GRINS-0.8.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-2017 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"
34 
35 #include "grins/single_variable.h"
36 
37 //libMesh
38 #include "libmesh/enum_order.h"
39 #include "libmesh/enum_fe_family.h"
40 #include "libmesh/point.h"
41 
42 namespace GRINS
43 {
44 
46 
49  template<class Viscosity, class SpecificHeat, class ThermalConductivity>
51  {
52  public:
53 
54  LowMachNavierStokesBase(const PhysicsName& physics_name, const std::string& core_physics_name, const GetPot& input);
55 
57 
59  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
60 
61  // Context initialization
62  virtual void init_context( AssemblyContext& context );
63 
64  libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const;
65 
66  libMesh::Real rho( libMesh::Real T, libMesh::Real p0 ) const;
67 
68  libMesh::Real d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const;
69 
70  libMesh::Real get_p0_steady( const AssemblyContext& c, unsigned int qp ) const;
71 
72  libMesh::Real get_p0_steady_side( const AssemblyContext& c, unsigned int qp ) const;
73 
74  libMesh::Real get_p0_steady( const AssemblyContext& c, const libMesh::Point& p ) const;
75 
76  libMesh::Real get_p0_transient( AssemblyContext& c, unsigned int qp ) const;
77 
78  // Registers all parameters in this physics and in its property
79  // classes
80  virtual void register_parameter
81  ( const std::string & param_name,
83  const;
84 
85  protected:
86 
88  libMesh::Number _p0_over_R;
89 
90  libMesh::Number _p0, _R, _T0;
91 
95 
99 
101  Viscosity _mu;
102 
104  SpecificHeat _cp;
105 
107  ThermalConductivity _k;
108 
110  libMesh::Point _g;
111 
114 
115  private:
116 
118 
120  void read_input_options( const GetPot& input );
121  };
122 
123  template<class V, class SH, class TC>
124  inline
125  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::T( const libMesh::Point& p, const AssemblyContext& c ) const
126  {
127  return c.point_value(_temp_vars.T(),p);
128  }
129 
130  template<class V, class SH, class TC>
131  inline
132  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::rho( libMesh::Real T, libMesh::Real p0 ) const
133  {
134  return p0/(this->_R*T);
135  }
136 
137  template<class V, class SH, class TC>
138  inline
139  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::d_rho_dT( libMesh::Real T, libMesh::Real p0 ) const
140  {
141  return -p0/(this->_R*(T*T));
142  }
143 
144  template<class V, class SH, class TC>
145  inline
147  unsigned int qp ) const
148  {
149  libMesh::Real p0;
150  if( this->_enable_thermo_press_calc )
151  {
152  p0 = c.interior_value( _p0_var->p0(), qp );
153  }
154  else
155  {
156  p0 = _p0;
157  }
158  return p0;
159  }
160 
161  template<class V, class SH, class TC>
162  inline
164  unsigned int qp ) const
165  {
166  libMesh::Real p0;
167  if( this->_enable_thermo_press_calc )
168  {
169  p0 = c.side_value( _p0_var->p0(), qp );
170  }
171  else
172  {
173  p0 = _p0;
174  }
175  return p0;
176  }
177 
178  template<class V, class SH, class TC>
179  inline
181  const libMesh::Point& p ) const
182  {
183  libMesh::Real p0;
184  if( this->_enable_thermo_press_calc )
185  {
186  p0 = c.point_value( _p0_var->p0(), p );
187  }
188  else
189  {
190  p0 = _p0;
191  }
192  return p0;
193  }
194 
195  template<class V, class SH, class TC>
196  inline
197  libMesh::Real LowMachNavierStokesBase<V,SH,TC>::get_p0_transient( AssemblyContext& c, unsigned int qp ) const
198  {
199  libMesh::Real p0;
200  if( this->_enable_thermo_press_calc )
201  {
202  p0 = c.fixed_interior_value( _p0_var->p0(), qp );
203  }
204  else
205  {
206  p0 = _p0;
207  }
208  return p0;
209  }
210 
211 } // namespace GRINS
212 
213 #endif // GRINS_LOW_MACH_NAVIER_STOKES_BASE_H
void read_input_options(const GetPot &input)
Read options from GetPot input file.
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
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
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 Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1