A 2D, two-phase, immiscible reservoir simulator using TPFA (two-point flux approximation). Documentation.
- small: all of its physics fit in
core.py's 300 lines of code - capable: two-phase, slight compressibility, BHP control – but 2D uniform grid, immiscible, isothermal, and only simple well models.
- adjoint model included; verified against finite differences
- python: easy to demo in a web browser via Colab or WASM
- fast: comparable to JutulDarcy (but no waiting on JIT startup!) at equal accuracy on 2D two-phase cases
- reliable: reproduces the numbers of the Matlab code (2007) from NTNU/Sintef by Jørg E. Aarnes, Tore Gimse, and Knut–Andreas Lie
- extensively tested and documented
The examples double as regression tests. Each has a page in the documentation.
Please let me know (or make a PR) if you use this in your work, and I will add it to this list.
TODO
Get uv and do uv sync,
after which you can run the tests with uv run pytest (no further args),
and linting with uv run ruff check.

