GEMS3K Code for Solving for GeoChemical Equilibria

Parameters of built-in models of phases-solutions in the IPM input file


Contents

1. Introduction

2. The TSolMod class structure

3. Setup and transfer of of non-ideality parameters

3.1. Parameters for Dependent Components in Phase definitions

3.2. Interaction parameters and coefficients in Phase definitions

4. Collected parameter arrays in MULTI data structure and IPM files

5. Codes of built-in non-ideality models and setup of their parameters

6. Examples of parameter structure of some specific-interaction phase models

5.1. SIT (Broensted-Scatchard-Guggenheim) model

5.2. Pitzer (HMW) model

5.3. Extended UNIQUAC model

......
<under construction>



1. Introduction

A particular strength of GEM algorithms is in their ability to compute equilibria in heterogeneous chemical systems containing several (highly)  non-ideal solution phases.  The GEM-Selektor v.3 code, in principle, allows the usage of any model of non-ideal mixing because it provides the possibility of writing scripts in the Phase definition record (see GEM-Selektor documentation). However, interpretation of Phase scripts slows the calculations down, and many non-ideality models are so well established and popular that they are now hard-coded in the GEM IPM kernel in form of TSolMod class library, which makes them available in both GEM-Selektor package and in standalone GEMS3K code. Formal description of these models is provided in the Activity-Coeffs.pdf  file in GEM-Selektor documentation (also on the GEMS web site). The present document provides an overview of implementation (TSolMod class), relevant data structures for transferring parameters and coefficients used in the models, and examples of parameter setup for frequently used built-in non-ideality models. 

More about TSolMod C++ class library can be learned from a publication:



2. The TSolMod class structure and functionality

Key innovative features of the TSolMod class library are:

In a broad sense, TSolMod library is a collection of classes (each implementing one particular equation of state or activity model) derived from the TSolMod base class. For brevity, this collection will further be called the TSolMod library. The base class contains a set of virtual member functions (virtual C++ methods) and data objects that are common to all models. These are designed to call model-specific calculations at different stages of the GEM IPM algorithm (Fig. 1), most importantly functions that calculate increments to the thermodynamic properties of chemical species, pressure-temperature corrections to model parameters, activity coefficients, and bulk phase ideal and excess mixing properties (Table 1). This separation of different functionality significantly increases the GEMS3K code efficiency (Fig. 1), because in most cases only the activity coefficients or activities need to be recalculated at each iteration of GEM IPM. The correction of model parameters is only done when pressure and/or temperature have been changed, and the bulk phase properties are calculated after the GEM IPM algorithm has converged.

The data objects in the TSolMod base class, commonly available to all derived classes, provide access to data arrays of composition (mole fractions, molalities) and model parameters (species-related and interaction parameters). In addition, they comprise thermodynamic output data including fugacity and activity coefficients, and different bulk phase properties such as Gibbs energy, enthalpy, entropy, Helmholtz energy, heat capacity, and volume (Table 2). The bulk phase properties are separated into thermodynamically distinct contributions, most importantly ideal mixing, excess, and residual properties (Anderson & Crerar 1993, Prausnitz et al. 1997), and Darken terms for solid solutions (Holland & Powell 1992). The data exchange between the GEM IPM algorithm and the derived classes in the TSolMod library occurs via two well-defined interfaces. These are the derived class constructor, which transfers all input (temperature, pressure, model parameters, composition) and output (activity coefficients, phase properties) data encapsulated into a single data container structure for a given phase, and a specific derived class member function call that updates pressure and temperature whenever these have been externally modified.

Of particular importance for the versatility and extensibility of the TSolMod library is the design of data arrays that contain the model-specific parameters. These are separated into two data structures, one containing parameters of individual end-member components (species) and a second containing the interaction parameters between end-member species. In addition, the end member site occupancy table (SOT) that contains the fractions of different moieties (ions, atoms, or groups of atoms) on individual crystal lattice sites is supported in the case of multi-site (sublattice) solid solution phases. Interaction parameters (of different types, composed of one or several coefficients to express temperature and pressure dependence) can be of binary, ternary or higher order (or combinations thereof). Any such interactions between different species are uniquely identified by a generalized indexation scheme, which also makes it possible to encode different types of interaction parameters (as for example in the Pitzer aqueous electrolyte model). Zero interaction parameters are default and can be skipped from input data lists. The indexation scheme and the two data structures can be collected and stored in phase definitions in the GEM-Selektor database, or read in from the GEMS3K input file. This gives maximum flexibility to the user, because the model parameters can be set up without any modification of the source code, and different alternative calibrations of equation of state or activity models using the same formalism can be tested in a straightforward, interactive way. An example of the data setup is provided in Figure 2 for the derived class TVanLaar containing implementation of a nonideal ternary feldspar solid solution model.

