23 params.
addClassDescription(
"Calculates the inertial torques and inertia proportional damping " 24 "corresponding to the nodal rotational inertia.");
25 params.
addCoupledVar(
"rotations",
"rotational displacement variables");
26 params.
addCoupledVar(
"rotational_velocities",
"rotational velocity variables");
27 params.
addCoupledVar(
"rotational_accelerations",
"rotational acceleration variables");
29 "beta",
"beta>0.0",
"beta parameter for Newmark Time integration");
31 "gamma",
"gamma>0.0",
"gamma parameter for Newmark Time integration");
35 "Constant real number defining the eta parameter for" 39 "alpha >= -0.3333 & alpha <= 0.0",
40 "Alpha parameter for mass dependent numerical damping induced " 41 "by HHT time integration scheme");
43 "Ixx",
"Ixx>0.0",
"Moment of inertia in the x direction.");
45 "Iyy",
"Iyy>0.0",
"Moment of inertia in the y direction.");
47 "Izz",
"Izz>0.0",
"Moment of inertia in the z direction.");
48 params.
addParam<
Real>(
"Ixy", 0.0,
"Moment of inertia in the xy direction.");
49 params.
addParam<
Real>(
"Ixz", 0.0,
"Moment of inertia in the xz direction.");
50 params.
addParam<
Real>(
"Iyz", 0.0,
"Moment of inertia in the yz direction.");
52 "x_orientation",
"Unit vector along the x direction if different from global x direction.");
54 "y_orientation",
"Unit vector along the y direction if different from global y direction.");
58 "An integer corresponding to the direction " 59 "the variable this nodalkernel acts in. (0 for rot_x, " 60 "1 for rot_y, and 2 for rot_z).");
66 _has_beta(isParamValid(
"beta")),
67 _has_gamma(isParamValid(
"gamma")),
68 _has_rot_velocities(isParamValid(
"rotational_velocities")),
69 _has_rot_accelerations(isParamValid(
"rotational_accelerations")),
70 _has_x_orientation(isParamValid(
"x_orientation")),
71 _has_y_orientation(isParamValid(
"y_orientation")),
72 _nrot(coupledComponents(
"rotations")),
76 _rot_accel_num(_nrot),
77 _rot_variables(_nrot),
81 _beta(_has_beta ? getParam<
Real>(
"beta") : 0.1),
82 _gamma(_has_gamma ? getParam<
Real>(
"gamma") : 0.1),
83 _eta(getParam<
Real>(
"eta")),
84 _alpha(getParam<
Real>(
"alpha")),
85 _component(getParam<unsigned
int>(
"component")),
86 _rot_dot_residual(_nrot),
87 _rot_vel_old_value(_nrot),
88 _rot_dotdot_residual(_nrot),
89 _time_integrator(_sys.getTimeIntegrator(_var.number()))
97 "NodalRotationalInertia: rotational_velocities and rotational_accelerations should " 101 for (
unsigned int i = 0; i <
_nrot; ++i)
118 for (
unsigned int i = 0; i <
_nrot; ++i)
135 mooseError(
"NodalRotationalInertia: Either all or none of `beta`, `gamma`, " 136 "`rotational_velocities` and `rotational_accelerations` should be provided as " 141 _inertia(0, 0) = getParam<Real>(
"Ixx");
142 _inertia(0, 1) = getParam<Real>(
"Ixy");
143 _inertia(0, 2) = getParam<Real>(
"Ixz");
145 _inertia(1, 1) = getParam<Real>(
"Iyy");
146 _inertia(1, 2) = getParam<Real>(
"Iyz");
149 _inertia(2, 2) = getParam<Real>(
"Izz");
156 if (det1 < 1e-6 || det2 < 1e-6 || det3 < 1e-6)
157 mooseError(
"NodalRotationalInertia: The moment of inertia tensor should be positive definite.");
160 const RealGradient x_orientation = getParam<RealGradient>(
"x_orientation");
161 const RealGradient y_orientation = getParam<RealGradient>(
"y_orientation");
163 if (std::abs(x_orientation.
norm() - 1.0) > 1e-6 || std::abs(y_orientation.norm() - 1.0) > 1e-6)
164 mooseError(
"NodalRotationalInertia: x_orientation and y_orientation must be unit vectors.");
166 Real sum = x_orientation(0) * y_orientation(0) + x_orientation(1) * y_orientation(1) +
167 x_orientation(2) * y_orientation(2);
169 if (std::abs(sum) > 1e-4)
170 mooseError(
"NodalRotationalInertia: x_orientation and y_orientation should be perpendicular " 175 z_orientation(0) = (x_orientation(1) * y_orientation(2) - x_orientation(2) * y_orientation(1));
176 z_orientation(1) = (x_orientation(2) * y_orientation(0) - x_orientation(0) * y_orientation(2));
177 z_orientation(2) = (x_orientation(0) * y_orientation(1) - x_orientation(1) * y_orientation(0));
181 orientation(0, 0) = x_orientation(0);
182 orientation(0, 1) = x_orientation(1);
183 orientation(0, 2) = x_orientation(2);
184 orientation(1, 0) = y_orientation(0);
185 orientation(1, 1) = y_orientation(1);
186 orientation(1, 2) = y_orientation(2);
187 orientation(2, 0) = z_orientation(0);
188 orientation(2, 1) = z_orientation(1);
189 orientation(2, 2) = z_orientation(2);
196 mooseError(
"NodalRotationalInertia: Both x_orientation and y_orientation should be provided if " 198 "y_orientation is different from global x or y direction, respectively.");
202 mooseError(
"NodalRotationalInertia: HHT time integration parameter can only be used with " 203 "Newmark-Beta time integration.");
207 mooseError(
"NodalRotationalInertia: beta time integration parameter can only be used with " 208 "Newmark-Beta time integrator.");
222 for (
unsigned int i = 0; i <
_nrot; ++i)
226 const Real rot_accel_old =
237 for (
unsigned int i = 0; i <
_nrot; ++i)
248 for (
unsigned int i = 0; i <
_nrot; ++i)
281 unsigned int coupled_component = 0;
282 bool rot_coupled =
false;
284 for (
unsigned int i = 0; i <
_nrot; ++i)
288 coupled_component = i;
296 else if (rot_coupled)
virtual Real computeQpResidual() override
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
const bool _has_rot_accelerations
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const DoFValue & dofValuesDotOld() const override
auto norm() const -> decltype(std::norm(Real()))
std::vector< const VariableValue * > _rot_vel_old_value
Old velocity value.
const unsigned int _component
Component along which torque is applied.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
AuxiliarySystem * _aux_sys
Auxiliary system object.
unsigned int number() const
std::vector< unsigned int > _rot_variables
Variable numbers for rotational variables.
std::vector< Real > _rot_vel_old
Old velocity of the node.
const VariableValue * _du_dot_du
du_dot_du value
virtual const VariableValue & coupledVectorTagDofValue(const std::string &var_name, TagID tag, unsigned int index=0) const
Calculates the inertial torque and inertia proportional damping for nodal rotational inertia...
const TimeIntegrator & _time_integrator
The TimeIntegrator.
static InputParameters validParams()
std::vector< const VariableValue * > _rot_dot_residual
Rotational udot residual.
virtual Real computeQpJacobian() override
std::vector< unsigned int > _rot_vel_num
Variable numbers for rotational velocity aux variables.
NodalRotationalInertia(const InputParameters ¶meters)
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
std::vector< Real > _rot_accel
Current acceleration of the node.
std::vector< Real > _rot_vel
Current velocity of the node.
const bool _has_x_orientation
virtual bool isExplicit() const
const VariableValue * _du_dotdot_du
du_dotdot_du value
std::vector< const VariableValue * > _rot_dotdot_residual
Rotational udotdot residual.
unsigned int _nrot
Number of coupled rotational variables.
const bool _has_rot_velocities
const DoFValue & dofValuesOld() const override
FEProblemBase & _fe_problem
RankTwoTensor _inertia
Moment of inertia tensor in global coordinate system.
TagID uDotDotFactorTag() const
const bool _has_beta
Booleans for validity of params.
std::vector< const VariableValue * > _rot
Value of rotational displacements.
unsigned int number() const
AuxiliarySystem & getAuxiliarySystem()
std::vector< unsigned int > _rot_accel_num
Variable numbers for rotational acceleration aux variables.
const Real _gamma
Newmark time integration parameter.
const Real _beta
Newmark time integration parameter.
unsigned int coupledComponents(const std::string &var_name) const
RankTwoTensorTempl< Real > transpose() const
std::vector< const VariableValue * > _rot_old
Old value of rotational displacements.
TagID uDotFactorTag() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("SolidMechanicsApp", NodalRotationalInertia)
const DoFValue & dofValues() const override
void mooseError(Args &&... args) const
const Real & _eta
Mass proportional Rayliegh damping.
const Real & _alpha
HHT time integration parameter.
const bool _has_y_orientation
const Node *const & _current_node
NumericVector< Number > & solutionOld()
void ErrorVector unsigned int
static InputParameters validParams()