28 params.
set<std::vector<BoundaryName>>(
"connections") = {};
32 "Any physical dimension of the turbine as a measure of the "
33 "turbine's size, usually the rotor diameter [m]");
34 params.
addRequiredParam<Real>(
"speed_cr_fr",
"Turbine speed threshold for friction [-]");
35 params.
addRequiredParam<Real>(
"tau_fr_const",
"Turbine friction constant [N-m]");
36 params.
addRequiredParam<std::vector<Real>>(
"tau_fr_coeff",
"Turbine friction coefficients [N-m]");
37 params.
addRequiredParam<Real>(
"speed_cr_I",
"Turbine speed threshold for inertia [-]");
38 params.
addRequiredParam<Real>(
"inertia_const",
"Turbine inertia constant [kg-m^2]");
40 "Turbine inertia coefficients [kg-m^2]");
42 "Head coefficient vs flow coefficient function [-]");
44 "Power coefficient vs flow coefficient function [-]");
47 "1-phase turbine that must be connected to a Shaft component. Turbine speed "
48 "is controlled by the connected shaft; Driving torque and delta_p are "
49 "computed by user input functions of inlet flow rate (flow coefficient aux variable) and "
58 _inlet(getParam<BoundaryName>(
"inlet")),
59 _outlet(getParam<BoundaryName>(
"outlet")),
60 _omega_rated(getParam<Real>(
"omega_rated")),
61 _D_wheel(getParam<Real>(
"D_wheel")),
62 _speed_cr_fr(getParam<Real>(
"speed_cr_fr")),
63 _tau_fr_const(getParam<Real>(
"tau_fr_const")),
64 _tau_fr_coeff(getParam<
std::vector<Real>>(
"tau_fr_coeff")),
65 _speed_cr_I(getParam<Real>(
"speed_cr_I")),
66 _inertia_const(getParam<Real>(
"inertia_const")),
67 _inertia_coeff(getParam<
std::vector<Real>>(
"inertia_coeff")),
68 _head_coefficient(getParam<FunctionName>(
"head_coefficient")),
69 _power_coefficient(getParam<FunctionName>(
"power_coefficient")),
70 _delta_p_var_name(junctionVariableName(
"delta_p")),
71 _power_var_name(junctionVariableName(
"power")),
72 _driving_torque_var_name(junctionVariableName(
"driving_torque")),
73 _friction_torque_var_name(junctionVariableName(
"friction_torque")),
74 _flow_coeff_var_name(junctionVariableName(
"flow_coeff")),
75 _moi_var_name(junctionVariableName(
"moment_of_inertia"))
81 checkSizeEqualsValue<Real>(
"tau_fr_coeff", 4);
82 checkSizeEqualsValue<Real>(
"inertia_coeff", 4);
103 const std::string class_name =
"ADShaftConnectedTurbine1PhaseUserObject";
105 params.
set<
bool>(
"use_scalar_variables") =
false;
108 params.
set<std::vector<Real>>(
"normals") =
_normals;
133 params.
set<std::vector<VariableName>>(
"omega") = {omega_var_name};
134 params.
set<Real>(
"A_ref") = getParam<Real>(
"A_ref");
135 params.
set<Real>(
"K") = getParam<Real>(
"K");
137 params.
set<std::string>(
"turbine_name") =
cname();
138 params.
set<
bool>(
"apply_velocity_scaling") = getParam<bool>(
"apply_velocity_scaling");
173 const std::vector<std::pair<std::string, VariableName>> quantities_aux = {
180 for (
const auto & quantity_and_name : quantities_aux)
182 const std::string class_name =
"ShaftConnectedTurbine1PhaseAux";
184 params.
set<AuxVariableName>(
"variable") = quantity_and_name.second;
185 params.
set<
MooseEnum>(
"quantity") = quantity_and_name.first;
187 const std::string obj_name =
genName(
name(), quantity_and_name.first +
"_aux");
const ExecFlagType EXEC_INITIAL
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_NONLINEAR
registerMooseObject("ThermalHydraulicsApp", ShaftConnectedTurbine1Phase)
std::vector< Real > _normals
Outward normals associated with connected components.
std::vector< RealVectorValue > _directions
Directions of connected components.
std::vector< BoundaryName > _boundary_names
Boundary names of connected components.
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
const std::vector< processor_id_type > & getConnectedProcessorIDs()
Gets the processor IDs of the connected 1D components.
subdomain_id_type _junction_subdomain_id
Junction subdomain ID.
Base class for THM components.
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
THMProblem & getTHMProblem() const
Gets the THM problem.
Factory & _factory
The Factory associated with the MooseApp.
const std::string & cname() const
Get the component name.
void connectObject(const InputParameters &obj_params, const std::string &obj_name, const std::string ¶m) const
Connects a controllable parameter of the component to a controllable parameter of a constituent objec...
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
std::vector< UserObjectName > _numerical_flux_names
const std::string _junction_uo_name
Name of junction user object name, if any.
UserObjectName _fp_name
Fluid property user object name.
static const std::string RHOUA
static const std::string RHOA
static const std::string RHOEA
static const std::string AREA
bool isRestarting() const
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.
Interface class for components that connect to a shaft.
std::string _shaft_name
Name of the shaft component.
virtual void checkShaftConnection(const Component *const component) const
static InputParameters validParams()
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.
1-phase turbine that must be connected to a Shaft component
ShaftConnectedTurbine1Phase(const InputParameters ¶ms)
const VariableName _delta_p_var_name
Name of turbine pressure drop variable.
static InputParameters validParams()
const VariableName _friction_torque_var_name
Name of turbine friction torque variable.
const Real & _speed_cr_fr
Turbine speed threshold for friction.
virtual void addVariables() override
const BoundaryName & _inlet
Turbine inlet.
const std::vector< Real > & _tau_fr_coeff
Turbine friction coefficients.
const BoundaryName & _outlet
Turbine outlet.
const VariableName _power_var_name
Name of turbine power variable.
const std::vector< Real > & _inertia_coeff
Turbine inertia coefficients.
const Real & _inertia_const
Turbine inertia constant.
const VariableName _driving_torque_var_name
Name of turbine driving torque variable.
const Real & _tau_fr_const
Turbine friction constant.
const Real & _speed_cr_I
Turbine speed threshold for inertia.
virtual UserObjectName getShaftConnectedUserObjectName() const override
const Real & _D_wheel
Turbine wheel diameter.
const FunctionName & _head_coefficient
Name of function to compute data for turbine head.
const VariableName _flow_coeff_var_name
Name of turbine flow_coeff torque variable.
virtual void addMooseObjects() override
virtual void check() const override
Check the component integrity.
virtual void buildVolumeJunctionUserObject() override
Builds user object for computing and storing the fluxes.
const FunctionName & _power_coefficient
Name of function to compute data for turbine power.
const Real & _omega_rated
Rated turbine speed.
Component that connects torque of turbomachinery components.
virtual VariableName getOmegaVariableName() const
Junction between 1-phase flow channels that has a non-zero volume.
const VariableName _rhovV_var_name
rho*v*V variable name for junction
const Real _volume
Volume of the junction.
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.
virtual void addVariables() override
const VariableName _rhoEV_var_name
rho*E*V variable name for junction
virtual void check() const override
Check the component integrity.
const VariableName _rhoV_var_name
rho*V variable name for junction
virtual void addMooseObjects() override
void addJunctionIC(const VariableName &var, Real value)
Adds a junction IC to the problem, as a scalar or field variable.
static InputParameters validParams()
const VariableName _rhowV_var_name
rho*w*V variable name for junction
const VariableName _rhouV_var_name
rho*u*V variable name for junction
ExecFlagEnum getDefaultExecFlagEnum()