21 "Reynolds-averaged fluid conservation equations.");
22 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
23 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
24 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
25 params.
addRequiredParam<MooseFunctorName>(
"mixing_length",
"The turbulent mixing length.");
28 "The turbulent Schmidt number (or turbulent Prandtl number if the passive scalar is energy) " 29 "that relates the turbulent scalar diffusivity to the turbulent momentum diffusivity.");
30 params.
set<
unsigned short>(
"ghost_layers") = 2;
35 "ElementSideNeighborLayers",
47 _dim(_subproblem.
mesh().dimension()),
48 _u(getFunctor<
ADReal>(
"u")),
49 _v(isParamValid(
"v") ? &getFunctor<
ADReal>(
"v") : nullptr),
50 _w(isParamValid(
"w") ? &getFunctor<
ADReal>(
"w") : nullptr),
51 _mixing_len(getFunctor<
ADReal>(
"mixing_length")),
52 _schmidt_number(getParam<
Real>(
"schmidt_number"))
56 "In two or more dimensions, the v velocity must be supplied using the 'v' parameter");
58 mooseError(
"In three dimensions, the w velocity must be supplied using the 'w' parameter");
64 constexpr
Real offset = 1e-15;
69 const auto grad_u =
_u.gradient(face, state);
70 ADReal symmetric_strain_tensor_norm = 2.0 * Utility::pow<2>(grad_u(0));
73 const auto grad_v =
_v->gradient(face, state);
74 symmetric_strain_tensor_norm +=
75 2.0 * Utility::pow<2>(grad_v(1)) + Utility::pow<2>(grad_v(0) + grad_u(1));
78 const auto grad_w =
_w->gradient(face, state);
79 symmetric_strain_tensor_norm += 2.0 * Utility::pow<2>(grad_w(2)) +
80 Utility::pow<2>(grad_u(2) + grad_w(0)) +
81 Utility::pow<2>(grad_v(2) + grad_w(1));
85 symmetric_strain_tensor_norm = std::sqrt(symmetric_strain_tensor_norm + offset);
91 ADReal eddy_diff = symmetric_strain_tensor_norm * mixing_len * mixing_len;
99 return -1 * eddy_diff * dudn;
virtual ADReal gradUDotNormal(const Moose::StateArg &time, const bool correct_skewness) const
const Real & _schmidt_number
Turbulent Schmidt number (or turbulent Prandtl number)
ADReal computeQpResidual() override
const unsigned int _dim
the dimension of the simulation
const FaceInfo * _face_info
Moose::StateArg determineState() const
const Moose::Functor< ADReal > *const _w
z-velocity
DualNumber< Real, DNDerivativeType, true > ADReal
const Moose::Functor< ADReal > & _mixing_len
Turbulent eddy mixing length.
const Moose::Functor< ADReal > *const _v
y-velocity
static InputParameters validParams()
const bool _correct_skewness
static InputParameters validParams()
INSFVMixingLengthScalarDiffusion(const InputParameters ¶ms)
const Moose::Functor< ADReal > & _u
x-velocity
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
registerMooseObject("NavierStokesApp", INSFVMixingLengthScalarDiffusion)
static void setRMParamsDiffusion(const InputParameters &obj_params, InputParameters &rm_params, const unsigned short conditional_extended_layers)
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
static InputParameters validParams()