Skip to content

Commit

Permalink
Fix bug with static and dynamic perforations
Browse files Browse the repository at this point in the history
  • Loading branch information
verveerpj committed Oct 28, 2024
1 parent c9ac100 commit 66c4dbc
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 39 deletions.
10 changes: 6 additions & 4 deletions src/everest_models/jobs/fm_well_trajectory/resinsight.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,19 @@ def _find_time_step(


def _create_tracks(
properties: Iterable[str],
properties: Iterable[Union[DynamicDomainProperty, StaticDomainProperty]],
property_type: str,
case: rips.Case,
well_path: rips.WellPath,
well_log_plot: rips.WellLogPlot,
time_step_num: Optional[int] = None,
) -> None:
for property in properties:
track = well_log_plot.new_well_log_track(f"Track: {property}", case, well_path)
track = well_log_plot.new_well_log_track(
f"Track: {property.key}", case, well_path
)
track.add_extraction_curve(
case, well_path, property_type, property, time_step_num
case, well_path, property_type, property.key, time_step_num
)


Expand Down Expand Up @@ -364,7 +366,7 @@ def _generate_welspecs(
lines = file_obj.readlines()

with open(export_filename, "w") as file_obj:
welspecs = False, False
welspecs, compdat = False, False
for line in lines:
stripped_line = line.strip()
if not stripped_line or stripped_line.startswith("--"):
Expand Down
32 changes: 32 additions & 0 deletions tests/jobs/well_trajectory/test_well_trajectory_resinsight.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,35 @@ def test_well_trajectory_resinsight_main_entry_point_mixed(
output = expected.relative_to("expected_mixed")
assert output.is_file()
assert filecmp.cmp(expected, output, shallow=False)


@pytest.mark.resinsight
def test_well_trajectory_resinsight_main_entry_point_no_mlt_static_perforation(
copy_testdata_tmpdir,
):
copy_testdata_tmpdir(Path(TEST_DATA) / "resinsight")
for path in Path.cwd().glob("mlt_*.json"):
path.unlink()
main_entry_point("-c config_static_perforation.yml -E SPE1CASE1".split())

for expected in Path("expected").glob("**/*"):
if expected.is_file():
output = expected.relative_to("expected")
assert output.is_file()
assert filecmp.cmp(expected, output, shallow=False)


@pytest.mark.resinsight
def test_well_trajectory_resinsight_main_entry_point_no_mlt_dynamic_perforation(
copy_testdata_tmpdir,
):
copy_testdata_tmpdir(Path(TEST_DATA) / "resinsight")
for path in Path.cwd().glob("mlt_*.json"):
path.unlink()
main_entry_point("-c config_dynamic_perforation.yml -E SPE1CASE1".split())

for expected in Path("expected").glob("**/*"):
if expected.is_file():
output = expected.relative_to("expected")
assert output.is_file()
assert filecmp.cmp(expected, output, shallow=False)
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/resinsight/SPE1CASE1.DATA
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ WCONINJE

DATES
1 'JAN' 2015 /
2 'JAN' 2015 /
/

END
Binary file not shown.
Binary file not shown.
Binary file not shown.
69 changes: 34 additions & 35 deletions tests/testdata/well_trajectory/resinsight/config.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
scales:
x: 4000
y: 4000
z: 300
k: 50
x: 4000
y: 4000
z: 300
k: 50
references:
x: 5000
y: 5000
z: 8375
k: 50
x: 5000
y: 5000
z: 8375
k: 50
interpolation:
type: resinsight
measured_depth_step: 5.0
type: resinsight
measured_depth_step: 5.0
connections:
type: resinsight
date: 2015-01-01
formations_file: ./formations.lyr
perforations:
- well: INJ
formations: [0, 1, 2]
- well: PROD
formations: [0, 1, 2]
type: resinsight
date: 2015-01-02
formations_file: ./formations.lyr
perforations:
- well: INJ
formations: [0, 1, 2]
- well: PROD
formations: [0, 1, 2]
wells:
- name: INJ
group: G1
phase: GAS
platform: PLATFORM
cost: 0
dogleg: 4
- name: PROD
group: G1
phase: OIL
platform: PLATFORM
cost: 0
dogleg: 4
- name: INJ
group: G1
phase: GAS
platform: PLATFORM
cost: 0
dogleg: 4
- name: PROD
group: G1
phase: OIL
platform: PLATFORM
cost: 0
dogleg: 4
platforms:
- name: PLATFORM
x: 5000
y: 5000
k: 50

- name: PLATFORM
x: 5000
y: 5000
k: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
scales:
x: 4000
y: 4000
z: 300
k: 50
references:
x: 5000
y: 5000
z: 8375
k: 50
interpolation:
type: resinsight
measured_depth_step: 5.0
connections:
type: resinsight
date: 2015-01-02
formations_file: ./formations.lyr
perforations:
- well: INJ
formations: [0, 1, 2]
- well: PROD
dynamic:
- key: SOIL
min: 0
max: 1
wells:
- name: INJ
group: G1
phase: GAS
platform: PLATFORM
cost: 0
dogleg: 4
- name: PROD
group: G1
phase: OIL
platform: PLATFORM
cost: 0
dogleg: 4
platforms:
- name: PLATFORM
x: 5000
y: 5000
k: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
scales:
x: 4000
y: 4000
z: 300
k: 50
references:
x: 5000
y: 5000
z: 8375
k: 50
interpolation:
type: resinsight
measured_depth_step: 5.0
connections:
type: resinsight
date: 2015-01-02
formations_file: ./formations.lyr
perforations:
- well: INJ
formations: [0, 1, 2]
- well: PROD
static:
- key: PORO
min: 0
max: 1
wells:
- name: INJ
group: G1
phase: GAS
platform: PLATFORM
cost: 0
dogleg: 4
- name: PROD
group: G1
phase: OIL
platform: PLATFORM
cost: 0
dogleg: 4
platforms:
- name: PLATFORM
x: 5000
y: 5000
k: 50

0 comments on commit 66c4dbc

Please sign in to comment.