Publications

Data and code dois

The global gradient-based groundwater model framework G³M-f

The global gradient-based groundwater model framework G³M-f is an extensible model framework.
Its main purpose is to be used as a main building block for the global groundwater mode G³M.
G³M is a newly developed gradient-based groundwater model which adapts MODFLOW [@harbaugh2005modflow] principles for the globalscale.
It is written in C++ and intended to be coupled to the global hydrology model WaterGAP (http://watergap.de), but can also be used for regional groundwater models and coupling to other hydrology models.
While it is intended to be used as a in memory coupled model it is also capable of running a standard standalone groundwater model.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Build

mkdir build
cd build
cmake ../
make

Equations

The three dimensional flow of water through the porous material between the cells is solved as a partial differential equation.
Where K is the hydraulic conductivity [L/T] along the three axis, S the specific storage and W is the volumentric flux per unit volume in and out of the groundwater system.
The hydraulic conductivity between two cells is caluclated b yusing the harmonic mean.
The equation is solved using a conjugate gradient approach and an Incomplete LUT preconditioner.

Additonal information on the equations can be found in the very detailed MODFLOW documentation: Modflow 2005

Boundary Conditions

G³M support multiple boundary condition types:

No-flow boundary

Static head boundary

General head boundary

Groundwater recharge

Lakes

Wetlands

Different river approaches

New flows can be defined in Model/ExternalFlows.hpp.
The domain boundary is currently defined implicitly through the input grid as no-flow for grid files and as ocean boundary for irregual grids.
This behaviour can be changed in DataProcessing/Neighbouring.hpp.

Quick start

The following picture shows the conceptual example model:

After compilation run:

simple_model

It will yield a depth to water table CSV file called wtd.csv for a simple model.

How to use

The follwing will guide you through the building blocks of the simple model shipped along with the code.
It assumes that you’ve constructed your model domain and have input data for the following

Groundwater recharge (recharge_simple.csv)

Surface elevation (elevation_simple.csv)

Rivers, location, elevation and depth (rivers_simple.csv)

Hydrogeology (lithology_simple.csv)

Riverbed conductance (rivers_simple.csv)

Inital head guess (otherwise the model assumes the surface elevation as best guess) (“heads_simple.csv”)

Center building stone for the framework is the GW_interface connecting any model with the groundwater code.
Implement this interface if you want to couple your model to G³M-f or build a custom standalone application.
In tests/SimpleModel you’ll find an example implementation explained further in the following.

Deployment in other models

The main steps towards your own model is to implement the GW_interface and provide a DataReader.
A standlone version can be easily implemented by extending the simple example provided above.

In memory coupling

G³M-f is written with the coupling to other models in mind.
In contrast to other model coupling efforts, it is not necessary to write out files in one model and read them in in another model.
You can diretly link G³M-f with your existing executable and by providing a class in your already existing model code that implements the gw_interface, you are free to call the simulate() function at any timestep you like.
Furthermore, the interface provides pointer containers and callbacks to transfer data in memory without the need to waste time on I/O.

Please contact us if you need advice.

Running the tests

Automated tests consits of gunit test which are compiled automatically with the attached cmake file.
You can run them by executing the test executable.

Versioning

Authors and Contributors

License

This project is licensed under the GNU General Public License - see the LICENSE file for details.
Please note that the code contains a modified version of the Eigen3 library which is published under the MPL 2.0.