25 #ifndef GRINS_HEAT_TRANSFER_STAB_HELPER_H
26 #define GRINS_HEAT_TRANSFER_STAB_HELPER_H
44 const GetPot& input );
48 void init( libMesh::FEMSystem& system );
52 const libMesh::Real rho,
53 const libMesh::Real Cp,
54 const libMesh::Real k )
const;
59 const libMesh::Real rho,
60 const libMesh::Real Cp,
61 const libMesh::Real k,
63 libMesh::Real &d_res_dT,
64 libMesh::Gradient &d_res_dgradT,
65 libMesh::Tensor &d_res_dhessT,
66 libMesh::Gradient &d_res_dU
71 const libMesh::Real rho,
72 const libMesh::Real Cp
78 const libMesh::Real rho,
79 const libMesh::Real Cp,
81 libMesh::Real &d_res_dTdot
85 libMesh::RealTensor& G,
90 bool is_steady )
const;
93 libMesh::RealTensor& G,
99 libMesh::Real &d_tau_E_d_rho,
100 libMesh::Gradient &d_tau_E_d_U,
101 bool is_steady )
const;
116 libMesh::RealTensor& G,
121 bool is_steady )
const
123 libMesh::Real tau = (rho*cp*U)*(G*(rho*cp*U)) + this->
_C*k*k*G.contract(G);
126 tau += (2.0*rho*cp/c.get_deltat_value())*(2.0*rho*cp/c.get_deltat_value());
135 libMesh::RealTensor& G,
140 libMesh::Real &tau_E,
141 libMesh::Real &d_tau_E_d_rho,
142 libMesh::Gradient &d_tau_E_d_U,
143 bool is_steady )
const
145 libMesh::Gradient rhocpU = rho*cp*U;
146 libMesh::Gradient GrhocpU = G*rhocpU;
147 libMesh::Real rhocpUGrhocpU = rhocpU * GrhocpU;
148 libMesh::Real GG = G.contract(G);
149 tau_E = (rhocpU)*(GrhocpU) + this->_C*k*k*GG;
150 d_tau_E_d_rho = rhocpUGrhocpU*2/rho/cp;
151 d_tau_E_d_U = 2*rho*cp*GrhocpU;
155 libMesh::Real two_rhocp_over_dt = 2*rho*cp/c.get_deltat_value();
156 tau_E += two_rhocp_over_dt * two_rhocp_over_dt;
157 d_tau_E_d_rho += 4*two_rhocp_over_dt/c.get_deltat_value();
163 libMesh::Real root_oldtau = std::sqrt(tau_E);
164 libMesh::Real d_tau_d_oldtau = -this->_tau_factor / (tau_E*root_oldtau) / 2;
166 d_tau_E_d_rho = d_tau_d_oldtau * d_tau_E_d_rho;
167 d_tau_E_d_U = d_tau_d_oldtau * d_tau_E_d_U;
169 tau_E = this->_tau_factor / root_oldtau;
173 #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
PrimitiveTempVariables _temp_vars
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
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
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
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()
libMesh::Real _tau_factor