Skip to content

Commit

Permalink
Fix energy calculation in gradient model
Browse files Browse the repository at this point in the history
  • Loading branch information
srosenbu committed Oct 4, 2023
1 parent ece1574 commit 8195158
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/comfe/cdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"ExplicitMechanicsSolver",
"CDM3D",
"CDMPlaneStrain",
"CDMUniaxialStrain",
"CDMNonlocalMechanics",
"CDMSolver",
"NonlocalInterface",
Expand Down
6 changes: 2 additions & 4 deletions src/gradient_jh2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ impl ConstitutiveModel for GradientJH23D {
d_eps_vol_pl = d_eps_vol - (p_damaged - p_0) / (self.parameters.K1 * del_t);
p_damaged
}
//d_eps_vol_pl = d_eps_vol - (p_damaged - p_0) / (self.parameters.K1 * del_t);
//(self.parameters.K1 * mu).max(-self.parameters.T * (1. - damage_1))
}
};
if damage_1 > damage_0 {
Expand Down Expand Up @@ -181,7 +179,7 @@ impl ConstitutiveModel for GradientJH23D {

if output.is_some(Q::InternalPlasticEnergy) && input.is_some(Q::InternalPlasticEnergy) {
let s_mid = 0.5 * (s_0 + s_1);
let p_mid = 0.5 * (p_0 + p_1);
let p_mid = - 0.5 * (p_0 + p_1);
let density_mid = 0.5 * (density_0 + density_1);
let deviatoric_rate = d_eps_dev * (1.-alpha);
let e_0 = input.get_scalar(Q::InternalPlasticEnergy, ip);
Expand All @@ -190,7 +188,7 @@ impl ConstitutiveModel for GradientJH23D {
}
if output.is_some(Q::InternalElasticEnergy) && input.is_some(Q::InternalElasticEnergy) {
let s_mid = 0.5 * (s_0 + s_1);
let p_mid = 0.5 * (p_0 + p_1);
let p_mid = - 0.5 * (p_0 + p_1);
let density_mid = 0.5 * (density_0 + density_1);
let deviatoric_rate = d_eps_dev * alpha;
let e_0 = input.get_scalar(Q::InternalElasticEnergy, ip);
Expand Down

0 comments on commit 8195158

Please sign in to comment.