19 template <ComputeStage compute_stage>
24 params.addClassDescription(
"This class uses the discrete material in a radial return isotropic "
25 "plasticity model. This class is one of the basic radial return "
26 "constitutive models, yet it can be used in conjunction with other "
27 "creep and plasticity materials for more complex simulations.");
29 params.addParam<FunctionName>(
"yield_stress_function",
30 "Yield stress as a function of temperature");
31 params.addParam<Real>(
32 "yield_stress", 0.0,
"The point at which plastic strain begins accumulating");
33 params.addParam<FunctionName>(
"hardening_function",
34 "True stress as a function of plastic strain");
35 params.addParam<Real>(
"hardening_constant", 0.0,
"Hardening slope");
36 params.addCoupledVar(
"temperature", 0.0,
"Coupled Temperature");
37 params.addDeprecatedParam<std::string>(
40 "String that is prepended to the plastic_strain Material Property",
41 "This has been replaced by the 'base_name' parameter");
42 params.set<std::string>(
"effective_inelastic_strain_name") =
"effective_plastic_strain";
46 template <ComputeStage compute_stage>
48 const InputParameters & parameters)
50 _plastic_prepend(getParam<std::string>(
"plastic_prepend")),
51 _yield_stress_function(
52 isParamValid(
"yield_stress_function") ? &getFunction(
"yield_stress_function") : NULL),
53 _yield_stress(getParam<Real>(
"yield_stress")),
54 _hardening_constant(getParam<Real>(
"hardening_constant")),
55 _hardening_function(isParamValid(
"hardening_function") ? &getFunction(
"hardening_function")
57 _yield_condition(-1.0),
58 _hardening_slope(0.0),
60 declareADProperty<
RankTwoTensor>(_base_name + _plastic_prepend +
"plastic_strain")),
62 getMaterialPropertyOld<
RankTwoTensor>(_base_name + _plastic_prepend +
"plastic_strain")),
63 _hardening_variable(declareADProperty<Real>(_base_name +
"hardening_variable")),
64 _hardening_variable_old(getMaterialPropertyOld<Real>(_base_name +
"hardening_variable")),
65 _temperature(adCoupledValue(
"temperature"))
67 if (parameters.isParamSetByUser(
"yield_stress") &&
_yield_stress <= 0.0)
68 mooseError(
"Yield stress must be greater than zero");
71 mooseError(
"Either yield_stress or yield_stress_function must be given");
73 if (!parameters.isParamSetByUser(
"hardening_constant") && !isParamValid(
"hardening_function"))
74 mooseError(
"Either hardening_constant or hardening_function must be defined");
76 if (parameters.isParamSetByUser(
"hardening_constant") && isParamValid(
"hardening_function"))
78 "Only the hardening_constant or only the hardening_function can be defined but not both");
81 template <ComputeStage compute_stage>
85 _hardening_variable[_qp] = 0.0;
86 _plastic_strain[_qp].zero();
89 template <ComputeStage compute_stage>
93 _hardening_variable[_qp] = _hardening_variable_old[_qp];
94 _plastic_strain[_qp] = _plastic_strain_old[_qp];
96 propagateQpStatefulPropertiesRadialReturn();
99 template <ComputeStage compute_stage>
102 const ADReal & effective_trial_stress,
const ADRankFourTensor & elasticity_tensor)
104 computeYieldStress(elasticity_tensor);
106 _yield_condition = effective_trial_stress - _hardening_variable_old[_qp] - _yield_stress;
107 _hardening_variable[_qp] = _hardening_variable_old[_qp];
108 _plastic_strain[_qp] = _plastic_strain_old[_qp];
111 template <ComputeStage compute_stage>
114 const ADReal & effective_trial_stress,
const ADReal & scalar)
116 ADReal residual = 0.0;
118 mooseAssert(_yield_condition != -1.0,
119 "the yield stress was not updated by computeStressInitialize");
121 if (_yield_condition > 0.0)
123 _hardening_slope = computeHardeningDerivative(scalar);
124 _hardening_variable[_qp] = computeHardeningValue(scalar);
127 (effective_trial_stress - _hardening_variable[_qp] - _yield_stress) / _three_shear_modulus -
133 template <ComputeStage compute_stage>
136 const ADReal & ,
const ADReal & )
138 if (_yield_condition > 0.0)
139 return -1.0 - _hardening_slope / _three_shear_modulus;
144 template <ComputeStage compute_stage>
148 if (_yield_condition > 0.0)
149 _hardening_variable[_qp] = computeHardeningValue(scalar);
152 template <ComputeStage compute_stage>
155 const ADRankTwoTensor & plastic_strain_increment)
157 _plastic_strain[_qp] += plastic_strain_increment;
160 template <ComputeStage compute_stage>
164 if (_hardening_function)
166 const Real strain_old = _effective_inelastic_strain_old[_qp];
168 const Real t = strain_old + MetaPhysicL::raw_value(scalar);
170 return _hardening_function->value(t, p) - _yield_stress;
173 return _hardening_variable_old[_qp] + _hardening_slope * scalar;
180 if (_hardening_function)
182 const Real strain_old = _effective_inelastic_strain_old[_qp];
184 const Real t = strain_old + MetaPhysicL::raw_value(scalar);
186 DualReal hardening_function_value = _hardening_function->value(t, p);
187 hardening_function_value.derivatives() =
188 (strain_old + scalar).derivatives() * _hardening_function->timeDerivative(t, p);
190 return hardening_function_value - _yield_stress;
193 return _hardening_variable_old[_qp] + _hardening_slope * scalar;
196 template <ComputeStage compute_stage>
201 if (_hardening_function)
203 const Real strain_old = _effective_inelastic_strain_old[_qp];
206 return _hardening_function->timeDerivative(strain_old, p);
209 return _hardening_constant;
212 template <ComputeStage compute_stage>
215 const ADRankFourTensor & )
217 if (_yield_stress_function)
220 _yield_stress = _yield_stress_function->value(MetaPhysicL::raw_value(_temperature[_qp]), p);
221 if (_yield_stress <= 0.0)
223 "In ", _name,
": The calculated yield stress (", _yield_stress,
") is less than zero");
232 if (_yield_stress_function)
236 _yield_stress = _yield_stress_function->value(MetaPhysicL::raw_value(_temperature[_qp]), p);
237 _yield_stress.derivatives() =
238 _temperature[_qp].derivatives() *
239 _yield_stress_function->timeDerivative(MetaPhysicL::raw_value(_temperature[_qp]), p);
241 if (_yield_stress <= 0.0)
242 mooseException(
"In ",
244 ": The calculated yield stress (",
245 _yield_stress.value(),
246 ") is less than zero");