Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.geol.msu.ru/deps/geochems/soft/en/H2O-H2S-NaCl.doc
Дата изменения: Mon Mar 21 19:09:05 2016
Дата индексирования: Sun Apr 10 01:39:30 2016
Кодировка:

Program H2O-H2S-NaCl





User manual



About the software 1
Program installation 1
Files and folders 1
Creating data files 2
User interface of the H2O-H2S-NaCl program 2
Initial data 2
Computation results 3
Working with H2O-H2S-NaCl program 3
Additional Comments 4
References 4
Appendix. Error messages 5
Errors that appear while the program is running 5
Errors detected in the worksheet 5



About the software

The code "H2O-H2S-NaCl" computes thermodynamic properties of components
of the ternary H2O-H2S-NaCl system on the base of the model given in [1].
Thermodynamic properties of the end members of the system as well as
aqueous solution properties (up to saturation) are computed for a wide
range of temperatures (up to 325 C) and pressures (up to 100 MPa).
Thermodynamic properties of pure H2O and H2S components are computed after
[2] and [3], respectively, while thermodynamic properties of the binary H2O-
NaCl subsystem are computed after [4].
The code operates under OS Windows (version 98 and higher) and requires
the Microsoft Excel (version 8.0 and higher) to be installed.

Program installation

Two files - the executable file H2O-H2S-NaCl.exe and the template H2O-
H2S-NaCl.xls (the latter will be used for creating data files) - are
required. To install the program copy them into any ("home") hard disk
folder.
Create a label of the executable H2O-H2S-NaCl.exe and put it on the
desktop or into any other convenient place. From now on, this label can be
used to run the code in the usual way.

Files and folders

The program H2O-H2S-NaCl uses an Excel workbook as a source file and
writes computation results into the same file. For an initial creation of
the source file start the H2O-H2S-NaCl.exe, push the button "Create new
data file" in the open window, and then fill all the fields as required in
the template provided. To save the file with both the initial data and the
computation results use the Excel interface (menu File, command Save
as...). Do not save data files in the home folder of the H2O-H2S-NaCl
program, use any other work folder.

Creating data files

To create a data file use the template as described above. The template
is an Excel two-sheet workbook (H2O-H2S-NaCl.xls) that is kept in the home
folder of the program and contains all the keywords and layouts required
for the H2O-H2S-NaCl.exe. Keywords are the words that describe the data and
should not be changed (if any of these words is changed, the program will
not work with such data file). Every cell of the template containing a
keyword is supplied with a corresponding comment. The template has the
"read only" attribute, and after filling all the needed fields and/or after
the computation, the file should be saved in a work folder (under any name
but with the .xls extension).

User interface of the H2O-H2S-NaCl program

At launch the program H2O-H2S-NaCl checks if the MS Excel is already
running, and if the Excel is not running, the program H2O-H2S-NaCl will
launch Excel without loading any workbook. If Excel is already running, no
new copy of Excel is created. If the MS Excel is not installed or its
version is too old, the H2O-H2S-NaCl.exe does not start. If all conditions
are satisfied, a reduced window of the program pops up. This window
contains only two command buttons for opening a required file or creating a
new one.
"Create new data file" option allows writing the source data into the
program template. This option is active only if the H2O-H2S-NaCl.xls file
is present in the home folder of the program (see section Program
installation above). The template is loaded by pressing "Create new data
file" into Excel, and then the file is ready for input. To save the data
file use the Excel interface (menu File, command Save as...).
"Open existing data file" function opens an existing Excel workbook
containing initial data for the task. This function is always active, and
launches a dialog for opening an .xls file. When the selected workbook is
opened, H2O-H2S-NaCl program starts to read information from the current
worksheet. During this process the program tests whether the data entered
contains an unacceptable value. If such an error is identified, a
corresponding message (indicating row and column of the error cell) appears
and the reading procedure terminates. In this case the user must correct
the error and re-launch. If no errors are identified, H2O-H2S-NaCl program
reports the total number of points in the spreadsheet and then opens its
window in a full view mode (as opposed to a reduced view).
If the working file is open and error-free, the title of the H2O-H2S-
NaCl window is the same as the name of the just opened Excel worksheet, and
in this window appears the command button "Calculate values", allowing
proceeding with the desired computation.

