Skip to main content

MODFLOW 6 and PHREEQC Reactive Transport Modeling

mf6rtm logo

JOSS Zenodo

PyPI Version Python Platforms License

main CI Linux CI macOS Docs Coverage

develop CI Linux CI macOS Docs Coverage

Benchmarks

Benchmark comparing model results against PHT3D are in benchmark/. Each folder contains a Jupyter notebook to write and execute an MF6RTM model via the MUP3D class. Additionally, PHT3D files are provided in the corresponding pht3d directory for each example.

Considerations

The current version is intended to work with structured grids (dis object in MF6), unstructured grids (disv) and one MF6 simulation that includes the flow and transport solutions. No support is currently provided for a 'flow then transport scheme,' meaning that advanced packages cannot be incorporated yet.

On the PHREEQC side, the following have been included:

  • Solution
  • Equilibrium phases
  • Cation Exchange
  • Surface Complexation
  • Kinetic Phases

Most options for each phreeqc block can be passed by adding list with options. However, not all options had been tested, so please create an issue if any option is not working or crashing the model.

Software requirements

All dependencies and executables are included in this repo. This package extensively uses modflowapi and phreeqcrm

Installation

Quick Start with pip

The package can be installed via pip:

pip install mf6rtm

From conda-forge (coming soon)

A conda-forge recipe is being prepared but not yet submitted -- conda install -c conda-forge mf6rtm isn't available yet. Use the pip install above in the meantime.

Installing MODFLOW 6 executables

After installing mf6rtm, install the MODFLOW 6 executables:

pip install modflow-devtools
get-modflow --subset mf6,libmf6,gridgen :python

Once installed, the executables in envs/[env-name]/bin will be automatically invoked whenever mf6rtm runs within the environment.

Custom MODFLOW Versions

If you need custom or older versions of mf6 (e.g., for running PESTPP on an HPC cluster), place them in a separate directory and use the provided utility to bring them to the model working directory:

from mf6rtm import utils

utils.prep_bins(model_dir, src_path=path_to_bins)

Running the benchmark notebooks

We have provided some benchmarks in the form of Jupyter notebooks. We have also included the executables needed to run them out of the box. Nevertheless, they can also be run using the executables downloaded with modflow-devtools.

Developing

With Pixi

For development, we use pixi for fast, reproducible environments:

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/mf6rtm.git
cd mf6rtm

# Install development environment with all dependencies, including an
# editable install of mf6rtm itself -- `import mf6rtm` works right away,
# no separate `pip install -e .` step needed
pixi install

# Run tests -- this fetches the MODFLOW 6 executables it needs
# automatically (via the install-modflow/install-benchmark-bins task
# dependencies); run those two tasks directly if you just want the
# executables on disk for interactive use, without running the suite
pixi run test

# Run tests with coverage
pixi run test-cov

# Run linting
pixi run lint

# Test with a specific Python version (py311, py312, py313, or py314)
pixi run -e py311 test

Contributions, bug reports, and questions are welcome. See CONTRIBUTING.md for how to get involved.

Documentation

The documentation is available in mf6rtm - read the docs

Citation

If you use mf6rtm, please cite the JOSS paper:

Ortega-Tong, P., Aufdenkampe, A., Prieto-Estrada, A., Foster, A., Tomasula, P., & Mancewicz, L. (2026). MF6RTM: a Python package for predictive reactive transport modeling via the MODFLOW 6 and PHREEQC APIs. Journal of Open Source Software, 11(127), 11173. https://doi.org/10.21105/joss.11173

@article{OrtegaTong2026,
  title   = {MF6RTM: a Python package for predictive reactive transport modeling via the MODFLOW 6 and PHREEQC APIs},
  author  = {Ortega-Tong, Pablo and Aufdenkampe, Anthony and Prieto-Estrada, Andres and Foster, Allan and Tomasula, Paul and Mancewicz, Lauren},
  journal = {Journal of Open Source Software},
  year    = {2026},
  volume  = {11},
  number  = {127},
  pages   = {11173},
  doi     = {10.21105/joss.11173}
}

Funding

The developing of mf6rtm was kindly supported by INTERA, Inc.

Metadata

Release files for mf6rtm 0.6.1

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

Source distribution (sdist)

Source distribution for mf6rtm 0.6.1
File Size Uploaded Provenance Actions
mf6rtm-0.6.1.tar.gz 2.0 MB With provenance Details for mf6rtm-0.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 3.3 MB

Release files / mf6rtm-0.6.1.tar.gz

Download URL mf6rtm-0.6.1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
23806eb1246b93a3bb762d0bcf8a55949bff27669da526def0d86269f466881f
BLAKE2b-256 checksum
How to use checksums
36cea9d51b77f8aca18e1187ed6e236ab367fcd23d696b564057b3d3e77777f5
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 Nov 17, 2026.

Transparency log

Release files / mf6rtm-0.6.1-py3-none-any.whl

Download URL mf6rtm-0.6.1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4509ef0882afd4b9d9cbd25ea97feb891f2719896f13280cb2dac057970e8cc2
BLAKE2b-256 checksum
How to use checksums
8604d33685aad07ea178e89f68a3fa18e1d44c23ffd68e8458fbfb5c66de19a2
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 Nov 17, 2026.

Transparency log

Security for mf6rtm 0.6.1

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.

Select from 2 files

Attestation for mf6rtm-0.6.1.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 Nov 17, 2026.

Transparency log

A 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.

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