20 params.
addRequiredParam<FunctionName>(
"torque",
"Driving torque supplied by the motor [kg-m^2]");
21 params.
addRequiredParam<FunctionName>(
"inertia",
"Moment of inertia from the motor [N-m]");
22 params.
addParam<
bool>(
"ad",
true,
"Use AD version or not");
31 _torque_fn_name(getParam<FunctionName>(
"torque")),
32 _inertia_fn_name(getParam<FunctionName>(
"inertia"))
57 if (getParam<bool>(
"ad"))
59 std::string class_name =
"ADShaftConnectedMotorUserObject";
63 params.
set<std::vector<VariableName>>(
"shaft_speed") = {shaft_speed_var_name};
68 std::string class_name =
"ShaftConnectedMotorUserObject";
72 params.
set<std::vector<VariableName>>(
"shaft_speed") = {shaft_speed_var_name};
std::string _shaft_name
Name of the shaft component.
ShaftConnectedMotor(const InputParameters ¶ms)
THMProblem & getTHMProblem() const
Gets the THM problem.
Motor to drive a shaft component.
InputParameters getValidParams(const std::string &name) const
void makeFunctionControllableIfConstant(const FunctionName &fn_name, const std::string &control_name, const std::string ¶m="value") const
Makes a function controllable if it is constant.
static InputParameters validParams()
virtual void checkShaftConnection(const Component *const component) const
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", ShaftConnectedMotor)
Component that connects torque of turbomachinery components.
static InputParameters validParams()
virtual void addMooseObjects() override
Base class for THM components.
const FunctionName & _torque_fn_name
Torque function name.
virtual void addVariables() override
const FunctionName & _inertia_fn_name
Moment of inertia function name.
virtual UserObjectName getShaftConnectedUserObjectName() const
virtual VariableName getOmegaVariableName() const
Factory & _factory
The Factory associated with the MooseApp.
Interface class for components that connect to a shaft.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
virtual void check() const override
Check the component integrity.