www.mooseframework.org
CappedWeakPlaneCosseratStressUpdate.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 
12 #include "libmesh/utility.h"
13 
15 
18 {
20  params.addClassDescription("Capped weak-plane plasticity Cosserat stress calculator");
21  return params;
22 }
23 
25  const InputParameters & parameters)
26  : CappedWeakPlaneStressUpdate(parameters)
27 {
28 }
29 
30 void
32  Real p_ok,
33  Real q_ok,
34  Real gaE,
35  const std::vector<Real> & /*intnl*/,
36  const yieldAndFlow & smoothed_q,
37  const RankFourTensor & Eijkl,
38  RankTwoTensor & stress) const
39 {
40  stress = stress_trial;
41  stress(2, 2) = p_ok;
42  // stress_xx and stress_yy are sitting at their trial-stress values
43  // so need to bring them back via Poisson's ratio
44  stress(0, 0) -= Eijkl(2, 2, 0, 0) * gaE / _Epp * smoothed_q.dg[0];
45  stress(1, 1) -= Eijkl(2, 2, 1, 1) * gaE / _Epp * smoothed_q.dg[0];
46  if (_in_q_trial == 0.0)
47  stress(0, 2) = stress(1, 2) = 0.0;
48  else
49  {
50  stress(0, 2) = _in_trial02 * q_ok / _in_q_trial;
51  stress(1, 2) = _in_trial12 * q_ok / _in_q_trial;
52  }
53 }
54 
55 void
57  const RankTwoTensor & /*stress_trial*/,
58  Real /*p_trial*/,
59  Real q_trial,
60  const RankTwoTensor & /*stress*/,
61  Real /*p*/,
62  Real q,
63  Real gaE,
64  const yieldAndFlow & smoothed_q,
65  const RankFourTensor & Eijkl,
66  bool compute_full_tangent_operator,
67  RankFourTensor & cto) const
68 {
69  cto = Eijkl;
70  if (!compute_full_tangent_operator)
71  return;
72 
73  const Real Ezzzz = Eijkl(2, 2, 2, 2);
74  const Real Exzxz = Eijkl(0, 2, 0, 2);
75  const Real tanpsi = _tan_psi.value(_intnl[_qp][0]);
76  const Real dintnl0_dq = -1.0 / Exzxz;
77  const Real dintnl0_dqt = 1.0 / Exzxz;
78  const Real dintnl1_dp = -1.0 / Ezzzz;
79  const Real dintnl1_dpt = 1.0 / Ezzzz;
80  const Real dintnl1_dq =
81  tanpsi / Exzxz - (q_trial - q) * _tan_psi.derivative(_intnl[_qp][0]) * dintnl0_dq / Exzxz;
82  const Real dintnl1_dqt =
83  -tanpsi / Exzxz - (q_trial - q) * _tan_psi.derivative(_intnl[_qp][0]) * dintnl0_dqt / Exzxz;
84 
85  for (unsigned i = 0; i < _tensor_dimensionality; ++i)
86  {
87  const Real dpt_depii = Eijkl(2, 2, i, i);
88  cto(2, 2, i, i) = _dp_dpt * dpt_depii;
89  const Real poisson_effect =
90  Eijkl(2, 2, 0, 0) / Ezzzz *
91  (_dgaE_dpt * smoothed_q.dg[0] + gaE * smoothed_q.d2g[0][0] * _dp_dpt +
92  gaE * smoothed_q.d2g[0][1] * _dq_dpt +
93  gaE * smoothed_q.d2g_di[0][0] * (dintnl0_dq * _dq_dpt) +
94  gaE * smoothed_q.d2g_di[0][1] *
95  (dintnl1_dpt + dintnl1_dp * _dp_dpt + dintnl1_dq * _dq_dpt)) *
96  dpt_depii;
97  cto(0, 0, i, i) -= poisson_effect;
98  cto(1, 1, i, i) -= poisson_effect;
99  if (q_trial > 0.0)
100  {
101  cto(0, 2, i, i) = _in_trial02 / q_trial * _dq_dpt * dpt_depii;
102  cto(1, 2, i, i) = _in_trial12 / q_trial * _dq_dpt * dpt_depii;
103  }
104  }
105 
106  const Real poisson_effect =
107  -Eijkl(2, 2, 0, 0) / Ezzzz *
108  (_dgaE_dqt * smoothed_q.dg[0] + gaE * smoothed_q.d2g[0][0] * _dp_dqt +
109  gaE * smoothed_q.d2g[0][1] * _dq_dqt +
110  gaE * smoothed_q.d2g_di[0][0] * (dintnl0_dqt + dintnl0_dq * _dq_dqt) +
111  gaE * smoothed_q.d2g_di[0][1] * (dintnl1_dqt + dintnl1_dp * _dp_dqt + dintnl1_dq * _dq_dqt));
112 
113  const Real dqt_dep02 = (q_trial == 0.0 ? 1.0 : _in_trial02 / q_trial) * Eijkl(0, 2, 0, 2);
114  cto(2, 2, 0, 2) = _dp_dqt * dqt_dep02;
115  cto(0, 0, 0, 2) = cto(1, 1, 0, 2) = poisson_effect * dqt_dep02;
116  if (q_trial > 0.0)
117  {
118  // for q_trial=0, Jacobian_mult is just given by the elastic case
119  cto(0, 2, 0, 2) = Eijkl(0, 2, 0, 2) * q / q_trial +
120  _in_trial02 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep02;
121  cto(1, 2, 0, 2) = _in_trial12 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep02;
122  }
123 
124  const Real dqt_dep20 = (q_trial == 0.0 ? 1.0 : _in_trial02 / q_trial) * Eijkl(0, 2, 2, 0);
125  cto(2, 2, 2, 0) = _dp_dqt * dqt_dep20;
126  cto(0, 0, 2, 0) = cto(1, 1, 2, 0) = poisson_effect * dqt_dep20;
127  if (q_trial > 0.0)
128  {
129  // for q_trial=0, Jacobian_mult is just given by the elastic case
130  cto(0, 2, 2, 0) = Eijkl(0, 2, 2, 0) * q / q_trial +
131  _in_trial02 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep20;
132  cto(1, 2, 2, 0) = _in_trial12 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep20;
133  }
134 
135  const Real dqt_dep12 = (q_trial == 0.0 ? 1.0 : _in_trial12 / q_trial) * Eijkl(1, 2, 1, 2);
136  cto(2, 2, 1, 2) = _dp_dqt * dqt_dep12;
137  cto(0, 0, 1, 2) = cto(1, 1, 1, 2) = poisson_effect * dqt_dep12;
138  if (q_trial > 0.0)
139  {
140  // for q_trial=0, Jacobian_mult is just given by the elastic case
141  cto(0, 2, 1, 2) = _in_trial02 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep12;
142  cto(1, 2, 1, 2) = Eijkl(1, 2, 1, 2) * q / q_trial +
143  _in_trial12 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep12;
144  }
145 
146  const Real dqt_dep21 = (q_trial == 0.0 ? 1.0 : _in_trial12 / q_trial) * Eijkl(1, 2, 2, 1);
147  cto(2, 2, 2, 1) = _dp_dqt * dqt_dep21;
148  cto(0, 0, 2, 1) = cto(1, 1, 2, 1) = poisson_effect * dqt_dep21;
149  if (q_trial > 0.0)
150  {
151  // for q_trial=0, Jacobian_mult is just given by the elastic case
152  cto(0, 2, 2, 1) = _in_trial02 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep21;
153  cto(1, 2, 2, 1) = Eijkl(1, 2, 2, 1) * q / q_trial +
154  _in_trial12 * (_dq_dqt - q / q_trial) / q_trial * dqt_dep21;
155  }
156 }
157 
160 {
162  const Real q = std::sqrt(Utility::pow<2>(stress(0, 2)) + Utility::pow<2>(stress(1, 2)));
163  if (q > 0.0)
164  {
165  deriv(0, 2) = stress(0, 2) / q;
166  deriv(1, 2) = stress(1, 2) / q;
167  }
168  else
169  {
170  // derivative is not defined here. For now i'll set:
171  deriv(0, 2) = 1.0;
172  deriv(1, 2) = 1.0;
173  }
174  return deriv;
175 }
176 
179 {
181 
182  const Real q = std::sqrt(Utility::pow<2>(stress(0, 2)) + Utility::pow<2>(stress(1, 2)));
183  if (q == 0.0)
184  return d2;
185 
186  const Real dq02 = stress(0, 2) / q;
187  const Real dq12 = stress(1, 2) / q;
188 
189  d2(0, 2, 0, 2) = 1.0 / q - dq02 * dq02 / q;
190  d2(0, 2, 1, 2) = -dq02 * dq12 / q;
191  d2(1, 2, 0, 2) = -dq12 * dq02 / q;
192  d2(1, 2, 1, 2) = 1.0 / q - dq12 * dq12 / q;
193 
194  return d2;
195 }
CappedWeakPlaneCosseratStressUpdate performs the return-map algorithm and associated stress updates f...
virtual RankTwoTensor dqdstress(const RankTwoTensor &stress) const override
d(q)/d(stress) Derived classes must override this
Real _dp_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Real _dq_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Struct designed to hold info about a single yield function and its derivatives, as well as the flow d...
Real _dgaE_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Real _dgaE_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
virtual Real value(Real intnl) const
MaterialProperty< std::vector< Real > > & _intnl
internal parameters
unsigned int _qp
Real _in_trial02
trial value of stress(0, 2)
Real _dq_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Real deriv(unsigned n, unsigned alpha, unsigned beta, Real x)
const SolidMechanicsHardeningModel & _tan_psi
Hardening model for tan(psi)
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.
Real _Epp
elasticity tensor in p direction
registerMooseObject("SolidMechanicsApp", CappedWeakPlaneCosseratStressUpdate)
virtual Real derivative(Real intnl) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CappedWeakPlaneCosseratStressUpdate(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const override
d2(q)/d(stress)/d(stress) Derived classes must override this
static InputParameters validParams()
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.
CappedWeakPlaneStressUpdate performs the return-map algorithm and associated stress updates for plast...
Real _dp_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
static constexpr unsigned _tensor_dimensionality
Internal dimensionality of tensors (currently this is 3 throughout tensor_mechanics) ...
Real _in_trial12
trial value of stress(1, 2)