39 #include "libmesh/utility.h"
40 #include "libmesh/string_to_enum.h"
41 #include "libmesh/getpot.h"
42 #include "libmesh/fem_system.h"
43 #include "libmesh/quadrature.h"
48 template<
class Conductivity>
62 template<
class Conductivity>
70 template<
class Conductivity>
74 system->time_evolving(this->_temp_vars.T(), 1);
77 template<
class Conductivity>
83 context.get_element_fe(_temp_vars.T())->get_JxW();
84 context.get_element_fe(_temp_vars.T())->get_phi();
85 context.get_element_fe(_temp_vars.T())->get_dphi();
86 context.get_element_fe(_temp_vars.T())->get_xyz();
88 context.get_side_fe(_temp_vars.T())->get_JxW();
89 context.get_side_fe(_temp_vars.T())->get_phi();
90 context.get_side_fe(_temp_vars.T())->get_dphi();
91 context.get_side_fe(_temp_vars.T())->get_xyz();
94 template<
class Conductivity>
99 const unsigned int n_T_dofs = context.get_dof_indices(_temp_vars.T()).size();
100 const unsigned int n_u_dofs = context.get_dof_indices(_flow_vars.u()).size();
108 const std::vector<libMesh::Real> &JxW =
109 context.get_element_fe(_temp_vars.T())->get_JxW();
112 const std::vector<std::vector<libMesh::Real> >& T_phi =
113 context.get_element_fe(_temp_vars.T())->get_phi();
116 const std::vector<std::vector<libMesh::Real> >& vel_phi =
117 context.get_element_fe(_flow_vars.u())->get_phi();
121 const std::vector<std::vector<libMesh::RealGradient> >& T_gradphi =
122 context.get_element_fe(_temp_vars.T())->get_dphi();
125 const std::vector<libMesh::Point>& u_qpoint =
126 context.get_element_fe(_flow_vars.u())->get_xyz();
129 libMesh::DenseSubVector<libMesh::Number> &FT = context.get_elem_residual(_temp_vars.T());
131 libMesh::DenseSubMatrix<libMesh::Number> &KTT = context.get_elem_jacobian(_temp_vars.T(), _temp_vars.T());
133 libMesh::DenseSubMatrix<libMesh::Number> &KTr = context.get_elem_jacobian(_temp_vars.T(), _flow_vars.u());
134 libMesh::DenseSubMatrix<libMesh::Number> &KTz = context.get_elem_jacobian(_temp_vars.T(), _flow_vars.v());
143 unsigned int n_qpoints = context.get_element_qrule().n_points();
145 for (
unsigned int qp=0; qp != n_qpoints; qp++)
147 const libMesh::Number r = u_qpoint[qp](0);
150 libMesh::Number u_r, u_z;
151 u_r = context.interior_value(_flow_vars.u(), qp);
152 u_z = context.interior_value(_flow_vars.v(), qp);
154 libMesh::Gradient grad_T;
155 grad_T = context.interior_gradient(_temp_vars.T(), qp);
157 libMesh::NumberVectorValue U (u_r,u_z);
159 libMesh::Number k = this->_k( context, qp );
166 for (
unsigned int i=0; i != n_T_dofs; i++)
169 (-_rho*_Cp*T_phi[i][qp]*(U*grad_T)
170 -k*(T_gradphi[i][qp]*grad_T) );
172 if (compute_jacobian)
174 libmesh_assert (context.get_elem_solution_derivative() == 1.0);
176 for (
unsigned int j=0; j != n_T_dofs; j++)
181 KTT(i,j) += JxW[qp] * context.get_elem_solution_derivative() *r*
182 (-_rho*_Cp*T_phi[i][qp]*(U*T_gradphi[j][qp])
183 -k*(T_gradphi[i][qp]*T_gradphi[j][qp]));
189 for (
unsigned int j=0; j != n_T_dofs; j++)
192 KTT(i,j) -= JxW[qp] * context.get_elem_solution_derivative() *r*( dk_dT*T_phi[j][qp]*T_gradphi[i][qp]*grad_T );
198 for (
unsigned int j=0; j != n_u_dofs; j++)
200 KTr(i,j) += JxW[qp] * context.get_elem_solution_derivative() *r*(-_rho*_Cp*T_phi[i][qp]*(vel_phi[j][qp]*grad_T(0)));
201 KTz(i,j) += JxW[qp] * context.get_elem_solution_derivative() *r*(-_rho*_Cp*T_phi[i][qp]*(vel_phi[j][qp]*grad_T(1)));
210 template<
class Conductivity>
218 const std::vector<libMesh::Real> &JxW =
219 context.get_element_fe(_temp_vars.T())->get_JxW();
222 const std::vector<std::vector<libMesh::Real> >& phi =
223 context.get_element_fe(_temp_vars.T())->get_phi();
226 const unsigned int n_T_dofs = context.get_dof_indices(_temp_vars.T()).size();
229 const std::vector<libMesh::Point>& u_qpoint =
230 context.get_element_fe(_flow_vars.u())->get_xyz();
233 libMesh::DenseSubVector<libMesh::Real> &F =
234 context.get_elem_residual(_temp_vars.T());
236 libMesh::DenseSubMatrix<libMesh::Real> &M =
237 context.get_elem_jacobian(_temp_vars.T(), _temp_vars.T());
239 unsigned int n_qpoints = context.get_element_qrule().n_points();
241 for (
unsigned int qp = 0; qp != n_qpoints; ++qp)
243 const libMesh::Number r = u_qpoint[qp](0);
251 context.interior_rate(_temp_vars.T(), qp, T_dot);
253 for (
unsigned int i = 0; i != n_T_dofs; ++i)
255 F(i) -= JxW[qp]*r*(_rho*_Cp*T_dot*phi[i][qp] );
257 if( compute_jacobian )
259 for (
unsigned int j=0; j != n_T_dofs; j++)
262 M(i,j) -= JxW[qp] * context.get_elem_solution_rate_derivative() *r*_rho*_Cp*phi[j][qp]*phi[i][qp] ;
271 template<
class Conductivity>
273 (
const std::string & param_name,
278 _k.register_parameter(param_name, param_pointer);
void read_input_options(const GetPot &input)
Read options from GetPot input file.
GRINS::ICHandlingBase * _ic_handler
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(AxisymmetricHeatTransfer)
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Base class for reading and handling initial conditions for physics classes.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
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.
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
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.
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.
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...
Helper functions for parsing material properties.
virtual void element_time_derivative(bool compute_jacobian, AssemblyContext &context)
Time dependent part(s) of physics for element interiors.
static PhysicsName axisymmetric_heat_transfer()
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.
AxisymmetricHeatTransfer()