25 #ifndef GRINS_INC_NAVIER_STOKES_STAB_HELPER_H
26 #define GRINS_INC_NAVIER_STOKES_STAB_HELPER_H
38 class VelocityVariable;
39 class PressureFEVariable;
46 (
const std::string & helper_name,
47 const GetPot& input );
52 libMesh::RealGradient& g )
const;
55 libMesh::Real d_tau_M_d_rho,
56 libMesh::Gradient d_tau_M_d_U,
57 libMesh::RealGradient& g,
59 libMesh::Real &d_tau_C_d_rho,
60 libMesh::Gradient &d_tau_C_d_U
65 libMesh::RealGradient& g,
66 libMesh::RealTensor& G,
70 bool is_steady )
const;
74 libMesh::RealGradient& g,
75 libMesh::RealTensor& G,
80 libMesh::Real &d_tau_M_d_rho,
81 libMesh::Gradient &d_tau_M_d_U,
82 bool is_steady )
const;
86 libMesh::Real mat_prop_sq,
87 libMesh::RealGradient& g,
88 libMesh::RealTensor& G,
91 bool is_steady )
const;
95 libMesh::Real mat_prop_sq,
96 libMesh::RealGradient& g,
97 libMesh::RealTensor& G,
101 libMesh::Real& d_tau_d_rho,
102 libMesh::Gradient& d_tau_d_U,
103 bool is_steady )
const;
108 unsigned int qp )
const;
112 libMesh::Real &res_C,
113 libMesh::Tensor &d_res_C_dgradU )
const;
117 const libMesh::Real rho,
118 const libMesh::Real mu )
const;
122 const libMesh::Real rho,
123 const libMesh::Real mu,
124 libMesh::Gradient &res_M,
125 libMesh::Tensor &d_res_M_dgradp,
126 libMesh::Tensor &d_res_M_dU,
127 libMesh::Gradient &d_res_Muvw_dgraduvw,
128 libMesh::Tensor &d_res_Muvw_dhessuvw
133 const libMesh::Real rho )
const;
137 const libMesh::Real rho,
138 libMesh::RealGradient &res_M,
139 libMesh::Real &d_res_Muvw_duvw
143 libMesh::RealGradient
UdotGradU( libMesh::Gradient& U, libMesh::Gradient& grad_u )
const;
146 libMesh::RealGradient
UdotGradU( libMesh::Gradient& U, libMesh::Gradient& grad_u,
147 libMesh::Gradient& grad_v )
const;
150 libMesh::RealGradient
UdotGradU( libMesh::Gradient& U, libMesh::Gradient& grad_u,
151 libMesh::Gradient& grad_v, libMesh::Gradient& grad_w )
const;
154 libMesh::RealGradient
div_GradU( libMesh::RealTensor& hess_u )
const;
156 libMesh::RealGradient
div_GradU( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v )
const;
158 libMesh::RealGradient
div_GradU_axi( libMesh::Real r,
const libMesh::Gradient& U,
159 const libMesh::Gradient& grad_u,
const libMesh::Gradient& grad_v,
160 const libMesh::RealTensor& hess_u,
const libMesh::RealTensor& hess_v )
const;
163 libMesh::RealGradient
div_GradU( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v,
164 libMesh::RealTensor& hess_w )
const;
167 libMesh::RealGradient
div_GradU_T( libMesh::RealTensor& hess_u )
const;
169 libMesh::RealGradient
div_GradU_T( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v )
const;
171 libMesh::RealGradient
div_GradU_T_axi( libMesh::Real r,
const libMesh::Gradient& U,
const libMesh::Gradient& grad_u,
172 const libMesh::RealTensor& hess_u,
const libMesh::RealTensor& hess_v )
const;
175 libMesh::RealGradient
div_GradU_T( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v,
176 libMesh::RealTensor& hess_w )
const;
179 libMesh::RealGradient
div_divU_I( libMesh::RealTensor& hess_u )
const;
181 libMesh::RealGradient
div_divU_I( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v )
const;
183 libMesh::RealGradient
div_divU_I_axi( libMesh::Real r,
const libMesh::Gradient& U,
const libMesh::Gradient& grad_u,
184 const libMesh::RealTensor& hess_u,
const libMesh::RealTensor& hess_v )
const;
187 libMesh::RealGradient
div_divU_I( libMesh::RealTensor& hess_u, libMesh::RealTensor& hess_v,
188 libMesh::RealTensor& hess_w )
const;
203 libMesh::RealGradient& g )
const
210 ( libMesh::Real tau_M,
211 libMesh::Real d_tau_M_d_rho,
212 libMesh::Gradient d_tau_M_d_U,
213 libMesh::RealGradient& g,
214 libMesh::Real &tau_C,
215 libMesh::Real &d_tau_C_d_rho,
216 libMesh::Gradient &d_tau_C_d_U
219 tau_C = this->_tau_factor/(tau_M*(g*g));
220 libMesh::Real d_tau_C_d_tau_M = -tau_C/tau_M;
221 d_tau_C_d_rho = d_tau_C_d_tau_M * d_tau_M_d_rho;
222 d_tau_C_d_U = d_tau_C_d_tau_M * d_tau_M_d_U;
228 libMesh::RealGradient& g,
229 libMesh::RealTensor& G,
233 bool is_steady )
const
235 return this->
compute_tau( c, qp, mu*mu, g, G, rho, U, is_steady );
242 libMesh::RealGradient& g,
243 libMesh::RealTensor& G,
247 libMesh::Real& tau_M,
248 libMesh::Real &d_tau_M_d_rho,
249 libMesh::Gradient &d_tau_M_d_U,
250 bool is_steady )
const
252 this->compute_tau_and_derivs( c, qp, mu*mu, g, G, rho, U, tau_M,
253 d_tau_M_d_rho, d_tau_M_d_U,
261 libMesh::Real mat_prop_sq,
262 libMesh::RealGradient& ,
263 libMesh::RealTensor& G,
266 bool is_steady )
const
268 libMesh::Real tau = (rho*U)*(G*(rho*U)) + this->
_C*mat_prop_sq*G.contract(G);
271 tau += (2.0*rho/c.get_deltat_value())*(2.0*rho/c.get_deltat_value());
281 libMesh::Real mat_prop_sq,
282 libMesh::RealGradient& ,
283 libMesh::RealTensor& G,
287 libMesh::Real& d_tau_d_rho,
288 libMesh::Gradient& d_tau_d_U,
289 bool is_steady )
const
291 libMesh::Gradient rhoU = rho*U;
292 libMesh::Gradient GrhoU = G*rhoU;
293 libMesh::Real rhoUGrhoU = rhoU * GrhoU;
294 libMesh::Real GG = G.contract(G);
295 tau = rhoUGrhoU + this->_C*mat_prop_sq*GG;
296 d_tau_d_rho = rhoUGrhoU*2/rho;
297 d_tau_d_U = 2*rho*GrhoU;
301 libMesh::Real two_rho_over_dt = 2*rho/c.get_deltat_value();
302 tau += two_rho_over_dt * two_rho_over_dt;
303 d_tau_d_rho += 4*two_rho_over_dt/c.get_deltat_value();
309 libMesh::Real root_oldtau = std::sqrt(tau);
310 libMesh::Real d_tau_d_oldtau = -this->_tau_factor / (tau*root_oldtau) / 2;
312 d_tau_d_rho = d_tau_d_oldtau * d_tau_d_rho;
313 d_tau_d_U = d_tau_d_oldtau * d_tau_d_U;
315 tau = this->_tau_factor / root_oldtau;
319 #endif // GRINS_INC_NAVIER_STOKES_STAB_HELPER_H
libMesh::RealGradient div_GradU_T(libMesh::RealTensor &hess_u) const
void compute_tau_momentum_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
libMesh::RealGradient div_divU_I_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
libMesh::Real compute_tau_continuity(libMesh::Real tau_C, libMesh::RealGradient &g) const
libMesh::RealGradient compute_res_momentum_steady(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, const libMesh::Real mu) const
libMesh::RealGradient UdotGradU(libMesh::Gradient &U, libMesh::Gradient &grad_u) const
libMesh::RealGradient compute_res_momentum_transient(AssemblyContext &context, unsigned int qp, const libMesh::Real rho) const
const VelocityVariable & _flow_vars
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::RealGradient div_GradU_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::Gradient &grad_v, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
void compute_tau_continuity_and_derivs(libMesh::Real tau_M, libMesh::Real d_tau_M_d_rho, libMesh::Gradient d_tau_M_d_U, libMesh::RealGradient &g, libMesh::Real &tau_C, libMesh::Real &d_tau_C_d_rho, libMesh::Gradient &d_tau_C_d_U) const
const PressureFEVariable & _press_var
libMesh::RealGradient div_GradU(libMesh::RealTensor &hess_u) const
void compute_res_momentum_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
void compute_res_momentum_transient_and_derivs(AssemblyContext &context, unsigned int qp, const libMesh::Real rho, libMesh::RealGradient &res_M, libMesh::Real &d_res_Muvw_duvw) const
libMesh::Real compute_tau_momentum(AssemblyContext &c, unsigned int qp, libMesh::RealGradient &g, libMesh::RealTensor &G, libMesh::Real rho, libMesh::Gradient U, libMesh::Real mu, bool is_steady) const
void compute_res_continuity_and_derivs(AssemblyContext &context, unsigned int qp, libMesh::Real &res_C, libMesh::Tensor &d_res_C_dgradU) const
libMesh::RealGradient div_divU_I(libMesh::RealTensor &hess_u) const
libMesh::RealGradient div_GradU_T_axi(libMesh::Real r, const libMesh::Gradient &U, const libMesh::Gradient &grad_u, const libMesh::RealTensor &hess_u, const libMesh::RealTensor &hess_v) const
IncompressibleNavierStokesStabilizationHelper(const std::string &helper_name, const GetPot &input)
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
~IncompressibleNavierStokesStabilizationHelper()
libMesh::Real compute_res_continuity(AssemblyContext &context, unsigned int qp) const
libMesh::Real _tau_factor