Advances in Geosciences (Oct 2021)
Geochemical and reactive transport modelling in R with the RedModRphree package
Abstract
Advances in computing and experimental capabilities in the research of water-rock-interactions require geoscientists to routinely combine laboratory data and models to produce new knowledge. Data science is hence a more and more pervasive instrument for geochemists, which in turn demands flexible and easy to learn software adaptable to their specific needs. The GNU R language and programming environment has established itself as de facto standard language for statistics and machine learning, enjoying increasing diffusion in many applied scientific fields such as bioinformatics, chemometrics and ecological modelling. The availability of excellent third party extensions as well as its advanced graphical and numerical capabilities make R an ideal platform for comprehensive geochemical data analysis, experiment evaluation and modelling. We introduce the open source RedModRphree extension package, which leverages the R interface to the established PHREEQC geochemical simulator. The aim of RedModRphree is to provide the user with an easy-to-use, high-level interface to program algorithms involving geochemical models: parameter calibration, error and sensitivity analysis, thermodynamical database manipulation, 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 using full speciation as computed by PHREEQC and the implementation of 1D advective reactive transport supporting the use of surrogate models replacing expensive equation-based calculations.