www.mooseframework.org
ADComputeIncrementalSmallStrain.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 
11 #include "libmesh/quadrature.h"
12 
14 
17  params.addClassDescription(
18  "Compute a strain increment and rotation increment for small strains."););
19 
20 template <ComputeStage compute_stage>
22  const InputParameters & parameters)
23  : ADComputeIncrementalStrainBase<compute_stage>(parameters)
24 {
25 }
26 
27 template <ComputeStage compute_stage>
28 void
30 {
31  ADReal volumetric_strain = 0.0;
32  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
33  {
34  ADRankTwoTensor total_strain_increment;
35  computeTotalStrainIncrement(total_strain_increment);
36 
37  _strain_increment[_qp] = total_strain_increment;
38 
39  if (_volumetric_locking_correction)
40  volumetric_strain += total_strain_increment.trace() * _JxW[_qp] * _coord[_qp];
41  }
42 
43  if (_volumetric_locking_correction)
44  volumetric_strain /= _current_elem_volume;
45 
46  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
47  {
48  if (_volumetric_locking_correction)
49  {
50  const auto correction = (volumetric_strain - _strain_increment[_qp].trace()) / 3.0;
51  _strain_increment[_qp](0, 0) += correction;
52  _strain_increment[_qp](1, 1) += correction;
53  _strain_increment[_qp](2, 2) += correction;
54  }
55 
56  _total_strain[_qp] = _strain_increment[_qp] + _total_strain_old[_qp];
57 
58  // Remove the Eigen strain increment
59  subtractEigenstrainIncrementFromStrain(_strain_increment[_qp]);
60 
61  // strain rate
62  if (_dt > 0)
63  _strain_rate[_qp] = _strain_increment[_qp] / _dt;
64  else
65  _strain_rate[_qp].zero();
66 
67  // Update strain in intermediate configuration: rotations are not needed
68  _mechanical_strain[_qp] = _strain_increment[_qp] + _mechanical_strain_old[_qp];
69 
70  // incremental small strain does not include rotation
71  _rotation_increment[_qp].setToIdentity();
72  }
73 
74  copyDualNumbersToValues();
75 }
76 
77 template <ComputeStage compute_stage>
78 void
80  ADRankTwoTensor & total_strain_increment)
81 {
82  // Deformation gradient
83  ADRankTwoTensor A(
84  (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]); // Deformation gradient
85  RankTwoTensor Fbar((*_grad_disp_old[0])[_qp],
86  (*_grad_disp_old[1])[_qp],
87  (*_grad_disp_old[2])[_qp]); // Old Deformation gradient
88 
89  A -= Fbar; // A = grad_disp - grad_disp_old
90 
91  total_strain_increment = 0.5 * (A + A.transpose());
92 }
93 
94 // explicit instantiation is required for AD base classes
ADComputeIncrementalSmallStrain defines a strain increment and rotation increment (=1)...
virtual void computeTotalStrainIncrement(ADRankTwoTensor &total_strain_increment)
Computes the current and old deformation gradients and passes back the total strain increment tensor...
registerADMooseObject("TensorMechanicsApp", ADComputeIncrementalSmallStrain)
defineADValidParams(ADComputeIncrementalSmallStrain, ADComputeIncrementalStrainBase, params.addClassDescription("Compute a strain increment and rotation increment for small strains.");)
adBaseClass(ADComputeIncrementalSmallStrain)
ADComputeIncrementalSmallStrain(const InputParameters &parameters)
ADComputeIncrementalStrainBase is the base class for strain tensors using incremental formulations...