19 params.
addClassDescription(
"Computes the wall value of the turbulent thermal conductivity based "
20 "on turbulent temperature wall functions.");
21 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
22 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
23 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
27 params.
addParam<MooseFunctorName>(
NS::k,
"The thermal conductivity.");
28 params.
addParam<MooseFunctorName>(
"Pr_t", 0.7,
"The turbulent Prandtl number.");
29 params.
addParam<MooseFunctorName>(
NS::TKE,
"The turbulent kinetic energy.");
30 params.
addParam<Real>(
"C_mu", 0.09,
"Coupled turbulent kinetic energy closure.");
32 MooseEnum wall_treatment(
"eq_newton eq_incremental eq_linearized neq",
"neq");
34 "wall_treatment", wall_treatment,
"The method used for computing the wall functions");
40 _dim(_subproblem.
mesh().dimension()),
41 _u_var(getFunctor<Real>(
"u")),
42 _v_var(params.isParamValid(
"v") ? &(getFunctor<Real>(
"v")) : nullptr),
43 _w_var(params.isParamValid(
"w") ? &(getFunctor<Real>(
"w")) : nullptr),
44 _rho(getFunctor<Real>(
NS::density)),
45 _mu(getFunctor<Real>(
NS::
mu)),
46 _cp(getFunctor<Real>(
NS::cp)),
47 _k(getFunctor<Real>(
NS::k)),
48 _Pr_t(getFunctor<Real>(
"Pr_t")),
49 _tke(getFunctor<Real>(
NS::TKE)),
50 _C_mu(getParam<Real>(
"C_mu")),
51 _wall_treatment(getParam<
MooseEnum>(
"wall_treatment").getEnum<
NS::WallTreatmentEnum>())
58 using std::abs, std::log, std::max, std::sqrt, std::pow, std::exp;
67 const auto mu =
_mu(re, state);
68 const auto rho =
_rho(re, state);
69 const auto cp =
_cp(re, state);
70 const auto k =
_k(re, state);
71 const auto Pr_t =
_Pr_t(re, state);
72 const auto Pr = cp *
mu / k;
75 RealVectorValue velocity(
_u_var(re, state));
77 velocity(1) = (*_v_var)(re, state);
79 velocity(2) = (*_w_var)(re, state);
94 y_plus = wall_dist * u_tau *
rho /
mu;
100 u_tau = parallel_speed /
109 const Real c_c = parallel_speed;
111 u_tau = (-b_c + std::sqrt(std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
112 y_plus = wall_dist * u_tau *
rho /
mu;
117 y_plus = std::pow(
_C_mu, 0.25) * wall_dist * std::sqrt(
_tke(re, state)) *
rho /
mu;
118 u_tau = parallel_speed /
123 "For `LinearFVTemperatureWallFunctionBC` , wall treatment should not reach here");
126 Real y_plus_thermal = 0.0;
131 if (y_plus <= y_plus_thermal)
133 T_plus = y_plus * Pr;
137 const auto Pr_ratio = Pr / Pr_t;
138 const auto jayatilleke_P =
139 9.24 * (
pow(Pr_ratio, 0.75) - 1.0) * (1.0 + 0.28 * exp(-0.007 * Pr_ratio));
140 const auto wall_scaling =
142 T_plus = Pr_t * wall_scaling;
145 return rho * cp * u_tau * wall_dist / T_plus;
169 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
170 "contribute to neither vector nor a right hand side.");
176 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
177 "contribute to neither vector nor a right hand side.");
183 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
184 "contribute to neither vector nor a right hand side.");
190 mooseError(
"We should not solve for the turbulent viscosity directly meaning that this should "
191 "contribute to neither vector nor a right hand side.");
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
registerMooseObject("NavierStokesApp", LinearFVTemperatureWallFunctionBC)
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.
LinearFVTemperatureWallFunctionBC(const InputParameters ¶meters)
Class constructor.
virtual Real computeBoundaryGradientRHSContribution() const override
const Moose::Functor< Real > * _w_var
z-velocity
const Moose::Functor< Real > & _u_var
x-velocity
const Moose::Functor< Real > & _tke
Turbulent kinetic energy.
virtual Real computeBoundaryValue() const override
virtual Real computeBoundaryValueMatrixContribution() const override
Real computeTurbulentThermalConductivity() const
Compute the turbulent thermal conductivity.
const Real _C_mu
C_mu turbulent coefficient.
const NS::WallTreatmentEnum _wall_treatment
Method used for wall treatment.
virtual Real computeBoundaryValueRHSContribution() const override
const Moose::Functor< Real > & _k
Thermal Conductivity.
virtual Real computeBoundaryNormalGradient() const override
const Moose::Functor< Real > * _v_var
y-velocity
static InputParameters validParams()
const Moose::Functor< Real > & _Pr_t
Turbulent Prandlt number.
virtual Real computeBoundaryGradientMatrixContribution() const override
const Moose::Functor< Real > & _cp
Specific Heat.
const Moose::Functor< Real > & _rho
Density.
void mooseError(Args &&... args) const
Moose::StateArg determineState() const
static const std::string density
template Real computeSpeed< Real >(const libMesh::VectorValue< Real > &velocity)
static constexpr Real von_karman_constant
static const std::string cp
static const std::string mu
static const std::string TKE
static const std::string k
static constexpr Real E_turb_constant
template Real findYplusThermal< Real >(const Real &Pr, const Real &Pr_t)
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)