Skip to content

Commit

Permalink
[EDZ permeabillity] Avoid stress=0 in the principle stress calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqing committed Jul 24, 2019
1 parent 39c61e2 commit 63a8752
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions FEM/Material/Solid/StressAuxiliaryFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <algorithm>
#include <cmath>
#include <limits>

namespace SolidProp
{
Expand Down Expand Up @@ -57,6 +58,16 @@ double* getPrincipleStresses(double const* const s,
- s23 * s23 * s11 - s13 * s13 * s22
- s12 * s12 * s33;

if ((std::fabs(I1) < std::numeric_limits<double>::epsilon() &&
std::fabs(I2) < std::numeric_limits<double>::epsilon()) ||
std::fabs(I1 * I1 - 3.0 * I2) < std::numeric_limits<double>::epsilon()
)
{
for (int k=0; k<3; k++)
principle_stress[k] = s[k];
return principle_stress;
}

const double cos_a =
std::min(std::max(0.5 * (2 * I1 * I1 * I1 - 9. * I1 * I2 + 27.0 * I3) /
std::pow(I1 * I1 - 3.0 * I2, 1.5),
Expand Down
1 change: 1 addition & 0 deletions FEM/rf_mmp_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file)
_damage_zone_permeability =
new PorousMediumProperty::DamageZonePermeability(a, b);
in.clear();
ScreenMessage("DAMAGE_ZONE_PERMEABILITY is used.\n");
continue;
}
//------------------------------------------------------------------------
Expand Down

0 comments on commit 63a8752

Please sign in to comment.