Initial data

Data required by the H2O-H2S-NaCl program for computation is located in
two worksheets (spreadsheets) of a single Excel workbook. The first sheet
(Components) is set to compute properties of the pure components (H2O, H2S,
NaCl) and binary aqueous solutions. The second sheet (Ternary system) is
set to predict thermodynamic properties of the ternary. These two
spreadsheets are organized in a similar way: the first line maintains the
name of the system, second and third lines are the headings of the initial
data and the results of the computation; these lines should not be changed
in any way. All data is presented in a table: the initial data specified by
the user is located on the left of the table, while data generated by the
program is located on the right of the table. The total number of lines in
the table is not restricted and depends on the initial parameters specified
by the user.
First sheet (Components). The input parameters are temperature (column
A) and pressure (column B). Temperature should be specified in Celsius,
pressure - in MPa. If any of the input parameters is beyond limits set in
the model, the program flags up an error message with the number of the
cell where the error is located. In this case, the user must correct the
error, return back to the main window of the H2O-H2S-NaCl program, and re-
calculate.
Second sheet (Ternary system). Besides temperature and pressure values
that are specified by the user, molalities of the two components (H2S and
NaCl) of the system may also be specified (it is assumed that water is
always present in the system). Note that empty cells are nullified.
When specifying pressure it is possible to substitute a number with an
abbreviation "sat". This means that pressure corresponds to the water
saturation pressure at a given temperature. Value "0" in this column
corresponds to the water saturation pressure at T > 100 њC, and P = 0.1 MPa
at T < 100 њC.

Computation results

To start computation press "Calculate values". The results of the
computation are deposited into the table of the current spreadsheet on the
right hand side. This process is repeated for each sheet independently.
The second sheet (Ternary system) has a special feature, which allows
specifying the concentrations of the components arbitrarily (within
reason). It could be that specified H2S and/or NaCl concentrations are
higher than their equilibrium (saturated) values at the given temperature
and pressure. However, H2O-H2S-NaCl program is designed to compute the
system properties anyway. To indicate that the solution is oversaturated
(if so), the program displays the results in color. In this case, the
normal values are displayed in black, H2S oversaturation is indicated in
blue, and NaCl oversaturation is indicated in red. These colors may
overlap: in cases when both components are oversaturated, the value number
is in magenta.

Working with H2O-H2S-NaCl program

Program's interface implies switching between the program window with
its control items and the Excel workbook with the initial data and the
computation results. Note that after a change in a current worksheet it is
necessary to complete the change by pressing "Enter" or moving to another
cell of the worksheet (e.g., pressing "Tab", mouse click, etc.). If the
modification of the contents of the cell has not been saved then it is not
possible to switch to the H2O-H2S-NaCl program window - this is the
property of Windows OS. For switching to the H2O-H2S-NaCl program window it
is recommended to click its header, not a command button. After activation,
the H2O-H2S-NaCl program always checks the information in the current
spreadsheet for possible errors, and if needed can return informational or
diagnostic message.
There are two types of the H2O-H2S-NaCl program messages that can occur
after control is received:
. "Row = ., Col = .: ". Message indicates an error in the spreadsheet
of the current workbook. Numbers Row and Col point to the error's
position in the "number of the row" - "number of the column" coordinates.
The text of the message specifies the error (see Appendix). Before
correcting the error, click OK in the message window to close it. Note
that when the error is found, the operating window of the H2O-H2S-NaCl
program is reduced, and the button "Calculate values" becomes
inaccessible.
. "Number of points: .". This message is generated when number of the
computation points has changed after the last activation of the H2O-H2S-
NaCl program. This message is merely informational and does not demand
any action besides closing this window (by clicking OK or Close). This
message confirms that the current spreadsheet is error-free. Note that in
this case H2O-H2S-NaCl program window will be fully opened and the
calculation function will be enabled.
If after a spreadsheet modification the number of computation points
did not change, and the program did not detect any errors, the activated
H2O-H2S-NaCl program does not generate any messages, its window opens in a
full view mode with all the command buttons visible.
To terminate the work of the H2O-H2S-NaCl program it is sufficient to
close the program by clicking the Close button. Then, the current
spreadsheet remains on the screen, and the Excel remains running regardless
of its state at the launch of the H2O-H2S-NaCl program. Such set-up allows
continuing working with the results of the calculation. It is not
recommended to close Excel while H2O-H2S-NaCl program is running; this will
cause the immediate termination of the H2O-H2S-NaCl program.

