Skip to main content

Reactive transport model through MODFLOW 6 and PHREEQCRM

Project description

MF6RTM: Reactive Transport Model via the MODFLOW 6 and PHREEQCRM APIs

Tests Tests Coverage Status PyPI License

PyPI Version PyPI Versions DOI

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

Manual Installation with Conda/Mamba

If you prefer conda/mamba, create a dedicated environment:

mamba env create -f env.yml
mamba activate mf6rtm-dev

After activating the environment, install the MODFLOW6 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 (Recommended)

For development, we recommend using 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
pixi install

# Run tests
pixi run test

# Run tests with coverage
pixi run test-cov

# Run linting
pixi run lint

# Test with specific Python version
pixi run -e py311 test

With Conda/Mamba

Alternatively, use conda/mamba with the provided environment file:

# Install environment
conda env create -f env.yml
conda activate mf6rtm-dev

# Install development dependencies
pip install -r requirements_dev.txt

The development dependencies for testing are located in requirements_dev.txt. We have also provided dependencies with flopy and pyemu inside the repo but feel free to use your own distribution.

Funding

The developing of mf6rtm was kindly funded and supported by Intera, Inc.

Authors

Pablo Ortega (Portega)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mf6rtm-0.3.2.tar.gz (60.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mf6rtm-0.3.2-py3-none-any.whl (63.9 kB view details)

Uploaded Python 3

File details

Details for the file mf6rtm-0.3.2.tar.gz.

File metadata

  • Download URL: mf6rtm-0.3.2.tar.gz
  • Upload date:
  • Size: 60.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for mf6rtm-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b825b38eee5c2bfe364b7dc07ba78fec4e65c8747afe6015470e331cecbd78b9
MD5 80332eaafc9042f0f0656d07a9d9b1f2
BLAKE2b-256 7d207e68568a017ba502c918f9a0bf33f8e7b3d9a0e2d84d1fc1b01a5533af4b

See more details on using hashes here.

File details

Details for the file mf6rtm-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mf6rtm-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 63.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for mf6rtm-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ff27cb8e3747d265b438b9c795acb51848f48b7495ad533410e072f1a255a355
MD5 96ba31cff9773160ea2ff2c9507018a5
BLAKE2b-256 58fc848cead878c7bdbab6f11c61c2ef3ff881f43acc0273f2bc3c93fb121a5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page