26 "pump_force_name",
"pump_volume_force",
"Name of the pump force functor.");
27 params.
addParam<FunctionName>(
"pressure_head_function",
"Pressure Head Function.");
28 params.
addParam<MooseFunctorName>(
"area_rated", 1.0,
"Rated area of the pump.");
29 params.
addParam<MooseFunctorName>(
"volume_rated", 1.0,
"Rated volume of the pump.");
32 params.
addParam<
Real>(
"flow_rate_rated", 1.0,
"Rated flow rate.");
33 params.
addParam<PostprocessorName>(
"flow_rate", 1.0,
"Flow rate.");
35 "gravity",
RealVectorValue(0, -9.81, 0),
"The gravitational acceleration vector.");
36 params.
addParam<
Real>(
"rotation_speed_rated", 1.0,
"The rated rotation speed of the pump.");
37 params.
addParam<
Real>(
"rotation_speed", 1.0,
"The rotation speed of the pump.");
39 "enable_negative_rotation",
false,
"Flag to allow negative rotation speeds.");
40 params.
addParam<
bool>(
"symmetric_negative_pressure_head",
42 "Flag to use the pressure head function in the negative direction than the " 43 "one in the positive direction.");
44 params.
addParam<FunctionName>(
"pressure_head_function_negative_rotation",
45 "Pressure head function for negative rotation.");
52 _pressure_head_function(
53 isParamValid(
"pressure_head_function") ? &getFunction(
"pressure_head_function") : nullptr),
54 _area_rated(getFunctor<
Real>(
"area_rated")),
55 _volume_rated(getFunctor<
Real>(
"volume_rated")),
58 _flow_rate_rated(getParam<
Real>(
"flow_rate_rated")),
59 _flow_rate(getPostprocessorValue(
"flow_rate")),
61 _rotation_speed_rated(getParam<
Real>(
"rotation_speed_rated")),
62 _rotation_speed(getParam<
Real>(
"rotation_speed")),
63 _flow_rate_scaling_bool(isParamSetByUser(
"flow_rate_rated")),
64 _bool_negative_rotation_speed(getParam<bool>(
"enable_negative_rotation")),
65 _bool_symmetric_negative_pressure_head(getParam<bool>(
"symmetric_negative_pressure_head")),
66 _pressure_head_function_negative_rotation(
67 isParamValid(
"pressure_head_function_negative_rotation")
68 ? &getFunction(
"pressure_head_function_negative_rotation")
74 "Pressure head function should be provided. If negative rotation is used " 75 "'pressure_head_function_negative_rotation' should be provided.");
79 "The rotation speed must be positive if 'enable_negative_rotation' is not true.");
83 "pressure_head_function_negative_rotation",
84 "The negative pressure head won't be used if 'enable_negative_rotation' is not true.");
87 paramError(
"pressure_head_function_negative_rotation",
88 "Negative pressure head function should be provided if " 89 "'symmetric_negative_pressure_head' is false.");
91 addFunctorProperty<Real>(
92 getParam<MooseFunctorName>(
"pump_force_name"),
93 [
this](
const auto & r,
const auto & t) ->
Real 96 const Point ref_pressure_point(0.0, 0.0, 0.0);
97 Real rated_pressure_head;
100 (*_pressure_head_function).value(std::abs(
_flow_rate), ref_pressure_point);
102 rated_pressure_head = -(*_pressure_head_function_negative_rotation)
103 .value(std::abs(
_flow_rate), ref_pressure_point);
106 const auto flow_rate_scaling =
109 const auto pressure_head =
110 rated_pressure_head *
std::pow(flow_rate_scaling * rotation_speed_scaling, 4.0 / 3.0);
113 mooseAssert(
_rho.isConstant(),
114 "The density must be a constant in order for the pump force to not contain " 115 "derivative information.");
120 return -rho * gravity * pressure_head * area /
volume;
124 const auto & pump_blocks =
blockIDs();
125 std::set<SubdomainID> missing_blocks;
127 std::set_difference(mesh_blocks.begin(),
131 std::inserter(missing_blocks, missing_blocks.begin()));
136 getParam<MooseFunctorName>(
"pump_force_name"),
137 [](
const auto &,
const auto &) ->
Real {
return 0.0; },
virtual MooseMesh & mesh()=0
const bool _bool_negative_rotation_speed
Allow negative rotation speed.
auto norm() const -> decltype(std::norm(Real()))
static const std::string speed
static InputParameters validParams()
registerMooseObjectRenamed("NavierStokesApp", NSFVPumpMaterial, "08/01/2024 00:00", NSFVPumpFunctorMaterial)
registerMooseObject("NavierStokesApp", NSFVPumpFunctorMaterial)
static const std::string density
NSFVPumpFunctorMaterial(const InputParameters ¶meters)
static InputParameters validParams()
const RealVectorValue & _gravity
Gravity.
virtual const std::set< SubdomainID > & blockIDs() const
const ExecFlagType EXEC_ALWAYS
DualNumber< Real, DNDerivativeType, true > ADReal
const Real & _rotation_speed
Actual Rotation Speed.
const Function *const _pressure_head_function
Function providing the pressure head The pressure head should be provided as head (in meters) vs...
Computes the effective pump body force as a functor.
const Moose::Functor< Real > & _area_rated
Rated transversal area of the pump.
const PostprocessorValue & _flow_rate
Actual flow rate.
void paramError(const std::string ¶m, Args... args) const
const Real & _rotation_speed_rated
Rated Rotation Speed.
const SubdomainID ANY_BLOCK_ID
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::Functor< ADReal > & _rho
Density.
const Moose::FunctorBase< T > & addPiecewiseByBlockLambdaFunctor(const std::string &name, PolymorphicLambda my_lammy, const std::set< ExecFlagType > &clearance_schedule, const MooseMesh &mesh, const std::set< SubdomainID > &block_ids, const THREAD_ID tid)
const bool _bool_symmetric_negative_pressure_head
Symmetric pressure head function in the negative direction.
const Moose::Functor< Real > & _volume_rated
Rated volume of the pump.
const Real & _flow_rate_rated
Rated flow rate.
MooseUnits pow(const MooseUnits &, int)
const bool _flow_rate_scaling_bool
Boolean to determine if flow rate scaling is necessary.
const Function *const _pressure_head_function_negative_rotation
Homologous pressure head function in the negative direction (in meters) vs. flow rate (in m3/s) ...
const std::set< SubdomainID > & meshSubdomains() const