Nektar++
AcousticSystem.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File AcousticSystem.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2018 Kilian Lackhove
10 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11 // Department of Aeronautics, Imperial College London (UK), and Scientific
12 // Computing and Imaging Institute, University of Utah (USA).
13 //
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: AcousticSystem base class
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_ACOUSTICSOLVER_EQUATIONSYSTEMS_ACOUSTICSYSTEM_H
37 #define NEKTAR_SOLVERS_ACOUSTICSOLVER_EQUATIONSYSTEMS_ACOUSTICSYSTEM_H
38 
39 // Define variable to avoid deprecated warning in Boost 1.69.
40 #include <boost/version.hpp>
41 #if BOOST_VERSION >= 106900 && BOOST_VERSION < 107000
42 #define BOOST_ALLOW_DEPRECATED_HEADERS
43 #endif
44 
45 #include <boost/core/ignore_unused.hpp>
46 #include <boost/random/mersenne_twister.hpp>
47 
54 
55 using namespace Nektar::SolverUtils;
56 
57 namespace Nektar
58 {
59 
61 {
62 public:
63  friend class MemoryManager<AcousticSystem>;
64 
65  /// Destructor
66  virtual ~AcousticSystem();
67 
68 protected:
69  /// indices of the fields
70  int m_ip, m_irho, m_iu;
71  /// we are dealing with a conservative formualtion
75  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
80  std::vector<std::string> m_bfNames;
81 
82  /// Initialises UnsteadySystem class members.
85 
86  virtual void v_InitObject();
87 
88  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
89  Array<OneD, Array<OneD, NekDouble>> &outarray,
90  const NekDouble time);
91 
92  void DoOdeProjection(
93  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
94  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
95 
96  virtual void v_GetFluxVector(
97  const Array<OneD, Array<OneD, NekDouble>> &physfield,
99 
100  virtual void v_AddLinTerm(
101  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
102  Array<OneD, Array<OneD, NekDouble>> &outarray)
103  {
104  boost::ignore_unused(inarray, outarray);
105  }
106 
107  virtual bool v_PreIntegrate(int step);
108 
109  virtual void v_Output();
110 
111  virtual Array<OneD, NekDouble> v_GetMaxStdVelocity(
112  const NekDouble SpeedSoundFactor);
113 
114  virtual void v_ExtraFldOutput(
115  std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
116  std::vector<std::string> &variables);
117 
118  const Array<OneD, const Array<OneD, NekDouble>> &GetNormals();
119 
120  const Array<OneD, const Array<OneD, NekDouble>> &GetVecLocs();
121 
122  const Array<OneD, const Array<OneD, NekDouble>> &GetBasefieldFwdBwd();
123 
124 private:
125  std::map<int, boost::mt19937> m_rng;
128 
130 
131  void SetBoundaryConditions(Array<OneD, Array<OneD, NekDouble>> &physarray,
132  NekDouble time);
133 
134  virtual void v_WallBC(int bcRegion, int cnt,
136  Array<OneD, Array<OneD, NekDouble>> &physarray);
137 
138  virtual void v_RiemannInvariantBC(
139  int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble>> &Fwd,
141  Array<OneD, Array<OneD, NekDouble>> &physarray) = 0;
142 
143  virtual void v_WhiteNoiseBC(int bcRegion, int cnt,
146  Array<OneD, Array<OneD, NekDouble>> &physarray);
147 
148  void CopyBoundaryTrace(const Array<OneD, NekDouble> &Fwd,
150 
151  void UpdateBasefieldFwdBwd();
152 };
153 } // namespace Nektar
154 
155 #endif
SolverUtils::CouplingSharedPtr m_coupling
virtual void v_GetFluxVector(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)=0
std::vector< std::string > m_bfNames
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
NekDouble GetCFLEstimate()
bool m_conservative
we are dealing with a conservative formualtion
SolverUtils::AdvectionSharedPtr m_advection
int m_ip
indices of the fields
virtual void v_AddLinTerm(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
std::map< int, boost::mt19937 > m_rng
Array< OneD, Array< OneD, NekDouble > > m_bfFwdBwd
Array< OneD, Array< OneD, NekDouble > > m_bf
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
virtual void v_RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble >> &Fwd, Array< OneD, Array< OneD, NekDouble >> &BfFwd, Array< OneD, Array< OneD, NekDouble >> &physarray)=0
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
NekDouble m_whiteNoiseBC_lastUpdate
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
A base class for PDEs which include an advection component.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Coupling > CouplingSharedPtr
Definition: Coupling.h:45
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:291
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble