www.mooseframework.org
InertialForceBeam.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "InertialForceBeam.h"
11 #include "SubProblem.h"
12 #include "libmesh/utility.h"
13 #include "MooseVariable.h"
14 #include "Assembly.h"
15 #include "NonlinearSystem.h"
16 #include "AuxiliarySystem.h"
17 #include "MooseMesh.h"
18 
19 registerMooseObject("TensorMechanicsApp", InertialForceBeam);
20 
22 
23 InputParameters
25 {
26  InputParameters params = TimeKernel::validParams();
27  params.addClassDescription("Calculates the residual for the inertial force/moment and the "
28  "contribution of mass dependent Rayleigh damping and HHT time "
29  "integration scheme.");
30  params.set<bool>("use_displaced_mesh") = true;
31  params.addRequiredCoupledVar(
32  "rotations",
33  "The rotational variables appropriate for the simulation geometry and coordinate system");
34  params.addRequiredCoupledVar(
35  "displacements",
36  "The displacement variables appropriate for the simulation geometry and coordinate system");
37  params.addCoupledVar("velocities", "Translational velocity variables");
38  params.addCoupledVar("accelerations", "Translational acceleration variables");
39  params.addCoupledVar("rotational_velocities", "Rotational velocity variables");
40  params.addCoupledVar("rotational_accelerations", "Rotational acceleration variables");
41  params.addRangeCheckedParam<Real>(
42  "beta", "beta>0.0", "beta parameter for Newmark Time integration");
43  params.addRangeCheckedParam<Real>(
44  "gamma", "gamma>0.0", "gamma parameter for Newmark Time integration");
45  params.addParam<MaterialPropertyName>("eta",
46  0.0,
47  "Name of material property or a constant real "
48  "number defining the eta parameter for the "
49  "Rayleigh damping.");
50  params.addRangeCheckedParam<Real>("alpha",
51  0.0,
52  "alpha >= -0.3333 & alpha <= 0.0",
53  "Alpha parameter for mass dependent numerical damping induced "
54  "by HHT time integration scheme");
55  params.addParam<MaterialPropertyName>(
56  "density",
57  "density",
58  "Name of Material Property or a constant real number defining the density of the beam.");
59  params.addRequiredCoupledVar("area", "Variable containing cross-section area");
60  params.addCoupledVar("Ay", 0.0, "Variable containing first moment of area about y axis");
61  params.addCoupledVar("Az", 0.0, "Variable containing first moment of area about z axis");
62  params.addCoupledVar("Ix",
63  "Variable containing second moment of area about x axis. Defaults to Iy+Iz");
64  params.addRequiredCoupledVar("Iy", "Variable containing second moment of area about y axis");
65  params.addRequiredCoupledVar("Iz", "Variable containing second moment of area about z axis");
66  params.addRequiredRangeCheckedParam<unsigned int>(
67  "component",
68  "component<6",
69  "An integer corresponding to the direction "
70  "the variable this kernel acts in. (0 for disp_x, "
71  "1 for disp_y, 2 for disp_z, 3 for rot_x, 4 for rot_y and 5 for rot_z)");
72  return params;
73 }
74 
75 InertialForceBeam::InertialForceBeam(const InputParameters & parameters)
76  : TimeKernel(parameters),
77  _has_beta(isParamValid("beta")),
78  _has_gamma(isParamValid("gamma")),
79  _has_velocities(isParamValid("velocities")),
80  _has_rot_velocities(isParamValid("rotational_velocities")),
81  _has_accelerations(isParamValid("accelerations")),
82  _has_rot_accelerations(isParamValid("rotational_accelerations")),
83  _has_Ix(isParamValid("Ix")),
84  _density(getMaterialProperty<Real>("density")),
85  _nrot(coupledComponents("rotations")),
86  _ndisp(coupledComponents("displacements")),
87  _rot_num(_nrot),
88  _disp_num(_ndisp),
89  _vel_num(_ndisp),
90  _accel_num(_ndisp),
91  _rot_vel_num(_nrot),
92  _rot_accel_num(_nrot),
93  _area(coupledValue("area")),
94  _Ay(coupledValue("Ay")),
95  _Az(coupledValue("Az")),
96  _Ix(_has_Ix ? coupledValue("Ix") : _zero),
97  _Iy(coupledValue("Iy")),
98  _Iz(coupledValue("Iz")),
99  _beta(_has_beta ? getParam<Real>("beta") : 0.1),
100  _gamma(_has_gamma ? getParam<Real>("gamma") : 0.1),
101  _eta(getMaterialProperty<Real>("eta")),
102  _alpha(getParam<Real>("alpha")),
103  _original_local_config(getMaterialPropertyByName<RankTwoTensor>("initial_rotation")),
104  _original_length(getMaterialPropertyByName<Real>("original_length")),
105  _component(getParam<unsigned int>("component")),
106  _local_force(2),
107  _local_moment(2)
108 {
109  // Checking for consistency between the length of the provided rotations and displacements vector
110  if (_ndisp != _nrot)
111  mooseError("InertialForceBeam: The number of variables supplied in 'displacements' and "
112  "'rotations' must match.");
113 
116  {
117  if ((coupledComponents("velocities") != _ndisp) ||
118  (coupledComponents("accelerations") != _ndisp) ||
119  (coupledComponents("rotational_velocities") != _ndisp) ||
120  (coupledComponents("rotational_accelerations") != _ndisp))
121  mooseError(
122  "InertialForceBeam: The number of variables supplied in 'velocities', "
123  "'accelerations', 'rotational_velocities' and 'rotational_accelerations' must match "
124  "the number of displacement variables.");
125 
126  // fetch coupled velocities and accelerations
127  for (unsigned int i = 0; i < _ndisp; ++i)
128  {
129  MooseVariable * vel_variable = getVar("velocities", i);
130  _vel_num[i] = vel_variable->number();
131 
132  MooseVariable * accel_variable = getVar("accelerations", i);
133  _accel_num[i] = accel_variable->number();
134 
135  MooseVariable * rot_vel_variable = getVar("rotational_velocities", i);
136  _rot_vel_num[i] = rot_vel_variable->number();
137 
138  MooseVariable * rot_accel_variable = getVar("rotational_accelerations", i);
139  _rot_accel_num[i] = rot_accel_variable->number();
140  }
141  }
142  else if (!_has_beta && !_has_gamma && !_has_velocities && !_has_accelerations &&
144  {
145  _du_dot_du = &coupledDotDu("displacements", 0);
146  _du_dotdot_du = &coupledDotDotDu("displacements", 0);
147  }
148  else
149  mooseError("InertialForceBeam: Either all or none of `beta`, `gamma`, `velocities`, "
150  "`accelerations`, `rotational_velocities` and `rotational_accelerations` should be "
151  "provided as input.");
152 
153  // fetch coupled displacements and rotations
154  for (unsigned int i = 0; i < _ndisp; ++i)
155  {
156  MooseVariable * disp_variable = getVar("displacements", i);
157  _disp_num[i] = disp_variable->number();
158 
159  MooseVariable * rot_variable = getVar("rotations", i);
160  _rot_num[i] = rot_variable->number();
161  }
162 }
163 
164 void
166 {
167  prepareVectorTag(_assembly, _var.number());
168 
169  if (_dt != 0.0)
170  {
171  // fetch the two end nodes for _current_elem
172  std::vector<const Node *> node;
173  for (unsigned int i = 0; i < 2; ++i)
174  node.push_back(_current_elem->node_ptr(i));
175 
176  // Fetch the solution for the two end nodes at time t
177  NonlinearSystemBase & nonlinear_sys = _fe_problem.getNonlinearSystemBase();
178 
179  if (_has_beta)
180  {
181  const NumericVector<Number> & sol = *nonlinear_sys.currentSolution();
182  const NumericVector<Number> & sol_old = nonlinear_sys.solutionOld();
183 
184  AuxiliarySystem & aux = _fe_problem.getAuxiliarySystem();
185  const NumericVector<Number> & aux_sol_old = aux.solutionOld();
186 
187  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
188  mooseAssert(_eta[0] >= 0.0, "InertialForceBeam: Eta parameter should be non-negative.");
189 
190  for (unsigned int i = 0; i < _ndisp; ++i)
191  {
192  // obtain delta displacement
193  unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
194  unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
195  const Real disp_0 = sol(dof_index_0) - sol_old(dof_index_0);
196  const Real disp_1 = sol(dof_index_1) - sol_old(dof_index_1);
197 
198  dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
199  dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
200  const Real rot_0 = sol(dof_index_0) - sol_old(dof_index_0);
201  const Real rot_1 = sol(dof_index_1) - sol_old(dof_index_1);
202 
203  // obtain new translational and rotational velocities and accelerations using newmark-beta
204  // time integration
205  _vel_old_0(i) = aux_sol_old(node[0]->dof_number(aux.number(), _vel_num[i], 0));
206  _vel_old_1(i) = aux_sol_old(node[1]->dof_number(aux.number(), _vel_num[i], 0));
207  const Real accel_old_0 = aux_sol_old(node[0]->dof_number(aux.number(), _accel_num[i], 0));
208  const Real accel_old_1 = aux_sol_old(node[1]->dof_number(aux.number(), _accel_num[i], 0));
209 
210  _rot_vel_old_0(i) = aux_sol_old(node[0]->dof_number(aux.number(), _rot_vel_num[i], 0));
211  _rot_vel_old_1(i) = aux_sol_old(node[1]->dof_number(aux.number(), _rot_vel_num[i], 0));
212  const Real rot_accel_old_0 =
213  aux_sol_old(node[0]->dof_number(aux.number(), _rot_accel_num[i], 0));
214  const Real rot_accel_old_1 =
215  aux_sol_old(node[1]->dof_number(aux.number(), _rot_accel_num[i], 0));
216 
217  _accel_0(i) =
218  1. / _beta * (disp_0 / (_dt * _dt) - _vel_old_0(i) / _dt - accel_old_0 * (0.5 - _beta));
219  _accel_1(i) =
220  1. / _beta * (disp_1 / (_dt * _dt) - _vel_old_1(i) / _dt - accel_old_1 * (0.5 - _beta));
221  _rot_accel_0(i) =
222  1. / _beta *
223  (rot_0 / (_dt * _dt) - _rot_vel_old_0(i) / _dt - rot_accel_old_0 * (0.5 - _beta));
224  _rot_accel_1(i) =
225  1. / _beta *
226  (rot_1 / (_dt * _dt) - _rot_vel_old_1(i) / _dt - rot_accel_old_1 * (0.5 - _beta));
227 
228  _vel_0(i) = _vel_old_0(i) + (_dt * (1 - _gamma)) * accel_old_0 + _gamma * _dt * _accel_0(i);
229  _vel_1(i) = _vel_old_1(i) + (_dt * (1 - _gamma)) * accel_old_1 + _gamma * _dt * _accel_1(i);
230  _rot_vel_0(i) = _rot_vel_old_0(i) + (_dt * (1 - _gamma)) * rot_accel_old_0 +
231  _gamma * _dt * _rot_accel_0(i);
232  _rot_vel_1(i) = _rot_vel_old_1(i) + (_dt * (1 - _gamma)) * rot_accel_old_1 +
233  _gamma * _dt * _rot_accel_1(i);
234  }
235  }
236  else
237  {
238  if (!nonlinear_sys.solutionUDot())
239  mooseError("InertialForceBeam: Time derivative of solution (`u_dot`) is not stored. Please "
240  "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
241 
242  if (!nonlinear_sys.solutionUDotOld())
243  mooseError("InertialForceBeam: Old time derivative of solution (`u_dot_old`) is not "
244  "stored. Please set uDotOldRequested() to true in FEProblemBase before "
245  "requesting `u_dot_old`.");
246 
247  if (!nonlinear_sys.solutionUDotDot())
248  mooseError("InertialForceBeam: Second time derivative of solution (`u_dotdot`) is not "
249  "stored. Please set uDotDotRequested() to true in FEProblemBase before "
250  "requesting `u_dotdot`.");
251 
252  const NumericVector<Number> & vel = *nonlinear_sys.solutionUDot();
253  const NumericVector<Number> & vel_old = *nonlinear_sys.solutionUDotOld();
254  const NumericVector<Number> & accel = *nonlinear_sys.solutionUDotDot();
255 
256  for (unsigned int i = 0; i < _ndisp; ++i)
257  {
258  // translational velocities and accelerations
259  unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
260  unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
261  _vel_0(i) = vel(dof_index_0);
262  _vel_1(i) = vel(dof_index_1);
263  _vel_old_0(i) = vel_old(dof_index_0);
264  _vel_old_1(i) = vel_old(dof_index_1);
265  _accel_0(i) = accel(dof_index_0);
266  _accel_1(i) = accel(dof_index_1);
267 
268  // rotational velocities and accelerations
269  dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
270  dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
271  _rot_vel_0(i) = vel(dof_index_0);
272  _rot_vel_1(i) = vel(dof_index_1);
273  _rot_vel_old_0(i) = vel_old(dof_index_0);
274  _rot_vel_old_1(i) = vel_old(dof_index_1);
275  _rot_accel_0(i) = accel(dof_index_0);
276  _rot_accel_1(i) = accel(dof_index_1);
277  }
278  }
279 
280  // transform translational and rotational velocities and accelerations to the initial local
281  // configuration of the beam
288 
295 
296  // local residual
297  for (unsigned int i = 0; i < _ndisp; ++i)
298  {
299  if (_component < 3)
300  {
301  _local_force[0](i) = _density[0] * _area[0] * _original_length[0] / 3.0 *
302  (_local_accel_0(i) + _local_accel_1(i) / 2.0 +
303  _eta[0] * (1.0 + _alpha) * (_local_vel_0(i) + _local_vel_1(i) / 2.0) -
304  _alpha * _eta[0] * (_local_vel_old_0(i) + _local_vel_old_1(i) / 2.0));
305  _local_force[1](i) = _density[0] * _area[0] * _original_length[0] / 3.0 *
306  (_local_accel_1(i) + _local_accel_0(i) / 2.0 +
307  _eta[0] * (1.0 + _alpha) * (_local_vel_1(i) + _local_vel_0(i) / 2.0) -
308  _alpha * _eta[0] * (_local_vel_old_1(i) + _local_vel_old_0(i) / 2.0));
309  }
310 
311  if (_component > 2)
312  {
313  Real I = _Iy[0] + _Iz[0];
314  if (_has_Ix && (i == 0))
315  I = _Ix[0];
316  if (i == 1)
317  I = _Iz[0];
318  else if (i == 2)
319  I = _Iy[0];
320 
321  _local_moment[0](i) =
322  _density[0] * I * _original_length[0] / 3.0 *
323  (_local_rot_accel_0(i) + _local_rot_accel_1(i) / 2.0 +
324  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(i) + _local_rot_vel_1(i) / 2.0) -
325  _alpha * _eta[0] * (_local_rot_vel_old_0(i) + _local_rot_vel_old_1(i) / 2.0));
326  _local_moment[1](i) =
327  _density[0] * I * _original_length[0] / 3.0 *
328  (_local_rot_accel_1(i) + _local_rot_accel_0(i) / 2.0 +
329  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(i) + _local_rot_vel_0(i) / 2.0) -
330  _alpha * _eta[0] * (_local_rot_vel_old_1(i) + _local_rot_vel_old_0(i) / 2.0));
331  }
332  }
333 
334  // If Ay or Az are non-zero, contribution of rotational accelerations to translational forces
335  // and vice versa have to be added
336  if (_component < 3)
337  {
338  _local_force[0](0) +=
339  _density[0] * _original_length[0] / 3.0 *
340  (_Az[0] * (_local_rot_accel_0(1) + _local_rot_accel_1(1) / 2.0 +
341  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(1) + _local_rot_vel_1(1) / 2.0) -
342  _alpha * _eta[0] * (_local_rot_vel_old_0(1) + _local_rot_vel_old_1(1) / 2.0)) -
343  _Ay[0] * (_local_rot_accel_0(2) + _local_rot_accel_1(2) / 2.0 +
344  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(2) + _local_rot_vel_1(2) / 2.0) -
345  _alpha * _eta[0] * (_local_rot_vel_old_0(2) + _local_rot_vel_old_1(2) / 2.0)));
346  _local_force[1](0) +=
347  _density[0] * _original_length[0] / 3.0 *
348  (_Az[0] * (_local_rot_accel_1(1) + _local_rot_accel_0(1) / 2.0 +
349  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(1) + _local_rot_vel_0(1) / 2.0) -
350  _alpha * _eta[0] * (_local_rot_vel_old_1(1) + _local_rot_vel_old_0(1) / 2.0)) -
351  _Ay[0] * (_local_rot_accel_1(2) + _local_rot_accel_0(2) / 2.0 +
352  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(2) + _local_rot_vel_0(2) / 2.0) -
353  _alpha * _eta[0] * (_local_rot_vel_old_1(2) + _local_rot_vel_old_0(2) / 2.0)));
354 
355  _local_force[0](1) +=
356  -_density[0] * _original_length[0] / 3.0 * _Az[0] *
357  (_local_rot_accel_0(0) + _local_rot_accel_1(0) / 2.0 +
358  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(0) + _local_rot_vel_1(0) / 2.0) -
359  _alpha * _eta[0] * (_local_rot_vel_old_0(0) + _local_rot_vel_old_1(0) / 2.0));
360  _local_force[1](1) +=
361  -_density[0] * _original_length[0] / 3.0 * _Az[0] *
362  (_local_rot_accel_1(0) + _local_rot_accel_0(0) / 2.0 +
363  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(0) + _local_rot_vel_0(0) / 2.0) -
364  _alpha * _eta[0] * (_local_rot_vel_old_1(0) + _local_rot_vel_old_0(0) / 2.0));
365 
366  _local_force[0](2) +=
367  _density[0] * _original_length[0] / 3.0 * _Ay[0] *
368  (_local_rot_accel_0(0) + _local_rot_accel_1(0) / 2.0 +
369  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(0) + _local_rot_vel_1(0) / 2.0) -
370  _alpha * _eta[0] * (_local_rot_vel_old_0(0) + _local_rot_vel_old_1(0) / 2.0));
371  _local_force[1](2) +=
372  _density[0] * _original_length[0] / 3.0 * _Ay[0] *
373  (_local_rot_accel_1(0) + _local_rot_accel_0(0) / 2.0 +
374  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(0) + _local_rot_vel_0(0) / 2.0) -
375  _alpha * _eta[0] * (_local_rot_vel_old_1(0) + _local_rot_vel_old_0(0) / 2.0));
376  }
377  else
378  {
379  _local_moment[0](0) += _density[0] * _original_length[0] / 3.0 *
380  (-_Az[0] * (_local_accel_0(1) + _local_accel_1(1) / 2.0) +
381  _Ay[0] * (_local_accel_0(1) + _local_accel_1(1) / 2.0));
382  _local_moment[1](0) += _density[0] * _original_length[0] / 3.0 *
383  (-_Az[0] * (_local_accel_1(1) + _local_accel_0(1) / 2.0) +
384  _Ay[0] * (_local_accel_1(1) + _local_accel_0(1) / 2.0));
385 
386  _local_moment[0](1) += _density[0] * _original_length[0] / 3.0 * _Az[0] *
387  (_local_accel_0(0) + _local_accel_1(0) / 2.0);
388  _local_moment[1](1) += _density[0] * _original_length[0] / 3.0 * _Az[0] *
389  (_local_accel_1(0) + _local_accel_0(0) / 2.0);
390 
391  _local_moment[0](2) += -_density[0] * _original_length[0] / 3.0 * _Ay[0] *
392  (_local_accel_0(0) + _local_accel_1(0) / 2.0);
393  _local_moment[1](2) += -_density[0] * _original_length[0] / 3.0 * _Ay[0] *
394  (_local_accel_1(0) + _local_accel_0(0) / 2.0);
395  }
396 
397  // Global force and moments
398  if (_component < 3)
399  {
402  _local_re(0) = _global_force_0(_component);
403  _local_re(1) = _global_force_1(_component);
404  }
405  else
406  {
409  _local_re(0) = _global_moment_0(_component - 3);
410  _local_re(1) = _global_moment_1(_component - 3);
411  }
412  }
413 
414  accumulateTaggedLocalResidual();
415 
416  if (_has_save_in)
417  {
418  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
419  for (unsigned int i = 0; i < _save_in.size(); ++i)
420  _save_in[i]->sys().solution().add_vector(_local_re, _save_in[i]->dofIndices());
421  }
422 }
423 
424 void
426 {
427  prepareMatrixTag(_assembly, _var.number(), _var.number());
428 
429  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
430 
431  Real factor = 0.0;
432  if (_has_beta)
433  factor = 1.0 / (_beta * _dt * _dt) + _eta[0] * (1.0 + _alpha) * _gamma / _beta / _dt;
434  else
435  factor = (*_du_dotdot_du)[0] + _eta[0] * (1.0 + _alpha) * (*_du_dot_du)[0];
436 
437  for (unsigned int i = 0; i < _test.size(); ++i)
438  {
439  for (unsigned int j = 0; j < _phi.size(); ++j)
440  {
441  if (_component < 3)
442  _local_ke(i, j) = (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] * _area[0] *
443  _original_length[0] * factor;
444  else if (_component > 2)
445  {
446  RankTwoTensor I;
447  if (_has_Ix)
448  I(0, 0) = _Ix[0];
449  else
450  I(0, 0) = _Iy[0] + _Iz[0];
451  I(1, 1) = _Iz[0];
452  I(2, 2) = _Iy[0];
453 
454  // conversion from local config to global coordinate system
455  RankTwoTensor Ig = _original_local_config[0].transpose() * I * _original_local_config[0];
456 
457  _local_ke(i, j) = (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
458  Ig(_component - 3, _component - 3) * _original_length[0] * factor;
459  }
460  }
461  }
462 
463  accumulateTaggedLocalMatrix();
464 
465  if (_has_diag_save_in)
466  {
467  unsigned int rows = _local_ke.m();
468  DenseVector<Number> diag(rows);
469  for (unsigned int i = 0; i < rows; ++i)
470  diag(i) = _local_ke(i, i);
471 
472  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
473  for (unsigned int i = 0; i < _diag_save_in.size(); ++i)
474  _diag_save_in[i]->sys().solution().add_vector(diag, _diag_save_in[i]->dofIndices());
475  }
476 }
477 
478 void
479 InertialForceBeam::computeOffDiagJacobian(MooseVariableFEBase & jvar)
480 {
481  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
482 
483  Real factor = 0.0;
484  if (_has_beta)
485  factor = 1.0 / (_beta * _dt * _dt) + _eta[0] * (1.0 + _alpha) * _gamma / _beta / _dt;
486  else
487  factor = (*_du_dotdot_du)[0] + _eta[0] * (1.0 + _alpha) * (*_du_dot_du)[0];
488 
489  size_t jvar_num = jvar.number();
490  if (jvar_num == _var.number())
491  computeJacobian();
492  else
493  {
494  unsigned int coupled_component = 0;
495  bool disp_coupled = false;
496  bool rot_coupled = false;
497 
498  for (unsigned int i = 0; i < _ndisp; ++i)
499  {
500  if (jvar_num == _disp_num[i] && _component > 2)
501  {
502  coupled_component = i;
503  disp_coupled = true;
504  break;
505  }
506  }
507 
508  for (unsigned int i = 0; i < _nrot; ++i)
509  {
510  if (jvar_num == _rot_num[i])
511  {
512  coupled_component = i + 3;
513  rot_coupled = true;
514  break;
515  }
516  }
517 
518  prepareMatrixTag(_assembly, _var.number(), jvar_num);
519 
520  if (disp_coupled || rot_coupled)
521  {
522  for (unsigned int i = 0; i < _test.size(); ++i)
523  {
524  for (unsigned int j = 0; j < _phi.size(); ++j)
525  {
526  if (_component < 3 && coupled_component > 2)
527  {
528  RankTwoTensor A;
529  A(0, 1) = _Az[0];
530  A(0, 2) = -_Ay[0];
531  A(1, 0) = -_Az[0];
532  A(2, 0) = _Ay[0];
533 
534  // conversion from local config to global coordinate system
535  const RankTwoTensor Ag =
536  _original_local_config[0].transpose() * A * _original_local_config[0];
537 
538  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
539  Ag(_component, coupled_component - 3) * _original_length[0] * factor;
540  }
541  else if (_component > 2 && coupled_component < 3)
542  {
543  RankTwoTensor A;
544  A(0, 1) = -_Az[0];
545  A(0, 2) = _Ay[0];
546  A(1, 0) = _Az[0];
547  A(2, 0) = -_Ay[0];
548 
549  // conversion from local config to global coordinate system
550  const RankTwoTensor Ag =
551  _original_local_config[0].transpose() * A * _original_local_config[0];
552 
553  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
554  Ag(_component - 3, coupled_component) * _original_length[0] * factor;
555  }
556  else if (_component > 2 && coupled_component > 2)
557  {
558  RankTwoTensor I;
559  if (_has_Ix)
560  I(0, 0) = _Ix[0];
561  else
562  I(0, 0) = _Iy[0] + _Iz[0];
563  I(1, 1) = _Iz[0];
564  I(2, 2) = _Iy[0];
565 
566  // conversion from local config to global coordinate system
567  const RankTwoTensor Ig =
568  _original_local_config[0].transpose() * I * _original_local_config[0];
569 
570  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
571  Ig(_component - 3, coupled_component - 3) * _original_length[0] *
572  factor;
573  }
574  }
575  }
576  }
577 
578  accumulateTaggedLocalMatrix();
579  }
580 }
InertialForceBeam::validParams
static InputParameters validParams()
Definition: InertialForceBeam.C:24
InertialForceBeam::_global_force_1
RealVectorValue _global_force_1
Definition: InertialForceBeam.h:179
InertialForceBeam::InertialForceBeam
InertialForceBeam(const InputParameters &parameters)
Definition: InertialForceBeam.C:75
InertialForceBeam::computeResidual
virtual void computeResidual() override
Definition: InertialForceBeam.C:165
InertialForceBeam::_ndisp
unsigned int _ndisp
Number of coupled displacement variables.
Definition: InertialForceBeam.h:56
InertialForceBeam::_has_velocities
const bool _has_velocities
Definition: InertialForceBeam.h:43
InertialForceBeam::_local_moment
std::vector< RealVectorValue > _local_moment
Definition: InertialForceBeam.h:173
InertialForceBeam::_local_vel_0
RealVectorValue _local_vel_0
Current translational and rotational velocities at the two nodes of the beam in the initial beam loca...
Definition: InertialForceBeam.h:161
InertialForceBeam::_local_accel_1
RealVectorValue _local_accel_1
Definition: InertialForceBeam.h:167
InertialForceBeam::_local_vel_old_0
RealVectorValue _local_vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the initial beam local co...
Definition: InertialForceBeam.h:155
InertialForceBeam::_local_rot_vel_old_1
RealVectorValue _local_rot_vel_old_1
Definition: InertialForceBeam.h:155
InertialForceBeam::_rot_accel_1
RealVectorValue _rot_accel_1
Definition: InertialForceBeam.h:149
InertialForceBeam::_du_dot_du
const VariableValue * _du_dot_du
Coupled variable for du_dot_du calculated by time integrator.
Definition: InertialForceBeam.h:184
InertialForceBeam::_original_local_config
const MaterialProperty< RankTwoTensor > & _original_local_config
Rotational transformation from global to initial beam local coordinate system.
Definition: InertialForceBeam.h:125
InertialForceBeam::_local_rot_vel_1
RealVectorValue _local_rot_vel_1
Definition: InertialForceBeam.h:161
InertialForceBeam::_local_rot_vel_old_0
RealVectorValue _local_rot_vel_old_0
Definition: InertialForceBeam.h:155
InertialForceBeam::_local_force
std::vector< RealVectorValue > _local_force
Forces and moments at the two end nodes of the beam in the initial beam local configuration.
Definition: InertialForceBeam.h:173
InertialForceBeam::_gamma
const Real _gamma
Newmark time integraion parameter.
Definition: InertialForceBeam.h:113
InertialForceBeam::_vel_num
std::vector< unsigned int > _vel_num
Variable numbers corresponding to velocity aux variables.
Definition: InertialForceBeam.h:65
InertialForceBeam::_Iz
const VariableValue & _Iz
Coupled variable for second momemnt of area of beam in z direction, i.e., integral of z^2*dA over the...
Definition: InertialForceBeam.h:107
InertialForceBeam::_has_accelerations
const bool _has_accelerations
Definition: InertialForceBeam.h:45
InertialForceBeam::_Ix
const VariableValue & _Ix
Coupled variable for second moment of area of beam in x direction, i.e., integral of (y^2+z^2)*dA ove...
Definition: InertialForceBeam.h:95
InertialForceBeam
Definition: InertialForceBeam.h:22
InertialForceBeam::_local_rot_vel_0
RealVectorValue _local_rot_vel_0
Definition: InertialForceBeam.h:161
InertialForceBeam::_alpha
const Real _alpha
HHT time integration parameter.
Definition: InertialForceBeam.h:119
InertialForceBeam::_component
const unsigned int _component
Direction along which residual is calculated.
Definition: InertialForceBeam.h:131
InertialForceBeam::computeOffDiagJacobian
virtual void computeOffDiagJacobian(MooseVariableFEBase &jvar) override
Definition: InertialForceBeam.C:479
InertialForceBeam::_local_rot_accel_0
RealVectorValue _local_rot_accel_0
Definition: InertialForceBeam.h:167
InertialForceBeam::_area
const VariableValue & _area
Coupled variable for beam cross-sectional area.
Definition: InertialForceBeam.h:77
InertialForceBeam::_Iy
const VariableValue & _Iy
Coupled variable for second moment of area of beam in y direction, i.e., integral of y^2*dA over the ...
Definition: InertialForceBeam.h:101
InertialForceBeam::_has_Ix
const bool _has_Ix
Definition: InertialForceBeam.h:47
InertialForceBeam::_rot_accel_num
std::vector< unsigned int > _rot_accel_num
Variable numbers corresponding to rotational acceleration aux variables.
Definition: InertialForceBeam.h:74
defineLegacyParams
defineLegacyParams(InertialForceBeam)
InertialForceBeam::_original_length
const MaterialProperty< Real > & _original_length
Initial length of beam.
Definition: InertialForceBeam.h:128
InertialForceBeam::_has_rot_accelerations
const bool _has_rot_accelerations
Definition: InertialForceBeam.h:46
InertialForceBeam::_rot_vel_num
std::vector< unsigned int > _rot_vel_num
Variable numbers corresponding to rotational velocity aux variables.
Definition: InertialForceBeam.h:71
validParams
InputParameters validParams()
InertialForceBeam::_rot_vel_1
RealVectorValue _rot_vel_1
Definition: InertialForceBeam.h:143
InertialForceBeam::_vel_old_0
RealVectorValue _vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the global coordinate sys...
Definition: InertialForceBeam.h:137
InertialForceBeam::_rot_vel_old_0
RealVectorValue _rot_vel_old_0
Definition: InertialForceBeam.h:137
InertialForceBeam::_Ay
const VariableValue & _Ay
Coupled variable for first moment of area of beam in y direction, i.e., integral of y*dA over the cro...
Definition: InertialForceBeam.h:83
InertialForceBeam::_global_moment_1
RealVectorValue _global_moment_1
Definition: InertialForceBeam.h:179
InertialForceBeam::_vel_old_1
RealVectorValue _vel_old_1
Definition: InertialForceBeam.h:137
registerMooseObject
registerMooseObject("TensorMechanicsApp", InertialForceBeam)
InertialForceBeam::_local_vel_old_1
RealVectorValue _local_vel_old_1
Definition: InertialForceBeam.h:155
InertialForceBeam::_rot_vel_old_1
RealVectorValue _rot_vel_old_1
Definition: InertialForceBeam.h:137
InertialForceBeam::_global_moment_0
RealVectorValue _global_moment_0
Definition: InertialForceBeam.h:179
InertialForceBeam::_vel_1
RealVectorValue _vel_1
Definition: InertialForceBeam.h:143
InertialForceBeam::_has_rot_velocities
const bool _has_rot_velocities
Definition: InertialForceBeam.h:44
InertialForceBeam::_local_rot_accel_1
RealVectorValue _local_rot_accel_1
Definition: InertialForceBeam.h:167
InertialForceBeam::_disp_num
std::vector< unsigned int > _disp_num
Variable numbers corresponding to displacement variables.
Definition: InertialForceBeam.h:62
InertialForceBeam::_Az
const VariableValue & _Az
Coupled variable for first moment of area of beam in z direction, i.e., integral of z*dA over the cro...
Definition: InertialForceBeam.h:89
InertialForceBeam::_rot_accel_0
RealVectorValue _rot_accel_0
Definition: InertialForceBeam.h:149
InertialForceBeam::_local_vel_1
RealVectorValue _local_vel_1
Definition: InertialForceBeam.h:161
InertialForceBeam::_rot_num
std::vector< unsigned int > _rot_num
Variable numbers corresponding to rotational variables.
Definition: InertialForceBeam.h:59
InertialForceBeam.h
InertialForceBeam::_density
const MaterialProperty< Real > & _density
Density of the beam.
Definition: InertialForceBeam.h:50
InertialForceBeam::_accel_1
RealVectorValue _accel_1
Definition: InertialForceBeam.h:149
InertialForceBeam::_accel_0
RealVectorValue _accel_0
Current translational and rotational accelerations at the two nodes of the beam in the global coordin...
Definition: InertialForceBeam.h:149
InertialForceBeam::_has_beta
const bool _has_beta
Booleans for validity of params.
Definition: InertialForceBeam.h:37
RankTwoTensorTempl< Real >
InertialForceBeam::computeJacobian
virtual void computeJacobian() override
Definition: InertialForceBeam.C:425
InertialForceBeam::_local_accel_0
RealVectorValue _local_accel_0
Current translational and rotational accelerations at the two nodes of the beam in the initial beam l...
Definition: InertialForceBeam.h:167
InertialForceBeam::_global_force_0
RealVectorValue _global_force_0
Forces and moments at the two end nodes of the beam in the global coordinate system.
Definition: InertialForceBeam.h:179
InertialForceBeam::_nrot
unsigned int _nrot
Number of coupled rotational variables.
Definition: InertialForceBeam.h:53
InertialForceBeam::_has_gamma
const bool _has_gamma
Definition: InertialForceBeam.h:42
InertialForceBeam::_rot_vel_0
RealVectorValue _rot_vel_0
Definition: InertialForceBeam.h:143
InertialForceBeam::_du_dotdot_du
const VariableValue * _du_dotdot_du
Coupled variable for du_dotdot_du calculated by time integrator.
Definition: InertialForceBeam.h:189
InertialForceBeam::_eta
const MaterialProperty< Real > & _eta
Mass proportional Rayleigh damping parameter.
Definition: InertialForceBeam.h:116
InertialForceBeam::_vel_0
RealVectorValue _vel_0
Current translational and rotational velocities at the two nodes of the beam in the global coordinate...
Definition: InertialForceBeam.h:143
InertialForceBeam::_accel_num
std::vector< unsigned int > _accel_num
Variable numbers corresponding to acceleraion aux variables.
Definition: InertialForceBeam.h:68
InertialForceBeam::_beta
const Real _beta
Newmark time integration parameter.
Definition: InertialForceBeam.h:110