mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-29 10:40:59 -06:00
ac927d997b
Added a get_dt() to the opm.simulators.BlackOilSimulator Python module. This will return the size of the previous simulator time step.
23 lines
840 B
Python
23 lines
840 B
Python
import os
|
|
import unittest
|
|
from pathlib import Path
|
|
from opm.simulators import BlackOilSimulator
|
|
from .pytest_common import pushd
|
|
|
|
class TestBasic(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
# NOTE: See comment in test_basic.py for the reason why we are
|
|
# only using a single test_all() function instead of splitting
|
|
# it up in multiple test functions
|
|
test_dir = Path(os.path.dirname(__file__))
|
|
cls.data_dir = test_dir.parent.joinpath("test_data/SPE1CASE1a")
|
|
|
|
def test_all(self):
|
|
with pushd(self.data_dir):
|
|
sim = BlackOilSimulator("SPE1CASE1.DATA")
|
|
# NOTE: The following call should throw an exception since the simulation
|
|
# has not been initialized
|
|
with self.assertRaises(RuntimeError):
|
|
sim.get_dt()
|