22 "Dirichlet BC for the turbulent kinetic energy dissipation rate.");
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.");
29 params.
addRequiredParam<MooseFunctorName>(
"k",
"The turbulent kinetic energy.");
31 params.
addParam<MooseFunctorName>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
32 params.
addParam<
bool>(
"newton_solve",
false,
"Whether a Newton nonlinear solve is being used");
39 _dim(_subproblem.
mesh().dimension()),
40 _u_var(getFunctor<
ADReal>(
"u")),
41 _v_var(params.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
42 _w_var(params.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
47 _C_mu(getFunctor<
ADReal>(
"C_mu")),
48 _newton_solve(getParam<bool>(
"newton_solve"))
57 const Real dist = std::abs(
61 const auto mu =
_mu(elem_arg, state);
62 const auto rho =
_rho(elem_arg, state);
68 for (
unsigned int i_side = 0; i_side < elem_ptr->n_sides(); ++i_side)
74 velocity(1) = (*_v_var)(elem_arg, state);
76 velocity(2) = (*_w_var)(elem_arg, state);
79 const ADReal parallel_speed =
86 const ADReal y_plus = dist * u_star * rho /
mu;
88 const auto TKE =
_k(elem_arg, state);
98 return laminar_value + 0 *
_mu_t(elem_arg, state);
100 else if (y_plus >= 30.0)
103 (
_mu_t(elem_arg, state) * dist);
105 return turbulent_value;
108 return turbulent_value + 0 *
mu;
114 (
_mu_t(elem_arg, state) * dist);
115 const auto interpolation_coef = (y_plus - 5.0) / 25.0;
116 return (interpolation_coef * (turbulent_value - laminar_value) + laminar_value);
const Moose::Functor< ADReal > & _rho
Density.
virtual MooseMesh & mesh()=0
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
static const std::string mu_t
const Moose::Functor< ADReal > & _mu_t
Turbulent dynamic viscosity.
unsigned int number() const
const Point & faceCentroid() const
static const std::string density
static const std::string TKE
const Moose::Functor< ADReal > & _C_mu
C_mu turbulent coefficient.
static InputParameters validParams()
MooseVariableFV< Real > & _var
const Moose::Functor< ADReal > * _v_var
y-velocity
const Point & neighborCentroid() const
DualNumber< Real, DNDerivativeType, true > ADReal
const Moose::Functor< ADReal > & _k
Turbulent kinetic energy.
const Moose::Functor< ADReal > & _u_var
x-velocity
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
const Elem * neighborPtr() const
const Point & elemCentroid() const
static InputParameters validParams()
static const std::string mu
template ADReal findUStar< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, const Real dist)
const Point & normal() const
unsigned int number() const
const Elem * elemPtr() const
const Moose::Functor< ADReal > * _w_var
z-velocity
registerMooseObject("NavierStokesApp", INSFVTKEDWallFunctionBC)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template ADReal computeSpeed< ADReal >(const libMesh::VectorValue< ADReal > &velocity)
const bool _newton_solve
Whether we are using a newton solve.
Applies a wall function to the turbulent kinetic energy dissipation rate.
static const std::string velocity
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
MooseUnits pow(const MooseUnits &, int)
INSFVTKEDWallFunctionBC(const InputParameters ¶meters)
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const