25 #ifndef GRINS_SPALART_ALLMARAS_STAB_HELPER_H
26 #define GRINS_SPALART_ALLMARAS_STAB_HELPER_H
44 class TurbulenceFEVariables;
56 libMesh::RealGradient& g,
57 libMesh::RealTensor& G,
61 bool is_steady )
const;
65 libMesh::RealGradient& g,
66 libMesh::RealTensor& G,
71 libMesh::Real &d_tau_M_d_rho,
72 libMesh::Gradient &d_tau_M_d_U,
73 bool is_steady )
const;
77 libMesh::Real mat_prop_sq,
78 libMesh::RealGradient& g,
79 libMesh::RealTensor& G,
82 bool is_steady )
const;
86 libMesh::Real mat_prop_sq,
87 libMesh::RealGradient& g,
88 libMesh::RealTensor& G,
92 libMesh::Real& d_tau_d_rho,
93 libMesh::Gradient& d_tau_d_U,
94 bool is_steady )
const;
99 const libMesh::Real rho,
100 const libMesh::Real mu,
101 const libMesh::Real distance_qp,
102 const bool infinite_distance)
const;
106 const libMesh::Real rho,
107 const libMesh::Real mu,
108 libMesh::Gradient &res_M,
109 libMesh::Tensor &d_res_M_dgradp,
110 libMesh::Tensor &d_res_M_dU,
111 libMesh::Gradient &d_res_Muvw_dgraduvw,
112 libMesh::Tensor &d_res_Muvw_dhessuvw
117 const libMesh::Real rho )
const;
121 const libMesh::Real rho,
122 libMesh::RealGradient &res_M,
123 libMesh::Real &d_res_Muvw_duvw
129 (
const std::string & param_name,
153 libMesh::RealGradient& g,
154 libMesh::RealTensor& G,
158 bool is_steady )
const
160 return this->
compute_tau( c, qp, mu*mu, g, G, rho, U, is_steady );
167 libMesh::RealGradient& g,
168 libMesh::RealTensor& G,
172 libMesh::Real& tau_M,
173 libMesh::Real &d_tau_M_d_rho,
174 libMesh::Gradient &d_tau_M_d_U,
175 bool is_steady )
const
177 this->compute_tau_and_derivs( c, qp, mu*mu, g, G, rho, U, tau_M,
178 d_tau_M_d_rho, d_tau_M_d_U,
186 libMesh::Real mat_prop_sq,
187 libMesh::RealGradient& ,
188 libMesh::RealTensor& G,
191 bool is_steady )
const
193 libMesh::Real tau = (rho*U)*(G*(rho*U)) + this->
_C*mat_prop_sq*G.contract(G);
196 tau += (2.0*rho/c.get_deltat_value())*(2.0*rho/c.get_deltat_value());
206 libMesh::Real mat_prop_sq,
207 libMesh::RealGradient& ,
208 libMesh::RealTensor& G,
212 libMesh::Real& d_tau_d_rho,
213 libMesh::Gradient& d_tau_d_U,
214 bool is_steady )
const
216 libMesh::Gradient rhoU = rho*U;
217 libMesh::Gradient GrhoU = G*rhoU;
218 libMesh::Real rhoUGrhoU = rhoU * GrhoU;
219 libMesh::Real GG = G.contract(G);
220 tau = rhoUGrhoU + this->_C*mat_prop_sq*GG;
221 d_tau_d_rho = rhoUGrhoU*2/rho;
222 d_tau_d_U = 2*rho*GrhoU;
226 libMesh::Real two_rho_over_dt = 2*rho/c.get_deltat_value();
227 tau += two_rho_over_dt * two_rho_over_dt;
228 d_tau_d_rho += 4*two_rho_over_dt/c.get_deltat_value();
234 libMesh::Real root_oldtau = std::sqrt(tau);
235 libMesh::Real d_tau_d_oldtau = -this->_tau_factor / (tau*root_oldtau) / 2;
237 d_tau_d_rho = d_tau_d_oldtau * d_tau_d_rho;
238 d_tau_d_U = d_tau_d_oldtau * d_tau_d_U;
240 tau = this->_tau_factor / root_oldtau;
244 #endif // GRINS_SPALART_ALLMARAS_STAB_HELPER_H
void compute_res_spalart_transient_and_derivs(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, libMesh::RealGradient &res_M, libMesh::Real &d_res_Muvw_duvw) const
const TurbulenceFEVariables & _turbulence_vars
~SpalartAllmarasStabilizationHelper()
libMesh::Real compute_tau(AssemblyContext &c, unsigned int qp, libMesh::Real mat_prop_sq, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, bool is_steady) const
libMesh::Real compute_res_spalart_transient(AssemblyContext &context, unsigned int qp, const libMesh::Real rho) const
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.
void compute_tau_and_derivs(AssemblyContext &c, unsigned int qp, libMesh::Real mat_prop_sq, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real &tau, libMesh::Real &d_tau_d_rho, libMesh::Gradient &d_tau_d_U, bool is_steady) const
libMesh::Real _tau_factor
libMesh::Real compute_tau_spalart(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
SpalartAllmarasHelper _spalart_allmaras_helper
const PressureFEVariable & _press_var
const VelocityVariable & _flow_vars
SpalartAllmarasStabilizationHelper(const std::string &helper_name, const GetPot &input)
SpalartAllmarasParameters _sa_params
Encapsulate Spalart-Allmaras model parameters.
void compute_res_spalart_steady_and_derivs(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real mu, libMesh::Gradient &res_M, libMesh::Tensor &d_res_M_dgradp, libMesh::Tensor &d_res_M_dU, libMesh::Gradient &d_res_Muvw_dgraduvw, libMesh::Tensor &d_res_Muvw_dhessuvw) const
libMesh::Real compute_res_spalart_steady(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real mu, const libMesh::Real distance_qp, const bool infinite_distance) const
void compute_tau_spalart_and_derivs(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real T, libMesh::Real &tau_M, libMesh::Real &d_tau_M_d_rho, libMesh::Gradient &d_tau_M_d_U, bool is_steady) const