Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,17 @@ on:
jobs:
run-pofff-local:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.12

- name: Install Flow Simulator
run: |
Expand Down Expand Up @@ -58,7 +52,7 @@ jobs:

- name: Run the tests
run: |
pytest --cov=pofff --cov-report term-missing tests/
pytest -x --cov=pofff --cov-report term-missing tests/

- name: Build documentation
run: |
Expand Down
Binary file added docs/_images/plopm_xco2l.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 34 additions & 2 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Adding your results
===================

The `publication <https://github.com/cssr-tools/pofff/blob/main/publication>`_ folder contains the configuration files used for the results in the
`pofff paper <https://arxiv.org/abs/2510.20614>`_ (see :doc:`publication <./publication>` for details in the steps to reproduce the figures in the paper).
For example, running inside that folder:
`pofff paper <https://arxiv.org/abs/2510.20614>`_ (see :doc:`publication <./publication>` for details in the steps to reproduce the figures in the paper).

.. code-block:: bash

Expand Down Expand Up @@ -77,3 +76,36 @@ see/run the scripts in the `tests <https://github.com/OPM/pyopmspe11/blob/main/t
After the runs, one can always use pofff to postprocess the data and generate the figures, running with the flag **-m none** (see the
`profiling.py <https://github.com/cssr-tools/pofff/blob/main/publication/sprofiling.py>`_ for an example of splitting the generation of the files, running of everest, and postprocessing).
Please raise an issue for missing keywords in the toml configuration files that you would like to be added.

=============
Visualization
=============
To postprocess the data, `plopm <https://github.com/cssr-tools/plopm>`_ can be used.

.. tip::
You can install `plopm <https://github.com/cssr-tools/plopm>`_ by executing in the terminal:

.. code-block:: bash

pip install git+https://github.com/cssr-tools/plopm.git

For example, if you run the `appendixb.toml <https://github.com/cssr-tools/pofff/blob/main/publication/appendixb.toml>`_ configuration file and change the 'inj' variable in line 17 to:

.. code-block:: bash

inj=[[8100, 300, 3E-7, 0],
[10200, 300, 3E-7, 3E-7],
[3300, 300, 0, 0],
[64800, 3600, 0, 0],
[345600, 21600, 0, 0]]

Then the following GIF is generated by:

.. code-block:: bash

pofff -i appendixb.toml -o plopm -m single -c '5e-2' -f none
plopm -v xco2l -i plopm/PLOPM -d 8,2.5 -mask satnum -m gif -dpi 1000 -f 12 -loop 1 -cformat .2f -cbsfax 0.30,0.01,0.4,0.02 -remove 0,0,1,0 -interval 437.5 -maskthr 1e-5 -tunits h

.. image:: ./figs/plopm_xco2l.gif

See the `plopm online docmunetation <https://cssr-tools.github.io/plopm/>`_ for additional information of supported flag parameters to generate customized PNGs and GIFs.
70 changes: 51 additions & 19 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ While using package managers such as Anaconda, Miniforge, or Mamba might work, t
update the documentation when Python 3.14 is supported (e.g., the ert Python package is not yet available
via pip install in Python 3.14).

`ResInsight <https://resinsight.org>`_ and `plopm <https://github.com/cssr-tools/plopm>`_ can be used for the visualization of the results.

.. note::

There are binary packages for Linux and Windows to install Resinsight, see the `ResInsight Documentation <https://resinsight.org/releases/>`_. For macOS users, you could try to install it using `brew <https://brew.sh>`_ by executing:

.. code-block:: bash

brew install cssr-tools/opm/resinsight

Then, you should be able to open resinsight by typing in the terminal **resinsight**.

.. _vpofff:

Python package
Expand Down Expand Up @@ -44,6 +56,14 @@ install the Python requirements in a virtual environment with the following comm

Typing **git tag -l** writes all available specific versions.

.. note::

For not macOS users, to install the (optional but recommended) dependencies used for the figure's LaTeX formatting, execute

**sudo apt-get install texlive-fonts-recommended texlive-fonts-extra dvipng cm-super**

