20 params.
addClassDescription(
"Adds Dirichlet BC for wall values of the turbulent viscosity.");
21 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
22 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
23 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
27 params.
addParam<MooseFunctorName>(
"k",
"The turbulent kinetic energy.");
29 params.
addParam<
Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
31 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
33 "wall_treatment", wall_treatment,
"The method used for computing the wall functions");
40 _dim(_subproblem.
mesh().dimension()),
41 _u_var(getFunctor<
ADReal>(
"u")),
42 _v_var(params.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
43 _w_var(params.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
48 _C_mu(getParam<
Real>(
"C_mu")),
50 _preserve_sparsity_pattern(_fv_problem.preserveMatrixSparsityPattern())
59 const Elem & _current_elem = fi.
elem();
60 const auto current_argument =
makeElemArg(&_current_elem);
63 const auto mu =
_mu(current_argument, old_state);
64 const auto rho =
_rho(current_argument, old_state);
69 velocity(1) = (*_v_var)(current_argument, old_state);
71 velocity(2) = (*_w_var)(current_argument, old_state);
86 y_plus = wall_dist * u_tau * rho /
mu;
87 mu_wall = rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
88 mut_log = mu_wall -
mu;
93 y_plus =
NS::findyPlus(
mu, rho, std::max(parallel_speed, 1e-10), wall_dist);
96 mut_log = mu_wall -
mu;
104 const ADReal c_c = parallel_speed;
106 const auto u_tau = (-b_c + std::sqrt(
std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
107 y_plus = wall_dist * u_tau * rho /
mu;
108 mu_wall = rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
109 mut_log = mu_wall -
mu;
115 std::pow(
_C_mu, 0.25) * wall_dist * std::sqrt(
_k(current_argument, old_state)) * rho /
mu;
118 mut_log = mu_wall -
mu;
122 "For `INSFVTurbulentViscosityWallFunction` , wall treatment should not reach here");
127 residual = 0 * mut_log * y_plus;
132 else if (y_plus >= 30.0)
138 const auto blending_function = (y_plus - 5.0) / 25.0;
static constexpr Real von_karman_constant
static const std::string mu_t
const Elem & elem() const
const Moose::Functor< ADReal > * _v_var
y-velocity
Applies a wall function to the turbulent viscosity field.
static InputParameters validParams()
const Point & faceCentroid() const
static const std::string density
static const std::string TKE
WallTreatmentEnum
Wall treatment options.
const Moose::Functor< ADReal > * _w_var
z-velocity
DualNumber< Real, DNDerivativeType, true > ADReal
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
INSFVTurbulentViscosityWallFunction(const InputParameters ¶meters)
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
const Point & elemCentroid() const
static InputParameters validParams()
static const std::string mu
const Moose::Functor< ADReal > & _k
Turbulent kinetic energy.
registerMooseObject("NavierStokesApp", INSFVTurbulentViscosityWallFunction)
NS::WallTreatmentEnum _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 > & _u_var
x-velocity
const Point & normal() const
const Real _C_mu
C_mu turbulent coefficient.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static constexpr Real E_turb_constant
const bool _preserve_sparsity_pattern
For Newton solves we want to add extra zero-valued terms regardless of y-plus to avoid sparsity patte...
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 > & _rho
Density.
static constexpr Real mu_t_low_limit
ADReal computeSpeed(const ADRealVectorValue &velocity)
Compute the speed (velocity norm) given the supplied velocity.
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
MooseUnits pow(const MooseUnits &, int)