Skip to content

Commit d9e39b0

Browse files
authored
Fixes for heat /0 cases for rate dependent hardening models (#168)
1 parent 09539f1 commit d9e39b0

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

src/materials/hardening_models/JohnsonCookHardening.C

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ JohnsonCookHardening::plasticEnergy(const ADReal & ep, const unsigned int deriva
103103

104104
if (derivative == 1)
105105
{
106-
return (1 - _tqf) * _sigma_0[_qp] * (_A[_qp] + _B * std::pow(ep / _ep0, _n)) *
106+
return _gp[_qp] * (1 - _tqf) * _sigma_0[_qp] * (_A[_qp] + _B * std::pow(ep / _ep0, _n)) *
107107
temperatureDependence();
108108
}
109109
if (derivative == 2)
110110
{
111-
return (1 - _tqf) * _sigma_0[_qp] * _B * std::pow(ep / _ep0, _n - 1) * _n / _ep0 *
111+
return _gp[_qp] * (1 - _tqf) * _sigma_0[_qp] * _B * std::pow(ep / _ep0, _n - 1) * _n / _ep0 *
112112
temperatureDependence();
113113
}
114114
mooseError(name(), "internal error: unsupported derivative order.");
@@ -119,6 +119,9 @@ JohnsonCookHardening::plasticDissipation(const ADReal & delta_ep,
119119
const ADReal & ep,
120120
const unsigned int derivative)
121121
{
122+
// For all cases, we are splitting between rate dependent and non rate dependent portions to avoid
123+
// /0 errors
124+
122125
ADReal result = 0;
123126

124127
if (derivative == 0)
@@ -146,7 +149,7 @@ JohnsonCookHardening::plasticDissipation(const ADReal & delta_ep,
146149
_B * std::pow(ep / _ep0, _n - 1) * _n / _ep0 * _C * std::log(delta_ep / _dt / _epdot0);
147150
}
148151

149-
return result * _sigma_0[_qp] * temperatureDependence();
152+
return _gp[_qp] * result * _sigma_0[_qp] * temperatureDependence();
150153

151154
mooseError(name(), "internal error: unsupported derivative order.");
152155
}
@@ -155,6 +158,7 @@ ADReal // Thermal conjugate term
155158
JohnsonCookHardening::thermalConjugate(const ADReal & ep)
156159
{
157160

158-
return _T[_qp] * (1 - _tqf) * _sigma_0[_qp] * (_A[_qp] + _B * std::pow(ep / _ep0, _n)) *
161+
return _gp[_qp] * _T[_qp] * (1 - _tqf) * _sigma_0[_qp] *
162+
(_A[_qp] + _B * std::pow(ep / _ep0, _n)) *
159163
(_m * (std::pow((_T0 - _T[_qp]) / (_T0 - _Tm), _m))) / (_T0 - _T[_qp]);
160164
}

src/materials/large_deformation_models/LargeDeformationJ2Plasticity.C

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,29 @@ LargeDeformationJ2Plasticity::updateState(ADRankTwoTensor & stress, ADRankTwoTen
4444
returnMappingSolve(stress_dev_norm, delta_ep, _console);
4545

4646
_ep[_qp] = _ep_old[_qp] + delta_ep;
47+
48+
// Avoiding /0 issues for rate dependent models
49+
_ep[_qp] = (_ep[_qp] == 0) ? 1e-20 : _ep[_qp];
50+
4751
ADRankTwoTensor delta_Fp = RaccoonUtils::exp(delta_ep * _Np[_qp]);
4852
_Fp[_qp] = delta_Fp * _Fp_old[_qp];
4953

5054
// Update stress and energy
5155
Fe = Fe * delta_Fp.inverse();
5256
stress = _elasticity_model->computeCauchyStress(Fe);
57+
5358
_hardening_model->plasticEnergy(_ep[_qp]);
59+
_hardening_model->plasticDissipation(delta_ep, _ep[_qp], 0);
5460

55-
_heat[_qp] = _hardening_model->plasticDissipation(delta_ep, _ep[_qp], 1) * delta_ep / _dt;
61+
// Avoiding NaN issues for rate depedent models
62+
if (_t_step > 0)
63+
{
64+
_heat[_qp] = _hardening_model->plasticDissipation(delta_ep, _ep[_qp], 1) * delta_ep / _dt;
5665

57-
_heat[_qp] += _hardening_model->thermalConjugate(_ep[_qp]) * delta_ep / _dt;
66+
_heat[_qp] += _hardening_model->thermalConjugate(_ep[_qp]) * delta_ep / _dt;
67+
}
68+
else
69+
_heat[_qp] = 0;
5870
}
5971

6072
Real
@@ -71,21 +83,31 @@ ADReal
7183
LargeDeformationJ2Plasticity::computeResidual(const ADReal & effective_trial_stress,
7284
const ADReal & delta_ep)
7385
{
86+
ADReal ep = _ep_old[_qp] + delta_ep;
87+
88+
// Avoiding /0 errors for rate depedent models
89+
ep = (ep == 0) ? 1e-20 : ep;
90+
7491
return effective_trial_stress -
7592
_elasticity_model
7693
->computeMandelStress(delta_ep * _Np[_qp],
7794
/*plasticity_update = */ true)
7895
.doubleContraction(_Np[_qp]) -
79-
_hardening_model->plasticEnergy(_ep_old[_qp] + delta_ep, 1) -
80-
_hardening_model->plasticDissipation(delta_ep, _ep_old[_qp] + delta_ep, 1);
96+
_hardening_model->plasticEnergy(ep, 1) -
97+
_hardening_model->plasticDissipation(delta_ep, ep, 1);
8198
}
8299

83100
ADReal
84101
LargeDeformationJ2Plasticity::computeDerivative(const ADReal & /*effective_trial_stress*/,
85102
const ADReal & delta_ep)
86103
{
104+
ADReal ep = _ep_old[_qp] + delta_ep;
105+
if (ep == 0)
106+
{
107+
ep = 1e-20;
108+
}
87109
return -_elasticity_model->computeMandelStress(_Np[_qp], /*plasticity_update = */ true)
88110
.doubleContraction(_Np[_qp]) -
89-
_hardening_model->plasticEnergy(_ep_old[_qp] + delta_ep, 2) -
90-
_hardening_model->plasticDissipation(delta_ep, _ep_old[_qp] + delta_ep, 2);
111+
_hardening_model->plasticEnergy(ep, 2) -
112+
_hardening_model->plasticDissipation(delta_ep, ep, 2);
91113
}

0 commit comments

Comments
 (0)