GRINS-0.7.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-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_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"
40 
41 namespace GRINS
42 {
44  {
45  public:
46 
47  ReactingLowMachNavierStokesAbstract(const PhysicsName& physics_name, const GetPot& input);
48 
50 
51  virtual void init_variables( libMesh::FEMSystem* system );
52 
54  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
55 
56  // Context initialization
57  virtual void init_context( AssemblyContext& context );
58 
59  unsigned int n_species() const;
60 
61  libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const;
62 
63  void mass_fractions( const libMesh::Point& p, const AssemblyContext& c,
64  std::vector<libMesh::Real>& mass_fracs ) const;
65 
66  libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const;
67 
68  libMesh::Real get_p0_steady( const AssemblyContext& c, unsigned int qp ) const;
69 
70  libMesh::Real get_p0_steady_side( const AssemblyContext& c, unsigned int qp ) const;
71 
72  libMesh::Real get_p0_steady( const AssemblyContext& c, const libMesh::Point& p ) const;
73 
74  libMesh::Real get_p0_transient( const AssemblyContext& c, unsigned int qp ) const;
75 
76  protected:
77 
78  libMesh::Number _p0;
79 
81  unsigned int _dim;
82 
86 
87  libMesh::UniquePtr<ThermoPressureFEVariable> _p0_var;
88 
90 
92  unsigned int _n_species;
93 
95  libMesh::Point _g;
96 
99 
101 
102  libMesh::Real _fixed_rho_value;
103 
104  private:
105 
107 
109  void read_input_options( const GetPot& input );
110 
111  void register_variables();
112 
113  }; // class ReactingLowMachNavierStokesAbstract
114 
115 
116  inline
118  { return _n_species; }
119 
120  inline
121  libMesh::Real ReactingLowMachNavierStokesAbstract::T( const libMesh::Point& p,
122  const AssemblyContext& c ) const
123  { return c.point_value(_temp_vars.T(),p); }
124 
125  inline
127  const AssemblyContext& c,
128  std::vector<libMesh::Real>& mass_fracs ) const
129  {
130  libmesh_assert_equal_to(mass_fracs.size(), this->_n_species);
131 
132  for( unsigned int var = 0; var < this->_n_species; var++ )
133  {
134  mass_fracs[var] = c.point_value(_species_vars.species(var),p);
135  }
136  }
137 
138  inline
139  libMesh::Real ReactingLowMachNavierStokesAbstract::rho( libMesh::Real T,
140  libMesh::Real p0,
141  libMesh::Real R_mix) const
142  {
143  libMesh::Real value = 0;
144  if( this->_fixed_density )
145  value = this->_fixed_rho_value;
146  else
147  value = p0/(R_mix*T);
148 
149  return value;
150  }
151 
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  inline
170  unsigned int qp ) const
171  {
172  libMesh::Real p0;
173  if( this->_enable_thermo_press_calc )
174  {
175  p0 = c.side_value( _p0_var->p0(), qp );
176  }
177  else
178  {
179  p0 = _p0;
180  }
181  return p0;
182  }
183 
184  inline
186  const libMesh::Point& p ) const
187  {
188  libMesh::Real p0;
189  if( this->_enable_thermo_press_calc )
190  {
191  p0 = c.point_value( _p0_var->p0(), p );
192  }
193  else
194  {
195  p0 = _p0;
196  }
197  return p0;
198  }
199 
200  inline
202  unsigned int qp ) const
203  {
204  libMesh::Real p0;
205  if( this->_enable_thermo_press_calc )
206  {
207  p0 = c.fixed_interior_value( _p0_var->p0(), qp );
208  }
209  else
210  {
211  p0 = _p0;
212  }
213  return p0;
214  }
215 
216 } // namespace GRINS
217 
218 #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.
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:107
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::UniquePtr< ThermoPressureFEVariable > _p0_var
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
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
VariableIndex species(unsigned int species) const
virtual void init_variables(libMesh::FEMSystem *system)
Initialize variables for this physics.
libMesh::Real get_p0_steady(const AssemblyContext &c, unsigned int qp) const

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