blage is calculated, not simultaneously during
one application of the Simplex routine, but se-
Solids
quentially. Another phase is added after local
If a molal quantity of solid calculated using eq
equilibrium with previously added phases is
2a was negative, this solid phase was considered
achieved.
as completely dissolved, and a new local equilib-
2. After the appearance of a new solid phase
rium without this solid was computed. Then a
and before applying Newton's method, the cur-
search of new solid phases from the list of possi-
rent species concentrations have to be recalcu-
ble solids to be included into the system is under-
lated to be in better agreement with values of
taken. The criterion for the inclusion of phase K is
independent component chemical potentials. The
as follows:
relation between concentration of species and
values of chemical potentials of independent
M
P
∑ 0 akK + ∑ λ i aik - 0 < 0.
(6)
components is expressed by eq 5 and can be also
K
k
k =1
i = M +1
treated in terms of the free energy of the chemical
reaction of species formation from independent
components of the system.
is that the free energy of chemical reaction of a
3. Because of particularities of Pitzer's model,
given solid substance formed from independent
to prevent wide fluctuations during solution of
components of the system is negative, and there-
the system of equations 4a,b,c by Newton's meth-
fore this solid is thermodynamically stable. If the
od, we have to smooth changes of activity coeffi-
condition (eq 6) asserts, this solid replaces one of
cient and osmotic coefficient values, which are
the independent components of the system with
calculated at each iteration by Pitzer's routine.
which it is linearly dependent. Then the system of
We use average values obtained at the current
linear equations (eq 2a,b) is solved with respect to
and previous iterations.
this new independent component. By this means
4. At every iteration a new approximation to
the solution is provided by inversion of the Hes-
the system will be expressed in terms of this and
sian matrix: yi(k +1) = yi(k) + ∆ i / ξ . For a homoge-
other independent components. This procedure
neous system the value of ξ is equal to 1 and it
is largely achieved by applying the Simplex rou-
increases by 0.5 with every new solid that precip-
tine. (Simplex is a classic finite iteration method
itates.
of linear programming [Korn and Korn 1963].)
Addition of each solid phase reduces the number
of active linear restrictions by one. Calculations
FREZCHEM2 PROGRAM
are continued until, in the list of possible phases,
A listing of the FREZCHEM2 Fortran program
there is no phase that meets the condition in eq 6.
is in Appendix A. FREZCHEM2 consists of a main
Aqueous solution
program called READWRITE and seven subrou-
Aqueous solution is considered absent in the
tines.
system when the number of active balance re-
The READWRITE program reads input data
strictions (P M ) is less than or equal to one and
from the file INPUT, according to these data
the amount of water is less than 0.001 moles.
forms independent components of the system,
and reads the temperature interval and tempera-
ture step for freezing, or the water content inter-
Special steps
Usually, the approximate phase composition
val and water decrement at a given temperature
of a system may be determined at the first steps of
calculation using the Simplex routine. Then the
cal potentials of the components as functions of
temperature, calls various subroutines, and
using Newton's method for local equilibria deter-
writes results of the chemical equilibria computa-
tion into the file RESULT.
mination and Simplex methods for addition or
Subroutine CHOICE is called from the main
substitution of solids. Due to the very high non-
program and chooses components that may be
ideality of brines, this technique collapsed, and
formed in the system of given chemical composi-
some changes in the logical pattern of calculation
tion as well as their stoichiometry. A data file for
were made:
this routine is the DATABASE file.
1. At first, the system is considered homo-
Subroutine SOL is called from READWRITE
geneous (no solids), then the solid-phase assem-
4