EuroSciPy 2026

Parallel Reactive Groundwater Transport Modeling
2026-07-20 , Room 1.19 (Ground Floor, Shannon)

Contaminated groundwater often carries multiple dissolved chemical species that react with each other, potentially causing mineral precipitation and altering subsurface flow properties. Simulating these coupled processes requires modeling groundwater flow, multi-species solute transport, and geochemical reactions simultaneously. This talk presents rtmf6, a new open-source reactive transport model that couples MODFLOW 6 (groundwater flow and transport) with PHREEQC 3 (geochemical reactions) through the Python libraries pymf6 and PhreeqPy. A key design goal was parallelization: species transport runs as independent parallel processes, while geochemical computations use multi-threading. Benchmark results show good agreement with the established model PHT3D, while rtmf6 supports a substantially broader range of applications by leveraging the full capabilities of MODFLOW 6.


Contaminated groundwater often carries multiple dissolved chemical species that can react with each other. These reactions may cause mineral precipitation — the formation of solid phases from dissolved substances — which can reduce the hydraulic conductivity (the ease with which water flows through) of the subsurface. Interactions with the solid matrix of the aquifer material, such as cation exchange — where positively charged ions in solution swap with ions bound to mineral surfaces — can further alter dissolved species concentrations.

Numerical modeling of these processes encompasses three groups: (1) groundwater flow, (2) multi-species solute transport, and (3) geochemical transformations of the transported species. One approach to simultaneously simulate all three process groups is to couple a flow and transport model with a hydrogeochemical model. In the approach presented here, MODFLOW 6 handles the simulation of groundwater flow and solute transport, while PHREEQC 3 computes the geochemical reactions.

MODFLOW 6 is the current version of the MODFLOW framework, a widely used open-source groundwater modeling system. It can simulate groundwater flow (GWF), solute transport (GWT), energy transport (GWE), and particle tracking (PRT). PHREEQC is a well-established geochemical modeling tool for computing equilibrium and kinetic reactions in aqueous solutions. Coupling the two models requires runtime data exchange so that concentrations in all model cells can be updated according to the computed chemical reactions at each exchange time step.

The data exchange on the MODFLOW 6 side is handled by pymf6, an open-source Python library that provides a high-level interface for stepping through a simulation at runtime. It can inspect and modify MODFLOW 6 variables during execution. On the PHREEQC side, data exchange is managed by PhreeqPy, which uses PhreeqcRM — a PHREEQC variant specifically designed for coupling with transport models. PhreeqcRM exposes a comprehensive API that enables programmatic control over all geochemical modeling capabilities.

The newly developed reactive transport model rtmf6, presented here, is built on pymf6 and PhreeqPy. Since computation times can be substantial for large models, a key design requirement was to parallelize as many computational steps as possible. Two parallelization strategies are implemented: flow and transport modeling runs as parallel processes, while the geochemical computations in PhreeqcRM use multi-threading.

Starting from a base MODFLOW 6 model, pymf6 generates a separate input dataset for each transported species. Each component model contains only the species-specific parameters that differ from the base model and references the base model's input data to avoid duplication. Depending on the application, this typically yields 10 to 30 component models, or more for complex geochemical scenarios. Each component model runs in its own process. Because the transport of each species is independent within a given time step, all component models can execute in parallel. When at least one CPU core is available per component model, this yields highly parallel execution of the flow and transport computations.

The optimal number of threads for PhreeqcRM depends on the available CPU cores and the number of model cells. Large models can therefore potentially utilize many cores to accelerate the geochemical computations. Performance benchmarks for this aspect are currently in progress.

Benchmark results from rtmf6 show good agreement with simulations from PHT3D, an established reactive groundwater transport model. Because rtmf6 leverages the full capabilities of MODFLOW 6, it can address a substantially broader range of applications than PHT3D. Comparative performance benchmarks against PHT3D are currently in progress.