Summary of virtual methods of the TSolMod library for all implemented activity and equation of state models.

Method name

GEM IPM wrapper

Description

TSolMod() SolModCreate(k) Constructor
~TSolMod()
Destructor
PureSpecies()
SolModParPT(k) Calculates increments to thermodynamic properties of species (end-members) in solution phases such as pure fluid fugacities, Darken correction terms
PTparam() SolModParPT(k) Calculates pressure-temperature corrections to interaction or equation of state mixing parameters, executed once before main GEM IPM
MixMod() SolModActCoeff(k)
Calculates activity and fugacity coefficients of species (end-members) in solution phases, executed every main GEM IPM iteration
ExcessProp()
SolModExcessProp(k) Calculates integral excess mixing properties of solution phases (enthalpy, entropy, heat capacity, volume), executed after GEM IPM has converged
IdealProp()
SolModIdealProp(k)
Calculates integral ideal mixing properties of solution phases (enthalpy, entropy, heat capacity, volume), executed after GEM IPM has converged
UpdatePT()
SolModCreate(k)
Updates pressure and temperature inside TSolMod and subclasses whenever they are externally modified
GetPhaseName()
SolModCreate(k) Transfers phase name into TSolMod and subclasses, used for supporting implementation of user-defined specific mixing models for solution phase

The functions are called through corresponding wrappers in the GEM IPM-3 main algorithm in a loop over all multicomponent phases (indexed with k).

Thermodynamic data objects of the TSolMod library that are available in all implemented activity and equation of state models.  

Data object name
Description
ModCode External code for identifying the activity or EoS model
MixCode External code for selection of EoS mixing rules
DC_Codes External code for selection of species (end-member) type
NComp Number of components in the solution phase
NPar Number of non-zero interaction parameters
NPcoef
Number of coefficients per interaction parameter
MaxOrd Maximum order of interaction (binary, ternary etc.)
NP_DC Number of coefficients per species
NSub Number of sublattices for multisite solid-solution models
Nmoi
Number of ions or ion groups (moieties) that exchange on sublattices
aIPx List of indexes of non-zero interaction parameters
aIPc Table of interaction parameter coefficients
aIP Vector of interaction parameters corrected to T and P
aDCc Species (end-member) properties coefficients
aDC Table of corrected species (end-member) properties at T and P
aGEX Reciprocal energies, Darken terms, pure fugacities of species
aPparc Output partial pressures (activities, fugacities)
x
Mole fractions of end members
lnGamma Activity coefficients of species (end-members)
aVol Molar volumes of species (end-members)
phVOL
Phases volume (cm3/mol)
R_CONST Universal gas constant (8.31451)
Tk Temperature (in K)
Pbar Pressure (in bar)
Gex, Hex, Sex, CPex, Vex, Aex, Uex Molar bulk phase excess properties <under construction>
Gid, Hid, Sid, CPid, Vid, Aid, Uid Molar bulk phase ideal mixing properties <under construction>
Gdq, Hdq, Sdq, CPdq, Vdq, Adq, Udq
Molar bulk phase DQF or reciprocal terms <under construction>
Grs, Hrs, Srs, CPrs, Vrs, Ars, Urs Molar bulk phase residual functions (for gases and fluids) <under construction>
   

Overview of activity and equation of state models currently implemented in TSolMod library

Multicomponent fluids and gases

