GRINS-0.6.0
low_mach_navier_stokes_base.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_LOW_MACH_NAVIER_STOKES_BASE_H
27 #define GRINS_LOW_MACH_NAVIER_STOKES_BASE_H
28 
29 // GRINS
30 #include "grins/physics.h"
31 #include "grins/assembly_context.h"
32 #include "grins/grins_enums.h"
33 
34 //libMesh
35 #include "libmesh/enum_order.h"
36 #include "libmesh/enum_fe_family.h"
37 #include "libmesh/point.h"
38 
39 namespace GRINS
40 {
41 
43 
46  template<class Viscosity, class SpecificHeat, class ThermalConductivity>
48  {
49  public:
50 
51  LowMachNavierStokesBase(const PhysicsName& physics_name, const GetPot& input);
52 
54 
56  virtual void read_input_options( const GetPot& input );
57 
58  virtual void init_variables( libMesh::FEMSystem* system );
59 
61  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
62 
63  // Context initialization
64  virtual void init_context( AssemblyContext& context );
65 
66  libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const;
67 
68  libMesh::Real rho( libMesh::Real T, libMesh::Real p0 ) const;
69 
70  libMesh::Real d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const;
71 
72  libMesh::Real get_p0_steady( const AssemblyContext& c, unsigned int qp ) const;
73 
74  libMesh::Real get_p0_steady_side( const AssemblyContext& c, unsigned int qp ) const;
75 
76  libMesh::Real get_p0_steady( const AssemblyContext& c, const libMesh::Point& p ) const;
77 
78  libMesh::Real get_p0_transient( AssemblyContext& c, unsigned int qp ) const;
79 
80  // Registers all parameters in this physics and in its property
81  // classes
82  virtual void register_parameter
83  ( const std::string & param_name,
85  const;
86 
87  protected:
88 
90  libMesh::Number _p0_over_R;
91 
92  libMesh::Number _p0, _R, _T0;
93 
95  unsigned int _dim;
96 
98  VariableIndex _u_var; /* Index for x-velocity field */
99  VariableIndex _v_var; /* Index for y-velocity field */
100  VariableIndex _w_var; /* Index for z-velocity field */
101  VariableIndex _p_var; /* Index for pressure field */
102  VariableIndex _T_var; /* Index for pressure field */
103  VariableIndex _p0_var; /* Index for thermodynamic pressure */
104 
107 
109  GRINSEnums::FEFamily _V_FE_family, _P_FE_family, _T_FE_family;
110 
112  GRINSEnums::Order _V_order, _P_order, _T_order;
113 
115  Viscosity _mu;
116 
118  SpecificHeat _cp;
119 
121  ThermalConductivity _k;
122 
124  libMesh::Point _g;
125 
128 
129  private:
130 
132 
133  };
134 
135  template<class V, class SH, class TC>
136  inline
137  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::T( const libMesh::Point& p, const AssemblyContext& c ) const
138  {
139  return c.point_value(_T_var,p);
140  }
141 
142  template<class V, class SH, class TC>
143  inline
144  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::rho( libMesh::Real T, libMesh::Real p0 ) const
145  {
146  return p0/(this->_R*T);
147  }
148 
149  template<class V, class SH, class TC>
150  inline
151  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const
152  {
153  return -p0/(this->_R*(T*T));
154  }
155 
156  template<class V, class SH, class TC>
157  inline
159  unsigned int qp ) const
160  {
161  libMesh::Real p0;
162  if( this->_enable_thermo_press_calc )
163  {
164  p0 = c.interior_value( _p0_var, qp );
165  }
166  else
167  {
168  p0 = _p0;
169  }
170  return p0;
171  }
172 
173  template<class V, class SH, class TC>
174  inline
176  unsigned int qp ) const
177  {
178  libMesh::Real p0;
179  if( this->_enable_thermo_press_calc )
180  {
181  p0 = c.side_value( _p0_var, qp );
182  }
183  else
184  {
185  p0 = _p0;
186  }
187  return p0;
188  }
189 
190  template<class V, class SH, class TC>
191  inline
193  const libMesh::Point& p ) const
194  {
195  libMesh::Real p0;
196  if( this->_enable_thermo_press_calc )
197  {
198  p0 = c.point_value( _p0_var, p );
199  }
200  else
201  {
202  p0 = _p0;
203  }
204  return p0;
205  }
206 
207  template<class V, class SH, class TC>
208  inline
209  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::get_p0_transient( AssemblyContext& c, unsigned int qp ) const
210  {
211  libMesh::Real p0;
212  if( this->_enable_thermo_press_calc )
213  {
214  p0 = c.fixed_interior_value( _p0_var, qp );
215  }
216  else
217  {
218  p0 = _p0;
219  }
220  return p0;
221  }
222 
223 } // namespace GRINS
224 
225 #endif // GRINS_LOW_MACH_NAVIER_STOKES_BASE_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:40
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.
GRINSEnums::FEFamily _V_FE_family
Element type, read from input.
libMesh::Number _p0_over_R
Thermodynamic pressure divided by gas constant.
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
VariableIndex _u_var
Indices for each (owned) variable;.
libMesh::Real get_p0_steady_side(const AssemblyContext &c, unsigned int qp) const
bool _enable_thermo_press_calc
Flag to enable thermodynamic pressure calculation.
libMesh::Real get_p0_steady(const AssemblyContext &c, unsigned int qp) const
virtual void init_variables(libMesh::FEMSystem *system)
Initialize variables for this physics.
unsigned int _dim
Physical dimension of problem.
SpecificHeat _cp
Specific heat object.
GRINS namespace.
ThermalConductivity _k
Thermal conductivity object.
libMesh::Real T(const libMesh::Point &p, const AssemblyContext &c) const
libMesh::Point _g
Gravity vector.
std::string _u_var_name
Names of each (owned) variable in the system.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
GRINSEnums::Order _V_order
Element orders, read from input.
std::string PhysicsName
libMesh::Real d_rho_dT(libMesh::Real T, libMesh::Real p0) const
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
libMesh::Real get_p0_transient(AssemblyContext &c, unsigned int qp) const
Physics class for Incompressible Navier-Stokes.
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
libMesh::Real rho(libMesh::Real T, libMesh::Real p0) const

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1