Time dependent part(s) of physics for element interiors.
48 const unsigned int n_p_dofs = context.get_dof_indices(this->
_press_var.
p()).size();
49 const unsigned int n_u_dofs = context.get_dof_indices(this->
_flow_vars.
u()).size();
50 const unsigned int n_T_dofs = context.get_dof_indices(this->
_temp_vars.
T()).size();
52 const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size();
55 const std::vector<libMesh::Real> &JxW =
56 context.get_element_fe(this->
_flow_vars.
u())->get_JxW();
59 const std::vector<std::vector<libMesh::RealGradient> >& p_dphi =
60 context.get_element_fe(this->
_press_var.
p())->get_dphi();
62 const std::vector<std::vector<libMesh::Real> >& u_phi =
63 context.get_element_fe(this->
_flow_vars.
u())->get_phi();
65 const std::vector<std::vector<libMesh::RealGradient> >& u_gradphi =
66 context.get_element_fe(this->
_flow_vars.
u())->get_dphi();
69 const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
70 context.get_element_fe(this->
_temp_vars.
T())->get_dphi();
72 const std::vector<std::vector<libMesh::Gradient> >& s_gradphi = context.get_element_fe(s0_var)->get_dphi();
75 const std::vector<libMesh::Point>& u_qpoint =
76 context.get_element_fe(this->
_flow_vars.
u())->get_xyz();
78 libMesh::DenseSubVector<libMesh::Number> &Fp = context.get_elem_residual(this->
_press_var.
p());
80 libMesh::DenseSubVector<libMesh::Number> &Fu = context.get_elem_residual(this->
_flow_vars.
u());
82 libMesh::DenseSubVector<libMesh::Number>* Fv = NULL;
84 Fv = &context.get_elem_residual(this->_flow_vars.v());
86 libMesh::DenseSubVector<libMesh::Number>* Fw = NULL;
88 Fw = &context.get_elem_residual(this->_flow_vars.w());
90 libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(this->
_temp_vars.
T());
92 unsigned int n_qpoints = context.get_element_qrule().n_points();
95 libMesh::FEBase* u_fe = context.get_element_fe(this->
_flow_vars.
u());
96 for (
unsigned int qp=0; qp != n_qpoints; qp++)
98 libMesh::Real
T = context.interior_value( this->
_temp_vars.
T(), qp );
100 libMesh::RealGradient U( context.interior_value( this->_flow_vars.u(), qp ) );
102 U(1) = context.interior_value( this->
_flow_vars.
v(), qp );
104 U(2) = context.interior_value( this->
_flow_vars.
w(), qp );
106 std::vector<libMesh::Real> ws(this->
n_species());
107 for(
unsigned int s=0; s < this->
_n_species; s++ )
113 const libMesh::Real R_mix = gas_evaluator.R_mix(ws);
115 libMesh::Real
rho = this->
rho(T, p0, R_mix);
117 const libMesh::Real cp = gas_evaluator.cp(T,p0,ws);
119 std::vector<libMesh::Real> D( this->
n_species() );
122 gas_evaluator.mu_and_k_and_D( T, rho, cp, ws, mu, k, D );
137 libMesh::RealGradient RM_s = 0.0;
138 libMesh::Real RC_s = 0.0;
139 libMesh::Real RE_s = 0.0;
140 std::vector<libMesh::Real> Rs_s;
144 const libMesh::Number r = u_qpoint[qp](0);
146 libMesh::Real jac = JxW[qp];
152 for (
unsigned int i=0; i != n_p_dofs; i++)
153 Fp(i) += tau_M*RM_s*p_dphi[i][qp]*jac;
156 for (
unsigned int i=0; i != n_u_dofs; i++)
158 Fu(i) += ( - tau_C*RC_s*u_gradphi[i][qp](0)
159 - tau_M*RM_s(0)*rho*U*u_gradphi[i][qp] )*jac;
162 Fu(i) += (-tau_C*RC_s/r)*u_phi[i][qp]*jac;
165 (*Fv)(i) += ( - tau_C*RC_s*u_gradphi[i][qp](1)
166 - tau_M*RM_s(1)*rho*U*u_gradphi[i][qp] )*jac;
169 (*Fw)(i) += ( - tau_C*RC_s*u_gradphi[i][qp](2)
170 - tau_M*RM_s(2)*rho*U*u_gradphi[i][qp] )*jac;
174 for (
unsigned int i=0; i != n_T_dofs; i++)
175 FT(i) -= rho*cp*tau_E*RE_s*U*T_gradphi[i][qp]*jac;
178 for(
unsigned int s=0; s < this->
n_species(); s++)
180 libMesh::DenseSubVector<libMesh::Number> &Fs =
185 for (
unsigned int i=0; i != n_s_dofs; i++)
186 Fs(i) -= rho*tau_s*Rs_s[s]*U*s_gradphi[i][qp]*jac;
190 libmesh_not_implemented();
unsigned int n_species() const
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
PrimitiveTempFEVariables & _temp_vars
libMesh::UniquePtr< Mixture > _gas_mixture
PressureFEVariable & _press_var
VariableIndex species(unsigned int species) const
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
libMesh::Real compute_tau_continuity(libMesh::Real tau_C, libMesh::RealGradient &g) const
unsigned int _n_species
Number of species.
libMesh::Real T(const libMesh::Point &p, const AssemblyContext &c) const
ReactingLowMachNavierStokesStabilizationHelper _stab_helper
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
libMesh::Real rho(libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const
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)
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
libMesh::Real compute_tau_species(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real D_s, bool is_steady) const
SpeciesMassFractionsVariable & _species_vars
libMesh::Real get_p0_steady(const AssemblyContext &c, unsigned int qp) const
unsigned int dim() const
Number of components.
libMesh::Real compute_tau_momentum(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
static bool _is_axisymmetric
Caches whether we are solving an axisymmetric problem or not.
VelocityVariable & _flow_vars
libMesh::Real compute_tau_energy(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real k, libMesh::Real cp, bool is_steady) const