Derived class name Short description
TSRKcalc Soave-Redlich-Kwong cubic equation of state, with Van der Waals mixing rule using constant or T-dependent parameter
TPR78calc Peng-Robinson cubic equation of state, with Van der Waals mixing rule using constant or T-dependent parameter
TPRSVcalc Peng-Robinson-Stryjek-Vera cubic equation of state, with Van der Waals mixing rule using constant or T-dependent parameter
TCORKcalc Compensated Redlich-Kwong (CORK) hybrid cubic and virial equation of state, with Van Laar mixing rule
TSTPcalc Sterner-Pitzer Helmholtz energy based equation of state for high-pressure systems, with Van Laar mixing rule
TCGFcalc Perturbation theory based Churakov-Gottschalk equation of state, with basic Van der Waals mixing rule

  

Multicomponent liquid nonelectrolyte solutions   

Derived class name Short description
TWilson Multicomponent Wilson local composition activity model, with T-dependent non-randomness parameter
TNRTL Multicomponent non-random two-liquid (NRTL) local composition activity model, with T-dependent non-randomness parameter

   

Solid solutions   

Derived class name Short description
TIdeal Multicomponent ideal mixing model for fluid/gases and solid-solutions; suppors a multisite ideal formalism for solid-solutions
TBerman Multicomponent microscopic-interaction multisite model for solid-solutions
TRegular
Multicomponent regular activity model (symmetric formalism)
TVanLaar Multicomponent Van Laar activity model (asymmetric formalism)
TRedlichKister Multicomponent 4-term Redlich-Kister activity model
TMargules Ternary regular Margules activity model
TSubregular Binary subregular Margules activity model
TGuggenheim Binary 3-term Redlich-Kister activity model

   
Multicomponent aqueous electrolyte solutions

Derived class name Short description
TDebyeHueckel Two-term Debye-Hückel model
TLimitingLaw One-term limiting law Debye-Hückel model
THelgeson Extended Debye-Hückel model with common constant or T-P-dependent extended term parameter, and common ion size
TKarpov Extended Debye-Hückel model with common constant or T-P-dependent extended term parameter, and individual ion sizes
TShvarov Extended Debye-Hückel model with common constant or T-P-dependent extended term parameter, and common ion size
TDavies Davies extended Debye-Hückel model
TSIT
2-term Specific ion interaction (SIT) model
TPitzer
Pitzer (Harvie-Moller-Weare) model with T-dependent binary and ternary interaction parameters
TEUNIQUAC Extended UNIQUAC model with T-dependent binary interaction parameters
  

More derived classes can be added in future versions of TSolMod library.



3. Setup and transfer of of non-ideality parameters

In GEM-Selektor code, there are two major variants of setting up the Phase definitions for ideal or non-ideal solution models: (1) Autophase setup; (2) User-defined Phase record setup.

In the Autophase mode, the GEM-Selektor can automatically construct a Phase definition record for an aqueous or a gas/fluid phase without specific interactions between phase components (species). Such a phase exists only during the modeling project session and will be automatically deleted when the project is closed, and created when it is opened again. If the model requires component individual parameters (such as Kielland ion-size parameters in the Debye-Hueckel equation), these will be automatically collected into dc_cfarray from DComp and ReacDC records. Note that, upon export to GEMS3K I/O files, automatically created aqueous, gas or fluid phases will be exported just as any ohter phase definitions.  

Mixing models with specific interactions between phase components (end members, aqueous ions) cannot be implemented in the Autophase mode. Any Phase record for such a model of mixing must be taken from the "DB.Default" data base, or created by the user in the modeling project before attempting to open the project and calculate the equilibria. In some cases, certain components of such phases cannot be switched off in the chemical system definition because this will render the mixing model non-operational. When setting this kind of Phase definition, one typically needs to know how many non-zero interaction parameters will be used - this determines the number of rows in  ipxT  and  ph_cf  arrays (zero interaction is default and needs not be defined explicitly).



3.1. Parameters for Dependent Components in Phase definitions

Many non-ideality models require some individual parameters of phase components (species or end members). If so then a dc_cf array must be allocated in the Phase record and structure, having the number of rows equal to the number of Dependent Components included in the phase, and the number of columns equal to the (maximum) number of parameters (coefficients) per component. Typically, in GEM-Selektor code, this information is collected from DComp or ReacDC records in Autophase setup or (as an option) during remake of Phase record. In user-defined Phase records, these parameters can be corrected or re-entered, if necessary. Upon export to GEMS3K I/O file, all this information is recorded in the IPM file for all multi-component phases.



