Nektar++
Loading...
Searching...
No Matches
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
51
52using namespace Nektar::SolverUtils;
53
54namespace Nektar
55{
56
58{
59public:
60 friend class MemoryManager<AcousticSystem>;
61
62protected:
63 /// indices of the fields
65 /// we are dealing with a conservative formualtion
69 std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
74 std::vector<std::string> m_bfNames;
75
76 /// Initialises UnsteadySystem class members.
79
80 ~AcousticSystem() override = default;
81
82 void v_InitObject(bool DeclareFields = true) override;
83
84 void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
86 const NekDouble time);
87
88 void DoOdeProjection(
89 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
90 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
91
92 virtual void v_AddLinTerm(
93 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
94 Array<OneD, Array<OneD, NekDouble>> &outarray) = 0;
95
96 virtual void v_GetFluxVector(
97 const Array<OneD, Array<OneD, NekDouble>> &physfield,
99
101 int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble>> &Fwd,
103 Array<OneD, Array<OneD, NekDouble>> &physarray) = 0;
104
105 bool v_PreIntegrate(int step) override;
106
107 void v_Output() override;
108
110 const NekDouble SpeedSoundFactor) override;
111
112 void v_ExtraFldOutput(std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
113 std::vector<std::string> &variables) override;
114
119
124
129
130private:
131 std::map<int, std::mt19937> m_rng;
134
136
138 NekDouble time);
139
140 void WallBC(int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble>> &Fwd,
141 Array<OneD, Array<OneD, NekDouble>> &physarray);
142
143 void WhiteNoiseBC(int bcRegion, int cnt,
146 Array<OneD, Array<OneD, NekDouble>> &physarray);
147
150
152};
153
154} // namespace Nektar
155
156#endif
SolverUtils::CouplingSharedPtr m_coupling
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the right-hand side.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
std::map< int, std::mt19937 > m_rng
Array< OneD, NekDouble > v_GetMaxStdVelocity(const NekDouble SpeedSoundFactor) override
Compute the advection velocity in the standard space for each element of the expansion.
std::vector< std::string > m_bfNames
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
NekDouble GetCFLEstimate()
void CopyBoundaryTrace(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
bool m_conservative
we are dealing with a conservative formualtion
void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables) override
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::AdvectionSharedPtr m_advection
void WhiteNoiseBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &BfFwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for the AcousticSystem equations.
int m_ip
indices of the fields
virtual void v_GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)=0
Array< OneD, Array< OneD, NekDouble > > m_bfFwdBwd
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection and call the method for imposing the boundary conditions in case of discontinu...
Array< OneD, Array< OneD, NekDouble > > m_bf
void v_InitObject(bool DeclareFields=true) override
Initialization object for the AcousticSystem class.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
~AcousticSystem() override=default
const Array< OneD, const Array< OneD, NekDouble > > & GetBasefieldFwdBwd()
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
virtual void v_AddLinTerm(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
NekDouble m_whiteNoiseBC_lastUpdate
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
Apply the Boundary Conditions to the AcousticSystem equations.
bool v_PreIntegrate(int step) override
v_PreIntegrate
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.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
Wall boundary conditions for compressible flow problems.
Definition WallBC.h:47
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:54
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224