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


The use of the external module Ab_An.dll

Ab_An.dll file is an external module for the Gibbs program, and is
designed to calculate the activity coefficients of the components of albite-
anortite solid solution. 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 albite-anortite solid solution, proposed in
literature [1], is used in this module.


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 Ab_An.dll, you need to include a binary
solid solution of albite and anortite 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 description of
these minerals. If you use a tailored description, you need to name these
minerals 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 their names: the name of the albite component
should start with the letters "alb", the name of the anortite component -
with "ano" (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,
"Plagioclase"); the only important thing is to make sure that the name is
unique within the System file.
After creating the System file, you must add a text file named
Modules.txt, containing the line ": "
(in our example it would be "Ab_An: Plagioclase" - 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 Gibbs
program will ignore the external module 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).
A use of the external module Ab_An.dll was demonstrated in [2].


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 Ab_An.dll only. All of these errors are detected during the
initial call to 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 minerals, which is not allowed. |
| | |Correct the System file. |
|2 |Incorrect mineral |The name of one of minerals must begin with |
| |name |"alb", and the other - with "ano". Check the |
| | |System file. |







References


1. Holland T.J.B., Powell R. Plagioclase feldspars: activity-composition
relations based upon Darken's quadratic formalism and Landau theory //
Amer. Mineral., 1992, v. 77, p. 53-61.

2. Shvarov Yu.V. HCh: New potentialities for the thermodynamic simulation
of geochemical systems offered by Windows // Geochemistry International,
2008, v. 46, # 8, p. 834-839.