Skip to content

Commit

Permalink
Rework well trajectory tests
Browse files Browse the repository at this point in the history
  • Loading branch information
verveerpj committed Jul 12, 2024
1 parent b0d6a4c commit c2e1eec
Show file tree
Hide file tree
Showing 20 changed files with 3,439 additions and 15 deletions.
21 changes: 6 additions & 15 deletions tests/jobs/well_trajectory/test_read_trajectories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import shutil
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -131,7 +130,7 @@ def test_read_trajectories_no_kickoff(copy_testdata_tmpdir):


def test_read_laterals_orphaned_branches(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
mlt_p1_z = load_json("mlt_p1_z.json")
mlt_p1_z["DUMMY"] = {"1": 0.0}
Expand All @@ -143,7 +142,7 @@ def test_read_laterals_orphaned_branches(copy_testdata_tmpdir):


def test_read_laterals_missing_files(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
Path("mlt_p2_b.json").unlink()
Path("mlt_p3_x.json").unlink()
Expand All @@ -155,7 +154,7 @@ def test_read_laterals_missing_files(copy_testdata_tmpdir):


def test_read_laterals_missing_wells(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
mlt_p2_b = load_json("mlt_p2_b.json")
mlt_p3_x = load_json("mlt_p3_x.json")
Expand All @@ -171,7 +170,7 @@ def test_read_laterals_missing_wells(copy_testdata_tmpdir):


def test_read_laterals_missing_branches(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
mlt_p2_b = load_json("mlt_p2_b.json")
mlt_p3_x = load_json("mlt_p3_x.json")
Expand All @@ -187,8 +186,7 @@ def test_read_laterals_missing_branches(copy_testdata_tmpdir):


def test_read_laterals_branch_not_on_well(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
shutil.copytree("expected/wellpaths", "wellpaths")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
mlt_p1_z = load_json("mlt_p1_z.json")
mlt_p1_z["INJ"]["1"] = 1.0
Expand All @@ -197,15 +195,8 @@ def test_read_laterals_branch_not_on_well(copy_testdata_tmpdir):
read_laterals(config.scales, config.references, config.wells)


def test_read_laterals_no_branches(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
assert read_laterals(config.scales, config.references, config.wells) == {}


def test_read_laterals(copy_testdata_tmpdir):
copy_testdata_tmpdir(Path(TEST_DATA) / "spe1case1_mlt")
shutil.copytree("expected/wellpaths", "wellpaths")
copy_testdata_tmpdir(Path(TEST_DATA) / "read_laterals")
config = ConfigSchema.model_validate(load_yaml("config.yml"))
laterals = read_laterals(config.scales, config.references, config.wells)

Expand Down
35 changes: 35 additions & 0 deletions tests/testdata/well_trajectory/read_laterals/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
scales:
x: 10000
y: 10000
z: 100
k: 50
references:
x: 5000
y: 5000
z: 8375
k: 50
interpolation:
type: resinsight
measured_depth_step: 5.0
wells:
- name: INJ
group: G1
phase: GAS
platform: INJ
cost: 0
dogleg: 4
- name: PROD
group: G1
phase: OIL
platform: PROD
cost: 0
dogleg: 4
platforms:
- name: INJ
x: 2500
y: 2500
k: 50
- name: PROD
x: 7500
y: 7500
k: 50
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p1_z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": -0.25, "2": 0.0}, "PROD": {"2": -0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p2_a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": 0.5, "2": 0.5}, "PROD": {"2": 0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p2_b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": 0.0, "2": 0.0}, "PROD": {"2": 0.0}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p2_c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": 0.5, "2": 0.5}, "PROD": {"2": 0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p3_x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": -0.45, "2": -0.25}, "PROD": {"2": 0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p3_y.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": -0.25, "2": 0.45}, "PROD": {"2": 0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/mlt_p3_z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": {"1": -0.25, "2": 0.0}, "PROD": {"2": 0.5}}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p1_x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": -0.25, "PROD": 0.25}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p1_y.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": -0.25, "PROD": 0.25}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p1_z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": -0.5, "PROD": -0.5}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p2_a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": 0.5, "PROD": 0.5}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p2_b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": 0.0, "PROD": 0.0}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p2_c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": 0.5, "PROD": 0.5}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p3_x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": -0.25001, "PROD": 0.25001}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p3_y.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": -0.25, "PROD": 0.25}
1 change: 1 addition & 0 deletions tests/testdata/well_trajectory/read_laterals/p3_z.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"INJ": 0.5, "PROD": 0.5}
Loading

0 comments on commit c2e1eec

Please sign in to comment.