Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A permeability model for the excavation damage zone #149

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Binary file added DOC/PermeabilityDamageZone.pdf
Binary file not shown.
14 changes: 10 additions & 4 deletions FEM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ set( HEADERS
Material/Fluid/GibbsFreeEnergy/DimensionLessGibbsFreeEnergyRegion1.h
Material/Fluid/Density/WaterDensityIAPWSIF97Region1.h
Material/Fluid/Viscosity/WaterViscosityIAPWS.h
Material/Solid/BGRaCreep.h
)

set( SOURCES
Expand Down Expand Up @@ -116,15 +115,22 @@ set( SOURCES
ShapeFunctionPool.cpp
Material/Fluid/GibbsFreeEnergy/DimensionLessGibbsFreeEnergyRegion1.cpp
Material/Fluid/Viscosity/WaterViscosityIAPWS.cpp
Material/Solid/BGRaCreep.cpp
)

# Get all files in the sub-directory
FILE(GLOB MAT_SOLID_H RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Material/Solid/*.h)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not move Material dir out of FEM dir?

FILE(GLOB MAT_SOLID_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Material/Solid/*.cpp)

FILE(GLOB MAT_PORO_H RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Material/PorousMedium/*.h)
FILE(GLOB MAT_PORO_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Material/PorousMedium/*.cpp)

set( HEADERS ${HEADERS} ${MAT_SOLID_H} ${MAT_PORO_H})
set( SOURCES ${SOURCES} ${MAT_SOLID_CPP} ${MAT_PORO_CPP})

if(NOT OGS_LSOLVER STREQUAL PETSC)
set( SOURCES ${SOURCES} par_ddc.h par_ddc.cpp)
endif()



if(OGS_LSOLVER STREQUAL RF)
set( HEADERS ${HEADERS} solver.h matrix_routines.h)
set( SOURCES ${SOURCES} solver.cpp matrix_routines.cpp)
Expand Down
39 changes: 39 additions & 0 deletions FEM/Material/PorousMedium/DamageZonePermeability.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file DamageZonePermeability.cpp
*
* Created on February 6, 2019, 3:25 PM
*
*/

#include "DamageZonePermeability.h"

#include <cmath>

#include "Material/Solid/MohrCoulombFailureCriterion.h"
namespace PorousMediumProperty
{
void DamageZonePermeability::computeDamageZonePermeability(
double* intrinsic_permeability,
SolidProp::MohrCoulombFailureCriterion const& failure_criterion,
double const* const stress, const int dim)
{
const int n_stresses = (dim == 3) ? 6 : 4;
const double failure_index =
failure_criterion.getFailureIndex(stress, n_stresses);

if (failure_index < 1.0)
return;

const double extra_k = _a * std::exp(_b * failure_index);
for (int i = 0; i < dim; i++)
{
intrinsic_permeability[i * dim + i] += extra_k;
}
}
} // End of the namespace
54 changes: 54 additions & 0 deletions FEM/Material/PorousMedium/DamageZonePermeability.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file DamageZonePermeability.h
*
* Created on February 6, 2019, 3:25 PM
*
*/

#pragma once
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace this


namespace SolidProp
{
class MohrCoulombFailureCriterion;
}
namespace PorousMediumProperty
{
/**
* Permeability model for damage zone, which is determined by the Mohr-Coulomb
* failure index as
* \f$ k=k_0 + a \mbox{e}^{b\,f} \f$
* where \f$k_0\f$ is the intrinsic permeability, \f$a\f$ and \f$b\f$ are
* coefficient, and \f$ f \f$ is the failure index.
*/
class DamageZonePermeability
{
public:
DamageZonePermeability(const double a, const double b) : _a(a), _b(b) {}
/**
*
* @param intrinsic_permeability Passed in as intrinsic permeability
* tensor, and passed out the modification of
* intrinsic permeability with damage zone
* model.
* @param failure_criterion Failure criterion.
* @param stress Stress tensor.
* @param dim Dimension of the intrinsic permeability
* tensor.
*/
void computeDamageZonePermeability(
double* intrinsic_permeability,
SolidProp::MohrCoulombFailureCriterion const& failure_criterion,
double const* const stress,
const int dim);

private:
const double _a; /// Coefficient a
const double _b; /// Coefficient a
};
} // End of the namespace
29 changes: 6 additions & 23 deletions FEM/Material/Solid/BGRaCreep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,17 @@
#include <cmath>
#include <limits>

#include "PhysicalConstant.h"
#include "LinAlg/GaussAlgorithm.h"
#include "rf_msp_new.h"

#include "display.h"

namespace SolidProp
{
void getDeviatoricStess(double const* const stress,
const int nstress_components, double* s)
{
for (int i = 0; i < nstress_components; i++)
s[i] = stress[i];
#include "LinAlg/GaussAlgorithm.h"
#include "PhysicalConstant.h"
#include "rf_msp_new.h"

const double mean_stress = (stress[0] + stress[1] + stress[2]) / 3.0;
for (int i = 0; i < 3; i++)
s[i] -= mean_stress;
}
#include "StressAuxiliaryFunctions.h"

double getStressNorm(double const* const s, const int nstress_components)
namespace SolidProp
{
double ns = 0.0;
for (int i = 0; i < 3; i++)
ns += s[i] * s[i];
for (int i = 3; i < nstress_components; i++)
ns += 2.0 * s[i] * s[i];
return std::sqrt(ns);
}

double getCreepConstantCoefficient(const double A, const double n,
const double sigma0)
{
Expand Down
51 changes: 51 additions & 0 deletions FEM/Material/Solid/MohrCoulombFailureCriterion.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file MohrCoulombFailureCriterion.cpp
*
* Created on February 6, 2019, 1:40 PM
*
*/

#include "MohrCoulombFailureCriterion.h"

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

#include "StressAuxiliaryFunctions.h"

namespace SolidProp
{
MohrCoulombFailureCriterion::MohrCoulombFailureCriterion(const double c,
const double angle)
: _c(c), _angle(angle * pi / 180.0)
{
}

double MohrCoulombFailureCriterion::getFailureIndex(
double const* const s, const int nstress_components) const
{
double const* const principle_stresses =
getPrincipleStresses(s, nstress_components);

double s_min = std::numeric_limits<double>::max();
double s_max = -std::numeric_limits<double>::max();

for (int i = 0; i < 3; i++)
{
s_max = std::max(s_max, principle_stresses[i]);
s_min = std::min(s_min, principle_stresses[i]);
}

const double tau_max = 0.5 * std::abs(s_max - s_min);
const double s_n = -0.5 * (s_max + s_min) / std::cos(_angle);

return tau_max / (_c + s_n * std::tan(_angle));
}

} // end of namespace
37 changes: 37 additions & 0 deletions FEM/Material/Solid/MohrCoulombFailureCriterion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file MohrCoulombFailureCriterion.h
*
* Created on February 6, 2019, 1:40 PM
*
*/

#pragma once

namespace SolidProp
{
class MohrCoulombFailureCriterion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think WX has already implemented MohrCoulomb stuff. Isn't it possible to reuse it?

{
public:
MohrCoulombFailureCriterion(const double c, const double angle);

/**
*
* @param s Stress.
* @param nstress_components Number of stress components.
* @return
*/
double getFailureIndex(double const* const s,
const int nstress_components) const;

private:
const double _c; /// apparent cohesion.
const double _angle; /// The angle of internal friction.
};

} // end of namespace
88 changes: 88 additions & 0 deletions FEM/Material/Solid/StressAuxiliaryFunctions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file StressAuxiliaryFunctions.cpp
*
* Created on February 6, 2019, 12:08 PM
*
*/

#include "StressAuxiliaryFunctions.h"

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

namespace SolidProp
{
void getDeviatoricStess(double const* const stress,
const int nstress_components, double* s)
{
for (int i = 0; i < nstress_components; i++)
s[i] = stress[i];

const double mean_stress = (stress[0] + stress[1] + stress[2]) / 3.0;
for (int i = 0; i < 3; i++)
s[i] -= mean_stress;
}

double getStressNorm(double const* const s, const int nstress_components)
{
double ns = 0.0;
for (int i = 0; i < 3; i++)
ns += s[i] * s[i];
for (int i = 3; i < nstress_components; i++)
ns += 2.0 * s[i] * s[i];
return std::sqrt(ns);
}

double* getPrincipleStresses(double const* const s,
const int nstress_components)
{
static double principle_stress[3];
const double s11 = s[0];
const double s22 = s[1];
const double s33 = s[2];
const double s12 = s[3];
const double s13 = (nstress_components == 6) ? s[4] : 0.0;
const double s23 = (nstress_components == 6) ? s[5] : 0.0;

const double I1 = s11 + s22 + s33;
const double I2 = s11 * s22 + s22 * s33 + s33 * s11 - s12 * s12
- s13 * s13 - s23 * s23;
const double I3 = s11 * s22 * s33 + 2 * s12 * s23 * s13
- 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),
-1.0),
1.0);

const double alpha = std::acos(cos_a) / 3.0;
const double I1_d3 = I1 / 3.0;
const double fac = 2. * std::sqrt(I1 * I1 - 3 * I2) / 3.0;

principle_stress[0] = I1_d3 + fac * std::cos(alpha);
principle_stress[1] = I1_d3 + fac * std::cos(alpha - 2.0 * pi / 3.0);
principle_stress[2] = I1_d3 + fac * std::cos(alpha - 4.0 * pi / 3.0);

return principle_stress;
}

} // namespace SolidProp
28 changes: 28 additions & 0 deletions FEM/Material/Solid/StressAuxiliaryFunctions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file StressAuxiliaryFunctions.h
*
* Created on February 6, 2019, 12:08 PM
*
*/

#pragma once

namespace SolidProp
{
void getDeviatoricStess(double const* const stress,
const int nstress_components, double* s);

double getStressNorm(double const* const s, const int nstress_components);

double* getPrincipleStresses(double const* const s,
const int nstress_components);

const double pi = 3.14159265359;

} // end of namespace
Loading