www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NodalRotationalInertia Class Reference

Calculates the inertial torque and inertia proportional damping for nodal rotational inertia. More...

#include <NodalRotationalInertia.h>

Inheritance diagram for NodalRotationalInertia:
[legend]

Public Member Functions

 NodalRotationalInertia (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

AuxiliarySystem * _aux_sys
 Auxiliary system object. More...
 
unsigned int _nrot
 Number of coupled rotational variables. More...
 
std::vector< const VariableValue * > _rot
 Value of rotational displacements. More...
 
std::vector< const VariableValue * > _rot_old
 Old value of rotational displacements. More...
 
std::vector< unsigned int > _rot_vel_num
 Variable numbers for rotational velocity aux variables. More...
 
std::vector< unsigned int > _rot_accel_num
 Variable numbers for rotational acceleration aux variables. More...
 
std::vector< unsigned int > _rot_variables
 Variable numbers for rotational variables. More...
 
std::vector< Real > _rot_accel
 Current acceleration of the node. More...
 
std::vector< Real > _rot_vel
 Current velocity of the node. More...
 
std::vector< Real > _rot_vel_old
 Old velocity of the node. More...
 
const Real _beta
 Newmark time integration parameter. More...
 
const Real _gamma
 Newmark time integration parameter. More...
 
const Real & _eta
 Mass proportional Rayliegh damping. More...
 
const Real & _alpha
 HHT time integration parameter. More...
 
const unsigned int _component
 Component along which torque is applied. More...
 
RankTwoTensor _inertia
 Moment of inertia tensor in global coordinate system. More...
 
std::vector< const VariableValue * > _rot_vel_value
 Velocity value. More...
 
std::vector< const VariableValue * > _rot_vel_old_value
 Old velocity value. More...
 
std::vector< const VariableValue * > _rot_accel_value
 Acceleration value. More...
 
const VariableValue * _du_dot_du
 du_dot_du value More...
 
const VariableValue * _du_dotdot_du
 du_dotdot_du value More...
 

Detailed Description

Calculates the inertial torque and inertia proportional damping for nodal rotational inertia.

Definition at line 31 of file NodalRotationalInertia.h.

Constructor & Destructor Documentation

◆ NodalRotationalInertia()

NodalRotationalInertia::NodalRotationalInertia ( const InputParameters &  parameters)

Definition at line 68 of file NodalRotationalInertia.C.

69  : TimeNodalKernel(parameters),
70  _nrot(coupledComponents("rotations")),
71  _rot(_nrot),
72  _rot_old(_nrot),
77  _rot_vel(_nrot),
79  _beta(isParamValid("beta") ? getParam<Real>("beta") : 0.1),
80  _gamma(isParamValid("gamma") ? getParam<Real>("gamma") : 0.1),
81  _eta(getParam<Real>("eta")),
82  _alpha(getParam<Real>("alpha")),
83  _component(getParam<unsigned int>("component")),
87 {
88  if (isParamValid("beta") && isParamValid("gamma") && isParamValid("rotational_velocities") &&
89  isParamValid("rotational_accelerations"))
90  {
91  _aux_sys = &(_fe_problem.getAuxiliarySystem());
92  if (coupledComponents("rotational_velocities") != _nrot ||
93  coupledComponents("rotational_accelerations") != _nrot)
94  mooseError(
95  "NodalRotationalInertia: rotational_velocities and rotational_accelerations should "
96  "be same size "
97  "as rotations.");
98 
99  for (unsigned int i = 0; i < _nrot; ++i)
100  {
101  MooseVariable * rot_var = getVar("rotations", i);
102  MooseVariable * rot_vel_var = getVar("rotational_velocities", i);
103  MooseVariable * rot_accel_var = getVar("rotational_accelerations", i);
104 
105  _rot[i] = &rot_var->dofValues();
106  _rot_old[i] = &rot_var->dofValuesOld();
107 
108  _rot_vel_num[i] = rot_vel_var->number();
109  _rot_accel_num[i] = rot_accel_var->number();
110 
111  _rot_variables[i] = coupled("rotations", i);
112  }
113  }
114  else if (!isParamValid("beta") && !isParamValid("gamma") &&
115  !isParamValid("rotational_velocities") && !isParamValid("rotational_accelerations"))
116  {
117  for (unsigned int i = 0; i < _nrot; ++i)
118  {
119  MooseVariable * rot_var = getVar("rotations", i);
120  _rot_vel_value[i] = &rot_var->dofValuesDot();
121  _rot_vel_old_value[i] = &rot_var->dofValuesDotOld();
122  _rot_accel_value[i] = &rot_var->dofValuesDotDot();
123 
124  if (i == 0)
125  {
126  _du_dot_du = &rot_var->dofValuesDuDotDu();
127  _du_dotdot_du = &rot_var->dofValuesDuDotDotDu();
128  }
129  }
130  }
131  else
132  mooseError("NodalRotationalInertia: Either all or none of `beta`, `gamma`, "
133  "`rotational_velocities` and `rotational_accelerations` should be provided as "
134  "input.");
135 
136  // Store inertia values in inertia tensor
137  _inertia.zero();
138  _inertia(0, 0) = getParam<Real>("Ixx");
139  _inertia(0, 1) = getParam<Real>("Ixy");
140  _inertia(0, 2) = getParam<Real>("Ixz");
141  _inertia(1, 0) = _inertia(0, 1);
142  _inertia(1, 1) = getParam<Real>("Iyy");
143  _inertia(1, 2) = getParam<Real>("Iyz");
144  _inertia(2, 0) = _inertia(0, 2);
145  _inertia(2, 1) = _inertia(1, 2);
146  _inertia(2, 2) = getParam<Real>("Izz");
147 
148  // Check for positive definiteness of matrix using Sylvester's criterion.
149  const Real det1 = _inertia(0, 0);
150  const Real det2 = _inertia(0, 0) * _inertia(1, 1) - _inertia(0, 1) * _inertia(1, 0);
151  const Real det3 = _inertia.det();
152 
153  if (det1 < 1e-6 || det2 < 1e-6 || det3 < 1e-6)
154  mooseError("NodalRotationalInertia: The moment of inertia tensor should be positive definite.");
155  if (isParamValid("x_orientation") && isParamValid("y_orientation"))
156  {
157  const RealGradient x_orientation = getParam<RealGradient>("x_orientation");
158  const RealGradient y_orientation = getParam<RealGradient>("y_orientation");
159 
160  if (std::abs(x_orientation.norm() - 1.0) > 1e-6 || std::abs(y_orientation.norm() - 1.0) > 1e-6)
161  mooseError("NodalRotationalInertia: x_orientation and y_orientation must be unit vectors.");
162 
163  Real sum = x_orientation(0) * y_orientation(0) + x_orientation(1) * y_orientation(1) +
164  x_orientation(2) * y_orientation(2);
165 
166  if (std::abs(sum) > 1e-4)
167  mooseError("NodalRotationalInertia: x_orientation and y_orientation should be perpendicular "
168  "to each other.");
169 
170  // Calculate z orientation as a cross product of the x and y orientations
171  RealGradient z_orientation;
172  z_orientation(0) = (x_orientation(1) * y_orientation(2) - x_orientation(2) * y_orientation(1));
173  z_orientation(1) = (x_orientation(2) * y_orientation(0) - x_orientation(0) * y_orientation(2));
174  z_orientation(2) = (x_orientation(0) * y_orientation(1) - x_orientation(1) * y_orientation(0));
175 
176  // Rotation matrix from global to original beam local configuration
177  RankTwoTensor orientation;
178  orientation(0, 0) = x_orientation(0);
179  orientation(0, 1) = x_orientation(1);
180  orientation(0, 2) = x_orientation(2);
181  orientation(1, 0) = y_orientation(0);
182  orientation(1, 1) = y_orientation(1);
183  orientation(1, 2) = y_orientation(2);
184  orientation(2, 0) = z_orientation(0);
185  orientation(2, 1) = z_orientation(1);
186  orientation(2, 2) = z_orientation(2);
187 
188  RankTwoTensor global_inertia = orientation.transpose() * _inertia * orientation;
189  _inertia = global_inertia;
190  }
191  else if ((isParamValid("x_orientation") && !isParamValid("y_orientation")) ||
192  (!isParamValid("x_orientation") && isParamValid("y_orientation")))
193  mooseError("NodalRotationalInertia: Both x_orientation and y_orientation should be provided if "
194  "x_orientation or "
195  "y_orientation is different from global x or y direction, respectively.");
196 }
std::vector< const VariableValue * > _rot_vel_old_value
Old velocity value.
const unsigned int _component
Component along which torque is applied.
AuxiliarySystem * _aux_sys
Auxiliary system object.
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
std::vector< unsigned int > _rot_vel_num
Variable numbers for rotational velocity aux variables.
std::vector< Real > _rot_accel
Current acceleration of the node.
std::vector< Real > _rot_vel
Current velocity of the node.
const VariableValue * _du_dotdot_du
du_dotdot_du value
unsigned int _nrot
Number of coupled rotational variables.
RankTwoTensor _inertia
Moment of inertia tensor in global coordinate system.
std::vector< const VariableValue * > _rot
Value of rotational displacements.
std::vector< unsigned int > _rot_accel_num
Variable numbers for rotational acceleration aux variables.
const Real _gamma
Newmark time integration parameter.
std::vector< const VariableValue * > _rot_vel_value
Velocity value.
const Real _beta
Newmark time integration parameter.
std::vector< const VariableValue * > _rot_old
Old value of rotational displacements.
std::vector< const VariableValue * > _rot_accel_value
Acceleration value.
const Real & _eta
Mass proportional Rayliegh damping.
const Real & _alpha
HHT time integration parameter.

Member Function Documentation

◆ computeQpJacobian()

Real NodalRotationalInertia::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 246 of file NodalRotationalInertia.C.

247 {
248  mooseAssert(_beta > 0.0, "NodalRotationalInertia: Beta parameter should be positive.");
249 
250  if (_dt == 0)
251  return 0.0;
252  else
253  {
254  if (isParamValid("beta"))
255  return _inertia(_component, _component) / (_beta * _dt * _dt) +
256  _eta * (1.0 + _alpha) * _inertia(_component, _component) * _gamma / _beta / _dt;
257  else
258  return _inertia(_component, _component) * (*_du_dotdot_du)[_qp] +
259  _eta * (1.0 + _alpha) * _inertia(_component, _component) * (*_du_dot_du)[_qp];
260  }
261 }
const unsigned int _component
Component along which torque is applied.
RankTwoTensor _inertia
Moment of inertia tensor in global coordinate system.
const Real _gamma
Newmark time integration parameter.
const Real _beta
Newmark time integration parameter.
const Real & _eta
Mass proportional Rayliegh damping.
const Real & _alpha
HHT time integration parameter.

◆ computeQpOffDiagJacobian()

Real NodalRotationalInertia::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 264 of file NodalRotationalInertia.C.

265 {
266  unsigned int coupled_component = 0;
267  bool rot_coupled = false;
268 
269  mooseAssert(_beta > 0.0, "NodalRotationalInertia: Beta parameter should be positive.");
270 
271  for (unsigned int i = 0; i < _nrot; ++i)
272  {
273  if (jvar == _rot_variables[i])
274  {
275  coupled_component = i;
276  rot_coupled = true;
277  break;
278  }
279  }
280 
281  if (_dt == 0)
282  return 0.0;
283  else if (rot_coupled)
284  {
285  if (isParamValid("beta"))
286  return _inertia(_component, coupled_component) / (_beta * _dt * _dt) +
287  _eta * (1.0 + _alpha) * _inertia(_component, coupled_component) * _gamma / _beta / _dt;
288  else
289  return _inertia(_component, coupled_component) * (*_du_dotdot_du)[_qp] +
290  _eta * (1.0 + _alpha) * _inertia(_component, coupled_component) * (*_du_dot_du)[_qp];
291  }
292  else
293  return 0.0;
294 }
const unsigned int _component
Component along which torque is applied.
std::vector< unsigned int > _rot_variables
Variable numbers for rotational variables.
unsigned int _nrot
Number of coupled rotational variables.
RankTwoTensor _inertia
Moment of inertia tensor in global coordinate system.
const Real _gamma
Newmark time integration parameter.
const Real _beta
Newmark time integration parameter.
const Real & _eta
Mass proportional Rayliegh damping.
const Real & _alpha
HHT time integration parameter.

◆ computeQpResidual()

Real NodalRotationalInertia::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 199 of file NodalRotationalInertia.C.

200 {
201  if (_dt == 0)
202  return 0;
203  else
204  {
205  if (isParamValid("beta"))
206  {
207  mooseAssert(_beta > 0.0, "NodalRotationalInertia: Beta parameter should be positive.");
208 
209  const NumericVector<Number> & aux_sol_old = _aux_sys->solutionOld();
210 
211  for (unsigned int i = 0; i < _nrot; ++i)
212  {
213  _rot_vel_old[i] =
214  aux_sol_old(_current_node->dof_number(_aux_sys->number(), _rot_vel_num[i], 0));
215  const Real rot_accel_old =
216  aux_sol_old(_current_node->dof_number(_aux_sys->number(), _rot_accel_num[i], 0));
217 
218  _rot_accel[i] = 1.0 / _beta *
219  ((((*_rot[i])[_qp] - (*_rot_old[i])[_qp]) / (_dt * _dt)) -
220  _rot_vel_old[i] / _dt - rot_accel_old * (0.5 - _beta));
221  _rot_vel[i] =
222  _rot_vel_old[i] + (_dt * (1.0 - _gamma)) * rot_accel_old + _gamma * _dt * _rot_accel[i];
223  }
224 
225  Real res = 0.0;
226  for (unsigned int i = 0; i < _nrot; ++i)
227  res += _inertia(_component, i) * (_rot_accel[i] + _rot_vel[i] * _eta * (1.0 + _alpha) -
228  _alpha * _eta * _rot_vel_old[i]);
229 
230  return res;
231  }
232  else
233  {
234  Real res = 0.0;
235  for (unsigned int i = 0; i < _nrot; ++i)
236  res += _inertia(_component, i) *
237  ((*_rot_accel_value[i])[_qp] + (*_rot_vel_value[i])[_qp] * _eta * (1.0 + _alpha) -
238  _alpha * _eta * (*_rot_vel_old_value[i])[_qp]);
239 
240  return res;
241  }
242  }
243 }
std::vector< const VariableValue * > _rot_vel_old_value
Old velocity value.
const unsigned int _component
Component along which torque is applied.
AuxiliarySystem * _aux_sys
Auxiliary system object.
std::vector< Real > _rot_vel_old
Old velocity of the node.
std::vector< unsigned int > _rot_vel_num
Variable numbers for rotational velocity aux variables.
std::vector< Real > _rot_accel
Current acceleration of the node.
std::vector< Real > _rot_vel
Current velocity of the node.
unsigned int _nrot
Number of coupled rotational variables.
RankTwoTensor _inertia
Moment of inertia tensor in global coordinate system.
std::vector< const VariableValue * > _rot
Value of rotational displacements.
std::vector< unsigned int > _rot_accel_num
Variable numbers for rotational acceleration aux variables.
const Real _gamma
Newmark time integration parameter.
std::vector< const VariableValue * > _rot_vel_value
Velocity value.
const Real _beta
Newmark time integration parameter.
std::vector< const VariableValue * > _rot_old
Old value of rotational displacements.
std::vector< const VariableValue * > _rot_accel_value
Acceleration value.
const Real & _eta
Mass proportional Rayliegh damping.
const Real & _alpha
HHT time integration parameter.

Member Data Documentation

◆ _alpha

const Real& NodalRotationalInertia::_alpha
protected

HHT time integration parameter.

Definition at line 83 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _aux_sys

AuxiliarySystem* NodalRotationalInertia::_aux_sys
protected

Auxiliary system object.

Definition at line 44 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _beta

const Real NodalRotationalInertia::_beta
protected

Newmark time integration parameter.

Definition at line 74 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _component

const unsigned int NodalRotationalInertia::_component
protected

Component along which torque is applied.

Definition at line 86 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _du_dot_du

const VariableValue* NodalRotationalInertia::_du_dot_du
protected

du_dot_du value

Definition at line 101 of file NodalRotationalInertia.h.

Referenced by NodalRotationalInertia().

◆ _du_dotdot_du

const VariableValue* NodalRotationalInertia::_du_dotdot_du
protected

du_dotdot_du value

Definition at line 104 of file NodalRotationalInertia.h.

Referenced by NodalRotationalInertia().

◆ _eta

const Real& NodalRotationalInertia::_eta
protected

Mass proportional Rayliegh damping.

Definition at line 80 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _gamma

const Real NodalRotationalInertia::_gamma
protected

Newmark time integration parameter.

Definition at line 77 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _inertia

RankTwoTensor NodalRotationalInertia::_inertia
protected

Moment of inertia tensor in global coordinate system.

Definition at line 89 of file NodalRotationalInertia.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), computeQpResidual(), and NodalRotationalInertia().

