Skip to content

Commit

Permalink
Allow negative swirr values (-1 <= swirr <= 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnyb committed Aug 25, 2023
1 parent 072bba6 commit 013ef86
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
8 changes: 7 additions & 1 deletion pyscal/gasoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@ def __init__(
if h is None:
h = 0.01

assert -epsilon < swirr < 1.0 + epsilon, "0 <= swirr <= 1 is required"
assert -epsilon - 1 < swirr < 1.0 + epsilon, "-1 <= swirr <= 1 is required"
assert -epsilon < sgcr < 1, "0 <= sgcr < 1 is required"
assert -epsilon < swl < 1, "0 <= swl < 1 is required"
assert -epsilon < sorg < 1, "0 <= sorg < 1 is required"

if swirr < 0:
logger.warning(
f"Negative swirr value, {swirr}, detected. Negative values are allowed,"
" but you should ensure that this is intentional."
)

if krgendanchor is None:
krgendanchor = ""

Expand Down
22 changes: 17 additions & 5 deletions pyscal/wateroil.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,18 @@ def __init__(
_sgcr and _sgl are only to be used by the GasWater object.
"""

assert -epsilon < swirr < 1.0 + epsilon
assert -epsilon < swl < 1.0 + epsilon
assert -epsilon < swcr < 1.0 + epsilon
assert -epsilon < sorw < 1.0 + epsilon
assert (
-epsilon - 1 < swirr < 1.0 + epsilon
), f"swirr = {swirr}, -1 <= swirr <= 1 is required"
assert -epsilon < swl < 1.0 + epsilon, f"swl = {swl}, 0 <= swl < 1 is required"
assert (
-epsilon < swcr < 1.0 + epsilon
), f"swcr = {swcr}, 0 <= swcr < 1 is required"
assert (
-epsilon < sorw < 1.0 + epsilon
), f"sorw = {sorw}, 0 <= sorw < 1 is required"
if socr is not None:
assert -epsilon < socr < 1.0 + epsilon
assert -epsilon < socr < 1.0 + epsilon, "0 <= socr < 1 is required"

if h is None:
h = 0.01
Expand All @@ -91,6 +97,12 @@ def __init__(
assert swcr < 1 - sorw
assert swirr < 1 - sorw

if swirr < 0:
logger.warning(
f"Negative swirr value, {swirr}, detected. Negative values are allowed,"
" but you should ensure that this is intentional."
)

self.swcomment: str = ""

h_min = 1.0 / float(SWINTEGERS)
Expand Down

0 comments on commit 013ef86

Please sign in to comment.