www.mooseframework.org
IsotropicPlasticityStressUpdate.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 #include "Function.h"
10 #include "ElasticityTensorTools.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<RadialReturnStressUpdate>();
17  params.addClassDescription("This class uses the discrete material in a radial return isotropic "
18  "plasticity model. This class is one of the basic radial return "
19  "constitutive models, yet it can be used in conjunction with other "
20  "creep and plasticity materials for more complex simulations.");
21  // Linear strain hardening parameters
22  params.addParam<FunctionName>("yield_stress_function",
23  "Yield stress as a function of temperature");
24  params.addParam<Real>(
25  "yield_stress", 0.0, "The point at which plastic strain begins accumulating");
26  params.addParam<FunctionName>("hardening_function",
27  "True stress as a function of plastic strain");
28  params.addParam<Real>("hardening_constant", 0.0, "Hardening slope");
29  params.addCoupledVar("temperature", 0.0, "Coupled Temperature");
30  params.addParam<std::string>(
31  "plastic_prepend", "", "String that is prepended to the plastic_strain Material Property");
32 
33  return params;
34 }
35 
37  : RadialReturnStressUpdate(parameters, "plastic"),
38  _plastic_prepend(getParam<std::string>("plastic_prepend")),
39  _yield_stress_function(
40  isParamValid("yield_stress_function") ? &getFunction("yield_stress_function") : NULL),
41  _yield_stress(getParam<Real>("yield_stress")),
42  _hardening_constant(getParam<Real>("hardening_constant")),
43  _hardening_function(isParamValid("hardening_function") ? &getFunction("hardening_function")
44  : NULL),
45  _yield_condition(-1.0), // set to a non-physical value to catch uninitalized yield condition
46  _hardening_slope(0.0),
47  _plastic_strain(declareProperty<RankTwoTensor>(_plastic_prepend + "plastic_strain")),
48  _plastic_strain_old(getMaterialPropertyOld<RankTwoTensor>(_plastic_prepend + "plastic_strain")),
49  _hardening_variable(declareProperty<Real>("hardening_variable")),
50  _hardening_variable_old(getMaterialPropertyOld<Real>("hardening_variable")),
51  _temperature(coupledValue("temperature"))
52 {
53  if (parameters.isParamSetByUser("yield_stress") && _yield_stress <= 0.0)
54  mooseError("Yield stress must be greater than zero");
55 
56  if (_yield_stress_function == NULL && !parameters.isParamSetByUser("yield_stress"))
57  mooseError("Either yield_stress or yield_stress_function must be given");
58 
59  if (!parameters.isParamSetByUser("hardening_constant") && !isParamValid("hardening_function"))
60  mooseError("Either hardening_constant or hardening_function must be defined");
61 
62  if (parameters.isParamSetByUser("hardening_constant") && isParamValid("hardening_function"))
63  mooseError(
64  "Only the hardening_constant or only the hardening_function can be defined but not both");
65 }
66 
67 void
69 {
70  _hardening_variable[_qp] = 0.0;
71  _plastic_strain[_qp].zero();
72 }
73 
74 void
76 {
79 
81 }
82 
83 void
85  const RankFourTensor & elasticity_tensor)
86 {
87  computeYieldStress(elasticity_tensor);
88 
89  _yield_condition = effective_trial_stress - _hardening_variable_old[_qp] - _yield_stress;
92 }
93 
94 Real
95 IsotropicPlasticityStressUpdate::computeResidual(const Real effective_trial_stress,
96  const Real scalar)
97 {
98  Real residual = 0.0;
99 
100  mooseAssert(_yield_condition != -1.0,
101  "the yield stress was not updated by computeStressInitialize");
102 
103  if (_yield_condition > 0.0)
104  {
107 
108  residual =
109  (effective_trial_stress - _hardening_variable[_qp] - _yield_stress) / _three_shear_modulus -
110  scalar;
111  }
112  return residual;
113 }
114 
115 Real
116 IsotropicPlasticityStressUpdate::computeDerivative(const Real /*effective_trial_stress*/,
117  const Real /*scalar*/)
118 {
119  Real derivative = 1.0;
120  if (_yield_condition > 0.0)
121  derivative = -1.0 - _hardening_slope / _three_shear_modulus;
122 
123  return derivative;
124 }
125 
126 void
128 {
129  if (_yield_condition > 0.0)
131 }
132 
133 void
134 IsotropicPlasticityStressUpdate::computeStressFinalize(const RankTwoTensor & plasticStrainIncrement)
135 {
136  _plastic_strain[_qp] += plasticStrainIncrement;
137 }
138 
139 Real
141 {
142  Real value = _hardening_variable_old[_qp] + (_hardening_slope * scalar);
144  {
145  const Real strain_old = _effective_inelastic_strain_old[_qp];
146  Point p;
147 
148  value = _hardening_function->value(strain_old + scalar, p) - _yield_stress;
149  }
150  return value;
151 }
152 
154 {
155  Real slope = _hardening_constant;
157  {
158  const Real strain_old = _effective_inelastic_strain_old[_qp];
159  Point p; // Always (0,0,0)
160 
161  slope = _hardening_function->timeDerivative(strain_old, p);
162  }
163  return slope;
164 }
165 
166 void
167 IsotropicPlasticityStressUpdate::computeYieldStress(const RankFourTensor & /*elasticity_tensor*/)
168 {
170  {
171  Point p;
173  if (_yield_stress <= 0.0)
174  mooseError("The yield stress must be greater than zero, but during the simulation your yield "
175  "stress became less than zero.");
176  }
177 }
const MaterialProperty< Real > & _effective_inelastic_strain_old
virtual Real computeResidual(const Real effective_trial_stress, const Real scalar) override
Compute the residual for a predicted value of the scalar.
virtual Real computeDerivative(const Real effective_trial_stress, const Real scalar) override
Compute the derivative of the residual as a function of the scalar variable.
RadialReturnStressUpdate computes the radial return stress increment for an isotropic viscoplasticity...
const MaterialProperty< Real > & _hardening_variable_old
virtual void iterationFinalize(Real scalar) override
Finalize internal state variables for a model for a given iteration.
InputParameters validParams< RadialReturnStressUpdate >()
IsotropicPlasticityStressUpdate(const InputParameters &parameters)
virtual void computeStressFinalize(const RankTwoTensor &plasticStrainIncrement) override
Perform any necessary steps to finalize state after return mapping iterations.
const MaterialProperty< RankTwoTensor > & _plastic_strain_old
old value of plastic strain
virtual void propagateQpStatefulProperties() override
If updateState is not called during a timestep, this will be.
void propagateQpStatefulPropertiesRadialReturn()
Propagate the properties pertaining to this intermediate class.
virtual void computeYieldStress(const RankFourTensor &elasticity_tensor)
virtual Real computeHardeningDerivative(Real scalar)
virtual void computeStressInitialize(const Real effective_trial_stress, const RankFourTensor &elasticity_tensor) override
Perform any necessary initialization before return mapping iterations.
InputParameters validParams< IsotropicPlasticityStressUpdate >()
MaterialProperty< RankTwoTensor > & _plastic_strain
plastic strain in this model
Real _three_shear_modulus
3 * shear modulus