https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Compute2DFiniteStrain.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
12#include "libmesh/quadrature.h"
13
16{
19 "Compute a strain increment and rotation increment for finite strains in 2D geometries.");
20
21 MooseEnum outOfPlaneDirection("x y z", "z");
22 params.addParam<MooseEnum>(
23 "out_of_plane_direction", outOfPlaneDirection, "The direction of the out-of-plane strain.");
24 return params;
25}
26
28 : ComputeFiniteStrain(parameters),
29 _out_of_plane_direction(getParam<MooseEnum>("out_of_plane_direction"))
30{
31}
32
33void
35{
36 for (unsigned int i = 0; i < 3; ++i)
37 {
39 {
40 _disp[i] = &_zero;
41 _grad_disp[i] = &_grad_zero;
42 }
43 else
44 {
45 _disp[i] = &coupledValue("displacements", i);
46 _grad_disp[i] = &coupledGradient("displacements", i);
47 }
48
49 if (_fe_problem.isTransient() && i != _out_of_plane_direction)
50 _grad_disp_old[i] = &coupledGradientOld("displacements", i);
51 else
52 _grad_disp_old[i] = &_grad_zero;
53 }
54}
55
56void
58{
59 RankTwoTensor ave_Fhat;
60 Real ave_dfgrd_det = 0.0;
61
62 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
63 {
64 // Deformation gradient calculation for 2D problems
66 (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
67
68 // Old Deformation gradient
70 (*_grad_disp_old[0])[_qp], (*_grad_disp_old[1])[_qp], (*_grad_disp_old[2])[_qp]);
71
72 // Compute the displacement gradient for the out of plane direction for plane strain,
73 // generalized plane strain, or axisymmetric problems
74
77
78 // Gauss point deformation gradient
80 _deformation_gradient[_qp].addIa(1.0);
81
82 // deformation gradient midpoint
83 if (_use_hw)
84 {
85 (*_def_grad_mid)[_qp].setToIdentity();
86 (*_def_grad_mid)[_qp] += 0.5 * (A + Fbar);
87 }
88
89 A -= Fbar; // very nearly A = gradU - gradUold
90
91 // _f_bar = dDU/dX_o
92 if (_use_hw)
93 (*_f_bar)[_qp] = A;
94
95 Fbar.addIa(1.0); // Fbar = ( I + gradUold)
96
97 // Incremental deformation gradient _Fhat = I + A Fbar^-1
98 _Fhat[_qp] = A * Fbar.inverse();
99 _Fhat[_qp].addIa(1.0);
100
102 {
103 // Calculate average _Fhat for volumetric locking correction
104 ave_Fhat += _Fhat[_qp] * _JxW[_qp] * _coord[_qp];
105
106 // Average deformation gradient
107 ave_dfgrd_det += _deformation_gradient[_qp].det() * _JxW[_qp] * _coord[_qp];
108 }
109 }
111 {
112 // needed for volumetric locking correction
113 ave_Fhat /= _current_elem_volume;
114 // average deformation gradient
115 ave_dfgrd_det /= _current_elem_volume;
116 }
117 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
118 {
120 {
121 // Finalize volumetric locking correction
122 _Fhat[_qp] *= std::cbrt(ave_Fhat.det() / _Fhat[_qp].det());
123 // Volumetric locking correction
124 _deformation_gradient[_qp] *= std::cbrt(ave_dfgrd_det / _deformation_gradient[_qp].det());
125 }
126
128 }
129}
130
131void
133{
134 if (_out_of_plane_direction != 2 && _ndisp != 3)
135 mooseError("For 2D simulations where the out-of-plane direction is x or y the number of "
136 "supplied displacements must be three.");
137 else if (_out_of_plane_direction == 2 && _ndisp != 2)
138 mooseError("For 2D simulations where the out-of-plane direction is z the number of supplied "
139 "displacements must be two.");
140}
void mooseError(Args &&... args)
const unsigned int _out_of_plane_direction
static InputParameters validParams()
virtual void displacementIntegrityCheck() override
virtual void computeProperties() override
virtual Real computeOutOfPlaneGradDispOld()=0
Computes the old out-of-plane component of the displacement gradient; as a virtual function,...
virtual Real computeOutOfPlaneGradDisp()=0
Computes the current out-of-plane component of the displacement gradient; as a virtual function,...
Compute2DFiniteStrain(const InputParameters &parameters)
ComputeFiniteStrain defines a strain increment and rotation increment, for finite strains.
static InputParameters validParams()
const bool _use_hw
Flag if using HughesWinget method.
virtual void computeQpStrain()
std::vector< RankTwoTensor > _Fhat
Incremental deformation gradient.
std::vector< const VariableGradient * > _grad_disp_old
MaterialProperty< RankTwoTensor > & _deformation_gradient
std::vector< const VariableGradient * > _grad_disp
Gradient of displacements.
std::vector< const VariableValue * > _disp
Displacement variables.
const Real & _current_elem_volume
unsigned int _ndisp
Coupled displacement variables.
const bool _volumetric_locking_correction
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static RankTwoTensorTempl initializeFromRows(const libMesh::TypeVector< T > &row0, const libMesh::TypeVector< T > &row1, const libMesh::TypeVector< T > &row2)