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


The use of the external module Electrum.dll

Electrum.dll file is an external module for the Gibbs program, and is
designed to calculate the activity coefficients of the components of gold-
silver alloy (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 gold-silver 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 Electrum.dll, you need to include a binary
solid solution of metallic gold and silver into the System file, as you
create it. These components 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 four letters of the name: the name of the
gold component should start with the letters "gold", the name of the silver
component - with "silv" (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, "Electrum"); 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 should be "Electrum: Electrum" - 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 Electrum.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 Electrum.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 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 "gold", and the other - with "silv". Check|
| | |the System file. |







References


1. White J.L., Orr R.L., and Hultgren R. The thermodynamic properties of
silver-gold alloys // Acta Metallurgica, 1957, v. 5 (12), p. 747-760.

2. Pal'yanova G.A., Shvarov Yu.V., Shironosova G.P., Laptev Yu.V.
Methodological approaches to the assessment of gold fineness during
thermodynamic modeling of hydrothermal systems // Geochemistry
International, 2005, v. 43, # 12, p. 1247-1251.