25 params.
addCoupledVar(
"v",
"The velocity in the y direction.");
26 params.
addCoupledVar(
"w",
"The velocity in the z direction.");
28 params.
addRequiredParam<MooseFunctorName>(
"rho_d",
"Dispersed phase density.");
31 "gravity", RealVectorValue(0, 0, 0),
"Gravity acceleration vector");
32 params.
addParam<Real>(
"force_value", 0.0,
"Coefficient to multiply by the body force term");
33 params.
addParam<FunctionName>(
"force_function",
"0",
"A function that describes the body force");
35 "force_postprocessor", 0,
"A postprocessor whose value is multiplied by the body force");
37 "force_direction", RealVectorValue(1, 0, 0),
"Gravitational acceleration vector");
39 "linear_coef_name", 0.44,
"Linear friction coefficient name as a material property");
41 "particle_diameter", 1.0,
"Diameter of particles in the dispersed phase.");
42 params.
addParam<MooseFunctorName>(
"fd", 0.0,
"Fraction dispersed phase.");
43 MooseEnum momentum_component(
"x=0 y=1 z=2");
47 "The component of the momentum equation that this kernel applies to.");
48 params.
addRequiredParam<MooseFunctorName>(
"slip_velocity_name",
"the name of the slip velocity");
49 params.
addParam<
unsigned short>(
"ghost_layers",
51 "The number of layers of elements to ghost. With Rhie-Chow and "
52 "the velocity gradient calculation below, we need 3");
54 "ElementSideNeighborLayers",
55 Moose::RelationshipManagerType::GEOMETRIC | Moose::RelationshipManagerType::ALGEBRAIC |
56 Moose::RelationshipManagerType::COUPLING,
59 rm_params.
set<
unsigned short>(
"layers") = obj_params.
get<
unsigned short>(
"ghost_layers");
67 _dim(_subproblem.
mesh().dimension()),
69 _v_var(params.isParamValid(
"v") ? dynamic_cast<
MooseVariableField<Real> *>(getFieldVar(
"v", 0))
71 _w_var(params.isParamValid(
"w") ? dynamic_cast<
MooseVariableField<Real> *>(getFieldVar(
"w", 0))
73 _rho_mixture(getFunctor<
ADReal>(
NS::density)),
74 _rho_d(getFunctor<
ADReal>(
"rho_d")),
76 _gravity(getParam<RealVectorValue>(
"gravity")),
77 _force_scale(getParam<Real>(
"force_value")),
78 _force_function(getFunction(
"force_function")),
79 _force_postprocessor(getPostprocessorValue(
"force_postprocessor")),
80 _force_direction(getParam<RealVectorValue>(
"force_direction")),
81 _linear_friction(getFunctor<
ADReal>(
"linear_coef_name")),
82 _particle_diameter(getFunctor<
ADReal>(
"particle_diameter")),
83 _index(getParam<
MooseEnum>(
"momentum_component"))
88 "the u velocity must be an INSFVVelocityVariable or a MooseLinearVariableFVReal");
93 "In two or more dimensions, the v velocity must be supplied and it must be an "
94 "INSFVVelocityVariable or a MooseLinearVariableFVReal.");
99 "In three-dimensions, the w velocity must be supplied and it must be an "
100 "INSFVVelocityVariable or a MooseLinearVariableFVReal.");
106 u->computeCellGradients();
108 v->computeCellGradients();
110 w->computeCellGradients();
112 addFunctorProperty<ADReal>(
113 getParam<MooseFunctorName>(
"slip_velocity_name"),
114 [
this](
const auto & r,
const auto & t)
116 constexpr Real offset = 1e-15;
137 const auto u_velocity = (*_u_var)(r, t);
139 term_advection(0) += u_velocity * u_grad(0);
142 const auto v_velocity = (*_v_var)(r, t);
144 term_advection(0) += v_velocity * u_grad(1);
145 term_advection(1) += u_velocity * v_grad(0) + v_velocity * v_grad(1);
148 const auto w_velocity = (*_w_var)(r, t);
150 term_advection(0) += w_velocity * u_grad(2);
151 term_advection(1) += w_velocity * v_grad(2);
153 u_velocity * w_grad(0) + v_velocity * w_grad(1) + w_velocity * w_grad(2);
158 const ADReal flux_residual =
159 density_scaling * (-term_transient - term_advection +
_gravity + term_force)(
_index);
161 const ADReal relaxation_time =
166 return relaxation_time / linear_friction_factor * flux_residual;
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", WCNSFV2PSlipVelocityFunctorMaterial)
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()
const Elem *const & _current_elem
void paramError(const std::string ¶m, Args... args) const
DotType dot(const ElemArg &elem, const StateArg &state) const
GradientType gradient(const ElemArg &elem, const StateArg &state) const
virtual bool isTransient() const=0
Computes the value of slip velocity for the two phase mixture model.
const Moose::Functor< ADReal > & _rho_d
Dispersed Phase Density.
unsigned int _index
index of the velocity component x|y|z
MooseVariableField< Real > *const _v_var
y-velocity
WCNSFV2PSlipVelocityFunctorMaterial(const InputParameters ¶meters)
const Moose::Functor< ADReal > & _particle_diameter
Particle diameter in the dispersed phase.
const Moose::Functor< ADReal > & _rho_mixture
Continuous phase density.
const Function & _force_function
Force optional function value.
const PostprocessorValue & _force_postprocessor
Optional Force Postprocessor value.
MooseVariableField< Real > *const _u_var
x-velocity
RealVectorValue _force_direction
Force direction vector.
const Real & _force_scale
Force scale factor.
const Moose::Functor< ADReal > & _mu_mixture
Mixture density.
static InputParameters validParams()
const unsigned int _dim
the dimension of the simulation
MooseVariableField< Real > *const _w_var
z-velocity
const Moose::Functor< ADReal > & _linear_friction
The linear friction factor, for laminar flow.
static const std::string density
static const std::string mu