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