Additional Comments

1. The range of the tolerable state parameters allowed in the H2O-H2S-NaCl
program are close to that recommended by the authors of the model [1] but
are a little wider. However, these restrictions might be ignored by
starting the program with an option /ie ("ignore errors"). Note that the
validity of the results of the computation under such conditions remains
the user's responsibility.
2. The program H2O-H2S-NaCl takes into account the properties of liquid
water computed according to [2]. This means that not all of T-P
parameters' combinations are allowable. The program keeps checking the
specified state parameters and prohibits computations in the water
gaseous state. However, even if the pressure specified by the user is
lower than the water saturation pressure at a given temperature, the
program will attempt to compute using a metastable state of liquid water.
And only if this attempt fails, a message noting that the pressure is too
low will be generated.







References

1. N. N. Akinfiev, V. Majer, Yu. V. Shvarov (2016). Thermodynamic
description of H2S-H2O-NaCl solutions in a range of temperatures to 573 K
and at pressures to 40 MPa. // Chemical Geology, 424, 1-11.
2. Revised Release on the IAPWS Formulation 1995 for the Thermodynamic
Properties of Ordinary Water Substance for General and Scientific Use //
The International Association for the Properties of Water and Steam.
Doorwerth, The Netherlands. September 2009.
3. E. W. Lemmon, R. Span (2006). Short fundamental equations of state for
20 industrial fluids. // J. Chem. Eng. Data, 51, 785-850.
4. D. G. Archer (1992). Thermodynamic Properties of the NaCl + H2O System.
II. Thermodynamic Properties of NaCl(aq), NaCl?2H2O(cr), and Phase
Equilibria. // J. Phys. Chem. Ref. Data, 21, 793-829.


Appendix. Error messages

|Error message |Comment |
|Errors that appear while the program is running |
|Could not run Excel |The MS Excel is not installed or its version is |
| |older than Office 97. Please install up-to-date |
| |Excel |
|Could not open the file|File opening error. Please ensure the file is not|
| |used by another program |
|Do not work in the home|You are trying to save the file in your home |
|folder! |directory (this is prohibited). Please save the |
| |file in a working folder |
|H2O-H2S-NaCl closed: |Program H2O-H2S-NaCl after activation did not |
|could not find an open |find any opened Excel workbook. For normal |
|worksheet |termination please shut down the H2O-H2S-NaCl |
| |firstly, and only then the Excel program |
|Errors detected in the worksheet |
|Unrecognized worksheet |Name of the current spreadsheet differs from |
| |"Components" or "Ternary system". Please check |
| |the xls data file |
|Format error or |Program discovered that the cell specified |
|incorrect keyword |contains unallowable value. Please correct |
|T/P/D value(s) out of |Temperature, pressure or water density is out of |
|range |the valid range. Please correct the parameters or|
| |start the program with the /ie option (at your |
| |own risk) |
|Saturation vapor |Saturation vapor pressure does not exist at a |
|pressure does not exist|given temperature. Please correct temperature or |
| |pressure |
|Illegal value of m(H2S)|H2S molality is negative. Please correct |
|Illegal value of |NaCl molality is negative. Please correct |
|m(NaCl) | |