|
|
Tools for Modeling with EQ3/6 under a UNIX/Linux Shell
|
Remark: All the following content pertains to the versions 7.2[a-c] of the
EQ3/6 geochemical modeling software package.
It is written and maintained by Thomas Wolery (
wolery1@llnl.gov )
from the Lawrence Livermore National Laboratory /
LLNL.
All major changes to my EQ3/6 pages are
documented in a separate file.
EQ3/6 is in wide-spread use nowadays for many geochemical modeling
purposes. I have prepared a page about some
traps and pitfalls, together with some further remarks.
Some users will also have noticed that there is no easy way to do
speciation scans on varying pH like it can be done by members of the
PHREEQE or MINEQL code families, not to talk from scans over varying Eh or
the concentration of some components. To overcome this limitation at least
partially, I have written some tools to allow such scans by automatically
starting a sequence of EQ3NR runs with appropriately updated input files,
or by analyzing and drastically shortening of the huge output from an EQ6
"titration" run. These tools are essentially shell scripts, namely for the
C-Shell under UNIX (but I was told that this shell is now also available under
the various flavors of the PC operating system MS Windows).
It should not be a big task to
re-write them to adapt from csh to ksh, bash, zsh or the Bourne Shell sh.
Attention!
All automatic input substitutions only work for input files
using the same key words as in the examples from the EQ3/6 manual !
And moreover, the input file needs to be in the W-format and are not
allowed to contain several concatenated problem descriptions !
But again it is not so difficult to adapt them to the D-notation.
All source files are commented to give further advice for any modifications.
I would be glad to be informed about any improvements concerning adaptation
to other operating systems or the D-notations, to extend the applicability
or improve the stability etc. This can be done by email to the address given at the end of this page.
Here are the items you can download:
-
scan_ph -
this script performs several single point calculations with EQ3NR to
simulate titration curves. It is an alias (symbolic link) to
scan_conc, scan_log, scan_eh, scan_ph,
scan_gas and scan_t.
According to the command line name, either
the concentration of one component (linear or logarithmic),
the redox potential, the pH, a gas partial pressure or the temperature is varied.
Possible precipitates are announced, but not taken into account for
the mass balances. The final output is a long list only containing
the actual value of the varied variable, the pH, the computed true and
the stoichiometric ionic strength, and the concentration of all
species. Solids are included, if they are listed in the mineral saturation output block.
The name of the output file is similar to the input file,
but with the extension ".3l" instead of ".3i".
-
conc3 -
this C-Shell script processes output files from
scan_conc, scan_log, scan_eh, scan_ph,
scan_gas and scan_t EQ3NR runs.
The final output from this C-Shell script is a table with:
- the 1st column giving the stepping value,
- the 2nd column giving the pH,
- the 3rd column giving the true ionic strength,
- the 4th column giving the stoichiometric ionic strength,
- all following columns giving the real concentration
of the species or the mineral saturation indices.
It is necessary to restrict the species to only those containing an
user-specified element. The total analytical start concentration of that
element must be given by the user, and only species with concentrations
larger than 0.01 % of the above element's "total analytical"
are considered.
The processing of solids is triggered by the element specification.
- If the element is followed by a "+", also the minerals and their saturation
indices log (Q / K) are extracted. If log (Q / K) becomes positive, the mineral is
oversaturated and should precipitate if not kinetically hindered.
The list of minerals containing the requested element is built from a global list
created by the separate C-Shell script
minerals.
- If the element is followed by a "-", also the total concentration of the respective
strict basis species is extracted, useful e.g. in studies of the pH dependence of mineral solubilities.
- If the element is followed by a "=", also the partial pressures of all gases are extracted.
- If "Q" is specified as (fake) element, all mineral indices (and only them) are listed.
The name of the output file is the same as the corresponding input file,
but with the extension ".3c" instead of ".3l".
-
conc6 -
this C-Shell Script extracts the concentration information of an EQ6
output file and adds it to a data table file with all the
species names in the 1st row and:
- the 1st column giving the reaction progress Xi,
- the 2nd column giving the pH,
- the 3rd column giving the Eh,
- the 4th column giving the ionic strength,
- all following columns giving the real concentration
of the species.
It is necessary to restrict the species to only those containing an
user-specified element. The total analytical start concentration of that
element must be given by the user, and only species with concentrations
larger than 0.01 % of the above "total analytical" are considered.
The minerals containing the requested element are extracted from a global list
created by the separate C-Shell script
minerals.
All relevant solids are listed in the data table file, with "(s)" appended to their name.
The name of the output file is the same as the corresponding EQ6 file,
but with the extension ".6c" instead of ".6o".
- Both conc3 and conc6 require a small binary to transform a long
single-column file (listing sequentially all species concentration for all
scanning steps) into a more convenient table. The source codes for
list2table.c and
openfile.c are therefore also made available. They use just
standard C syntax and should be accepted by really any decent
C-compiler.
-
tab3 -
this C-Shell script processes output files from conc3
based on EQ3NR run series.
The final output from this C-Shell script is a table with:
- the 1st column giving the stepping value,
- all following columns giving the percentage distribution
of the species.
It is necessary to restrict the species to only those containing a
given (user-defined) element. The stoichiometric coefficients of this
element in each species are not automatically determined,
so the user has to provide them.
The name of the output file is the same as the corresponding input file,
but with the extension ".3d" instead of ".3l".
-
tab6 -
this C-Shell script processes output files from conc6,
resulting from an EQ6 run.
The final output from this C-Shell script is a table with:
- the 1st column giving the x-axis variable (Xi, pH, or Eh)
- all following columns giving the percentage distribution
of the species.
It is necessary to restrict the species to only those containing a
given (user-defined) element. The stoichiometric coefficients of this
element in each species are not automatically determined,
so the user has to provide them.
The name of the output file is the same as the corresponding EQ6 file,
but with the extension ".6d" instead of ".6i".
-
nplot -
to make things even more convenient, this script creates a
gnuplot script for the plotting of EQ3NR scans
or EQ6 titrations (species distributions from tab3 or tab6), and optionally also
a PostScript version of the distribution graphs.
The output is optimized for gnuplot 3.7.
In case of EQ6 output, also all precipitated solids are included.
The name of the output files are the same as the corresponding input
file, but instead of the extension ".[3|6]d" they have ".[3|6]gnu" for
the gnuplot script file, and ".[3|6]ps" for the PostScript graphics file.
Depending on the first token of the first line in the input file, the x-axis
scaling is equidistant or logarithmic.
-
mplot -
similar to nplot but prints mineral saturation indices.
Last Update: February 28, 2014
Back to homepage !