Subroutine GG is called from the SOL subrou-
and is the main calculating routine. It computes
tine and solves the system of linear equations by
the GaussJordan method.
en T and specified mass balance by searching for
The principal flowchart of FREZCHEM2 is
the global extremum of the Lagrangian function.
It forms the Hessian matrix and calls various sub-
shown in Figure 1. The FREZCHEM2 model is a
universal model that may be used to compute
READWRITE program to be written.
Subroutine SIMPL is called from the SOL sub-
one-component solids and/or aqueous solution.
routine to enter new solid phases into the system
For this goal, only additions in the data files are
and to invert the stoichiometric matrix. This calls
needed.
the GG1 routine, which is the short version of the
GaussJordan matrix method.
Data files
Subroutine PITZER is called from the main
Files that contain the information needed for
program to choose data for Pitzer parameters and
calculations and some remarks are listed in Ap-
to calculate them at various temperatures if the
pendix B.
freezing scenario has been chosen. It is also called
File DATABASE contains a list of independent
from the SOL routine to calculate activity coeffi-
components, which can be taken into account,
cients of species and water activity, using the
and lists of aqueous solution species (cations, an-
Pitzer model at every iteration while minimizing
ions, neutral species including water) and solid
the free energy function by Newton's method. In
phases, consisting of given independent compo-
FREZCHEM2, the PITZER subroutine, as well as
nents as well as their stoichiometry. For the con-
the INTERACT subroutine published by Marion
venience of users, the same species numbers
and Grant (1994), were used with only insig-
(coding) were used as in the FREZCHEM model.
nificant changes dealing mainly with the inter-
If necessary, additional information may be add-
face with data files.
ed for independent components as well as for
Subroutine INTERACT calculates the higher-
species and solids. Requested formats for enter-
order electrostatic interactions for the Pitzer
ing new data could be taken from the listing of
equations.
the READWRITE program (Appendix A).
File TABLE1 represents Table 1 of Spencer et al.
(1990), which includes constants for the Debye
Read input data
Hckel model parameter Aφ and for the binary
interaction parameters as a function of tempera-
Choose needed data
ture (K). File TABLE2 represents Table 2 of that
from data files
paper for mixed-salt parameters. File TABLE3
contains coefficients for calculation of free ener-
gies of chemical reactions of formation for solids
Homogeneous system
and ion pairs from aqueous solution species and
liquid water as a function of temperature, using
equations of the form published by Spencer et al.
(1990):
Call Pitzer
Local equilibrium
∆G
computation
= a1 + a2T + a6T 2 + a9T 3
Call Gauss-Jordan
RT
no
yes
+ a3 /T + a4 ln(T )
(7 )
yes
Phase removal
and represents a copy of Table 3 from their paper.
no
In this convention, free energies of cations, an-
yes
Phase addition
(call Simplex)
ions, and liquid water are taken to be equal to
zero at any temperature.
no
Print results
Program input and output
Input to FREZCHEM2 is through the file IN-
Figure 1. Flowchart of the FREZCHEM2 model.
PUT, which contains the molal amounts of inde-
5