30 params.
set<std::vector<BoundaryName>>(
"connections") = {};
32 params.
addParam<
bool>(
"treat_as_turbine",
false,
"Treat the compressor as a turbine?");
35 params.
addRequiredParam<
Real>(
"rho0_rated",
"Rated compressor stagnation fluid density [kg/m^3]");
40 "Compressor friction coefficients [N-m]");
44 "Compressor inertia coefficients [kg-m^2]");
47 "Relative corrected speeds. Order of speeds needs correspond to the " 48 "orders of `Rp_functions` and `eff_functions` [-]");
51 "Functions of pressure ratio versus relative corrected flow. Each function is for a " 52 "different, constant relative corrected speed. The order of function names should correspond " 53 "to the order of speeds in the `speeds` parameter [-]");
56 "Functions of adiabatic efficiency versus relative corrected flow. Each function is for a " 57 "different, constant relative corrected speed. The order of function names should correspond " 58 "to the order of speeds in the `speeds` parameter [-]");
59 params.
addParam<
Real>(
"min_pressure_ratio", 0.0,
"Minimum pressure ratio");
60 params.
addParam<
Real>(
"max_pressure_ratio", 50.0,
"Maximum pressure ratio");
63 "1-phase compressor that must be connected to a Shaft component. Compressor speed " 64 "is controlled by the connected shaft; Isentropic/Dissipation torque and delta_p are " 65 "computed by user input functions of inlet flow rate and shaft speed");
73 _inlet(getParam<BoundaryName>(
"inlet")),
74 _outlet(getParam<BoundaryName>(
"outlet")),
75 _omega_rated(getParam<
Real>(
"omega_rated")),
76 _mdot_rated(getParam<
Real>(
"mdot_rated")),
77 _rho0_rated(getParam<
Real>(
"rho0_rated")),
78 _c0_rated(getParam<
Real>(
"c0_rated")),
79 _speed_cr_fr(getParam<
Real>(
"speed_cr_fr")),
80 _tau_fr_const(getParam<
Real>(
"tau_fr_const")),
81 _tau_fr_coeff(getParam<
std::vector<
Real>>(
"tau_fr_coeff")),
82 _speed_cr_I(getParam<
Real>(
"speed_cr_I")),
83 _inertia_const(getParam<
Real>(
"inertia_const")),
84 _inertia_coeff(getParam<
std::vector<
Real>>(
"inertia_coeff")),
85 _speeds(getParam<
std::vector<
Real>>(
"speeds")),
86 _Rp_functions(getParam<
std::vector<FunctionName>>(
"Rp_functions")),
87 _eff_functions(getParam<
std::vector<FunctionName>>(
"eff_functions")),
88 _delta_p_var_name(junctionVariableName(
"delta_p")),
89 _isentropic_torque_var_name(junctionVariableName(
"isentropic_torque")),
90 _dissipation_torque_var_name(junctionVariableName(
"dissipation_torque")),
91 _friction_torque_var_name(junctionVariableName(
"friction_torque")),
92 _moi_var_name(junctionVariableName(
"moment_of_inertia"))
98 checkSizeEqualsValue<Real>(
"tau_fr_coeff", 4);
99 checkSizeEqualsValue<Real>(
"inertia_coeff", 4);
113 const Shaft & scc =
dynamic_cast<const Shaft &
>(
c);
120 const std::string class_name =
"ADShaftConnectedCompressor1PhaseUserObject";
122 params.
set<
bool>(
"use_scalar_variables") =
false;
125 params.
set<std::vector<Real>>(
"normals") =
_normals;
141 params.
set<
bool>(
"treat_as_turbine") = getParam<bool>(
"treat_as_turbine");
151 params.
set<std::vector<Real>>(
"speeds") =
_speeds;
154 params.
set<
Real>(
"min_pressure_ratio") = getParam<Real>(
"min_pressure_ratio");
155 params.
set<
Real>(
"max_pressure_ratio") = getParam<Real>(
"max_pressure_ratio");
156 params.
set<std::vector<VariableName>>(
"omega") = {omega_var_name};
157 params.
set<
Real>(
"A_ref") = getParam<Real>(
"A_ref");
158 params.
set<
Real>(
"K") = getParam<Real>(
"K");
160 params.
set<std::string>(
"compressor_name") =
cname();
161 params.
set<
bool>(
"apply_velocity_scaling") = getParam<bool>(
"apply_velocity_scaling");
194 const std::vector<std::pair<std::string, VariableName>> quantities_aux = {
200 for (
const auto & quantity_and_name : quantities_aux)
202 const std::string class_name =
"ShaftConnectedCompressor1PhaseAux";
204 params.
set<AuxVariableName>(
"variable") = quantity_and_name.second;
205 params.
set<
MooseEnum>(
"quantity") = quantity_and_name.first;
207 const std::string obj_name =
genName(
name(), quantity_and_name.first +
"_aux");
212 const std::vector<std::string> quantities_pp = {
213 "pressure_ratio",
"efficiency",
"rel_corrected_flow",
"rel_corrected_speed"};
214 for (
const auto & quantity : quantities_pp)
216 const std::string class_name =
"ShaftConnectedCompressor1PhasePostprocessor";
virtual void check() const override
Check the component integrity.
virtual UserObjectName getShaftConnectedUserObjectName() const override
const Real & _rho0_rated
Rated compressor inlet stagnation fluid density.
virtual void addVariables() override
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
std::string _shaft_name
Name of the shaft component.
virtual void addMooseObjects() override
const VariableName _rhoV_var_name
rho*V variable name for junction
const std::vector< processor_id_type > & getConnectedProcessorIDs()
Gets the processor IDs of the connected 1D components.
static InputParameters validParams()
static const std::string AREA
const Real & _speed_cr_fr
Compressor speed threshold for friction.
THMProblem & getTHMProblem() const
Gets the THM problem.
const std::vector< Real > & _speeds
Compressor speeds which correspond to Rp and eff function order.
virtual void addVariables() override
const VariableName _dissipation_torque_var_name
Name of compressor dissipation torque variable.
const VariableName _rhovV_var_name
rho*v*V variable name for junction
InputParameters getValidParams(const std::string &name) const
const std::string & cname() const
Get the component name.
registerMooseObject("ThermalHydraulicsApp", ShaftConnectedCompressor1Phase)
const Real & _tau_fr_const
Compressor friction constant.
const Real & _mdot_rated
Rated compressor mass flow rate.
const Real & _c0_rated
Rated compressor inlet stagnation sound speed.
virtual void buildVolumeJunctionUserObject() override
Builds user object for computing and storing the fluxes.
const ExecFlagType EXEC_TIMESTEP_END
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
const BoundaryName & _outlet
Compressor outlet.
const Real & _speed_cr_I
Compressor speed threshold for inertia.
static InputParameters validParams()
const VariableName _rhowV_var_name
rho*w*V variable name for junction
bool isRestarting() const
const VariableName _isentropic_torque_var_name
Name of compressor isentropic torque variable.
virtual void checkShaftConnection(const Component *const component) const
std::vector< BoundaryName > _boundary_names
Boundary names of connected components.
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
virtual const std::string & name() const
const VariableName _delta_p_var_name
Name of compressor delta_p variable.
ExecFlagEnum getDefaultExecFlagEnum()
Component that connects torque of turbomachinery components.
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
void addJunctionIC(const VariableName &var, Real value)
Adds a junction IC to the problem, as a scalar or field variable.
const BoundaryName & _inlet
Compressor inlet.
static const std::string RHOUA
std::vector< UserObjectName > _numerical_flux_names
virtual void check() const override
Check the component integrity.
static const std::string RHOA
virtual void addMooseObjects() override
Base class for THM components.
const Real _volume
Volume of the junction.
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.
1-phase compressor that must be connected to a Shaft component
void addJunctionVariable(bool is_nonlinear, const VariableName &var, Real scaling_factor=1.0)
Adds a junction variable to the problem, as a scalar or field variable.
const ExecFlagType EXEC_LINEAR
const std::vector< FunctionName > & _Rp_functions
Names of the pressure ratio functions.
ShaftConnectedCompressor1Phase(const InputParameters ¶ms)
Junction between 1-phase flow channels that has a non-zero volume.
const ExecFlagType EXEC_NONLINEAR
const std::string _junction_uo_name
Name of junction user object name, if any.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual VariableName getOmegaVariableName() const
Factory & _factory
The Factory associated with the MooseApp.
void connectObject(const InputParameters ¶ms, const std::string &mooseName, const std::string &name) const
Connect with control logic.
Interface class for components that connect to a shaft.
UserObjectName _fp_name
Fluid property user object name.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
const std::vector< Real > & _inertia_coeff
Compressor inertia coefficients.
const std::vector< FunctionName > & _eff_functions
Names of the adiabatic efficiency functions.
static const std::string RHOEA
const VariableName _rhouV_var_name
rho*u*V variable name for junction
const std::vector< Real > & _tau_fr_coeff
Compressor friction coefficients.
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
const Real & _inertia_const
Compressor inertia constant.
std::vector< Real > _normals
Outward normals associated with connected components.
std::vector< RealVectorValue > _directions
Directions of connected components.
const VariableName _rhoEV_var_name
rho*E*V variable name for junction
static InputParameters validParams()
subdomain_id_type _junction_subdomain_id
Junction subdomain ID.
const Real & _omega_rated
Rated compressor speed.
const VariableName _friction_torque_var_name
Name of compressor friction torque variable.
const ExecFlagType EXEC_INITIAL