Expected audience expertise: Domain: some Expected audience expertise: Python: some Supporting material: Supporting material Project homepage or Git: Project homepage or Git Your relationship with the presented work/project: Original author or co-author

Dr. Mike Müller has been working with Python since 1999 and teaching it professionally since 2004. As a trainer at Python Academy (https://www.python-academy.com), he has taught over 580 Python courses totaling more than 1,400 teaching days to thousands of participants worldwide.

Mike has taught more than 75 tutorials at Python conferences, including 29 tutorials at PyCon US over the years. He is known for his hands-on teaching approach, live coding demonstrations, and comprehensive course materials that participants can use as references long after the tutorial ends. His tutorials blend practical examples with solid theoretical foundations, making complex topics accessible and immediately applicable.

Beyond teaching, Mike is deeply involved in the Python community. He has organized conferences including PyCon DE, EuroSciPy, and numerous BarCamps. His contributions to the community have been recognized with the PSF Community Service Award and PSF Fellow status. He serves as chair of the German Python Software Verband.

Mike holds a doctorate in hydrology and brings a scientific perspective to programming education. He believes in learning by doing and creates supportive environments where participants feel comfortable asking questions and experimenting with code.

Dr. Mike Müller

Education

  • German Diplom-Ingenieur Wasserwirtschaft (5 years) at University of
    Technology Dresden,
    Germany -- Wasserwirtschaft literal translation water management, engineering
    degree in water resources management with focus on groundwater hydrology and
    modelling
  • MS in Hydrology and Water Resources at University of Arizona, Tucson, USA
  • Ph.D. in Mining Hydrology at BTU Cottbus, Germany -- Development of a coupled
    surface water and groundwater model for open pit mine lakes (PITLAKQ)

Work Experience

  • Combination of hydrology and software development
  • Coupling of models
  • Python teaching -- since 2004, >1500 full teaching days with focus on scientist and engineers

Model Coupling

I have experience in coupling different hydrological and hydraulic models, such as:

PITLAKQ

This is my Ph.D. work that couples a finite volume groundwater model (PCGEOFIM),
a hydrodynamic and water quality lake Model (CE-QUAL-W2), and a
hydro-geo-chemical model (PHREEQC).
PITLAKQ is open source.
It has been applied world wide.
I used it for pit lakes in Germany, Australia, and Canada.
Others have used it in many other countries of the world.

Coupling of a river flood model and a groundwater model

I have been involved in a research project that couples a river model, a sewer
pipeline model and groundwater model for the river Elbe in the city of Dresden,
Germany.
I was responsible for the coupling of the river model and the groundwater
model.

Rainfall runoff model -- groundwater model

I implemented a coupling of a rainfall runoff model (ArcEGMO) and a groundwater
model (PCGEOFIM) for a watershed in Germany.

Density-driven flow in groundwater and lake

I coupled a density-driven groundwater flow and transport model (MODMST) to
PITLAKQ.
This was used for a long-term simulation of a sub-aquatic landfill,
i.e. a lake over a deposit of mining waste.

MODFLOW with dynamic boundary conditions - pymf6

I am the developer of pymf6
that allows to interact with MODFLOW 6 via Python at runtime.
This can be used to implement dynamic boundary conditions.
Examples are:

  • water-level-controlled wells that dynamically adjust their pumping rates
    based on simulated water levels in the aquifer
  • dynamic values of the resistance of the colmation layer at the river bottom
    that depend on the flow direction between river and aquifer
  • technical heat boundary conditions in urban settings such as building
    basements and tunnels

MODFLOW 6 with AEM

I coupled an Analytic Element Model (AEM)
TTim with MODFLOW 6
via pymf6.
This allows to combine the grid-based approach of MODFLOW with the analytic,
grid-less approach of AEMs.

MODFLOW 6 with PHREEQC -- rtmf6

I coupled MODFLOW 6 with the geochemical model PHREEQC via
PhreeqPyusing
PhreeqcRM.
I am the author of PhreeqPy.
The result is rtmf6.

This speaker also appears in: