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-2025.10-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (46.0 MB view details)

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

opm_simulators-2025.10-cp38-cp38-manylinux_2_28_x86_64.whl (46.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b419c0490551022d8320081b7048191e4aba9429d78e42c859abdf3e00a8e83
MD5 be28e7bfb2270ab46eea3cc17768abd4
BLAKE2b-256 5f2b822977c512f2434cdddd3f0835e017062b8f2c88bfbd8d1ff3885890aade

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0fb456a972d4d658c49a2fd9e06dc40d9624cc174aebce50a9facccc87fa0379
MD5 6f5ff3cce0c98e2aa3242ca0af7a17af
BLAKE2b-256 793e9f45fb008b790283b0b46a03b424b94de3fbe5a35f59c2087ad86a10f802

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6906e4c378eb8a813bbc453ef02926fb8c1fe58133371026085124d30336cf36
MD5 bca0ce48b907740d92d491268af40ec0
BLAKE2b-256 43f02b632ac32f2f77b4dfb44ec8af159f631071154b4c3c7f45cd7fbbdbaf99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94ed1a0c20c47dd74ab23ed5169cb0f54a112afa4272c4c45671f37aed66f95a
MD5 255453f02ac8b3d5157fa5cc793f08a4
BLAKE2b-256 a5ab638b7a901cf5ec02e7b81a45d4b6a2b7d967c7593cd8bdf1b911adbd83ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f99bbe6a093a0d299ddaec521d16ee32321eb01efa8cebd8dcd87ebac24e3236
MD5 6fee667face8aa9c4989d4e443b537d6
BLAKE2b-256 e6c26e4632bffa7248fac232e985be7e4a10dd8aea4be7acef8344958b974f15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88a263fc64bbd159b3d6cde96ed2f5bcfd91c5ad9657485407172899333aa7a2
MD5 72c349795a0ee921b32b29ac9d6aeec6
BLAKE2b-256 c81ce0997a967b9d30c0548d96233885fbad49c8da5a0e0b9aa1684426d1a40b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opm_simulators-2025.10-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b992d3011d504201498daf6dd9020b66d1b02e223a4d2a4f691dee0a8e904e34
MD5 85166c9fd2a738ed5cb50cb9d8ef4d87
BLAKE2b-256 534ca56ee02c240fea9c6725e8719be1715b6e9cf10f4aa4aaceb8472d24b5fd

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