modOBIGT: Modify the Thermodynamic Database to Prepare for \logK...

View source: R/modOBIGT.R

modOBIGTR Documentation

Modify the Thermodynamic Database to Prepare for \logK Calculations

Description

These functions modify the thermodynamic database by adding data from optional data files in CHNOSZ or thermodynamic parameters fitted to equilibrium constants from a GWB file.

Usage

  modOBIGT(mod)
  addOBIGT(species, formula = NULL, file = system.file("extdata/thermo_24swapped.tdat",
           package = "logKcalc"), tolerance = 0.1)

Arguments

mod

Name(s) of modifications to make to OBIGT

species

Name of a species to add from a GWB file

formula

Chemical formula of the species for OBIGT

file

GWB file that has the species as a redox couple, aqueous or mineral species

tolerance

Tolerance for checking equivalence of input and calculated \logK values

Details

Before running logKcalc, modOBIGT can be used to make preset modifications to the default OBIGT database, for example to use a different dataset for minerals. If you require a redox, aqueous, or mineral species from a GWB file that is not present in OBIGT, addOBIGT can be used to add it.

modOBIGT takes one or more names of modfications in mod and runs them in the order given. These are the available mods:

⁠addSUPCRT⁠

The main source of mineral data for OBIGT is Berman (1988), but selected minerals from SUPCRT92, “including native elements, sulfides, halides, sulfates, and carbonates and oxides that do not duplicate those in the Berman dataset”, are also included (Dick, 2019). This mod add the remaining minerals from SUPCRT92 that are not in OBIGT.

⁠allSUPCRT⁠

This mod adds all minerals from SUPCRT92, possibly replacing the Berman ones.

⁠noBerman⁠

This can be used before either of the above modifications to remove the Berman minerals from the database and generate a set of minerals that is mostly based on SUPCRT92.

⁠steam⁠

This adds data for steam (\H2O(g)) taken from the ‘⁠sprons92.dat⁠’ file of SUPCRT92, which is referenced there as “Johnson, J.W., Personal calculation, Earth Sciences Dept., Lawrence Livermore National Lab., Livermore, CA. Parameters given provide smooth metastable extrapolation of one-bar steam properties predicted by the Haar et al. (1984) equation of state to temperatures < the saturation temperature (99.632 C).” This entry was removed in CHNOSZ 1.1.3 based on the issues raised by Zavarin et al. (2016, p. 6). However, many existing GWB files have an entry for steam, and the data are needed to include it in the output.

⁠realgar*4⁠

This mod scales the chemical formula and thermodynamic parameters of realgar by a factor of 4. This makes realgar in OBIGT compatible with the UNITHERM database in the HCh package (Shvarov and Bastrkov, 1999).

⁠antigorite/2⁠

This mod scales the chemical formula and thermodynamic parameters of antigorite by a factor of 1/2. This makes antigorite in OBIGT compatible with the thermo.tdat file from GWB.

addOBIGT reads the equilibrium constants for the dissociation reaction of one species from the indicated file. The standard Gibbs energy of the species is computed at each temperature from the \logK values and the Gibbs energies of the other species in the reaction, which must be available in OBIGT. Then, the standard Gibbs energy of the species is fit using the thermodynamic parameters G, S, and Cp.

The species is then added to OBIGT; the upper temperature limit (corresponding to the \T range for the fitted \logK values) is set in the ‘⁠T⁠’ parameter for minerals or the ‘⁠abbrv⁠’ parameter for aqueous species; the latter is specially used by other functions in this package to assign NA values at appropriate places (i.e., ‘⁠500⁠’ in GWB data files). An attempt is made to convert GWB-style formulas (e.g. Sn\S++++) to the format used in OBIGT (Sn\S+4) (see Names Mapping section in logKcalc), but if there is any doubt, the formula should be given explicitly. For adding minerals, a valid formula must be provided in the formula argument.

Note that the equation assumes a constant heat capacity and no volume change, so in general does not perfectly fit the \logK values in the input GWB file and may be unsuitable for extrapolation beyond the original \T and \P range. all.equal is used to test the near equivalence of the input and calculated equilibrium constants; if the differences exceed tolerance, the code generates an error.

References

Berman, R. G. (1988) Internally-consistent thermodynamic data for minerals in the system Na\s2O-K\s2O-CaO-MgO-FeO-Fe\s2O\s3-Al\s2O\s3-SiO\s2-TiO\s2-H\s2O-CO\s2. J. Petrol. 29, 445-522. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/petrology/29.2.445")}

Dick, J. M. (2019) CHNOSZ: Thermodynamic calculations and diagrams for geochemistry. Front. Earth Sci. 7:180. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/feart.2019.00180")}

Shvarov, Y. and Bastrakov, E. (1999) HCh: A software package for geochemical equilibrium modelling. User's Guide. Australian Geological Survey Organisation 1999/25. http://pid.geoscience.gov.au/dataset/ga/25473

Zavarin, M., Wolery, T. J. and Atkins-Duffin, C. (2016) M4FT-16LL080302052-Update to Thermodynamic Database Development and Sorption Database Integration. Lawrence Livermore National Laboratory, LLNL-TR-701407. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2172/1325873")}

See Also

See add.OBIGT in CHNOSZ for more information about modifying the database.

Examples

## Useful settings for processing the GWB thermo.tdat file
modOBIGT(c("addSUPCRT", "steam", "antigorite/2"))

# As(OH)4- and Sn++++ are basis species in the thermo.tdat GWB file,
# but aren't available in OBIGT, so we add them like this:
addOBIGT("As(OH)4-")
addOBIGT("Sn++++")
# Now As- and Sn-bearing species can be included in the logK calculation:
#logKcalc("thermo.tdat")

jedick/logKcalc documentation built on Jan. 19, 2025, 10:41 a.m.