22 "Computes the force due to the Reynolds stress term in the incompressible" 23 " Reynolds-averaged Navier-Stokes equations.");
24 params.
addRequiredParam<MooseFunctorName>(
"u",
"The velocity in the x direction.");
25 params.
addParam<MooseFunctorName>(
"v",
"The velocity in the y direction.");
26 params.
addParam<MooseFunctorName>(
"w",
"The velocity in the z direction.");
28 params.
addRequiredParam<MooseFunctorName>(
"mixing_length",
"Turbulent eddy mixing length.");
29 MooseEnum momentum_component(
"x=0 y=1 z=2");
33 "The component of the momentum equation that this kernel applies to.");
39 params.
set<
unsigned short>(
"ghost_layers") = 3;
45 _dim(blocksMaxDimension()),
46 _axis_index(getParam<
MooseEnum>(
"momentum_component")),
47 _u(getFunctor<
ADReal>(
"u")),
48 _v(params.isParamValid(
"v") ? &getFunctor<
ADReal>(
"v") : nullptr),
49 _w(params.isParamValid(
"w") ? &getFunctor<
ADReal>(
"w") : nullptr),
51 _mixing_len(getFunctor<
ADReal>(
"mixing_length"))
55 "In two or more dimensions, the v velocity must be supplied using the 'v' parameter");
57 mooseError(
"In three dimensions, the w velocity must be supplied using the 'w' parameter");
63 constexpr
Real offset = 1e-15;
68 const auto grad_u =
_u.gradient(face, state);
76 grad_v =
_v->gradient(face, state);
80 grad_w =
_w->gradient(face, state);
85 norm_strain_rate += var_grad *
_normal;
87 ADReal symmetric_strain_tensor_norm = 2.0 * Utility::pow<2>(grad_u(0));
90 symmetric_strain_tensor_norm +=
91 2.0 * Utility::pow<2>(grad_v(1)) + Utility::pow<2>(grad_v(0) + grad_u(1));
93 symmetric_strain_tensor_norm += 2.0 * Utility::pow<2>(grad_w(2)) +
94 Utility::pow<2>(grad_u(2) + grad_w(0)) +
95 Utility::pow<2>(grad_v(2) + grad_w(1));
98 symmetric_strain_tensor_norm = std::sqrt(symmetric_strain_tensor_norm + offset);
104 ADReal eddy_diff = symmetric_strain_tensor_norm * mixing_len * mixing_len;
108 if (populate_a_coeffs)
116 _ae = norm_strain_rate.derivatives()[dof_number];
117 _ae *= -rho * eddy_diff;
123 _an = norm_strain_rate.derivatives()[dof_number];
124 _an *= rho * eddy_diff;
129 return -1 * rho * eddy_diff * norm_strain_rate;
A flux kernel that momentum residual objects that add non-advection flux terms, or more specifically ...
const unsigned int _dim
The dimension of the simulation.
const Moose::Functor< ADReal > & _u
x-velocity
INSFVMixingLengthReynoldsStress(const InputParameters ¶ms)
unsigned int number() const
const Elem & elem() const
const FaceInfo * _face_info
Moose::StateArg determineState() const
ADReal _ae
Rhie-Chow element coefficient.
const unsigned int _index
index x|y|z
static const std::string density
const Moose::Functor< ADReal > *const _v
y-velocity
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSFVMixingLengthReynoldsStress)
RhieChowInterpolatorBase & _rc_uo
The Rhie Chow user object that is responsible for generating face velocities for advection terms...
virtual bool skipForBoundary(const FaceInfo &fi) const
const Elem * neighborPtr() const
virtual ADReal computeSegregatedContribution() override
Compute the contribution which goes into the residual of the segregated system.
static InputParameters validParams()
const Elem & neighbor() const
const Moose::Functor< ADReal > & _mixing_len
Turbulent eddy mixing length.
const Point & normal() const
unsigned int number() const
const unsigned int _axis_index
index x|y|z
FaceInfo::VarFaceNeighbors _face_type
ADReal _an
Rhie-Chow neighbor coefficient.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addResidualAndJacobian(const ADReal &residual)
Process into either the system residual or Jacobian.
virtual void addToA(const libMesh::Elem *elem, unsigned int component, const ADReal &value)=0
API for momentum residual objects that have on-diagonals for velocity call.
void gatherRCData(const FaceInfo &) override final
Should be a non-empty implementation if the residual object is a FVFluxKernel and introduces residual...
ADReal computeStrongResidual(const bool populate_a_coeffs)
Routine to compute this object's strong residual (e.g.
static InputParameters validParams()
void mooseError(Args &&... args) const
const Moose::Functor< ADReal > & _rho
Density.
MooseVariableFV< Real > & _var
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
const Moose::Functor< ADReal > *const _w
z-velocity
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const