Skip to main content

MiniRes

The MiniRes logo

A simple petroleum reservoir simulator using TPFA (two-point flux approximation). Documentation.

  • Small: all of its physics fit in core.py's 400 lines of code.
  • Capable: two-phase, slight compressibility, BHP control, well paths, irregular outlines and faults (inactive cells), aquifers – but 2D uniform grid, immiscible, isothermal, and simple well models and operation.
  • Adjoint model included; verified against finite differences.
  • Python: PyPI (pip install minires), or demo it in a web browser via Open In Colab (backend: Google) or WASM (no backend!).
  • Fast: similar to JutulDarcy's (but no JIT startup/wait) at equal accuracy on 2D two-phase cases of size $100$ – $10^5$.
  • Reliable: reproduces the numbers of the Matlab code (2007) from NTNU/Sintef by Jørg E. Aarnes, Tore Gimse, and Knut–Andreas Lie. Further validated against Buckley–Leverett's analytic solution, ECLIPSE's numbers on the Egg model and JutulDarcy's on quarter five-spot, SPE-10, and Egg.
  • Tested extensively: GitHub CI, with many examples doubling as regression tests.

The Egg model: permeability, pressure, oil saturation, and the adjoint sensitivity of a producer's water cut

Used by

Please let me know (or make a PR) if you use this in your work, and I will add it to this list.

Installation

Requires Python >=3.12.

pip install minires

or, with uv,

uv add minires

Since 0.x minor bumps may break the API (ref CHANGELOG.md), pin the minor version (minires~=0.3.0) and advance it deliberately. An unreleased snapshot is installed from git, pinned by commit hash:

pip install "minires @ git+https://github.com/patnr/MiniRes.git@<hash>"

Contributions

To also get the examples and tests, clone instead, and install in editable mode:

git clone https://github.com/patnr/MiniRes.git
cd MiniRes
uv sync  # or: pip install -e .
uv run pytest
uv run ruff check

Release files for minires 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minires 0.3.0
File Size Uploaded
minires-0.3.0.tar.gz 63.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minires 0.3.0
File Interpreter ABI Platform
minires-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 130.7 kB

Release files / minires-0.3.0.tar.gz

Download URL minires-0.3.0.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
858b91e089ac25fe9df002d30e71e8d1f1d8c3d51134d7f598af33edaba7dd47
BLAKE2b-256 checksum
How to use checksums
359545fe49d0e8fd79f7efe1ed9e730935e4ed3ab9147651f4fd3027051060b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / minires-0.3.0-py3-none-any.whl

Download URL minires-0.3.0-py3-none-any.whl
Size 67.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdb7f331fc1606d8b4e9efc2b9804c183a3dc5ad99cfe84d9562abb52a4f0fcf
BLAKE2b-256 checksum
How to use checksums
7c94e15c1963ff7026bd0dbbf978e421054ee66cecaa6bf8cd1eba9aebda1116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page