40 #include "libmesh/quadrature.h"
41 #include "libmesh/fem_system.h"
68 system->time_evolving(_temp_vars.T(), 1);
77 context.get_element_fe(_temp_vars.T())->get_JxW();
78 context.get_element_fe(_temp_vars.T())->get_phi();
79 context.get_element_fe(_temp_vars.T())->get_dphi();
80 context.get_element_fe(_temp_vars.T())->get_xyz();
82 context.get_side_fe(_temp_vars.T())->get_JxW();
83 context.get_side_fe(_temp_vars.T())->get_phi();
84 context.get_side_fe(_temp_vars.T())->get_dphi();
85 context.get_side_fe(_temp_vars.T())->get_xyz();
90 (
bool compute_jacobian,
94 const unsigned int n_T_dofs = context.get_dof_indices(_temp_vars.T()).size();
100 const std::vector<libMesh::Real> &JxW =
101 context.get_element_fe(_temp_vars.T())->get_JxW();
105 const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
106 context.get_element_fe(_temp_vars.T())->get_dphi();
114 libMesh::DenseSubMatrix<libMesh::Number> &KTT = context.get_elem_jacobian(_temp_vars.T(), _temp_vars.T());
116 libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(_temp_vars.T());
124 unsigned int n_qpoints = context.get_element_qrule().n_points();
126 for (
unsigned int qp=0; qp != n_qpoints; qp++)
129 libMesh::Gradient grad_T;
130 grad_T = context.interior_gradient(_temp_vars.T(), qp);
133 libMesh::Real _k_qp = this->_k(context, qp);
136 for (
unsigned int i=0; i != n_T_dofs; i++)
138 FT(i) += JxW[qp]*(-_k_qp*(T_gradphi[i][qp]*grad_T));
140 if (compute_jacobian)
142 for (
unsigned int j=0; j != n_T_dofs; j++)
147 KTT(i,j) += JxW[qp] * context.get_elem_solution_derivative() *
148 ( -_k_qp*(T_gradphi[i][qp]*T_gradphi[j][qp]) );
167 const std::vector<libMesh::Real> &JxW =
168 context.get_element_fe(_temp_vars.T())->get_JxW();
171 const std::vector<std::vector<libMesh::Real> >& phi =
172 context.get_element_fe(_temp_vars.T())->get_phi();
175 const unsigned int n_T_dofs = context.get_dof_indices(_temp_vars.T()).size();
178 libMesh::DenseSubVector<libMesh::Real> &F =
179 context.get_elem_residual(_temp_vars.T());
181 libMesh::DenseSubMatrix<libMesh::Real> &M =
182 context.get_elem_jacobian(_temp_vars.T(), _temp_vars.T());
184 unsigned int n_qpoints = context.get_element_qrule().n_points();
186 for (
unsigned int qp = 0; qp != n_qpoints; ++qp)
194 context.interior_rate(_temp_vars.T(), qp, T_dot);
196 for (
unsigned int i = 0; i != n_T_dofs; ++i)
198 F(i) -= JxW[qp]*(_rho*_Cp*T_dot*phi[i][qp] );
200 if( compute_jacobian )
202 for (
unsigned int j=0; j != n_T_dofs; j++)
206 context.get_elem_solution_rate_derivative()
207 * JxW[qp]*_rho*_Cp*phi[j][qp]*phi[i][qp] ;
220 (
const std::string & param_name,
225 _k.register_parameter(param_name, param_pointer);
GRINS::ICHandlingBase * _ic_handler
PrimitiveTempFEVariables & _temp_vars
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...
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
virtual void element_time_derivative(bool compute_jacobian, AssemblyContext &context)
Time dependent part(s) of physics for element interiors.
void check_var_subdomain_consistency(const FEVariablesBase &var) const
Check that var is enabled on at least the subdomains this Physics is.
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatConduction)
virtual void register_parameter(const std::string ¶m_name, libMesh::ParameterMultiAccessor< libMesh::Number > ¶m_pointer) const
Each subclass will register its copy of an independent.
Base class for reading and handling initial conditions for physics classes.
static void read_density(const std::string &core_physics_name, const GetPot &input, ParameterUser ¶ms, libMesh::Real &rho)
Helper function to reading density from input.
static void read_specific_heat(const std::string &core_physics_name, const GetPot &input, ParameterUser ¶ms, libMesh::Real &cp)
Helper function to reading scalar specific heat from input.
Helper functions for parsing material properties.
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Set which variables are time evolving.
static PhysicsName heat_conduction()
virtual void register_parameter(const std::string ¶m_name, libMesh::ParameterMultiAccessor< libMesh::Number > ¶m_pointer) const
Each subclass will register its copy of an independent.