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.");
30 params.
addParam<MooseFunctorName>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
31 params.
addParam<
bool>(
"newton_solve",
false,
"Whether a Newton nonlinear solve is being used");
38 _dim(_subproblem.
mesh().dimension()),
39 _u_var(getFunctor<
ADReal>(
"u")),
40 _v_var(params.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
41 _w_var(params.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
42 _rho(getFunctor<
ADReal>(
NS::density)),
46 _C_mu(getFunctor<
ADReal>(
"C_mu")),
47 _newton_solve(getParam<bool>(
"newton_solve"))
54 using std::pow, std::abs;
57 FaceInfo::VarFaceNeighbors::ELEM);
58 const Real dist = abs(
62 const auto mu =
_mu(elem_arg, state);
63 const auto rho =
_rho(elem_arg, state);
69 for (
unsigned int i_side = 0; i_side < elem_ptr->n_sides(); ++i_side)
75 velocity(1) = (*_v_var)(elem_arg, state);
77 velocity(2) = (*_w_var)(elem_arg, state);
80 const ADReal parallel_speed =
89 const auto TKE =
_k(elem_arg, state);
93 const auto laminar_value = 2.0 * weight * TKE *
mu /
pow(dist, 2);
99 return laminar_value + 0 *
_mu_t(elem_arg, state);
101 else if (y_plus >= 30.0)
103 const auto turbulent_value =
104 weight *
_C_mu(elem_arg, state) *
pow(abs(TKE), 1.5) / (
_mu_t(elem_arg, state) * dist);
106 return turbulent_value;
109 return turbulent_value + 0 *
mu;
113 const auto laminar_value = 2.0 * weight * TKE *
mu /
pow(dist, 2);
114 const auto turbulent_value =
115 weight *
_C_mu(elem_arg, state) *
pow(abs(TKE), 1.5) / (
_mu_t(elem_arg, state) * dist);
116 const auto interpolation_coef = (y_plus - 5.0) / 25.0;
117 return (interpolation_coef * (turbulent_value - laminar_value) + laminar_value);
DualNumber< Real, DNDerivativeType, true > ADReal
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
registerMooseObject("NavierStokesApp", INSFVTKEDWallFunctionBC)
MooseVariableFV< Real > & _var
static InputParameters validParams()
const Point & normal() const
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
const Elem * neighborPtr() const
const Elem * elemPtr() const
const Point & neighborCentroid() const
const Point & elemCentroid() const
const Point & faceCentroid() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
Applies a wall function to the turbulent kinetic energy dissipation rate.
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
static InputParameters validParams()
const Moose::Functor< ADReal > & _k
Turbulent kinetic energy.
const Moose::Functor< ADReal > * _v_var
y-velocity
const Moose::Functor< ADReal > * _w_var
z-velocity
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
const bool _newton_solve
Whether we are using a newton solve.
const Moose::Functor< ADReal > & _rho
Density.
INSFVTKEDWallFunctionBC(const InputParameters ¶meters)
const Moose::Functor< ADReal > & _mu_t
Turbulent dynamic viscosity.
const Moose::Functor< ADReal > & _C_mu
C_mu turbulent coefficient.
const Moose::Functor< ADReal > & _u_var
x-velocity
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
unsigned int number() const
virtual MooseMesh & mesh()=0
unsigned int number() const
static const std::string density
static const std::string mu_t
template ADReal computeSpeed< ADReal >(const libMesh::VectorValue< ADReal > &velocity)
static const std::string mu
static const std::string TKE
template ADReal findUStar< ADReal >(const ADReal &mu, const ADReal &rho, const ADReal &u, const Real dist)