32 #include "libmesh/quadrature.h"
56 const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size();
59 const std::vector<libMesh::Real> &JxW =
60 context.get_element_fe(this->_temp_vars.T())->get_JxW();
62 const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
63 context.get_element_fe(this->_temp_vars.T())->get_dphi();
65 libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(this->_temp_vars.T());
67 libMesh::FEBase* fe = context.get_element_fe(this->_temp_vars.T());
69 unsigned int n_qpoints = context.get_element_qrule().n_points();
71 for (
unsigned int qp=0; qp != n_qpoints; qp++)
73 libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
74 libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
76 libMesh::RealGradient U( context.interior_value( this->_flow_vars.u(), qp ),
77 context.interior_value( this->_flow_vars.v(), qp ) );
78 if( this->_flow_vars.dim() == 3 )
80 U(2) = context.interior_value( this->_flow_vars.w(), qp );
84 libMesh::Real _k_qp = this->_k(context, qp);
86 libMesh::Real tau_E = this->_stab_helper.compute_tau_energy( context, G, this->_rho, this->_Cp, _k_qp, U, this->_is_steady );
88 libMesh::Real RE_s = this->_stab_helper.compute_res_energy_steady( context, qp, this->_rho, this->_Cp, _k_qp );
90 for (
unsigned int i=0; i != n_T_dofs; i++)
92 FT(i) += -tau_E*RE_s*this->_rho*this->_Cp*U*T_gradphi[i][qp]*JxW[qp];
95 if( compute_jacobian )
97 libmesh_not_implemented();
107 if( compute_jacobian )
108 libmesh_not_implemented();
111 const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size();
114 const std::vector<libMesh::Real> &JxW =
115 context.get_element_fe(this->_temp_vars.T())->get_JxW();
117 const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
118 context.get_element_fe(this->_temp_vars.T())->get_dphi();
120 libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(this->_temp_vars.T());
122 libMesh::FEBase* fe = context.get_element_fe(this->_temp_vars.T());
124 unsigned int n_qpoints = context.get_element_qrule().n_points();
126 for (
unsigned int qp=0; qp != n_qpoints; qp++)
128 libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
129 libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
131 libMesh::RealGradient U( context.fixed_interior_value( this->_flow_vars.u(), qp ),
132 context.fixed_interior_value( this->_flow_vars.v(), qp ) );
133 if( this->_flow_vars.dim() == 3 )
135 U(2) = context.fixed_interior_value( this->_flow_vars.w(), qp );
139 libMesh::Real _k_qp = this->_k(context, qp);
141 libMesh::Real tau_E = this->_stab_helper.compute_tau_energy( context, G, this->_rho, this->_Cp, _k_qp, U,
false );
143 libMesh::Real RE_t = this->_stab_helper.compute_res_energy_transient( context, qp, this->_rho, this->_Cp );
145 for (
unsigned int i=0; i != n_T_dofs; i++)
147 FT(i) -= tau_E*RE_t*this->_rho*this->_Cp*U*T_gradphi[i][qp]*JxW[qp];
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferSPGSMStabilization)
virtual ~HeatTransferSPGSMStabilization()
virtual void mass_residual(bool compute_jacobian, AssemblyContext &context)
Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part...
HeatTransferSPGSMStabilization()
virtual void element_time_derivative(bool compute_jacobian, AssemblyContext &context)
Time dependent part(s) of physics for element interiors.