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