30 #include "libmesh/getpot.h"
31 #include "libmesh/system.h"
32 #include "libmesh/mesh.h"
38 (
const std::string & helper_name,
46 if (input.have_variable(
"Stabilization/tau_constant_T"))
48 (_C, input,
"Stabilization/tau_constant_T", _C );
51 (_C, input,
"Stabilization/tau_constant", _C );
53 if (input.have_variable(
"Stabilization/tau_factor_T"))
55 (_tau_factor, input,
"Stabilization/tau_factor_T", _tau_factor );
58 (_tau_factor, input,
"Stabilization/tau_factor", _tau_factor );
76 const libMesh::Real rho,
77 const libMesh::Real Cp,
78 const libMesh::Real k )
const
80 libMesh::Gradient grad_T = context.fixed_interior_gradient(this->
_temp_vars.
T_var(), qp);
81 libMesh::Tensor hess_T = context.fixed_interior_hessian(this->
_temp_vars.
T_var(), qp);
83 libMesh::RealGradient rhocpU( rho*Cp*context.fixed_interior_value(this->_flow_vars.u_var(), qp),
84 rho*Cp*context.fixed_interior_value(this->_flow_vars.v_var(), qp) );
85 if(context.get_system().get_mesh().mesh_dimension() == 3)
86 rhocpU(2) = rho*Cp*context.fixed_interior_value(this->
_flow_vars.
w_var(), qp);
88 return rhocpU*grad_T - k*(hess_T(0,0) + hess_T(1,1) + hess_T(2,2));
94 const libMesh::Real rho,
95 const libMesh::Real Cp,
96 const libMesh::Real k,
98 libMesh::Real &d_res_dT,
99 libMesh::Gradient &d_res_dgradT,
100 libMesh::Tensor &d_res_dhessT,
101 libMesh::Gradient &d_res_dU
104 libMesh::Gradient grad_T = context.fixed_interior_gradient(this->_temp_vars.T_var(), qp);
105 libMesh::Tensor hess_T = context.fixed_interior_hessian(this->_temp_vars.T_var(), qp);
107 libMesh::RealGradient rhocpU( rho*Cp*context.fixed_interior_value(this->_flow_vars.u_var(), qp),
108 rho*Cp*context.fixed_interior_value(this->_flow_vars.v_var(), qp) );
109 if(context.get_system().get_mesh().mesh_dimension() == 3)
110 rhocpU(2) = rho*Cp*context.fixed_interior_value(this->_flow_vars.w_var(), qp);
112 res = rhocpU*grad_T - k*(hess_T(0,0) + hess_T(1,1) + hess_T(2,2));
114 d_res_dgradT = rhocpU;
116 d_res_dhessT(0,0) = -k;
117 d_res_dhessT(1,1) = -k;
118 d_res_dhessT(2,2) = -k;
119 d_res_dU = rho * Cp * grad_T;
125 const libMesh::Real rho,
126 const libMesh::Real Cp )
const
138 const libMesh::Real rho,
139 const libMesh::Real Cp,
141 libMesh::Real &d_res_dTdot
145 context.interior_rate(this->_temp_vars.T_var(), qp, T_dot);
148 d_res_dTdot = rho*Cp;
libMesh::Real compute_res_energy_transient(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp) const
PrimitiveTempVariables _temp_vars
VariableIndex w_var() const
void init(libMesh::FEMSystem &system)
void compute_res_energy_transient_and_derivs(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp, libMesh::Real &res, libMesh::Real &d_res_dTdot) const
void compute_res_energy_steady_and_derivs(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp, const libMesh::Real k, libMesh::Real &res, libMesh::Real &d_res_dT, libMesh::Gradient &d_res_dgradT, libMesh::Tensor &d_res_dhessT, libMesh::Gradient &d_res_dU) const
PrimitiveFlowVariables _flow_vars
VariableIndex T_var() const
virtual void init(libMesh::FEMSystem *system)
virtual void init(libMesh::FEMSystem *system)
libMesh::Real compute_res_energy_steady(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp, const libMesh::Real k) const
HeatTransferStabilizationHelper(const std::string &helper_name, const GetPot &input)
~HeatTransferStabilizationHelper()