Skip to content

Commit

Permalink
BUG: support for E300 and tentative IX for Phases in restart
Browse files Browse the repository at this point in the history
Phases are given in INTEHEAD record 14. For Eclipse 100 numbers
are 1-7, while E300 operates with 0 and IX with undefined (-2345).
For IX there seems to be other issues on reading
  • Loading branch information
jcrivenaes committed Feb 7, 2022
1 parent 3081780 commit 0b3e602
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_ecl_output_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class UnitSystem(Enum):

@unique
class Phases(Enum):
E300_GENERIC = 0
OIL = 1
WATER = 2
OIL_WATER = 3
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_find_gridprop_in_eclrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def filter_lgr(generator):
"SOIL": 0.0,
},
Phases.OIL_WATER_GAS: dict(),
Phases.E300_GENERIC: dict(),
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[269.9453125 -- 270.1187438965]
[269.9519958496 270.0467834473 --]]

[[269.9609069824 270.0378723145 270.1144714355]
[269.9542236328 270.0423278809 270.1266784668]]

[[269.9818725586 270.047668457 270.1114196777]
[269.956451416 270.0378723145 270.1205749512]]

[[269.9742736816 270.0467834473 270.1083679199]
[269.9635925293 270.0333862305 270.1077575684]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[0.0335517526 -- 0.0]
[0.0315505862 0.003243804 --]]

[[0.02888304 0.0059047341 0.0]
[0.0308837295 0.0045742989 0.0]]

[[0.0226168633 0.0029776692 0.0]
[0.0302168131 0.0059047341 0.0]]

[[0.0248830914 0.003243804 0.0]
[0.028082788 0.007235229 0.0]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[269.9447937012 -- 270.1181945801]
[269.9514770508 270.0462646484 --]]

[[269.9604187012 270.037322998 270.1139221191]
[269.9537353516 270.0417785645 270.1260986328]]

[[269.9813537598 270.0471496582 270.1108703613]
[269.9559631348 270.037322998 270.1200256348]]

[[269.9737854004 270.0462646484 270.1078186035]
[269.9630737305 270.0328674316 270.107208252]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[0.0335402489 -- 0.0]
[0.0315398015 0.0032426515 --]]

[[0.0288731679 0.0059027206 0.0]
[0.0308731422 0.0045726863 0.0]]

[[0.0226091091 0.0029766446 0.0]
[0.0302064847 0.0059027206 0.0]]

[[0.0248745903 0.0032426515 0.0]
[0.0280731786 0.0072327554 0.0]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[400.6692199707 -- 400.7821044922]
[400.6722717285 400.7158203125 --]]

[[400.6763916016 400.711730957 400.7778015137]
[400.6733093262 400.7137756348 400.7900695801]]

[[400.6860046387 400.7162475586 400.7747192383]
[400.6743469238 400.711730957 400.7839355469]]

[[400.6825256348 400.7158203125 400.7716674805]
[400.6776123047 400.7096862793 400.7710571289]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[[0.0313438885 -- 0.0]
[0.0283134598 0.0015908304 --]]

[[0.0241011288 0.0028758403 0.0]
[0.0272606183 0.0022333621 0.0]]

[[0.013992371 0.0014623175 0.0]
[0.0262076166 0.0028758403 0.0]]

[[0.0177176725 0.0015908304 0.0]
[0.0228369273 0.0035182647 0.0]]]
47 changes: 47 additions & 0 deletions tests/test_grid3d/test_grid_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,3 +696,50 @@ def test_gridprop_export_bgrdecl_double(tmp_path, grid):

with open(tmp_path / "actnum.DATA", "rb") as fh:
assert b"DOUB" in fh.read()


@pytest.mark.parametrize(
"simcase, props",
[
(
pytest.param(
"E100_BO",
["SOIL", "PRESSURE"],
id="E100 blackoil",
)
),
(
pytest.param(
"E300_BO",
["SOIL", "PRESSURE"],
id="E300 blackoil",
)
),
(
pytest.param(
"E300_COMP",
["SOIL", "PRESSURE"],
id="E300 composite",
)
),
],
)
def test_simpleb8_case(simcase, props, snapshot):
"""Test a very small case that is actually ran through E100, E300, IX."""

folder = TPATH / "3dgrids" / "simpleb8"

grd = xtgeo.grid_from_file(folder / str(simcase + ".EGRID"), fformat="egrid")

assert grd.dimensions == (4, 2, 3)

for prop in props:
gprop = xtgeo.gridproperty_from_file(
folder / str(simcase + ".UNRST"),
name=prop,
fformat="unrst",
date="20220101",
grid=grd,
)

snapshot.assert_match(str(gprop.values.round(10)), f"{prop}_{simcase}")
6 changes: 6 additions & 0 deletions tests/test_grid3d/test_gridprop_import_eclrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ def test_read_values():
Phases.OIL_WATER_GAS,
0.25,
),
(
iter([MockEntry("SWAT", 0.5), MockEntry("SGAS", 0.25)]),
"SOIL",
Phases.E300_GENERIC,
0.25,
),
],
)
def test_read_values_phases(generator, keyword, phases, expected):
Expand Down

0 comments on commit 0b3e602

Please sign in to comment.