20 "Calculates y+ value according to the algebraic velocity standard wall function.");
22 params.
addCoupledVar(
"v",
"The velocity in the y direction.");
23 params.
addCoupledVar(
"w",
"The velocity in the z direction.");
27 "Boundaries that correspond to solid walls");
33 _dim(_subproblem.
mesh().dimension()),
35 _v_var(params.isParamValid(
"v")
38 _w_var(params.isParamValid(
"w")
41 _rho(getFunctor<
ADReal>(
"rho")),
42 _mu(getFunctor<
ADReal>(
"mu")),
43 _wall_boundary_names(getParam<
std::vector<BoundaryName>>(
"walls"))
46 paramError(
"u",
"the u velocity must be an INSFVVelocityVariable.");
50 "In two or more dimensions, the v velocity must be supplied and it must be an " 51 "INSFVVelocityVariable.");
55 "In three-dimensions, the w velocity must be supplied and it must be an " 56 "INSFVVelocityVariable.");
64 bool wall_bounded =
false;
65 Real min_wall_dist = 1e10;
68 for (
unsigned int i_side = 0; i_side < elem.n_sides(); ++i_side)
70 const std::vector<BoundaryID> side_bnds =
80 const Point & this_normal = fi->
normal();
81 Point this_wall_vec = (elem.vertex_average() - fi->
faceCentroid());
82 Real dist = std::abs(this_wall_vec * normal);
83 if (dist < min_wall_dist)
86 wall_vec = this_wall_vec;
108 Real dist = std::abs(wall_vec * normal);
111 ADReal parallel_speed = parallel_velocity.
norm();
114 if (parallel_speed.value() < 1e-6)
117 if (!std::isfinite(parallel_speed.value()))
118 return parallel_speed.value();
122 const auto rho =
_rho(elem_arg, state);
123 const auto mu =
_mu(elem_arg, state);
125 ADReal tau = u_star * u_star * rho;
127 return (dist * u_star * rho /
mu).value();
virtual MooseMesh & mesh()=0
const std::vector< BoundaryName > & _wall_boundary_names
Wall boundaries.
auto norm() const -> decltype(std::norm(T()))
Moose::StateArg determineState() const
const boundary_id_type side_id
const Point & faceCentroid() const
virtual Real computeValue() override
DualNumber< Real, DNDerivativeType, true > ADReal
virtual const std::string & name() const
ADReal getElemValue(const Elem *elem, const StateArg &state) const
const INSFVVelocityVariable *const _v_var
y-velocity
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
const std::vector< const FaceInfo *> & faceInfo() const
WallFunctionYPlusAux(const InputParameters ¶meters)
static const std::string mu
boundary_id_type BoundaryID
static InputParameters validParams()
const INSFVVelocityVariable *const _u_var
x-velocity
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
const Point & normal() const
void paramError(const std::string ¶m, Args... args) const
registerMooseObject("NavierStokesApp", WallFunctionYPlusAux)
const Moose::Functor< ADReal > & _rho
Density.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
const INSFVVelocityVariable *const _w_var
z-velocity
static InputParameters validParams()
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.
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Computes wall y+ based on wall functions.
const unsigned int _dim
the dimension of the simulation
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const