GEM-Standalone (GEMS3K)
Standalone Solver of Chemical Equilibria for Coupled Simulation Codes
Codes can be coupled to GEM-Standalone through its C/C++ and Python interfaces. GEMS3K Standalone is a powerful and flexible tool for geochemical modeling, enabling high-precision equilibrium calculations in diverse applications.
- Equilibrium solver capable of modeling complex (geo)chemical systems with many non-ideal solutions.
- Supports variable temperature and pressure with substantial improvements in Gibbs Energy Minimization algorithms.
- Fast, accurate, and ensures excellent mass balance precision.
- Written in C/C++, open-source, and fully parallelizable on HPC architectures.
- Python interface available via
xGEMS
(installable fromconda-forge
). - Serves as the numerical kernel of the GEM-Selektor geochemical modeling package.
- GEM-Selektor can export input files for GEMS3K with a simple mouse click.
- Used in developing coupled reactive mass transport simulation codes, such as OpenGeoSys-GEM.
- Integrated into parameter fitting frameworks like GEMSFITS.
GEMS3K (formerly GEMIPM2K) is a standalone C/C++ code implementing the efficient numerical kernel IPM-3 of the GEM-Selektor v.3 package. It enables geochemical thermodynamic modeling of local/partial equilibria in complex heterogeneous multicomponent-multiphase systems. The code includes the TSolMod library, which provides built-in phase models of non-ideal mixing for a broad range of geochemical applications (more...). GEMS3K employs fast and efficient linear algebra solvers from the JAMA C++ TNT package (NIST).
GEMS3K is released under the Lesser GPL v.3 license, promoting broad applications in hydro(thermal)- and waste geochemistry research. The code is provided for implementation of various reactive-mass-transport and other coupled codes, where massive, chemically plausible computations of local/partial equilibrium states are necessary, including HPC codes.
GEMS3K runs under Windows, Mac OSX and Linux desktop PCs, as well as on various parallel architectures.
GEMS3K Interfaces
C++ Interface
GEMS3K provides a flexible TNode
C/C++ interface for data exchange in coupled simulations.
Modern xGEMS C++ and Python Interface
The xGEMS
is a modern interface (ChemicalEngine
) accessible from C/C++ amd Python. Python module enables seamless integration of GEMS3K into Python workflows, allowing researchers to leverage its capabilities in data analysis and machine learning applications.
Examples of Coupled Codes
GEMS3K can be integrated into high-performance computing (HPC) frameworks, enabling coupling with reactive mass transport codes such as:
Input files (text format) for GEMS3K can be exported from GEM-Selektor or manually prepared using any text editor. Runtime data exchange within coupled codes can be implemented in computer memory via the TNode
class functions.
- OpenGeoSys-GEMS1: Reactive transport modeling.
- COMSOL-GEMS2: Coupling with multiphysics simulations.
- CSMP++-GEMS3: Computational simulations of multiphase processes.
- NLOpt-GEMS4: GEMSFITS parameter optimization tool.
Authors
The development of GEMS3K stems from advancements in convex programming Gibbs energy minimization algorithms since 2000. It has been continuously improved with contributions from:
- Dmitrii A. Kulik (Paul Scherrer Institut, retired 2024) – Lead developer of GEM IPM algorithm and GEMS3K.
- Svitlana V. Dmytrieva (Institute of Environmental Geochemistry, Kyiv, Ukraine) – GEM Software engineer, C++ re-implementation of GEM-Selektor.
- Thomas Wagner (ETH Zurich, University of Helsinki) – Co-developer of GEM algorithms and TSolMod.
- Georg Kosakowski (Paul Scherrer Institut) – Developed data exchange interfaces for coupled reactive transport simulations.
- Ferdinand Franziskus Hingerl (PSI, now at Stanford University) – Extended TSolMod with Pitzer, Extended UNIQUAC, and rEUNIQUAC models.
- Konstantin V. Chudnenko (Institute of Geochemistry, Irkutsk, Russia) – Creator of SELEKTOR codes, contributor to GEM IPM algorithms.
Contributors
- Frieder Enzmann (JOGU Mainz, Germany) – Improved
TNodeArray
example for GEM2MT module. - Sergey Churakov (Paul Scherrer Institute) – Provided Churakov-Gottschalk EoS implementation.
Publications
- Kulik D.A., et al. (2012). "GEM-Selektor geochemical modeling package: Numerical kernel GEMS3K for coupled simulation codes." Computational Geosciences. DOI
- Wagner T., et al. (2012). "GEM-Selektor geochemical modeling package: TSolMod library and data interface for multicomponent phase models." Canadian Mineralogist, 50, 1173-1195. DOI
- Shao H., et al. (2009). "Modeling reactive transport in non-ideal aqueous–solid solution systems." Applied Geochemistry, 24, 1287-1300.
- Kulik D.A. (2006). "Dual-thermodynamic estimation of stoichiometry and stability of solid solution end-members in aqueous–solid solution systems." Chemical Geology, 225(2-3), 189–212.
- Karpov I.K., et al. (2002). "Convex programming minimization of thermodynamic potentials other than Gibbs energy in geochemical modeling." American Journal of Science, 302, 281-311.
- Karpov I.K., et al. (2001). "Minimization of Gibbs free energy in geochemical systems by convex programming." Geochemistry International, 39(11).
- Karpov I.K., et al. (1997). "Modeling chemical mass-transfer in geochemical processes: Thermodynamic relations, equilibrium conditions, and numerical algorithms." American Journal of Science, 297, 767-806.
Licensing
The GEMS Sandalone package is open-source, distributed under the Lesser GPL v.3 license. It is available free of charge for developers affiliated with non-profit educational and research institutions for educational and research purposes only, subject to the Terms and Conditions of Use of GEM Software.
-
G. Kosakowski and N. Watanabe, "OpenGeoSys-gem: A numerical tool for calculating geochemical and porosity changes in saturated and partially saturated media," Physics and Chemistry of the Earth, Parts A/B/C, vol. 70--71, pp. 138--149, 2014, doi: https://doi.org/10.1016/j.pce.2013.11.008. ↩
-
V. J. Azad, C. Li, C. Verba, J. H. Ideker, and O. B. Isgor, "A COMSOL--GEMS interface for modeling coupled reactive-transport geochemical processes," Computers & Geosciences, vol. 92, pp. 79--89, 2016, doi: https://doi.org/10.1016/j.cageo.2016.04.002. ↩
-
A. Yapparova, G. D. Miron, D. A. Kulik, G. Kosakowski, and T. Driesner, "An advanced reactive transport simulation scheme for hydrothermal systems modelling," Geothermics, vol. 78, pp. 138--153, 2019, doi: https://doi.org/10.1016/j.geothermics.2018.12.003. ↩
-
G. D. Miron, D. A. Kulik, S. V. Dmytrieva, and T. Wagner, "GEMSFITS: Code package for optimization of geochemical model parameters and inverse modeling," Applied Geochemistry, vol. 55, pp. 28--45, 2015, doi: https://doi.org/10.1016/j.apgeochem.2014.10.013. ↩