3.2. Interaction parameters and coefficients in Phase definitions

In all built-in non-ideality models with specific inetractions belonging to the TSolMod class library, the interaction parameter coefficients are given in the  ph_cf  array, and the indexes of involved phase components (and optionally parameter types) are given in the ipxT  array. These two arrays are connected in a sense that a row in the ipxT index list tells the indexes of interacting components in the phase, while the respective row of the ph_cf table contains all the coefficients that together make up the respective interaction parameter. The number of columns in the ipxT index list depends on the maximum order of interaction parameters (2 for binary, 3 for ternary, ...); unused indexes should be set to -1. The number of columns in the ph_cf table depends on the maximum number of coefficients per parameter - minimum 1, or depending on how the temperature, pressure or ionic strength dependence of interaction parameters is defined in the particular model. Examples of this setup are given for some particular models of mixing.



4. Collected parameter arrays in MULTI data structure and IPM files

The model selection codes (listed in tables in Section 5 below) can be selected in the Phase remake wizard  (in  GEM-Selektor) and will appear as a first character in the p_solt list (the fourth character there must be set to 'S' for built-in models).

When the chemical system definition is assembled inside of the GEMS modeling project, the p_solt data object for each multi-component phase will be copied into a respective row of the  smod  array in the IPM (MULTI) work data structure. In parallel, the dimensions of ipxT  and ph_cf arrays  for each phase will be collected  in the respective row of the Lsmod array; the number of individual DC parameters per component will be put into the respective cell (row) of the Lsmdc array.

After completion of assembling the smod, Lsmod and Lsmdc arrays, the dmc array (in MULTI structure, called DMc in the IPM file) will be allocated, with number of elements equal to the sum of products Lsmdc[k][0]*L1[k], i.e. the sum of each non-zero element in the Lsmdc[0] array column times the number of phase components over all multicomponent phases. The  pmc  array (PMc in the IPM file) will be allocated next, with total number of elements equal to the sum of products  Lsmod[k][0]*Lsmod[k][2]  for all multicomponent phases. The ipx index array (IPxPH in IPM file) will be allocated with total number of elements equal to the sum of products  Lsmod[k][0]*Lsmod[k][1]  for all multicomponent phases.

Finally, the Phase records will be read again one-by-one, and the contents of dc_cf array in k-th phase (if any) will be copied into the dmc array block-after-block (a table block is copied row-by-row). For instance, if the aqueous phase (k=0) had one parameter per species and 10 species, the gas phase (k=1) had no parameters per species and 3 species, and the solid solution phase (k=2) had two parameter per species and two species, the L1 array will contain  { 10, 3, 2  }; the  Lsmdc array will contain { 1, 0, 0,   0, 0, 0,   2, 0, 0  }; the dmc array will contain first 10 numbers for aqueous phase, then no numbers for gas phase, and then 4 numbers for solid solution phase.

Likewise, the contents of  ipxT array for each phase (if available) will be copied into the ipx array block-after-block (row-by-row); the respective rows with interaction parameter coefficients will be copied from ph_cf into pmc array. If some components of the phase were turned off then only those rows will be copied where no indexes of turned-off components are present; the index values will be adjusted to the remaining set of 'turned-on' components in the phase.

Continuing with the above example, let the number of interaction parameters Lsmod[k][0] be 5 for the aqueous phase, 0 for gas phase, and 2 for the solid solution phase; the maximum order of parameters Lsmod[k][1] be 3 for aqueous, 0 for gas and 2 for  solid solution, and the number of coefficients per interaction parameter Lsmod[k][2] be 2 for aqueous, 0 for gas, and 4 for solid solution. Then the ipx array will contain 15 indexes for the aqueous phase, 0 for gas phase, and 4 for solid solution phase; the pmc array will contain 10 coefficients for aqueous phase, 0 for gas, and 8 for solid solution phase (all in the indicated sequence of phases). In a similar way, the contents of pmcLsmod collected array can be analyzed using dimensions from columns [0] and [2] of the table.

The sMod, LsMod, LsMdc, DMc, IPxPH, and PMc arrays are written/read by TNode class functions into/from the GEMS3K IPM file in the same format as just described above, i.e. as their counterparts exist in the IPM work structure (MULTI).

