Skip to main content

OPM-Simulators Python bindings

Project description

Python bindings for the OPM-common module of the Open Porous Media project.

To compile with python support:

  • Add the cmake flags -DOPM_ENABLE_PYTHON=ON and -DOPM_INSTALL_PYTHON=ON
  • Optionally add prefix -DCMAKE_INSTALL_PREFIX=/opt/opm to install outside the standard distro directories
  • Optionally specify python binary -DPython3_EXECUTABLE=/home/user/miniconda3/envs/rkt/bin/python3 if you don't want to use the system python, e.g. use a python from pyenv or from a conda environment

Sample compilation on linux:

#! /bin/bash

flags="-DPython3_EXECUTABLE=/home/hakon/miniconda3/envs/rkt/bin/python3 -DOPM_ENABLE_PYTHON=ON -DOPM_INSTALL_PYTHON=ON -DCMAKE_INSTALL_PREFIX=/opt/opm"
for repo in opm-common opm-grid opm-models opm-simulators
do
    cd "$repo"
    mkdir -p build
    cd build
    cmake  $flags ..
    make -j8
    sudo make install
    cd ..
    cd ..
done

Then you should be able to use the module from a Python script. If you installed in a non-standard directory by specifying -DCMAKE_INSTALL_PREFIX you may need to set the PYTHONPATH environment variable before running your Python script, for example:

$ PYTHONPATH=/opt/opm/lib/python3.11/site-packages python3 spe1case1.py

and spe1case1.py could be:

import os
from opm.simulators import BlackOilSimulator
from opm.io.parser import Parser
from opm.io.ecl_state import EclipseState
from opm.io.schedule import Schedule
from opm.io.summary import SummaryConfig

os.chdir("SPE1CASE1")
deck  = Parser().parse('SPE1CASE1.DATA')
state = EclipseState(deck)
schedule = Schedule( deck, state )
summary_config = SummaryConfig(deck, state, schedule)

sim = BlackOilSimulator(deck, state, schedule, summary_config)
sim.step_init()
sim.step()
poro = sim.get_porosity()
poro = poro *.95
sim.set_porosity(poro)
sim.step()
sim.step_cleanup()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

opm_simulators-2026.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

opm_simulators-2026.4-cp38-cp38-manylinux_2_28_x86_64.whl (47.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

Details for the file opm_simulators-2026.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8714fb2b9e20854be3f659a28fc6c8e4f2ec40472778a22878848a00dbb310ea
MD5 4353675521e438d2ef8ec48237708bea
BLAKE2b-256 e68e2bc8d67a18a26a32f01a4ae1ce48897c5407926073c7864d11ebeeed17bc

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d84e363ebd44fc4d2462af63f36dad4b0877918c4f3a5f5d433aab2491156250
MD5 7bfb27f4e0c04f8b9ed795a992ac6c4d
BLAKE2b-256 9645852716a49db502ffe96a4fd0c277370f676e536304023cc700cdf7dd60e9

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bf1e77553b0db2e78c0f5b4fefa14d163f175f5ed2acb13848ffb7b1d1a0c8dd
MD5 ce50dd5b77288cabfbec7c1c333d3074
BLAKE2b-256 c8755d51828d6ed18eb7bb34ba4bb4b8db1893a260aa0ad0425eb551296a6390

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6c1dfbef141e97b4734fe925da7f43ea078172e023b2f1549230bcd99f9ba788
MD5 f81734dbb0e27614638564aa9c1d1076
BLAKE2b-256 8535f432d287e44aac6cb294bc7ba569b06d67001963f5da14db99a7877d1aea

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2505d40602b2653c8a50d564d32bb0a7b406ac4e9aca445027161bb453459dc3
MD5 2bcd74d09c6a23b63a6c0a1900226dbe
BLAKE2b-256 d5485e0a4cc2fd2326a5b4197b0a1cedbe71626de478a4295dba86a477752af3

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e7d228049a532d321601fe983e6929fd0edab0bd2f840c1600098f13494d1670
MD5 e4e5878d351c48b07246044d3e96025d
BLAKE2b-256 23ff1935845ffb1ecd5a0d80d1395e92782a0137a1ef3ca62091f780951a822b

See more details on using hashes here.

File details

Details for the file opm_simulators-2026.4-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for opm_simulators-2026.4-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cd34aa61a1e1a75b26c1b20c0943e289c4fe11050fad67f1bf9bf93c56513be3
MD5 e2949e9cdabd3ed18650e9fa2cb1f23b
BLAKE2b-256 1199438dd1d7e8a9e6de67b8b772e9654a5f4ebf6aac3232b5dda99b9baa1986

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page