For macOS users, the LaTeX dependency can be installed from https://www.tug.org/mactex/

.. _opmflow:

OPM Flow
Expand All @@ -52,6 +72,13 @@ You also need to install:

* OPM Flow (https://opm-project.org, Release 2025.10 or current master branches)

Binary packages
+++++++++++++++

See the `downloading and installing <https://opm-project.org/?page_id=36>`_ OPM Flow online documentation for
instructions to install the binary packages in Ubuntu and Red Hat Enterprise Linux, and for other platforms which are
supported either via source builds or through running a virtual machine.

.. tip::

See the `CI.yml <https://github.com/cssr-tools/pofff/blob/main/.github/workflows/CI.yml>`_ script
Expand Down Expand Up @@ -89,30 +116,40 @@ in the terminal the following lines (which in turn should build flow in the fold

.. _macOS:

Brew formula for macOS
++++++++++++++++++++++
For macOS, there are no available binary packages, so OPM Flow needs to be built from source. Recently, a formula to build flow using brew has
been added in `https://github.com/cssr-tools/homebrew-opm <https://github.com/cssr-tools/homebrew-opm>`_.
Then, you can try to install flow (v2025.10) by simply typing:

.. code-block:: console

brew install cssr-tools/opm/opm-simulators

You can check if the installation of OPM Flow succeded by typing in the terminal **flow \-\-help**.

.. tip::
See the actions in the `cssr-tools/homebrew-opm <https://github.com/cssr-tools/homebrew-opm/actions>`_ repository.

Source build in macOS
+++++++++++++++++++++
For macOS, there are no available binary packages, so OPM Flow needs to be built from source, in addition to the dune libraries
(see the `prerequisites <https://opm-project.org/?page_id=239>`_, which can be installed using macports or brew). For example,
with brew the prerequisites can be installed by:
If you would like to build the latest OPM Flow from the master branch, then you can first install the prerequisites using brew:

.. code-block:: console

brew install boost cmake openblas suite-sparse python@3.13

In addition, it is recommended to upgrade and update your macOS to the latest available versions (the following steps have
worked for macOS Tahoe 26.1 with Apple clang version 17.0.0).
After the prerequisites are installed and the vpofff Python environment is created (see :ref:`vpofff`),
then building OPM Flow and the opm Python package can be achieved with the following lines:
After the prerequisites are installed, then building OPM Flow can be achieved with the following lines:

.. code-block:: console

CURRENT_DIRECTORY="$PWD"

deactivate
source vpofff/bin/activate

for module in common geometry grid istl
do git clone https://gitlab.dune-project.org/core/dune-$module.git --branch v2.9.1
do git clone https://gitlab.dune-project.org/core/dune-$module.git
cd dune-$module && git checkout v2.10.0 && cd ..
./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1
./dune-common/bin/dunecontrol --only=dune-$module make -j5
done
Expand All @@ -121,9 +158,8 @@ then building OPM Flow and the opm Python package can be achieved with the follo

for repo in common grid simulators
do git clone https://github.com/OPM/opm-$repo.git
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DWITH_NDEBUG=1 -DUSE_MPI=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
mkdir build/opm-$repo && cd build/opm-$repo
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
if [[ $repo == simulators ]]; then
make -j5 flow
else
Expand All @@ -132,15 +168,11 @@ then building OPM Flow and the opm Python package can be achieved with the follo
cd ../..
done

echo "export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin" >> $CURRENT_DIRECTORY/vpofff/bin/activate
echo "export PATH=\$PATH:$CURRENT_DIRECTORY/build/opm-simulators/bin" >> ~/.zprofile
source ~/.zprofile

deactivate
source vpofff/bin/activate

This builds OPM Flow, and it exports the path to the flow executable (i.e., executing in the terminal **which flow** should print the path).
This builds OPM Flow, and it exports the path to the flow executable. You can check if the installation of OPM Flow succeded by typing in the terminal **flow \-\-help**.

.. tip::
See `this repository <https://github.com/daavid00/OPM-Flow_macOS>`_ dedicated to build OPM Flow from source in the latest macOS (GitHub actions).
If you still face problems, raise an issue in the GitHub repository, or you could also send an email to the maintainers.

For macOS, the LaTeX dependency can be installed from https://www.tug.org/mactex/.
20 changes: 10 additions & 10 deletions docs/_sources/publication.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Figure 3:
plopm -i figure3/FIGURE3 -v 'multx * 1.75' -grid 'black,1e-2' -remove 1,1,0,1 -d 20,15 -clabel 'Thickness map [cm]' -cformat .2f -cnum 5 -f 20 -o figure3 -save figure3b

Figure 4 requires running the SPE11A cases using `pyopmspe11 <https://github.com/OPM/pyopmspe11>`_, which uses the simulation grid. You might need to edit the configuration files to
adjust the computational resources to your machine (e.g., `r3_cp_1cmish_capmax2500Pa.txt <https://github.com/OPM/pyopmspe11/blob/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.txt>`_ is run with 32 cpus).
adjust the computational resources to your machine (e.g., `r3_cp_1cmish_capmax2500Pa.toml <https://github.com/OPM/pyopmspe11/blob/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.toml>`_ is run with 32 cpus).

.. tip::
You can install `pyopmspe11 <https://github.com/OPM/pyopmspe11>`_ by executing in the terminal:
Expand All @@ -35,18 +35,18 @@ adjust the computational resources to your machine (e.g., `r3_cp_1cmish_capmax25
.. code-block:: bash

mkdir figure4 && cd figure4
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.txt
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.txt
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r4_Cart_1mm_capmax2500Pa.txt
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r5_Cart_1mm_capmax2500Pa_strictol.txt
pyopmspe11 -i r2_Cart_1cm_capmax2500Pa.txt -o r2_Cart_1cm_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r3_cp_1cmish_capmax2500Pa.txt -o r3_cp_1cmish_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r4_Cart_1mm_capmax2500Pa.txt -o r4_Cart_1mm_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r5_Cart_1mm_capmax2500Pa_strictol.txt -o r5_Cart_1mm_capmax2500Pa_strictol -t 1 -r 280,1,120 -w 0.16666666666666666
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.toml
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r3_cp_1cmish_capmax2500Pa.toml
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r4_Cart_1mm_capmax2500Pa.toml
curl -O https://raw.githubusercontent.com/OPM/pyopmspe11/refs/heads/main/benchmark/spe11a/r5_Cart_1mm_capmax2500Pa_strictol.toml
pyopmspe11 -i r2_Cart_1cm_capmax2500Pa.toml -o r2_Cart_1cm_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r3_cp_1cmish_capmax2500Pa.toml -o r3_cp_1cmish_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r4_Cart_1mm_capmax2500Pa.toml -o r4_Cart_1mm_capmax2500Pa -t 1 -r 280,1,120 -w 0.16666666666666666
pyopmspe11 -i r5_Cart_1mm_capmax2500Pa_strictol.toml -o r5_Cart_1mm_capmax2500Pa_strictol -t 1 -r 280,1,120 -w 0.16666666666666666
plopm -v xco2l -r 53 -mask satnum -maskthr 7e-5 -i 'r2_Cart_1cm_capmax2500Pa/flow/R2_CART_1CM_CAPMAX2500PA r3_cp_1cmish_capmax2500Pa/flow/R3_CP_1CMISH_CAPMAX2500PA r4_Cart_1mm_capmax2500Pa/flow/R4_CART_1MM_CAPMAX2500PA r5_Cart_1mm_capmax2500Pa_strictol/flow/R5_CART_1MM_CAPMAX2500PA_STRICTOL' -cnum 3 -xlnum 8 -clabel 'OPM results for SPE11A: CO$_2$ mass fraction (liquid phase) after 2 days' -d 16,6.5 -t "(a) Cartesian grid 1cm (b) Corner-point grid 1cmish (c) Cartesian grid 1mm (d) Cartesian grid 1mm stricter tolerances" -yunits cm -xunits cm -yformat .0f -xformat .0f -f 16 -save figure4 -cformat .2e -suptitle 0 -subfigs 2,2 -cbsfax 0.35,0.97,0.3,0.02 -delax 1 -c '#9ca245 #9da347 #9fa44a #a0a64d #a2a750 #a3a953 #a5aa56 #a6ac59 #a8ad5c #a9af5f #abb062 #adb164 #aeb367 #b0b46a #b1b66d #b3b770 #b4b973 #b6ba76 #b7bc79 #b9bd7c #babf7f #bcc082 #bec184 #bfc387 #c1c48a #c2c68d #c4c790 #c5c993 #c7ca96 #c8cc99 #cacd9c #cbcf9f #cdd0a2 #cfd1a4 #d0d3a7 #d2d4aa #d3d6ad #d5d7b0 #d6d9b3 #d8dab6 #d9dcb9 #dbddbc #dcdfbf #dee0c1 #e0e1c4 #e1e3c7 #e3e4ca #e4e6cd #e6e7d0 #e7e9d3 #e9ead6 #eaecd9 #eceddc #edefdf #eff0e1 #f1f1e4 #f2f3e7 #f4f4ea #f5f6ed #f7f7f0 #f8f9f3 #fafaf6 #fbfcf9 #fdfdfc #ffffff #fefbfb #fdf7f7 #fcf3f3 #fbefef #faebeb #f9e7e7 #f8e3e3 #f7e0e0 #f6dcdc #f5d8d8 #f4d4d4 #f3d0d0 #f2cccc #f1c8c8 #f0c5c5 #efc1c1 #eebdbd #edb9b9 #ecb5b5 #ebb1b1 #eaadad #e9aaaa #e8a6a6 #e7a2a2 #e69e9e #e59a9a #e49696 #e39292 #e28f8f #e18b8b #e08787 #df8383 #de7f7f #dd7b7b #dc7777 #db7474 #da7070 #d96c6c #d86868 #d76464 #d66060 #d55c5c #d45959 #d35555 #d25151 #d14d4d #d04949 #cf4545 #ce4141 #cd3e3e #cc3a3a #cb3636 #ca3232 #c92e2e #c82a2a #c72626 #c62323 #c51f1f #c41b1b #c31717 #c21313 #c10f0f #c00b0b'

A similar figure without the need of running the simulations (not showing the sands in the background and using the reporting grid) can be obtained by downloading the SPE11A benchmark data in csv format available at
`this website <https://darus.uni-stuttgart.de/dataset.xhtml?persistentId=doi:10.18419/DARUS-4750>`_ (the submitted benchmark data does not include the `r5_Cart_1mm_capmax2500Pa_strictol.txt <https://github.com/OPM/pyopmspe11/blob/main/benchmark/spe11a/r5_Cart_1mm_capmax2500Pa_strictol.txt>`_ results):
`this website <https://darus.uni-stuttgart.de/dataset.xhtml?persistentId=doi:10.18419/DARUS-4750>`_ (the submitted benchmark data does not include the `r5_Cart_1mm_capmax2500Pa_strictol.toml <https://github.com/OPM/pyopmspe11/blob/main/benchmark/spe11a/r5_Cart_1mm_capmax2500Pa_strictol.toml>`_ results):

.. code-block:: bash

Expand Down
2 changes: 1 addition & 1 deletion docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1>About pofff<a class="headerlink" href="#about-pofff" title="Link to this hea
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2025, NORCE Research AS.</p>
<p>&#169; Copyright 2025-2026, NORCE Research AS.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
2 changes: 1 addition & 1 deletion docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h2>pofff<a class="headerlink" href="#pofff" title="Link to this heading"></a
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2025, NORCE Research AS.</p>
<p>&#169; Copyright 2025-2026, NORCE Research AS.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h1>Configuration file<a class="headerlink" href="#configuration-file" title="Li
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2025, NORCE Research AS.</p>
<p>&#169; Copyright 2025-2026, NORCE Research AS.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2>Seek support<a class="headerlink" href="#seek-support" title="Link to this h
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2025, NORCE Research AS.</p>
<p>&#169; Copyright 2025-2026, NORCE Research AS.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
Loading