On each iteration of the GEM IPM algorithm, the CalculateActivityCoefficients() function goes in a loop k over multi-component phases and delivers to the TSolMod class instance for each phase the contents of k-th row of  smod, Lsmod, Lsmdc arrays, the respective blocks (if available) of data from the dmc, ipx and pmc collected arrays, as well as respective blocks of speciation data (concentrations, activity coefficients, etc.). In this way, a built-in function form TSolMod obtains only counters, indexes and parameters for the k-th phase model only, as this had been defined in the respective Phase record. In other word, any built-in calculation of non-ideality and activity coefficients instantaneously "knows" only about this particular phase and not about other phases and models. This data exchange structure used in TSolMod library is quite general, flexible, and allows processing systems with very different multi-component phases and solution models.
  

5. Codes of built-in non-ideality models and setup of their parameters

Table 5-1. Built-in models for calculation of activity coefficients for aqueous species and water


Code Model DC individual parameters  Phase and Interaction parameters
D Davies none none (depends on ionic strength, T and P); molality correction optional. Autophase  setup.
3 Extended Debye-Hückel (Kielland) individual ion-size (Kielland) parameter ċ ,in Angstroms
Common bg  (third) DH parameter (default value 0.064); molality correction by default. Autophase  setup. 
H Extended Debye-Hückel (Helgeson) none Common ion-size parameter ċ  (default value 3.72 Angstrom); common bg  parameter (default value 0.064); molality correction by default. Autophase  setup.
2 Debye-Hückel individual ion-size (Kielland) parameter ċ ,in Angstroms (in dmc array) None (depends on ionic strength, T and P); molality correction by default. Autophase  setup.
1 Debye-Hückel limiting law none None. Autophase  setup.
S SIT (BGS) model none Two binary interaction coefficients (provided in pmc array);  indexes of interacting  species  to be given in ipx array. 
Z Pitzer (HMW) model none Several sorts of binary and ternary interaction coefficients (provided in pmc) between aqueous species whose indexes are given in ipx array together with parameter types.
Q EUNIQUAC model Volume and surface area parameter (in dmc array) Binary interaction coefficients (provided in pmc array) between aqueous species whose indexes are given in the ipx array.


Table 5-2. Built-in options for mixed non-ideal gas/fluid phases

Code

Model 

DC individual parameters 

Phase and Interaction parameters

F

CG (Churakov-Gottschalk) EoS 

4 to 12 parameters per species (in dmc array)

none (autophase setup)

P

PRSV (Peng-Robinson-Stryjek-Vera) EoS

six parameters per species (in dmc array)

one constant binary interaction parameter (provided in pmc  array) between species whose indexes are given in the ipx array.

E

SRK (Soave-Redlich-Kwong) EoS

three parameters per species (in dmc array)

one constant binary interaction parameter (provided in pmc  array) between species whose indexes are given in the ipx array. 


Table 5-3. Built-in options for activity coefficients for end members of condensed (solid and liquid) non-electrolyte solution phases.

Code

Model

DC individual parameters

Phase and Interaction parameters  (provided in pmc  array)

G

Redlich-Kister model (binary)

none

three constant binary interaction parameters

M

Subregular model (binary)

none

two binary interaction parameters, each represented with 3 coefficients as ab×T + c×P

T

Regular model (ternary)

none

one binary interaction parameter per pair and 1 ternary interaction parameter, each represented with 3 coefficients as ab×T + c×P

R

Regular model (multicomponent)

none

one binary interaction parameter per pair of components, represented as  a + b×T + c×P

V

Van Laar model (multicomponent)

one size parameter in dmc array

one binary interaction parameter per pair of components, represented using three coefficients as a + b×T + c×P

 

K

Redlich-Kister model (multicomponent)

none

four binary interaction parameters per pair of components, represented using four coefficients as a + b×T + c×T×ln(T) + d×P

L

NRTL model (multicomponent)

none

two normalized binary interaction energies per pair of components, represented using four coefficients as  A + B/T + C×T + D×ln(T)

1 parameter α per pair of components: E + F× (T-273.15) represented using two coefficients

W

Wilson model (multicomponent)

none

two binary interaction energies per pair of components, represented using four coeeficients as exp[ A + B/T + C×T + D×ln(T) ]

