Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CompressibleFlowSystem.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File CompressibleFlowSystem.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
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: Auxiliary functions for the compressible flow system
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_EQUATIONSYSTEMS_COMPRESSIBLEFLOWSYSTEM_H
37 #define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_EQUATIONSYSTEMS_COMPRESSIBLEFLOWSYSTEM_H
38 
44 #include <StdRegions/StdQuadExp.h>
45 #include <StdRegions/StdHexExp.h>
46 
47 namespace Nektar
48 {
49  /**
50  *
51  */
53  {
54  public:
55 
57 
58  /// Creates an instance of this class
61  {
63  AllocateSharedPtr(pSession);
64  }
65  /// Name of class
66  static std::string className;
67 
68  virtual ~CompressibleFlowSystem();
69 
70  /// Function to calculate the stability limit for DG/CG.
72 
73  /// Function to calculate the stability limit for DG/CG
74  /// (a vector of them).
76  const Array<OneD,int> &ExpOrder);
77 
78  protected:
93  std::string m_ViscosityType;
94  std::string m_shockCaptureType;
95  std::string m_EqTypeStr;
111 
112  // L2 error file
113  std::ofstream m_errFile;
114 
115  // Check for steady state at step interval
117 
118  // Tolerance to which steady state should be evaluated at
120 
121  // Forcing term
122  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
126 
127 
128  // Pressure storage for PressureOutflowFileBC
130 
131  // Field storage for PressureInflowFileBC
133 
134  // Storage for L2 norm error
136 
138  const LibUtilities::SessionReaderSharedPtr& pSession);
139 
140  virtual void v_InitObject();
141 
142  /// Print a summary of time stepping parameters.
144 
145  void GetFluxVector(
146  const Array<OneD, Array<OneD, NekDouble> > &physfield,
149  const Array<OneD, Array<OneD, NekDouble> > &physfield,
152  const Array<OneD, Array<OneD, NekDouble> > &physfield,
153  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &derivatives,
154  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &viscousTensor);
155  void GetFluxVectorPDESC(
156  const Array<OneD, Array<OneD, NekDouble> > &physfield,
159  const Array<OneD, Array<OneD, NekDouble> > &physfield,
160  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &derivatives,
161  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &viscousTensor);
162 
163  void SetCommonBC(const std::string &userDefStr,
164  const int n,
165  const NekDouble time,
166  int &cnt,
168  Array<OneD, Array<OneD, NekDouble> > &inarray);
169  void WallBC(
170  int bcRegion,
171  int cnt,
173  Array<OneD, Array<OneD, NekDouble> > &physarray);
174  void WallViscousBC(
175  int bcRegion,
176  int cnt,
178  Array<OneD, Array<OneD, NekDouble> > &physarray);
179  void SymmetryBC(
180  int bcRegion,
181  int cnt,
183  Array<OneD, Array<OneD, NekDouble> > &physarray);
184  void RiemannInvariantBC(
185  int bcRegion,
186  int cnt,
188  Array<OneD, Array<OneD, NekDouble> > &physarray);
190  int bcRegion,
191  int cnt,
193  Array<OneD, Array<OneD, NekDouble> > &physarray);
194  void PressureOutflowBC(
195  int bcRegion,
196  int cnt,
198  Array<OneD, Array<OneD, NekDouble> > &physarray);
200  int bcRegion,
201  int cnt,
203  Array<OneD, Array<OneD, NekDouble> > &physarray);
205  int bcRegion,
206  int cnt,
208  Array<OneD, Array<OneD, NekDouble> > &physarray);
209  void ExtrapOrder0BC(
210  int bcRegion,
211  int cnt,
213  Array<OneD, Array<OneD, NekDouble> > &physarray);
214  void GetVelocityVector(
215  const Array<OneD, Array<OneD, NekDouble> > &physfield,
216  Array<OneD, Array<OneD, NekDouble> > &velocity);
217  void GetSoundSpeed(
218  const Array<OneD, Array<OneD, NekDouble> > &physfield,
219  Array<OneD, NekDouble> &pressure,
220  Array<OneD, NekDouble> &soundspeed);
221  void GetMach(
222  Array<OneD, Array<OneD, NekDouble> > &physfield,
223  Array<OneD, NekDouble> &soundspeed,
224  Array<OneD, NekDouble> &mach);
225  void GetTemperature(
226  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
227  Array<OneD, NekDouble> &pressure,
228  Array<OneD, NekDouble> &temperature);
229  void GetPressure(
230  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
231  Array<OneD, NekDouble> &pressure);
232  void GetPressure(
233  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
234  const Array<OneD, const Array<OneD, NekDouble> > &velocity,
235  Array<OneD, NekDouble> &pressure);
236  void GetEnthalpy(
237  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
238  Array<OneD, NekDouble> &pressure,
239  Array<OneD, NekDouble> &enthalpy);
240  void GetEntropy(
241  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
242  const Array<OneD, const NekDouble> &pressure,
243  const Array<OneD, const NekDouble> &temperature,
244  Array<OneD, NekDouble> &entropy);
246  const Array<OneD, Array<OneD, NekDouble> > &physfield,
247  Array<OneD, NekDouble > &eps_bar);
248  void GetDynamicViscosity(
249  const Array<OneD, const NekDouble> &temperature,
251  void GetStdVelocity(
252  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
253  Array<OneD, NekDouble> &stdV);
254 
255  virtual bool v_PostIntegrate(int step);
256  bool CalcSteadyState(bool output);
257 
258  void GetSensor(
259  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
260  Array<OneD, NekDouble> &Sensor,
261  Array<OneD, NekDouble> &SensorKappa);
263  Array<OneD, Array<OneD, NekDouble> > &outarray,
265  void GetAbsoluteVelocity(
266  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
267  Array<OneD, NekDouble> &Vtot);
269  const Array<OneD, Array<OneD, NekDouble> > &physfield,
270  Array<OneD, NekDouble> &mu_var);
271  void SetVarPOrderElmt(
272  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
273  Array<OneD, NekDouble> &PolyOrder);
274  void GetForcingTerm(
275  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
276  Array<OneD, Array<OneD, NekDouble> > outarrayForcing);
277  virtual NekDouble v_GetTimeStep(
278  const Array<OneD, const Array<OneD, NekDouble> > &inarray);
279  virtual void v_SetInitialConditions(
280  NekDouble initialtime = 0.0,
281  bool dumpInitialConditions = true,
282  const int domain = 0);
283 
285  {
286  return m_gasConstant;
287  }
288 
290  {
291  return m_gamma;
292  }
293 
295  {
296  return m_vecLocs;
297  }
298 
300  {
301  return m_traceNormals;
302  }
303 
304  virtual void v_ExtraFldOutput(
305  std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
306  std::vector<std::string> &variables);
307  };
308 }
309 #endif
void GetMach(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &soundspeed, Array< OneD, NekDouble > &mach)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
Array< OneD, Array< OneD, NekDouble > > m_fieldStorage
virtual ~CompressibleFlowSystem()
Destructor for CompressibleFlowSystem class.
void GetSoundSpeed(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &soundspeed)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for compressible flow problems.
void GetViscousFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
void GetStdVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &stdV)
SolverUtils::RiemannSolverSharedPtr m_riemannSolverLDG
virtual bool v_PostIntegrate(int step)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:47
NekDouble GetStabilityLimit(int n)
Function to calculate the stability limit for DG/CG.
boost::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:158
void SymmetryBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Symmetry boundary conditions for compressible flow problems.
void RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Outflow characteristic boundary conditions for compressible flow problems.
boost::shared_ptr< StdHexExp > StdHexExpSharedPtr
Definition: StdHexExp.h:286
void GetTemperature(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &temperature)
void GetArtificialDynamicViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu_var)
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
Array< OneD, Array< OneD, NekDouble > > m_un
void GetViscousFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
boost::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
void PressureOutflowBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
void PressureOutflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
void PressureOutflowNonReflectiveBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow non-reflective boundary conditions for compressible flow problems.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void SetVarPOrderElmt(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &PolyOrder)
void GetVelocityVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
void WallViscousBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for viscous compressible flow problems.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
StdRegions::StdHexExpSharedPtr m_OrthoHexExp
void GetFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Return the flux vector for the compressible Euler equations by using the de-aliasing technique...
void GetEntropy(const Array< OneD, const Array< OneD, NekDouble > > &physfield, const Array< OneD, const NekDouble > &pressure, const Array< OneD, const NekDouble > &temperature, Array< OneD, NekDouble > &entropy)
Base class for unsteady solvers.
void PressureInflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure inflow boundary conditions for compressible flow problems where either the density and the v...
boost::shared_ptr< Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:164
void GetFluxVectorPDESC(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
double NekDouble
virtual void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
bool CalcSteadyState(bool output)
Array< OneD, NekDouble > m_pressureStorage
Array< OneD, NekDouble > GetStabilityLimitVector(const Array< OneD, int > &ExpOrder)
Function to calculate the stability limit for DG/CG (a vector of them).
void GetAbsoluteVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &Vtot)
SolverUtils::AdvectionSharedPtr m_advection
SolverUtils::DiffusionSharedPtr m_diffusion
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
void GetDynamicViscosity(const Array< OneD, const NekDouble > &temperature, Array< OneD, NekDouble > &mu)
virtual NekDouble v_GetTimeStep(const Array< OneD, const Array< OneD, NekDouble > > &inarray)
Return the timestep to be used for the next step in the time-marching loop.
void GetEnthalpy(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &enthalpy)
void GetSmoothArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &eps_bar)
void SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
boost::shared_ptr< StdQuadExp > StdQuadExpSharedPtr
Definition: StdQuadExp.h:262
void GetForcingTerm(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > outarrayForcing)
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure()
Get pressure field if available.
StdRegions::StdQuadExpSharedPtr m_OrthoQuadExp
void GetSensor(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, NekDouble > &Sensor, Array< OneD, NekDouble > &SensorKappa)
CompressibleFlowSystem(const LibUtilities::SessionReaderSharedPtr &pSession)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Return the flux vector for the compressible Euler equations.
void ExtrapOrder0BC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Extrapolation of order 0 for all the variables such that, at the boundaries, a trivial Riemann proble...
static std::string className
Name of class.
void GetElementDimensions(Array< OneD, Array< OneD, NekDouble > > &outarray, Array< OneD, NekDouble > &hmin)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing