From 9e7610db6bdd40c20bbafd53528045beeb544455 Mon Sep 17 00:00:00 2001 From: "Bartek Florczyk Vik (CCI RPT RES1)" Date: Fri, 22 Mar 2024 13:31:08 +0100 Subject: [PATCH 1/2] add threshold to add_LET_pc_pd --- src/pyscal/wateroil.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pyscal/wateroil.py b/src/pyscal/wateroil.py index 61c55385..2b698c8c 100644 --- a/src/pyscal/wateroil.py +++ b/src/pyscal/wateroil.py @@ -929,11 +929,14 @@ def add_LET_pc_pd( Tt: float, Pcmax: float, Pct: float, + Ftp: Optional[bool] = False, ) -> None: """Add a primary drainage LET capillary pressure curve. Docs: https://wiki.equinor.com/wiki/index.php/Res:The_LET_correlation_for_capillary_pressure + It includes a welldefined threshold pressure Pct if required, and Ftp is a flag that is either True or False defining whether a + threshold pressure should be used or not. Note that Pc where Sw > 1 - sorw will appear linear because there are no saturation points in that interval. """ @@ -945,16 +948,24 @@ def add_LET_pc_pd( assert epsilon < Tt < MAX_EXPONENT_PC assert Pct <= Pcmax + # swnpc is a normalized saturation, but normalized with + # respect to swirr, not to swl (the swirr here is sometimes + # called 'swirra' - asymptotic swirr) + # LET Pc is provides and finite Pc value, thus swirr does not fit into the concept + # swnpc is generated upon object initialization, but overwritten + # here and normalized with respect to swl + self.table["SWNPC"] = (self.table["SW"] - self.swl) / (1 - self.swl) + # The "forced part" self.table["Ffpcow"] = (1 - self.table["SWNPC"]) ** Lp / ( (1 - self.table["SWNPC"]) ** Lp + Ep * self.table["SWNPC"] ** Tp ) # The gradual rise part: - self.table["Ftpcow"] = self.table["SWNPC"] ** Lt / ( + self.table["Ftpcow"] = (1-Ftp)*Pct*self.table["SWNPC"] ** Lt / ( self.table["SWNPC"] ** Lt + Et * (1 - self.table["SWNPC"]) ** Tt ) - + # Putting it together: self.table["PC"] = ( (Pcmax - Pct) * self.table["Ffpcow"] - Pct * self.table["Ftpcow"] + Pct @@ -966,7 +977,7 @@ def add_LET_pc_pd( "-- LET correlation for primary drainage Pc;\n" f"-- Lp={Lp:g}, Ep={Ep:g}, Tp={Tp:g}, " f"Lt={Lt:g}, Et={Et:g}, Tt={Tt:g}, " - f"Pcmax={Pcmax:g}, Pct={Pct:g}\n" + f"Pcmax={Pcmax:g}, Pct={Pct:g}, Ftp={Ftp}\n" ) def add_LET_pc_imb( From d73217cea7651ecb459d44a2301e897f708286c1 Mon Sep 17 00:00:00 2001 From: "Bartek Florczyk Vik (CCI RPT RES1)" Date: Fri, 22 Mar 2024 14:18:57 +0100 Subject: [PATCH 2/2] changed to thershold let_pc_pd and added into test --- src/pyscal/wateroil.py | 2 +- tests/test_wateroil_pc.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pyscal/wateroil.py b/src/pyscal/wateroil.py index 2b698c8c..ef46f186 100644 --- a/src/pyscal/wateroil.py +++ b/src/pyscal/wateroil.py @@ -962,7 +962,7 @@ def add_LET_pc_pd( ) # The gradual rise part: - self.table["Ftpcow"] = (1-Ftp)*Pct*self.table["SWNPC"] ** Lt / ( + self.table["Ftpcow"] = (1-Ftp)*self.table["SWNPC"] ** Lt / ( self.table["SWNPC"] ** Lt + Et * (1 - self.table["SWNPC"]) ** Tt ) diff --git a/tests/test_wateroil_pc.py b/tests/test_wateroil_pc.py index 45b968a6..34fef81f 100644 --- a/tests/test_wateroil_pc.py +++ b/tests/test_wateroil_pc.py @@ -174,6 +174,11 @@ def test_let_pc_pd(): assert np.isclose(wateroil.table["PC"].min(), 0) # (everything is linear) + #Test for added threshold in the function + wateroil.add_LET_pc_pd(Lp=1, Ep=1, Tp=1, Lt=1, Et=1, Tt=1, Pcmax=10, Pct=5, Ftp=True) + assert np.isclose(wateroil.table["PC"].max(), 10) + assert np.isclose(wateroil.table["PC"].min(), 5) + wateroil.add_LET_pc_pd(Lp=10, Ep=10, Tp=10, Lt=10, Et=10, Tt=10, Pcmax=10, Pct=5) assert np.isclose(wateroil.table["PC"].max(), 10) assert np.isclose(wateroil.table["PC"].min(), 0)