22 params.addClassDescription(
23 "Viscous diffusion term, div(mu eps grad(u_d / eps)), in the porous media " 24 "incompressible Navier-Stokes momentum equation.");
25 params.addRequiredParam<MooseFunctorName>(
NS::porosity,
"Porosity auxiliary variable");
32 if (!dynamic_cast<PINSFVSuperficialVelocityVariable *>(&
_var))
33 mooseError(
"PINSFVMomentumDiffusion may only be used with a superficial velocity " 34 "variable, of variable type PINSFVSuperficialVelocityVariable.");
47 const auto elem_face =
elemArg();
55 const auto mu_elem = has_elem ?
_mu(elem_face, state) :
_mu(neighbor_face, state);
56 const auto eps_elem = has_elem ?
_eps(elem_face, state) :
_eps(neighbor_face, state);
64 mu_neighbor = has_elem ?
_mu(neighbor_face, state) :
_mu(elem_face, state);
65 eps_neighbor = has_neighbor ?
_eps(neighbor_face, state) :
_eps(elem_face, state);
72 if (populate_a_coeffs)
79 _ae = dudn.derivatives()[dof_number];
85 _an = dudn.derivatives()[dof_number];
91 ADReal residual = mu_face * dudn;
94 const auto & grad_eps_face =
95 (has_elem && has_neighbor)
104 const auto coeff_one_side =
105 mu_elem / eps_elem * (has_elem ?
_var(elem_face, state) :
_var(neighbor_face, state));
107 coeff_face = coeff_one_side;
110 mooseAssert(has_elem,
"We should be defined on the element side if we're not on a boundary");
111 const auto coeff_neighbor = mu_neighbor / eps_neighbor *
112 (has_elem ?
_var(neighbor_face, state) :
_var(elem_face, state));
121 residual -= coeff_face * grad_eps_face *
_normal;
ADReal _ae
The a coefficient for the element.
ADReal _an
The a coefficient for the neighbor.
Moose::ElemArg elemArg(bool correct_skewness=false) const
unsigned int number() const
const Elem & elem() const
const FaceInfo * _face_info
Moose::StateArg determineState() const
DualNumber< Real, DNDerivativeType, true > ADReal
const Moose::Functor< ADReal > & _eps
the porosity
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
static const std::string porosity
bool onBoundary(const FaceInfo &fi) const
A flux kernel for diffusion of momentum in porous media across cell faces.
const Elem * neighborPtr() const
PINSFVMomentumDiffusion(const InputParameters ¶ms)
const Moose::Functor< ADReal > & _mu
The dynamic viscosity.
const Elem & neighbor() const
const Point & normal() const
unsigned int number() const
virtual ADReal computeStrongResidual(const bool populate_a_coeffs) override
Routine to compute this object's strong residual (e.g.
FaceInfo::VarFaceNeighbors _face_type
Moose::ElemArg neighborArg(bool correct_skewness=false) const
static InputParameters validParams()
GradientType gradient(const ElemArg &elem, const StateArg &state) const
static InputParameters validParams()
void mooseError(Args &&... args) const
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
MooseVariableFV< Real > & _var
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
registerMooseObject("NavierStokesApp", PINSFVMomentumDiffusion)
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)