mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user