www.mooseframework.org
IsotropicPlasticity.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 
10 #include "IsotropicPlasticity.h"
11 
13 
14 #include "PiecewiseLinear.h"
15 
16 registerMooseObject("SolidMechanicsApp", IsotropicPlasticity);
17 
18 template <>
19 InputParameters
21 {
22  InputParameters params = validParams<ReturnMappingModel>();
23  params.addClassDescription("Calculates the stress and plastic strain in the general isotropic "
24  "linear strain hardening plasticity model");
25 
26  // Linear strain hardening parameters
27  params.addParam<Real>("yield_stress", "The point at which plastic strain begins accumulating");
28  params.addParam<FunctionName>("yield_stress_function",
29  "Yield stress as a function of temperature");
30  params.addParam<Real>("hardening_constant", "Hardening slope");
31  params.addParam<FunctionName>("hardening_function",
32  "True stress as a function of plastic strain");
33 
34  return params;
35 }
36 
37 IsotropicPlasticity::IsotropicPlasticity(const InputParameters & parameters)
38  : ReturnMappingModel(parameters, "plastic"),
39  _yield_stress_function(
40  isParamValid("yield_stress_function") ? &getFunction("yield_stress_function") : NULL),
41  _yield_stress(isParamValid("yield_stress") ? getParam<Real>("yield_stress") : 0),
42  _hardening_constant(isParamValid("hardening_constant") ? getParam<Real>("hardening_constant")
43  : 0),
44  _hardening_function(isParamValid("hardening_function") ? dynamic_cast<const PiecewiseLinear *>(
45  &getFunction("hardening_function"))
46  : NULL),
47 
48  _plastic_strain(declareProperty<SymmTensor>("plastic_strain")),
49  _plastic_strain_old(getMaterialPropertyOld<SymmTensor>("plastic_strain")),
50 
51  _hardening_variable(declareProperty<Real>("hardening_variable")),
52  _hardening_variable_old(getMaterialPropertyOld<Real>("hardening_variable"))
53 {
54  if (isParamValid("yield_stress") && _yield_stress <= 0)
55  mooseError("Yield stress must be greater than zero");
56 
57  if (_yield_stress_function == NULL && !isParamValid("yield_stress"))
58  mooseError("Either yield_stress or yield_stress_function must be given");
59 
60  if ((isParamValid("hardening_constant") && isParamValid("hardening_function")) ||
61  (!isParamValid("hardening_constant") && !isParamValid("hardening_function")))
62  mooseError("Either hardening_constant or hardening_function must be defined");
63 
64  if (isParamValid("hardening_function") && !_hardening_function)
65  mooseError("The hardening_function must be PiecewiseLinear");
66 }
67 
68 void
70 {
71  _hardening_variable[_qp] = 0;
73 }
74 
75 void
77  const SymmElasticityTensor & elasticityTensor)
78 {
80  dynamic_cast<const SymmIsotropicElasticityTensor *>(&elasticityTensor);
81  if (!eT)
82  mooseError("IsotropicPlasticity requires a SymmIsotropicElasticityTensor");
83 
86  _yield_condition = effectiveTrialStress - _hardening_variable_old[_qp] - _yield_stress;
89 }
90 
91 void
93 {
94  _plastic_strain[_qp] += plasticStrainIncrement;
95 }
96 
97 Real
98 IsotropicPlasticity::computeResidual(const Real effectiveTrialStress, const Real scalar)
99 {
100  Real residual = 0.0;
101  _hardening_slope = 0.0;
102  if (_yield_condition > 0.0)
103  {
106 
107  // The order here is important. The final term can be small, and we don't want it lost to
108  // roundoff.
109  residual =
110  (effectiveTrialStress - _hardening_variable[_qp] - _yield_stress) / (3.0 * _shear_modulus) -
111  scalar;
112  }
113 
114  return residual;
115 }
116 
117 Real
118 IsotropicPlasticity::computeDerivative(const Real /*effectiveTrialStress*/, const Real /*scalar*/)
119 {
120  Real derivative(1);
121  if (_yield_condition > 0)
122  derivative = -1.0 - _hardening_slope / (3.0 * _shear_modulus);
123 
124  return derivative;
125 }
126 
127 void
129 {
130  if (_yield_condition > 0)
132 }
133 
134 Real
136 {
137  Real hardening = _hardening_variable_old[_qp] + (_hardening_slope * scalar);
139  {
140  const Real strain_old = _effective_inelastic_strain_old[_qp];
141  Point p;
142 
143  hardening = _hardening_function->value(strain_old + scalar, p) - _yield_stress;
144  }
145  return hardening;
146 }
147 
149 {
150  Real slope = _hardening_constant;
152  {
153  const Real strain_old = _effective_inelastic_strain_old[_qp];
154  Point p;
155 
156  slope = _hardening_function->timeDerivative(strain_old, p);
157  }
158  return slope;
159 }
160 
161 void
163 {
165  {
166  Point p;
168  if (_yield_stress <= 0)
169  mooseError("Yield stress must be greater than zero");
170  }
171 }
IsotropicPlasticity::_hardening_variable
MaterialProperty< Real > & _hardening_variable
Definition: IsotropicPlasticity.h:53
IsotropicPlasticity::_yield_condition
Real _yield_condition
Definition: IsotropicPlasticity.h:46
SymmIsotropicElasticityTensor
Defines an Isotropic Elasticity Tensor.
Definition: SymmIsotropicElasticityTensor.h:33
IsotropicPlasticity::computeYieldStress
virtual void computeYieldStress()
Definition: IsotropicPlasticity.C:162
registerMooseObject
registerMooseObject("SolidMechanicsApp", IsotropicPlasticity)
IsotropicPlasticity::computeStressFinalize
virtual void computeStressFinalize(const SymmTensor &plasticStrainIncrement) override
Perform any necessary steps to finalize state after return mapping iterations.
Definition: IsotropicPlasticity.C:92
IsotropicPlasticity::computeResidual
virtual Real computeResidual(const Real effectiveTrialStress, const Real scalar) override
Compute the residual for a predicted value of the scalar.
Definition: IsotropicPlasticity.C:98
IsotropicPlasticity::_hardening_constant
const Real _hardening_constant
Definition: IsotropicPlasticity.h:43
ReturnMappingModel::_effective_inelastic_strain_old
const MaterialProperty< Real > & _effective_inelastic_strain_old
Definition: ReturnMappingModel.h:98
IsotropicPlasticity::_yield_stress_function
const Function * _yield_stress_function
Definition: IsotropicPlasticity.h:41
SymmIsotropicElasticityTensor.h
IsotropicPlasticity::_shear_modulus
Real _shear_modulus
Definition: IsotropicPlasticity.h:47
IsotropicPlasticity::computeDerivative
virtual Real computeDerivative(const Real effectiveTrialStress, const Real scalar) override
Compute the derivative of the residual as a function of the scalar variable.
Definition: IsotropicPlasticity.C:118
validParams< ReturnMappingModel >
InputParameters validParams< ReturnMappingModel >()
Definition: ReturnMappingModel.C:17
IsotropicPlasticity::_yield_stress
Real _yield_stress
Definition: IsotropicPlasticity.h:42
IsotropicPlasticity::computeStressInitialize
virtual void computeStressInitialize(Real effectiveTrialStress, const SymmElasticityTensor &elasticityTensor) override
Perform any necessary initialization before return mapping iterations.
Definition: IsotropicPlasticity.C:76
IsotropicPlasticity::_hardening_variable_old
const MaterialProperty< Real > & _hardening_variable_old
Definition: IsotropicPlasticity.h:54
IsotropicPlasticity::_plastic_strain_old
const MaterialProperty< SymmTensor > & _plastic_strain_old
Definition: IsotropicPlasticity.h:51
IsotropicPlasticity::_plastic_strain
MaterialProperty< SymmTensor > & _plastic_strain
Definition: IsotropicPlasticity.h:50
SymmElasticityTensor
This class defines a basic set of capabilities any elasticity tensor should have.
Definition: SymmElasticityTensor.h:55
IsotropicPlasticity::IsotropicPlasticity
IsotropicPlasticity(const InputParameters &parameters)
Definition: IsotropicPlasticity.C:37
IsotropicPlasticity.h
ReturnMappingModel
Base class for models that perform return mapping iterations to compute stress.
Definition: ReturnMappingModel.h:26
IsotropicPlasticity
Definition: IsotropicPlasticity.h:21
IsotropicPlasticity::iterationFinalize
virtual void iterationFinalize(Real scalar) override
Finalize internal state variables for a model for a given iteration.
Definition: IsotropicPlasticity.C:128
ReturnMappingModel::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: ReturnMappingModel.C:47
IsotropicPlasticity::computeHardeningValue
virtual Real computeHardeningValue(Real scalar)
Definition: IsotropicPlasticity.C:135
validParams< IsotropicPlasticity >
InputParameters validParams< IsotropicPlasticity >()
Definition: IsotropicPlasticity.C:20
IsotropicPlasticity::_hardening_slope
Real _hardening_slope
Definition: IsotropicPlasticity.h:48
SymmTensor
Definition: SymmTensor.h:21
ConstitutiveModel::_temperature
const VariableValue & _temperature
Definition: ConstitutiveModel.h:50
IsotropicPlasticity::_hardening_function
const PiecewiseLinear *const _hardening_function
Definition: IsotropicPlasticity.h:44
SymmIsotropicElasticityTensor::shearModulus
Real shearModulus() const
Return the shear modulus...
Definition: SymmIsotropicElasticityTensor.C:69
IsotropicPlasticity::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: IsotropicPlasticity.C:69
IsotropicPlasticity::computeHardeningDerivative
virtual Real computeHardeningDerivative(Real scalar)
Definition: IsotropicPlasticity.C:148