36 #include "libmesh/getpot.h"
37 #include "libmesh/mesh.h"
38 #include "libmesh/fem_system.h"
46 _C( input(
"Stabilization/tau_constant_vel", input(
"Stabilization/tau_constant", 1.0 ) ) ),
47 _tau_factor( input(
"Stabilization/tau_factor_vel", input(
"Stabilization/tau_factor", 0.5 ) ) ),
51 _spalart_allmaras_helper(input),
54 this->
set_parameter(this->
_C ,input,
"Stabilization/tau_constant_vel" , this->
_C );
63 this->_sa_params.register_parameter(param_name, param_pointer);
67 unsigned int qp,
const libMesh::Real rho,
const libMesh::Real mu,
const libMesh::Real distance_qp,
const bool infinite_distance)
const
71 u = context.interior_value(this->
_flow_vars.
u(), qp);
72 v = context.interior_value(this->
_flow_vars.
v(), qp);
74 libMesh::NumberVectorValue U(u,v);
76 U(2) = context.interior_value(this->
_flow_vars.
w(), qp);
78 libMesh::RealGradient grad_u = context.fixed_interior_gradient(this->
_flow_vars.
u(), qp);
79 libMesh::RealGradient grad_v = context.fixed_interior_gradient(this->
_flow_vars.
v(), qp);
83 libMesh::RealGradient grad_nu = context.fixed_interior_gradient(this->
_turbulence_vars.
nu(), qp);
85 libMesh::RealTensor hess_nu = context.fixed_interior_hessian(this->
_turbulence_vars.
nu(), qp);
88 libMesh::Number rhoUdotGradnu = rho*(U*grad_nu);
91 libMesh::Number inv_sigmadivnuplusnuphysicalGradnu = (1./this->
_sa_params.
get_sigma())*(grad_nu*grad_nu + ((nu_value + mu)*(hess_nu(0,0) + hess_nu(1,1) + (this->
_flow_vars.
dim() == 3)?hess_nu(2,2):0)) + this->
_sa_params.
get_cb2()*grad_nu*grad_nu);
95 libMesh::Real S_tilde = this->
_sa_params.
source_fn(nu_value, mu, distance_qp, vorticity_value_qp, infinite_distance);
103 libMesh::Real destruction_term = 0.0;
104 if(infinite_distance)
106 destruction_term = 0.0;
110 destruction_term = cw1*fw*pow(nu_value/distance_qp, 2.);
113 return rhoUdotGradnu + source_term + inv_sigmadivnuplusnuphysicalGradnu - destruction_term;
118 unsigned int ,
const libMesh::Real ,
const libMesh::Real ,
127 libmesh_not_implemented();
142 const libMesh::Real ,
143 libMesh::RealGradient& ,
147 libmesh_not_implemented();
virtual void set_parameter(libMesh::Number ¶m_variable, const GetPot &input, const std::string ¶m_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
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
libMesh::Real source_fn(libMesh::Number nu, libMesh::Real mu, libMesh::Real wall_distance, libMesh::Real vorticity_value, bool infinite_distance) const
libMesh::Real get_sigma() const
libMesh::Real get_cb2() 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.
libMesh::Real _tau_factor
SpalartAllmarasHelper _spalart_allmaras_helper
libMesh::Real vorticity(AssemblyContext &context, unsigned int qp) const
libMesh::Real get_cb1() const
const VelocityVariable & _flow_vars
SpalartAllmarasStabilizationHelper(const std::string &helper_name, const GetPot &input)
SpalartAllmarasParameters _sa_params
libMesh::Real destruction_fn(libMesh::Number nu, libMesh::Real wall_distance, libMesh::Real S_tilde, bool infinite_distance) const
libMesh::Real get_kappa() const
unsigned int dim() const
Number of components.
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_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