EGU General Assembly 2021
© Author(s) 2021. This work is distributed under
the Creative Commons Attribution 4.0 License.

Geochemical and reactive transport modelling in R with the RedModRphree package

Marco De Lucia1 and Michael Kühn1,2
Marco De Lucia and Michael Kühn
  • 1GFZ German Research Centre for Geosciences, Fluid Systems Modelling, Potsdam, 14473, Germany (
  • 2Institute of Geosciences, University of Potsdam, Potsdam, 14476, Germany

The modern advances in computing and experimental capabilities in the research of water-rock-interactions require geoscientists to routinely combine laboratory data and models to produce knowledge in order to solve pressing societal challenges connected to subsurface utilization. Data science is hence a more and more pervasive instrument also for  geochemists, which in turn demands flexible and easy to learn software adaptable to their specific needs. 
In this contribution we showcase geochemical and reactive transport modelling with our RedModRphree [1] extension package for the GNU R environment and programming language. The new version of the package leverages the R interface to the established PHREEQC geochemical simulator maintained by its original authors [2]. R has established itself as de facto standard language for statistics and machine learning. It enjoys increasing diffusion in many applied scientific fields such as bioinformatics, chemometrics and ecological modelling. The availability of excellent third party extensions such as the thermodynamic package CHNOSZ [3], which extends the functionalities of SUPCRT92, as well as its advanced graphical and numerical capabilities, make R an attractive platform for comprehensive geochemical data analysis, experiment evaluation and modelling. 
The aim of RedModRphree is to provide the user with an easy-to-use, high-level interface to program algorithms involving geochemical models, which are then solved using the PHREEQC engine: parameter calibration, error and sensitivity analysis, visualization, up to CPU-intensive parallel coupled reactive transport models. Among the out-of-the-box features included in RedModRphree, we highlight the computation and visualization of Pourbaix (Eh-pH) diagrams and the implementation of 1D advective reactive transport supporting the use of surrogate models replacing expensive PHREEQC calculations [4]. RedModRphree is open source and can be installed from

[1] De Lucia, M. and Kühn, M.: Coupling R and PHREEQC: Efficient Programming of Geochemical Models, Energy Procedia, 40, 464–471,, 2013.

[2] Charlton, S.R. and Parkhurst, D.L.: Modules based on the geochemical model PHREEQC for use in scripting and programming languages, Computers & Geosciences 37, 10, 1653–1663,, 2011.

[3] Dick, J.M.: CHNOSZ: Thermodynamic Calculations and Diagrams for Geochemistry, Frontiers in Earth Science, 7,, 2019.

[4] Jatnieks, J., De Lucia, M., Dransch, D., and Sips, M.: Data-driven Surrogate Model Approach for Improving the Performance of Reactive Transport Simulations, Energy Procedia, 97, 447–453,, 2016.


How to cite: De Lucia, M. and Kühn, M.: Geochemical and reactive transport modelling in R with the RedModRphree package, EGU General Assembly 2021, online, 19–30 Apr 2021, EGU21-2636,, 2021.


Display file