www.mooseframework.org
CappedWeakInclinedPlaneStressUpdate.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 /****************************************************************/
8 #include "RotationMatrix.h" // for rotVecToZ
9 #include "libmesh/utility.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<CappedWeakPlaneStressUpdate>();
16  params.addClassDescription("Capped weak inclined plane plasticity stress calculator");
17  params.addRequiredParam<RealVectorValue>("normal_vector", "The normal vector to the weak plane");
18  return params;
19 }
20 
22  const InputParameters & parameters)
23  : CappedWeakPlaneStressUpdate(parameters),
24  _n_input(getParam<RealVectorValue>("normal_vector")),
25  _n(declareProperty<RealVectorValue>("weak_plane_normal")),
26  _n_old(getMaterialProperty<RealVectorValue>("weak_plane_normal")),
27  _rot_n_to_z(RealTensorValue()),
28  _rot_z_to_n(RealTensorValue()),
29  _rotated_trial(RankTwoTensor()),
30  _rotated_Eijkl(RankFourTensor())
31 {
32  if (_n_input.norm() == 0)
33  mooseError("CappedWeakInclinedPlaneStressUpdate: normal_vector must not have zero length");
34  else
35  _n_input /= _n_input.norm();
36 
37  _rot_n_to_z = RotationMatrix::rotVecToZ(_n_input);
38  _rot_z_to_n = _rot_n_to_z.transpose();
39 }
40 
41 void
43 {
45  _n[_qp] = _n_input;
46 }
47 
48 void
49 CappedWeakInclinedPlaneStressUpdate::finalizeReturnProcess(const RankTwoTensor & rotation_increment)
50 {
53  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
54  {
55  _n[_qp](i) = 0.0;
56  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
57  _n[_qp](i) += rotation_increment(i, j) * _n_old[_qp](j);
58  }
59 }
60 
61 void
63 {
66  {
67  _rot_n_to_z = RotationMatrix::rotVecToZ(_n[_qp]);
68  _rot_z_to_n = _rot_n_to_z.transpose();
69  }
70 }
71 
72 void
74  Real q_trial,
75  const RankTwoTensor & stress_trial,
76  const std::vector<Real> & /*intnl_old*/,
77  const std::vector<Real> & yf,
78  const RankFourTensor & Eijkl)
79 {
80  // If it's obvious, then simplify the return-type
81  if (yf[1] >= 0)
83  else if (yf[2] >= 0)
85 
86  _rotated_trial = stress_trial;
90  _in_q_trial = q_trial;
91 
92  _rotated_Eijkl = Eijkl;
94 }
95 
96 void
98  Real & p,
99  Real & q) const
100 {
101  RankTwoTensor rotated_stress = stress;
102  rotated_stress.rotate(_rot_n_to_z);
103  p = rotated_stress(2, 2);
104  q = std::sqrt(Utility::pow<2>(rotated_stress(0, 2)) + Utility::pow<2>(rotated_stress(1, 2)));
105 }
106 
107 void
108 CappedWeakInclinedPlaneStressUpdate::setEppEqq(const RankFourTensor & /*Eijkl*/,
109  Real & Epp,
110  Real & Eqq) const
111 {
112  Epp = _rotated_Eijkl(2, 2, 2, 2);
113  Eqq = _rotated_Eijkl(0, 2, 0, 2);
114 }
115 
116 void
117 CappedWeakInclinedPlaneStressUpdate::setStressAfterReturn(const RankTwoTensor & /*stress_trial*/,
118  Real p_ok,
119  Real q_ok,
120  Real gaE,
121  const std::vector<Real> & /*intnl*/,
122  const yieldAndFlow & smoothed_q,
123  const RankFourTensor & /*Eijkl*/,
124  RankTwoTensor & stress) const
125 {
126  // first get stress in the frame where _n points along "z"
127  stress = _rotated_trial;
128  stress(2, 2) = p_ok;
129  // stress_xx and stress_yy are sitting at their trial-stress values
130  // so need to bring them back via Poisson's ratio
131  stress(0, 0) -= _rotated_Eijkl(2, 2, 0, 0) * gaE / _Epp * smoothed_q.dg[0];
132  stress(1, 1) -= _rotated_Eijkl(2, 2, 1, 1) * gaE / _Epp * smoothed_q.dg[0];
133  if (_in_q_trial == 0.0)
134  stress(2, 0) = stress(2, 1) = stress(0, 2) = stress(1, 2) = 0.0;
135  else
136  {
137  stress(2, 0) = stress(0, 2) = _in_trial02 * q_ok / _in_q_trial;
138  stress(2, 1) = stress(1, 2) = _in_trial12 * q_ok / _in_q_trial;
139  }
140 
141  // rotate back to the original frame
142  stress.rotate(_rot_z_to_n);
143 }
144 
145 void
147  Real p_trial,
148  Real q_trial,
149  const RankTwoTensor & stress,
150  Real p,
151  Real q,
152  Real gaE,
153  const yieldAndFlow & smoothed_q,
154  const RankFourTensor & Eijkl,
155  bool compute_full_tangent_operator,
156  RankFourTensor & cto) const
157 {
159  p_trial,
160  q_trial,
161  stress,
162  p,
163  q,
164  gaE,
165  smoothed_q,
166  Eijkl,
167  compute_full_tangent_operator,
168  cto);
169 }
170 
171 RankTwoTensor
172 CappedWeakInclinedPlaneStressUpdate::dpdstress(const RankTwoTensor & /*stress*/) const
173 {
174  RankTwoTensor dpdsig = RankTwoTensor();
175  dpdsig(2, 2) = 1.0;
176  dpdsig.rotate(_rot_z_to_n);
177  return dpdsig;
178 }
179 
180 RankTwoTensor
181 CappedWeakInclinedPlaneStressUpdate::dqdstress(const RankTwoTensor & stress) const
182 {
183  RankTwoTensor rotated_stress = stress;
184  rotated_stress.rotate(_rot_n_to_z);
185  RankTwoTensor dqdsig = CappedWeakPlaneStressUpdate::dqdstress(rotated_stress);
186  dqdsig.rotate(_rot_z_to_n);
187  return dqdsig;
188 }
189 
190 RankFourTensor
191 CappedWeakInclinedPlaneStressUpdate::d2qdstress2(const RankTwoTensor & stress) const
192 {
193  RankTwoTensor rotated_stress = stress;
194  rotated_stress.rotate(_rot_n_to_z);
195  RankFourTensor d2qdsig2 = CappedWeakPlaneStressUpdate::d2qdstress2(rotated_stress);
196  d2qdsig2.rotate(_rot_z_to_n);
197  return d2qdsig2;
198 }
RealTensorValue _rot_n_to_z
Rotation matrix that rotates _n to "z".
RealVectorValue _n_input
User-input value of the normal vector to the weak plane.
InputParameters validParams< CappedWeakPlaneStressUpdate >()
virtual void computePQ(const RankTwoTensor &stress, Real &p, Real &q) const override
Computes p and q, given stress.
RankFourTensor _rotated_Eijkl
Elasticity tensor rotated to the frame where _n points along "z".
virtual void consistentTangentOperator(const RankTwoTensor &stress_trial, Real p_trial, Real q_trial, const RankTwoTensor &stress, Real p, Real q, Real gaE, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, bool compute_full_tangent_operator, RankFourTensor &cto) const
Calculates the consistent tangent operator.
virtual void consistentTangentOperator(const RankTwoTensor &stress_trial, Real p_trial, Real q_trial, const RankTwoTensor &stress, Real p, Real q, Real gaE, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, bool compute_full_tangent_operator, RankFourTensor &cto) const override
Calculates the consistent tangent operator.
RankTwoTensor _rotated_trial
Trial stress rotated to the frame where _n points along "z".
CappedWeakInclinedPlaneStressUpdate(const InputParameters &parameters)
Struct designed to hold info about a single yield function and its derivatives, as well as the flow d...
virtual RankTwoTensor dqdstress(const RankTwoTensor &stress) const override
d(q)/d(stress) Derived classes must override this
InputParameters validParams< CappedWeakInclinedPlaneStressUpdate >()
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const override
d2(q)/d(stress)/d(stress) Derived classes must override this
RealTensorValue _rot_z_to_n
Rotation matrix that rotates "z" to _n.
virtual void setEppEqq(const RankFourTensor &Eijkl, Real &Epp, Real &Eqq) const override
Set Epp and Eqq based on the elasticity tensor Derived classes must override this.
Real _in_trial02
trial value of stress(0, 2)
virtual void initializeReturnProcess() override
Derived classes may use this to perform calculations before any return-map process is performed...
virtual void preReturnMap(Real p_trial, Real q_trial, const RankTwoTensor &stress_trial, const std::vector< Real > &intnl_old, const std::vector< Real > &yf, const RankFourTensor &Eijkl) override
Derived classes may employ this function to record stuff or do other computations prior to the return...
virtual void finalizeReturnProcess(const RankTwoTensor &rotation_increment) override
Derived classes may use this to perform calculations after the return-map process has completed succe...
Real _Epp
elasticity tensor in p direction
const bool _perform_finite_strain_rotations
Whether to perform finite-strain rotations.
virtual RankTwoTensor dpdstress(const RankTwoTensor &stress) const override
d(p)/d(stress) Derived classes must override this
virtual void finalizeReturnProcess(const RankTwoTensor &rotation_increment) override
Derived classes may use this to perform calculations after the return-map process has completed succe...
virtual RankTwoTensor dqdstress(const RankTwoTensor &stress) const override
d(q)/d(stress) Derived classes must override this
enum CappedWeakPlaneStressUpdate::StressReturnType _stress_return_type
virtual void setStressAfterReturn(const RankTwoTensor &stress_trial, Real p_ok, Real q_ok, Real gaE, const std::vector< Real > &intnl, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, RankTwoTensor &stress) const override
Sets stress from the admissible parameters.
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const override
d2(q)/d(stress)/d(stress) Derived classes must override this
const MaterialProperty< RealVectorValue > & _n_old
Old value of the normal.
CappedWeakPlaneStressUpdate performs the return-map algorithm and associated stress updates for plast...
virtual void initializeReturnProcess() override
Derived classes may use this to perform calculations before any return-map process is performed...
MaterialProperty< RealVectorValue > & _n
Current value of the normal.
Real _in_trial12
trial value of stress(1, 2)