@@ -44,17 +44,29 @@ LargeDeformationJ2Plasticity::updateState(ADRankTwoTensor & stress, ADRankTwoTen
44
44
returnMappingSolve (stress_dev_norm , delta_ep , _console );
45
45
46
46
_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
+
47
51
ADRankTwoTensor delta_Fp = RaccoonUtils ::exp (delta_ep * _Np [_qp ]);
48
52
_Fp [_qp ] = delta_Fp * _Fp_old [_qp ];
49
53
50
54
// Update stress and energy
51
55
Fe = Fe * delta_Fp .inverse ();
52
56
stress = _elasticity_model -> computeCauchyStress (Fe );
57
+
53
58
_hardening_model -> plasticEnergy (_ep [_qp ]);
59
+ _hardening_model -> plasticDissipation (delta_ep , _ep [_qp ], 0 );
54
60
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 ;
56
65
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 ;
58
70
}
59
71
60
72
Real
@@ -71,21 +83,31 @@ ADReal
71
83
LargeDeformationJ2Plasticity ::computeResidual (const ADReal & effective_trial_stress ,
72
84
const ADReal & delta_ep )
73
85
{
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
+
74
91
return effective_trial_stress -
75
92
_elasticity_model
76
93
-> computeMandelStress (delta_ep * _Np [_qp ],
77
94
/*plasticity_update = */ true)
78
95
.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 );
81
98
}
82
99
83
100
ADReal
84
101
LargeDeformationJ2Plasticity ::computeDerivative (const ADReal & /*effective_trial_stress*/ ,
85
102
const ADReal & delta_ep )
86
103
{
104
+ ADReal ep = _ep_old [_qp ] + delta_ep ;
105
+ if (ep == 0 )
106
+ {
107
+ ep = 1e-20 ;
108
+ }
87
109
return - _elasticity_model -> computeMandelStress (_Np [_qp ], /*plasticity_update = */ true)
88
110
.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 );
91
113
}
0 commit comments