Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.geol.msu.ru/deps/geochems/soft/en/ZnS_FeS.doc
Дата изменения: Tue Feb 11 19:24:56 2014
Дата индексирования: Thu Feb 27 23:35:37 2014
Кодировка:


The use of the external module ZnS_FeS.dll


ZnS_FeS.dll file is an external module for the Gibbs program, and is
designed to calculate the activity coefficients of the components of iron-
bearing sphalerite (Zn,Fe)S. Using this module in the calculation of
equilibria via HCh package programs provides better, more realistic results
than when running the programs without it.
A non-ideal model of sphalerite, proposed in literature [1], is used in
this module. The authors of the cited paper state that the model is valid
at temperature range of 300-850 њC and under pressures up to 10 kbar, and
assume the possibility of extrapolation of this model to lower
temperatures.


Installation


In order to make the module available for the HCh package, it is enough
to place it in the home directory of the package (normally, this is
C:\HCh_Win\Main).


Preparation of the System file


To be able to use the module ZnS_FeS.dll, you need to include a binary
solid solution of troilite FeS and sphalerite ZnS into the System file, as
you create it. These minerals are included into the default database
Unitherm, a part of the HCh package; it is also possible to use tailored
descriptions of these end members. If you use a tailored description, you
need to name these components in such a way, which will allow the module to
recognize them. Note that the module recognizes end members of the solution
by name, or rather by the first three letters of the name: the name of the
troilite component should start with the letters "tro", the name of pure
sphalerite - with "sph" (both case insensitive). You need to use the same
approach when renaming the standard database components. After creating a
solid solution as described above, you can assign any name to it (for
example, "Sphalerite (SS)"); the only important thing is to make sure that
the name is unique within the System file.
It is important to note that, according to the model used in ZnS_FeS
module, the standard state of the FeS component in sphalerite is different
from that of pure troilite. The corresponding correction to the standard
free energy of this component is performed automatically, you do not need
to do anything. The second important point that should be mentioned here:
the sphalerite model, implemented in the ZnS-FeS module, is consistent with
the thermodynamic model of pyrrhotite, proposed in literature [2].
Therefore, to obtain realistic modeling results, you need also to provide
in your System file the possibility of pyrrhotite formation and set an
adequate thermodynamic model for it.
After creating the System file, you must add a text file named
Modules.txt, containing the line ": "
(in our example it should be "ZnS_FeS: Sphalerite (SS)" - do not use the
quotes) to the project folder. The file Modules.txt is needed for
determining which solutions of the current project require processing by
external modules, and which modules need to be used. If the file
Modules.txt already exists in the project folder, then simply add to its
contents the line, specified above. Be careful here: the name of your
solution must be written exactly as it appears in the System file (here
registers are important!). If the exact name of your solution is not found
in the file Modules.txt, the external module will be ignored by the Gibbs
program and the error notification will not be displayed.


Computations with an external module


To allow the external modules, listed in the file Modules.txt, to
dynamically link to the Gibbs program during the calculations, you need to
run the program with the option "Attach external modules" activated. If the
Gibbs program is running in the interactive mode (i.e. with the source
files such as Blank or Input), this option is set in the Main program
through the top menu: Gibbs - Gibbs Options - Computing. - Attach external
modules. Similarly, it is set for the Control file when editing the list of
Gibbs program options. If the program Gibbs is invoked from a user's
application (see GibbsLib.doc), then this option should be set in the
property GibbsOptions by adding the parameter "/em" ("External modules").


The results of using the external module


When an external module is dynamically linked to the Gibbs program, the
activity coefficients of the components of the corresponding solution are
calculated using this module. The results of these calculations are easiest
to see in the Gibbs program listing, in the case when the program is run in
the interactive mode (with a Blank or Input file). In this case, the
program provides a full listing, which includes the activity coefficients.
Note that in the complete listing the name of the external module, used in
the calculation, is always listed under the row with the name of the
solution.
When the Gibbs program is run in the automatic mode (with a Control
file), the values of the activity coefficients are never shown, so in this
case the effect of the external module can only be estimated indirectly.
If the values of the activity coefficients, calculated by the module,
are needed, for example, in the case when the Gibbs program is invoked from
any user's application, this information can be obtained by using the
parameter lna of the CallGibbs method or the property GibbsResult_g of the
object Gibbs (see GibbsLib.doc).
It is important to note that the ZnS_FeS module corrects the standard
free energy of troilite (in sphalerite) in order to get the correct
standard potential of FeS component in sphalerite, so you cannot calculate
the chemical potential of this component by using its activity, obtained
from the Gibbs program listing. If you would like to get the chemical
potential of FeS in the equilibrium composition of the system, it should be
calculated from the other coexisting phases/components with the known
standard state parameters. If the Gibbs program is run from the user's
application, the chemical potential of FeS component in sphalerite can be
found either in the parameter lna of the CallGibbs method, or in the
property GibbsResult_g of the object Gibbs (see GibbsLib.doc).
A use of the external module ZnS_FeS.dll was demonstrated in [3].

Error messages

If the program Gibbs detects an error when an external module is added
or accessed, it displays the error notification and terminates. Of course,
errors may occur due to incorrect operation of the Gibbs program itself but
most of the time the errors are caused by the actions of the user. The list
of errors detected by the Gibbs program can be found in the file
GibbsExt.doc; here we show only the notifications of errors, which are
detected by the ZnS_FeS.dll only. All of these errors are detected during
the initial call of the module (Primary call) and are characterized by the
value of the numeric code:

|Code|Description |Comment |
|-1 |Too many solutions|There are several solutions that are assigned |
| | |to the current module in the System file, which|
| | |makes no sense. Delete the excess solid |
| | |solutions from the System file. |
|1 |Non-binary |The solution, used by the module, consists of |
| |solution |more than two end-members, which is not |
| | |allowed. Correct the System file. |
|2 |Incorrect |The name of one of the end-members must begin |
| |end-member name |with "tro", and the other - with "sph". Check |
| | |the System file. |







References



1. Delgado Martin J. and Soler i Gil A. (2005) An integrated thermodynamic
mixing model for sphalerite geobarometry from 300 to 850 њC and up to 1
GPa // Geochimica et Cosmochimica Acta, Vol. 69, No. 4, pp. 995-1006.


2. Toulmin P., III and Barton P.B., Jr. (1964) A thermodynamic study of
pyrite and pyrrhotite // Geochimica et Cosmochimica Acta, Vol. 28, pp.
641-671.


3. Laptev Yu.V. and Shvarov Yu.V. (2012) Computer simulation in
hydrothermal systems with allowance for nonideality of sphalerite and
pyrrhotite // Geology of Ore Deposits, Vol. 54, No. 4, pp. 304-312.