GRINS-0.7.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-2016 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"
37 
38 //libMesh
39 #include "libmesh/enum_order.h"
40 #include "libmesh/enum_fe_family.h"
41 #include "libmesh/point.h"
42 
43 namespace GRINS
44 {
45 
47 
50  template<class Viscosity, class SpecificHeat, class ThermalConductivity>
52  {
53  public:
54 
55  LowMachNavierStokesBase(const PhysicsName& physics_name, const std::string& core_physics_name, const GetPot& input);
56 
58 
59  virtual void init_variables( libMesh::FEMSystem* system );
60 
62  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
63 
64  // Context initialization
65  virtual void init_context( AssemblyContext& context );
66 
67  libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const;
68 
69  libMesh::Real rho( libMesh::Real T, libMesh::Real p0 ) const;
70 
71  libMesh::Real d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const;
72 
73  libMesh::Real get_p0_steady( const AssemblyContext& c, unsigned int qp ) const;
74 
75  libMesh::Real get_p0_steady_side( const AssemblyContext& c, unsigned int qp ) const;
76 
77  libMesh::Real get_p0_steady( const AssemblyContext& c, const libMesh::Point& p ) const;
78 
79  libMesh::Real get_p0_transient( AssemblyContext& c, unsigned int qp ) const;
80 
81  // Registers all parameters in this physics and in its property
82  // classes
83  virtual void register_parameter
84  ( const std::string & param_name,
86  const;
87 
88  protected:
89 
91  libMesh::Number _p0_over_R;
92 
93  libMesh::Number _p0, _R, _T0;
94 
96  unsigned int _dim;
97 
101 
102  libMesh::UniquePtr<ThermoPressureFEVariable> _p0_var;
103 
105  Viscosity _mu;
106 
108  SpecificHeat _cp;
109 
111  ThermalConductivity _k;
112 
114  libMesh::Point _g;
115 
118 
119  private:
120 
122 
124  void read_input_options( const GetPot& input );
125 
126  void register_variables();
127 
128  };
129 
130  template<class V, class SH, class TC>
131  inline
132  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::T( const libMesh::Point& p, const AssemblyContext& c ) const
133  {
134  return c.point_value(_temp_vars.T(),p);
135  }
136 
137  template<class V, class SH, class TC>
138  inline
139  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::rho( libMesh::Real T, libMesh::Real p0 ) const
140  {
141  return p0/(this->_R*T);
142  }
143 
144  template<class V, class SH, class TC>
145  inline
146  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const
147  {
148  return -p0/(this->_R*(T*T));
149  }
150 
151  template<class V, class SH, class TC>
152  inline
154  unsigned int qp ) const
155  {
156  libMesh::Real p0;
157  if( this->_enable_thermo_press_calc )
158  {
159  p0 = c.interior_value( _p0_var->p0(), qp );
160  }
161  else
162  {
163  p0 = _p0;
164  }
165  return p0;
166  }
167 
168  template<class V, class SH, class TC>
169  inline
171  unsigned int qp ) const
172  {
173  libMesh::Real p0;
174  if( this->_enable_thermo_press_calc )
175  {
176  p0 = c.side_value( _p0_var->p0(), qp );
177  }
178  else
179  {
180  p0 = _p0;
181  }
182  return p0;
183  }
184 
185  template<class V, class SH, class TC>
186  inline
188  const libMesh::Point& p ) const
189  {
190  libMesh::Real p0;
191  if( this->_enable_thermo_press_calc )
192  {
193  p0 = c.point_value( _p0_var->p0(), p );
194  }
195  else
196  {
197  p0 = _p0;
198  }
199  return p0;
200  }
201 
202  template<class V, class SH, class TC>
203  inline
204  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::get_p0_transient( AssemblyContext& c, unsigned int qp ) const
205  {
206  libMesh::Real p0;
207  if( this->_enable_thermo_press_calc )
208  {
209  p0 = c.fixed_interior_value( _p0_var->p0(), qp );
210  }
211  else
212  {
213  p0 = _p0;
214  }
215  return p0;
216  }
217 
218 } // namespace GRINS
219 
220 #endif // GRINS_LOW_MACH_NAVIER_STOKES_BASE_H
void read_input_options(const GetPot &input)
Read options from GetPot input file.
libMesh::UniquePtr< ThermoPressureFEVariable > _p0_var
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:107
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.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
std::string PhysicsName
libMesh::Real d_rho_dT(libMesh::Real T, libMesh::Real p0) const
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.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
libMesh::Real rho(libMesh::Real T, libMesh::Real p0) const

Generated on Thu Jun 2 2016 21:52:27 for GRINS-0.7.0 by  doxygen 1.8.10