https://mooseframework.inl.gov
ShaftConnectedMotorUserObject.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "Function.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", ShaftConnectedMotorUserObject);
14 
17 {
20  params.addRequiredParam<FunctionName>("torque", "Torque as a function of shaft speed");
21  params.addRequiredParam<FunctionName>("inertia",
22  "Moment of inertia as a function of shaft speed");
23  params.addRequiredCoupledVar("shaft_speed", "Shaft speed");
24  params.addClassDescription(
25  "Computes the torque and moment of inertia of a shaft connected motor");
26  return params;
27 }
28 
30  : GeneralUserObject(params),
32  _torque_fn(getFunction("torque")),
33  _inertia_fn(getFunction("inertia")),
34  _shaft_speed(coupledScalarValue("shaft_speed"))
35 {
36 }
37 
38 Real
40 {
41  return _torque_fn.value(_shaft_speed[0], Point());
42 }
43 
44 void
46  std::vector<dof_id_type> & /*dofs_j*/) const
47 {
48 }
49 
50 Real
52 {
53  return _inertia_fn.value(_shaft_speed[0], Point());
54 }
55 
56 void
58  DenseMatrix<Real> & /*jacobian_block*/, std::vector<dof_id_type> & /*dofs_j*/) const
59 {
60 }
61 
62 void
64 {
65 }
66 
67 void
69 {
70 }
71 
72 void
74 {
75 }
ShaftConnectedMotorUserObject(const InputParameters &params)
static InputParameters validParams()
virtual Real getTorque() const override
const VariableValue & _shaft_speed
Shaft speed.
registerMooseObject("ThermalHydraulicsApp", ShaftConnectedMotorUserObject)
virtual Real getMomentOfInertia() const override
void addRequiredParam(const std::string &name, const std::string &doc_string)
const Function & _torque_fn
Torque as a function of shaft speed.
Interface class for user objects that are connected to a shaft.
User object to provide data for a shaft-connected motor.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual void getTorqueJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const override
virtual Real value(Real t, const Point &p) const
virtual void getMomentOfInertiaJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const override
const Function & _inertia_fn
Moment of inertia as a function of shaft speed.