|Reactive transport in aquatic ecosystems: Rapid model prototyping in the open source software R|Soetaert, K.; Meysman, F. (2012). Reactive transport in aquatic ecosystems: Rapid model prototyping in the open source software R. Environ. Model. Softw. 32: 49-60. dx.doi.org/10.1016/j.envsoft.2011.08.011
In: Environmental Modelling & Software. Elsevier: Oxford. ISSN 1364-8152; e-ISSN 1873-6726, meer
Reactive transport; Model; Open source; Software; R
The concentrations of many natural compounds are altered by chemical and biological transformations, and physical processes such as adsorption and transport. Their fate can be predicted using reactive transport models that describe reaction and advective and dispersive movement of these components in their natural environment.
Recently a number of software packages have been implemented in the open source software R that allow one to implement reactive transport models.
Central to this is the ReacTran R-package, a comprehensive collection of functions for modeling reactive components that may be distributed over multiple phases, whose dynamics are coupled through biological and geochemical reactions, and that are transported in one-, two- or three-dimensional domains with simple geometries. Dedicated solution methods are in R-packages deSolve and rootSolve.
The modeling packages facilitate the simulation of reaction and transport of components for spatial scales ranging from micrometers to kilometers and spanning multiple time-scales. As they are influenced in similar ways, the same functions can solve biogeochemical models of the sediment, groundwater, rivers, estuaries, lakes or water columns, experimental setups, or even describe reaction and transport within flat, cylindrical or spherical bodies, such as organisms, aggregates, or the dispersion of individuals on flat surfaces and so on.
We illustrate the use of R for reactive transport modeling by three applications spanning several orders of magnitude with respect to spatial and temporal scales. They comprise (1) a model of an experimental flow-through sediment reactor, where fitting so-called breakthrough curves are used to derive sulfate reduction rates in an estuarine sediment, (2) a conservative and reactive tracer addition experiment in a small stream, which implements the concept of river spiraling, and (3) a 2-D and 3-D model that describes oxygen dynamics in the upper layers of the sediment, interspersed with several hotspots of increased reaction intensities.
The packages ReacTran, deSolve and rootSolve are implemented in the software R and thus available for all popular platforms (Linux, Windows, Mac). Models implemented using this software are short and easily readable, yet they are efficiently solved. This makes R extremely well suited for rapid model prototyping.