Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.geol.msu.ru/deps/geochems/soft/Guide_34.txt
Äàòà èçìåíåíèÿ: Sat Apr 7 13:35:14 2012
Äàòà èíäåêñèðîâàíèÿ: Tue Oct 2 01:36:14 2012
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: ion drive
Last updated: 1 September, 1999

HCh: a software package for geochemical equilibrium
modelling (v. 3.4)

User's Guide

Yuri Shvarov & Evgeniy Bastrakov


About This Guide
~~~~~~~~~~~~~~~~
This manual has been compiled by the package developer
(Yu. Shvarov, Moscow State University) and one of the long-term
package users (E. Bastrakov, Australian Geological Survey
Organisation). It provides instructions on the practical
package usage and some brief information on the employed
algorithms. You can also find additional information in the
reference ASCII files (*.TXT and *.REF) located in your HCH and
UNITHERM directories.

As the result of the ongoing HCh development this manual may
contain minor omissions and undocumented options. Please refer
to the WNEW*.TXT files for the most recent information. This
manual covers version 3.4 of the HCh package.


Acknowledgements
~~~~~~~~~~~~~~~~
The authors are grateful to Terry Mernagh, Roger Skirrow, and
Greg Cameron for careful reviews and suggestions for
improvement of the manuscript.


CONTENTS

About This Guide
Acknowledgements
TABLE OF CONTENTS
OVERVIEW: GENERAL INFORMATION
Introduction
Guide Conventions
Keyboard Formats
Selecting and Choosing
Case Sensitivity
HCh editing tips
Installation of the package
DOS Environment
Windows Environment
Windows 3.x
Windows 9x/NT
Specific features of work under the Windows NT
operating system
HCh Directory Tree
Package Components
Package Upgrading
CHAPTER 1. THE UNITHERM PROGRAM AND DATABASE
About UNITHERM
Database Components
Database Capacity
Default Database
Database Files
Naming Conventions
Standard State Conventions
Calculation of Gibbs Free Energies
Water
Aqueous species
Basic species
Complexes
Pure phases (minerals, non-aqueous liquids and gases)
Calculation of Coefficients of the Debye-Huckel Equation
Working with UNITHERM
To Start UNITHERM
Basic UNITHERM Commands
Modified Basic Commands
UNITHERM Reaction Commands
Additional UNITHERM Commands
Starting UNITHERM in a Specific Mode
Selecting components in the /SCOPY mode
Selecting components in the /EXPort mode
Selecting components in the multiple /IMPort mode
CHAPTER 2. EQUILIBRIUM MODELLING
Overview
Files Required for Modelling
Working with MAIN
About MAIN
To start MAIN
Starting MAIN in a specific mode
To Quit MAIN
Creating and Changing Files
System Menu
Creating *.ST file
Viewing *.ST file
Editing *.ST file
Exporting *.ST files to ASCII files
Other operations on *.ST files
Blank Menu
Creating *.BL file
Viewing *.BL file
Editing *.BL file
Exporting *.BL files to ASCII files
Other Operations on *.BL files
Input Menu
Creating *.IN file
Viewing *.IN file
Editing *.IN file
Importing ASCII files
Other operations on *.IN files
Control Menu
Menu functions
Control file conventions
Expressions
Relations
Conditions
Operators and functions
Variables
Creating *.CT file
Viewing *.CT file
Editing *.CT file
Other operations on *.CT files
GIBBS Menu
Choosing the source file
Setting GIBBS options
Calling GIBBS
Result Menu
ASCII files
Binary file
Single points mode
Cross Sections mode
Options Menu
Change Directory Request switch
Shown Files switch
Delay Time switches
Set Paths switches
Screen Colours switches
Set Defaults switch
Saving settings
Restoring settings from file
Working with GIBBS
About GIBBS
Equilibrium Calculations
GIBBS reads Control file
GIBBS reads Input file
GIBBS reads Blank file
Tables of Results
Standard table of results
Tables extracted from binary files
GIBBS Options
REFERENCES
Employed Models and Algorithms
Example HCh/GIBBS Applications
Hydrothermal Geochemistry
Processing of Experimental Data
APPENDICES
Appendix 1. Brief Summary of HCh specifications
Appendix 2. Definition of Solid Solution Models
Appendix 3. Calculation of Activity Coefficients of Aqueous
Species
Charged Aqueous Species
Neutral Aqueous Species
Examples of *.ST file modification
Appendix 4. Examples of Control Files Usage
EXAMPLE 1: Titration and Mixing Calculations
EXAMPLE 2: Modelling of Processes at Steady-State Conditions
EXAMPLE 3: Modelling of Progressive Fluid-Rock Interaction
by the "Flow-Through" Reactor Technique
Special syntax of vector variables
Appendix 5. Supplementary Utilities
LST2TAB: Conversion of *.LST Files for Export to Microsoft
Excel
REX.XLS: Importing Results into Microsoft Excel


OVERVIEW: GENERAL INFORMATION

Introduction
~~~~~~~~~~~~
The HCh program package was developed by Yu. Shvarov at the
Department of Geology of the Moscow State University (Russia).
It consists of several compatible programs and a thermodynamic
database that provide a powerful tool for modelling of chemical
and geochemical processes.

Using this program package you can:

Program Functions
--------------------------------------------------------------
MAIN and GIBBS Calculate chemical equilibria in chemical and
geochemical systems using the GIBBS program;

Define and calculate equilibrium-dynamic models
of chemical and geochemical processes.

UNITHERM Maintain an extensive thermodynamic database
for aqueous species, minerals, gases and
non-aqueous liquids;

Calculate and tabulate thermodynamic properties
of database components and chemical reactions
over a wide range of T-P conditions.
--------------------------------------------------------------

The equilibrium compositions of multi-phase chemical systems
are computed using the free-energy minimisation technique
(Shvarov, 1976; 1978; 1981; 1987; 1989).

Model chemical systems can currently incorporate the following
phases of constant and variable composition:

- Pure solids (minerals), liquids and gases
- An aqueous solution (including the supercritical aqueous
phase)
- A gaseous mixture (ideal mixture of ideal gases)
- Liquid non-aqueous solutions (ideal or NRTL model)
- Solid solutions (ideal multi-site mixing)

The model chemical systems can be either closed or open in
respect to perfectly mobile components (Korzhinskii, 1965).

The HCh package was developed to simulate a broad variety of
hydrogeochemical and geochemical processes. HCh can handle
water-gas-rock interaction, fluid mixing, gas partitioning and
boiling calculations. Possible calculations involving an
aqueous solution cover the temperature range of 0 - 1000ÜC and
pressure range of 1 - 5000 bar at water densities exceeding
0.35 g/cm3. The allowed salinity range is limited by the
applicability of the extended versions of the Debye-Huckel
equation.

The HCh package is user-friendly and quite self-explanatory. It
can be used as a good starting point for learning computer
modelling of geochemical systems. However, a novice user should
have a reasonable knowledge of hydrothermal geochemistry and
ability to formulate well-defined chemical and geochemical
models.

It is recommended that the new users experiment with the
provided examples and their own data. A basic knowledge of
MS-DOS/Windows personal computers is assumed.


Guide Conventions
~~~~~~~~~~~~~~~~~
Keyboard Formats

Key combinations and key sequences appear in this guide in the
following formats.

Format Meaning
--------------------------------------------------------------
KEY1,KEY2 A comma (,) between key names means to press
and release the keys one after the other. For
example, "press F3,F1" means to press and
release the F3 key and then press and release
the F1 key.

KEY1+KEY2 A plus sign (+) between key names means to
press and hold down the first key while you
press the second key. For example, "press
CTRL+Q" means to press and hold down the CTRL
key and press the Q key, and then release both
keys.
--------------------------------------------------------------


Selecting and Choosing

The terms "select" and "choose" have different meanings in this
guide. Selecting an item means marking it with the rectangular
cursor or highlighting. Selecting alone does not start an
action.

You choose an item to carry out an action.

- To select a single item

Use the arrow keys until you place the cursor on the item you
want. The item is already highlighted.

- To select or cancel multiple items

Sometimes you need to select multiple items from an offered
list.

1. Use the arrow keys to place the cursor on the item you want.
2. Press the SPACE BAR or INSERT key to highlight the item.
3. Use the arrow keys to proceed with further selection,
pressing SPACE BAR or INSERT to select each item. Press
SPACE BAR or INSERT again to cancel the selection of the
item.

- To choose an item

1. Select the item(s).
2. Press ENTER. In menus it is also possible to press the UP or
DOWN arrow keys, or simply a highlighted letter (Access key).

Case Sensitivity

Data entry in the HCh package may be case-sensitive. Case
sensitivity is noted in the text where applicable.


HCh editing tips
~~~~~~~~~~~~~~~~
When editing input fields in UNITHERM, MAIN, or GIBBS, you can
use the following useful keys and key combinations:

Press To
---------------------------------------------------------------
Clear the input field completely
when the cursor is located at the
beginning of the field

Clear the input field starting
from the current cursor position
---------------------------------------------------------------


Installation of the package
~~~~~~~~~~~~~~~~~~~~~~~~~~~
DOS Environment

1. Make sure that the computer is free from non-DOS resident
programs and viruses.
2. Insert the HCh installation disk in a floppy disk drive.
3. At the command prompt, type the drive letter of the drive
you are using, followed by a colon (:).
4. Type "INSTALL", and then press ENTER.
5. Type your password if required, and then press ENTER.
6. Follow the instructions on the screen. The default options
are recommended for most users.
7. The message "Working version installed" tells you whether
the installation has been completed successfully.
8. Move files UT.BAT and HCH.BAT to a directory mentioned in
the PATH command of your AUTOEXEC.BAT file.

NOTE: By default the installation program activates an
anti-virus program AIDSTEST. You can terminate this program by
pressing CTRL+BREAK or CTRL+C if you find this virus scan
unnecessary. You can also disable AIDSTEST completely during
future upgrades of the HCh package. Simply delete the
AIDSTEST.EXE file from the installation disk or rename it.

Windows Environment

If you are working in the Windows environment you can complete
the installation by using MS-DOS prompt of Windows 3.x/9x/NT.
You can also complete the installation by using the Windows Run
command or using Windows Explorer (File Manager). However, we
recommend the first (MS-DOS) option. This will immediately
bring you to your \HCH directory.

Windows 3.x

1. Insert the HCh installation disk in a floppy disk drive.
2. Run MS-DOS prompt (or a DOS shell, e.g., Norton Commander)
and follow the instructions for the DOS environment (see
above, steps 3 - 8). Alternatively, choose the Run command
from the File menu of Program Manager. Designate the drive
letter from which you will be installing HCh, and type
"INSTALL" (e.g., a:\install). Click the OK button.
3. Type your password if required, and then press ENTER.
4. Follow the instructions on the screen. The default options
are recommended for most users.
5. The message "Working version installed" tells you whether
the installation has been completed successfully.
6. The MS-DOS window closes automatically when the installation
has completed.
7. Move files UT.BAT and HCH.BAT to a directory mentioned in
the PATH command of your AUTOEXEC.BAT file.

Windows 9x/NT

1. Insert the HCh installation disk in a floppy disk drive.
2. Run MS-DOS prompt (or a DOS shell, e.g., Norton Commander)
and follow the instructions for the DOS environment (see
above, steps 3 - 8). Alternatively, click the Start button
on the Taskbar and choose the Run command. Designate the
drive letter from which you will be installing HCh, and type
"INSTALL" (e.g., a:\install). Click the OK button.
3. Type your password if required, and then press ENTER.
4. Follow the instructions on the screen. The default options
are recommended for most users.
5. The message "Working version installed" tells you whether
the installation has been completed successfully.
6. If necessary, click the Close button in the corner of the
MS-DOS window.
7. Move files UT.BAT and HCH.BAT to a directory mentioned in
the PATH command of your AUTOEXEC.BAT file (Windows 3.x/9x)
or your Environment System Variables (Windows NT).

You can create the HCh program group and program items in a
conventional way (see your Windows manual or Help file). A
number of icons (UT1.ICO, UT2.ICO and HCH.ICO) are usually
provided on the installation disc for further customisation of
the HCh program items.

Specific features of work under the Windows NT operating
system

During the installation you might get the message about the
"non-standard DOS partition", referring to the NTFS partition.
Just press Y to proceed.

NOTE: If your computer has multiple operating systems, and you
are planning to use HCh under all of them, run the installation
program (INSTALL.EXE) from Windows NT only and choose a FAT
partition for the HCh package.

If you prefer to work using both the full-screen and window
modes, we recommend you always start HCh programs in a
full-screen mode, or from a DOS prompt or a DOS-Shell program
running in a full-screen mode. You can switch between the
screen modes using Windows ALT+ENTER shortcut keys after
starting an HCh program.

If you start an HCh program from a normal window and then
change to the full screen, you might face a disruption of the
program graphical interface. To fix this problem, follow the
suggested sequence of actions:

For Actions
---------------------------------------------------------------
MS-DOS prompt 1. Quit the program (press F10 for
UNITHERM; press Q for MAIN).
2. Minimize the DOS window, and then
maximize it.
3. Re-start the program.

Norton Commander 1. Quit the program (press F10 for
UNITHERM; press Q (a popular
DOS-Shell) for MAIN).
2. Press ALT+F9 ("EGA Lines") twice.
3. Re-start the program.

Windows NT Explorer 1. Quit the program (press F10 for
UNITHERM; press Q
for MAIN).
2. Edit the program properties (the
Screen Tab; Usage: Full-screen).
3. Re-start the program.
---------------------------------------------------------------

TIP: Generally, we recommend to set the following properties
for your HCh sessions:

- To change properties of the HCh programs

1. In My Computer or Windows NT Explorer, click the HCh program
whose properties you want to change.
2. On the File menu, click Properties.

