23 "Computes a friction force term on fluid in porous media in the " 24 "Navier Stokes i-th momentum equation in Rhie-Chow (incompressible) contexts.");
25 params.
addParam<MooseFunctorName>(
"Darcy_name",
"Name of the Darcy coefficients property.");
26 params.
addParam<MooseFunctorName>(
"Forchheimer_name",
27 "Name of the Forchheimer coefficients property.");
28 params.
addParam<
bool>(
"is_porous_medium",
true,
"Boolean to choose the type of medium.");
30 "standard_friction_formulation",
true,
"Boolean to choose the type of friction formulation.");
31 params.
addParam<MooseFunctorName>(
NS::mu,
"The dynamic viscosity");
32 params.
addParam<MooseFunctorName>(
NS::speed,
"The magnitude of the interstitial velocity.");
33 params.
addParam<MooseFunctorName>(
"u",
34 "The velocity in the x direction. Superficial in the case of " 35 "porous treatment, interstitial otherwise");
36 params.
addParam<MooseFunctorName>(
"v",
37 "The velocity in the y direction. Superficial in the case of " 38 "porous treatment, interstitial otherwise");
39 params.
addParam<MooseFunctorName>(
"w",
40 "The velocity in the z direction. Superficial in the case of " 41 "porous treatment, interstitial otherwise");
49 _D(isParamValid(
"Darcy_name") ? &getFunctor<
ADRealVectorValue>(
"Darcy_name") : nullptr),
50 _F(isParamValid(
"Forchheimer_name") ? &getFunctor<
ADRealVectorValue>(
"Forchheimer_name")
52 _use_Darcy_friction_model(isParamValid(
"Darcy_name")),
53 _use_Forchheimer_friction_model(isParamValid(
"Forchheimer_name")),
54 _is_porous_medium(getParam<bool>(
"is_porous_medium")),
55 _standard_friction_formulation(getParam<bool>(
"standard_friction_formulation")),
59 _dim(_subproblem.
mesh().dimension()),
60 _u_var(params.isParamValid(
"u") ? &(getFunctor<
ADReal>(
"u")) : nullptr),
61 _v_var(params.isParamValid(
"v") ? &(getFunctor<
ADReal>(
"v")) : nullptr),
62 _w_var(params.isParamValid(
"w") ? &(getFunctor<
ADReal>(
"w")) : nullptr),
66 mooseError(
"At least one friction model needs to be specified.");
69 mooseError(
"If using the standard Darcy friction model, then the '",
71 "' parameter must be provided");
77 mooseError(
"The velocity variable 'u' should be defined if no speed functor material is " 78 "defined for this kernel when using the Forchheimer fromulation.");
84 "The velocity variable 'v' should be defined if no speed functor material is " 85 "defined for this kernel and dimensions >= 2 when using the Forchheimer fromulation.");
91 "The velocity variable 'w' should be defined if no speed functor material is " 92 "defined for this kernel and dimensions >= 3 when using the Forchheimer fromulation.");
129 speed = (*_speed)(elem_arg, state);
153 mu = (*_mu)(elem_arg, state);
158 rho =
_rho(elem_arg, state);
167 coefficient +=
mu * (*_D)(elem_arg, state)(
_index);
169 coefficient += rho / 2 * (*_F)(elem_arg, state)(
_index)*
speed;
174 coefficient += (*_D)(elem_arg, state)(
_index);
176 coefficient += (*_F)(elem_arg, state)(
_index)*
speed;
195 const auto coefficient =
const Moose::Functor< ADReal > * _w_var
z-velocity
ADReal computeFrictionWCoefficient(const Moose::ElemArg &elem_arg, const Moose::StateArg &state)
Computes the friction coefficient which gets multiplied by the velocity.
void addResidualAndJacobian(const ADReal &residual, dof_id_type dof)
Process into either the system residual or Jacobian.
static const std::string superficial_velocity
Imposes a friction force on the momentum equation in porous media in Rhie-Chow contexts.
static const std::string speed
An elemental kernel that momentum residual objects that add body forces should inherit from...
const Moose::Functor< ADReal > *const _speed
Speed (norm of the interstitial velocity) as a functor.
registerMooseObject("NavierStokesApp", PINSFVMomentumFriction)
unsigned int number() const
const Moose::Functor< ADReal > *const _mu
Dynamic viscosity.
const bool _use_Forchheimer_friction_model
Moose::StateArg determineState() const
const bool _standard_friction_formulation
const unsigned int _index
index x|y|z
static const std::string density
DualNumber< Real, DNDerivativeType, true > ADReal
RhieChowInterpolatorBase & _rc_uo
The Rhie Chow user object that is responsible for generating face velocities for advection terms...
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
static const std::string porosity
const unsigned int _dim
The dimension of the domain.
const Elem *const & _current_elem
Real elementVolume(const Elem *elem) const
const Moose::Functor< ADReal > & _rho
Density as a functor.
static const std::string mu
const Moose::Functor< ADReal > & _epsilon
Adding porosity functor.
unsigned int number() const
static InputParameters validParams()
static InputParameters validParams()
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.
const Moose::Functor< ADReal > * _u_var
x-velocity
const bool _use_Darcy_friction_model
Booleans to select the right models.
const Moose::Functor< ADReal > * _v_var
y-velocity
const Moose::Functor< ADReal > & _u_functor
void mooseError(Args &&... args) const
PINSFVMomentumFriction(const InputParameters ¶ms)
void gatherRCData(const Elem &) override
Should be a non-empty implementation if the residual object is a FVElementalKernel and introduces res...
ADReal computeSpeed(const ADRealVectorValue &velocity)
Compute the speed (velocity norm) given the supplied velocity.
const bool _is_porous_medium
ADReal computeSegregatedContribution() override
Compute the contribution which goes into the residual of the segregated system.
MooseVariableFV< Real > & _var