Commit Graph

12 Commits

Author SHA1 Message Date
Kai Bao
027c3ba0fc using one day time step for SPE1CASE1a/SPE1CASE1.DATA
to avoid time stepping change causes test failures for the python tests
2024-06-19 13:42:55 +02:00
Håkon Hægland
a1b7d4b5dd Allow Python bindings to setup MPI
Allows the Python bindings to control whether MPI_Init() and
MPI_Finalize() will be called when creating an OPM::Main object.
2024-05-02 11:14:07 +02:00
Håkon Hægland
55aab60549 Get primary variables and fluid state from Python
Added methods to Python module opm.simulators.BlackOilSimulator to
access primary variables and fluid state variables.
2024-03-01 14:22:35 +01:00
Håkon Hægland
ac927d997b Added a get_dt() method
Added a get_dt() to the opm.simulators.BlackOilSimulator Python module.
This will return the size of the previous simulator time step.
2023-09-08 19:40:42 +02:00
Håkon Hægland
e2f62644ae 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.
2023-09-08 09:39:24 +02:00
Håkon Hægland
3c0498e55f Dynamically update schedule from Python
Adds some test cases that show how injection properties in Opm::Schedule
can be dynamically modified from Python.
2022-06-10 11:31:48 +02:00
Håkon Hægland
91ac3a2a32 Dynamically update schedule from Python
Adds some methods that enables Opm::Schedule to be dynamically modified
from Python. A test case in test_schedule.py illustrates the use case.
2022-05-05 13:10:39 +02:00
Håkon Hægland
5ad65c70ee Initialize blackoil simulator from schedule shared with Python.
Adds a new constructor to Main.hpp that takes shared pointers to Deck,
EclipseState, Schedule, and SummaryConfig. This makes it possible to
share these variables with Python without worrying about lifetime issues
of the underlying C++ objects. For example, a Python script can first
create an opm.io.schedule.Schedule object which is modified from Python.
Then, assume the same Python script creates an
opm.simulators.BlackOilSimulator which is initialized with the same
schedule object. Since the underlying C++ object is a shared pointer,
the Schedule object in Python may go out of scope (get deleted by Python)
without having the C++ schedule object being deleted. And the Python
BlackOilSimulator may continue to be used after the Python Schedule object
has been deleted since it still has a valid C++ schedule object.
2021-09-21 15:52:59 +02:00
Håkon Hægland
b680d96198 The data directory is relative to the parent.
The test data directory is relative to the parent directory, not the
current directory.
2020-11-05 09:48:39 +01:00
Joakim Hove
68e8c4a900 Use python pushd 2020-11-04 14:24:39 +01:00
Håkon Hægland
7011a6c0b7 Restore cwd after each unittest.
Restores the original cwd after each unittest in test_basic.py. Also
simplifies add_test() in python/simulators/CMakeLists.txt such that the
Bash script wrapper run-python-tests.sh is no longer needed to run the
tests.
2020-11-04 13:51:36 +01:00
Håkon Hægland
648bab7108 Implements access to the porosity from Python.
Implements access (read/write) to the porosity from Python.
2020-11-03 17:18:14 +01:00