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 50 constexpr
Real offset = 1e-15;
52 const auto grad_u =
_u_vel.gradient(r, t);
54 ADReal symmetric_strain_tensor_norm = 2.0 * Utility::pow<2>(grad_u(0));
57 const auto grad_v =
_v_vel->gradient(r, t);
59 symmetric_strain_tensor_norm +=
60 2.0 * Utility::pow<2>(grad_v(1)) + Utility::pow<2>(grad_v(0) + grad_u(1));
63 const auto grad_w =
_w_vel->gradient(r, t);
65 symmetric_strain_tensor_norm += 2.0 * Utility::pow<2>(grad_w(2)) +
66 Utility::pow<2>(grad_u(2) + grad_w(0)) +
67 Utility::pow<2>(grad_v(2) + grad_w(1));
70 symmetric_strain_tensor_norm = std::sqrt(symmetric_strain_tensor_norm + offset);
74 _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
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.