diff --git a/src/coreComponents/common/Units.hpp b/src/coreComponents/common/Units.hpp index 8bfdc04ca80..693c3a13f75 100644 --- a/src/coreComponents/common/Units.hpp +++ b/src/coreComponents/common/Units.hpp @@ -30,6 +30,8 @@ namespace geos namespace units { +/// Darcy to m^2 conversion factor +static constexpr double DarcyToSqM = 9.869233e-13; /** * @return the input Kelvin degrees converted in Celsius diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 908c42604b4..3e67db4b27b 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -22,6 +22,7 @@ #include "constitutive/capillaryPressure/CapillaryPressureFields.hpp" #include "constitutive/capillaryPressure/TableCapillaryPressureHelpers.hpp" #include "functions/FunctionManager.hpp" +#include "common/Units.hpp" namespace geos { @@ -250,7 +251,8 @@ void JFunctionCapillaryPressure::saveConvergedRockState( arrayView2d< real64 con { permeability = convergedPermeability[ei][0][2]; } - GEOS_ERROR_IF( permeability < LvArray::NumericLimits< real64 >::epsilon, "Zero permeability in J-function capillary pressure" ); + // multiply epsilon by Darcy to sq m factor + GEOS_ERROR_IF( permeability < LvArray::NumericLimits< real64 >::epsilon * units::DarcyToSqM, "Zero permeability in J-function capillary pressure" ); // here we compute an average of the porosity over quadrature points // this average is exact for tets, regular pyramids/wedges/hexes, or for VEM