www.mooseframework.org
TensorMechanicsPlasticJ2.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 "RankFourTensor.h"
12 
13 registerMooseObject("TensorMechanicsApp", TensorMechanicsPlasticJ2);
14 
16 
17 InputParameters
19 {
20  InputParameters params = TensorMechanicsPlasticModel::validParams();
21  params.addRequiredParam<UserObjectName>(
22  "yield_strength",
23  "A TensorMechanicsHardening UserObject that defines hardening of the yield strength");
24  params.addRangeCheckedParam<unsigned>(
25  "max_iterations", 10, "max_iterations>0", "Maximum iterations for custom J2 return map");
26  params.addParam<bool>("use_custom_returnMap",
27  true,
28  "Whether to use the custom returnMap "
29  "algorithm. Set to true if you are using "
30  "isotropic elasticity.");
31  params.addParam<bool>("use_custom_cto",
32  true,
33  "Whether to use the custom consistent tangent "
34  "operator computations. Set to true if you are "
35  "using isotropic elasticity.");
36  params.addClassDescription("J2 plasticity, associative, with hardening");
37 
38  return params;
39 }
40 
41 TensorMechanicsPlasticJ2::TensorMechanicsPlasticJ2(const InputParameters & parameters)
42  : TensorMechanicsPlasticModel(parameters),
43  _strength(getUserObject<TensorMechanicsHardeningModel>("yield_strength")),
44  _max_iters(getParam<unsigned>("max_iterations")),
45  _use_custom_returnMap(getParam<bool>("use_custom_returnMap")),
46  _use_custom_cto(getParam<bool>("use_custom_cto"))
47 {
48 }
49 
50 Real
51 TensorMechanicsPlasticJ2::yieldFunction(const RankTwoTensor & stress, Real intnl) const
52 {
53  return std::sqrt(3.0 * stress.secondInvariant()) - yieldStrength(intnl);
54 }
55 
58 {
59  Real sII = stress.secondInvariant();
60  if (sII == 0.0)
61  return RankTwoTensor();
62  else
63  return 0.5 * std::sqrt(3.0 / sII) * stress.dsecondInvariant();
64 }
65 
66 Real
68 {
69  return -dyieldStrength(intnl);
70 }
71 
73 TensorMechanicsPlasticJ2::flowPotential(const RankTwoTensor & stress, Real intnl) const
74 {
75  return dyieldFunction_dstress(stress, intnl);
76 }
77 
80 {
81  Real sII = stress.secondInvariant();
82  if (sII == 0)
83  return RankFourTensor();
84 
85  RankFourTensor dfp = 0.5 * std::sqrt(3.0 / sII) * stress.d2secondInvariant();
86  Real pre = -0.25 * std::sqrt(3.0) * std::pow(sII, -1.5);
87  RankTwoTensor dII = stress.dsecondInvariant();
88  for (unsigned i = 0; i < 3; ++i)
89  for (unsigned j = 0; j < 3; ++j)
90  for (unsigned k = 0; k < 3; ++k)
91  for (unsigned l = 0; l < 3; ++l)
92  dfp(i, j, k, l) += pre * dII(i, j) * dII(k, l);
93  return dfp;
94 }
95 
98  Real /*intnl*/) const
99 {
100  return RankTwoTensor();
101 }
102 
103 Real
105 {
106  return _strength.value(intnl);
107 }
108 
109 Real
111 {
112  return _strength.derivative(intnl);
113 }
114 
115 std::string
117 {
118  return "J2";
119 }
120 
121 bool
123  Real intnl_old,
124  const RankFourTensor & E_ijkl,
125  Real ep_plastic_tolerance,
126  RankTwoTensor & returned_stress,
127  Real & returned_intnl,
128  std::vector<Real> & dpm,
129  RankTwoTensor & delta_dp,
130  std::vector<Real> & yf,
131  bool & trial_stress_inadmissible) const
132 {
133  if (!(_use_custom_returnMap))
134  return TensorMechanicsPlasticModel::returnMap(trial_stress,
135  intnl_old,
136  E_ijkl,
137  ep_plastic_tolerance,
138  returned_stress,
139  returned_intnl,
140  dpm,
141  delta_dp,
142  yf,
143  trial_stress_inadmissible);
144 
145  yf.resize(1);
146 
147  Real yf_orig = yieldFunction(trial_stress, intnl_old);
148 
149  yf[0] = yf_orig;
150 
151  if (yf_orig < _f_tol)
152  {
153  // the trial_stress is admissible
154  trial_stress_inadmissible = false;
155  return true;
156  }
157 
158  trial_stress_inadmissible = true;
159  Real mu = E_ijkl(0, 1, 0, 1);
160 
161  // Perform a Newton-Raphson to find dpm when
162  // residual = 3*mu*dpm - trial_equivalent_stress + yieldStrength(intnl_old + dpm) = 0
163  Real trial_equivalent_stress = yf_orig + yieldStrength(intnl_old);
164  Real residual;
165  Real jac;
166  dpm[0] = 0;
167  unsigned int iter = 0;
168  do
169  {
170  residual = 3.0 * mu * dpm[0] - trial_equivalent_stress + yieldStrength(intnl_old + dpm[0]);
171  jac = 3.0 * mu + dyieldStrength(intnl_old + dpm[0]);
172  dpm[0] += -residual / jac;
173  if (iter > _max_iters) // not converging
174  return false;
175  iter++;
176  } while (residual * residual > _f_tol * _f_tol);
177 
178  // set the returned values
179  yf[0] = 0;
180  returned_intnl = intnl_old + dpm[0];
181  RankTwoTensor nn = 1.5 * trial_stress.deviatoric() /
182  trial_equivalent_stress; // = dyieldFunction_dstress(trial_stress, intnl_old) =
183  // the normal to the yield surface, at the trial
184  // stress
185  returned_stress = 2.0 / 3.0 * nn * yieldStrength(returned_intnl);
186  returned_stress.addIa(1.0 / 3.0 * trial_stress.trace());
187  delta_dp = nn * dpm[0];
188 
189  return true;
190 }
191 
194  Real intnl_old,
195  const RankTwoTensor & stress,
196  Real intnl,
197  const RankFourTensor & E_ijkl,
198  const std::vector<Real> & cumulative_pm) const
199 {
200  if (!_use_custom_cto)
202  trial_stress, intnl_old, stress, intnl, E_ijkl, cumulative_pm);
203 
204  Real mu = E_ijkl(0, 1, 0, 1);
205 
206  Real h = 3 * mu + dyieldStrength(intnl);
207  RankTwoTensor sij = stress.deviatoric();
208  Real sII = stress.secondInvariant();
209  Real equivalent_stress = std::sqrt(3.0 * sII);
210  Real zeta = cumulative_pm[0] / (1.0 + 3.0 * mu * cumulative_pm[0] / equivalent_stress);
211 
212  return E_ijkl - 3.0 * mu * mu / sII / h * sij.outerProduct(sij) -
213  4.0 * mu * mu * zeta * dflowPotential_dstress(stress, intnl);
214 }
215 
216 bool
218 {
219  return _use_custom_returnMap;
220 }
221 
222 bool
224 {
225  return _use_custom_cto;
226 }
TensorMechanicsPlasticJ2::dyieldStrength
virtual Real dyieldStrength(Real intnl) const
d(yieldStrength)/d(intnl)
Definition: TensorMechanicsPlasticJ2.C:110
TensorMechanicsPlasticModel::validParams
static InputParameters validParams()
Definition: TensorMechanicsPlasticModel.C:18
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
TensorMechanicsPlasticJ2::TensorMechanicsPlasticJ2
TensorMechanicsPlasticJ2(const InputParameters &parameters)
Definition: TensorMechanicsPlasticJ2.C:41
TensorMechanicsPlasticJ2::yieldStrength
virtual Real yieldStrength(Real intnl) const
YieldStrength.
Definition: TensorMechanicsPlasticJ2.C:104
TensorMechanicsPlasticJ2
J2 plasticity, associative, with hardning.
Definition: TensorMechanicsPlasticJ2.h:24
TensorMechanicsPlasticJ2.h
TensorMechanicsPlasticJ2::dyieldFunction_dstress
virtual RankTwoTensor dyieldFunction_dstress(const RankTwoTensor &stress, Real intnl) const override
The derivative of yield function with respect to stress.
Definition: TensorMechanicsPlasticJ2.C:57
registerMooseObject
registerMooseObject("TensorMechanicsApp", TensorMechanicsPlasticJ2)
TensorMechanicsPlasticJ2::yieldFunction
virtual Real yieldFunction(const RankTwoTensor &stress, Real intnl) const override
The following functions are what you should override when building single-plasticity models.
Definition: TensorMechanicsPlasticJ2.C:51
TensorMechanicsPlasticJ2::modelName
virtual std::string modelName() const override
Definition: TensorMechanicsPlasticJ2.C:116
TensorMechanicsPlasticJ2::dyieldFunction_dintnl
Real dyieldFunction_dintnl(const RankTwoTensor &stress, Real intnl) const override
The derivative of yield function with respect to the internal parameter.
Definition: TensorMechanicsPlasticJ2.C:67
TensorMechanicsPlasticJ2::consistentTangentOperator
virtual RankFourTensor consistentTangentOperator(const RankTwoTensor &trial_stress, Real intnl_old, const RankTwoTensor &stress, Real intnl, const RankFourTensor &E_ijkl, const std::vector< Real > &cumulative_pm) const override
Calculates a custom consistent tangent operator.
Definition: TensorMechanicsPlasticJ2.C:193
TensorMechanicsPlasticModel::_f_tol
const Real _f_tol
Tolerance on yield function.
Definition: TensorMechanicsPlasticModel.h:175
TensorMechanicsPlasticJ2::validParams
static InputParameters validParams()
Definition: TensorMechanicsPlasticJ2.C:18
TensorMechanicsPlasticJ2::dflowPotential_dintnl
RankTwoTensor dflowPotential_dintnl(const RankTwoTensor &stress, Real intnl) const override
The derivative of the flow potential with respect to the internal parameter.
Definition: TensorMechanicsPlasticJ2.C:97
TensorMechanicsPlasticJ2::dflowPotential_dstress
virtual RankFourTensor dflowPotential_dstress(const RankTwoTensor &stress, Real intnl) const override
The derivative of the flow potential with respect to stress.
Definition: TensorMechanicsPlasticJ2.C:79
TensorMechanicsPlasticJ2::useCustomReturnMap
virtual bool useCustomReturnMap() const override
Returns false. You will want to override this in your derived class if you write a custom returnMap f...
Definition: TensorMechanicsPlasticJ2.C:217
TensorMechanicsHardeningModel::derivative
virtual Real derivative(Real intnl) const
Definition: TensorMechanicsHardeningModel.C:47
TensorMechanicsPlasticJ2::useCustomCTO
virtual bool useCustomCTO() const override
Returns false. You will want to override this in your derived class if you write a custom consistent ...
Definition: TensorMechanicsPlasticJ2.C:223
TensorMechanicsPlasticJ2::_strength
const TensorMechanicsHardeningModel & _strength
yield strength, from user input
Definition: TensorMechanicsPlasticJ2.h:83
TensorMechanicsPlasticModel::returnMap
virtual bool returnMap(const RankTwoTensor &trial_stress, Real intnl_old, const RankFourTensor &E_ijkl, Real ep_plastic_tolerance, RankTwoTensor &returned_stress, Real &returned_intnl, std::vector< Real > &dpm, RankTwoTensor &delta_dp, std::vector< Real > &yf, bool &trial_stress_inadmissible) const
Performs a custom return-map.
Definition: TensorMechanicsPlasticModel.C:221
TensorMechanicsHardeningModel::value
virtual Real value(Real intnl) const
Definition: TensorMechanicsHardeningModel.C:45
RankTwoTensor
RankTwoTensorTempl< Real > RankTwoTensor
Definition: ACGrGrElasticDrivingForce.h:17
TensorMechanicsPlasticModel::consistentTangentOperator
virtual RankFourTensor consistentTangentOperator(const RankTwoTensor &trial_stress, Real intnl_old, const RankTwoTensor &stress, Real intnl, const RankFourTensor &E_ijkl, const std::vector< Real > &cumulative_pm) const
Calculates a custom consistent tangent operator.
Definition: TensorMechanicsPlasticModel.C:254
TensorMechanicsPlasticJ2::_use_custom_cto
const bool _use_custom_cto
Whether to use the custom consistent tangent operator calculation.
Definition: TensorMechanicsPlasticJ2.h:92
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
TensorMechanicsPlasticModel
Plastic Model base class The virtual functions written below must be over-ridden in derived classes t...
Definition: TensorMechanicsPlasticModel.h:42
TensorMechanicsPlasticJ2::_max_iters
const unsigned _max_iters
max iters for custom return map loop
Definition: TensorMechanicsPlasticJ2.h:86
TensorMechanicsPlasticJ2::returnMap
virtual bool returnMap(const RankTwoTensor &trial_stress, Real intnl_old, const RankFourTensor &E_ijkl, Real ep_plastic_tolerance, RankTwoTensor &returned_stress, Real &returned_intnl, std::vector< Real > &dpm, RankTwoTensor &delta_dp, std::vector< Real > &yf, bool &trial_stress_inadmissible) const override
Performs a custom return-map.
Definition: TensorMechanicsPlasticJ2.C:122
RankTwoTensorTempl< Real >
TensorMechanicsPlasticJ2::_use_custom_returnMap
const bool _use_custom_returnMap
Whether to use the custom return-map algorithm.
Definition: TensorMechanicsPlasticJ2.h:89
defineLegacyParams
defineLegacyParams(TensorMechanicsPlasticJ2)
TensorMechanicsPlasticJ2::flowPotential
virtual RankTwoTensor flowPotential(const RankTwoTensor &stress, Real intnl) const override
The flow potential.
Definition: TensorMechanicsPlasticJ2.C:73
RankFourTensor
RankFourTensorTempl< Real > RankFourTensor
Definition: ACGrGrElasticDrivingForce.h:20
TensorMechanicsHardeningModel
Hardening Model base class.
Definition: TensorMechanicsHardeningModel.h:27