From 6ebf57643a6fc6136f9687cfbc902bc662fc39a2 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Thu, 19 Dec 2024 11:43:00 -0600 Subject: [PATCH 1/4] fix issue 3499 --- .../capillaryPressure/JFunctionCapillaryPressure.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 908c42604b4..6fcdc37dc5c 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -250,7 +250,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" ); + // 9.869233×10−13 is Darcy to sq m factor + GEOS_ERROR_IF( permeability < LvArray::NumericLimits< real64 >::epsilon * 9.869233e-13, "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 From 3e0a40995bf1dc6e22fbc55fb0853d68088f3cd9 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Mon, 13 Jan 2025 17:16:06 -0600 Subject: [PATCH 2/4] add constant in units --- .../capillaryPressure/JFunctionCapillaryPressure.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 6fcdc37dc5c..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,8 +251,8 @@ void JFunctionCapillaryPressure::saveConvergedRockState( arrayView2d< real64 con { permeability = convergedPermeability[ei][0][2]; } - // 9.869233×10−13 is Darcy to sq m factor - GEOS_ERROR_IF( permeability < LvArray::NumericLimits< real64 >::epsilon * 9.869233e-13, "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 From 2792f15f213a569d2d650c940d60077cb09c6c82 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Tue, 14 Jan 2025 11:24:43 -0600 Subject: [PATCH 3/4] missing file --- src/coreComponents/common/Units.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreComponents/common/Units.hpp b/src/coreComponents/common/Units.hpp index 8bfdc04ca80..08f1701cd26 100644 --- a/src/coreComponents/common/Units.hpp +++ b/src/coreComponents/common/Units.hpp @@ -30,6 +30,7 @@ namespace geos namespace units { +static constexpr double DarcyToSqM = 9.869233e-13; /** * @return the input Kelvin degrees converted in Celsius From 4e72772f2eb20e833b80aca6845a25232306a7ba Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Tue, 14 Jan 2025 14:23:27 -0600 Subject: [PATCH 4/4] Update Units.hpp --- src/coreComponents/common/Units.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreComponents/common/Units.hpp b/src/coreComponents/common/Units.hpp index 08f1701cd26..693c3a13f75 100644 --- a/src/coreComponents/common/Units.hpp +++ b/src/coreComponents/common/Units.hpp @@ -30,6 +30,7 @@ namespace geos namespace units { +/// Darcy to m^2 conversion factor static constexpr double DarcyToSqM = 9.869233e-13; /**