32 #include "libmesh/quadrature.h" 
   56 #ifdef GRINS_USE_GRVY_TIMERS 
   57     this->_timer->BeginTimer(
"HeatTransferSPGSMStabilization::element_time_derivative");
 
   61     const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size();
 
   64     const std::vector<libMesh::Real> &JxW =
 
   65       context.get_element_fe(this->_temp_vars.T())->get_JxW();
 
   67     const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
 
   68       context.get_element_fe(this->_temp_vars.T())->get_dphi();
 
   70     libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(this->_temp_vars.T()); 
 
   72     libMesh::FEBase* fe = context.get_element_fe(this->_temp_vars.T());
 
   74     unsigned int n_qpoints = context.get_element_qrule().n_points();
 
   76     for (
unsigned int qp=0; qp != n_qpoints; qp++)
 
   78         libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
 
   79         libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
 
   81         libMesh::RealGradient U( context.interior_value( this->_flow_vars.u(), qp ),
 
   82                                  context.interior_value( this->_flow_vars.v(), qp ) );
 
   85             U(2) = context.interior_value( this->_flow_vars.w(), qp );
 
   89         libMesh::Real _k_qp = this->_k(context, qp);
 
   91         libMesh::Real tau_E = this->_stab_helper.compute_tau_energy( context, G, this->_rho, this->_Cp, _k_qp,  U, this->_is_steady );
 
   93         libMesh::Real RE_s = this->_stab_helper.compute_res_energy_steady( context, qp, this->_rho, this->_Cp, _k_qp );
 
   95         for (
unsigned int i=0; i != n_T_dofs; i++)
 
   97             FT(i) += -tau_E*RE_s*this->_rho*this->_Cp*U*T_gradphi[i][qp]*JxW[qp];
 
  100         if( compute_jacobian )
 
  102             libmesh_not_implemented();
 
  107 #ifdef GRINS_USE_GRVY_TIMERS 
  108     this->_timer->EndTimer(
"HeatTransferSPGSMStabilization::element_time_derivative");
 
  118 #ifdef GRINS_USE_GRVY_TIMERS 
  119     this->_timer->BeginTimer(
"HeatTransferSPGSMStabilization::mass_residual");
 
  123     const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size();
 
  126     const std::vector<libMesh::Real> &JxW =
 
  127       context.get_element_fe(this->_temp_vars.T())->get_JxW();
 
  129     const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
 
  130       context.get_element_fe(this->_temp_vars.T())->get_dphi();
 
  132     libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(this->_temp_vars.T()); 
 
  134     libMesh::FEBase* fe = context.get_element_fe(this->_temp_vars.T());
 
  136     unsigned int n_qpoints = context.get_element_qrule().n_points();
 
  138     for (
unsigned int qp=0; qp != n_qpoints; qp++)
 
  140         libMesh::RealGradient g = this->_stab_helper.compute_g( fe, context, qp );
 
  141         libMesh::RealTensor G = this->_stab_helper.compute_G( fe, context, qp );
 
  143         libMesh::RealGradient U( context.fixed_interior_value( this->_flow_vars.u(), qp ),
 
  144                                  context.fixed_interior_value( this->_flow_vars.v(), qp ) );
 
  145         if( this->_dim == 3 )
 
  147             U(2) = context.fixed_interior_value( this->_flow_vars.w(), qp );
 
  151         libMesh::Real _k_qp = this->_k(context, qp);
 
  153         libMesh::Real tau_E = this->_stab_helper.compute_tau_energy( context, G, this->_rho, this->_Cp, _k_qp,  U, 
false );
 
  155         libMesh::Real RE_t = this->_stab_helper.compute_res_energy_transient( context, qp, this->_rho, this->_Cp );
 
  157         for (
unsigned int i=0; i != n_T_dofs; i++)
 
  159             FT(i) -= tau_E*RE_t*this->_rho*this->_Cp*U*T_gradphi[i][qp]*JxW[qp];
 
  164 #ifdef GRINS_USE_GRVY_TIMERS 
  165     this->_timer->EndTimer(
"HeatTransferSPGSMStabilization::mass_residual");
 
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferSPGSMStabilization)
 
virtual ~HeatTransferSPGSMStabilization()
 
virtual void mass_residual(bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part...
 
virtual void element_time_derivative(bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
Time dependent part(s) of physics for element interiors. 
 
HeatTransferSPGSMStabilization()