Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticModel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2014> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 #ifndef __TYACOUSTICMODEL_9613__
17 #define __TYACOUSTICMODEL_9613__
18 
19 #include "Tympan/core/interfaces.h"
23 #include <gtest/gtest_prod.h>
24 
25 class TYTrajet;
26 class TYSolver;
27 
33 {
34 public:
35  TYAcousticModel(TYSolver& solver); //<! Constructor
36  virtual ~TYAcousticModel(); //<! Destructor
37 
46  virtual void compute(const std::deque<TYSIntersection>& tabIntersect, TYTrajet& trajet,
47  TabPoint3D& ptsTop, TabPoint3D& ptsLeft, TabPoint3D& ptsRight);
48 
50  void init();
51 
67  virtual bool computeCheminsAvecEcran(const OSegment3D& rayon, const tympan::AcousticSource& source,
68  const TabPoint3D& pts, const bool vertical, TYTabChemin& TabChemins,
69  double distance, const bool left) const;
70 
80  void computeCheminReflexion(const std::deque<TYSIntersection>& tabIntersect, const OSegment3D& ray,
81  const tympan::AcousticSource& source, TYTabChemin& TabChemins,
82  double distance) const;
83 
95  void computeCheminSansEcran(const std::deque<TYSIntersection>& tabIntersect, const OSegment3D& rayon,
96  const tympan::AcousticSource& source, TYTabChemin& TabChemins,
97  double distance, bool conditionFav = false) const;
98 
109  void computeCheminAPlat(const OSegment3D& rayon, const tympan::AcousticSource& source,
110  TYTabChemin& TabChemins, double distance) const;
111 
118  OSpectreOctave calculC3(const double& epaisseur) const;
119 
133  OSpectreOctave calculAttDiffraction(const OSegment3D& ray, const double& re, const double& dss,
134  const double& dsr, const double& width, const bool& vertical) const;
135 
142 
155  bool addStep(const OPoint3D& ptStart, const OPoint3D& ptEnd, const tympan::AcousticSource& source,
156  const bool& fromSource, TYTabEtape& Etapes) const;
157 
173  bool getGroundfactors(const std::deque<TYSIntersection>& tabIntersect, const OSegment3D& ray2D, double hs,
174  double hr, double& Gs, double& Gm, double& Gr) const;
175 
193  bool getGroundfactors(const std::deque<TYSIntersection>& tabIntersectUpSegment,
194  const std::deque<TYSIntersection>& tabIntersectDownSegment, const OSegment3D& SO2D,
195  const OSegment3D& OR2D, double hs, double hr, double& Gs, double& Gm,
196  double& Gr) const;
197 
198  /*
199  * @brief Compute effective barrier attenuation implementing recommandation paragraph 5.6
200  * of ISO TR 17534-3
201  * @param [in] Abar_top Barrier attenuation for the vertical path.
202  * @param [in] Abar_left Barrier attenuation for the left lateral path.
203  * @param [in] Abar_right Barrier attenuation for the right lateral path.
204  *
205  */
207  const OSpectreOctave& Abar_left,
208  const OSpectreOctave& Abar_right);
209 
210  /*
211  * @brief Compute mean slope plan - Kept for ISO 9613-2 ground effect alternative method.
212  *
213  * @param penteMoyenne Mean slope used to compute the plan corresponding to this slope.
214  *
215  * @return OPlan The computed mean slope plan.
216  */
217  OPlan buildMeanSlopePlan(const OSegment3D& penteMoyenne) const;
218 
223  bool solve(TYTrajet& trajet);
224 
225 private:
232  OSpectreOctave getReflexionSpectrumAt(const OSegment3D& incident, double length,
233  const OSegment3D& segPente,
234  const tympan::AcousticSource& source) const;
235 
239  void meanSlope(const OSegment3D& director, OSegment3D& slope) const;
240 
248  bool computeSegmentEdgesHeights(double& hauteurA, double& hauteurB, const OSegment3D& meanSlope,
249  const OSegment3D& ray) const;
250 
259  bool computeGZone(const OPoint3D& ptDebut, const OPoint3D& ptFin, double& GZone, double& dpZone,
260  const std::deque<TYSIntersection>& tabIntersect) const;
261 
262 private:
263  bool _useSol;
266  bool _useAtmo;
268  double _paramH;
269 
270  std::unique_ptr<AtmosphericConditions> pSolverAtmos;
271 
274 
277 };
278 
279 #endif // __TYACOUSTICMODEL_9613__
std::vector< OPoint3D > TabPoint3D
Definition: 3d.h:483
Representation of one of the most optimal path between source and receptor: S—>R.
std::deque< TYChemin > TYTabChemin
TYChemin collection.
Definition: TYChemin.h:255
std::deque< TYEtape > TYTabEtape
TYEtape collection.
Definition: TYEtape.h:193
Interface class for acoustic models.
Definition: interfaces.h:48
Plan defined by its equation : ax+by+cz+d=0.
Definition: plan.h:31
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1089
Acoustic model for the default solver.
OSpectreOctave limAttDiffraction(const OSpectreOctave &sNC, const OSpectreOctave &C) const
Limit the screen attenuation value with a frequency dependent criteria.
std::unique_ptr< AtmosphericConditions > pSolverAtmos
void computeCheminSansEcran(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance, bool conditionFav=false) const
Compute the main path between source and receptor. In 9613 solver, this path includes all attenuation...
bool computeSegmentEdgesHeights(double &hauteurA, double &hauteurB, const OSegment3D &meanSlope, const OSegment3D &ray) const
Compute heights relative to real ground, of the edges of a segment.
TYSolver & _solver
Reference to the solver.
void init()
Initialize the acoustic model.
void computeCheminAPlat(const OSegment3D &rayon, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance) const
Compute the list of paths for a perfectly flat and reflective ground.
OSpectreOctave calculAttDiffraction(const OSegment3D &ray, const double &re, const double &dss, const double &dsr, const double &width, const bool &vertical) const
Compute the attenuation from the diffraction on the screen.
TYAcousticModel(TYSolver &solver)
OSpectreOctave computeEffectiveBarAttenuation(const OSpectreOctave &Abar_top, const OSpectreOctave &Abar_left, const OSpectreOctave &Abar_right)
OSpectreOctave getReflexionSpectrumAt(const OSegment3D &incident, double length, const OSegment3D &segPente, const tympan::AcousticSource &source) const
Find Reflexion spectrum at point defined by the end of an incident segment.
OSpectreOctave calculC3(const double &epaisseur) const
Compute the spectrum of the C3 factor used in the diffraction calculation.
void meanSlope(const OSegment3D &director, OSegment3D &slope) const
Create a segment corresponding to the projection of "director" segment on the ground.
bool computeGZone(const OPoint3D &ptDebut, const OPoint3D &ptFin, double &GZone, double &dpZone, const std::deque< TYSIntersection > &tabIntersect) const
Compute GZone and dpZone for the segment between ptDebut and ptFin.
virtual ~TYAcousticModel()
bool solve(TYTrajet &trajet)
Compute the source contributions to the receptor point.
virtual void compute(const std::deque< TYSIntersection > &tabIntersect, TYTrajet &trajet, TabPoint3D &ptsTop, TabPoint3D &ptsLeft, TabPoint3D &ptsRight)
Main entry point, trigger acoustic computations.
OPlan buildMeanSlopePlan(const OSegment3D &penteMoyenne) const
void computeCheminReflexion(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &ray, const tympan::AcousticSource &source, TYTabChemin &TabChemins, double distance) const
Compute the list of path generated by reflection on the vertical walls.
OSpectreOctave _absoNulle
OSpectreOctave _lambda
virtual bool computeCheminsAvecEcran(const OSegment3D &rayon, const tympan::AcousticSource &source, const TabPoint3D &pts, const bool vertical, TYTabChemin &TabChemins, double distance, const bool left) const
Compute barrier attenuation effect on the direct path for the considered geometrical path (top,...
bool getGroundfactors(const std::deque< TYSIntersection > &tabIntersect, const OSegment3D &ray2D, double hs, double hr, double &Gs, double &Gm, double &Gr) const
Get ground factors for source, middle and receptor zones.
bool addStep(const OPoint3D &ptStart, const OPoint3D &ptEnd, const tympan::AcousticSource &source, const bool &fromSource, TYTabEtape &Etapes) const
Compute the different steps from a point to another via a reflection and a direct view.
9613 Solver
Definition: TYSolver.h:38
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Definition: TYTrajet.h:35
Describes an acoustic source.
Definition: entities.hpp:366