24 "Computes the slip velocity advection kernel for two-phase mixture model.");
25 params.
addRequiredParam<MooseFunctorName>(
"u_slip",
"The slip velocity in the x direction.");
26 params.
addParam<MooseFunctorName>(
"v_slip",
"The slip velocity in the y direction.");
27 params.
addParam<MooseFunctorName>(
"w_slip",
"The slip velocity in the z direction.");
28 params.
addRequiredParam<MooseFunctorName>(
"rho_d",
"Dispersed phase density.");
29 params.
addParam<MooseFunctorName>(
"fd", 0.0,
"Fraction dispersed phase.");
38 _rho_d(getFunctor<
ADReal>(
"rho_d")),
39 _dim(_subproblem.
mesh().dimension()),
40 _u_slip(getFunctor<
ADReal>(
"u_slip")),
41 _v_slip(isParamValid(
"v_slip") ? &getFunctor<
ADReal>(
"v_slip") : nullptr),
42 _w_slip(isParamValid(
"w_slip") ? &getFunctor<
ADReal>(
"w_slip") : nullptr),
43 _fd(getFunctor<
ADReal>(
"fd"))
46 mooseError(
"In two or more dimensions, the v_slip velocity must be supplied using the 'v_slip' " 50 "In three dimensions, the w_slip velocity must be supplied using the 'w_slip' parameter");
57 "We shouldn't get in here if we're supposed to skip for a boundary");
59 constexpr
Real offset = 1e-15;
81 u_slip_vel_vec(0) =
_u_slip(face_arg, state);
88 const auto rho_mix =
_rho(face_arg, state) +
89 (
_rho_d(face_arg, state) -
_rho(face_arg, state)) *
_fd(face_arg, state);
91 const auto vdotn =
_normal * u_slip_vel_vec;
96 const Elem *
const sided_elem = ssf.face_side;
98 const auto rho_face = rho_mix;
99 const auto eps_face =
epsilon()(ssf, state);
100 const auto u_face =
_var(ssf, state);
101 const Real d_u_face_d_dof = u_face.derivatives()[dof_number];
102 const auto coeff = vdotn * rho_face / eps_face;
104 if (sided_elem == fi.
elemPtr())
106 _ae = coeff * d_u_face_d_dof;
109 _ae =
_cs / fi.
elem().n_sides() * rho_face / eps_face;
113 _an = -coeff * d_u_face_d_dof;
128 if (
const auto [is_jump, eps_elem_face, eps_neighbor_face] =
136 const auto rho_face =
137 _rho_d(advected_face_arg, state) -
_rho(advected_face_arg, state) + offset;
140 const auto & var_elem_face = u_slip_vel_vec(
_index);
141 const auto & var_neighbor_face = u_slip_vel_vec(
_index);
146 const auto d_var_elem_face_d_elem_dof = var_elem_face.derivatives()[elem_dof_number];
147 const auto d_var_neighbor_face_d_neighbor_dof =
148 var_neighbor_face.derivatives()[neighbor_dof_number];
157 const auto elem_coeff = vdotn * rho_face / eps_elem_face;
158 const auto neighbor_coeff = vdotn * rho_face / eps_neighbor_face;
159 _ae = elem_coeff * d_var_elem_face_d_elem_dof;
161 _an = -neighbor_coeff * d_var_neighbor_face_d_neighbor_dof;
165 _ae =
_cs / fi.
elem().n_sides() * rho_face / eps_elem_face;
171 const auto [interp_coeffs, advected] =
174 const auto elem_arg =
elemArg();
177 const auto rho_elem =
_rho_d(elem_arg, state) -
_rho(elem_arg, state) + offset;
178 const auto rho_neighbor =
_rho_d(neighbor_arg, state) -
_rho(neighbor_arg, state) + offset;
179 const auto eps_elem =
epsilon()(elem_arg, state),
180 eps_neighbor =
epsilon()(neighbor_arg, state);
181 const auto var_elem = advected.first / rho_elem * eps_elem,
182 var_neighbor = advected.second / rho_neighbor * eps_neighbor;
184 _ae = vdotn * rho_elem / eps_elem * interp_coeffs.first;
186 _an = -vdotn * rho_neighbor / eps_neighbor * interp_coeffs.second;
193 _ae =
_cs / fi.
elem().n_sides() * rho_elem / eps_elem;
ADReal _neighbor_residual
The neighbor residual.
Moose::FV::InterpMethod _advected_interp_method
The interpolation method to use for the advected quantity.
const Moose::Functor< ADReal > *const _v_slip
slip velocity in direction y
Moose::ElemArg elemArg(bool correct_skewness=false) const
unsigned int number() const
std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADReal > > _rho_u
Our local momentum functor.
const Elem & elem() const
const FaceInfo * _face_info
Moose::StateArg determineState() const
std::tuple< bool, ADReal, ADReal > isPorosityJumpFace(const Moose::Functor< ADReal > &porosity, const FaceInfo &fi, const Moose::StateArg &time)
Checks to see whether the porosity value jumps from one side to the other of the provided face...
const unsigned int _index
index x|y|z
static const std::string density
static InputParameters validParams()
ADReal _ae
The a coefficient for the element.
bool onBoundary(const FaceInfo &fi) const
LimiterType limiterType(InterpMethod interp_method)
const Elem * neighborPtr() const
const Real _cs
Characteristic speed.
const Moose::Functor< ADReal > & _u_slip
slip velocity in direction x
const bool _approximate_as
Whether to approximately calculate the 'a' coefficients.
bool skipForBoundary(const FaceInfo &fi) const override
const Moose::Functor< ADReal > & _rho
Density.
virtual const Moose::FunctorBase< ADReal > & epsilon() const
A virtual method that allows us to reuse all the code from free-flow for porous.
const Moose::Functor< ADReal > & _rho_d
Dispersed phase density.
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics...
const Elem & neighbor() const
static InputParameters validParams()
const Point & normal() const
unsigned int number() const
virtual void computeResidualsAndAData(const FaceInfo &fi) override
Helper method that computes the 'a' coefficients and AD residuals.
FaceInfo::VarFaceNeighbors _face_type
const Elem * elemPtr() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
WCNSFV2PMomentumAdvectionSlip(const InputParameters ¶ms)
Moose::ElemArg neighborArg(bool correct_skewness=false) const
ADReal _an
The a coefficient for the neighbor.
const Moose::Functor< ADReal > & _fd
Particle diameter in the dispersed phase.
registerMooseObject("NavierStokesApp", WCNSFV2PMomentumAdvectionSlip)
void mooseError(Args &&... args) const
Adds momentum kernel coming from the slip velocity in two-phase mixture model.
ADReal _elem_residual
The element residual.
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
const Moose::Functor< ADReal > *const _w_slip
slip velocity in direction z
std::pair< std::pair< T, T >, std::pair< T, T > > interpCoeffsAndAdvected(const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
const unsigned int _dim
the dimension of the simulation
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const