U

User-defined*


Must be hardcoded or provided as Phase scripts and parameters*

 *Not yet available in GEMS3K code

<Under construction, more TSolMod models to be added>



6. Examples of parameter structure of some specific-interaction phase models

Such non-ideality models can only be implemented (in GEM-Selektor) in ordinary Phase definition records but not in Autophase setup mode. The currently available implementation covers three most popular models valid up to 3 (SIT) to 10 molal ionic strength, i.e. for highly concentrated aqueous solutions. However, temperature and pressure range of applicability is rather limited in comparison with the DHH model: SIT only at 1 bar 25 C, and Pitzer up to 200 C along PSAT. T,P applicability range of the EUNIQUAC model is still a matter of investigation.



6.1. SIT (Broensted-Guggenheim-Scatchard) model (NEA TDB variant)

The built-in SIT model for aqueous electrolyte (code 'S') has no individual parameters for aqueous species. The model consists of a generic Debye-Hueckel term (a function of effective molal ionic strength), enhanced with a SIT sum of binary interaction parameters multiplied by the molality of respective counter-ions. The model is officially applicable to ambient conditions (1 bar and temperature around 25 C) and to systems with one background electrolyte; it is not good for mixed-electrolyte systems (Plyasunov and Grenthe, 1997). The interaction parameters, in general, consist of two coefficients, the second one describes an optional linear dependence on the ionic strength. This second coefficient is seldomly used.

The Phase window screenshot below shows an example of SIT model setup for an aqueous phase containing 17 species. There are four interaction parameters given non-zero values (K+ - OH-, Na+ - OH-, Ca+2 - NaOH0, and CaOH+ - NaOH0; the parameters are example only). Hence, the ipxT array has dimensions 4*2 and the ph_cf array has 4*2. The indexes of cations and anions are shown on the right side; those of interacting ions are seen in the ipxT columns. The order of interaction parameters in rows of ipxT, as well as the order of ions indexes inside of one row of ipxT, play no role.

Example Phase setup for SIT model 


An example chemical system that included the above SIT aqueous model, the ideal gas mixture (3 gases), and a pure Portlandite phase, was constructed in GEM-Selektor and printed into GEMS3K files, fragments of which are given below. The numbers of components and phases with the respective name lists are seen in the fragments of DCH file.

Fragments of (commented) GEMS3K DCH file
## (1) Dimensions for memory allocation
# nIC: Number of Independent Components (stoichiometry units, usually chemical elements and charge)
<nIC>  9
# nDC: Total number of Dependent Components (chemical species made of Independent Components)
<nDC>  21
# nPH: Number of phases (into which Dependent Components are grouped)
<nPH>  3
# nPS: Number of phases-solutions (multicomponent phases) in the chemical system definition (<= nPH)
<nPS>  2
# nDCs: Number of Dependent Components in phases-solutions (multicomponent phases)
<nDCs> 20
## (5) Independent components section
# ICNL: Name list of Independent Components (up to 4 characters per name) [nIC]
<ICNL>
'Ca' 'Cl' 'H' 'K' 'N' 'Na' 'Nit' 'O' 'Zz'
## (6) Dependent Components section (codes and names)
# DCNL: Name list of Dependent Components (up to 16 characters per name) [nDC]
<DCNL>
'Ca+2' 'CaOH+' 'K+' 'KOH@' 'Na+' 'NaOH@' 'ClO4-' 'Cl-' 'H2@' 'NO3-' 'NH3@' 'NH4+' 'N2@' 'O2@' 'OH-' 'H+' 'H2O@' 'H2' 'N2' 'O2' 'Portlandite'
## (7) Phases section
# PHNL: List of Phase names (up to 16 characters per name) [nPH]
<PHNL>
'aq_sit' 'gas_gen' 'Portlandite'
# ccPH: Phase aggregate state codes [nPH]
<ccPH>
'a' 'g' 's'
# nDCinPH: This vector (L1 in IPM work structure) tells how many Dependent Components is included in each phase [nPH]
<nDCinPH>
17 3 1
# . . . . . . . . .


