19 params.
addClassDescription(
"Adds Dirichlet BC for wall values of the turbulent viscosity.");
20 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
21 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
22 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
25 params.
addParam<MooseFunctorName>(
NS::TKE,
"The turbulent kinetic energy.");
26 params.
addParam<Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
28 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
30 "wall_treatment", wall_treatment,
"The method used for computing the wall functions");
37 _dim(_subproblem.
mesh().dimension()),
38 _u_var(getFunctor<Real>(
"u")),
39 _v_var(params.isParamValid(
"v") ? &(getFunctor<Real>(
"v")) : nullptr),
40 _w_var(params.isParamValid(
"w") ? &(getFunctor<Real>(
"w")) : nullptr),
41 _rho(getFunctor<Real>(
NS::density)),
42 _mu(getFunctor<Real>(
NS::
mu)),
43 _k(getFunctor<Real>(
NS::TKE)),
44 _C_mu(getParam<Real>(
"C_mu")),
45 _wall_treatment(getParam<
MooseEnum>(
"wall_treatment").getEnum<
NS::WallTreatmentEnum>())
58 const auto old_state =
Moose::StateArg(1, Moose::SolutionIterationType::Nonlinear);
59 const auto mu =
_mu(re, old_state);
60 const auto rho =
_rho(re, old_state);
63 RealVectorValue velocity(
_u_var(re, old_state));
65 velocity(1) = (*_v_var)(re, old_state);
67 velocity(2) = (*_w_var)(re, old_state);
82 y_plus = wall_dist * u_tau *
rho /
mu;
83 mu_wall =
rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
98 const Real c_c = parallel_speed;
100 const auto u_tau = (-b_c + std::sqrt(std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
101 y_plus = wall_dist * u_tau *
rho /
mu;
102 mu_wall =
rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
107 y_plus = std::pow(
_C_mu, 0.25) * wall_dist * std::sqrt(
_k(re, old_state)) *
rho /
mu;
113 "For `INSFVTurbulentViscosityWallFunction` , wall treatment should not reach here");
115 const Real mut_log = mu_wall -
mu;
122 else if (y_plus >= 30.0)
128 const auto blending_function = (y_plus - 5.0) / 25.0;
156 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
157 "contribute to neither vector nor a right hand side.");
163 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
164 "contribute to neither vector nor a right hand side.");
170 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
171 "contribute to neither vector nor a right hand side.");
177 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
178 "contribute to neither vector nor a right hand side.");
registerMooseObject("NavierStokesApp", LinearFVTurbulentViscosityWallFunctionBC)
const Point & normal() const
const Elem * neighborPtr() const
const Elem * elemPtr() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
static InputParameters validParams()
const FaceInfo * _current_face_info
Real computeCellToFaceDistance() const
FaceInfo::VarFaceNeighbors _current_face_type
MooseLinearVariableFV< Real > & _var
Class implementing a Dirichlet boundary condition for the turbulent viscosity wall function in a RANS...
const Moose::Functor< Real > & _mu
Dynamic viscosity.
static InputParameters validParams()
virtual Real computeBoundaryValueMatrixContribution() const override
virtual Real computeBoundaryValueRHSContribution() const override
virtual Real computeBoundaryNormalGradient() const override
virtual Real computeBoundaryValue() const override
const Moose::Functor< Real > & _rho
Density.
const Moose::Functor< Real > & _k
Turbulent kinetic energy.
const Moose::Functor< Real > * _w_var
z-velocity
virtual Real computeBoundaryGradientRHSContribution() const override
LinearFVTurbulentViscosityWallFunctionBC(const InputParameters ¶meters)
Class constructor.
virtual Real computeBoundaryGradientMatrixContribution() const override
const Moose::Functor< Real > * _v_var
y-velocity
const Moose::Functor< Real > & _u_var
x-velocity
const Real _C_mu
C_mu turbulent coefficient.
Real computeTurbulentViscosity() const
const NS::WallTreatmentEnum _wall_treatment
Method used for wall treatment.
void mooseError(Args &&... args) const
Moose::StateArg determineState() const
static constexpr Real mu_t_low_limit
static const std::string density
template Real computeSpeed< Real >(const libMesh::VectorValue< Real > &velocity)
static constexpr Real von_karman_constant
static const std::string mu
static const std::string TKE
static constexpr Real E_turb_constant
template Real findyPlus< Real >(const Real &mu, const Real &rho, const Real &u, Real dist)
template Real findUStar< Real >(const Real &mu, const Real &rho, const Real &u, const Real dist)
Real distance(const Point &p)