22 "Reynolds-averaged fluid energy conservation equations.");
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.");
26 params.
addRequiredParam<MooseFunctorName>(
"mixing_length",
"The turbulent mixing length.");
29 "The turbulent Schmidt number (or turbulent Prandtl number if the passive scalar is energy) " 30 "that relates the turbulent scalar diffusivity to the turbulent momentum diffusivity.");
37 "ElementSideNeighborLayers",
43 params.
set<
unsigned short>(
"ghost_layers") = 2;
50 _dim(_subproblem.
mesh().dimension()),
51 _u(getFunctor<
ADReal>(
"u")),
52 _v(isParamValid(
"v") ? &getFunctor<
ADReal>(
"v") : nullptr),
53 _w(isParamValid(
"w") ? &getFunctor<
ADReal>(
"w") : nullptr),
56 _mixing_len(getFunctor<
ADReal>(
"mixing_length")),
57 _schmidt_number(getParam<
Real>(
"schmidt_number"))
61 "In two or more dimensions, the v velocity must be supplied using the 'v' parameter");
63 mooseError(
"In three dimensions, the w velocity must be supplied using the 'w' parameter");
69 constexpr
Real offset = 1e-15;
74 const auto grad_u =
_u.gradient(face, state);
75 ADReal symmetric_strain_tensor_norm = 2.0 * Utility::pow<2>(grad_u(0));
78 const auto grad_v =
_v->gradient(face, state);
79 symmetric_strain_tensor_norm +=
80 2.0 * Utility::pow<2>(grad_v(1)) + Utility::pow<2>(grad_v(0) + grad_u(1));
83 const auto grad_w =
_w->gradient(face, state);
84 symmetric_strain_tensor_norm += 2.0 * Utility::pow<2>(grad_w(2)) +
85 Utility::pow<2>(grad_u(2) + grad_w(0)) +
86 Utility::pow<2>(grad_v(2) + grad_w(1));
90 symmetric_strain_tensor_norm = std::sqrt(symmetric_strain_tensor_norm + offset);
96 ADReal eddy_diff = symmetric_strain_tensor_norm * mixing_len * mixing_len;
108 rho_cp_face =
_rho(ssf, state) *
_cp(ssf, state);
113 const auto face_elem =
elemArg();
117 _rho(face_elem, state) *
_cp(face_elem, state),
118 _rho(face_neighbor, state) *
_cp(face_neighbor, state),
123 return -1 * eddy_diff * rho_cp_face * dTdn;
virtual ADReal gradUDotNormal(const Moose::StateArg &time, const bool correct_skewness) const
ADReal computeQpResidual() override
const Moose::Functor< ADReal > & _cp
the specific heat capacity
const unsigned int _dim
the dimension of the simulation
Moose::ElemArg elemArg(bool correct_skewness=false) const
const FaceInfo * _face_info
Moose::StateArg determineState() const
static const std::string density
DualNumber< Real, DNDerivativeType, true > ADReal
Computes the turbulent diffusion of energy term in the weakly compressible formulation of the energy ...
WCNSFVMixingLengthEnergyDiffusion(const InputParameters ¶ms)
bool onBoundary(const FaceInfo &fi) const
static const std::string cp
const Moose::Functor< ADReal > & _mixing_len
Turbulent eddy mixing length.
static InputParameters validParams()
registerMooseObject("NavierStokesApp", WCNSFVMixingLengthEnergyDiffusion)
const bool _correct_skewness
static InputParameters validParams()
const Moose::Functor< ADReal > & _rho
the fluid density
const Moose::Functor< ADReal > & _u
x-velocity
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Moose::ElemArg neighborArg(bool correct_skewness=false) const
const Moose::Functor< ADReal > *const _w
z-velocity
const Moose::Functor< ADReal > *const _v
y-velocity
void mooseError(Args &&... args) const
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
const Real & _schmidt_number
Turbulent Schmidt number (or turbulent Prandtl number)
static void setRMParamsDiffusion(const InputParameters &obj_params, InputParameters &rm_params, const unsigned short conditional_extended_layers)
static InputParameters validParams()
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)