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.");
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",
58 rm_params.
set<
unsigned short>(
"layers") = obj_params.
get<
unsigned short>(
"ghost_layers");
66 _dim(_subproblem.
mesh().dimension()),
73 _rho_d(getFunctor<
ADReal>(
"rho_d")),
76 _force_scale(getParam<
Real>(
"force_value")),
77 _force_function(getFunction(
"force_function")),
78 _force_postprocessor(getPostprocessorValue(
"force_postprocessor")),
80 _linear_friction(getFunctor<
ADReal>(
"linear_coef_name")),
81 _particle_diameter(getFunctor<
ADReal>(
"particle_diameter")),
82 _index(getParam<
MooseEnum>(
"momentum_component"))
84 if (!dynamic_cast<const INSFVVelocityVariable *>(
_u_var) &&
87 "the u velocity must be an INSFVVelocityVariable or a MooseLinearVariableFVReal");
89 if (
_dim >= 2 && (!dynamic_cast<const INSFVVelocityVariable *>(
_v_var) &&
92 "In two or more dimensions, the v velocity must be supplied and it must be an " 93 "INSFVVelocityVariable or a MooseLinearVariableFVReal.");
95 if (
_dim >= 3 && (!dynamic_cast<const INSFVVelocityVariable *>(
_w_var) &&
98 "In three-dimensions, the w velocity must be supplied and it must be an " 99 "INSFVVelocityVariable or a MooseLinearVariableFVReal.");
105 u->computeCellGradients();
107 v->computeCellGradients();
109 w->computeCellGradients();
111 addFunctorProperty<ADReal>(
112 getParam<MooseFunctorName>(
"slip_velocity_name"),
113 [
this](
const auto & r,
const auto & t)
115 constexpr
Real offset = 1e-15;
136 const auto u_velocity = (*_u_var)(r, t);
138 term_advection(0) += u_velocity * u_grad(0);
141 const auto v_velocity = (*_v_var)(r, t);
143 term_advection(0) += v_velocity * u_grad(1);
144 term_advection(1) += u_velocity * v_grad(0) + v_velocity * v_grad(1);
147 const auto w_velocity = (*_w_var)(r, t);
149 term_advection(0) += w_velocity * u_grad(2);
150 term_advection(1) += w_velocity * v_grad(2);
152 u_velocity * w_grad(0) + v_velocity * w_grad(1) + w_velocity * w_grad(2);
157 const ADReal flux_residual =
158 density_scaling * (-term_transient - term_advection +
_gravity + term_force)(
_index);
160 const ADReal relaxation_time =
165 return relaxation_time / linear_friction_factor * flux_residual;
const Moose::Functor< ADReal > & _rho_mixture
Continuous phase density.
static InputParameters validParams()
static InputParameters validParams()
RealVectorValue _force_direction
Force direction vector.
const Moose::Functor< ADReal > & _linear_friction
The linear friction factor, for laminar flow.
static const std::string density
registerMooseObject("NavierStokesApp", WCNSFV2PSlipVelocityFunctorMaterial)
MooseVariableField< Real > *const _w_var
z-velocity
WCNSFV2PSlipVelocityFunctorMaterial(const InputParameters ¶meters)
DualNumber< Real, DNDerivativeType, true > ADReal
const PostprocessorValue & _force_postprocessor
Optional Force Postprocessor value.
MooseVariableField< Real > *const _u_var
x-velocity
Computes the value of slip velocity for the two phase mixture model.
static const std::string mu
virtual bool isTransient() const=0
unsigned int _index
index of the velocity component x|y|z
const unsigned int _dim
the dimension of the simulation
void paramError(const std::string ¶m, Args... args) const
const Function & _force_function
Force optional function value.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
DotType dot(const ElemArg &elem, const StateArg &state) const
const Real & _force_scale
Force scale factor.
const Moose::Functor< ADReal > & _rho_d
Dispersed Phase Density.
GradientType gradient(const ElemArg &elem, const StateArg &state) const
const Moose::Functor< ADReal > & _mu_mixture
Mixture density.
virtual Real value(Real t, const Point &p) const
const Moose::Functor< ADReal > & _particle_diameter
Particle diameter in the dispersed phase.
const Elem *const & _current_elem
MooseVariableField< Real > *const _v_var
y-velocity