www.mooseframework.org
Nonlinear3D.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 
8 #include "Nonlinear3D.h"
9 #include "SolidModel.h"
10 #include "Problem.h"
12 
13 #include "libmesh/quadrature.h"
14 
15 namespace SolidMechanics
16 {
17 
19  const std::string & name,
20  const InputParameters & parameters)
21  : Nonlinear(solid_model, name, parameters),
22  _grad_disp_x(coupledGradient("disp_x")),
23  _grad_disp_y(coupledGradient("disp_y")),
24  _grad_disp_z(coupledGradient("disp_z")),
25  _grad_disp_x_old(coupledGradientOld("disp_x")),
26  _grad_disp_y_old(coupledGradientOld("disp_y")),
27  _grad_disp_z_old(coupledGradientOld("disp_z")),
28  _volumetric_locking_correction(_solid_model.getParam<bool>("volumetric_locking_correction"))
29 {
30 }
31 
33 
35 
37 
38 void
40 {
41  // A = grad(u(k+1) - u(k))
42  // Fbar = 1 + grad(u(k))
43  // Fhat = 1 + A*(Fbar^-1)
44  ColumnMajorMatrix A;
45  ColumnMajorMatrix Fbar;
46  ColumnMajorMatrix Fbar_inverse;
47  ColumnMajorMatrix Fhat_average;
48  Real volume(0);
49 
50  _Fbar.resize(_solid_model.qrule()->n_points());
51 
52  for (unsigned qp = 0; qp < _solid_model.qrule()->n_points(); ++qp)
53  {
56 
57  A -= Fbar;
58 
59  Fbar.addDiag(1);
60 
61  _Fbar[qp] = Fbar;
62 
63  // Get Fbar^(-1)
64  // Computing the inverse is generally a bad idea.
65  // It's better to compute LU factors. For now at least, we'll take
66  // a direct route.
67 
68  invertMatrix(Fbar, Fbar_inverse);
69 
70  Fhat[qp] = A * Fbar_inverse;
71  Fhat[qp].addDiag(1);
72 
74  {
75  // Now include the contribution for the integration of Fhat over the element
76  Fhat_average += Fhat[qp] * _solid_model.JxW(qp);
77 
78  volume += _solid_model.JxW(qp); // Accumulate original configuration volume
79  }
80  }
81 
83  {
84  Fhat_average /= volume;
85  const Real det_Fhat_average(detMatrix(Fhat_average));
86 
87  // Finalize volumetric locking correction
88  for (unsigned qp = 0; qp < _solid_model.qrule()->n_points(); ++qp)
89  {
90  const Real det_Fhat(detMatrix(Fhat[qp]));
91  const Real factor(std::cbrt(det_Fhat_average / det_Fhat));
92 
93  Fhat[qp] *= factor;
94  }
95  }
96  // Moose::out << "Fhat(0,0)" << Fhat[0](0,0) << std::endl;
97 }
98 
100 
101 void
102 Nonlinear3D::computeDeformationGradient(unsigned int qp, ColumnMajorMatrix & F)
103 {
104  mooseAssert(F.n() == 3 && F.m() == 3, "computeDefGrad requires 3x3 matrix");
105 
106  F(0, 0) = _grad_disp_x[qp](0) + 1;
107  F(0, 1) = _grad_disp_x[qp](1);
108  F(0, 2) = _grad_disp_x[qp](2);
109  F(1, 0) = _grad_disp_y[qp](0);
110  F(1, 1) = _grad_disp_y[qp](1) + 1;
111  F(1, 2) = _grad_disp_y[qp](2);
112  F(2, 0) = _grad_disp_z[qp](0);
113  F(2, 1) = _grad_disp_z[qp](1);
114  F(2, 2) = _grad_disp_z[qp](2) + 1;
115 }
116 
118 
119 Real
120 Nonlinear3D::volumeRatioOld(unsigned int qp) const
121 {
122  ColumnMajorMatrix Fnm1T(_grad_disp_x_old[qp], _grad_disp_y_old[qp], _grad_disp_z_old[qp]);
123  Fnm1T(0, 0) += 1;
124  Fnm1T(1, 1) += 1;
125  Fnm1T(2, 2) += 1;
126 
127  return detMatrix(Fnm1T);
128 }
129 
131 }
Nonlinear is the base class for all large strain/rotation models.
Definition: Nonlinear.h:22
const VariableGradient & _grad_disp_z_old
Definition: Nonlinear3D.h:37
virtual void computeDeformationGradient(unsigned int qp, ColumnMajorMatrix &F)
Definition: Nonlinear3D.C:102
const VariableGradient & _grad_disp_x_old
Definition: Nonlinear3D.h:35
std::vector< ColumnMajorMatrix > _Fbar
Definition: Nonlinear.h:46
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
const VariableGradient & _grad_disp_x
Definition: Nonlinear3D.h:32
const VariableGradient & _grad_disp_z
Definition: Nonlinear3D.h:34
const bool _volumetric_locking_correction
Definition: Nonlinear3D.h:44
virtual Real volumeRatioOld(unsigned qp) const
Definition: Nonlinear3D.C:120
static Real detMatrix(const ColumnMajorMatrix &A)
Definition: Element.C:28
const VariableGradient & _grad_disp_y
Definition: Nonlinear3D.h:33
const VariableGradient & _grad_disp_y_old
Definition: Nonlinear3D.h:36
Real JxW(unsigned i) const
Definition: SolidModel.h:55
const std::vector< ColumnMajorMatrix > & Fhat() const
Definition: Nonlinear.h:31
virtual void computeIncrementalDeformationGradient(std::vector< ColumnMajorMatrix > &Fhat)
Definition: Nonlinear3D.C:39
SolidModel & _solid_model
Definition: Element.h:72
void fillMatrix(unsigned int qp, const VariableGradient &grad_x, const VariableGradient &grad_y, const VariableGradient &grad_z, ColumnMajorMatrix &A)
Definition: Element.C:225
Nonlinear3D(SolidModel &solid_model, const std::string &name, const InputParameters &parameters)
Definition: Nonlinear3D.C:18
static void invertMatrix(const ColumnMajorMatrix &A, ColumnMajorMatrix &Ainv)
Definition: Element.C:49