15 MixingLengthTurbulentViscosityMaterial,
23 params.
addClassDescription(
"Computes the material property corresponding to the total viscosity" 24 "comprising the mixing length model turbulent total_viscosity" 25 "and the molecular viscosity.");
27 params.
addParam<MooseFunctorName>(
"v", 0,
"y-velocity");
28 params.
addParam<MooseFunctorName>(
"w", 0,
"z-velocity");
29 params.
addRequiredParam<MooseFunctorName>(
"mixing_length",
"Turbulent eddy mixing length.");
31 params.
addRequiredParam<MooseFunctorName>(
"rho",
"The value for the density");
38 _mesh_dimension(_mesh.dimension()),
39 _u_vel(getFunctor<
ADReal>(
"u")),
40 _v_vel(isParamValid(
"v") ? &getFunctor<
ADReal>(
"v") : nullptr),
41 _w_vel(isParamValid(
"w") ? &getFunctor<
ADReal>(
"v") : nullptr),
43 _mu(getFunctor<
ADReal>(
"mu")),
44 _rho(getFunctor<
ADReal>(
"rho"))
46 addFunctorProperty<ADReal>(
48 [
this](
const auto & r,
const auto & t) ->
ADReal 52 constexpr
Real offset = 1e-15;
54 const auto grad_u =
_u_vel.gradient(r, t);
56 ADReal symmetric_strain_tensor_norm = 2.0 * Utility::pow<2>(grad_u(0));
59 const auto grad_v =
_v_vel->gradient(r, t);
61 symmetric_strain_tensor_norm +=
62 2.0 * Utility::pow<2>(grad_v(1)) + Utility::pow<2>(grad_v(0) + grad_u(1));
65 const auto grad_w =
_w_vel->gradient(r, t);
67 symmetric_strain_tensor_norm += 2.0 * Utility::pow<2>(grad_w(2)) +
68 Utility::pow<2>(grad_u(2) + grad_w(0)) +
69 Utility::pow<2>(grad_v(2) + grad_w(1));
72 symmetric_strain_tensor_norm =
sqrt(symmetric_strain_tensor_norm + offset);
76 _rho(r, t) * symmetric_strain_tensor_norm * Utility::pow<2>(
_mixing_len(r, t));
const Moose::Functor< ADReal > & _rho
density
const unsigned int _mesh_dimension
static InputParameters validParams()
static const std::string mixing_length
const Moose::Functor< ADReal > *const _w_vel
z-component velocity
DualNumber< Real, DNDerivativeType, true > ADReal
const Moose::Functor< ADReal > & _u_vel
x-component velocity
const Moose::Functor< ADReal > *const _v_vel
y-component velocity
registerMooseObjectRenamed("NavierStokesApp", MixingLengthTurbulentViscosityMaterial, "08/01/2024 00:00", MixingLengthTurbulentViscosityFunctorMaterial)
MixingLengthTurbulentViscosityFunctorMaterial(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
const Moose::Functor< ADReal > & _mu
viscosity
registerMooseObject("NavierStokesApp", MixingLengthTurbulentViscosityFunctorMaterial)
static InputParameters validParams()
static const std::string total_viscosity
const Moose::Functor< ADReal > & _mixing_len
Turbulent eddy mixing length.