GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator > Class Template Reference

Adds VMS-based stabilization to LowMachNavierStokes physics class. More...

#include <reacting_low_mach_navier_stokes_stab_base.h>

Inheritance diagram for GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >:
Collaboration graph
[legend]

Public Member Functions

 ReactingLowMachNavierStokesStabilizationBase (const GRINS::PhysicsName &physics_name, const GetPot &input, libMesh::UniquePtr< Mixture > &gas_mix)
 
virtual ~ReactingLowMachNavierStokesStabilizationBase ()
 
virtual void init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
void compute_res_steady (AssemblyContext &context, unsigned int qp, libMesh::Real &RP_s, libMesh::RealGradient &RM_s, libMesh::Real &RE_s, std::vector< libMesh::Real > &Rs_s)
 
void compute_res_transient (AssemblyContext &context, unsigned int qp, libMesh::Real &RP_t, libMesh::RealGradient &RM_t, libMesh::Real &RE_t, std::vector< libMesh::Real > &Rs_t)
 
- Public Member Functions inherited from GRINS::ReactingLowMachNavierStokesBase< Mixture >
 ReactingLowMachNavierStokesBase (const PhysicsName &physics_name, const GetPot &input, libMesh::UniquePtr< Mixture > &gas_mix)
 
virtual ~ReactingLowMachNavierStokesBase ()
 
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. More...
 
const Mixture & gas_mixture () const
 
- Public Member Functions inherited from GRINS::ReactingLowMachNavierStokesAbstract
 ReactingLowMachNavierStokesAbstract (const PhysicsName &physics_name, const GetPot &input)
 
virtual ~ReactingLowMachNavierStokesAbstract ()
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets velocity variables to be time-evolving. More...
 
unsigned int n_species () const
 
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
 