Property Tab Selected Options
---------------------------------------------------------------
Program Command line: include your preferred command line
options (see "Starting UNITHERM in a Specific
Mode" and "Starting MAIN in a Specific Mode")
Working: preferred working directory Batch file:
NONE Close on exit: ON

Font Available types: Bitmap only
Font size: Auto

Memory All lists: Auto
Protected Mode: OFF
Uses HMA: ON

Screen Full-screen: ON

Misc All boxes (excluding shortcut keys): OFF
Idle sensitivity: Low
---------------------------------------------------------------


HCh Directory Tree
~~~~~~~~~~~~~~~~~~
After the initial installation your HCh directory tree should
look approximately as follows:

[] HCH
[] EXAMPLES Example files
[] MAIN Programs MAIN and GIBBS
[] UNITHERM UNITHERM program + database
[] UNITHERM.EXT Auxiliary programs for data fitting
(free)
[] UTIL Supplementary items (utilities and
icons)
acknowlg.txt Acknowledgements
faq.txt Frequently asked questions
guide*.* User's guide
licence*.txt Licence agreement
readme.txt Installation instructions
wnew*.txt Latest information in ASCII format
hch.bat Files for package customisation
ut.bat

Files UT.BAT and HCH.BAT are intended for package
customisation. If these files are located in a directory
mentioned in the PATH command of your AUTOEXEC.BAT file or your
Environment System Variables, you will be able to call UNITHERM
and MAIN from any of your working directories. Just type "UT"
or "HCH" at the DOS prompt, and press ENTER.


Package Components
~~~~~~~~~~~~~~~~~~
The installed HCh package consists of two parts:

The UNITHERM program + database (sub-directory UNITHERM).
The programs MAIN and GIBBS (sub-directory MAIN).

Program Functions
---------------------------------------------------------------
UNITHERM Thermodynamic database maintenance.
Calculation of thermodynamic properties of the
database components (aqueous species, minerals,
gases and non-aqueous liquids) and chemical
reactions.

MAIN Maintenance and management of files and
programs for equilibrium modelling.

GIBBS Equilibrium calculations on chemical systems.
---------------------------------------------------------------

NOTE: The auxiliary programs in the optional UNITHERM.EXT
directory (currently, UT-RYZ and UT-HEL) are not the part of
the commercial HCh package. They are provided for your
convenience to facilitate the development of the thermodynamic
database for aqueous species. The program documentation is
provided in the relevant text files.

Two additional utilities located in the UTIL directory (the
program LST2TAB and the spreadsheet REX.XLS) are provided for
import of the modelling results into spreadsheet programs. See
Appendix 5, "Supplementary Utilities", for details.


Package Upgrading
~~~~~~~~~~~~~~~~~
To upgrade the package, you need to complete the following
steps:

1. Copy the updated installation files (normally, HCH.AIN and
*.TXT files) to your installation disk.
2. Re-run the installation program and follow the instructions.
Choose the "Keep hard disk version" option to retain your
own version of the database located in the :\HCH\UNITHERM
directory.

During upgrading, informational text files (*.TXT) in the :\HCH
directory are updated automatically.

NOTE: If you are upgrading from HCh version 3.2, the database
file UT_RADII.REF will be automatically renamed to UT_SIZES.REF.


CHAPTER 1. THE UNITHERM PROGRAM AND DATABASE

About UNITHERM
~~~~~~~~~~~~~~
The UNITHERM program is designed for storage and retrieval of
thermodynamic data and calculation of apparent Gibbs free
energies of components (aqueous species, minerals, gases and
non-aqueous liquids) required for equilibrium modelling. Using
UNITHERM you can:

- Easily maintain and modify the provided thermodynamic
database or create a new database of your own.
- Calculate apparent Gibbs free energies of the database
components over a wide range of T-P conditions.
- Calculate pK and dGr(T,P) values of a specified chemical
reaction.
- Tabulate parameters of the extended Debye-Huckel equation
for a number of electrolytes.
- Tabulate density, dielectric constant, fugacity and fugacity
coefficients of pure water.


Database Components
~~~~~~~~~~~~~~~~~~~
The term "component" in the current manual and HCh programs
means any chemical compound included in a model of a chemical
system. Components may be represented by phases of constant
composition or by components of phase-solutions (e.g., aqueous
species such as ions and complexes, or end-members of solid
solutions). Thus the term "component" in this manual should be
distinguished from an independent thermodynamic component.

Currently the database contains three types of components:

- Basic species (simple ions, some polyatomic ions and aqueous
complexes)
- Complexes (aqueous complexes)
- Pure phases (minerals, gases, and non-aqueous liquids)

This subdivision is based on different algorithms employed to
calculate the apparent Gibbs free energies (see "Calculation of
Gibbs Free Energies").


Database Capacity
~~~~~~~~~~~~~~~~~
The UNITHERM database can contain up to 1023 components of each
type (basic species, complexes, and pure phases), i.e. 3069
components in total.


Default Database
~~~~~~~~~~~~~~~~
The default database copied to your UNITHERM directory during
the primary installation has been compiled from a variety of
sources at the Department of Geochemistry of the Moscow State
University. Despite the efforts to maintain a reasonable
consistency it should be stressed that this is not a completely
internally consistent thermodynamic data set. However, the
default data provide a reasonable description of many
hydrothermal equilibria in low- to medium-temperature
hydrothermal conditions (t < 350ÜC). They also provide a
convenient starting point for building and expanding of your
own database.

Browse the database references (see "Basic UNITHERM Commands")
and the reference text files (UT_*.REF) to familiarise yourself
with the sources of thermodynamic data.

NOTE: Some of the records in the original UT_*.REF files are
provided in a Cyrillic font. You can browse them in a UNITHERM
session, or in a DOS session after UNITHERM execution. If you
are running HCh under Windows, make sure you are working in a
full-screen session - otherwise you will see an unreadable set
of characters.


Database Files
~~~~~~~~~~~~~~
The UNITHERM database consists of several data files which are
normally located in the UNITHERM directory. Some of these files
are binary and are maintained automatically by the UNITHERM
program. Others are in the text (ASCII) format. As a rule ASCII
files may be modified by an external text editor. All the
binary files are mandatory and the text files are optional.

File Format Contents
---------------------------------------------------------------
UT.DIR Binary The list of the database components.
UT1.BIN Binary Parameters of the basic aqueous species
(the revised HKF model).
UT2.BIN Binary Parameters of the aqueous complexes
(the modified Ryzhenko-Bryzgalin
model).
UT3.BIN Binary General parameters of the pure phases.
UT4.BIN Binary Heat capacity equations for the pure
phases.
UT_BASIC.REF Text Extended references for basic species.
UT_COMPL.REF Text Extended references for complexes.
UT_ELECT.REF Text Parameters of background electrolytes
(HKF) for calculation of activity
coefficients of aqueous species.
UT_MINER.REF Text Extended references for pure phases.
UT_SIZES.REF Text Ion size parameters for calculation of
(UT_RADII.REF activity coefficients of aqueous
in earlier species.
versions)
UT_REACT.REF Text Definition of a chemical reaction.
UT_TABLE.REF Text User-defined T-P table.
UT_USREL.REF Text User-defined "chemical elements".
---------------------------------------------------------------

NOTE: You can set the Read-Only attribute for any of the binary
files to protect the database from inadvertent modifications.

NOTE: We do not recommended to modify the text file UT_USREL.REF
with an external text editor. To edit this file start UNITHERM
with the /UserElements command option (see "Starting UNITHERM in
a Specific Mode").


Naming Conventions
~~~~~~~~~~~~~~~~~~
The UNITHERM database contains two groups of components with
different naming conventions: (1) aqueous species (basic
species and complexes) and (2) pure phases (minerals, gases,
and non-aqueous liquids).

---------------------------------------------------------------
Group of Name (14 characters)
components ----------------------------------------------------
Mandatory part Optional part (for names
shorter than 14 characters)
---------------------------------------------------------------
(1) Aqueous Chemical formula in a Any comment separated
species conventional notation from the chemical formula
including the non- by space or comma.
zero charge.

e.g.: "Fe++", "Fe(OH)3-", "Fe(OH)2", "Fe(OH)2 (aq)", "Fe(OH)2,aq"

(2) Pure Any string (e.g., Any comment separated
phases mineral name). The from the chemical formula
chemical formula of by space or comma.
the component is
defined inside the
corresponding
database record.

e.g.: "Quartz", "Iron", "Hematite RH", "Hematite,RH"
---------------------------------------------------------------

NOTE: Special substrings in the comment field are used by
modelling programs to distinguish gases and liquids from solid
phases (see below).

TIP: Use space as a comment separator (e.g., Fe(OH)2 (aq) ) if
you do not wish the comment to appear in the output listing of
modelling programs and in your System files. Use comma as a
comment separator (e.g., Fe(OH)2,aq ) to retain the comment in
the output listing.

TIP: If you want to truncate the comment in your routine output
listing but to keep track of the exact species names used in
your models, you can use the Export ASCII command of the System
menu. Full comments will be printed in the *.STG text files
(See "Exporting *.ST files to ASCII files"). Also, using the
GIBBS option /fn, you can force the output of the full species
names both to to the screen and *.LST files (See "Gibbs
options").

Special substrings in the comment field are used by modelling
programs to distinguish gases and liquids from solid phases.
This distinction is required to select a proper algorithm of
calculating Gibbs free energies of species and defining
gaseous, liquid and solid solutions.

Components Substring Purpose Example
--------------------------------------------------------------
Pure phases: Gases ",g" Specify a pure Hydrogen,g
phase as a gas. Hydrogen,gas 0

Pure phases: Liquids ",l" Specify a pure Benzene,l
phase as a liquid.
--------------------------------------------------------------

A special substring is used to modify the selection of
components in the MAIN program when you create a System file
(see "Creating *.ST File").

Components Substring Purpose Example
--------------------------------------------------------------
All "/" Exclude a component HFeO2 (aq) /
from the default
selection of components
suggested for a specified
chemical system.
--------------------------------------------------------------


Standard State Conventions
~~~~~~~~~~~~~~~~~~~~~~~~~~
Component Standard state convention
--------------------------------------------------------------
Stoichiometric minerals or Unit activity of the pure
pure liquids (including water) component at all temperatures
and pressures.

Gases (including stable and The hypothetical state of unit
metastable steam) fugacity at any temperature.

Aqueous species Unit activity of the species
(other than H2O) in a hypothetical 1 molal
solution referenced to
infinite dilution at any
temperatureand pressure.
--------------------------------------------------------------

NOTE: Fugacity and fugacity coefficients of water in liquid and
gaseous phases are calculated by UNITHERM according to the gas
standard state.


Calculation of Gibbs Free Energies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The standard molal Gibbs free energies of minerals, gases, and
aqueous species are represented as apparent standard molal
Gibbs free energies (dg(T,P)) of formation from the elements at
the given temperature and pressure. These apparent energies can
be written as

dg(T,P) = dGf + (G(T,P) - G(Tr,Pr)),

where dGf denotes the standard molal Gibbs free energy of
formation of the species from its elements in their stable
phase at the reference temperature (Tr = 298.15 K) and pressure
(Pr = 1 bar), and G(T,P)-G(Tr,Pr) refers to differences in the
standard molal Gibbs free energy that arise from changes in
temperature (T - Tr) and pressure (P - Pr).

Further in the manual the apparent standard molal Gibbs free
energies of formation (dg(T,P)) are referred to as "Gibbs free
energies".

Water

Thermodynamic properties of pure water are calculated according
to the Haar-Gallagher-Kell (HGK) model (Kestin et al., 1984)
using the modified algorithm of the program H2O (P.N. Kopylov,
the Chernogolovka Institute of Experimental Mineralogy). This
algorithm is consistent with the algorithms employed in the
revised HKF model.

Aqueous species

Aqueous species are subdivided in UNITHERM into "basic species"
and "complexes". This subdivision is purely conventional and is
related to particular algorithms used to calculate Gibbs free
energies of aqueous species. The "basic species" are
self-sufficient, as their Gibbs free energies are calculated
directly from an equation of state. In contrast, definition of
the "complexes" and calculation of their energies require
references to other aqueous species.

NOTE: An aqueous complex as a chemical compound can be
optionally described either in terms of "basic species" or
"complexes".

Basic species

Gibbs free energies of the "basic species" (simple ions, some
polyatomic ions, and aqueous complexes) are calculated
according to the revised Helgeson-Kirkham-Flowers equations of
state (HKF) (Shock et al., 1992; Tanger and Helgeson, 1988).
The calculation algorithm has been extracted from the SUPCRT92
software package (Johnson et al., 1992). See the referred
publications for further details.

NOTE: The OH- ion holds a unique position among other aqueous
species. By default the free energy of formation of the OH-
ion is calculated from the Gibbs free energy of water and its
dissociation constant calculated according to Marshall and
Franck (1981):

dg(T,P)(OH-) = dg(T,P)(H2O) - R*T*ln(10)*pKdiss(T,P).

The built-in OH- ion cannot be deleted from the database but
you can add your own OH- ion with a modified name (e.g.,
"OH- (HKF)").

WARNING: At high temperatures and pressures the dissociation
constant of water calculated according to Marshall and Franck
(1981) is different from the dissociation constant of water
calculated using SUPCRT (e.g., the deviation can reach ~0.4 log
units at 350ÜC and PSAT). If you are working with aqueous
hydroxocomplexes at near-critical or supercritical conditions
make sure that you are using the "proper" OH- ion to preserve
the internal consistency of your aqueous species database.

Complexes

Gibbs free energies of the "complexes" are calculated according
to the modified Ryzhenko-Bryzgalin model (MRB) (Borisov and
Shvarov, 1992) from their pKdiss(T,P) values:

dg(T,P) = SUM(n[i]*dg[i](T,P) - R*T*ln(10)*pKdiss(T,P),

where dg[i](T,P) are Gibbs free energies of basic species
(and/or, H2O, H+, and OH-), and n[i] are stoichiometric
coefficients. Temperature and pressure dependence of
pKdiss(T,P) values is represented by the equation

pKdiss(T,P) = Tr/T*pKdiss(Tr,Pr) + B(T,P)*(zz/a)eff,

where (zz/a)eff is the effective property of the complex which
depends on temperature:

(zz/a)eff = A + B/T.

The parameter B(T,P) does not depend on the complex type and is
computed from the dissociation constant of water according to
Marshall and Franck (1981). It is assumed that for H2O
(zz/a)eff = 1.0107.

NOTE: If you exclude the default OH- ion from your chemical
system and replace it by an alternative OH- ion, the parameter
B(T,P) in the MRB equation will still be calculated from the
dissociation constant of water according to Marshall and Franck
(1981).

TIP: You can use the "complex" representation of
non-conventional aqueous species described according to the
revised HKF model. For example, you can use Al(OH)4- instead of
AlO2-. Just specify AlO2- and water as "basic species" and set
pKdiss(Tr,Pr), and A and B parameters of your complex to zero.

NOTE: UNITHERM does not provide facilities to calculate dg(T,P)
or pKdiss(T,P) values as simple power functions of temperature
and pressure. However, you can re-fit available experimental
data on pKdiss(T,P) or dg(T,P) in terms of the MRB or HKF
models using the auxiliary programs UT-RYZ and UT-HEL.

Pure phases (minerals, non-aqueous liquids and gases)

Gibbs free energies of minerals and non-aqueous liquids are
conventionally calculated as:

ÒT
dg(T,P) = dG(Tr,Pr) - S(Tr,Pr)*(T-Tr) + ¨Cp(t)dt -
ÓTr
ÒT ÒP
- T*¨Cp(t)/tdt + ¨V(T,p)dp,
ÓTr ÓPr

where S(Tr), V(Tr) and dGf are the standard molal entropy,
volume and Gibbs free energy of formation, and Cp(t) is the
molal isobaric heat capacity of the mineral at 1 bar. Cp(t)is
defined as a usual power function. If a mineral has phase
transitions, every stable interval is described by its own
Cp(t) equation. The maximum number of the Cp(t) equations
allowed in UNITHERM is 5. Each phase transition is
characterised by its temperature (at P = 1 bar), the reciprocal
of the Clapeyron slope (dT/dP), and values of heat and volume
effects. The temperature of the last phase transition can
define the upper temperature limit of the mineral stability.

Gibbs free energies of gases are calculated as:

ÒT
dg(T,P) = dG(Tr,Pr) - S(Tr,Pr)*(T-Tr) + ¨Cp(t)dt -
ÓTr
ÒT
- T*¨Cp(t)/tdt + R*T*ln(P),
ÓTr

unless you have specified the /1bar command-line option (see
"Starting UNITHERM in a Specific Mode").


Calculation of Coefficients of the Debye-Huckel Equation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using UNITHERM you can calculate coefficients necessary for
estimation of activity coefficients of charged aqueous species
according to the extended Debye-Huckel equation:

log(gamma) =

= -(A*z^2*sqr(I))/(1 + B*a*sqr(I)) + GAMMA + b-dot*I

or

log(gamma) =

= -(A*z^2*sqr(I))/(1 + B*a*sqr(I)) + GAMMA + b-gamma*I,

where GAMMA designates the mole fraction to molality
conversion.

b-dot represents the extended term parameter for the
NaCl-dominated solutions, which is a function of temperature
(Helgeson, 1969).

b-gamma represents the extended term parameter for the
electrolyte MX, which is a function of temperature and pressure
(Helgeson et al., 1981; Oelkers and Helgeson, 1990). Equation
of state coefficients for computing extended term parameters
b-gamma for a number of electrolytes are provided by the
UT_ELECT.REF database file.

Using UNITHERM you can calculate and tabulate the A, B, b-dot,
and b-gamma parameters.

Parameter of the UNITHERM
Debye-Huckel equation menu key
---------------------------------
A A
B B
b-dot C
b-gamma X
---------------------------------

b-gamma parameters are calculated for a specified "background"
electrolyte (see "Additional UNITHERM Commands").

Activity coefficients of charged aqueous species for your model
system are calculated by GIBBS (See Appendix 3, "Calculation of
Activity Coefficients of Aqueous Species").

NOTE: UNITHERM does not support any options to calculate
Setchenow coefficients to estimate activity coefficients of
neutral aqueous species. However, they can be calculated by
GIBBS (See Appendix 3, "Calculation of Activity Coefficients of
Aqueous Species").


Working with UNITHERM

To Start UNITHERM
~~~~~~~~~~~~~~~~~
At the command prompt, type "UT" and then press ENTER.

The UNITHERM window is displayed. Use the cursor control keys
for browsing the database contents and selecting components of
your interest.

The key bar with the list of the available commands is
positioned at the bottom of the screen. The key bar operates in
3 modes when used in conjunction with the SHIFT and ALT keys.

NOTE: Some additional commands are not listed on the key bar.
Press the F1 key to get brief information on these commands
(see "Additional UNITHERM Commands"for details).


Basic UNITHERM Commands
~~~~~~~~~~~~~~~~~~~~~~~
The following table describes the available commands on the
main key bar.

Use To
---------------------------------------------------------------
F1 Info Get general information about UNITHERM. You can use

UP and DOWN arrow keys to scroll through the help
text; Get the extended reference for the selected
component in the View mode (F3,F1).

NOTE: Short references about Aqueous complexes and
Pure phases in the UNITHERM "Info" window (F1) are
read from the UT_COMPL.REF and UT_MINER.REF text
files. You can change these references by editing
the top lines of these files immediately after the
exclamation mark (!).

F2 Input Add a new component to the database. The new
component is added to the end of the components
list (use SHIFT+F2 to insert a new component
immediately above the current position of the
cursor bar).

F3 View Examine the stored data for the selected component.

F4 Edit Modify the data for the selected component.

F5 Move Move the component to a different location in the
UNITHERM table of contents.

F6 RenDel Rename the selected component or delete it from the
data base.

F7 Search Find a component in the table of contents by a
string of characters (the search is
case-sensitive!).

F8 DefTab Define temperatures and pressures for calculation
of Gibbs free energies.

F9 Energy Calculate Gibbs free energies for the selected
component (kJ/mol by default). NOTE: The Gibbs free
energies of the components are tabulated by the F9
command for their standard state except for the
ideal gases. For ideal gases UNITHERM tabulates the
values of dg(T,P) = dg(T,1) + R*T*ln(P). To
calculate dg values for the gas standard state
(T,fr = 1) start UNITHERM with the /1bar option
(see "Starting UNITHERM in a Specific Mode").

F10 Quit Quit UNITHERM;
Terminate the program Subset mode (S, F10) (see
further).
---------------------------------------------------------------

NOTE: Operations that modify database (Input, Edit, Move,
RenDel) are blocked in the Subset mode or when the Read-Only
attribute is set for any of the data files (UT.DIR, UT#.BIN).

See "Additional UNITHERM commands" and "Starting UNITHERM in a
Specific Mode" on how to print your data.


Modified Basic Commands
~~~~~~~~~~~~~~~~~~~~~~~
The SHIFT key modifies some of these basic commands. Pressing
the SHIFT key displays the modified commands on the key bar.

Use To
---------------------------------------------------------------
SHIFT+F2 Insert Add a new component to the database. The new
componentis inserted immediately above the
current position of the cursor bar.

SHIFT+F5 Copy Duplicate the record. A copy of the selected
component is inserted immediately below the
current position of the cursor bar. You will
be prompted to input a new unique name for
the duplicated record.

SHIFT+F7 Next Find the next component matching the
previously defined search string.
---------------------------------------------------------------

NOTE: Operations that modify database (Insert, Copy) are
blocked in the Subset mode or when the Read-Only attribute is
set for any of the data files (UT.DIR, UT*.BIN).


UNITHERM Reaction Commands
~~~~~~~~~~~~~~~~~~~~~~~~~~
The ALT key activates a special "Reaction" mode of UNITHERM.
The relevant commands are displayed on the key bar by pressing
and holding the ALT key.

Using this option you can calculate pK and dGr(T,P) values of a
specified chemical reaction. The reaction name and
stoichiometry can be saved in the UT_REACT.REF file for a
future reference. Starting from the UNITHERM version 3.4, the
UT_REACT.REF file can contain multiple chemical reactions.

Use To
---------------------------------------------------------------
ALT+F1 Load Load a chemical reaction from the UT_REACT.REF
file

NOTE: A reaction can also be loaded using the
Reaction View, Edit, pK, and dGr commands (see
immediately below).

ALT+F2 Input Input a new chemical reaction.

ALT+F3 View View the title and stoichiometry of the current
reaction.

ALT+F4 Edit Edit the title and stoichiometry of the current
reaction.

ALT+F5 Save Save the reaction stoichiometry in the
UT_REACT.REF file.

ALT+F8 pK Calculate pK values of the specified chemical
reaction.

ALT+F9 dGr Calculate dGr(T,P) values of the specified
chemical reaction (kJ/mol by default).
---------------------------------------------------------------

NOTE: Start UNITHERM in the /1bar mode to calculate pK and
dGr(T,P) values of chemical reactions involving gases (see
"Starting UNITHERM in a Specific Mode").

See "Additional UNITHERM commands" and "Starting UNITHERM in a
Specific Mode" on how to print your data.

NOTE: An attempt to load a reaction from a UT_REACT.REF file
inherited from the 3.3 UNITHERM version will result in the
error message "Errors in UT_REACT.REF file". To make the
reaction usable again, the user should reformat the reaction
file using a text editor.

Working with the UNITHERM Reaction mode bears the following
features:

- You can work with one reaction at a time.
- The current working reaction is kept in the computer memory
but not in the UT_REACT.REF file.
- The current working reaction is never saved automatically.
To keep it in the UT_REACT.REF file, you must use the Save
command (ALT+F5).
- Entering a new reaction or editing the current one will
replace the reaction in the memory without any notification.
- The maximum number of reactions in the UT_REACT.REF file is
20.
- The order of reactions in the UT_REACT.REF file depends on
the order of saving. The most recent reaction is located at
the top of the reaction list.
- Normally, you cannot delete the reactions from the
UT_REACT.REF file in a UNITHERM session. To delete reactions
use a text editor in a DOS/WINDOWS session.
- An attempt to add the 21st reaction to the reaction file will
result in the automatic deletion of the bottom reaction from
the reaction list.


Additional UNITHERM Commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some additional commands are not listed on the key bar and can
be activated by pressing one of the following keys.

Use To
---------------------------------------------------------------
A Calculate the A parameter of the Debye-Huckel equation.

B Calculate the B parameter of the Debye-Huckel equation.

C Calculate the extended parameter of the Debye-Huckel
equation (b-dot) for NaCl-dominated solutions according
to Helgeson (1969).

X Calculate the extended parameter of the Debye-Huckel
equation (b-gamma) according to Helgeson et al.(1981)
and Oelkers and Helgeson (1990) for a selected
"background" electrolyte (see command F11).

D Calculate density of pure water.

E Calculate dielectric constant of pure water.

F Calculate fugacity of pure water and gases.

G Calculate fugacity coefficients of pure water and
gases.

NOTE: D, E, F and G commands return the properties of
water in its stable phase for any given temperature and
pressure. However, you can specify a metastable water
phase using the W command (see below).

P 1. Print the table of the database contents;
2. Print the stored data for the selected component in
the View mode (F3,P);
3. Print the tabulated parameters (e.g., F9,P; ALT+F9,P).
NOTE: You can redirect all the program output to the
UT.PRN ASCII file instead of to the printer using the
command-line /PTF option (see "Starting UNITHERM in a
Specific Mode").

S Select the subset of components for a specified
chemical element (filter the database).

W Switch between stable and metastable phases of water.

NOTE: In the "metastable" mode the HGK model equations
for the chosen phase ("Vapor" or "Liquid") are
extrapolated into the metastable phase region across
the vapor saturation curve. An error string (*Error*)
will be printed for an attempt to tabulate water
properties (energy, density, dielectric constant, etc)
outside the area of reasonable extrapolation.

F11 Switch between electrolytes available for computation
of the extended parameter of the Debye-Huckel equation
according to Helgeson et al.(1981) and Oelkers and
Helgeson (1990).

F12 Switch between energy units (cal vs J) for pure phases.
You can also use this key in the Input (F2,F12), View
(F3,F12), and Edit (F4,F12) modes.
---------------------------------------------------------------

Quick reference for most of the UNITHERM commands can be
obtained from the UNITHERM Info window (F1).


Starting UNITHERM in a Specific Mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At times you might want to run UNITHERM in a specific mode. To
ensure that UNITHERM runs in a particular mode, specify one of
the following options after the "UT" command. For example, type
"UT /PrintToFile" to redirect all the program output to the
UT.PRN file.

NOTE: The command-line options are case-insensitive. Some of
them can be abbreviated to the letters shown here in the
uppercase.

Use To
---------------------------------------------------------------
/1bar Calculate free energies for gases according to
their standard state (T,fr = 1 bar). The option
will affect only tabulation of dg(T,P),
dGr(T,P), and pK values.

/copy Copy the data files UT.DIR and UT*.BIN with
optimisation. The optimised database is copied
into the WT.DIR and WT*.BIN files in the same
directory. To make the copy of your database
usable you have to rename them to UT.DIR and
UT*.BIN files (e.g., using the DOS command ren
w*.* u*.*).

/EXPort Export selected records into the DATA.TXT file.
The selected database records are exported into
the ASCII file DATA.TXT in the current database
directory. If the file does not exist, it is
created automatically. If the file already
exists, the data will be appended to the file's
end.

/IMPort Import records from the DATA.TXT file.
The source ASCII file DATA.TXT must be located
in the current database directory. Started with
the /IMP option the UNITHERM program works as
usual, but the and commands will
input data from the DATA.TXT file. The new
records can be imported one by one or using a
multiple selection mode. The latter is similar
to the multiple selection mode of the UNITHERM
/scopy option (see below).

/kcal Calculate free energies of components and
chemical reactions in kcal/mol instead of
kJ/mol.

/PrintToFile Redirect all the program output to the UT.PRN
ASCII file or /PTF instead of to the printer.

/scopy Create a new database from the selected
components of the current database.

/tab Save a user-defined T-P definition table
(F8,ESC) in the UT_TABLE.REF file;
Retrieve a user-defined T-P definition table
(F8,ESC) from the UT_TABLE.REF file.

/UserElements Define or change your own "chemical elements" if
or /UE the periodical system is insufficient for your
purposes. The definitions are stored in
UT_USREL.REF ASCII file.

TIP: You can specify your own "chemical
elements" for special problems including
non-equilibrium geochemical processes (e.g.,
with blocked redox reactions for a particular
chemical element), or processes with isotopic
exchange.
---------------------------------------------------------------

NOTE: If you want to use specific modes (e.g., /1bar, /PTF or
/tab) on a day-to-day basis you can add the necessary options
to your UT.BAT file (e.g., ...\UNITHERM\UNITHERM.EXE /PTF) or
to the Command line of the UNITHERM Program Properties of
Windows (e.g., ...\HCH\UNITHERM\UNITHERM.EXE /PTF).

NOTE: Not all UNITHERM command-line options are compatible. For
example, /COPY, /SCOPY and/or /EXPort cannot be set
simultaneously. Setting the /COPY option will disable the rest
of the specified options; simultaneous setting of the /SCOPY
and /EXPort options will enable only /SCOPY.

NOTE: The /EXPort and /IMPort options are intended to facilitate
(1) exchange of custom data between the HCh users and (2)
UNITHERM upgrading using the existing digital databases (e.g.,
the SUPCRT family of data files).

Selecting components in the /SCOPY mode

When you start UNITHERM in this mode all the components of the
current database will be selected for copying. You should start
to prepare your reduced data set by deselecting unnecessary
components. All the selected components are designated with the
yellow colour. The same colour palette is used for selected
components in the /EXPort mode.

NOTE: In UNITHERM version 3.4, the colour for the selected
components has been changed from the selection colour of the
previous versions (from light blue to yellow).

Use To
---------------------------------------------------------------
INSERT or Select/Deselect the current component.
SPACE BAR

- Deselect all the components below the current
position of the cursor bar.

+ Select all the components below the current
position of the cursor bar.

* Reverse the present selection below the
current position of the cursor bar.
---------------------------------------------------------------

NOTE: If you switch to and from the UNITHERM subset mode (S),
you current selection will be preserved.

NOTE: During the program session you can work with UNITHERM as
usual, but the commands that modify the original database will
be disabled.

The data are copied when you complete your selection and quit
the program. The new database is copied into the WT.DIR and
WT*.BIN files in the same directory. To make the copy of your
database usable you have to rename them to UT.DIR and UT*.BIN
files (e.g., using the DOS command ren w*.* u*.*).

Selecting components in the /EXPort mode

The procedures of selecting components intended for export are
similar to those employed by the /SCOPY mode (use the reference
table above). However, there are no preselected components when
you start UNITHERM in the /EXPort mode.

Selecting components in the multiple /IMPort mode

Press F2 or SHIFT+F2 to display the list of the available
components from the DATA.TXT file (you can see up to 20 top
components).

Use the arrow keys, HOME, END, Pg DOWN, or Pg UP keys to
navigate within the list of the available components. Press
any letter key to jump to the next component starting with
this letter.

The procedures of selecting components from the import list is
similar to those employed by the /scopy and /IMPort modes (use
the reference table above). Press ENTER to complete the import
of the selected components.



CHAPTER 2. EQUILIBRIUM MODELLING

Overview
~~~~~~~~
Using the HCh package you can calculate the equilibrium
compositions of chemical systems containing an aqueous
solution, a gaseous mixture, non-aqueous liquid solutions,
solid solutions, and any number of pure individual phases
(minerals). You can consider either closed systems or open
systems with perfectly mobile components (PMC) (Korzhinskii,
1965).

The package also provides powerful tools for automated
equilibrium-dynamic modelling of geochemical processes (see
"Control Menu").

Preparation and maintenance of the necessary modelling files
are performed with the assistance of the MAIN program.

The equilibrium calculations on systems are performed by the
GIBBS program.


Files Required for Modelling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To proceed with calculations you must prepare several binary
files to define the chemical system and formats of the input
data. There are four different types of binary files used for
calculations. Each of them has a specific fixed extension.

The following table describes the files required for modelling.

Filetype Extension Status Purpose
---------------------------------------------------------------
System *.ST Mandatory Definition of a chemical system.

These files contain stoichiometric
data for all possible components of
the system and some additional data
such as ion charges and ion size
parameters, Setchenow coefficients
for neutral aqueous species, and
parameters for solid and liquid
solution models.

Blank *.BL Mandatory Definition of the input data and
their formats. These files define
the substances used for the
description of the total system
composition(s) and the
corresponding measurement units.

Input *.IN Optional Description of the total system
composition(s). You can describe up
to 3 system compositions according
to the format defined in a *.BL
file.

Control *.CT Optional Definition of the modelling
algorithm. These files contain the
information necessary for automated
equilibrium calculations for a
number of system compositions.
---------------------------------------------------------------

NOTE: The *.IN and *.CT files are not mandatory for equilibrium
calculations in the "manual" (non-automated) mode. You can
define the total system composition(s) in the direct
interactive mode of GIBBS using a *.BL file and calculate the
equilibrium composition immediately.

NOTE: For special purposes you might find it necessary to
create a special *.STG ASCII file complimenting your *.ST
binary file (see "System Menu" for details).


Working with MAIN

About MAIN
~~~~~~~~~~
The program is developed for preparation and maintenance of
files necessary for equilibrium modelling. Using MAIN you can:

1. Create and modify files defining your model chemical
systems.
2. Define algorithms for equilibrium-dynamic geochemical
modelling.
3. Calculate equilibrium compositions of your chemical systems
using GIBBS.


To start MAIN
~~~~~~~~~~~~~
At the command prompt, type "HCH", and press ENTER. The MAIN
window appears. Initially, the MAIN window displays the
contents of your current directory.

NOTE: The exact list of the displayed files depends on the
setting of the "Shown Files" switch in the Options menu.

The program is menu-driven. The menu bar is displayed at the
top of the screen.

- To choose a menu

Press the RIGHT arrow or LEFT arrow key to select the menu you
want, and then press ENTER (or UP arrow, or DOWN arrow). Or
press the highlighted letter for the menu you want.

Press F1 to get Help on the selected menu.

- To choose a command from a menu

Use the UP arrow or DOWN arrow key to select the command you
want, and then press ENTER.

Or press the highlighted letter for the menu you want. The
status bar at the bottom of the screen will contain the list of
keys for currently available commands.


Starting MAIN in a specific mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At times you might want to run MAIN in a specific mode. To
ensure that MAIN runs in a particular mode, specify one of the
following options after the "HCH" command. For example, type
"HCH /PrintToFile" to redirect all the program output to the
MAIN.PRN file rather than to a printer.

NOTE: The command-line options are case-insensitive. Some of
them can be abbreviated to the letters shown here in the
uppercase.

Use To
---------------------------------------------------------------
/PrintToFile (or /PTF) Redirect all the program output to the
ASCII file MAIN.PRN in the current
directory.

/IgnoreError (or /IE) To ignore the error message about
excluding the default OH- ion from the
aqueous species list (see "System
Menu" later).

To suppress the error message about
exceeding the maximum number (255) of
components in ideal liquid and
molecular solid solutions.
---------------------------------------------------------------

NOTE: If you want to use specific modes (e.g., /IE or /PTF) on
a day-to-day basis you can add the necessary options to your
HCH.BAT file (e.g., ...\MAIN\MAIN.EXE /IE) or to the Command
line of the MAIN Program Properties of Windows (e.g.,
...\HCH\MAIN\MAIN.EXE /IE).


To Quit MAIN
~~~~~~~~~~~~
To exit the program, choose Quit (Q) on the main menu bar.
Press ALT+Q to quit MAIN when the menu bar is not accessible.


Creating and Changing Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~
To create and change the files necessary for the modelling, use
the following menus.

Use To
---------------------------------------------------------------
System Create and edit files defining the chemical system
(*.ST files).

Blank Create and edit files defining the formats of the
input data (*.BL files).

Input Create and edit files describing the total system
compositions (*.IN files).

Control Create and edit files defining the algorithms for
equilibrium modelling (*.CT files).
---------------------------------------------------------------

System Menu
~~~~~~~~~~~
Creating *.ST file

1. From the System menu, choose New.
2. If the information about the database contents appears,
press any key to skip the message.
3. If the "Set directory for System file" directive is
displayed, set the directory where you want to save the
file. Press the drive letter to choose the drive, and select
the necessary directory using the ENTER and arrow keys.
Press ESC to accept the selected directory. Just press ESC
if no changes are required.
4. Define the type of your system. Select one or more of the
following possible phases:

- "Perfectly mobile components" (for an open system with
perfectly mobile components, PMC).
- "Individual phases" (for a system containing individual
phases - solids, liquids and gases that will not mix).
- "Solid solution(s)" (for a system containing solid
solutions). - "Liquid solution(s)" (for a system
containing non-aqueous liquid solutions).
- "Gaseous mixture" (for a system containing a gaseous
phase).
- "Aqueous solution"(for a system containing an aqueous
phase).

To select an item use the SPACE BAR or INSERT key. To
complete the selection press ENTER.

5. Select the chemical elements making up your system (you can
use the F1 key to view definitions of user-defined
elements). Press ENTER.
6. Put the elements in a suitable order, then press ENTER.
7. Select PMC (for an open system) and minerals from the
offered lists. You can use the F1 key to view chemical
formulas of these components.

For a system containing solid solutions:

- Enter the number of solid solutions.
- Select end-member minerals from the offered list (you can
use the F1 key to view chemical formulas of minerals).
Press ENTER.
- Input the name of the solid solution, then press ENTER.
- Press ENTER to confirm the Ideal mixing model.
- Fill in the table with the parameters of the appropriate
ideal site-mixing model (see Appendix 2, "Definition of
Solid Solution Models in HCh"). Just leave this table
empty to define the simplest "molecular" solution). Press
ESC to finish.
- Repeat these steps for the rest of the solid solutions.

For a system containing non-aqueous liquid solutions:

- Repeat the initial steps for a system with solid
solutions.
- Select either Ideal or Non-random two-liquid solution
model (NRTL) for your liquid solution. Press ENTER.
- If you chose NRTL, enter parameters of your model. Press
ESC to finish.

NOTE: If you know that your liquids can form N partially
immiscible phases, you need to create N copies of your
solution in the System file. For each copy of such solution
we recommend you to use one and the same solution name. As
the result of calculations you may obtain N equilibrium
liquid solutions, although their definitions and names in
the System file are identical.

Select gases and aqueous species from the offered lists.
Press ENTER.

8. Input the title of the system, then press ENTER.
9. Input the filename (without the extension). When ENTER is
pressed, the new System file is saved and ready for use.

NOTE: The maximum number of chemical elements allowed in your
model is 30.

NOTE: If you need to include in your aqueous system OH- ion
other than the default UNITHERM ion, you must start MAIN with
the /IgnoreError (/IE) option (see "Starting UNITHERM in a
Specific Mode"). The built-in OH- ion cannot be excluded from
the aqueous species list in a normal MAIN mode.

TIP: You can add the /IE option to your HCH.BAT file or to the
Command line of the MAIN Program Properties of Windows.


Viewing *.ST file

1. From the System menu, choose View.
2. Select the necessary *.ST file, and press ENTER.
3. Use the cursor keys for scrolling the file if necessary. If
the System file contains pure phases with non-integer
stoichiometric coefficients (e.g., pyrrhotite Fe0.877S), the
ALT key highlights them, and the ALT+L combination shows
their real values.
4. Press ESC to quit.


Editing *.ST file

Using the Edit command of the System menu you can:

- Delete unnecessary components from the file.
- Edit names and parameters of solid and liquid solutions.
- Edit effective diameters (a) of the charged aqueous species.
- Add individual Setchenow coefficients for neutral aqueous
species (see Appendix 3, "Calculation of Activity
Coefficients of Aqueous Species").
- Alter the system title.

Using the Edit command of the System menu you cannot:

- Edit stoichiometry or names of the components in System files
- they are defined in the UNITHERM database.
- Add new components to your System file or change them.

1. From the System menu, choose Edit.
2. Select the necessary *.ST file, and press ENTER.
3. Use the cursor keys to select the necessary line. Press
DELETE if you wish to delete the current component. A minus
sign (-) is displayed after the component number. To cancel
deletion, press the DELETE key again.
4. To rename a solid or liquid solution, select any of its
end-member components. Press ALT+N, enter the new name, and
press ENTER.
5. To edit parameters of a solid or liquid solution, select any
of its components. Press ALT+E, edit the parameters, and
press ESC.
6. To alter the diameter of the selected aqueous species, press
ALT+S. Enter the new value, then press ENTER.
7. To alter the system title press ALT+T, edit the title, and
press ENTER.
8. Press ESC to complete editing. The new data are saved in the
existing *.ST file.


Exporting *.ST files to ASCII files

Use this command to substitute free energies of specified
components with your own non-database values, or to fix their
activity coefficients at arbitrary constant values.

1. From the System menu, choose Export ASCII.
2. Select the necessary *.ST file, and press ENTER. An ASCII
file with the same name as the specified *.ST file and the
extension *.STG is created in the same directory. It
contains the names of all the system components (except PMC)
and allocates the fields for their energies and activity
coefficients.

You can edit this file using the ASCII Files command of the
Result menu (see "Result Menu").

NOTE: To use *.STG files for equilibrium modelling you must run
GIBBS with the /g option (see "Gibbs Options").

TIP: You might need *.STG files for processing experimental
data when the accuracy of the Gibbs free energies of components
provided by UNITHERM is not sufficient.


Other operations on *.ST files

The System menu provides some other commands to manage System
files. You can print, copy, rename, and delete files. When you
choose one of these commands you are asked to select a System
file, and the command is performed if you follow the program's
directives.


Blank Menu
~~~~~~~~~~
Creating *.BL file

1. From the Blank menu, choose New. The directive "Choose
System (*.st) file" appears.
2. Select the System file that describes your system, and press
ENTER.
3. If the "Set directory for Blank file" directive appears, set
the directory in which you wish to save the file. Press the
drive letter to choose the drive, and select the necessary
directory using the ENTER and arrow keys. Press ESC to
accept the selected directory. Just press ESC if no changes
are required.

4. If the system is open, select the fugacity units for the PMC
(bars, their decimal or natural logarithms). Press ENTER.
5. Select the way to define the total system compositions. The
following options for input substances are available:

- Chemical elements (for theoretical modelling).
- Ions and complexes (for processing hydrogeochemical data).
- Other substances (the default option; convenient in most
cases of geochemical modelling).

Press ENTER.

6. If the system is open, choose the type of each PMC:

- Constant (you must specify the fugacity value(s) in the
current *.BL file).
- Variable (you will input the fugacity value(s) later in an
*.IN file).
- Computed (the fugacity value(s) will be calculated by
GIBBS program using the formulas defined in a *.CT file).

7. If the system contains an aqueous solution, choose the
measurement unit for water (kg by default). Use the DOWN or
UP arrow keys to make your selection. Select the unit and
press ENTER.
8. If you have chosen chemical elements for definition of the
total system composition, choose units for each element.

If you have chosen "ions and complexes" or "other
substances" for definition of the total system composition,
input their chemical formulas followed by the appropriate
measurement units. You can define any number of ions or
substances. To finish the list press ENTER when the input
field for a formula is empty.

9. Input the filename (without the extension). When ENTER is
pressed, the new Blank file is saved and ready for use.

NOTE: Each Blank file points to one particular System file, but
there can be any number of different Blank files that point to
the same System file.


Viewing *.BL file

1. From the Blank menu, choose View.
2. Select the necessary *.BL file and press ENTER.
3. Use the cursor keys for scrolling the file if necessary. The
top line of the file contains the reference to the source
System file.
4. Press ESC to quit.


Editing *.BL file

1. From the Blank menu, choose Edit.
2. Select the necessary *.BL file and press ENTER.
3. Use the cursor keys to select the necessary data line.
4. To switch between the data column and the unit box press TAB.
5. To change the formula in the current data line press ENTER
and edit the formula.
6. Press ESC to complete editing. The new data are saved in the
existing *.BL file.

NOTE: You cannot change the number of ions or substances in
your Blank file. The only way to do this is to create a new
*.BL file. You can change the types of the PMC, formulas of
ions and substances, and their measurement units.


Exporting *.BL files to ASCII files

From the Blank menu, choose the Export ASCII command if you
need your Blank file in the ASCII format. The specified Blank
file is copied as a text file with the same name and the
extension *.BLK. This file can be used by external programs for
the automatic creating of Input files in the ASCII format (see
the Import ASCII command of the Input menu on page 27).

Other Operations on *.BL files

The Blank menu provides some other commands to manage Blank
files. You can print, copy, rename, and delete files. When you
choose one of these commands you are asked to select a Blank
file, and the command is performed if you follow the program's
directives.


Input Menu
~~~~~~~~~~
Creating *.IN file

1. From the Input menu, choose New. The directive "Choose Blank
(*.bl) file" appears.
2. Select the necessary Blank file, and press ENTER.
3. If the "Set directory for Blank file" directive appears, set
the directory in which you wish to save the file. Press the
drive letter to choose the drive, and select the necessary
directory using the ENTER and arrow keys. Press ESC to
accept the selected directory. Just press ESC if no changes
are required.
4. Fill in the columns with the required data:

- Fugacities of PMC (if the system is open and their type is
variable).
- Quantity of water (for a system with an aqueous solution).
- Quantities of chemical elements, ions or other substances.
- Titles for each composition of the system.

Measurement units for all the data are shown to the right of
input fields. After completing the input, press ESC.

5. Input the filename (without the extension). When ENTER is
pressed, the new Input file is saved and ready for use.

NOTE: If you use ions to define the system composition, you
might get the error message on non-zero charge balance. In this
case, correct the composition in one of the three suggested
ways and press ESC again.

NOTE: Each Input file points to one particular Blank file, but
there can be any number of different Input files that point to
the same Blank file.


Viewing *.IN file

1. From the Input menu, choose View.
2. Select the necessary *.IN file and press ENTER.
3. Use the cursor keys for scrolling the file if necessary. The
top line of the file contains the reference to the source
Blank file.
4. Press ESC to quit.


Editing *.IN file

1. From the Input menu, choose Edit.
2. Select the necessary *.IN file and press ENTER.
3. Move to the field that requires editing:

- Use the DOWN arrow or UP arrow keys to move along the
column.
- Use the TAB or SHIFT+TAB keys to switch between columns.
- Press ENTER to shift the edit box one field down.
- Clean all the fields in the column to delete a composition
completely.
- Press CTRL+C to copy the contents of the current field to
the right column, and ALT+C to copy the entire column to
the right.

4. Press ESC to complete editing. The new data are saved in the
existing *.IN file.


Importing ASCII files

From the Input menu, choose the Import ASCII command if you
need to create an *.IN file from an existing ASCII file. The
source ASCII file must have the fixed extension .INP and is
created by filling in the table presented in a *.BLK file (see
the Export ASCII command from the Blank menu). You can edit the
loaded data as usual (see "Editing *.IN File"). Press ESC to
save the data into a new *.IN file.


Other operations on *.IN files

The Input menu provides some other commands to manage Input
files. You can print, copy, rename, and delete files. When you
choose one of these commands you are asked to select an Input
file, and the command is performed if you follow the program's
directives.


Control Menu
~~~~~~~~~~~~
Menu functions

The Control menu enables you to create and maintain files
defining the automatic equilibrium calculations for a number of
system compositions. Using Control file instructions, the GIBBS
program can perform the entire series of calculations without
your intervention. During these calculations the results of any
computational step can be used as input data for the subsequent
calculations.

Although the application area of the algorithmic approach
implemented in HCh is very wide, it has been used mostly for
local equilibrium modelling by the "step-flow-through reactor"
technique. This practice has resulted in adoption of a specific
terminology for the definition of modelling algorithms. A
single equilibrium calculation is called "step"; a series of
steps related by a single common rule is called a "wave". A
numerical model defined in a Control file can include one or
more waves each containing an arbitrary number of steps. If
your model includes a single wave, it is one-dimensional; if
the number of waves is more than one, the model is
two-dimensional. The steps can also be referred to as "blocks",
"reactors" or "points" depending on the model context.

As in all equilibrium calculations, each reactor must be
characterized by its own temperature, pressure, chemical
potentials of PMC, and bulk chemical composition. In a Control
file you can define these parameters for all the reactors as
functions of relative time, distance or other conditions.

A single-wave model can represent a unit stage of a geochemical
process. It may be visualised as a one-dimensional (either in
terms of space or time) sequence of reactors. Equilibrium
compositions of consecutive reactors are calculated through a
single pass. For example, in the case of a "flow-through"
reactor model one wave corresponds to a single batch of fluid
passing through a reactor sequence.

A multi-wave model can represent a multi-stage geochemical
process. It may be visualised as a two-dimensional (either in
terms of time or space) sequence of reactors. Equilibrium
compositions of consecutive reactors are calculated through a
number of passes (waves). For example, in the case of a
"flow-through" reactor model a number of waves correspond to a
number of fluid batches passing through a reactor sequence.

An equilibrium-dynamic model can be defined using expressions,
relations, and conditions. See "Control file conventions" for
details.


Control file conventions
~~~~~~~~~~~~~~~~~~~~~~~~
Expressions

The expressions enable you to write formulae defining all the
state variables of your system: temperature, pressure, chemical
potentials of PMC and the bulk chemical composition of an
equilibrium reactor.

To write formulae you can use the usual arithmetic operators
and functions, any numerical constants, special variables, and
relations. For example, to specify the temperature, pressure
and chemical potential of the PMC for your calculation step you
can write

T = 400-i*50
P = 3*T
lg(f) = 8.7-23560/(T+273.15)

where T is temperature in ÜC, i is the number of the current
calculation step, P is pressure in bars, and f is fugacity of
the PMC in the user-specified units.

To define the bulk chemical composition of an equilibrium
reactor ([*]) you can write

[*] = [1]+100*[2]
[*] = [1]+[2]*10^(i-6)
[*] = [A]

and so on. [1] and [2] are the bulk system composition
specified in the source *.IN file, and [A] is the bulk
composition of the aqueous phase obtained at the preceding
calculation step. The full list of the permissible special
variables is provided later. For further details, see
Appendix 4, "Examples Of The Control Files Usage".


Relations

A relation is a pair of expressions connected by relational
operators, which are = (equal to), <= (less than or equal to),
>= (greater than or equal to), < (less than), > (greater than),
<> (not equal to). When used in expressions, relations should
be surrounded by parenthesis (). For these relations HCh
generates the value of +1 for true and the value of 0 for
false. For example, the formula

[*] = ([A]+100*[2])*(i<5)+([A]+100*[3])*(i>=5)

will be equivalent to

[*] = [A]+100*[2]

for calculation steps from 1 to 4, and to

[*] = [A]+100*[3]

for calculation steps greater than or equal to 5.


Conditions

The conditions are relations used to define the number of
calculation steps or waves. See Appendix 4, "Examples Of The
Control Files Usage" for details.


Operators and functions

To define your modelling algorithms use the following
arithmetic operators: + , ? , * , / , ^ or ** (raise to a
power). The available functions are: log, exp, and sqr (square
root).


Variables

To define your modelling algorithms use the following variables
in the Control files:

Symbol Variable
--------------------------------------------------------------
T Current temperature (ÜC).

P Current pressure (bars).

f, lg(f), or ln(f) Current fugacity of PMC in selected units.

i Current step number.

N Current wave number.

W Current quantity of water (moles).

[1] 1st composition from *.IN file.

[2] 2nd composition from *.IN file.

[3] 3rd composition from *.IN file.

[A] Bulk composition of the aqueous phase of
the system (current wave, preceding step).

[G] Bulk composition of the gaseous phase of
the system (current wave, preceding step).

[L] Bulk composition of liquid non-aqueous
phases of the system (current wave,
preceding step).

[S] Bulk composition of solid phases of the
system (current wave, preceding step).

[*] Current total system composition
([*]=[A]+[G]+[L]+[S]).

{A} Bulk composition of the aqueous phase of
the system (same step, preceding wave).

{G} Bulk composition of the gaseous phase of
the system (same step, preceding wave).

{L} Bulk composition of liquid non-aqueous
phases of the system (same step, preceding
wave).

{S} Bulk composition of solid phases of the
system (same step, preceding wave).

{*} Total system composition
({*}={A}+{G}+{L}+{S}) of the same
equilibrium reactor obtained in the
preceding wave.
--------------------------------------------------------------

A special syntax for the {} vector variables
{*|G|A|L|S(expression)} allows you to refer to any step of the
preceding wave. The value of the expression defines the step
number. For example, {A(i-1)} means "the bulk composition of
the aqueous phase from the preceding step of the preceding
wave". See Appendix 4, Examples of Control Files Usage, for
details.

NOTE: The [*] designation has double meaning:
1. Current total system composition;
2. Total system composition obtained at the preceding step.

This convention follows the usual convention adopted in
computer programming. If the variable is to the left from the
assignment operator ("="), it represents the new value. If the
variable is to the right from the assignment operator, it
represents the old (preceding) value. For example, the formula
[*]=[*]-[G] means "let the total system composition at the
current step be equal to the total system composition at the
preceding step minus the bulk composition of the gaseous phase
obtained at the preceding step".

Note that T and P have the same "double meaning" (e.g., you can
write T=T+1, which means that at each calculation step the
temperature is incremented by 1).


Creating *.CT file

Modelling of geochemical processes in HCh involves circular
calculations of equilibrium compositions of a chemical system
(reactor) under changing input condition. To define an
algorithm for such circular calculations you are provided with
an on-screen chart of a computation loop. The loop consists of
several blocks defining loop initialisation, an algorithm for
setting the state variables for a calculation step, GIBBS
run-time options, and a termination condition. Using this
graphical interface you can select, view and edit each block of
the model loop.

1. From the Control menu, choose New. The directive "Choose
Input (*.in) file" appears.
2. Select the necessary Input file, and press ENTER.
3. If the "Set directory for Control file" directive appears,
set the directory where you wish to save the file. Press the
drive letter to choose the drive, and select the necessary
directory using the ENTER and arrow keys. Press ESC to
accept the selected directory. Just press ESC if no changes
are required.
4. Using the graphical interface define the algorithm for
computation of the Primary (N=0) wave. Use arrow keys to
select the necessary definition block.

- Choose the block "Set Initial Composition (i=0)". Input
temperature, pressure, fugacities of computed PMC (if
any), and the total system composition for the initial
state of the system (this block is optional; see Appendix
4, "Examples of Control Files Usage"). Press ESC.
- Choose the block "Recalculate Composition (i=i+1)". Input
the expressions that define changes of temperature,
pressure, fugacities of PMC (if any), and the total system
composition on the i-th ("general") step of the Primary
wave (i= 1,2,...) computation. Press ESC.
- Choose the block "Calculate equilibrium". If necessary,
input options for GIBBS (see "GIBBS Options"). Press
ENTER.
- Choose the block "Test Finish Condition". Input the
condition that defines the length of the Primary wave.
Press ENTER.
- Choose the block "Finish the wave definition". If you have
omitted the "Set Initial Composition" step, the warning is
displayed; choose "Yes" if the initial step is not
required by your model.

5. Answer the question "Should the SECONDARY WAVE be defined
also?":

- choose "Yes" if your model is multi-wave.
- choose "No" to complete the model definition.
- choose "Return" (or press ESC) to cancel the question.

6. Define the algorithm of the Secondary (N=1,...) wave
computation:

- Choose the block "Set Initial Composition (i=0)". Input
temperature, pressure, fugacities of computed PMC (if
any), and the total system composition on the initial step
of the secondary wave (this block must be omitted if it
was not used in the Primary wave). Press ESC.
- Choose the block "Recalculate Composition (i=i+1)". Input
the expressions which describe the changes of temperature,
pressure, fugacities of computed PMC (if any), and the
total system composition on the i-th ("general") step of
the Secondary wave (i=1,2,...) computation. Press ESC.
- Choose the block "Test Finish Condition". Input the
condition which defines the length of the Secondary wave.
Press ENTER.
- Choose the block "Finish the wave definition". If no
errors are detected, input the condition defining the
number of secondary waves. Press ENTER.

7. Input the description of the model (any text), then press
ENTER.
8. Input the filename (without the extension). When ENTER is
pressed, the new Control file is saved and ready for use.

NOTE: Each Control file points to one particular Input file,
but there can be any number of different Control files that
point to the same Input file.

NOTE: You can omit an optional block of the loop
initialisation, ("Set Initial Composition (i=0)") from your
Primary wave definition. In this case, calculations by GIBBS
will start from the "Recalculate Composition (i=i+1)" block.
However, you will not be able to use the block of the loop
initialisation in subsequent calculation waves, either.


Viewing *.CT file

1. From the Control menu, choose View.
2. Select the necessary *.CT file, and press ENTER.
3. Use the cursor keys for scrolling the file if necessary. The
top line of the file contains the reference to the source
Blank file.
4. Press ESC to quit.


Editing *.CT file

1. From the Control menu, choose Edit.
2. Select the necessary *.CT file, and press ENTER.
3. Use the DOWN arrow or UP arrow keys to move along the
column.
4. Press ENTER to modify the current step of your algorithm,
the model title, or GIBBS options.
5. Press ESC to complete editing. The new data are saved in the
existing *.CT file.


Other operations on *.CT files

The Control menu provides some other commands to manage Control
files. You can print, copy, rename, and delete files. When you
choose one of these commands you are asked to select a Control
file, and the command is performed if you follow the program's
directives.


GIBBS Menu
~~~~~~~~~~
Normally the GIBBS program is called by MAIN.

To calculate the equilibrium composition of a chemical system
GIBBS requires information on the total system composition, the
possible components of the system and their thermodynamic
properties, the temperature and pressure of equilibration. Most
of this information is provided by MAIN. Before calling GIBBS,
MAIN creates a special file GIBBS.INI that contains:

- The source files specification and the list of options for
GIBBS;
- The path to the database in use;
- The path to the MAIN program (this path is required when
GIBBS returns the control to MAIN and is included
automatically).


Choosing the source file

You can pass either Blank (*.BL), Input (*.IN), or Control
(*.CT) file to GIBBS. When you pass an Input file, GIBBS
calculates equilibria for the total system composition(s) from
this file; when you pass a Blank file you have to define the
total system compositions manually during GIBBS execution. In
both cases you need to define the temperature and pressure
before the calculations begin. When you pass a Control file, no
additional input is required.

1. From the GIBBS menu, choose Source File.
2. Select the required *.BL, *.IN, or *.CT file and press
ENTER. MAIN keeps your choice in memory for further use.

NOTE: If you call GIBBS without choosing a source file, MAIN
passes to GIBBS the file used on the previous call, or the
source file specified in its setup file (MAIN.INI). If no file
was specified previously, MAIN will ask you to define it.


Setting GIBBS options

MAIN program does not know options for GIBBS. It can only pass
to GIBBS a string of characters. See the list of the available
options in the "GIBBS Options" section.

1. From the GIBBS menu, choose Set Options.
2. Edit the option list, and press ENTER. MAIN keeps the
options in memory for further use.

NOTE: If you call GIBBS without setting options, MAIN passes to
GIBBS the list of options used on the previous call or the
options specified in its setup file (MAIN.INI).

NOTE: GIBBS options for automated equilibrium modelling must be
defined within *.CT files. The options defined in *.CT files
will override any options defined by means of the "GIBBS" menu.


Calling GIBBS

From the "GIBBS" menu, choose Run GIBBS. If source file has
been already specified, the GIBBS.INI file is created and GIBBS
is loaded and started. Otherwise you will be requested to
choose the source file (see above).

NOTE: This sequence of operations is available if MAIN knows
the path to the GIBBS program. If not, you are requested to
specify the GIBBS location prior to the call (see also the Set
Paths command in the Options menu).


Result Menu
~~~~~~~~~~~
There are two types of files generated by MAIN and GIBBS
programs: ASCII files (their extensions always consist of 3
letters) and binary files (their extensions always consist of 2
letters). All the ASCII files can be used by any external text
viewer or editor, but also can be browsed from inside MAIN. The
binary files can be processed by means of MAIN only.


ASCII files

Using this command you can work with the following ASCII files:
*.PRN, *.STG, *.BLK, *.INP, *.RES, *.REX (generated by MAIN),
*.LST (generated by GIBBS), and *.TXT (DOS text files).

1. From the Result menu, choose ASCII Files.
2. Select the required ASCII file and press ENTER.
3. Use the arrow keys to browse the file.
4. To delete the file from the disk, press ALT+D.
5. To rename the file, press ALT+R.
6. Press ESC to complete browsing.
7. To edit the file (*.STG only!), press ALT+E. Input or modify
Gibbs free energy and/or activity coefficient for the
necessary component(s) and press ESC. Confirm that you want
to save the modified data.

WARNING: If you substitute an energy of an aqueous "basic
species" using an *.STG file, the free energies of the related
"complexes" will still be calculated by HCh using the energies
provided by UNITHERM. Thus, you will need to replace energies
of the "daughter" complexes as well.


Binary file

This command allows you to view the contents of the *.RE binary
files that are created by GIBBS in the modelling mode. You can
also export selected data to .RES and .REX ASCII files (See
Appendix 5 for details).

1. From the Result menu, choose Binary File.
2. Select the required *.RE file and press ENTER.
3. Choose the mode to view the file.

Modelling results in a binary file are represented by a set of
points, where each point corresponds to a single equilibrium
computation. The points are graphically arranged by MAIN either
in a one-dimensional array, or in a table, where rows will
correspond to waves, and columns will correspond to steps.
Using the graphical interface of MAIN you can examine your
equilibrium compositions point by point (Single Points mode) or
series by series (Cross Sections mode).

Single points mode

Use the arrow keys to navigate within the table. To view or
process the data, use the following keys:

Use To
--------------------------------------------------------------
Esc ESC=Exit Change the browsing mode or terminate the View
command.

F F=File Change the name of the file (extension .RES)
for saving selected results.

P P=Print Print the equilibrium composition of the
selected point ("reactor").

S S=Save Save the equilibrium composition of the
selected point in an ASCII file (extension
.RES).

V or V=View Show the equilibrium composition of the current
ENTER point.
--------------------------------------------------------------

Cross Sections mode

Using the Cross Sections mode you can examine your equilibrium
compositions series by series.

Select a particular cross-section mode to examine the modelling
results. Press ENTER.

Use To
--------------------------------------------------------------
Horizontal To examine the evolution of your points within a
computational wave.

Vertical To examine the evolution of your points for a
given reactor (step).

Diagonal (/) To examine the state of your system at a
particular "moment" (a "system shot").
--------------------------------------------------------------

NOTE: The meaning of particular cross-sections can change if
you use a special syntax for the Control file vector variables.

Use the arrow keys to navigate within the table of points and
select a series of interest. To view or process the data, use
the following keys:

Use To
--------------------------------------------------------------
C C=Component Select a system component to show.

Esc ESC=Exit Change the browsing mode or terminate a
command.

O O=CutOff Truncate the records in the current result
(*.RE) file beyond the selected
cross-section.

Use this command to recalculate a part of
your equilibrium-dynamic model starting
from a particular reactor/wave. For
horizontal cross-sections the command also
allows you to delete preceding waves. Use
this option to reduce the size of the
result file prior to adding additional
waves.

S S=Save Save the table with calculation results for
specified components of the selected
cross-section. The table is saved in an
ASCII file with .REX extension.

TAB TAB=Unit Switch between quantity and concentration
for the solution components in the "View"
mode.

V or V=View Show the component variance along the
ENTER cross-section.
--------------------------------------------------------------

NOTE: The ASCII *.REX files are ready for import by a
spreadsheet program (e.g., Excel).


Options Menu
~~~~~~~~~~~~
There are several internal switches in MAIN which you can
change to make working with the program more convenient for
you. Their values are stored in the MAIN.INI file and used for
setting the program modes when MAIN starts. MAIN.INI also
contains the paths to the UNITHERM database and the GIBBS
program, and the data required for GIBBS calls - the source
file specification and the list of GIBBS options.


Change Directory Request switch

1. From the Options menu, choose ChDir Request.
2. Select one of the following answers, and press ENTER.

Answer Meaning
--------------------------------------------------------------
All The directive "Set directory for ... file" is
displayed whenever you create *.ST, *.BL, *IN, or
*.CT file (the default setting).

*.st only The directive "Set directory for ... file" is
displayed only on the creation of System files.

None All files are created in the current directory
without additional requests.
--------------------------------------------------------------


Shown Files switch

1. From the Options menu, choose Set Shown Files.
2. Select one of the following answers, and press ENTER.

Answer Meaning
--------------------------------------------------------------
Specific... MAIN displays only the files relevant to a chosen
menu.

All files MAIN displays all files in the current directory
(the default setting).
--------------------------------------------------------------


Delay Time switches

This switch sets the display time for instructions and messages
guiding your work.

1. From the Options menu, choose Set Delay Times.
2. Select the display time for instructions, and press ENTER.
3. Select the display time for messages, and press ENTER.

The default values are 3 sec for instructions and 2 sec for
messages.


Set Paths switches

If you have different versions of thermodynamic databases or
GIBBS programs, you might need this command to switch between
them. You will also need to use this command if you lose your
old MAIN.INI file.

1. From the Options menu, choose Set Paths.
2. Select the path you wish to define, and press ENTER.
3. To set path to a UNITHERM database, set the directory with
the required version of the database, and press ESC. This
database will be used for further work.
4. To set path to a GIBBS program, set the directory with the
required version of GIBBS, and press ESC. The selected
version of GIBBS will be used for further work.

NOTE: The ESC key does not terminate execution of the command
if the selected directory does not contain the database or the
GIBBS program. In this case an error message appears. You can
terminate execution of the command by pressing CTRL+Q.


Screen Colours switches

If you want to change the colour palette of MAIN:

1. From the Options menu, choose Set Colours.
2. Select the text item for which you want to change the
colours, and press ENTER.
3. Change the foreground and/or background colours of the
selected item by pressing the arrow keys. The example box
enables you to see the results.
4. Press ENTER to accept the colours for the selected item.
5. Press ESC to finish the colour definition session.
6. Accept the changes, or restore the old or default settings.

NOTE: GIBBS uses the same colour palette as MAIN.


Set Defaults switch

You can use this switch to restore the default settings of the
MAIN program.

1. From the Options menu, choose Set Defaults.
2. Select the setting you wish to restore, and press ENTER.


Saving settings

By default all the customised settings are lost when the MAIN
session is completed. To make them permanent you must save them
in the MAIN.INI file.

1. From the Options menu, choose Save Setup.
2. Select location for the customised MAIN.INI file, and press
ENTER.

Option Directory
--------------------------------------------------------------
in the current directory The directory from which MAIN was
started.

where MAIN.EXE located The MAIN directory (common setting).

in another directory Any directory you like.
--------------------------------------------------------------

NOTE: When MAIN starts it searches for the MAIN.INI file in the
current directory, then (if it is not found) in the MAIN
directory.

TIP: The most convenient way to work is probably as follows:
1. Create a separate directory for your data files.
2. Save your MAIN.INI file with the appropriate settings in
this directory.
3. Start MAIN from this directory.


Restoring settings from file

At times you might need to restore the MAIN settings from a
MAIN.INI file located in a directory other than your current
directory or the MAIN directory. To read the settings from this
file and set the corresponding modes:

1. From the Options menu, choose Load Setup command.
2. Select the required MAIN.INI file, and press ENTER. The file
is read and the modes are set.


Working with GIBBS

About GIBBS
~~~~~~~~~~~
GIBBS performs equilibrium calculations on chemical systems
using a free energy minimisation technique.


Equilibrium Calculations
~~~~~~~~~~~~~~~~~~~~~~~~
When GIBBS starts it reads the GIBBS.INI file, loads the source
file (*.BL, *.IN, or *.CT), and reads the corresponding System
(*.ST) file. The subsequent procedure differs depending on the
type of the source file.


GIBBS reads Control file
~~~~~~~~~~~~~~~~~~~~~~~~
In this automated mode the calculations begin immediately. The
results of calculations are always saved in a file in the
current directory.

If the model is multi-wave, the results will be automatically
written into a binary file with the extension .RE. The file
will have the same name as the source Control (*.CT) file.

If the model is single-wave, you will be requested to choose
between the binary (*.RE) and the ASCII (*.LST) output files.
If you select an ASCII file option, you will be able to edit
the name of the output *.LST file.

NOTE: In the modelling mode GIBBS uses the options defined in
the *.CT source file.


GIBBS reads Input file
~~~~~~~~~~~~~~~~~~~~~~
1. Input the value of temperature in ÜC (default is 25) and
press ENTER, or press ESC to quit the program.
2. Input the value of pressure in bars (default is Sat. -
saturated vapour pressure for the defined temperature) and
press ENTER, or press ESC to return to the previous step.

Calculations begin immediately after pressing the ENTER key.
If the Input file contains more than one system composition,
the compositions are sequentially processed for the same T
and P. The title of the processed composition is displayed
in the third screen line. If you think that the calculations
are too long and do not want to wait longer, press ESC to
terminate them. The message "Process terminated..." appears,
and the calculations proceed for the next composition. When
all the compositions are processed, the table of results is
displayed (see "Table of Results").

3. Use the cursor keys for scrolling the table of results if
necessary. Press ESC to finish.
4. Choose one of the following answers:

Choose To
--------------------------------------------------------------
Print Send the table of results to the
printer.

Save in file Add the table to a file in the current
directory.

None Skip the results (default).

Add as initial values Save the first equilibrium composition
in the source *.IN file. This option is
available if (1) calculations for the
first composition were not terminated,
and (2) the source *.IN file does not
already contain initial values.
--------------------------------------------------------------

The program performs the chosen action and returns to the
start. Now you may change temperature and/or pressure and
repeat the calculations for the same system compositions. If
the *.IN file contains a single system composition and you did
not change the temperature and pressure, you may modify the
system composition from keyboard and then repeat calculations.

NOTE: If you start GIBBS using an *.IN file with the previously
saved initial values, the corresponding T and P will be offered
for input.


GIBBS reads Blank file
~~~~~~~~~~~~~~~~~~~~~~
1. Input the value of temperature in ÜC (default is 25) and
press ENTER, or press ESC to quit the program.
2. Input the value of pressure in bars (default is Sat. -
saturated vapour pressure for the defined temperature) and
press ENTER, or press ESC to return to the previous step.
3. If the system is open, input fugacities of all variable PMC
(measurement units are displayed on the screen), or press
ESC to return to the start.
4. Input quantities of water and elements, ions or substances
as specified in the *.BL file (units are displayed on the
screen), or press ESC to return to the start.

If you input quantities of ions, you might get the message
on non-zero charge balance. If this is the case, choose one
of three offered ways for correction of the system
composition.

5. Input the composition title and press ENTER (to return to
start press the ESC key as usual). Calculations begin
immediately.

If you think that the calculations are too long and do not
want to wait longer, press ESC to terminate them. The
message "Process terminated..." appears, and the program
returns to the start. If the job is successfully completed,
the table of results is displayed (see "Table of Results")

6. Use the cursor keys for scrolling the table of results if
necessary. Press ESC to finish.

7. Choose one of the following options: "Print", "Save to
file", "None", and "Add as initial values" (see the previous
section).

After returning to the start, you can modify temperature,
pressure, and/or total system composition and repeat
calculations for the new values.

NOTE: If you start GIBBS using a *.BL file with the previously
saved initial values, the first cycle of calculations begins
immediately.


Tables of Results
~~~~~~~~~~~~~~~~~
Standard table of results

This table is displayed when GIBBS calculations in
non-automated mode are successfully completed. It can be saved
in a text file with the fixed extension .LST. If the file with
the specified name already exists, the table will be added to
its end. The tables of results within the *.LST file will be
separated by the page separator code (ASCII 12). In the general
case the table of results is structured as follows:

Data Quantity and Activity
Concentration coefficients
units
--------------------------------------------------------------
System title

Temperature

Total pressure

Compositional data (columns 1 - 3)

Input data

Composition titles

Total system compositions User-specified
(including fugacities of PMC
for open systems) in
user specified substances

Output data

- Pure phases

Equilibrium assemblage of Moles + Mass
pure phases fractions (%)
in the bulk
solid phase *

Total number of moles of Moles
pure phases

Bulk composition of pure Moles **
phases in terms of chemical
elements

Total number of moles of Moles
chemical elements

- Solid solutions

Equilibrium composition of Mole fractions Rational
a solid solution

Total number of moles of Moles + Mass
end-member substances + fractions (%)
mass fraction (%) of the in the bulk
solid solution in the bulk solid phase **
solid phase

Bulk composition of the solid Moles **
solution in terms of chemical
element

Total number of moles of Moles
chemical elements

- Non-aqueous liquid solutions

Equilibrium composition of Mole fractions Rational
a liquid solution

Total number of moles of Moles
end-member substances

Bulk composition of the Moles **
liquid solution in terms of
chemical elements

Total number of moles of Moles
chemical elements

- Gaseous mixture

Equilibrium composition of the Mole fractions Rational
the gaseous mixture

Total number of moles of gases Moles

Bulk composition of the gaseous Moles **
mixture in terms of chemical
elements

Total number of moles of Moles
chemical elements

- Aqueous solution

Equilibrium concentration of Mole fraction Rational
water

Equilibrium concentrations of Molality Molal
aqueous species

Ionic strength Molality

pH

Eh ***

Bulk composition of the
aqueous solution in terms
of:

Water Moles **

Chemical elements in the Moles **
aqueous phase excluding water

- GIBBS run options (optional)
--------------------------------------------------------------

* Bulk solid phase comprise pure phases (minerals) and solid
solutions.

** Moles by default. You can specify your own output units
using the /o GIBBS option (see "GIBBS Options" for details).

*** Eh value is output only if you included the H2 (aq) species
in your aqueous speciation model.

NOTE: The activity coefficients of components of ideal
solutions are always set to one. See Appendix 2, "Definition of
Solid Solution Models", for clarification.

NOTE: Tables of results produced by GIBBS in the modelling mode
are not displayed when calculations are completed. Instead they
are automatically written into the file that you have specified
at the start of the calculations.

In comparison with the tables of results produced by GIBBS in a
non-automated mode, they do not contain information on the
initial system compositions (except the fugacities of the PMC).


Tables extracted from binary files

Tables of results can also be extracted from the binary *.RE
files produced by GIBBS in a modelling mode (see "Result
Menu"). However, these tables contain reduced information in
comparison with the text *.LST files.

Data Quantity and
Concentration
units
--------------------------------------------------------------
Step information

Wave number

Step number

Temperature

Total pressure

Fugacities of PMC for open systems

Compositional output data

- Pure phases

Equilibrium assemblage of pure phases Moles

- Solid solutions

Equilibrium composition of a solid solution Mole
fractions

Total number of moles of end-member substances Moles

- Non-aqueous liquid solutions

Equilibrium composition of a liquid solution Mole
fractions

Total number of moles of liquids Moles

- Gaseous mixture

Equilibrium composition of the gaseous mixture Mole
fractions

Total number of moles of gases Moles

- Aqueous solution

Equilibrium concentration of water Mole
fraction

Equilibrium concentrations of aqueous species Molality

pH

Eh

Bulk composition of the aqueous solution in terms of:

Water Moles

Chemical elements in the aqueous phase excluding Moles
water
--------------------------------------------------------------

NOTE: Data on the activity coefficients of the solution
components are not provided.

NOTE: Data from the binary *.RE files can be exported to text
files (*.REX) ready for import by a spreadsheet program (e.g.,
Excel). The structure of these files is very similar to the
structure of the *.RES text files, but the bulk compositions of
phases in terms of chemical elements are omitted.


GIBBS Options
~~~~~~~~~~~~~

At times you might want to run GIBBS in a specific mode. To
this end you should specify one or more GIBBS options, which
are defined as a string of characters (e.g., /i/s/t/c=@1/b=@1).
The options can be passed to GIBBS using (1) the Gibbs menu of
MAIN or (2) the Calculate Equilibrium block of a Control file.

Use To
--------------------------------------------------------------
Modify the output listing (*.LST files only):

/fn Forces the output of the full species names to
the screen and *.LST files.

/i Add the list of options to the output listing.

/o= Output bulk compositions in specified units
where = mol (default) | kg | g | mg |
mkg.

/t Output calculation time.

/x Exclude concentrations of aqueous species from
the listing.

Change the calculation mode:

/b=@n Specify the algorithm for reading and/or
calculation of Setchenow coefficients of
neutral aqueous species. See Appendix 3 for
details. You can change the @n value at run
time by pressing ALT+B when you define or
change temperature or pressure.

/b= Set the common Setchenow coefficient for all
the neutral species equal to . You can
change the at run time by pressing
ALT+B when you define or change temperature or
pressure.

/c=@n Set the extended parameter of the Debye-Huckel
equation equal to bg value for the specified
background electrolyte (Oelkers and Helgeson,
1990) (e.g., /c=@1 defines NaCl) and to replace
all the default ion size parameters (a) with
the ion size parameters calculated for the
given electrolyte (Shock et al., 1992). See
Appendix 3 for details.

You can change the @n value at run time by
pressing ALT+C when you define or change
temperature or pressure.

/c= Set the extended parameter of the Debye-Huckel
equation equal to . You can change the
at run time by pressing ALT+C when you
define or change temperature or pressure.

/g Use an *.STG file for free energies and/or
activity coefficients substitution. The string
"(Subst On)" is added to the system title to
indicate that the substitution mode is active.
If the *.STG file is not found in the same
directory as the corresponding *.ST file, the
/g option will be ignored without any warning
messages.

WARNING: If you substitute an energy of a
"basic species" using an *.STG file, the free
energies of the related "complexes" will still
be calculated using the default energies
provided by UNITHERM. Thus, you will need to
replace energies of the "daughter" complexes as
well.

/s Compute sequentially. When you set this option,
the program uses the equilibrium composition
obtained at the previous step as an initial
approximation for the next step. This makes
computations faster if the differences between
total system compositions are small. Without
this option all the compositions are processed
independently. Do not set this option if the
compositional differences between computation
steps are significant.

/ Re-set the internal numerical threshold for
mass-conservation equations balance (the
default value is /6).

NOTE: this is an emergency switch! You do not
need to change this value in your routine
practice. Decrease this value (e.g., set it to
/5) if you have convergence problems; increase
this value (e.g., set it to /7 or /8) if you
are "loosing" minor components from your
modelling jobs.

/w Calculate the activity of water according to
the revised HKF model (Helgeson et al., 1981).
This option does not work without the /c=@n
option (thus, you should set the combination
/c=@n /w).
--------------------------------------------------------------


REFERENCES

Employed Models and Algorithms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Borisov, M. V., and Shvarov, Yu. V., 1992, Thermodynamics
of geochemical processes: Moscow, Moscow State University
Publishing House, 254 p (in Russian).

Ding, K., and Seyfried, W. E., 1990, Activity coefficients of
H2 and H2S in NaCl solutions at 300-425ÜC, 300-500 bars with
application to ridge crest hydrothermal systems: EOS, v. 71,
43, p. 1680.

Helgeson, H. C., 1969, Thermodynamics of hydrothermal systems
at elevated temperatures and pressures: American Journal of
Science, v. 267, 7, p. 729-804.

Helgeson, H. C., Kirkham, D. H., and Flowers, G. C., 1981,
Theoretical prediction of the thermodynamic behaviour of
aqueous electrolytes at high pressures and temperatures:
Calculation of activity coefficients, osmotic coefficients,
and apparent molal and standard and relative partial molal
properties to 600ÜC and 5 kb: American Journal of Science,
v. 281, 10, p. 1249-1516.

Johnson, J. W., Oelkers, E. H., and Helgeson, H. C., 1992,
SUPCRT92: a software package for calculating the standard
molal thermodynamic properties of minerals, gases, aqueous
species, and reactions from 1 to 5000 bars and 0 to 1000ÜC:
Computers and Geosciences, v. 18, 7, p. 899-947.

Kestin, J., Sengers, J. V., Kamgar-Parsi, B., and Levelt
Sengers, J. M. H., 1984, Thermophysical properties of fluid
H2O: Journal of Physical & Chemical Reference Data, v. 13, 1,
p. 175-183.

Korzhinskii, D. S., 1965, The theory of systems with perfectly
mobile components and processes of mineral formation: American
Journal of Science, v. 263, 3, p. 193-205.

Marshall, W. L., and Franck, E. U., 1981, Ion product of water
substance, 0-1000ÜC, 1-10000 bars new international formulation
and its background: Journal of Physical & Chemical Reference
Data, v. 10, 2, p. 295-304.

Nordstrom, D. K., and Munoz, J. L., 1994, Geochemical
thermodynamics, Blackwell Scientific Publications, 493 p.

Oelkers, E. H., and Helgeson, H. C., 1990, Triple-ion anions
and polynuclear complexing in supercritical electrolyte
solutions: Geochimica et Cosmochimica Acta, v. 54, 3, p. 727-738.

Powell, R., 1977, Activity-composition relation for crystalline
solutions, in Fraser, D. G., editor, Thermodynamics in geology:
Dordrecht, D. Reidel Publishing Company, p. 57-65.

Shock, E. L., Oelkers, E. H., Johnson, J. W., Sverjensky, D. A.,
and Helgeson, H. C., 1992, Calculation of the thermodynamic
properties of aqueous species at high pressures and
temperatures: J. Chem. Soc. Faraday Trans., v. 88, 6, p. 803-826.

Shvarov, Yu. V., 1976, Calculation of equilibrium composition
in a multicomponent heterogeneous system: Transactions
(Doklady) of the U.S.S.R. Academy of Sciences: Earth Science
Sections, v. 229, 1-6, p. 223-225.

Shvarov, Yu. V., 1978, Minimization of the thermodynamic
potential of an open chemical system: Geochemistry International,
v. 15, 6, p. 200-203.

Shvarov, Yu. V., 1981, A general equilibrium criterion for an
isobaric-isothermal model of a chemical system: Geochemistry
International, v. 18, 4, p. 38-45.

Shvarov, Yu. V., 1987, Use of the electrical neutrality
equation in calculations on the equilibrium compositions of
geochemical systems: Geochemistry International, v. 24, 2,
p. 131-135.

Shvarov, Yu. V., 1989, A numerical criterion for existence of
the equilibrium state in an open chemical system: Sciences
Geologiques (Bulletin), v. 42, 4, p. 365-369.

Shvarov, Yu. V., 1999, Algorithmization of the numerical
equilibrium modelling of dynamic geochemical processes:
Geochemistry International, v. 37, p. 571-576.

Suleimenov, O. M., and Krupp, R. E., 1994, Solubility of
hydrogen sulfide in pure water and in NaCl solutions, from
20 to 320ÜC and at saturation pressures: Geochimica et
Cosmochimica Acta, v. 58, 11, p. 2433-2444.

Tanger, J. C. I., and Helgeson, H. C., 1988, Calculation of the
thermodynamic and transport properties of aqueous species at
high pressures and temperatures: Revised equations of state for
the standard partial molal properties of ions and electrolytes:
American Journal of Science, v. 288, 1, p. 19-98.


Example HCh/GIBBS Applications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A few recent references to case studies that employed the HCh
program package or the GIBBS program:

Hydrothermal Geochemistry

Pokrovskii, V. A., and Helgeson, H. C., 1991, Unified
description of incongruent reactions and mineral solubilities
as a function of bulk composition and solution pH in
hydrothermal systems: The Canadian Mineralogist, v. 29, 4,
p. 909-942.

Grichuk, D. V., 1996, Ore elements in midoceanic ridge
hydrothermal systems: Geochemistry International, v. 35, 7,
p. 586-606.

Ryzhenko, B. N., Barsukov, V. L., and Knyazeva, S. N., 1996,
Chemical characteristics (composition, pH, and Eh) of a
rock-water system: 1. The granitoids-water system: Geochemistry
International, v. 34, 5, p. 436-454.

Kolonin, G. R., Pal'yanova, G. A., Shironosova, G. P., and
Morgunov, K. G., 1997, The effect of carbon dioxide on internal
equilibria in the fluid during the formation of hydrothermal
gold deposits: Geochemistry International, v. 35, 1, p. 46-57.

Ryzhenko, B. N., Barsukov, V. L., and Knyazeva, S. N., 1997,
Chemical characteristics (composition, pH, and Eh) of the
rock-water system: II. Diorite (andesite)-water and gabbro
(basalt)-water systems: Geochemistry International, v. 35, 12,
p. 1227-1254.

Borisov, M. V., and Shvarov, Yu. V., 1998, Mobilization of ore
components during the formation of Pb-Zn hydrothermal lodes:
a thermodynamic model: Geochemistry International, v. 36, 2,
p. 134-149.


Processing of Experimental Data

Pokrovskii, V. A., and Helgeson, H. C., 1995, Thermodynamic
properties of aqueous species and the solubilities of minerals
at high pressures and temperatures: the system Al2O3-H2O-NaCl:
American Journal of Science, v. 295, 10, p. 1255-1342.

Bastrakov, E. N., Pokrovskii, V. A., and Heinrich, C. A., 1997,
Gold in hydrothermal solutions: thermodynamic properties of
Au(HS)2- and solubility of gold at high pressures and
temperatures, Seventh Annual V.M.Goldschmidt Conference, LPI
Contribution No. 921: Tucson, Arizona, Lunar and Planetary
Institute, Houston, p. 19.

Suleimenov, O. M., and Seward, T. M., 1997, A
spectrophotometric study of hydrogen sulphide ionisation in
aqueous solutions to 350ÜC: Geochimica et Cosmochimica Acta,
v. 61, 24, p. 5187-5198.



APPENDICES


Appendix 1. Brief Summary of HCh specifications


NOTE: Specifications are provided for HCh v. 3.4, July 1999

Hardware Requirements
~~~~~~~~~~~~~~~~~~~~~
IBM PC AT-compatible computers; 640Kb RAM; EGA monitor and
better; hard disk; floppy disk; keyboard. Math co-processor not
necessary but highly recommended.

HD space: 1 Mb for the initial installation.


Operating Systems
~~~~~~~~~~~~~~~~~
MS-DOS 3.3 and higher, Windows 3.x, Windows 9x/NT;
DOS-emulating packages for the Macintosh computers.


Databases
~~~~~~~~~
--------------------------------------------------------------
Number of user-defined databases: Unlimited

Database usage: One at a time
--------------------------------------------------------------


Database components and capacity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Data sources for the default database:
Miscellaneous sources; partially based on SUPCRT 92.

--------------------------------------------------------------
Stoichiometry units: Chemical elements 105 Standard
(conventional)

<=150 User-defined
--------------------------------------------------------------

--------------------------------------------------------------
Database Database Chemical Equation
components capacity compounds of state
--------------------------------------------------------------
Pure water Pure water Haar-Gallagher-Kell
model
(Kestin et al., 1984).

Basic species 1023 Simple ions, The revised Helgeson-
some polyatomic Kirkham-Flowers
ions, aqueous equations of state
complexes (MHKF) (Shock et al.,
1992; Tanger and
Helgeson, 1988).

Complexes 1023 Aqueous The modified Ryzhenko-
complexes Bryzgalin model
(Borisov and Shvarov,
1992).

Pure phases 1023 Minerals, gases, Conventional
and non-aqueous integration of
liquids heat-capacity
equations *.
Total 3069
--------------------------------------------------------------

* NOTE:
1. Cp(t) = a + b*T + c*T^-2 + d*T^-0.5 + e*T^2 + f*T^3 +
+ g*T^4 + h*T^-3 + i*T^0.5 + j*T^-1.
2. Allowed number of phase transitions in minerals: 4;
the maximum number of the Cp(t) equations: 5.
3. No provisions for calculation of mineral compressibilities.


Allowed Model Phases and Solution Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------------
Phases Maximum Solution model Maximum number
number of and calculation of components
phases of activities in the solution
phase
--------------------------------------------------------------
Pure solids 255
(minerals),
liquids and gases

An aqueous 1 Water: gamma=1 or according to 255
solution the HKF model (Helgeson et. al.,
(including the 1981)
supercritical Charged species: extended
aqueous phase) versions of the Debye-Huckel
equation (Helgeson,1969;
Helgeson et al.,1981; Oelkers
and Helgeson, 1990).

Neutral species: Setchenow equation
(e.g., Oelkers and Helgeson, 1990).

A gaseous mixture 1 Ideal 255

Liquid non- * 1. Ideal 255
-aqueous 2. Non-random two-liquid (NRTL) 6
solutions (NRTL)

Solid solutions * Ideal:
(ideal multisite 1. Molecular 255
mixing) 2. Mixing-on-sites (MOS, 4 sites 20
allowed)
3. Local charge balance (LCB) 20
---------------------------------------------------------------

* NOTE: The maximum total number of phases and components in a
system is restricted by the available conventional memory
(DOS), and will vary depending on a particular problem and
computer configuration.


Special Notes
~~~~~~~~~~~~~
--------------------------------------------------------------
Recommended T-P range for 0 - 1000ÜC, 1 - 5000 bar at water
systems containing aqueous densities exceeding 0.35 g/cm3
solution: (according to the MHKF model; see
above)

Allowed salinity range for Limited by the applicability of
systems containing aqueous the extended versions of the
solution: Debye-Huckel equation (see above).
--------------------------------------------------------------

Limitations of Chemical models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The maximum number of chemical elements allowed in models: 30


Limitations of Equilibrium-Dynamic Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------------
The number of calculation Unrestricted; the convenient range
steps in model definition is 1..73.
loops:

The number of waves Limited by the size of the output
(loops): file accessible for processing by
the package.

The theoretical maximum is
constrained by 32,000 calculation
points, but in practice might be
less. The exact number will vary
depending on a particular computer
configuration. This limitation is
not critical due to the MAIN CutOff
command.
--------------------------------------------------------------


Appendix 2. Definition of Solid Solution Models


Currently you can specify in the HCh package ideal
mixing-on-sites (MOS) models for solid solutions. The maximum
number of mixing sites allowed in the program is 4.

To specify an ideal mixing-on-site model for a given solid
solution, fill in the table which is displayed when you create
a new System (*.ST) file. The columns numbers (1..4) correspond
to different mixing sites. Coefficients in the upper column
cells represent the stoichiometric coefficients for the sites.
Other cells are allocated for chemical elements (ions) mixing
on the specified sites.

For example, consider garnets of the generalised formula
X3Y2(SiO4)3 in which mixing can occur independently on the
eightfold X sites and the sixfold Y sites (Nordstrom and Munoz,
1994). The mixing is restricted to Al+++ and Fe+++ in the
octahedral site and Mg++, Fe++, and Ca++ in the cubic site. The
end-member components and their compositions are andradite
(Ca3Fe2(SiO4)3), grossular (Ca3Al2(SiO4)3), pyrope
(Mg3Al2(SiO4)3) and almandine (Fe3Al2(SiO4)3). To specify the
ideal MOS model in HCh you need to fill in the solid-solution
table as follows:

Solid solution: Garnet (ideal)
1 2 3 4
Coefficient 3 2
1. Andradite Ca Fe
2. Grossular Ca Al
3. Pyrope Mg Al
4. Almandine Fe Al

As mixing occurs only on two sites, the columns 3-4 are left
blank.

NOTE: If you ignore this table (just by pressing ESC), the
end-members of the solid solution will be treated as
"molecular" species.

When the mixing ions have different charges, it is also
possible to specify a local charge balance (LCB) model. In this
case, because of the charge balance, a group of atoms exchanges
as a whole, e.g., CaAl - NaSi, and should be formally
considered as mixing on one site. Thus you can ascribe to these
complexes separate single ions (e.g. Al for CaAl, and Si for
NaSi), and use them in the solution definition table. Note that
the specified ions will not have any physical meaning, but will
be used by the program only to determine whether pairs of
exchanged ions are different or not.

For example, to specify an LCB model for the albite-anorthite
solid solution (NaAlSi3O8-CaAl2Si2O8) you need to fill in the
solid-solution table as follows:

Solid solution: Plagioclase (ideal)
1 2 3 4
Coefficient 1
1. Albite Si
2. Anorthite Al

The activities of the end-member components are calculated by
GIBBS according to the expression:

a = gamma*X',

where X' is an appropriate function of the concentration of the
end-member component in the solution ("thermodynamic" mole
fraction of (Powell, 1977), and gamma is the corresponding
activity coefficient. For ideal solid solutions gamma = 1 and
a(ideal) = X'. The thermodynamic mole fraction for the ideal
multi-site mixing is calculated as the product of mole
fractions of the site components (elements) raised to the power
of the site stoichiometric coefficients:

X' = product(X[i]^n[i]').

NOTE: The composition of a given solid solution in the GIBBS
output listing is expressed in terms of the chosen end-member
minerals on the conventional mole fraction basis. The activity
coefficients of the end-member minerals are always set to 1
according to the provided definition of the ideal solid
solution.

NOTE: You may assign any activity coefficient (gamma) for an
end-member component by using the /g option of GIBBS (see
"Exporting *.ST files to ASCII files" on page 24 and "GIBBS
Options" on page 44). In this case the activity of the
component will be calculated as the product of the ideal
activity and the specified activity coefficient:

a = gamma*a(ideal)=gamma*product(X[i]^n[i]').



Appendix 3. Calculation of Activity Coefficients of Aqueous
Species


Activity coefficients of all aqueous species are calculated for
the molality scale of concentration.


Charged Aqueous Species
~~~~~~~~~~~~~~~~~~~~~~~

Activity coefficients of charged aqueous species are calculated
by GIBBS according to the extended Debye-Huckel equation. The
necessary parameters for their calculation are provided by the
UT_SIZES.REF and UT_ELECT.REF database files.

By default activity coefficients of charged aqueous species are
calculated according to Helgeson (1969):

log(gamma) =
= -(A*z^2*sqr(I))/(1 + B*a*sqr(I)) + GAMMA + b-dot*I.

where GAMMA designates the mole fraction to molality conversion
factor given by GAMMA = -log(1 + 0.0180153*m'), and m'
symbolises the sum of the molalities of all solute species in
solution. This expression is equivalent to GAMMA = log(Xw),
where Xw represents the mole fraction of water in solution.

Ion size parameters (a) for particular ions are considered to
be temperature-independent and are kept in the UT_SIZES.REF
file (UT_RADII.REF in earlier HCh versions). If there is no
specified individual value for a particular ion, the ion size
parameter is set to the default value of 4.5 A.

Using a special GIBBS option (/c=) you can also set
the extended parameter of the Debye-Huckel equation to a common
arbitrary value (e.g., /c=-0.2).

Using a special GIBBS option (/c=@n) you can choose the
calculation of activity coefficients of charged aqueous species
according to Oelkers and Helgeson (1990) for a specified
background electrolyte MX:

log(gamma) =
= -(A*z^2*sqr(I))/(1 + B*a*sqr(I)) + GAMMA + b-gamma*I.

In this case the ion size parameters for all the ions are
calculated by GIBBS according to Shock et al. (1992):

a = re(m+) + re(x-),

where re is an effective electrostatic radius of an ion
depending on temperature and pressure.

To specify electrolytes from the default UT_ELECT.REF database
file

Set For Set For
---------------------------------------------------
/c=@1 NaCl-dominated /c=@3 KOH-dominated
solutions. solutions.

/c=@2 NaOH-dominated /c=@4 KCl-dominated
solutions. solutions.
---------------------------------------------------

NOTE: All these options can be changed at GIBBS run-time by
pressing ALT+C when you define or change temperature or
pressure (just omit the slash from the option definition). You
can also remove them by specifying the "c=" option.

For information about setting GIBBS options, see Chapter 2,
"Gibbs Options".


Neutral Aqueous Species
~~~~~~~~~~~~~~~~~~~~~~~
Activity coefficients of neutral aqueous species are calculated
by GIBBS according to the Setchenow equation (e.g., Oelkers and
Helgeson, 1990):

log(gamma) = GAMMA + b-setch*I.

where b-setch is the Setchenow coefficient. By default,
b-setch = 0, and

log(gamma) = GAMMA.

NOTE: By default, activity coefficients of neutral aqueous
species in HCh versions prior to 3.3 were calculated according
to the degenerative version of the extended Debye-Huckel
equation:

log(gamma) = GAMMA + b-dot*I, or

log(gamma) = GAMMA + b-gamma*I.

You can still use this algorithm by specifying the GIBBS
command-line option /b=@0 (see below).

NOTE: The old /0 option for calculation of activity
coefficients of neutral species is now disabled.

Using the GIBBS command-line options /b=@n and /b= you
can specify direct reading or calculation of Setchenow
coefficients by GIBBS in a number of possible ways.

Option Algorithm
--------------------------------------------------------------
/b=@0 The common "Setchenow" coefficient for all the
neutral species is equal either to b-dot or b-gamma
values of the extended Debye-Huckel equation (the
old default option).

/b=@1 The individual Setchenow coefficients are read from
the ion "size" fields of the neutral species in a
relevant System (*.ST) file.

/b=@2 The common Setchenow coefficient for all the
neutral species is calculated as a function of
temperature (0 and Krupp, 1994) approximation for H2S (aq). Any
values entered in the "size" fields of the neutral
species in your *.ST file will be ignored.

/b=@3 The common Setchenow coefficient for most of the
neutral species is calculated as a function of
temperature and pressure according to an empirical
fit for H2S (aq) based on Ding and Seyfried (1990)
and Suleimenov and Krupp (1994) (Bastrakov and
Pokrovskii, personal communication). Any non-zero
values entered in the "size" fields of the neutral
species will be used as "scaling" factors to
calculate individual Setchenow coefficients
relative to the Setchenow coefficients of H2S:
b-setch = a*b-setch(H2S). For further clarification
see examples provided below.

/b= The Setchenow coefficients for all the neutral
species are set to a common arbitrary value (e.g.,
/b=0.46). Any Setchenow values entered in the
"size" fields of the neutral species in your *.ST
file will be ignored, and any other built-in
algorithms suppressed.
--------------------------------------------------------------

NOTE: All these options can be changed at GIBBS run-time by
pressing ALT+B when you define or change temperature or
pressure (just omit the slash from the option definition). You
can also remove them by specifying the "b=" option.

For information about setting GIBBS options, see Chapter 2,
"Gibbs Options".


Examples of *.ST file modification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To specify direct reading or calculation of Setchenow
coefficients by GIBBS, you might need to modify your System
file in one of the following ways:

/b=@0:
Not applicable. Any individual values entered in the "size"
fields of your *.ST file will be ignored.

/b=@1:

H O Cl S Na z a
* * * Aqueous solution * * *
0. 2 1 0 0 0 0 0.00 H2O
1. 1 0 0 0 0 1 9.00 H+
2. 1 1 0 0 0 -1 3.50 OH-
3. 0 2 0 0 0 0 0.46 O2 # Individual value
4. 2 0 0 0 0 0 0.60 H2 # Individual value
5. 2 0 0 1 0 0 0.46 H2S # Individual value
6. 1 0 0 1 0 -1 3.50 HS-
7. 0 0 0 2 0 -2 4.50 S2--
8. 0 3 0 2 0 -2 4.50 S2O3--
9. 0 2 0 1 0 0 0.46 SO2 # Individual value

/b=@2:
Not applicable. Any individual values entered in the "size"
fields of your *.ST file will be ignored.

/b=@3:

H O Cl S Na z a
* * * Aqueous solution * * *
0. 2 1 0 0 0 0 0.00 H2O
1. 1 0 0 0 0 1 9.00 H+
2. 1 1 0 0 0 -1 3.50 OH-
3. 0 2 0 0 0 0 1.00 O2 # Scaling factor re H2S
4. 2 0 0 0 0 0 1.30 H2 # Scaling factor
5. 2 0 0 1 0 0 1.00 H2S # Scaling factor
6. 1 0 0 1 0 -1 3.50 HS-
7. 0 0 0 2 0 -2 4.50 S2--
8. 0 3 0 2 0 -2 4.50 S2O3--
9. 0 2 0 1 0 0 0.00 SO2 # Scaling factor; note
# that 0.00 = 1.00 (!)

/b=:
Not applicable. Any individual values entered in the "size"
fields of your *.ST file will be ignored, and any other
built-in algorithms for calculation of Setchenow coefficients
suppressed.



Appendix 4. Examples of Control Files Usage


See "Control File Conventions" for the list of the variables
permissible for model definitions. The example files provided
below are commented by the hash sign (#).

EXAMPLE 1 Calculation of diagrams, titration and mixing
calculations.
EXAMPLE 2 Modelling of dynamic processes at steady-state
conditions.
EXAMPLE 3 Modelling of progressive fluid-rock interaction by
the "flow-through" reactor technique, e.g.
metasomatic zoning.


EXAMPLE 1: Titration and Mixing Calculations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Geological model

Rock of a given composition is equilibrated with an aqueous
solution at constant temperature and pressure. The object of
the modelling is to define the equilibrium alteration
assemblages and aqueous solution compositions at increasing
rock-to-water ratios, R/W (e.g., from 10^-5 to 10^5) with a
step of 1 log units.

Preparation steps

After the routine preparation of the files defining a chemical
system of interest (*.ST and *.BL) you should create an Input
file (*.IN) with two separate bulk compositions for the aqueous
solution [1] and the rock [2] (e.g., 1 kg of each).

Numerical model

The numerical model of the titration can be represented by a
number of reactors of variable bulk composition defined as a
function of the titration step (i) in terms of the initial rock
and solution:

[*] = [1]+[2]*10^(i-6),

where [*] is the bulk chemical composition of the reactor at
the i-th step. To characterise the rock-to-water ratios as
within the specified limits (from 10^-5 to 10^5) you should
define the power of the multiplier of the rock amount as (i-6).

Now you can prepare your Control file. Note that for this
particular problem you do not need to use the block of the loop
initialisation ("Set Initial Composition (i=0)").

Input file: Filename
Wave model: Titration
GIBBS options: /S
* * * Primary wave * * *
Initial step... # Not required for this
problem
General step... # Model definition
Temperature,C T = 300 # Titration at constant
temperature
Pressure,bar P = 500 # Titration at constant
pressure
Composition [*] = [1]+[2]*10^(i-6) # Calculation of
increasing R/W
Stop when: i=11 # Loop until i=11
(R/W=1E+05)
* * * End of file * * *

Now you are ready to run GIBBS.

File of results

The modelling results can be optionally written either into an
ASCII (*.LST) or binary (*.RE) output file. On the basis of
your Control file instructions GIBBS will output the sequence
of 11 equilibrium compositions defining the overall direction
of the particular water-rock interaction.


EXAMPLE 2: Modelling of Processes at Steady-State Conditions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Geological model

An aqueous solution is equilibrated with a rock of a given
composition at some temperature and pressure at rock-buffered
conditions (R/W >> 1). The resulting solution saturated with
all the rock components is ascending along a fault zone towards
the Earth's surface. The object of the modelling is to define
the mineral composition of the resulting vein material.

Preparation steps

After the routine preparation of the files defining a chemical
system of interest (*.ST and *.BL) you should create an Input
file (*.IN) with two separate bulk compositions for the initial
aqueous solution [1] and the rock [2] (e.g., 1 kg of each).

Numerical model

The bulk chemical composition of the reactor ([*]) at a general
computation step can be defined in terms of the aqueous
solution isolated from the equilibrium rock at the preceding
step:

[*] = [A]

Thus the outlined algorithms requires sequential computation of
the reactor composition.

NOTE: To define the bulk chemical composition of an equilibrium
reactor using sequential computation you must specify the
initial step in your wave model. In the general case the
initial step is not mandatory.

Now you can prepare your Control file:

Input file: Filename
Wave model: Modelling of the vein mineral composition
GIBBS options: /S
* * * Primary wave * * *
Initial step... # Modelling of the initial
equilibration:
Temperature,C T = 300 # Temperature at the initial
depth
Pressure,bar P = 0 # Pressure = PSAT for a given
temperature
Composition [*] = [1]+[2]*100 # Initial rock-to-water ratio
is set to 100
General step... # Modelling of precipitating
minerals:
Temperature,C T = T-2 # Step of the temperature
change (-2ÜC)
Pressure,bar P = 0 # PSAT for the new temperature
Composition [*] = [A] # Only the solution is
ascending
Do while: T>0 # Loop until the complete
cooling
* * * End of file * * *

Now you are ready to run GIBBS.

File of results

The modelling results can be optionally written either into an
ASCII (*.LST) or binary (*.RE) output file. On the basis of
your Control file instructions GIBBS will output the sequence
of 150 equilibrium compositions defining the mineral zoning of
the model vein.


EXAMPLE 3: Modelling of Progressive Fluid-Rock Interaction by
the "Flow-Through" Reactor Technique
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Geological model

Progressive fluid-rock interaction in an open geochemical
system at near-surface conditions (e.g., the formation of
roll-front U deposits by U leaching and re-deposition). An
initially "fresh" aqueous solution percolates through a rock at
constant temperature and pressure. The object of the modelling
is to define the spatial and temporal evolution of the rock and
solution compositions.

Preparation steps

After the routine preparation of the files defining a chemical
system of interest (*.ST and *.BL) you should write into the
input file (*.IN) two bulk compositions characterising the
initial aqueous solution [1] and the unaltered rock [2].

Numerical model

The numerical model of the progressive fluid-rock interaction
can be defined as number of reactors of variable bulk
composition defined in terms of specified amounts of
pre-reacted rock and solution:

[*]= [A]+[2] (interaction of the solution with unaltered rock),
and
[*]= [A]+{S} (interaction of the solution with rock pre-altered
in the previous wave).

Now you can prepare your control file:

Input file: Filename
Wave model: Flow-through reactor technique
GIBBS options: /S
* * * Primary wave * * *
Initial step...
Temperature,C T = 25 # Earth surface conditions
Pressure,bar P = 1 # Earth surface conditions
Composition [*] = [1] # Initial solution
General step...
Temperature,C T = T # isothermic system
Pressure,bar P = P # isobaric system
Composition [*] = [A]+[2] # solution interaction with fresh
rock
Do while: i<50 # 50 reactors are sufficient
* * * Secondary wave * * *
Initial step...
Temperature,C T = 25 # initial conditions are the same
Pressure,bar P = 1 # initial conditions are the same
Composition [*] = [1] # the leaching solution is the
same
General step...
Temperature,C T = T # isothermic system
Pressure,bar P = P # isobaric system
Composition [*] = [A]+{S} # solution interaction with
altered rock
Do while: I<50 # the same length of the wave
* * * Completion condition * * *
Do while: N<50 # 50 waves are sufficient
* * * End of file * * *

Now you are ready to run GIBBS.

File of results

The modelling results will be written into a binary (*.RE)
output file. On the basis of your Control file instructions
GIBBS will output the sequence of more than 2500 calculated
compositions of the system. They will describe the results of
water-rock interaction along the filtration path (parameter i)
at different stages of interaction (parameter N). The
calculation results can be browsed using the Binary File
command of the Result menu of MAIN. All the computed points
will be graphically represented by MAIN as a 51 by 51 table
where rows will correspond to waves, and columns will
correspond to steps. You can examine your equilibrium
compositions point by point (Single Points mode) or series by
series (Cross Sections mode). To see the evolution of the fluid
composition within the j-th wave choose the j-th horizontal
cross-section; to see the evolution of rock composition in the
i-th reactor, choose the i-th vertical cross-section; to see
the state of your system at a particular moment choose a
diagonal (/) cross-section. See "Result menu" for details.

Special syntax of vector variables

A special syntax for the {} vector variables
{*|G|A|L|S(expression)} allows reference to any step of the
preceding wave. The value of the expression defines the step
number. For example, {A(i-1)} means "the bulk composition of
the aqueous phase from the preceding step of the preceding
wave". This syntax allows the definition of a flow-through
reactor model as follows:

Input file: Filename
Wave model: Special syntax
GIBBS options: /S
* * * Primary wave * * *
Initial step...
Temperature,C T = 25
Pressure,bar P = 1
Composition [*] = [1]+[2] # [1] is fluid, [2] is rock
General step...
Temperature,C T = T
Pressure,bar P = P
Composition [*] = [2] # the other blocks are
initially dry
Do while: i<50
* * * Secondary wave * * *
Initial step...
Temperature,C T = 25
Pressure,bar P = 1
Composition [*] = [1]+{S} # new fluid batch
General step...
Temperature,C T = T
Pressure,bar P = P # below the example of the
special sintax:
Composition [*] = {A(i-1)}+{S} # solution interaction with
altered rock
Do while: i<50
* * * Completion condition * * *
Do while: N<1000 # 1000 waves are sufficient
* * * End of file * * *

In such a model a "system shot" (the state of the system at the
particular time) will be represented by the corresponding
horizontal cross-section. Vertical cross-sections will
represent evolution of the static part of the system (rock).
The evolution of the fluid during the filtration will be
represented by diagonal (\) cross-sections that cannot be shown
by the program.



Appendix 5. Supplementary Utilities


Two additional utilities (the program LST2TAB and the
spreadsheet REX.XLS) are provided to assist in processing of
the modelling results and the relevant data analysis.

Utility Functions
--------------------------------------------------------------
LST2TAB Simplifies the import of *.LST files into Microsoft
Excel by converting them into ASCII files in a "Tab
Delimited" format: *.LST file -> *.TAB file.

REX.XLS Simplifies the import of *.REX files into Microsoft
Excel (version 5.0 and higher): *.REX file -> *.XLS
file.
--------------------------------------------------------------

LST2TAB: Conversion of *.LST Files for Export to Microsoft Excel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To take the full advantage of this utility we recommend using
it under the MS-DOS prompt or a DOS shell (e.g., Norton
Commander). Copy the program to a directory mentioned in the
PATH command of your AUTOEXEC.BAT file (DOS, Windows 3.x/9x),
or Environment System Variables (Windows NT), or create an
appropriate batch file. You will be able to call the program
from any of your working directories.

1. Run the program in the command-line mode from your current
working directory. Type the program name followed either by
the name of your input *.LST file or the asterisk (*). You
do not need to type the file extension.
2. Press ENTER. When the job has been completed, you will
receive a confirmation message. The output file(s) will have
the same name(s) as the source file(s) followed by the
extension *.TAB.

Type To
--------------------------------------------------------------
lst2tab [filename] Process a single required file.

lst2tab * Process all *.LST files located in the
current directory.

lst2tab /h Display a brief help information.
(or /? or ?)
--------------------------------------------------------------

You can also run the program in a dialog mode:

1. Type the program name, and press ENTER.
2. Enter the name of the input file in the provided edit box.
Press ENTER.
3. Repeat step 2 if necessary.
4. Press ESC to finish.

You can run LST2TAB in the batch command-line (lst2tab *) or
dialog modes in a normal Windows session (just double-click the
program icon). Edit the program properties in a conventional
way to customise your working directory and program mode (see
your Windows manual or Help file).

NOTE: The program is sensitive to the exact format of the input
data. The *.LST file is processed line by line. If the program
encounters a line that cannot be recognised, it will print an
error message (***Error***) in the relevant line of the output
file. The subsequent lines will be copied without conversion
until the next page separator symbol delimiting calculation
steps. After this the program will resume the conversion for a
new series of calculations as usual.

To import data into Microsoft Excel:

1. Using the Excel Open File Wizard choose the required *.TAB
file.
2. Choose the "Delimited" file type. Set the delimiter as
"Tab".
3. Click the FINISH button.


REX.XLS: Importing Results into Microsoft Excel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The *.REX files produced with the Binary File command of the
Result menu of MAIN can be directly loaded into Microsoft
Excel. To complete this task:

1. Start Microsoft Excel. Open the REX.XLS file.
2. Press the import button. Choose a *.REX file for import.
3. When the *.REX file is loaded, you will be prompted to save
it in the Microsoft Excel format. Click SAVE to proceed.

NOTE: If you cancel this step and try to save this file later,
the file format offered by Excel will be the "Tab Delimited"
text.

The data are ready for processing and analysis.

NOTE: To take the full advantage of this utility we recommend
copying it in your Microsoft Excel Startup directory.