15 #include "metaphysicl/parallel_numberarray.h" 16 #include "metaphysicl/parallel_dualnumber.h" 17 #include "metaphysicl/parallel_semidynamicsparsenumberarray.h" 18 #include "libmesh/parallel_algebra.h" 28 params.
addParam<BoundaryName>(
"inlet",
"Pump inlet");
29 params.
addParam<BoundaryName>(
"outlet",
"Pump outlet");
39 params.
addRequiredParam<std::vector<Real>>(
"tau_fr_coeff",
"Friction coefficients [N-m]");
42 params.
addRequiredParam<std::vector<Real>>(
"inertia_coeff",
"Pump inertia coefficients [kg-m^2]");
43 params.
addRequiredParam<FunctionName>(
"head",
"Function to compute data for pump head [-]");
45 "Function to compute data for pump torque [-]");
46 params.
addRequiredParam<std::string>(
"pump_name",
"Name of the instance of this pump component");
50 "Transition width for sign of the frictional torque at 0 speed over rated speed ratio.");
54 "Computes and caches flux and residual vectors for a 1-phase pump. Also computes pump torque " 55 "and head which is passed to the connected shaft");
65 _di_out(getParam<Point>(
"di_out")),
66 _g(getParam<
Real>(
"gravity_magnitude")),
67 _omega_rated(getParam<
Real>(
"omega_rated")),
68 _volumetric_rated(getParam<
Real>(
"volumetric_rated")),
69 _head_rated(getParam<
Real>(
"head_rated")),
70 _torque_rated(getParam<
Real>(
"torque_rated")),
71 _density_rated(getParam<
Real>(
"density_rated")),
72 _speed_cr_fr(getParam<
Real>(
"speed_cr_fr")),
73 _tau_fr_const(getParam<
Real>(
"tau_fr_const")),
74 _tau_fr_coeff(getParam<
std::vector<
Real>>(
"tau_fr_coeff")),
75 _speed_cr_I(getParam<
Real>(
"speed_cr_I")),
76 _inertia_const(getParam<
Real>(
"inertia_const")),
77 _inertia_coeff(getParam<
std::vector<
Real>>(
"inertia_coeff")),
78 _head(getFunction(
"head")),
79 _torque_hydraulic(getFunction(
"torque_hydraulic")),
80 _pump_name(getParam<
std::string>(
"pump_name")),
81 _omega(adCoupledScalarValue(
"omega")),
82 _transition_width(getParam<
Real>(
"transition_width")),
83 _transition_friction(0, _transition_width)
143 const ADReal homologous_torque = -
y * zt;
const ADVariableValue & _rhoA
rho*A of the connected flow channels
virtual void initialize()
const Function & _torque_hydraulic
Function to compute data for pump torque.
std::vector< std::vector< dof_id_type > > _flow_channel_dofs
Degrees of freedom for flow channel variables, for each connection.
virtual void finalize() override
const Real & _g
Gravity constant.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
unsigned int getBoundaryIDIndex()
Gets the index of the currently executing boundary within the vector of boundary IDs given to this Si...
const Real & _head_rated
Rated pump head.
static InputParameters validParams()
Point _di_out
Direction of the pump outlet.
const Real & _speed_cr_fr
Pump speed threshold for friction.
const Parallel::Communicator & comm() const
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
const ADWeightedTransition _transition_friction
Transition for the sign of the frictional torque when speed is 0.
unsigned int _n_flux_eq
Number of flow channel flux components.
const std::vector< double > y
Computes and caches flux and residual vectors for a 1-phase pump.
const unsigned int _n_connections
Number of connected flow channels.
const Real & _omega_rated
Rated pump speed.
const ADReal & leftEnd() const
Returns the coordinate of the left end of the transition.
DualNumber< Real, DNDerivativeType, true > ADReal
virtual void initialize() override
virtual void initialize() override
ADReal _pump_head
Pump head.
const Real & _volumetric_rated
Rated pump volumetric flow rate.
std::vector< ADReal > _residual
Cached scalar residual vector.
virtual void setOmegaDofs(const MooseVariableScalar *omega_var)
const Real & _torque_rated
Rated pump torque.
const ADVariableValue & _omega
Shaft speed.
const std::vector< Real > & _tau_fr_coeff
Pump friction coefficients.
virtual void threadJoin(const UserObject &uo) override
const ADReal & rightEnd() const
Returns the coordinate of the right end of the transition.
const Real & _tau_fr_const
Pump friction constant.
const Real & _density_rated
Rated pump density.
ADReal _friction_torque
Pump friction torque.
const Real & _A_ref
Reference area.
virtual void execute() override
virtual void storeConnectionData()
Stores data (connection index, face shape functions, DoFs associated with flow channel variables) rel...
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
virtual ADReal value(const ADReal &x, const ADReal &f1, const ADReal &f2) const override
Computes the transition value.
virtual void setupJunctionData(std::vector< dof_id_type > &scalar_dofs)
Stores data associated with a junction component.
virtual void initialSetup() override
const Real & _inertia_const
Pump inertia constant.
Computes and caches flux and residual vectors for a 1-phase volume junction.
registerMooseObject("ThermalHydraulicsApp", ADShaftConnectedPump1PhaseUserObject)
virtual void threadJoin(const UserObject &uo)
virtual void finalize() override
ADReal getFrictionTorque() const
Friction torque computed in the 1-phase shaft-connected pump.
ADReal getPumpHead() const
Pump head computed in the 1-phase shaft-connected pump.
std::vector< dof_id_type > _scalar_dofs
Degrees of freedom for scalar variables.
static InputParameters validParams()
ADReal _moment_of_inertia
Moment of inertia.
Interface class for user objects that are connected to a shaft.
const ADVariableValue & _A
Cross-sectional area of connected flow channels.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void setConnectionData(const std::vector< std::vector< dof_id_type >> &flow_channel_dofs)
Stores data computed by a volume-junction-like object associated with the conection.
const std::vector< Real > & _inertia_coeff
Pump inertia coefficients.
static const std::string alpha
ADReal getHydraulicTorque() const
Hydraulic torque computed in the 1-phase shaft-connected pump.
virtual void threadJoin(const UserObject &uo) override
virtual void setupConnections(unsigned int n_connections, unsigned int n_flow_eq)
ADReal _torque
Total torque.
static InputParameters validParams()
virtual Real value(Real t, const Point &p) const
ADReal _hydraulic_torque
Pump hydraulic torque.
const ADVariableValue & _rhouA
rho*u*A of the connected flow channels
ADShaftConnectedPump1PhaseUserObject(const InputParameters ¶ms)
const Real & _speed_cr_I
Pump speed threshold for inertia.
virtual void initialSetup() override
const Function & _head
Function to compute data for pump head.