www.mooseframework.org
PlaneStrain.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "PlaneStrain.h"
8 #include "SolidModel.h"
9 #include "libmesh/quadrature.h"
10 
11 namespace SolidMechanics
12 {
13 
15  const std::string & name,
16  const InputParameters & parameters)
17  : Element(solid_model, name, parameters),
18  ScalarCoupleable(&solid_model),
19  _large_strain(solid_model.getParam<bool>("large_strain")),
20  _grad_disp_x(coupledGradient("disp_x")),
21  _grad_disp_y(coupledGradient("disp_y")),
22  _have_strain_zz(isCoupled("strain_zz")),
23  _strain_zz(_have_strain_zz ? coupledValue("strain_zz") : _zero),
24  _have_scalar_strain_zz(isCoupledScalar("scalar_strain_zz")),
25  _scalar_strain_zz(_have_scalar_strain_zz ? coupledScalarValue("scalar_strain_zz") : _zero),
26  _volumetric_locking_correction(solid_model.getParam<bool>("volumetric_locking_correction"))
27 {
29  mooseError("Must define only one of strain_zz or scalar_strain_zz");
30 }
31 
33 
34 void
35 PlaneStrain::computeStrain(const unsigned qp,
36  const SymmTensor & total_strain_old,
37  SymmTensor & total_strain_new,
38  SymmTensor & strain_increment)
39 {
40  strain_increment.xx() = _grad_disp_x[qp](0);
41  strain_increment.yy() = _grad_disp_y[qp](1);
42 
43  if (_have_strain_zz)
44  strain_increment.zz() = _strain_zz[qp];
45  else if (_have_scalar_strain_zz && _scalar_strain_zz.size() > 0)
46  strain_increment.zz() = _scalar_strain_zz[0];
47  else
48  strain_increment.zz() = 0;
49 
50  strain_increment.xy() = 0.5 * (_grad_disp_x[qp](1) + _grad_disp_y[qp](0));
51  strain_increment.yz() = 0;
52  strain_increment.zx() = 0;
53  if (_large_strain)
54  {
55  strain_increment.xx() += 0.5 * (_grad_disp_x[qp](0) * _grad_disp_x[qp](0) +
56  _grad_disp_y[qp](0) * _grad_disp_y[qp](0));
57  strain_increment.yy() += 0.5 * (_grad_disp_x[qp](1) * _grad_disp_x[qp](1) +
58  _grad_disp_y[qp](1) * _grad_disp_y[qp](1));
59  strain_increment.xy() += 0.5 * (_grad_disp_x[qp](0) * _grad_disp_x[qp](1) +
60  _grad_disp_y[qp](0) * _grad_disp_y[qp](1));
61  }
62 
64  {
65  // volumetric locking correction
66  Real volumetric_strain = 0.0;
67  Real volume = 0.0;
68  Real dim = 3.0;
69  for (unsigned int qp_loop = 0; qp_loop < _solid_model.qrule()->n_points(); ++qp_loop)
70  {
71  if (_have_strain_zz)
72  volumetric_strain +=
73  (_grad_disp_x[qp_loop](0) + _grad_disp_y[qp_loop](1) + _strain_zz[qp_loop]) / dim *
74  _solid_model.JxW(qp_loop);
75  else if (_have_scalar_strain_zz && _scalar_strain_zz.size() > 0)
76  volumetric_strain +=
77  (_grad_disp_x[qp_loop](0) + _grad_disp_y[qp_loop](1) + _scalar_strain_zz[0]) / dim *
78  _solid_model.JxW(qp_loop);
79  else
80  volumetric_strain +=
81  (_grad_disp_x[qp_loop](0) + _grad_disp_y[qp_loop](1)) / dim * _solid_model.JxW(qp_loop);
82 
83  volume += _solid_model.JxW(qp_loop);
84 
85  if (_large_strain)
86  {
87  volumetric_strain += 0.5 * (_grad_disp_x[qp_loop](0) * _grad_disp_x[qp_loop](0) +
88  _grad_disp_y[qp_loop](0) * _grad_disp_y[qp_loop](0)) /
89  dim * _solid_model.JxW(qp_loop);
90  volumetric_strain += 0.5 * (_grad_disp_x[qp_loop](1) * _grad_disp_x[qp_loop](1) +
91  _grad_disp_y[qp_loop](1) * _grad_disp_y[qp_loop](1)) /
92  dim * _solid_model.JxW(qp_loop);
93  }
94  }
95 
96  volumetric_strain /= volume; // average volumetric strain
97 
98  // strain increment at _qp
99  Real trace = strain_increment.trace();
100  strain_increment.xx() += volumetric_strain - trace / dim;
101  strain_increment.yy() += volumetric_strain - trace / dim;
102  strain_increment.zz() += volumetric_strain - trace / dim;
103  }
104 
105  total_strain_new = strain_increment;
106 
107  strain_increment -= total_strain_old;
108 }
109 
110 void
111 PlaneStrain::computeDeformationGradient(unsigned int qp, ColumnMajorMatrix & F)
112 {
113  mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");
114 
115  F(0, 0) = _grad_disp_x[qp](0) + 1.0;
116  F(0, 1) = _grad_disp_x[qp](1);
117  F(0, 2) = 0.0;
118  F(1, 0) = _grad_disp_y[qp](0);
119  F(1, 1) = _grad_disp_y[qp](1) + 1.0;
120  F(1, 2) = 0.0;
121  F(2, 0) = 0.0;
122  F(2, 1) = 0.0;
123  F(2, 2) = 1.0;
124 }
125 }
const VariableGradient & _grad_disp_y
Definition: PlaneStrain.h:37
Real yy() const
Definition: SymmTensor.h:130
Element is the base class for all of this module&#39;s solid mechanics element formulations.
Definition: Element.h:23
Real xx() const
Definition: SymmTensor.h:129
const VariableValue & _strain_zz
Definition: PlaneStrain.h:39
SolidModel is the base class for all this module&#39;s solid mechanics material models.
Definition: SolidModel.h:31
QBase * qrule()
Definition: SolidModel.h:53
PlaneStrain(SolidModel &solid_model, const std::string &name, const InputParameters &parameters)
Definition: PlaneStrain.C:14
Real zz() const
Definition: SymmTensor.h:131
const VariableGradient & _grad_disp_x
Definition: PlaneStrain.h:36
virtual void computeDeformationGradient(unsigned int qp, ColumnMajorMatrix &F)
Definition: PlaneStrain.C:111
Real trace() const
Definition: SymmTensor.h:95
Real JxW(unsigned i) const
Definition: SolidModel.h:55
Real xy() const
Definition: SymmTensor.h:132
SolidModel & _solid_model
Definition: Element.h:72
Real yz() const
Definition: SymmTensor.h:133
Real zx() const
Definition: SymmTensor.h:134
virtual void computeStrain(const unsigned qp, const SymmTensor &total_strain_old, SymmTensor &total_strain_new, SymmTensor &strain_increment)
Definition: PlaneStrain.C:35
const bool _volumetric_locking_correction
Definition: PlaneStrain.h:42
const VariableValue & _scalar_strain_zz
Definition: PlaneStrain.h:41