In the corresponding IPM file fragment shown below, slightly re-formatted for better readability, the LsMdc object contains zeros (no individual parameters of Dependent Components and no sublattices in any muticomponent phase). Because of this, there is no need to provide the DMc array. The LsMod object defines that there are 4 non-zero binary interaction parameters, each represented by two coefficients. The indexes  of interacting ions are given in the IPxPH data object, and the parameter values - in the PMc data object. The same data structure exists in the computer memory during equilibria calculations within GEM-Selektor or GEMS3K.

Fragments of (commented) GEMS3K IPM file
## (4) Initial data for multicomponent phases (see DATACH file for dimension nPHs)
# sMod: Codes for built-in mixing models of multicomponent phases (smod)
<sMod>
'SNNSNN'
'INNINN'

# LsMod: Dimensions of <IPxPH> (ipx) and <PMc> (pmc) arrays (Lsmod)
<LsMod>
4 2 2
0 0 0
# IPxPH: Collected indexation table for interaction parameters of non-ideal solutions (ipx).
<IPxPH>
2 14
14 4
5  0
1  3

# PMc: Collected interaction parameter coefficients for the (built-in) non-ideal mixing models (pmc)
<PMc>
0.09 0
0.04 0
0.9  0
0.9  0

# LsMdc: Number of parameters per component of the phase for the non-ideal mixing models (Lsmdc)
<LsMdc>
0 0 0
0 0 0
# . . . . . . . .



6.2. Pitzer (Harvie-Moller-Weare) model                 

The Pitzer model version of Harvie-Moller-Weare (1984), as implemented in TSolMod class and GEMS3K code, allows for activity coefficient calculations up to ionic strengths greater than 6 molal. The Pitzer model consists of a Debye-Huckel term accounting for long-range interactions, and a semi-empirical virial expansion approach considering short range interactions.

The model specific alpha parameters are fixed to α = 2.0 and α1 = 0.0 for electrolytes containing a monovalent ion, 1.4 and 12.0 for  2-2 electrolytes and 2.0, 50.0 for all other cases (equivalent to the PHREEQC Pitzer implementation).

The Phase window screenshot below shows an example of a Pitzer model setup for an aqueous phase containing 21 species (-> Ph_Nc = 21).


Pitzer Model: Phase Record, page 3


The arrays shown on the screenshot contain the following values:

ipxT The first three columns contain the indices of the species of interest.  In case of a binary interaction parameter, the value in the third column is set to -1. The internal parameter code is collected in the fourth column. In the above example, "0" stands for Ca+2 and  "9" for Cl-  (see plsCat and plsAn vector). As mentioned, "-1" indicates that only binary interaction is  described. "-10" is the code for the β0ca interaction coefficient (see the table below).
ph_cf This array contains the parameter coefficients as given for the 5-parameter temperature correction function. Fields left empty are automatically assigned the value 0.
plsCat Cation indices (within this aqueous phase)
pnxCat List of cation names
plsAn Anion indices
pnxAn List of anion names
plsNs Indices of neutral species
pnxNs List of names of neutral species
Ph_ncp[0], Ph_hcp[1] Dimensions of the ph_cf interaction parameter data array, with a = number of rows and b = number of columns (coefficients per parameter)
Ph_npx[0] Number of columns (max. order) in the ipxT parameter indexation array.


The following table displays the interaction parameters and the their corresponding code, which enters the ipxT array at the fourth column. Also given is the index nomenclature, as well as the parameter dimensions (only shown for illustration here, as they are fixed internally).


Code Symbol Indices Dimension
-10 β0ca c          a        -1 Nc*Na
-11 β1ca c          a        -1 Nc*Na
-12 β2ca c          a        -1 Nc*Na
-20 Cφca c          a        -1 Nc*Na
-30 λnc n          c        -1 Nn*Nc
-31 λna n          a        -1        Nn*Na
-40 θcc' c         c1       -1 Nc*Nc
-41 θaa' a         a1       -1 Na*Na
-50 ψcc'a c         c1         a Nc*Nc*Na
-51 ψaa'c a         a1         c Na*Na*Nc
-60 ζnca n          c          a  Nn*Nc*Na

    with: a1 = a + 1, c1 = c + 1, c = cation, a = anion, n = neutral species

<to be continued>



6.3. Extended UNIQUAC model <under construction>





Last changed: 22.10.2012 DK

Copyright (c) 2012 GEMS Development Team