www.mooseframework.org
CappedDruckerPragerCosseratStressUpdate.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 
13 
15 
16 InputParameters
18 {
19  InputParameters params = CappedDruckerPragerStressUpdate::validParams();
20  params.addClassDescription("Capped Drucker-Prager plasticity stress calculator for the Cosserat "
21  "situation where the host medium (ie, the limit where all Cosserat "
22  "effects are zero) is isotropic. Note that the return-map flow rule "
23  "uses an isotropic elasticity tensor built with the 'host' properties "
24  "defined by the user.");
25  params.addRequiredRangeCheckedParam<Real>("host_youngs_modulus",
26  "host_youngs_modulus>0",
27  "Young's modulus for the isotropic host medium");
28  params.addRequiredRangeCheckedParam<Real>("host_poissons_ratio",
29  "host_poissons_ratio>=0 & host_poissons_ratio<0.5",
30  "Poisson's ratio for the isotropic host medium");
31  return params;
32 }
33 
35  const InputParameters & parameters)
36  : CappedDruckerPragerStressUpdate(parameters),
37  _shear(getParam<Real>("host_youngs_modulus") /
38  (2.0 * (1.0 + getParam<Real>("host_poissons_ratio"))))
39 {
40  const Real young = getParam<Real>("host_youngs_modulus");
41  const Real poisson = getParam<Real>("host_poissons_ratio");
42  const Real lambda = young * poisson / ((1.0 + poisson) * (1.0 - 2.0 * poisson));
43  _Ehost.fillFromInputVector({lambda, _shear}, RankFourTensor::symmetric_isotropic);
44 }
45 
46 void
48  Real & Epp,
49  Real & Eqq) const
50 {
51  Epp = _Ehost.sum3x3();
52  Eqq = _shear;
53 }
54 
55 void
57  Real p_ok,
58  Real q_ok,
59  Real /*gaE*/,
60  const std::vector<Real> & /*intnl*/,
61  const yieldAndFlow & /*smoothed_q*/,
62  const RankFourTensor & /*Eijkl*/,
63  RankTwoTensor & stress) const
64 {
65  // symm_stress is the symmetric part of the stress tensor.
66  // symm_stress = (s_ij+s_ji)/2 + de_ij tr(stress) / 3
67  // = q / q_trial * (s_ij^trial+s_ji^trial)/2 + de_ij p / 3
68  // = q / q_trial * (symm_stress_ij^trial - de_ij tr(stress^trial) / 3) + de_ij p / 3
69  const Real p_trial = stress_trial.trace();
70  RankTwoTensor symm_stress = RankTwoTensor(RankTwoTensor::initIdentity) / 3.0 *
71  (p_ok - (_in_q_trial == 0.0 ? 0.0 : p_trial * q_ok / _in_q_trial));
72  if (_in_q_trial > 0)
73  symm_stress += q_ok / _in_q_trial * 0.5 * (stress_trial + stress_trial.transpose());
74  stress = symm_stress + 0.5 * (stress_trial - stress_trial.transpose());
75 }
76 
77 void
79  const RankTwoTensor & /*stress_trial*/,
80  Real /*p_trial*/,
81  Real /*q_trial*/,
82  const RankTwoTensor & stress,
83  Real /*p*/,
84  Real q,
85  Real gaE,
86  const yieldAndFlow & smoothed_q,
87  const RankFourTensor & Eijkl,
88  bool compute_full_tangent_operator,
89  RankFourTensor & cto) const
90 {
91  if (!compute_full_tangent_operator)
92  {
93  cto = Eijkl;
94  return;
95  }
96 
97  RankFourTensor EAijkl;
98  for (unsigned i = 0; i < _tensor_dimensionality; ++i)
99  for (unsigned j = 0; j < _tensor_dimensionality; ++j)
100  for (unsigned k = 0; k < _tensor_dimensionality; ++k)
101  for (unsigned l = 0; l < _tensor_dimensionality; ++l)
102  {
103  cto(i, j, k, l) = 0.5 * (Eijkl(i, j, k, l) + Eijkl(j, i, k, l));
104  EAijkl(i, j, k, l) = 0.5 * (Eijkl(i, j, k, l) - Eijkl(j, i, k, l));
105  }
106 
107  const RankTwoTensor s_over_q =
108  (q == 0.0 ? RankTwoTensor()
109  : (0.5 * (stress + stress.transpose()) -
110  stress.trace() * RankTwoTensor(RankTwoTensor::initIdentity) / 3.0) /
111  q);
112  const RankTwoTensor E_s_over_q = Eijkl.innerProductTranspose(s_over_q); // not symmetric in kl
113  const RankTwoTensor Ekl =
114  RankTwoTensor(RankTwoTensor::initIdentity).initialContraction(Eijkl); // symmetric in kl
115 
116  for (unsigned i = 0; i < _tensor_dimensionality; ++i)
117  for (unsigned j = 0; j < _tensor_dimensionality; ++j)
118  for (unsigned k = 0; k < _tensor_dimensionality; ++k)
119  for (unsigned l = 0; l < _tensor_dimensionality; ++l)
120  {
121  cto(i, j, k, l) -= (i == j) * (1.0 / 3.0) *
122  (Ekl(k, l) * (1.0 - _dp_dpt) + 0.5 * E_s_over_q(k, l) * (-_dp_dqt));
123  cto(i, j, k, l) -=
124  s_over_q(i, j) * (Ekl(k, l) * (-_dq_dpt) + 0.5 * E_s_over_q(k, l) * (1.0 - _dq_dqt));
125  }
126 
127  if (smoothed_q.dg[1] != 0.0)
128  {
129  const RankFourTensor Tijab = _Ehost * (gaE / _Epp) * smoothed_q.dg[1] * d2qdstress2(stress);
130  RankFourTensor inv = RankFourTensor(RankFourTensor::initIdentitySymmetricFour) + Tijab;
131  try
132  {
133  inv = inv.transposeMajor().invSymm();
134  }
135  catch (const MooseException & e)
136  {
137  // Cannot form the inverse, so probably at some degenerate place in stress space.
138  // Just return with the "best estimate" of the cto.
139  mooseWarning("CappedDruckerPragerCosseratStressUpdate: Cannot invert 1+T in consistent "
140  "tangent operator computation at quadpoint ",
141  _qp,
142  " of element ",
143  _current_elem->id());
144  return;
145  }
146  cto = (cto.transposeMajor() * inv).transposeMajor();
147  }
148  cto += EAijkl;
149 }
CappedDruckerPragerStressUpdate::validParams
static InputParameters validParams()
Definition: CappedDruckerPragerStressUpdate.C:19
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
CappedDruckerPragerStressUpdate::d2qdstress2
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const override
d2(q)/d(stress)/d(stress) Derived classes must override this
Definition: CappedDruckerPragerStressUpdate.C:415
MultiParameterPlasticityStressUpdate::yieldAndFlow::dg
std::vector< Real > dg
Definition: MultiParameterPlasticityStressUpdate.h:219
CappedDruckerPragerCosseratStressUpdate
CappedDruckerPragerCosseratStressUpdate performs the return-map algorithm and associated stress updat...
Definition: CappedDruckerPragerCosseratStressUpdate.h:54
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
CappedDruckerPragerCosseratStressUpdate::CappedDruckerPragerCosseratStressUpdate
CappedDruckerPragerCosseratStressUpdate(const InputParameters &parameters)
Definition: CappedDruckerPragerCosseratStressUpdate.C:34
CappedDruckerPragerStressUpdate
CappedDruckerPragerStressUpdate performs the return-map algorithm and associated stress updates for p...
Definition: CappedDruckerPragerStressUpdate.h:60
CappedDruckerPragerCosseratStressUpdate::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: CappedDruckerPragerCosseratStressUpdate.C:56
CappedDruckerPragerCosseratStressUpdate::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: CappedDruckerPragerCosseratStressUpdate.C:47
TwoParameterPlasticityStressUpdate::_dq_dqt
Real _dq_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Definition: TwoParameterPlasticityStressUpdate.h:65
registerMooseObject
registerMooseObject("TensorMechanicsApp", CappedDruckerPragerCosseratStressUpdate)
defineLegacyParams
defineLegacyParams(CappedDruckerPragerCosseratStressUpdate)
TwoParameterPlasticityStressUpdate::_dp_dpt
Real _dp_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Definition: TwoParameterPlasticityStressUpdate.h:59
CappedDruckerPragerCosseratStressUpdate::validParams
static InputParameters validParams()
Definition: CappedDruckerPragerCosseratStressUpdate.C:17
CappedDruckerPragerStressUpdate::_in_q_trial
Real _in_q_trial
trial value of q
Definition: CappedDruckerPragerStressUpdate.h:118
CappedDruckerPragerCosseratStressUpdate::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: CappedDruckerPragerCosseratStressUpdate.C:78
RankTwoTensor
RankTwoTensorTempl< Real > RankTwoTensor
Definition: ACGrGrElasticDrivingForce.h:17
CappedDruckerPragerCosseratStressUpdate::_Ehost
RankFourTensor _Ehost
Isotropic elasticity tensor for the host medium.
Definition: CappedDruckerPragerCosseratStressUpdate.h:71
RankFourTensorTempl< Real >
TwoParameterPlasticityStressUpdate::_dq_dpt
Real _dq_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Definition: TwoParameterPlasticityStressUpdate.h:61
RankTwoTensorTempl< Real >
CappedDruckerPragerCosseratStressUpdate.h
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
CappedDruckerPragerCosseratStressUpdate::_shear
const Real _shear
Shear modulus for the host medium.
Definition: CappedDruckerPragerCosseratStressUpdate.h:68