◆ _nrot

unsigned int NodalRotationalInertia::_nrot
protected

Number of coupled rotational variables.

Definition at line 47 of file NodalRotationalInertia.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and NodalRotationalInertia().

◆ _rot

std::vector<const VariableValue *> NodalRotationalInertia::_rot
protected

Value of rotational displacements.

Definition at line 50 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_accel

std::vector<Real> NodalRotationalInertia::_rot_accel
protected

Current acceleration of the node.

Definition at line 65 of file NodalRotationalInertia.h.

Referenced by computeQpResidual().

◆ _rot_accel_num

std::vector<unsigned int> NodalRotationalInertia::_rot_accel_num
protected

Variable numbers for rotational acceleration aux variables.

Definition at line 59 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_accel_value

std::vector<const VariableValue *> NodalRotationalInertia::_rot_accel_value
protected

Acceleration value.

Definition at line 98 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_old

std::vector<const VariableValue *> NodalRotationalInertia::_rot_old
protected

Old value of rotational displacements.

Definition at line 53 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_variables

std::vector<unsigned int> NodalRotationalInertia::_rot_variables
protected

Variable numbers for rotational variables.

Definition at line 62 of file NodalRotationalInertia.h.

Referenced by computeQpOffDiagJacobian(), and NodalRotationalInertia().

◆ _rot_vel

std::vector<Real> NodalRotationalInertia::_rot_vel
protected

Current velocity of the node.

Definition at line 68 of file NodalRotationalInertia.h.

Referenced by computeQpResidual().

◆ _rot_vel_num

std::vector<unsigned int> NodalRotationalInertia::_rot_vel_num
protected

Variable numbers for rotational velocity aux variables.

Definition at line 56 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_vel_old

std::vector<Real> NodalRotationalInertia::_rot_vel_old
protected

Old velocity of the node.

Definition at line 71 of file NodalRotationalInertia.h.

Referenced by computeQpResidual().

◆ _rot_vel_old_value

std::vector<const VariableValue *> NodalRotationalInertia::_rot_vel_old_value
protected

Old velocity value.

Definition at line 95 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().

◆ _rot_vel_value

std::vector<const VariableValue *> NodalRotationalInertia::_rot_vel_value
protected

Velocity value.

Definition at line 92 of file NodalRotationalInertia.h.

Referenced by computeQpResidual(), and NodalRotationalInertia().


The documentation for this class was generated from the following files: