https://mooseframework.inl.gov
ComputeIncrementalBeamStrain.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 "MooseMesh.h"
12 #include "Assembly.h"
13 #include "NonlinearSystem.h"
14 #include "MooseVariable.h"
15 #include "Function.h"
16 
17 #include "libmesh/quadrature.h"
18 #include "libmesh/utility.h"
19 
21 
24 {
26  params.addClassDescription("Compute a infinitesimal/large strain increment for the beam.");
27  params.addRequiredCoupledVar(
28  "rotations", "The rotations appropriate for the simulation geometry and coordinate system");
29  params.addRequiredCoupledVar(
30  "displacements",
31  "The displacements appropriate for the simulation geometry and coordinate system");
32  params.addRequiredParam<RealGradient>("y_orientation",
33  "Orientation of the y direction along "
34  "with Iyy is provided. This should be "
35  "perpendicular to the axis of the beam.");
36  params.addRequiredCoupledVar(
37  "area",
38  "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
39  params.addCoupledVar("Ay",
40  0.0,
41  "First moment of area of the beam about y axis. Can be supplied "
42  "as either a number or a variable name.");
43  params.addCoupledVar("Az",
44  0.0,
45  "First moment of area of the beam about z axis. Can be supplied "
46  "as either a number or a variable name.");
47  params.addCoupledVar("Ix",
48  "Second moment of area of the beam about x axis. Can be "
49  "supplied as either a number or a variable name. Defaults to Iy+Iz.");
50  params.addRequiredCoupledVar("Iy",
51  "Second moment of area of the beam about y axis. Can be "
52  "supplied as either a number or a variable name.");
53  params.addRequiredCoupledVar("Iz",
54  "Second moment of area of the beam about z axis. Can be "
55  "supplied as either a number or a variable name.");
56  params.addParam<bool>("large_strain", false, "Set to true if large strain are to be calculated.");
57  params.addParam<std::vector<MaterialPropertyName>>(
58  "eigenstrain_names",
59  {},
60  "List of beam eigenstrains to be applied in this strain calculation.");
61  params.addParam<FunctionName>(
62  "elasticity_prefactor",
63  "Optional function to use as a scalar prefactor on the elasticity vector for the beam.");
64  return params;
65 }
66 
68  : Material(parameters),
69  _has_Ix(isParamValid("Ix")),
70  _nrot(coupledComponents("rotations")),
71  _ndisp(coupledComponents("displacements")),
72  _rot_num(_nrot),
73  _disp_num(_ndisp),
74  _area(coupledValue("area")),
75  _Ay(coupledValue("Ay")),
76  _Az(coupledValue("Az")),
77  _Iy(coupledValue("Iy")),
78  _Iz(coupledValue("Iz")),
79  _Ix(_has_Ix ? coupledValue("Ix") : _zero),
80  _original_local_config(declareRestartableData<RankTwoTensor>("original_local_config")),
81  _original_length(declareProperty<Real>("original_length")),
82  _total_rotation(declareProperty<RankTwoTensor>("total_rotation")),
83  _total_disp_strain(declareProperty<RealVectorValue>("total_disp_strain")),
84  _total_rot_strain(declareProperty<RealVectorValue>("total_rot_strain")),
85  _total_disp_strain_old(getMaterialPropertyOld<RealVectorValue>("total_disp_strain")),
86  _total_rot_strain_old(getMaterialPropertyOld<RealVectorValue>("total_rot_strain")),
87  _mech_disp_strain_increment(declareProperty<RealVectorValue>("mech_disp_strain_increment")),
88  _mech_rot_strain_increment(declareProperty<RealVectorValue>("mech_rot_strain_increment")),
89  _material_stiffness(getMaterialPropertyByName<RealVectorValue>("material_stiffness")),
90  _K11(declareProperty<RankTwoTensor>("Jacobian_11")),
91  _K21_cross(declareProperty<RankTwoTensor>("Jacobian_12")),
92  _K21(declareProperty<RankTwoTensor>("Jacobian_21")),
93  _K22(declareProperty<RankTwoTensor>("Jacobian_22")),
94  _K22_cross(declareProperty<RankTwoTensor>("Jacobian_22_cross")),
95  _large_strain(getParam<bool>("large_strain")),
96  _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
97  _disp_eigenstrain(_eigenstrain_names.size()),
98  _rot_eigenstrain(_eigenstrain_names.size()),
99  _disp_eigenstrain_old(_eigenstrain_names.size()),
100  _rot_eigenstrain_old(_eigenstrain_names.size()),
101  _nonlinear_sys(_fe_problem.getNonlinearSystemBase(/*nl_sys_num=*/0)),
102  _soln_disp_index_0(_ndisp),
103  _soln_disp_index_1(_ndisp),
104  _soln_rot_index_0(_ndisp),
105  _soln_rot_index_1(_ndisp),
106  _initial_rotation(declareProperty<RankTwoTensor>("initial_rotation")),
107  _effective_stiffness(declareProperty<Real>("effective_stiffness")),
108  _prefactor_function(isParamValid("elasticity_prefactor") ? &getFunction("elasticity_prefactor")
109  : nullptr)
110 {
111  // Checking for consistency between length of the provided displacements and rotations vector
112  if (_ndisp != _nrot)
113  mooseError("ComputeIncrementalBeamStrain: The number of variables supplied in 'displacements' "
114  "and 'rotations' must match.");
115 
116  // fetch coupled variables and gradients (as stateful properties if necessary)
117  for (unsigned int i = 0; i < _ndisp; ++i)
118  {
119  MooseVariable * disp_variable = getVar("displacements", i);
120  _disp_num[i] = disp_variable->number();
121 
122  MooseVariable * rot_variable = getVar("rotations", i);
123  _rot_num[i] = rot_variable->number();
124  }
125 
126  if (_large_strain && (_Ay[0] > 0.0 || _Ay[1] > 0.0 || _Az[0] > 0.0 || _Az[1] > 0.0))
127  mooseError("ComputeIncrementalBeamStrain: Large strain calculation does not currently "
128  "support asymmetric beam configurations with non-zero first or third moments of "
129  "area.");
130 
131  for (unsigned int i = 0; i < _eigenstrain_names.size(); ++i)
132  {
133  _disp_eigenstrain[i] = &getMaterialProperty<RealVectorValue>("disp_" + _eigenstrain_names[i]);
134  _rot_eigenstrain[i] = &getMaterialProperty<RealVectorValue>("rot_" + _eigenstrain_names[i]);
136  &getMaterialPropertyOld<RealVectorValue>("disp_" + _eigenstrain_names[i]);
138  &getMaterialPropertyOld<RealVectorValue>("rot_" + _eigenstrain_names[i]);
139  }
140 }
141 
142 void
144 {
145  // compute initial orientation of the beam for calculating initial rotation matrix
146  const std::vector<RealGradient> * orientation =
147  &_subproblem.assembly(_tid, _nonlinear_sys.number()).getFE(FEType(), 1)->get_dxyzdxi();
148  RealGradient x_orientation = (*orientation)[0];
149  x_orientation /= x_orientation.norm();
150 
151  RealGradient y_orientation = getParam<RealGradient>("y_orientation");
152  y_orientation /= y_orientation.norm();
153  Real sum = x_orientation(0) * y_orientation(0) + x_orientation(1) * y_orientation(1) +
154  x_orientation(2) * y_orientation(2);
155 
156  if (std::abs(sum) > 1e-4)
157  mooseError("ComputeIncrementalBeamStrain: y_orientation should be perpendicular to "
158  "the axis of the beam.");
159 
160  // Calculate z orientation as a cross product of the x and y orientations
161  RealGradient z_orientation;
162  z_orientation(0) = (x_orientation(1) * y_orientation(2) - x_orientation(2) * y_orientation(1));
163  z_orientation(1) = (x_orientation(2) * y_orientation(0) - x_orientation(0) * y_orientation(2));
164  z_orientation(2) = (x_orientation(0) * y_orientation(1) - x_orientation(1) * y_orientation(0));
165 
166  // Rotation matrix from global to original beam local configuration
167  _original_local_config(0, 0) = x_orientation(0);
168  _original_local_config(0, 1) = x_orientation(1);
169  _original_local_config(0, 2) = x_orientation(2);
170  _original_local_config(1, 0) = y_orientation(0);
171  _original_local_config(1, 1) = y_orientation(1);
172  _original_local_config(1, 2) = y_orientation(2);
173  _original_local_config(2, 0) = z_orientation(0);
174  _original_local_config(2, 1) = z_orientation(1);
175  _original_local_config(2, 2) = z_orientation(2);
176 
178 
179  RealVectorValue temp;
180  _total_disp_strain[_qp] = temp;
181  _total_rot_strain[_qp] = temp;
182 }
183 
184 void
186 {
187  // fetch the two end nodes for current element
188  std::vector<const Node *> node;
189  for (unsigned int i = 0; i < 2; ++i)
190  node.push_back(_current_elem->node_ptr(i));
191 
192  // calculate original length of a beam element
193  // Nodal positions do not change with time as undisplaced mesh is used by material classes by
194  // default
195  RealGradient dxyz;
196  for (unsigned int i = 0; i < _ndisp; ++i)
197  dxyz(i) = (*node[1])(i) - (*node[0])(i);
198 
199  _original_length[0] = dxyz.norm();
200 
201  // Fetch the solution for the two end nodes at time t
204 
205  for (unsigned int i = 0; i < _ndisp; ++i)
206  {
207  _soln_disp_index_0[i] = node[0]->dof_number(_nonlinear_sys.number(), _disp_num[i], 0);
208  _soln_disp_index_1[i] = node[1]->dof_number(_nonlinear_sys.number(), _disp_num[i], 0);
209  _soln_rot_index_0[i] = node[0]->dof_number(_nonlinear_sys.number(), _rot_num[i], 0);
210  _soln_rot_index_1[i] = node[1]->dof_number(_nonlinear_sys.number(), _rot_num[i], 0);
211 
212  _disp0(i) = sol(_soln_disp_index_0[i]) - sol_old(_soln_disp_index_0[i]);
213  _disp1(i) = sol(_soln_disp_index_1[i]) - sol_old(_soln_disp_index_1[i]);
214  _rot0(i) = sol(_soln_rot_index_0[i]) - sol_old(_soln_rot_index_0[i]);
215  _rot1(i) = sol(_soln_rot_index_1[i]) - sol_old(_soln_rot_index_1[i]);
216  }
217 
218  // For small rotation problems, the rotation matrix is essentially the transformation from the
219  // global to original beam local configuration and is never updated. This method has to be
220  // overriden for scenarios with finite rotation
221  computeRotation();
223 
224  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
225  computeQpStrain();
226 
229 }
230 
231 void
233 {
234  const Real A_avg = (_area[0] + _area[1]) / 2.0;
235  const Real Iz_avg = (_Iz[0] + _Iz[1]) / 2.0;
236  Real Ix = _Ix[_qp];
237  if (!_has_Ix)
238  Ix = _Iy[_qp] + _Iz[_qp];
239 
240  // Rotate the gradient of displacements and rotations at t+delta t from global coordinate
241  // frame to beam local coordinate frame
242  const RealVectorValue grad_disp_0(1.0 / _original_length[0] * (_disp1 - _disp0));
243  const RealVectorValue grad_rot_0(1.0 / _original_length[0] * (_rot1 - _rot0));
244  const RealVectorValue avg_rot(
245  0.5 * (_rot0(0) + _rot1(0)), 0.5 * (_rot0(1) + _rot1(1)), 0.5 * (_rot0(2) + _rot1(2)));
246 
247  _grad_disp_0_local_t = _total_rotation[0] * grad_disp_0;
248  _grad_rot_0_local_t = _total_rotation[0] * grad_rot_0;
249  _avg_rot_local_t = _total_rotation[0] * avg_rot;
250 
251  // displacement at any location on beam in local coordinate system at t
252  // u_1 = u_n1 - rot_3 * y + rot_2 * z
253  // u_2 = u_n2 - rot_1 * z
254  // u_3 = u_n3 + rot_1 * y
255  // where u_n1, u_n2, u_n3 are displacements at neutral axis
256 
257  // small strain
258  // e_11 = u_1,1 = u_n1, 1 - rot_3, 1 * y + rot_2, 1 * z
259  // e_12 = 2 * 0.5 * (u_1,2 + u_2,1) = (- rot_3 + u_n2,1 - rot_1,1 * z)
260  // e_13 = 2 * 0.5 * (u_1,3 + u_3,1) = (rot_2 + u_n3,1 + rot_1,1 * y)
261 
262  // axial and shearing strains at each qp along the length of the beam
264  _grad_rot_0_local_t(2) * _Ay[_qp] +
272 
273  // rotational strains at each qp along the length of the beam
274  // rot_strain_1 = integral(e_13 * y - e_12 * z) dA
275  // rot_strain_2 = integral(e_11 * z) dA
276  // rot_strain_3 = integral(e_11 * -y) dA
277  // Iyz is the product moment of inertia which is zero for most cross-sections so it is assumed to
278  // be zero for this analysis
279  const Real Iyz = 0;
282  _grad_rot_0_local_t(0) * Ix + _avg_rot_local_t(2) * _Az[_qp] -
285  _grad_rot_0_local_t(2) * Iyz +
288  _grad_rot_0_local_t(2) * _Iy[_qp] -
289  _grad_rot_0_local_t(1) * Iyz;
290 
291  if (_large_strain)
292  {
294  0.5 *
295  ((Utility::pow<2>(_grad_disp_0_local_t(0)) + Utility::pow<2>(_grad_disp_0_local_t(1)) +
296  Utility::pow<2>(_grad_disp_0_local_t(2))) *
297  _area[_qp] +
298  Utility::pow<2>(_grad_rot_0_local_t(2)) * _Iy[_qp] +
299  Utility::pow<2>(_grad_rot_0_local_t(1)) * _Iz[_qp] +
300  Utility::pow<2>(_grad_rot_0_local_t(0)) * Ix);
303  _area[_qp];
306  _area[_qp];
307 
312  _Iz[_qp];
315  _Iy[_qp];
316  }
317 
322 
323  // Convert eigenstrain increment from global to beam local coordinate system and remove eigen
324  // strain increment
325  for (unsigned int i = 0; i < _eigenstrain_names.size(); ++i)
326  {
329  _area[_qp];
332  }
333 
334  Real c1_paper = std::sqrt(_material_stiffness[0](0));
335  Real c2_paper = std::sqrt(_material_stiffness[0](1));
336 
337  Real effec_stiff_1 = std::max(c1_paper, c2_paper);
338 
339  Real effec_stiff_2 = 2 / (c2_paper * std::sqrt(A_avg / Iz_avg));
340 
341  _effective_stiffness[_qp] = std::max(effec_stiff_1, _original_length[0] / effec_stiff_2);
342 
345 }
346 
347 void
349 {
350  const Real youngs_modulus = _material_stiffness[0](0);
351  const Real shear_modulus = _material_stiffness[0](1);
352 
353  const Real A_avg = (_area[0] + _area[1]) / 2.0;
354  const Real Iy_avg = (_Iy[0] + _Iy[1]) / 2.0;
355  const Real Iz_avg = (_Iz[0] + _Iz[1]) / 2.0;
356  Real Ix_avg = (_Ix[0] + _Ix[1]) / 2.0;
357  if (!_has_Ix)
358  Ix_avg = Iy_avg + Iz_avg;
359 
360  // K = |K11 K12|
361  // |K21 K22|
362 
363  // relation between translational displacements at node 0 and translational forces at node 0
364  RankTwoTensor K11_local;
365  K11_local.zero();
366  K11_local(0, 0) = youngs_modulus * A_avg / _original_length[0];
367  K11_local(1, 1) = shear_modulus * A_avg / _original_length[0];
368  K11_local(2, 2) = shear_modulus * A_avg / _original_length[0];
369  _K11[0] = _total_rotation[0].transpose() * K11_local * _total_rotation[0];
370 
371  // relation between displacements at node 0 and rotational moments at node 0
372  RankTwoTensor K21_local;
373  K21_local.zero();
374  K21_local(2, 1) = shear_modulus * A_avg * 0.5;
375  K21_local(1, 2) = -shear_modulus * A_avg * 0.5;
376  _K21[0] = _total_rotation[0].transpose() * K21_local * _total_rotation[0];
377 
378  // relation between rotations at node 0 and rotational moments at node 0
379  RankTwoTensor K22_local;
380  K22_local.zero();
381  K22_local(0, 0) = shear_modulus * Ix_avg / _original_length[0];
382  K22_local(1, 1) = youngs_modulus * Iz_avg / _original_length[0] +
383  shear_modulus * A_avg * _original_length[0] / 4.0;
384  K22_local(2, 2) = youngs_modulus * Iy_avg / _original_length[0] +
385  shear_modulus * A_avg * _original_length[0] / 4.0;
386  _K22[0] = _total_rotation[0].transpose() * K22_local * _total_rotation[0];
387 
388  // relation between rotations at node 0 and rotational moments at node 1
389  RankTwoTensor K22_local_cross = -K22_local;
390  K22_local_cross(1, 1) += 2.0 * shear_modulus * A_avg * _original_length[0] / 4.0;
391  K22_local_cross(2, 2) += 2.0 * shear_modulus * A_avg * _original_length[0] / 4.0;
392  _K22_cross[0] = _total_rotation[0].transpose() * K22_local_cross * _total_rotation[0];
393 
394  // relation between displacements at node 0 and rotational moments at node 1
395  _K21_cross[0] = -_K21[0];
396 
397  // stiffness matrix for large strain
398  if (_large_strain)
399  {
400  // k1_large is the stiffness matrix obtained from sigma_xx * d(epsilon_xx)
401  RankTwoTensor k1_large_11;
402  // row 1
403  k1_large_11(0, 0) = Utility::pow<2>(_grad_disp_0_local_t(0)) +
404  1.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg +
405  1.5 * Utility::pow<2>(_grad_rot_0_local_t(1)) * Iz_avg +
406  0.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) +
407  0.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) +
408  0.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Ix_avg;
409  k1_large_11(1, 0) = 0.5 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(1) -
410  1.0 / 3.0 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(1) * Iz_avg;
411  k1_large_11(2, 0) = 0.5 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(2) -
412  1.0 / 3.0 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(2) * Iy_avg;
413 
414  // row 2
415  k1_large_11(0, 1) = k1_large_11(1, 0);
416  k1_large_11(1, 1) = Utility::pow<2>(_grad_disp_0_local_t(1)) +
417  1.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iz_avg +
418  0.5 * Utility::pow<2>(_grad_disp_0_local_t(0)) +
419  0.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) +
420  0.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg +
421  0.5 * Utility::pow<2>(_grad_rot_0_local_t(1)) * Iz_avg +
422  0.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iy_avg;
423  k1_large_11(2, 1) = 0.5 * _grad_disp_0_local_t(1) * _grad_disp_0_local_t(2);
424 
425  // row 3
426  k1_large_11(0, 2) = k1_large_11(2, 0);
427  k1_large_11(1, 2) = k1_large_11(2, 1);
428  k1_large_11(2, 2) = Utility::pow<2>(_grad_disp_0_local_t(2)) +
429  1.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iy_avg +
430  0.5 * Utility::pow<2>(_grad_disp_0_local_t(0)) +
431  0.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) +
432  0.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iz_avg +
433  0.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg +
434  0.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iz_avg;
435 
436  k1_large_11 *= 1.0 / 4.0 / Utility::pow<2>(_original_length[0]);
437 
438  RankTwoTensor k1_large_21;
439  // row 1
440  k1_large_21(0, 0) = 0.5 * _grad_disp_0_local_t(0) * _grad_rot_0_local_t(0) * (Ix_avg)-1.0 /
441  3.0 * _grad_disp_0_local_t(1) * _grad_rot_0_local_t(1) * Iz_avg -
442  1.0 / 3.0 * _grad_disp_0_local_t(2) * _grad_rot_0_local_t(2);
443  k1_large_21(1, 0) = 1.5 * _grad_disp_0_local_t(0) * _grad_rot_0_local_t(1) * Iz_avg -
444  1.0 / 3.0 * _grad_disp_0_local_t(1) * _grad_rot_0_local_t(0) * Iz_avg;
445  k1_large_21(2, 0) = 1.5 * _grad_disp_0_local_t(0) * _grad_rot_0_local_t(2) * Iy_avg -
446  1.0 / 3.0 * _grad_disp_0_local_t(2) * _grad_rot_0_local_t(0) * Iy_avg;
447 
448  // row 2
449  k1_large_21(0, 1) = k1_large_21(1, 0);
450  k1_large_21(1, 1) = 0.5 * _grad_disp_0_local_t(1) * _grad_rot_0_local_t(1) * Iz_avg -
451  1.0 / 3.0 * _grad_disp_0_local_t(0) * _grad_rot_0_local_t(0) * Iz_avg;
452  k1_large_21(2, 1) = 0.5 * _grad_disp_0_local_t(1) * _grad_rot_0_local_t(2) * Iy_avg;
453 
454  // row 3
455  k1_large_21(0, 2) = k1_large_21(2, 0);
456  k1_large_21(1, 2) = k1_large_21(2, 1);
457  k1_large_21(2, 2) = 0.5 * _grad_disp_0_local_t(2) * _grad_rot_0_local_t(2) * Iy_avg -
458  1.0 / 3.0 * _grad_disp_0_local_t(0) * _grad_rot_0_local_t(0) * Iy_avg;
459  k1_large_21 *= 1.0 / 4.0 / Utility::pow<2>(_original_length[0]);
460 
461  RankTwoTensor k1_large_22;
462  // row 1
463  k1_large_22(0, 0) = Utility::pow<2>(_grad_rot_0_local_t(0)) * Utility::pow<2>(Ix_avg) +
464  1.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) * Iz_avg +
465  1.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) * Iy_avg +
466  0.5 * Utility::pow<2>(_grad_disp_0_local_t(0)) * Ix_avg +
467  0.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) * Iz_avg +
468  0.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) * Iy_avg +
469  0.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg * Ix_avg +
470  0.5 * Utility::pow<2>(_grad_rot_0_local_t(1)) * Iz_avg * Ix_avg;
471  k1_large_22(1, 0) = 0.5 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(1) * Iz_avg * Ix_avg -
472  1.0 / 3.0 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(1) * Iz_avg;
473  k1_large_22(2, 0) = 0.5 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(2) * Iy_avg * Ix_avg -
474  1.0 / 3.0 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(2) * Iy_avg;
475 
476  // row 2
477  k1_large_22(0, 1) = k1_large_22(1, 0);
478  k1_large_22(1, 1) = Utility::pow<2>(_grad_rot_0_local_t(1)) * Iz_avg * Iz_avg +
479  1.5 * Utility::pow<2>(_grad_disp_0_local_t(0)) * Iz_avg +
480  1.5 * Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg * Iz_avg +
481  0.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) * Iz_avg +
482  0.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) * Iz_avg +
483  0.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iz_avg * Ix_avg;
484  k1_large_22(2, 1) = 1.5 * _grad_rot_0_local_t(1) * _grad_rot_0_local_t(2) * Iy_avg * Iz_avg;
485 
486  // row 3
487  k1_large_22(0, 2) = k1_large_22(2, 0);
488  k1_large_22(1, 2) = k1_large_22(2, 1);
489  k1_large_22(2, 2) = Utility::pow<2>(_grad_rot_0_local_t(2)) * Iy_avg * Iy_avg +
490  1.5 * Utility::pow<2>(_grad_disp_0_local_t(0)) * Iy_avg +
491  1.5 * Utility::pow<2>(_grad_rot_0_local_t(1)) * Iy_avg * Iz_avg +
492  0.5 * Utility::pow<2>(_grad_disp_0_local_t(1)) * Iy_avg +
493  0.5 * Utility::pow<2>(_grad_disp_0_local_t(2)) * Iy_avg +
494  0.5 * Utility::pow<2>(_grad_rot_0_local_t(0)) * Iz_avg * Ix_avg;
495 
496  k1_large_22 *= 1.0 / 4.0 / Utility::pow<2>(_original_length[0]);
497 
498  // k2_large and k3_large are contributions from tau_xy * d(gamma_xy) and tau_xz * d(gamma_xz)
499  // k2_large for node 1 is negative of that for node 0
500  RankTwoTensor k2_large_11;
501  // col 1
502  k2_large_11(0, 0) =
503  0.25 * Utility::pow<2>(_avg_rot_local_t(2)) + 0.25 * Utility::pow<2>(_avg_rot_local_t(1));
504  k2_large_11(1, 0) = -1.0 / 6.0 * _avg_rot_local_t(0) * _avg_rot_local_t(1);
505  k2_large_11(2, 0) = -1.0 / 6.0 * _avg_rot_local_t(0) * _avg_rot_local_t(2);
506 
507  // col 2
508  k2_large_11(0, 1) = k2_large_11(1, 0);
509  k2_large_11(1, 1) = 0.25 * _avg_rot_local_t(0);
510 
511  // col 3
512  k2_large_11(0, 2) = k2_large_11(2, 0);
513  k2_large_11(2, 2) = 0.25 * Utility::pow<2>(_avg_rot_local_t(0));
514 
515  k2_large_11 *= 1.0 / 4.0 / Utility::pow<2>(_original_length[0]);
516 
517  RankTwoTensor k2_large_22;
518  // col1
519  k2_large_22(0, 0) = 0.25 * Utility::pow<2>(_avg_rot_local_t(0)) * Ix_avg;
520  k2_large_22(1, 0) = 1.0 / 6.0 * _avg_rot_local_t(0) * _avg_rot_local_t(1) * Iz_avg;
521  k2_large_22(2, 0) = 1.0 / 6.0 * _avg_rot_local_t(0) * _avg_rot_local_t(2) * Iy_avg;
522 
523  // col2
524  k2_large_22(0, 1) = k2_large_22(1, 0);
525  k2_large_22(1, 1) = 0.25 * Utility::pow<2>(_avg_rot_local_t(2)) * Iz_avg +
526  0.25 * Utility::pow<2>(_avg_rot_local_t(1)) * Iz_avg;
527 
528  // col3
529  k2_large_22(0, 2) = k2_large_22(2, 0);
530  k2_large_22(2, 2) = 0.25 * Utility::pow<2>(_avg_rot_local_t(2)) * Iy_avg +
531  0.25 * Utility::pow<2>(_avg_rot_local_t(1)) * Iy_avg;
532 
533  k2_large_22 *= 1.0 / 4.0 / Utility::pow<2>(_original_length[0]);
534 
535  // k3_large for node 1 is same as that for node 0
536  RankTwoTensor k3_large_22;
537  // col1
538  k3_large_22(0, 0) = 0.25 * Utility::pow<2>(_grad_disp_0_local_t(2)) +
539  0.25 * _grad_rot_0_local_t(0) * Ix_avg +
540  0.25 * Utility::pow<2>(_grad_disp_0_local_t(1));
541  k3_large_22(1, 0) = -1.0 / 6.0 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(1) +
542  1.0 / 6.0 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(1) * Iz_avg;
543  k3_large_22(2, 0) = -1.0 / 6.0 * _grad_disp_0_local_t(0) * _grad_disp_0_local_t(2) +
544  1.0 / 6.0 * _grad_rot_0_local_t(0) * _grad_rot_0_local_t(2) * Iy_avg;
545 
546  // col2
547  k3_large_22(0, 1) = k3_large_22(1, 0);
548  k3_large_22(2, 2) = 0.25 * Utility::pow<2>(_grad_disp_0_local_t(0)) +
549  0.25 * _grad_rot_0_local_t(2) * Iy_avg +
550  0.25 * _grad_rot_0_local_t(1) * Iz_avg;
551 
552  // col3
553  k3_large_22(0, 2) = k3_large_22(2, 0);
554  k3_large_22(2, 2) = 0.25 * Utility::pow<2>(_grad_disp_0_local_t(0)) +
555  0.25 * _grad_rot_0_local_t(2) * Iy_avg +
556  0.25 * _grad_rot_0_local_t(1) * Iz_avg;
557 
558  k3_large_22 *= 1.0 / 16.0;
559 
560  RankTwoTensor k3_large_21;
561  // col1
562  k3_large_21(0, 0) = -1.0 / 6.0 *
565  k3_large_21(1, 0) = 0.25 * _grad_disp_0_local_t(0) * _avg_rot_local_t(1) -
566  1.0 / 6.0 * _grad_disp_0_local_t(1) * _avg_rot_local_t(0);
567  k3_large_21(2, 0) = 0.25 * _grad_disp_0_local_t(0) * _avg_rot_local_t(2) -
568  1.0 / 6.0 * _grad_disp_0_local_t(2) * _avg_rot_local_t(0);
569 
570  // col2
571  k3_large_21(0, 1) = 0.25 * _grad_disp_0_local_t(1) * _avg_rot_local_t(0) -
572  1.0 / 6.0 * _grad_disp_0_local_t(0) * _avg_rot_local_t(1);
573  k3_large_21(1, 1) = -1.0 / 6.0 * _grad_disp_0_local_t(0) * _avg_rot_local_t(0);
574 
575  // col3
576  k3_large_21(0, 2) = 0.25 * _grad_disp_0_local_t(2) * _avg_rot_local_t(0) -
577  1.0 / 6.0 * _grad_disp_0_local_t(0) * _avg_rot_local_t(2);
578  k3_large_21(2, 2) = -1.0 / 6.0 * _grad_disp_0_local_t(0) * _avg_rot_local_t(0);
579 
580  k3_large_21 *= 1.0 / 8.0 / _original_length[0];
581 
582  RankTwoTensor k4_large_22;
583  // col 1
584  k4_large_22(0, 0) = 0.25 * _grad_rot_0_local_t(0) * _avg_rot_local_t(0) * Ix_avg +
585  1.0 / 6.0 * _grad_rot_0_local_t(2) * _avg_rot_local_t(2) * Iy_avg +
586  1.0 / 6.0 * _grad_rot_0_local_t(1) * _avg_rot_local_t(1) * Iz_avg;
587  k4_large_22(1, 0) = 1.0 / 6.0 * _grad_rot_0_local_t(1) * _avg_rot_local_t(0) * Iz_avg;
588  k4_large_22(2, 0) = 1.0 / 6.0 * _grad_rot_0_local_t(2) * _avg_rot_local_t(0) * Iy_avg;
589 
590  // col2
591  k4_large_22(0, 1) = 1.0 / 6.0 * _grad_rot_0_local_t(0) * _avg_rot_local_t(1) * Iz_avg;
592  k4_large_22(1, 1) = 0.25 * _grad_rot_0_local_t(1) * _avg_rot_local_t(1) * Iz_avg +
593  1.0 / 6.0 * _grad_rot_0_local_t(0) * _avg_rot_local_t(0) * Iz_avg;
594  k4_large_22(2, 1) = 0.25 * _grad_rot_0_local_t(1) * _avg_rot_local_t(2) * Iz_avg;
595 
596  // col 3
597  k4_large_22(0, 2) = 1.0 / 6.0 * _grad_rot_0_local_t(0) * _avg_rot_local_t(2) * Iy_avg;
598  k4_large_22(1, 2) = 0.25 * _grad_rot_0_local_t(2) * _avg_rot_local_t(1) * Iy_avg;
599  k4_large_22(2, 2) = 0.25 * _grad_rot_0_local_t(2) * _avg_rot_local_t(2) * Iy_avg +
600  1.0 / 6.0 * _grad_rot_0_local_t(0) * _avg_rot_local_t(0) * Iy_avg;
601 
602  k3_large_22 += 1.0 / 8.0 / _original_length[0] * (k4_large_22 + k4_large_22.transpose());
603 
604  // Assembling final matrix
605  _K11[0] += _total_rotation[0].transpose() * (k1_large_11 + k2_large_11) * _total_rotation[0];
606  _K22[0] += _total_rotation[0].transpose() * (k1_large_22 + k2_large_22 + k3_large_22) *
607  _total_rotation[0];
608  _K21[0] += _total_rotation[0].transpose() * (k1_large_21 + k3_large_21) * _total_rotation[0];
609  _K21_cross[0] +=
610  _total_rotation[0].transpose() * (-k1_large_21 + k3_large_21) * _total_rotation[0];
611  _K22_cross[0] += _total_rotation[0].transpose() * (-k1_large_22 - k2_large_22 + k3_large_22) *
612  _total_rotation[0];
613  }
614 }
615 
616 void
618 {
620 }
const MooseArray< Point > & _q_point
MaterialProperty< RealVectorValue > & _total_disp_strain
Current total displacement strain integrated over the cross-section in global coordinate system...
std::vector< const MaterialProperty< RealVectorValue > * > _rot_eigenstrain_old
Vector of old rotational eigenstrains.
RankTwoTensor & _original_local_config
Rotational transformation from global coordinate system to initial beam local configuration.
const VariableValue & _Iy
Coupled variable for the second moment of area in y direction, i.e., integral of y^2*dA over the cros...
std::vector< unsigned int > _soln_disp_index_1
Indices of solution vector corresponding to displacement DOFs at the node 1.
std::vector< unsigned int > _rot_num
Variable numbers corresponding to the rotational variables.
MaterialProperty< RankTwoTensor > & _initial_rotation
Rotational transformation from global coordinate system to initial beam local configuration.
FEProblemBase & _fe_problem
const QBase *const & _qrule
std::vector< unsigned int > _soln_rot_index_0
Indices of solution vector corresponding to rotation DOFs at the node 0.
MaterialProperty< RankTwoTensor > & _K21_cross
Stiffness matrix between displacement DOFs of one node to rotational DOFs of another node...
auto norm() const -> decltype(std::norm(Real()))
const VariableValue & _Iz
Coupled variable for the second moment of area in z direction, i.e., integral of z^2*dA over the cros...
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
unsigned int _ndisp
Number of coupled displacement variables.
unsigned int number() const
virtual void computeRotation()
Computes the rotation matrix at time t. For small rotation scenarios, the rotation matrix at time t i...
SubProblem & _subproblem
MaterialProperty< RankTwoTensor > & _K22
Stiffness matrix between rotation DOFs of the same node.
MaterialProperty< RealVectorValue > & _total_rot_strain
Current total rotational strain integrated over the cross-section in global coordinate system...
NonlinearSystemBase & _nonlinear_sys
Reference to the nonlinear system object.
std::vector< const MaterialProperty< RealVectorValue > * > _disp_eigenstrain_old
Vector of old displacement eigenstrains.
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
registerMooseObject("SolidMechanicsApp", ComputeIncrementalBeamStrain)
ComputeIncrementalBeamStrain(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
RealVectorValue _avg_rot_local_t
Average rotation calculated in the beam local configuration at time t.
unsigned int _nrot
Number of coupled rotational variables.
MaterialProperty< RankTwoTensor > & _K11
Stiffness matrix between displacement DOFs of same node or across nodes.
unsigned int _qp
virtual const NumericVector< Number > *const & currentSolution() const override final
static InputParameters validParams()
THREAD_ID _tid
ComputeIncrementalBeamStrain defines a displacement and rotation strain increment and rotation increm...
std::vector< unsigned int > _disp_num
Variable numbers corresponding to the displacement variables.
MaterialProperty< RankTwoTensor > & _K22_cross
Stiffness matrix between rotation DOFs of different nodes.
Real & _t
virtual void initQpStatefulProperties() override
MaterialProperty< Real > & _original_length
Initial length of the beam.
const bool _has_Ix
Booleans for validity of params.
unsigned int number() const
const Function *const _prefactor_function
Prefactor function to multiply the elasticity tensor with.
MaterialProperty< RealVectorValue > & _mech_rot_strain_increment
Mechanical rotation strain increment (after removal of eigenstrains) integrated over the cross-sectio...
void addCoupledVar(const std::string &name, const std::string &doc_string)
std::vector< const MaterialProperty< RealVectorValue > * > _disp_eigenstrain
Vector of current displacement eigenstrains.
std::vector< unsigned int > _soln_rot_index_1
Indices of solution vector corresponding to rotation DOFs at the node 1.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
MaterialProperty< RealVectorValue > & _mech_disp_strain_increment
Mechanical displacement strain increment (after removal of eigenstrains) integrated over the cross-se...
const MaterialProperty< RealVectorValue > & _material_stiffness
Material stiffness vector that relates displacement strain increments to force increments.
RankTwoTensorTempl< Real > transpose() const
void computeQpStrain()
Computes the displacement and rotation strain increments.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RealVectorValue _grad_rot_0_local_t
Gradient of rotation calculated in the beam local configuration at time t.
const VariableValue & _area
Coupled variable for the beam cross-sectional area.
RealVectorValue _disp0
Displacement and rotations at the two nodes of the beam in the global coordinate system.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
MaterialProperty< Real > & _effective_stiffness
Psuedo stiffness for critical time step computation.
std::vector< MaterialPropertyName > _eigenstrain_names
Vector of beam eigenstrain names.
const bool _large_strain
Boolean flag to turn on large strain calculation.
const VariableValue & _Ay
Coupled variable for the first moment of area in y direction, i.e., integral of y*dA over the cross-s...
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
std::vector< const MaterialProperty< RealVectorValue > * > _rot_eigenstrain
Vector of current rotational eigenstrains.
void computeStiffnessMatrix()
Computes the stiffness matrices.
const VariableValue & _Az
Coupled variable for the first moment of area in z direction, i.e., integral of z*dA over the cross-s...
const bool & currentlyComputingJacobian() const
virtual Real value(Real t, const Point &p) const
const VariableValue & _Ix
Coupled variable for the second moment of area in x direction, i.e., integral of (y^2 + z^2)*dA over ...
NumericVector< Number > & solutionOld()
std::vector< unsigned int > _soln_disp_index_0
Indices of solution vector corresponding to displacement DOFs at the node 0.
const Elem *const & _current_elem
MaterialProperty< RankTwoTensor > & _total_rotation
Rotational transformation from global coordinate system to beam local configuration at time t...
MaterialProperty< RankTwoTensor > & _K21
Stiffness matrix between displacement DOFs and rotation DOFs of the same node.
const MaterialProperty< RealVectorValue > & _total_disp_strain_old
Old total displacement strain integrated over the cross-section in global coordinate system...
RealVectorValue _grad_disp_0_local_t
Gradient of displacement calculated in the beam local configuration at time t.