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>(
"k",
"Turbulent kinetic energy functor.");
33 params.
addParam<
Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
34 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
36 "wall_treatment", wall_treatment,
"The method used for computing the wall functions");
38 params.
addParam<
bool>(
"newton_solve",
false,
"Whether a Newton nonlinear solve is being used");
46 _dim(_subproblem.
mesh().dimension()),
47 _T_w(getFunctor<
ADReal>(
"T_w")),
48 _u_var(getFunctor<
ADReal>(
"u")),
49 _v_var(parameters.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
50 _w_var(parameters.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
55 _Pr_t(getFunctor<
ADReal>(
"Pr_t")),
57 _C_mu(getParam<
Real>(
"C_mu")),
58 _wall_treatment(getParam<
MooseEnum>(
"wall_treatment")),
59 _newton_solve(getParam<bool>(
"newton_solve"))
69 const Elem & _current_elem = fi.
elem();
70 const auto current_argument =
makeElemArg(&_current_elem);
73 const auto mu =
_mu(current_argument, state);
74 const auto rho =
_rho(current_argument, state);
75 const auto cp =
_cp(current_argument, state);
81 velocity(1) = (*_v_var)(current_argument, state);
83 velocity(2) = (*_w_var)(current_argument, state);
86 const ADReal parallel_speed =
96 y_plus = wall_dist * u_tau * rho /
mu;
101 y_plus =
NS::findyPlus(
mu, rho, std::max(parallel_speed, 1e-10), wall_dist);
111 const ADReal c_c = parallel_speed;
113 u_tau = (-b_c + std::sqrt(
std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
114 y_plus = wall_dist * u_tau * rho /
mu;
119 y_plus = wall_dist * std::sqrt(std::sqrt(
_C_mu) *
_k(current_argument, old_state)) * rho /
mu;
129 else if (y_plus >= 30.0)
132 const auto Pr_ratio = Pr /
_Pr_t(current_argument, state);
133 const auto jayatilleke_P =
134 9.24 * (
std::pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 * std::exp(-0.007 * Pr_ratio));
135 const auto wall_scaling =
137 alpha = u_tau * wall_dist / (
_Pr_t(current_argument, state) * wall_scaling);
141 const auto alpha_lam =
kappa / (rho *
cp);
143 const auto Pr_t =
_Pr_t(current_argument, state);
144 const auto Pr_ratio = Pr / Pr_t;
145 const auto jayatilleke_P =
146 9.24 * (
std::pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 * std::exp(-0.007 * Pr_ratio));
147 const auto wall_scaling =
149 const auto alpha_turb = u_tau * wall_dist / (Pr_t * wall_scaling);
150 const auto blending_function = (y_plus - 5.0) / 25.0;
151 alpha = blending_function * alpha_turb + (1.0 - blending_function) * alpha_lam;
156 alpha += 0 *
kappa * (rho *
cp) + 0 * u_tau *
_Pr_t(current_argument, state) * y_plus;
159 return -rho *
cp *
alpha * (
_T_w(face_arg, state) -
_var(current_argument, state)) / wall_dist;
static constexpr Real von_karman_constant
INSFVTurbulentTemperatureWallFunction(const InputParameters ¶meters)
const FaceInfo * _face_info
static InputParameters validParams()
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
const Elem & elem() const
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
DualNumber< Real, DNDerivativeType, true > ADReal
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 Point & elemCentroid() const
static const std::string mu
const MooseEnum _wall_treatment
Method used for wall treatment.
ADReal findyPlus(const ADReal &mu, const ADReal &rho, const ADReal &u, Real dist)
Finds the non-dimensional wall distance normalized with the friction velocity Implements a fixed-poin...
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 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
const Moose::Functor< ADReal > & _k
Turbulent kinetic energy.
static constexpr Real E_turb_constant
static const std::string alpha
const Moose::Functor< ADReal > * _w_var
z-velocity
static const std::string velocity
ADReal findUStar(const ADReal &mu, const ADReal &rho, const ADReal &u, Real dist)
Finds the friction velocity using standard velocity wall functions formulation.
const Moose::Functor< ADReal > * _v_var
y-velocity
ADReal computeSpeed(const ADRealVectorValue &velocity)
Compute the speed (velocity norm) given the supplied velocity.
This boundary condition applies a wall function for the energy equation for turbulent flows...
MooseUnits pow(const MooseUnits &, int)