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