Get cell volumes from Python

Adds a new method get_cell_volumes() to the opm.simulators Python module
that returns a python list of the cell volumes in the black oil
simulator.
This commit is contained in:
Håkon Hægland
2023-09-08 09:39:24 +02:00
parent 8bf45ea86b
commit e2f62644ae
7 changed files with 72 additions and 245 deletions

View File

@@ -63,7 +63,11 @@ class TestBasic(unittest.TestCase):
sim = BlackOilSimulator("SPE1CASE1.DATA")
sim.step_init()
sim.step()
vol = sim.get_cell_volumes()
self.assertEqual(len(vol), 300, 'length of volume vector')
# NOTE: The volume should be 1000 ft x 1000 ft x 20 ft * 0.3 (porosity)
# = 600000 ft^3 = 566336.93 m^3
self.assertAlmostEqual(vol[0], 566336.93, places=2, msg='value of volume')
poro = sim.get_porosity()
self.assertEqual(len(poro), 300, 'length of porosity vector')
self.assertAlmostEqual(poro[0], 0.3, places=7, msg='value of porosity')