MANTIS: A Python framework to solve extremely stiff isotope enabled reaction-transport equations using a Monolithic Assembly of Nonlinear Transport Interactions Solver (MANTIS)
MANTIS is a high-performance 1D reactive-transport modeling (RTM) framework written in Python. Unlike most reaction-transport codes, Mantis uses a fully coupled monolithic equation system. This approach allows to solve stiff, tightly coupled, non-linear advection-diffusion-reaction networks efficiently with minimal computational overhead. Mantis supports non-uniform grids, speciation, and adsorption as well as kinetic and equilibrium isotope effects.
MANTIS models are defined through a declarative interface that is easy to read, and has an integrated plotting system that supports asynchronous time-lapse video generation.
How is MANTIS Different from Other RTM Packages?
Many (if not most) geochemical reactive-transport modeling packages rely on operator splitting (such as Sequential Non-Iterative Approach [SNIA] or Sequential Iterative Approach [SIA]) or decoupled Picard (Gauss-Seidel) iterations:
-
Monolithic Coupling vs. Operator Splitting:
- Operator splitting alternates between solving pure transport and pure batch chemistry over a time step. While simple, it introduces splitting errors and often requires tiny time steps ($\Delta t$ on the order of seconds or hours) to avoid artificial oscillations or numerical divergence when reactions are fast and stiff.
- Picard iterations solve each chemical species sequentially, lagging cross-species couplings from the previous iteration. At sharp reaction fronts (e.g., where sulfide meets oxygen or ferric iron), this decoupling frequently causes severe numerical lag oscillations.
- MANTIS solves the entire system monolithically: Transport and reactions for all species are assembled into a single unified block-tridiagonal linear system at each Newton step. This achieves true simultaneous coupling and quadratic Newton convergence.
-
Unconditional Numerical Stability:
- Thanks to its fully implicit monolithic formulation, MANTIS does not suffer from Courant-Friedrichs-Lewy (CFL) or diffusion time step stability restrictions, enabling long-term simulations (centuries to millennia) with large time steps.
Current Limitations
While MANTIS provides robust and unconditionally stable solutions for stiff reactive transport, the current release has the following limitations:
- Time-Invariant Spatial Mesh:
- The spatial grid $z$ is static throughout the simulation. Dynamic grid adaptation, moving boundaries, or expanding domains (e.g., physical sediment column growth over time) are not currently supported.
- Time-Invariant Porosity:
- The porosity profile $\phi(z)$ is stationary in time (steady-state compaction). Transient sediment compaction or compaction-driven dynamic fluid expulsion over time is not currently modeled.
- Time-Invariant Temperature:
- The temperature profile of $T(z)$ is steady-state. Dynamic thermal evolution and time-dependent diffusion coefficients or rate constants driven by non-isothermal thermal transients are not currently supported.
Installation
MANTIS requires Python 3.12 or newer. Clone the repository and install in editable mode:
pip install mantis-rtm
mantis_create_examples.py
Dependencies include numpy, pandas, matplotlib, numba, sympy, chempy, and watchdog.
Quick Start Example
A quick-start tutorial is available in the ./docs folder
Running Tests
Run the unit test suite using pytest:
pytest
License
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.
Metadata
Release files for mantis-rtm 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mantis_rtm-0.6.0.tar.gz | 2.0 MB | With provenance | Details for mantis_rtm-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mantis_rtm-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for mantis_rtm-0.6.0-py3-none-any.whl |
Total release size: 2.1 MB
Release files / mantis_rtm-0.6.0.tar.gz
| Download URL | mantis_rtm-0.6.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf4f18fa13679849d6566d530ca1ae5a10a34804cff84f13bcc023a00ff67370
|
|
BLAKE2b-256 checksum How to use checksums |
04120554ea65247e2b25152397e2d1b8d4a7cf313d0c7134a0ab110a6526d75d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / mantis_rtm-0.6.0-py3-none-any.whl
| Download URL | mantis_rtm-0.6.0-py3-none-any.whl |
|---|---|
| Size | 154.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0202f66082934f00ef098b0ac8df08f0a5a0380baf730c051d5bb8ad1dfe0429
|
|
BLAKE2b-256 checksum How to use checksums |
b0b7b7240c251400dd8235230c3bf80c88e77c48f645c428f8433fed7bd07925
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logSecurity for mantis-rtm 0.6.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mantis_rtm-0.6.0.tar.gz
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 Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.