25 #ifndef GRINS_HEAT_TRANSFER_STAB_HELPER_H
26 #define GRINS_HEAT_TRANSFER_STAB_HELPER_H
38 class PrimitiveTempFEVariables;
39 class VelocityVariable;
40 class PressureFEVariable;
47 const GetPot& input );
53 const libMesh::Real rho,
54 const libMesh::Real Cp,
55 const libMesh::Real k )
const;
60 const libMesh::Real rho,
61 const libMesh::Real Cp,
62 const libMesh::Real k,
64 libMesh::Real &d_res_dT,
65 libMesh::Gradient &d_res_dgradT,
66 libMesh::Tensor &d_res_dhessT,
67 libMesh::Gradient &d_res_dU
72 const libMesh::Real rho,
73 const libMesh::Real Cp
79 const libMesh::Real rho,
80 const libMesh::Real Cp,
82 libMesh::Real &d_res_dTdot
86 libMesh::RealTensor& G,
91 bool is_steady )
const;
94 libMesh::RealTensor& G,
100 libMesh::Real &d_tau_E_d_rho,
101 libMesh::Gradient &d_tau_E_d_U,
102 bool is_steady )
const;
118 libMesh::RealTensor& G,
123 bool is_steady )
const
125 libMesh::Real tau = (rho*cp*U)*(G*(rho*cp*U)) + this->
_C*k*k*G.contract(G);
128 tau += (2.0*rho*cp/c.get_deltat_value())*(2.0*rho*cp/c.get_deltat_value());
137 libMesh::RealTensor& G,
142 libMesh::Real &tau_E,
143 libMesh::Real &d_tau_E_d_rho,
144 libMesh::Gradient &d_tau_E_d_U,
145 bool is_steady )
const
147 libMesh::Gradient rhocpU = rho*cp*U;
148 libMesh::Gradient GrhocpU = G*rhocpU;
149 libMesh::Real rhocpUGrhocpU = rhocpU * GrhocpU;
150 libMesh::Real GG = G.contract(G);
151 tau_E = (rhocpU)*(GrhocpU) + this->_C*k*k*GG;
152 d_tau_E_d_rho = rhocpUGrhocpU*2/rho/cp;
153 d_tau_E_d_U = 2*rho*cp*GrhocpU;
157 libMesh::Real two_rhocp_over_dt = 2*rho*cp/c.get_deltat_value();
158 tau_E += two_rhocp_over_dt * two_rhocp_over_dt;
159 d_tau_E_d_rho += 4*two_rhocp_over_dt/c.get_deltat_value();
165 libMesh::Real root_oldtau = std::sqrt(tau_E);
166 libMesh::Real d_tau_d_oldtau = -this->_tau_factor / (tau_E*root_oldtau) / 2;
168 d_tau_E_d_rho = d_tau_d_oldtau * d_tau_E_d_rho;
169 d_tau_E_d_U = d_tau_d_oldtau * d_tau_E_d_U;
171 tau_E = this->_tau_factor / root_oldtau;
175 #endif // GRINS_HEAT_TRANSFER_STAB_HELPER_H
libMesh::Real compute_res_energy_transient(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp) const
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
void compute_tau_energy_and_derivs(AssemblyContext &c, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Real cp, libMesh::Real k, libMesh::Gradient U, libMesh::Real &tau_E, libMesh::Real &d_tau_E_d_rho, libMesh::Gradient &d_tau_E_d_U, bool is_steady) const
const PrimitiveTempFEVariables & _temp_vars
libMesh::Real compute_tau_energy(AssemblyContext &c, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Real cp, libMesh::Real k, libMesh::Gradient U, bool is_steady) const
const VelocityVariable & _flow_vars
libMesh::Real compute_res_energy_steady(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real Cp, const libMesh::Real k) const
const PressureFEVariable & _press_var
HeatTransferStabilizationHelper(const std::string &helper_name, const GetPot &input)
~HeatTransferStabilizationHelper()
libMesh::Real _tau_factor