GRINS-0.8.0
reacting_low_mach_navier_stokes_abstract.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_REACTING_LOW_MACH_NAVIER_STOKES_ABSTRACT_H
27 #define GRINS_REACTING_LOW_MACH_NAVIER_STOKES_ABSTRACT_H
28 
29 // GRINS
30 #include "grins_config.h"
31 #include "grins/grins_enums.h"
32 #include "grins/physics.h"
33 #include "grins/pressure_pinning.h"
34 #include "grins/assembly_context.h"
36 
37 #include "grins/single_variable.h"
39 
40 namespace GRINS
41 {
43  {
44  public:
45 
46  ReactingLowMachNavierStokesAbstract(const PhysicsName& physics_name, const GetPot& input);
47 
49 
51  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
52 
53  // Context initialization
54  virtual void init_context( AssemblyContext& context );
55 
56  unsigned int n_species() const;
57 
58  libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const;
59 
60  void mass_fractions( const libMesh::Point& p, const AssemblyContext& c,
61  std::vector<libMesh::Real>& mass_fracs ) const;
62 
63  libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const;
64 
65  libMesh::Real get_p0_steady( const AssemblyContext& c, unsigned int qp ) const;
66 
67  libMesh::Real get_p0_steady_side( const AssemblyContext& c, unsigned int qp ) const;
68 
69  libMesh::Real get_p0_steady( const AssemblyContext& c, const libMesh::Point& p ) const;
70 
71  libMesh::Real get_p0_transient( const AssemblyContext& c, unsigned int qp ) const;
72 
73  protected:
74 
75  libMesh::Number _p0;
76 
80 
82 
86 
88  unsigned int _n_species;
89 
91  libMesh::Point _g;
92 
95 
97 
98  libMesh::Real _fixed_rho_value;
99 
100  private:
101 
103 
105  void read_input_options( const GetPot& input );
106 
107  }; // class ReactingLowMachNavierStokesAbstract
108 
109 
110  inline
112  { return _n_species; }
113 
114  inline
115  libMesh::Real ReactingLowMachNavierStokesAbstract::T( const libMesh::Point& p,
116  const AssemblyContext& c ) const
117  { return c.point_value(_temp_vars.T(),p); }
118 
119  inline
121  const AssemblyContext& c,
122  std::vector<libMesh::Real>& mass_fracs ) const
123  {
124  libmesh_assert_equal_to(mass_fracs.size(), this->_n_species);
125 
126  for( unsigned int var = 0; var < this->_n_species; var++ )
127  {
128  mass_fracs[var] = c.point_value(_species_vars.species(var),p);
129  }
130  }
131 
132  inline
133  libMesh::Real ReactingLowMachNavierStokesAbstract::rho( libMesh::Real T,
134  libMesh::Real p0,
135  libMesh::Real R_mix) const
136  {
137  libMesh::Real value = 0;
138  if( this->_fixed_density )
139  value = this->_fixed_rho_value;
140  else
141  value = p0/(R_mix*T);
142 
143  return value;
144  }
145 
146  inline
148  unsigned int qp ) const
149  {
150  libMesh::Real p0;
151  if( this->_enable_thermo_press_calc )
152  {
153  p0 = c.interior_value( _p0_var->p0(), qp );
154  }
155  else
156  {
157  p0 = _p0;
158  }
159  return p0;
160  }
161 
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  inline
180  const libMesh::Point& p ) const
181  {
182  libMesh::Real p0;
183  if( this->_enable_thermo_press_calc )
184  {
185  p0 = c.point_value( _p0_var->p0(), p );
186  }
187  else
188  {
189  p0 = _p0;
190  }
191  return p0;
192  }
193 
194  inline
196  unsigned int qp ) const
197  {
198  libMesh::Real p0;
199  if( this->_enable_thermo_press_calc )
200  {
201  p0 = c.fixed_interior_value( _p0_var->p0(), qp );
202  }
203  else
204  {
205  p0 = _p0;
206  }
207  return p0;
208  }
209 
210 } // namespace GRINS
211 
212 #endif //GRINS_REACTING_LOW_MACH_NAVIER_STOKES_ABSTRACT_H
libMesh::Real get_p0_steady_side(const AssemblyContext &c, unsigned int qp) const
bool _enable_thermo_press_calc
Flag to enable thermodynamic pressure calculation.
VariableIndex species(unsigned int species) const
VariableIndex T() const
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
libMesh::Real T(const libMesh::Point &p, const AssemblyContext &c) const
void mass_fractions(const libMesh::Point &p, const AssemblyContext &c, std::vector< libMesh::Real > &mass_fracs) const
GRINS namespace.
libMesh::Real rho(libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
void read_input_options(const GetPot &input)
Read options from GetPot input file.
std::string PhysicsName
VariableIndex p0() const
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
libMesh::Real get_p0_transient(const AssemblyContext &c, unsigned int qp) const
libMesh::Real get_p0_steady(const AssemblyContext &c, unsigned int qp) const

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1