GEM-Selektor v.3 (GEMS3) is a geochemical modelling code. It uses an advanced convex programming method of Gibbs energy minimization (GEM) implemented as an efficient Interior Points Method (IPM) in the GEMS3K kernel module.
Using GEMS3, you can compute an equilibrium phase assemblage and speciation in a complex chemical system with many phases-solutions from its total bulk elemental composition at given temperature and pressure (optionally, subject to additional kinetic metastability constraints).
Chemical interactions involving solids, solid solutions, metls, gas/fluid mixture, aqueous electrolyte, (non-)electrostatic surface complexation, and ion exchange can be considered simultaneously in the chemical elemental stoichiometry (+ electrical charge) of the system, i.e. without any mass balance constraints for ligands or surface sites.
GEMS3 package includes a built-in write-protected default chemical thermodynamic data base, selected parts of which are automatically copied into your modelling project data base upon creation of the modeling project, where the thermodynamic and compositional input data are immediately available for calculation of equilibrium states. This data base can be extended or corrected at any time, and changes will have no effect on the default database supplied with the program.
Within a modeling project, all you have to do
is, in principle, to provide a recipe, i.e. the bulk composition of
your system and, possibly,
exclude some irrelevant species and phases and set mestability
constraints, then start GEM calculation of equilibrium state.
If necessary, the standard-state thermodynamic data will be automatically converted to temperature/ pressure of interest before computing the equilibrium state using several techniques as appropriate for soilds, gases, aqueous and surface species.
Using GEMS3, you can simulate various mass-transfer processes, reaction paths, and simple reactive transport cases, for instance, titrations, mixing, weathering; stepwise flow-through reactors, controlled by a "process extent" master variable(s) used in the process simulator scripts. Results of such "process simulations" can easily be tabulated, plotted (also at run time), copy-pasted to other programs, or printed into text files. In GEM2MT module, sequential reactor chains, box-flux chains, 1-D column advection-dispersion-diffusion models can be set up and run to explore e.g. water-rock interactions in simple reactive transport scenarios.
In addition to the common "primal solution", i.e. equilibrium chemical speciation, the GEM IPM algorithm always calculates a "dual solution", i.e. chemical potentials of stoichiometry units (elements) in equilibrium state. By comparing primal and dual solutions, it becomes easy to retrieve pe (Eh), pH, fugacities of gases, very low activities or concentrations of dissolved species, as well as to estimate unknown thermodynamic properties of mixing or of end-members in a solid solution - aqueous solution system.
Overall, using the
code will bring you all the power of advanced chemical thermodynamic
modelling, leading to high efficiency in interpreting even complex
hydrothermal aquatic systems. Of course, some learning and exercise
will be needed. To make it easier, we strive to provide a help tutorial
and a set
of test projects .
It's hardly possible to set up meaningful problems in geochemical thermodynamic modelling and interprete results without a good basic understanding of aquatic chemistry and chemical thermodynamics, even though the underlying concepts are very general and quite simple. Taking a course in the above subjects and/or reading a few good textbooks such as (Anderson, 2005; Nordstrom and Muņos, 1994; Stumm and Morgan, 1996) would therefore be a valuable investment, helping you to maximize the usefulness of GEM modeling.
Geochemical thermodynamic modelling (as almost any modelling) should be regarded as nothing else than a tool helping you in interpreting your geochemical data and in reaching a deeper understanding of how the chemical system works. As with any tool, using GEMS3 can be either creative or a waste of time.
Very often, first GEMS3 modeling runs yield rather unexpected results, urging a re-consideration of some concepts or assumptions.. This is normal; a few more modeling iterations will soon give you much more confidence in your data and model predictions. It makes no sense is to start modeling just having the raw data, without a working hypothesis to be verified; clearly, no interpretation of results is possible in this case. GEMS3 is just a tool for checking how realistic your ideas about the system are.
Some natural, biological or technical systems, especially at short time scales, exist far from equilibrium or in a transient state. In such cases, fundamental assumptions about local and partial equilibria cannot be applied and, therefore, methods of equilibrium chemical thermodynamic cannot be used. Before doing any model calculations with GEMS or another speciation code, first question to ask is whether the concept of local/partial equilibrium is adequate for the system of interest.
Plotting phase diagrams is a popular exercise in chemical thermodynamics in petrology or metallurgy, and in aquatic chemistry as well. This often requires a very serious simplification of the chemical system (to make it observable in 2D or 3D coordinate space). A number of tools is avaialble for this purpose (Perplex, Thermocalc, PHREEQPLOT etc.). GEMS3 modeling, however, is aimed at quantifying the effects of equilibration at given (sequence of) T,P, and bulk composition in full speciation complexity of the system, perhaps under many additional kinetic, metastability and/or dispersity constraints. GEMS3 batch calculations can be designed in a way that directly produces phase, activity, or reaction-path diagrams.
Any chain is as strong as it's weakest link. Likewise, any modeling result is not better than the input compositional and thermodynamic data. In the past 30 years, a considerable progress has been made in compilation of internally consistent thermodynamic data bases, including those supplied as the default database with the GEMS3 code. However, no database covers everything relevant for all possible applications. Therefore, it is usually necessary to extend it with the standard-state data for some missing species or minerals, or extend T,P correction range. Although GEMS3 provides a number of tools for extension of the project thermodynamic database, it cannot replace an expert in critical compilation, matching and retrieval of thermodynamic data.
In most geochemical modelling studies (except maybe simple test examples) the user will need to extend thermodynamic database with some new chemical species and phases, or change some thermodynamic properties of them in a consistent way. A modeling project concept implemented in GEMS3 lets the user performing such modifications conveniently and continue thermodynamic modeling straight away: already created records with input chemical recipes and output equilibrium speciation will be updated or extended automatically.
All input data and results of GEM calculations are automatically stored in the modeling project data base files and nowhere else. The user can zip her modelling project folder for back-up or to share it with colleagues. Anyone who has (the same or newer) GEMS3 code installed on her PC can unpack that project and run it, as the user would continue running it on her own desktop.
GEMS3 has a
structure of thermodynamic database. The standard molar data for
chemical species are kept either in thermochemical
equation-of-state) DComp format, or as reactions defining
standard molar properties
of a given species via that of the
reaction and of other species involved (ReacDC format). In both
formats, many data
consistency checks are performed. Data of both
formats, saved into database records, can be immediately used in GEM
calculations of chemical equilibria.
Unlike command-driven or batch-input-file geochemical codes (e.g., PHREEQC, EQ3/6, GWB, ChemApp, Selektor-C, HCh), GEM-Selektor is an interactive modular package in which computational modules share data objects in memory, manipulated by the data base maintenance module. GEMS3 is written in C/C++ and has a modern multi-document mouse-menu-driven GUI (graphical user's interface) based on the Qt GUI Toolkit, which also provides GEMS3 with cross-platform portability: The source code of GEMS3 can be compiled and executed on most Intel-based Linux/Unix, Windows, and Mac OS X desktop platforms.
In GEM-Selektor, no
files with input data are necessary. The program operation is
fully interactive, controlled
by mouse clicking on toolbar icons or menu items, selecting record keys
from lists, or entering data directly into spreadsheet-like screen
forms. Your entered or calculated data is automatically stored
in the project data base, where it is kept accessible for
subsequent calculations or data sampling, plotting or exporting.
This interactive functionality makes the work flow of geochemical
modeling more efficient than ever before.
Almost all kinds of
accessible in GEM-Selektor windows using the data object labels can be
printed into ASCII text files using the simple print
A collection of template printing
scripts is provided for the user' convenience; all scripts can
easily be customized and saved into your project data base. The data in
module window pages can also be copy-pasted to/from most other
spreadsheet or text editing programs. Some results of computations can
also be exported into csv and VTK format files.
GEM-Selektor GUI provides the user with a context-sensitive hypertext runtime help. In most cases, the tooltips (popping up upon hovering the cursor over almost every button or data field) are sufficient. Direct access to separate HelpWindow with documentation is possible from any dialog, screen form, and even a single data field cell on any screen form. The HelpWindow has the industry-standard browsing and search functionality.
kernel GEMS3K implements an
Interior Points Method (IPM) module for non-linear
minimization of total Gibbs energy of the heterogeneous multi-phase
chemical system (more...), with improved
accuracy, mass balance precision, convergence, speed, and extended
input data diagnostics
the needs of the reactive-transport modelling applications in
performance assessment of radioactive waste disposal, aquatic
chemistry, and hydrogeochemistry. The IPM module uses fast and
efficient linear algebra solvers from the JAMA
C++ TNT package
standalone program implementing the enhanced GEM IPM algorithm is now
available open-source from this
web site under the LGPL v.3 license. GEMS3K has no GUI and can
read/write input/output data from/to text files, as well as exchange
the data in computer memory. It can also interpolate thermodynamic data
for chemical species for changing temperature and/or pressure. The
purpose of GEMS3K is to facilitate and promote development of coupled
codes for modelling reactive mass transport
using the "operator splitting" approach with GEM chemical equilibria
solver. GEMS3K C/C++ code is small, fast, and meets all requirements of
coupled codes including MPI parallelization and high-performance
computing for realistic 2D or 3D transport simulations.