13 #include "libmesh/nonlinear_solver.h" 23 params.
addCoupledVar(
"v",
"The velocity in the y direction.");
24 params.
addCoupledVar(
"w",
"The velocity in the z direction.");
25 params.
addParam<MooseFunctorName>(
"k",
"Turbulent kinetic energy functor.");
29 params.
addParam<std::vector<BoundaryName>>(
30 "walls", {},
"Boundaries that correspond to solid walls.");
31 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
34 "The method used for computing the y_plus in the wall functions " 35 "'eq_newton', 'eq_incremental', 'eq_linearized', 'neq'");
36 params.
addParam<
Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure coefficient.");
43 _dim(_subproblem.
mesh().dimension()),
44 _u_var(getFunctor<
ADReal>(
"u")),
45 _v_var(params.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
46 _w_var(params.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
50 _wall_boundary_names(getParam<
std::vector<BoundaryName>>(
"walls")),
52 _C_mu(getParam<
Real>(
"C_mu"))
55 paramError(
"v",
"In two or more dimensions, the v velocity must be supplied!");
58 paramError(
"w",
"In three or more dimensions, the w velocity must be supplied!");
61 paramError(
NS::TKE,
"In the non-equilibrium wall treatment the TKE must be supplied!");
82 const auto rho =
_rho(elem_arg, state);
83 const auto mu =
_mu(elem_arg, state);
85 std::vector<Real> y_plus_vec;
89 velocity(1) = (*_v_var)(elem_arg, state);
91 velocity(2) = (*_w_var)(elem_arg, state);
96 for (
unsigned int i = 0; i < distance_vec.size(); i++)
99 velocity -
velocity * face_info_vec[i]->normal() * face_info_vec[i]->normal());
100 const auto distance = distance_vec[i];
112 return std::accumulate(y_plus_vec.begin(), y_plus_vec.end(), 0.0) / y_plus_vec.size();
Computes wall y+ based on wall functions.
const Real _C_mu
C_mu constant.
void getWallBoundedElements(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::map< const Elem *, bool > &wall_bounded_map)
Map marking wall bounded elements The map passed in wall_bounded_map gets cleared and re-populated...
Moose::StateArg determineState() const
const unsigned int _dim
the dimension of the simulation
const Moose::Functor< ADReal > & _mu
Dynamic viscosity.
static const std::string density
static const std::string TKE
WallTreatmentEnum
Wall treatment options.
NS::WallTreatmentEnum _wall_treatment
Method used for wall treatment.
virtual const std::set< SubdomainID > & blockIDs() const
const Moose::Functor< ADReal > * _k
Turbulent kinetic energy.
DualNumber< Real, DNDerivativeType, true > ADReal
Real distance(const Point &p)
FEProblemBase & _c_fe_problem
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
virtual Real computeValue() override
static const std::string mu
std::map< const Elem *, std::vector< Real > > _dist
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 > * _v_var
y-velocity
registerMooseObject("NavierStokesApp", RANSYPlusAux)
std::map< const Elem *, bool > _wall_bounded
void paramError(const std::string ¶m, Args... args) const
const Moose::Functor< ADReal > * _w_var
z-velocity
void getWallDistance(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::map< const Elem *, std::vector< Real >> &dist_map)
Map storing wall ditance for near-wall marked elements The map passed in dist_map gets cleared and re...
std::map< const Elem *, std::vector< const FaceInfo * > > _face_infos
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RANSYPlusAux(const InputParameters ¶meters)
const Elem *const & _current_elem
const std::vector< BoundaryName > & _wall_boundary_names
Wall boundary names.
void getElementFaceArgs(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::map< const Elem *, std::vector< const FaceInfo *>> &face_info_map)
Map storing face arguments to wall bounded faces The map passed in face_info_map gets cleared and re-...
static InputParameters validParams()
static const std::string velocity
const Moose::Functor< ADReal > & _rho
Density.
ADReal computeSpeed(const ADRealVectorValue &velocity)
Compute the speed (velocity norm) given the supplied velocity.
const Moose::Functor< ADReal > & _u_var
x-velocity
virtual void initialSetup() override
MooseUnits pow(const MooseUnits &, int)