23 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
24 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
25 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
30 params.
addParam<MooseFunctorName>(
"Pr_t", 0.58,
"The turbulent Prandtl number.");
31 params.
addParam<MooseFunctorName>(
NS::TKE,
"Turbulent kinetic energy functor.");
32 params.
addParam<
Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
33 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
35 "wall_treatment", wall_treatment,
"The method used for computing the wall functions");
37 params.
addParam<
bool>(
"newton_solve",
false,
"Whether a Newton nonlinear solve is being used");
45 _dim(_subproblem.
mesh().dimension()),
46 _T_w(getFunctor<
ADReal>(
"T_w")),
47 _u_var(getFunctor<
ADReal>(
"u")),
48 _v_var(parameters.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
49 _w_var(parameters.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
54 _Pr_t(getFunctor<
ADReal>(
"Pr_t")),
56 _C_mu(getParam<
Real>(
"C_mu")),
57 _wall_treatment(getParam<
MooseEnum>(
"wall_treatment")),
58 _newton_solve(getParam<bool>(
"newton_solve"))
65 using std::abs, std::log, std::max, std::sqrt,
std::pow, std::exp;
78 const auto mu =
_mu(elem_arg, state);
79 const auto rho =
_rho(elem_arg, state);
80 const auto cp =
_cp(elem_arg, state);
86 velocity(1) = (*_v_var)(elem_arg, state);
88 velocity(2) = (*_w_var)(elem_arg, state);
91 const ADReal parallel_speed =
101 y_plus = wall_dist * u_tau * rho /
mu;
107 u_tau = parallel_speed /
116 const ADReal c_c = parallel_speed;
118 u_tau = (-b_c +
sqrt(
pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
119 y_plus = wall_dist * u_tau * rho /
mu;
125 u_tau = parallel_speed /
134 else if (y_plus >= 30.0)
137 const auto Pr_ratio = Pr /
_Pr_t(elem_arg, state);
138 const auto jayatilleke_P =
139 9.24 * (
pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 *
exp(-0.007 * Pr_ratio));
140 const auto wall_scaling =
142 alpha = u_tau * wall_dist / (
_Pr_t(elem_arg, state) * wall_scaling);
146 const auto alpha_lam =
kappa / (rho *
cp);
148 const auto Pr_t =
_Pr_t(elem_arg, state);
149 const auto Pr_ratio = Pr / Pr_t;
150 const auto jayatilleke_P =
151 9.24 * (
pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 *
exp(-0.007 * Pr_ratio));
152 const auto wall_scaling =
154 const auto alpha_turb = u_tau * wall_dist / (Pr_t * wall_scaling);
155 const auto blending_function = (y_plus - 5.0) / 25.0;
156 alpha = blending_function * alpha_turb + (1.0 - blending_function) * alpha_lam;
164 return -rho *
cp *
alpha * (
_T_w(face_arg, state) -
_var(elem_arg, state)) / wall_dist;
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
static constexpr Real von_karman_constant
INSFVTurbulentTemperatureWallFunction(const InputParameters ¶meters)
const FaceInfo * _face_info
FaceInfo::VarFaceNeighbors _face_type
static InputParameters validParams()
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
const bool _newton_solve
For Newton solves we want to add extra zero-valued terms regardless of y-plus to avoid sparsity patte...
Moose::StateArg determineState() const
const Point & faceCentroid() const
registerADMooseObject("NavierStokesApp", INSFVTurbulentTemperatureWallFunction)
static const std::string density
static const std::string TKE
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
MooseVariableFV< Real > & _var
const Point & neighborCentroid() const
DualNumber< Real, DNDerivativeType, true > ADReal
auto max(const L &left, const R &right)
virtual ADReal computeQpResidual() override
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
static const std::string cp
const Moose::Functor< ADReal > & _rho
Density.
const Moose::Functor< ADReal > & _u_var
x-velocity
const Elem * neighborPtr() const
const Point & elemCentroid() const
static const std::string mu
const MooseEnum _wall_treatment
Method used for wall treatment.
template ADReal findUStar< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, const Real dist)
const Moose::Functor< ADReal > & _T_w
Wall Temperature.
const Point & normal() const
const Moose::Functor< ADReal > & _kappa
Thermal conductivity.
const Moose::Functor< ADReal > & _Pr_t
Turbulent Prandtl number near the wall.
const Elem * elemPtr() const
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _C_mu
C_mu turbulent coefficient.
static InputParameters validParams()
const Moose::Functor< ADReal > & _cp
The specific heat at constant pressure.
static const std::string kappa
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template ADReal computeSpeed< ADReal >(const libMesh::VectorValue< ADReal > &velocity)
const Moose::Functor< ADReal > & _k
Turbulent kinetic energy.
static constexpr Real E_turb_constant
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
static const std::string alpha
const Moose::Functor< ADReal > * _w_var
z-velocity
template ADReal findyPlus< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, Real dist)
static const std::string velocity
const Moose::Functor< ADReal > * _v_var
y-velocity
This boundary condition applies a wall function for the energy equation for turbulent flows...
MooseUnits pow(const MooseUnits &, int)