Skip to content

GEM-Standalone: Examples

The GEMS3K I/O files used in the gemcalc and node-gem test examples were exported using GEM-Selektor v.3 from the CalcDolo modeling project (included in the GEM-Selektor installer). This small, simple project demonstrates GEMS3K I/O file structures.

Example: calcite–dolomite benchmark (xGEMS in Python)

A demo reactive transport modeling of the calcite–dolomite benchmark1 2 using xGEMS can be found in the repository

GEMS-CSMP GEMS-OpenGeoSys

Example: Reactive Transport in a Calcite Column (GEMS3K TNode in C++)

This example models a hypothetical porous column filled with an inert material containing small amounts of reactive calcite. A Ca-poor MgCl₂ solution enters one end of the column as an infinite source, while the opposite end serves as an infinite sink. As fluid flows through the column (assuming instantaneous mineral-water reactions), two key reaction fronts develop:

  1. Calcite dissolves, and dolomite precipitates.
  2. Dolomite dissolves, leaving no reactive minerals in the column.

To define this system, only two initial chemical states are required:

  • Initial column composition: Stable calcite with trace amounts of Mg and Cl.
  • Source composition: MgCl₂ solution.

Both are provided in the CalcDolo project.

Initial Column Composition

The CalcDolo:G:CalcColumn:0001:0:1:25:0 SysEq record represents the initial column chemistry (excluding inert material).

Bulk Composition

Property    Name    Quantity    Units  
bi_         C       0.00035     M  
bi_         Ca      0.00025     M  
bi_         Cl      2e-07       M  
bi_         H       110.684     M  
bi_         Mg      1e-07       M  
bi_         O       55.3428     M  

Equilibrium Speciation

At 1 bar and 25°C, equilibrium calculations produce the following speciation:

Screen-Calcite-Column-0001.png

Here, partial calcite dissolution (isolated from atmospheric air) results in a slightly alkaline, low-ionic-strength solution.

Source Solution Composition

The CalcDolo:G:CalcColumn:0000:0:1:25:0 SysEq record defines the MgCl₂ source solution:

Bulk Composition

Property    Name    Quantity    Units  
bi_         C       0.0001001   M  
bi_         Ca      1e-07       M  
bi_         Cl      0.016       M  
bi_         H       110.684     M  
bi_         Mg      0.008       M  
bi_         O       55.3421     M  

Equilibrium Speciation

At 1 bar and 25°C, equilibrium calculations produce:

Screen-Calcite-Col-BC-0000.png

Here, calcite and dolomite are both strongly undersaturated, the solution is weakly acidic, and it has a significant ionic strength (0.024 m).

File Export and Location

  • The initial column composition was exported as:
  • CalcColumn-dch.dat
  • CalcColumn-ipm.dat
  • CalcColumn-dbr-0-0001.dat

  • The source solution composition was exported as:

  • CalcColumn-dbr-0-0000.dat
  • (DCH and IPM files remain unchanged, as only the bulk composition differs.)

All exported files can be found in:
- tp_test/ subfolder of standalone/gemcalc-build/
- tp_test/ subfolder of standalone/node-gem-build/

In gemcalc-build, files contain comments and all data fields, while in node-gem-build, files are optimized for performance.


  1. A. Yapparova, T. Gabellone, F. Whitaker, D. A. Kulik, and S. K. Matthäi, "Reactive transport modelling of dolomitisation using the new CSMP++GEM coupled code: Governing equations, solution method and benchmarking results," Transport in Porous Media, vol. 117, no. 3, pp. 385--413, 2017, doi: 10.1007/s11242-017-0839-7

  2. H. Shao, S. V. Dmytrieva, O. Kolditz, D. A. Kulik, W. Pfingsten, and G. Kosakowski, "Modeling reactive transport in non-ideal aqueous--solid solution system," Applied Geochemistry, vol. 24, no. 7, pp. 1287--1300, 2009, doi: https://doi.org/10.1016/j.apgeochem.2009.04.001