19LinearWCNSFV2PMomentumDriftFlux ::validParams()
22 params.addClassDescription(
"Implements the drift momentum flux source.");
23 params.addRequiredParam<UserObjectName>(
24 "rhie_chow_user_object",
25 "The rhie-chow user-object which is used to determine the face velocity.");
26 params.addRequiredParam<MooseFunctorName>(
"u_slip",
"The slip velocity in the x direction.");
27 params.addParam<MooseFunctorName>(
"v_slip",
"The slip velocity in the y direction.");
28 params.addParam<MooseFunctorName>(
"w_slip",
"The slip velocity in the z direction.");
29 params.addRequiredParam<MooseFunctorName>(
"rho_d",
"Dispersed phase density.");
30 params.addParam<MooseFunctorName>(
"fd", 0.0,
"Fraction dispersed phase.");
31 params.renameParam(
"fd",
"fraction_dispersed",
"");
33 params.addParam<
bool>(
34 "force_boundary_execution",
true,
"This kernel should execute on boundaries by default");
35 MooseEnum momentum_component(
"x=0 y=1 z=2");
39 "The component of the momentum equation that this kernel applies to.");
41 MooseEnum coeff_interp_method(
"average harmonic",
"harmonic");
42 params.addParam<
MooseEnum>(
"density_interp_method",
44 "Switch that can select face interpolation method for the density.");
49LinearWCNSFV2PMomentumDriftFlux ::LinearWCNSFV2PMomentumDriftFlux(
const InputParameters & params)
51 _dim(_subproblem.
mesh().dimension()),
52 _mass_flux_provider(getUserObject<
RhieChowMassFlux>(
"rhie_chow_user_object")),
53 _rho_d(getFunctor<Real>(
"rho_d")),
54 _f_d(getFunctor<Real>(
"fd")),
55 _u_slip(getFunctor<Real>(
"u_slip")),
56 _v_slip(isParamValid(
"v_slip") ? &getFunctor<Real>(
"v_slip") : nullptr),
57 _w_slip(isParamValid(
"w_slip") ? &getFunctor<Real>(
"w_slip") : nullptr),
58 _index(getParam<
MooseEnum>(
"momentum_component")),
59 _density_interp_method(
60 Moose::FV::selectInterpolationMethod(getParam<
MooseEnum>(
"density_interp_method")))
63 mooseError(
"In two or more dimensions, the v_slip velocity must be supplied using the 'v_slip' "
67 "In three dimensions, the w_slip velocity must be supplied using the 'w_slip' parameter");
86 RealVectorValue u_slip_vel_vec;
88 u_slip_vel_vec = RealVectorValue(
_u_slip(face_arg, state), 0.0, 0.0);
90 u_slip_vel_vec = RealVectorValue(
_u_slip(face_arg, state), (*
_v_slip)(face_arg, state), 0.0);
92 u_slip_vel_vec = RealVectorValue(
95 const auto uslipdotn = normal * u_slip_vel_vec;
99 face_rho_fd =
_rho_d(face_arg, state) *
_f_d(face_arg, state);
107 _rho_d(elem_arg, state) *
_f_d(elem_arg, state),
108 _rho_d(neigh_arg, state) *
_f_d(neigh_arg, state),
120 if (std::abs(u_old) > 1e-6)
130 if (std::abs(u_old) > 1e-6)
143 if (std::abs(u_old) > 1e-6)
155 if (std::abs(u_old) > 1e-6)
registerMooseObject("NavierStokesApp", LinearWCNSFV2PMomentumDriftFlux)
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
const Point & normal() const
const Elem * neighborPtr() const
const Elem * elemPtr() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
virtual void setupFaceData(const FaceInfo *face_info)
const FaceInfo * _current_face_info
static InputParameters validParams()
MooseLinearVariableFV< Real > & _var
Adds drift flux kernel coming for two-phase mixture model for the linear finite volume discretization...
const unsigned int _index
The index of the momentum component.
const Moose::Functor< Real > & _u_slip
slip velocity in direction x
const Moose::Functor< Real > *const _v_slip
slip velocity in direction y
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition &bc) override
virtual Real computeElemRightHandSideContribution() override
const RhieChowMassFlux & _mass_flux_provider
The Rhie-Chow user object that provides us with the face velocity.
virtual Real computeElemMatrixContribution() override
virtual Real computeNeighborMatrixContribution() override
Real _face_flux
Face flux.
virtual void setupFaceData(const FaceInfo *face_info) override
Set the current FaceInfo object.
const Moose::Functor< Real > & _f_d
Dispersed phase fraction.
const Moose::FV::InterpMethod _density_interp_method
The face interpolation method for the density.
const Moose::Functor< Real > & _rho_d
Dispersed phase density.
const Moose::Functor< Real > *const _w_slip
slip velocity in direction z
const unsigned int _dim
The dimension of the simulation.
virtual Real computeNeighborRightHandSideContribution() override
void computeFlux()
Compute the face flux.
std::pair< Real, Real > _velocity_interp_coeffs
Advected coefficients.
void mooseError(Args &&... args) const
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Real getMassFlux(const FaceInfo &fi) const
Get the face velocity times density (used in advection terms)
Moose::StateArg determineState() const
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
std::pair< Real, Real > interpCoeffs(const InterpMethod m, const FaceInfo &fi, const bool one_is_elem, const T &face_flux=0.0)
bool onBoundary(const SubdomainRestrictable &obj, const FaceInfo &fi)
StateArg previousNonlinearState()