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 
43 #include <StdRegions/StdQuadExp.h>
44 #include <StdRegions/StdHexExp.h>
45 
46 
47 #define EPSILON 0.000001
48 
49 #define CROSS(dest, v1, v2){ \
50  dest[0] = v1[1] * v2[2] - v1[2] * v2[1]; \
51  dest[1] = v1[2] * v2[0] - v1[0] * v2[2]; \
52  dest[2] = v1[0] * v2[1] - v1[1] * v2[0];}
53 
54 #define DOT(v1, v2) (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2])
55 
56 #define SUB(dest, v1, v2){ \
57  dest[0] = v1[0] - v2[0]; \
58  dest[1] = v1[1] - v2[1]; \
59  dest[2] = v1[2] - v2[2];}
60 
61 namespace Nektar
62 {
63  /**
64  *
65  */
67  {
68  public:
69 
71 
72  /// Creates an instance of this class
75  {
77  }
78  /// Name of class
79  static std::string className;
80 
81  virtual ~CompressibleFlowSystem();
82 
83  /// Function to calculate the stability limit for DG/CG.
85 
86  /// Function to calculate the stability limit for DG/CG
87  /// (a vector of them).
88  Array<OneD, NekDouble> GetStabilityLimitVector(
89  const Array<OneD,int> &ExpOrder);
90 
91  protected:
96  Array<OneD, Array<OneD, NekDouble> >m_vecLocs;
105  std::string m_ViscosityType;
106  std::string m_shockCaptureType;
107  std::string m_EqTypeStr;
124 
126  const LibUtilities::SessionReaderSharedPtr& pSession);
127 
128  virtual void v_InitObject();
129 
130  /// Print a summary of time stepping parameters.
132 
133  void GetFluxVector(
134  const Array<OneD, Array<OneD, NekDouble> > &physfield,
135  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &flux);
137  const Array<OneD, Array<OneD, NekDouble> > &physfield,
138  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &flux);
140  const Array<OneD, Array<OneD, NekDouble> > &physfield,
141  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &derivatives,
142  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &viscousTensor);
143  void GetFluxVectorPDESC(
144  const Array<OneD, Array<OneD, NekDouble> > &physfield,
145  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &flux);
147  const Array<OneD, Array<OneD, NekDouble> > &physfield,
148  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &derivatives,
149  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &viscousTensor);
150  void WallBC(
151  int bcRegion,
152  int cnt,
153  Array<OneD, Array<OneD, NekDouble> > &physarray);
154  void WallViscousBC(
155  int bcRegion,
156  int cnt,
157  Array<OneD, Array<OneD, NekDouble> > &physarray);
158  void SymmetryBC(
159  int bcRegion,
160  int cnt,
161  Array<OneD, Array<OneD, NekDouble> > &physarray);
162  void RiemannInvariantBC(
163  int bcRegion,
164  int cnt,
165  Array<OneD, Array<OneD, NekDouble> > &physarray);
166  void ExtrapOrder0BC(
167  int bcRegion,
168  int cnt,
169  Array<OneD, Array<OneD, NekDouble> > &physarray);
170  void GetVelocityVector(
171  const Array<OneD, Array<OneD, NekDouble> >&physfield,
172  Array<OneD, Array<OneD, NekDouble> >&velocity);
173  void GetSoundSpeed(
174  const Array<OneD, Array<OneD, NekDouble> >&physfield,
175  Array<OneD, NekDouble> &pressure,
176  Array<OneD, NekDouble> &soundspeed);
177  void GetMach(
178  Array<OneD, Array<OneD, NekDouble> >&physfield,
179  Array<OneD, NekDouble> &soundspeed,
180  Array<OneD, NekDouble> &mach);
181  void GetTemperature(
182  const Array<OneD, const Array<OneD, NekDouble> >&physfield,
183  Array<OneD, NekDouble> &pressure,
184  Array<OneD, NekDouble> &temperature);
185  void GetPressure(
186  const Array<OneD, const Array<OneD, NekDouble> >&physfield,
187  Array<OneD, NekDouble> &pressure);
188  void GetPressure(
189  const Array<OneD, const Array<OneD, NekDouble> >&physfield,
190  const Array<OneD, const Array<OneD, NekDouble> >&velocity,
191  Array<OneD, NekDouble> &pressure);
192  void GetEnthalpy(
193  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
194  Array<OneD, NekDouble> &pressure,
195  Array<OneD, NekDouble> &enthalpy);
196  void GetEntropy(
197  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
198  const Array<OneD, const NekDouble> &pressure,
199  const Array<OneD, const NekDouble> &temperature,
200  Array<OneD, NekDouble> &entropy);
202  const Array<OneD, Array<OneD, NekDouble> > &physfield,
203  Array<OneD, NekDouble > &eps_bar);
204  void GetDynamicViscosity(
205  const Array<OneD, const NekDouble> &temperature,
206  Array<OneD, NekDouble >&mu);
207  void GetStdVelocity(
208  const Array<OneD, const Array<OneD, NekDouble> >&inarray,
209  Array<OneD, NekDouble> &stdV);
210  void GetSensor(
211  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
212  Array<OneD, NekDouble> &Sensor,
213  Array<OneD, NekDouble> &SensorKappa);
215  Array<OneD, Array<OneD, NekDouble> > &outarray,
216  Array<OneD, NekDouble > &hmin);
217  void GetAbsoluteVelocity(
218  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
219  Array<OneD, NekDouble> &Vtot);
221  const Array<OneD, Array<OneD, NekDouble> > &physfield,
222  Array<OneD, NekDouble > &mu_var);
223  void SetVarPOrderElmt(
224  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
225  Array<OneD, NekDouble > &PolyOrder);
226  void GetForcingTerm(
227  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
228  Array<OneD, Array<OneD, NekDouble> > outarrayForcing);
229  virtual NekDouble v_GetTimeStep(
230  const Array<OneD, const Array<OneD, NekDouble> > &inarray);
232  NekDouble initialtime = 0.0,
233  bool dumpInitialConditions = true,
234  const int domain = 0)
235  {
236  }
237 
239  {
240  return m_gasConstant;
241  }
242 
244  {
245  return m_gamma;
246  }
247 
248  const Array<OneD, const Array<OneD, NekDouble> > &GetVecLocs()
249  {
250  return m_vecLocs;
251  }
252 
253  const Array<OneD, const Array<OneD, NekDouble> > &GetNormals()
254  {
255  return m_traceNormals;
256  }
257 
258  virtual void v_ExtraFldOutput(
259  std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
260  std::vector<std::string> &variables);
261  };
262 }
263 #endif