mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 18:01:08 -06:00
Python: add unit test for load_case for roff, roffasc and grdecl.
This commit is contained in:
parent
f46516ac85
commit
7215504b16
@ -58,3 +58,40 @@ def test_10k(rips_instance, initialize_test):
|
||||
check_corner(cell_corners[cell_index].c5, expected_corners[5])
|
||||
check_corner(cell_corners[cell_index].c6, expected_corners[6])
|
||||
check_corner(cell_corners[cell_index].c7, expected_corners[7])
|
||||
|
||||
|
||||
def check_reek_grid_box(case):
|
||||
assert len(case.grids()) == 1
|
||||
grid = case.grid(index=0)
|
||||
|
||||
dimensions = grid.dimensions()
|
||||
assert dimensions.i == 21
|
||||
assert dimensions.j == 23
|
||||
assert dimensions.k == 14
|
||||
|
||||
cell_centers = grid.cell_centers()
|
||||
total_size = dimensions.i * dimensions.j * dimensions.k
|
||||
assert len(cell_centers) == total_size
|
||||
|
||||
poro = case.active_cell_property("INPUT_PROPERTY", "PORO", 0)
|
||||
assert len(poro) == total_size
|
||||
assert math.isclose(min(poro), 0.000928084715269506)
|
||||
assert math.isclose(max(poro), 0.351595014333725)
|
||||
|
||||
|
||||
def test_load_roff_binary_grid(rips_instance, initialize_test):
|
||||
casePath = dataroot.PATH + "/reek/reek_box_grid_w_props.roff"
|
||||
case = rips_instance.project.load_case(path=casePath)
|
||||
check_reek_grid_box(case)
|
||||
|
||||
|
||||
def test_load_roff_ascii_grid(rips_instance, initialize_test):
|
||||
casePath = dataroot.PATH + "/reek/reek_box_grid_w_props.roffasc"
|
||||
case = rips_instance.project.load_case(path=casePath)
|
||||
check_reek_grid_box(case)
|
||||
|
||||
|
||||
def test_load_grdecl_grid(rips_instance, initialize_test):
|
||||
casePath = dataroot.PATH + "/reek/reek_box_grid_w_props.grdecl"
|
||||
case = rips_instance.project.load_case(path=casePath)
|
||||
check_reek_grid_box(case)
|
||||
|
15709
TestModels/reek/reek_box_grid_w_props.grdecl
Normal file
15709
TestModels/reek/reek_box_grid_w_props.grdecl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
TestModels/reek/reek_box_grid_w_props.roff
Normal file
BIN
TestModels/reek/reek_box_grid_w_props.roff
Normal file
Binary file not shown.
9915
TestModels/reek/reek_box_grid_w_props.roffasc
Normal file
9915
TestModels/reek/reek_box_grid_w_props.roffasc
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user