libMesh::Real rho (libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const
 
libMesh::Real get_p0_steady (const AssemblyContext &c, unsigned int qp) const
 
libMesh::Real get_p0_steady_side (const AssemblyContext &c, unsigned int qp) const
 
libMesh::Real get_p0_steady (const AssemblyContext &c, const libMesh::Point &p) const
 
libMesh::Real get_p0_transient (const AssemblyContext &c, unsigned int qp) const
 
- Public Member Functions inherited from GRINS::Physics
 Physics (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~Physics ()
 
virtual void init_variables (libMesh::FEMSystem *)
 Initialize variables for this physics. More...
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void preassembly (MultiphysicsSystem &)
 Perform any necessary setup before element assembly begins. More...
 
virtual void reinit (MultiphysicsSystem &)
 Any reinitialization that needs to be done. More...
 
virtual void element_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void side_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool, AssemblyContext &)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void element_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for element interiors. More...
 
virtual void side_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_constraint (bool, AssemblyContext &)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void damping_residual (bool, AssemblyContext &)
 Damping matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void nonlocal_mass_residual (bool, AssemblyContext &)
 Mass matrix part(s) for scalar variables. More...
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
virtual void compute_element_time_derivative_cache (AssemblyContext &)
 
virtual void compute_side_time_derivative_cache (AssemblyContext &)
 
virtual void compute_nonlocal_time_derivative_cache (AssemblyContext &)
 
virtual void compute_element_constraint_cache (AssemblyContext &)
 
virtual void compute_side_constraint_cache (AssemblyContext &)
 
virtual void compute_nonlocal_constraint_cache (AssemblyContext &)
 
virtual void compute_damping_residual_cache (AssemblyContext &)
 
virtual void compute_mass_residual_cache (AssemblyContext &)
 
virtual void compute_nonlocal_mass_residual_cache (AssemblyContext &)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
ICHandlingBaseget_ic_handler ()
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 

Protected Attributes

ReactingLowMachNavierStokesStabilizationHelper _stab_helper
 
- Protected Attributes inherited from GRINS::ReactingLowMachNavierStokesBase< Mixture >
libMesh::UniquePtr< Mixture > _gas_mixture
 
- Protected Attributes inherited from GRINS::ReactingLowMachNavierStokesAbstract
libMesh::Number _p0
 
VelocityVariable_flow_vars
 
PressureFEVariable_press_var
 
PrimitiveTempFEVariables_temp_vars
 
SpeciesMassFractionsVariable_species_vars
 
ThermoPressureVariable_p0_var
 
unsigned int _n_species
 Number of species. More...
 
libMesh::Point _g
 Gravity vector. More...
 
bool _enable_thermo_press_calc
 Flag to enable thermodynamic pressure calculation. More...
 
bool _fixed_density
 
libMesh::Real _fixed_rho_value
 
- Protected Attributes inherited from GRINS::Physics
const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 

Private Member Functions

 ReactingLowMachNavierStokesStabilizationBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::Physics
static void set_is_axisymmetric (bool is_axisymmetric)
 Set whether we should treat the problem as axisymmetric. More...
 
static bool is_axisymmetric ()
 
- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 
- Protected Member Functions inherited from GRINS::Physics
libMesh::UniquePtr< libMesh::FEGenericBase< libMesh::Real > > build_new_fe (const libMesh::Elem *elem, const libMesh::FEGenericBase< libMesh::Real > *fe, const libMesh::Point p)
 
void parse_enabled_subdomains (const GetPot &input, const std::string &physics_name)
 
void check_var_subdomain_consistency (const FEVariablesBase &var) const
 Check that var is enabled on at least the subdomains this Physics is. More...
 
- Static Protected Attributes inherited from GRINS::Physics
static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 
static bool _is_axisymmetric = false
 Caches whether we are solving an axisymmetric problem or not. More...
 

Detailed Description

template<typename Mixture, typename Evaluator>
class GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >

Adds VMS-based stabilization to LowMachNavierStokes physics class.

Definition at line 37 of file reacting_low_mach_navier_stokes_stab_base.h.

Constructor & Destructor Documentation

template<typename Mixture , typename Evaluator >
GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::ReactingLowMachNavierStokesStabilizationBase ( const GRINS::PhysicsName physics_name,
const GetPot &  input,
libMesh::UniquePtr< Mixture > &  gas_mix 
)

Definition at line 38 of file reacting_low_mach_navier_stokes_stab_base.C.

39  : ReactingLowMachNavierStokesBase<Mixture>(physics_name,input,gas_mix),
40  _stab_helper( physics_name+"StabHelper", input )
41  {}
template<typename Mixture, typename Evaluator>
virtual GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::~ReactingLowMachNavierStokesStabilizationBase ( )
inlinevirtual

Definition at line 45 of file reacting_low_mach_navier_stokes_stab_base.h.

45 {};
template<typename Mixture, typename Evaluator>
GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::ReactingLowMachNavierStokesStabilizationBase ( )
private

Member Function Documentation

template<typename Mixture , typename Evaluator >
void GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::compute_res_steady ( AssemblyContext context,
unsigned int  qp,
libMesh::Real &  RP_s,
libMesh::RealGradient &  RM_s,
libMesh::Real &  RE_s,
std::vector< libMesh::Real > &  Rs_s 
)
Todo:
Still missing derivative of species diffusion coefficient. rho*grad_D[s]*grad_ws[s]

Definition at line 58 of file reacting_low_mach_navier_stokes_stab_base.C.

References GRINS::Constants::R_universal.

64  {
65  Rs_s.resize(this->n_species(),0.0);
66 
67  // Grab r-coordinate for axisymmetric terms
68  // We're assuming all variables are using the same quadrature rule
69  libMesh::Real r = (context.get_element_fe(this->_flow_vars.u())->get_xyz())[qp](0);
70 
71  libMesh::RealGradient grad_p = context.interior_gradient(this->_press_var.p(), qp);
72 
73  libMesh::RealGradient grad_u = context.interior_gradient(this->_flow_vars.u(), qp);
74 
75  libMesh::RealGradient U( context.interior_value(this->_flow_vars.u(), qp) );
76  libMesh::Real divU = grad_u(0);
77 
78  if( this->_is_axisymmetric )
79  divU += U(0)/r;
80 
81  if(this->_flow_vars.dim() > 1)
82  {
83  U(1) = context.interior_value(this->_flow_vars.v(), qp);
84  divU += (context.interior_gradient(this->_flow_vars.v(), qp))(1);
85  }
86  if(this->_flow_vars.dim() == 3)
87  {
88  U(2) = context.interior_value(this->_flow_vars.w(), qp);
89  divU += (context.interior_gradient(this->_flow_vars.w(), qp))(2);
90  }
91 
92  // We don't add axisymmetric terms here since we don't directly use hess_{u,v}
93  // axisymmetric terms are built into divGradU, etc. functions below
94  libMesh::RealTensor hess_u = context.interior_hessian(this->_flow_vars.u(), qp);
95  libMesh::RealTensor hess_v = context.interior_hessian(this->_flow_vars.v(), qp);
96 
97  libMesh::Real T = context.interior_value(this->_temp_vars.T(), qp);
98 
99  libMesh::Gradient grad_T = context.interior_gradient(this->_temp_vars.T(), qp);
100  libMesh::Tensor hess_T = context.interior_hessian(this->_temp_vars.T(), qp);
101 
102  libMesh::Real hess_T_term = hess_T(0,0) + hess_T(1,1);
103 #if LIBMESH_DIM > 2
104  hess_T_term += hess_T(2,2);
105 #endif
106  // Add axisymmetric terms, if needed
107  if( this->_is_axisymmetric )
108  hess_T_term += grad_T(0)/r;
109 
110  std::vector<libMesh::Real> ws(this->n_species());
111  std::vector<libMesh::RealGradient> grad_ws(this->n_species());
112  std::vector<libMesh::RealTensor> hess_ws(this->n_species());
113  for(unsigned int s=0; s < this->_n_species; s++ )
114  {
115  ws[s] = context.interior_value(this->_species_vars.species(s), qp);
116  grad_ws[s] = context.interior_gradient(this->_species_vars.species(s), qp);
117  hess_ws[s] = context.interior_hessian(this->_species_vars.species(s), qp);
118  }
119 
120  Evaluator gas_evaluator( *(this->_gas_mixture) );
121  const libMesh::Real R_mix = gas_evaluator.R_mix(ws);
122  const libMesh::Real p0 = this->get_p0_steady(context,qp);
123  libMesh::Real rho = this->rho(T, p0, R_mix );
124  libMesh::Real cp = gas_evaluator.cp(T,p0,ws);
125  libMesh::Real M = gas_evaluator.M_mix( ws );
126 
127  std::vector<libMesh::Real> D( this->n_species() );
128  libMesh::Real mu, k;
129 
130  gas_evaluator.mu_and_k_and_D( T, rho, cp, ws, mu, k, D );
131 
132 
133  // grad_rho = drho_dT*gradT + \sum_s drho_dws*grad_ws
134  const libMesh::Real drho_dT = -p0/(R_mix*T*T);
135  libMesh::RealGradient grad_rho = drho_dT*grad_T;
136  for(unsigned int s=0; s < this->_n_species; s++ )
137  {
138  libMesh::Real Ms = gas_evaluator.M(s);
139  libMesh::Real R_uni = Constants::R_universal/1000.0; /* J/kmol-K --> J/mol-K */
140 
141  // drho_dws = -p0/(T*R_mix*R_mix)*dR_dws
142  // dR_dws = R_uni*d_dws(1/M)
143  // d_dws(1/M) = d_dws(\sum_s w_s/Ms) = 1/Ms
144  const libMesh::Real drho_dws = -p0/(R_mix*R_mix*T)*R_uni/Ms;
145  grad_rho += drho_dws*grad_ws[s];
146  }
147 
148  libMesh::RealGradient rhoUdotGradU;
149  libMesh::RealGradient divGradU;
150  libMesh::RealGradient divGradUT;
151  libMesh::RealGradient divdivU;
152 
153  if( this->_flow_vars.dim() == 1 )
154  {
155  rhoUdotGradU = rho*_stab_helper.UdotGradU( U, grad_u );
156 
157  divGradU = _stab_helper.div_GradU( hess_u );
158  divGradUT = _stab_helper.div_GradU_T( hess_u );
159  divdivU = _stab_helper.div_divU_I( hess_u );
160  }
161  else if( this->_flow_vars.dim() == 2 )
162  {
163  libMesh::RealGradient grad_v = context.interior_gradient(this->_flow_vars.v(), qp);
164 
165  rhoUdotGradU = rho*_stab_helper.UdotGradU( U, grad_u, grad_v );
166 
167  // Call axisymmetric versions if we are doing an axisymmetric run
168  if( this->_is_axisymmetric )
169  {
170  divGradU = _stab_helper.div_GradU_axi( r, U, grad_u, grad_v, hess_u, hess_v );
171  divGradUT = _stab_helper.div_GradU_T_axi( r, U, grad_u, hess_u, hess_v );
172  divdivU = _stab_helper.div_divU_I_axi( r, U, grad_u, hess_u, hess_v );
173  }
174  else
175  {
176  divGradU = _stab_helper.div_GradU( hess_u, hess_v );
177  divGradUT = _stab_helper.div_GradU_T( hess_u, hess_v );
178  divdivU = _stab_helper.div_divU_I( hess_u, hess_v );
179  }
180  }
181  else
182  {
183  libMesh::RealGradient grad_v = context.interior_gradient(this->_flow_vars.v(), qp);
184  libMesh::RealTensor hess_v = context.interior_hessian(this->_flow_vars.v(), qp);
185 
186  libMesh::RealGradient grad_w = context.interior_gradient(this->_flow_vars.w(), qp);
187  libMesh::RealTensor hess_w = context.interior_hessian(this->_flow_vars.w(), qp);
188 
189  rhoUdotGradU = rho*_stab_helper.UdotGradU( U, grad_u, grad_v, grad_w );
190 
191  divGradU = _stab_helper.div_GradU( hess_u, hess_v, hess_w );
192  divGradUT = _stab_helper.div_GradU_T( hess_u, hess_v, hess_w );
193  divdivU = _stab_helper.div_divU_I( hess_u, hess_v, hess_w );
194  }
195 
196 
197 
198  // Terms if we have vicosity derivatives w.r.t. temp.
199  /*
200  if( this->_mu.deriv(T) != 0.0 )
201  {
202  libMesh::Gradient gradTgradu( grad_T*grad_u, grad_T*grad_v );
203 
204  libMesh::Gradient gradTgraduT( grad_T(0)*grad_u(0) + grad_T(1)*grad_u(1),
205  grad_T(0)*grad_v(0) + grad_T(1)*grad_v(1) );
206 
207  libMesh::Real divU = grad_u(0) + grad_v(1);
208 
209  libMesh::Gradient gradTdivU( grad_T(0)*divU, grad_T(1)*divU );
210 
211  if(this->_flow_vars.dim() == 3)
212  {
213  libMesh::Gradient grad_w = context.interior_gradient(this->_flow_vars.w(), qp);
214 
215  gradTgradu(2) = grad_T*grad_w;
216 
217  gradTgraduT(0) += grad_T(2)*grad_u(2);
218  gradTgraduT(1) += grad_T(2)*grad_v(2);
219  gradTgraduT(2) = grad_T(0)*grad_w(0) + grad_T(1)*grad_w(1) + grad_T(2)*grad_w(2);
220 
221  divU += grad_w(2);
222  gradTdivU(0) += grad_T(0)*grad_w(2);
223  gradTdivU(1) += grad_T(1)*grad_w(2);
224  gradTdivU(2) += grad_T(2)*divU;
225  }
226 
227  divT += this->_mu.deriv(T)*( gradTgradu + gradTgraduT - 2.0/3.0*gradTdivU );
228  }
229  */
230 
231  // Axisymmetric terms already built in
232  libMesh::RealGradient div_stress = mu*(divGradU + divGradUT - 2.0/3.0*divdivU);
233 
234  std::vector<libMesh::Real> omega_dot(this->n_species());
235  gas_evaluator.omega_dot(T,rho,ws,omega_dot);
236 
237  libMesh::Real chem_term = 0.0;
238  libMesh::Gradient mass_term(0.0,0.0,0.0);
239  for(unsigned int s=0; s < this->_n_species; s++ )
240  {
241  // Start accumulating chemistry term for energy residual
242  libMesh::Real h_s=gas_evaluator.h_s(T,s);
243  chem_term += h_s*omega_dot[s];
244 
245  /* Accumulate mass term for continuity residual
246  mass_term = grad_M/M */
247  mass_term += grad_ws[s]/this->_gas_mixture->M(s);
248 
249  libMesh::Real hess_s_term = hess_ws[s](0,0) + hess_ws[s](1,1);
250 #if LIBMESH_DIM > 2
251  hess_s_term += hess_ws[s](2,2);
252 #endif
253  // Add axisymmetric terms, if needed
254  if( this->_is_axisymmetric )
255  hess_s_term += grad_ws[s](0)/r;
256 
257  // Species residual
260  Rs_s[s] = rho*U*grad_ws[s] - rho*D[s]*hess_s_term - grad_rho*D[s]*grad_ws[s]
261  - omega_dot[s];
262  }
263  mass_term *= M;
264 
265  // Continuity residual
266  RP_s = divU - (U*grad_T)/T - U*mass_term;
267 
268  // Momentum residual
269  RM_s = rhoUdotGradU + grad_p - div_stress - rho*(this->_g);
270 
271  // Energy residual
272  // - this->_k.deriv(T)*(grad_T*grad_T)
273  RE_s = rho*U*cp*grad_T - k*(hess_T_term) + chem_term;
274 
275  return;
276  }
libMesh::RealGradient div_GradU_T(libMesh::RealTensor &hess_u) const
VariableIndex species(unsigned int species) const
VariableIndex T() const
libMesh::RealGradient div_divU_I_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
libMesh::RealGradient UdotGradU(libMesh::Gradient &U, libMesh::Gradient &grad_u) const
const libMesh::Real R_universal
Universal Gas Constant, R, [J/(kmol-K)].
libMesh::Real T(const libMesh::Point &p, const AssemblyContext &c) const
libMesh::RealGradient div_GradU_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::Gradient &grad_v, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
libMesh::Real rho(libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const
VariableIndex p() const
libMesh::RealGradient div_GradU(libMesh::RealTensor &hess_u) const
libMesh::Real get_p0_steady(const AssemblyContext &c, unsigned int qp) const
unsigned int dim() const
Number of components.
libMesh::RealGradient div_divU_I(libMesh::RealTensor &hess_u) const
libMesh::RealGradient div_GradU_T_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
static bool _is_axisymmetric
Caches whether we are solving an axisymmetric problem or not.
Definition: physics.h:269
template<typename Mixture , typename Evaluator >
void GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::compute_res_transient ( AssemblyContext context,
unsigned int  qp,
libMesh::Real &  RP_t,
libMesh::RealGradient &  RM_t,
libMesh::Real &  RE_t,
std::vector< libMesh::Real > &  Rs_t 
)

Definition at line 279 of file reacting_low_mach_navier_stokes_stab_base.C.

285  {
286  libMesh::Real T = context.interior_value( this->_temp_vars.T(), qp );
287 
288  std::vector<libMesh::Real> ws(this->n_species());
289  for(unsigned int s=0; s < this->_n_species; s++ )
290  {
291  ws[s] = context.interior_value(this->_species_vars.species(s), qp);
292  }
293 
294  Evaluator gas_evaluator( *(this->_gas_mixture) );
295  const libMesh::Real R_mix = gas_evaluator.R_mix(ws);
296  const libMesh::Real p0 = this->get_p0_transient(context,qp);
297  const libMesh::Real rho = this->rho(T, p0, R_mix);
298  const libMesh::Real cp = gas_evaluator.cp(T,p0,ws);
299  const libMesh::Real M = gas_evaluator.M_mix( ws );
300 
301  // M_dot = -M^2 \sum_s w_dot[s]/Ms
302  libMesh::Real M_dot = 0.0;
303  std::vector<libMesh::Real> ws_dot(this->n_species());
304  for(unsigned int s=0; s < this->n_species(); s++)
305  {
306  context.interior_rate(this->_species_vars.species(s), qp, ws_dot[s]);
307 
308  // Start accumulating M_dot
309  M_dot += ws_dot[s]/this->_gas_mixture->M(s);
310  }
311  libMesh::Real M_dot_over_M = M_dot*(-M);
312 
313  libMesh::RealGradient u_dot;
314  context.interior_rate(this->_flow_vars.u(), qp, u_dot(0));
315  if(this->_flow_vars.dim() > 1)
316  context.interior_rate(this->_flow_vars.v(), qp, u_dot(1));
317  if(this->_flow_vars.dim() == 3)
318  context.interior_rate(this->_flow_vars.w(), qp, u_dot(2));
319 
320  libMesh::Real T_dot;
321  context.interior_rate(this->_temp_vars.T(), qp, T_dot);
322 
323  RP_t = -T_dot/T + M_dot_over_M;
324  RM_t = rho*u_dot;
325  RE_t = rho*cp*T_dot;
326  for(unsigned int s=0; s < this->n_species(); s++)
327  {
328  Rs_t[s] = rho*ws_dot[s];
329  }
330 
331  return;
332  }
VariableIndex species(unsigned int species) const
VariableIndex T() const
libMesh::Real T(const libMesh::Point &p, const AssemblyContext &c) const
libMesh::Real rho(libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const
libMesh::Real get_p0_transient(const AssemblyContext &c, unsigned int qp) const
unsigned int dim() const
Number of components.
template<typename Mixture , typename Evaluator >
void GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::init_context ( AssemblyContext context)
virtual

Initialize context for added physics variables.

Reimplemented from GRINS::ReactingLowMachNavierStokesAbstract.

Definition at line 44 of file reacting_low_mach_navier_stokes_stab_base.C.

References GRINS::ReactingLowMachNavierStokesAbstract::init_context().

45  {
46  // First call base class
48 
49  // We need pressure derivatives
50  context.get_element_fe(this->_press_var.p())->get_dphi();
51 
52  // We also need second derivatives, so initialize those.
53  context.get_element_fe(this->_flow_vars.u())->get_d2phi();
54  context.get_element_fe(this->_temp_vars.T())->get_d2phi();
55  }
VariableIndex T() const
VariableIndex p() const
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.

Member Data Documentation

template<typename Mixture, typename Evaluator>
ReactingLowMachNavierStokesStabilizationHelper GRINS::ReactingLowMachNavierStokesStabilizationBase< Mixture, Evaluator >::_stab_helper
protected

Definition at line 66 of file reacting_low_mach_navier_stokes_stab_base.h.


The documentation for this class was generated from the following files:

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