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,
167  Array<OneD, Array<OneD, NekDouble> > &inarray);
168 
169  void WallBC(
170  int bcRegion,
171  int cnt,
172  Array<OneD, Array<OneD, NekDouble> > &physarray);
173  void WallViscousBC(
174  int bcRegion,
175  int cnt,
176  Array<OneD, Array<OneD, NekDouble> > &physarray);
177  void SymmetryBC(
178  int bcRegion,
179  int cnt,
180  Array<OneD, Array<OneD, NekDouble> > &physarray);
181  void RiemannInvariantBC(
182  int bcRegion,
183  int cnt,
184  Array<OneD, Array<OneD, NekDouble> > &physarray);
186  int bcRegion,
187  int cnt,
188  Array<OneD, Array<OneD, NekDouble> > &physarray);
189  void PressureOutflowBC(
190  int bcRegion,
191  int cnt,
192  Array<OneD, Array<OneD, NekDouble> > &physarray);
194  int bcRegion,
195  int cnt,
196  Array<OneD, Array<OneD, NekDouble> > &physarray);
198  int bcRegion,
199  int cnt,
200  Array<OneD, Array<OneD, NekDouble> > &physarray);
201  void ExtrapOrder0BC(
202  int bcRegion,
203  int cnt,
204  Array<OneD, Array<OneD, NekDouble> > &physarray);
205  void GetVelocityVector(
206  const Array<OneD, Array<OneD, NekDouble> > &physfield,
207  Array<OneD, Array<OneD, NekDouble> > &velocity);
208  void GetSoundSpeed(
209  const Array<OneD, Array<OneD, NekDouble> > &physfield,
210  Array<OneD, NekDouble> &pressure,
211  Array<OneD, NekDouble> &soundspeed);
212  void GetMach(
213  Array<OneD, Array<OneD, NekDouble> > &physfield,
214  Array<OneD, NekDouble> &soundspeed,
215  Array<OneD, NekDouble> &mach);
216  void GetTemperature(
217  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
218  Array<OneD, NekDouble> &pressure,
219  Array<OneD, NekDouble> &temperature);
220  void GetPressure(
221  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
222  Array<OneD, NekDouble> &pressure);
223  void GetPressure(
224  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
225  const Array<OneD, const Array<OneD, NekDouble> > &velocity,
226  Array<OneD, NekDouble> &pressure);
227  void GetEnthalpy(
228  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
229  Array<OneD, NekDouble> &pressure,
230  Array<OneD, NekDouble> &enthalpy);
231  void GetEntropy(
232  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
233  const Array<OneD, const NekDouble> &pressure,
234  const Array<OneD, const NekDouble> &temperature,
235  Array<OneD, NekDouble> &entropy);
237  const Array<OneD, Array<OneD, NekDouble> > &physfield,
238  Array<OneD, NekDouble > &eps_bar);
239  void GetDynamicViscosity(
240  const Array<OneD, const NekDouble> &temperature,
242  void GetStdVelocity(
243  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
244  Array<OneD, NekDouble> &stdV);
245 
246  virtual bool v_PostIntegrate(int step);
247  bool CalcSteadyState(bool output);
248 
249  void GetSensor(
250  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
251  Array<OneD, NekDouble> &Sensor,
252  Array<OneD, NekDouble> &SensorKappa);
254  Array<OneD, Array<OneD, NekDouble> > &outarray,
256  void GetAbsoluteVelocity(
257  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
258  Array<OneD, NekDouble> &Vtot);
260  const Array<OneD, Array<OneD, NekDouble> > &physfield,
261  Array<OneD, NekDouble> &mu_var);
262  void SetVarPOrderElmt(
263  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
264  Array<OneD, NekDouble> &PolyOrder);
265  void GetForcingTerm(
266  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
267  Array<OneD, Array<OneD, NekDouble> > outarrayForcing);
268  virtual NekDouble v_GetTimeStep(
269  const Array<OneD, const Array<OneD, NekDouble> > &inarray);
270  virtual void v_SetInitialConditions(
271  NekDouble initialtime = 0.0,
272  bool dumpInitialConditions = true,
273  const int domain = 0);
274 
276  {
277  return m_gasConstant;
278  }
279 
281  {
282  return m_gamma;
283  }
284 
286  {
287  return m_vecLocs;
288  }
289 
291  {
292  return m_traceNormals;
293  }
294 
295  virtual void v_ExtraFldOutput(
296  std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
297  std::vector<std::string> &variables);
298  };
299 }
300 #endif
void ExtrapOrder0BC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Extrapolation of order 0 for all the variables such that, at the boundaries, a trivial Riemann proble...
void GetMach(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &soundspeed, Array< OneD, NekDouble > &mach)
void RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Outflow characteristic boundary conditions for compressible flow problems.
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
Array< OneD, Array< OneD, NekDouble > > m_fieldStorage
void SymmetryBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Symmetry boundary conditions for compressible flow problems.
void PressureOutflowNonReflectiveBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow non-reflective boundary conditions for compressible flow problems.
virtual ~CompressibleFlowSystem()
Destructor for CompressibleFlowSystem class.
void GetSoundSpeed(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &soundspeed)
void PressureOutflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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
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.
void PressureOutflowBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
boost::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
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 SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
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 > > &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 WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for compressible flow problems.
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)
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.
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
void PressureInflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure inflow boundary conditions for compressible flow problems where either the density and the v...