---
title: "OBIGT thermodynamic database"
output:
html_vignette:
mathjax: null
vignette: >
%\VignetteIndexEntry{OBIGT thermodynamic database}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: OBIGT.bib
# So that these appear in the bibliography
nocite: |
@SPRONS92, @SLOP98, @SLOP07, @SLOP16, @JOH92, @WP02, @CWM89, @PRPG97, @TH88, @Kul06, @Sho09, @HKF81
csl: elementa.csl
link-citations: true
---
```{r CHNOSZ_reset, include=FALSE}
library(CHNOSZ)
reset()
```
```{r setfile, include=FALSE}
# Assign the file name to a variable and print the file name and number of species
setfile <- function(csvfile, dat=NULL) {
# Assign csvfile outside this function
assign("csvfile", csvfile, parent.frame())
file <- system.file(paste0("extdata/OBIGT/", csvfile), package="CHNOSZ")
dat <- read.csv(file, as.is=TRUE)
## Exclude entries for high-T polymorphs
#dat <- dat[!dat$state %in% c("cr2", "cr3", "cr4", "cr5", "cr6", "cr7", "cr8", "cr9"), ]
# The state and class of substance (used as section header), followed by number of species
basename <- gsub(".csv", "", csvfile)
class <- strsplit(basename, "_")[[1]][1]
substr(class, 1, 1) <- toupper(substr(class, 1, 1))
state <- strsplit(basename, "_")[[1]][2]
if(identical(state, "aq")) state <- "Aqueous "
else if(identical(state, "cr")) state <- "Solid "
else if(identical(state, "gas")) state <- "Gas "
else if(identical(state, "liq")) state <- "Liquid "
else state <- "Optional "
paste0(state, class, " (", nrow(dat), " species)")
}
```
```{r filerefs, include=FALSE}
filerefs <- function(csvfile, dat=NULL, message=FALSE) {
# With dat, look for ref2 in dat
whichref <- "ref2"
# Without dat, look for ref1 in csvfile
if(is.null(dat)) {
file <- system.file(paste0("extdata/OBIGT/", csvfile), package="CHNOSZ")
dat <- read.csv(file, as.is=TRUE)
whichref <- "ref1"
}
## Exclude entries for high-T polymorphs
#dat <- dat[!dat$state %in% c("cr2", "cr3", "cr4", "cr5", "cr6", "cr7", "cr8", "cr9"), ]
# Count number of times each reference is used
tab <- table(dat[, whichref])
# In case there are not references (previously for H2O_aq.csv) we return the species here
if(length(tab)==0) return(paste(dat$name, dat$state))
# The reference keys
keys <- names(tab)
# Warn if any keys aren't in thermo()$ref$key
ikey <- match(keys, thermo()$ref$key)
ina <- is.na(ikey)
if(any(ina)) cat(paste("**WARNING: key(s)", paste(names(tab)[ina], collapse=" "), "not found in `thermo()$ref$key`**\n\n"))
# Put the table in chronological order, according to thermo()$ref
ikey <- order(match(keys, thermo()$ref$key))
tab <- tab[ikey]
keys <- keys[ikey]
xxx <- lapply(seq_along(tab), function(i){
thiskey <- keys[i]
# Read thermo()$ref$note
iref <- match(thiskey, thermo()$ref$key)
note <- thermo()$ref$note[iref]
# Show the note in italics
if(!identical(note, "")) note <- paste0(" *", note, "* ")
# Use bullets for ref2
if(whichref=="ref2") bullet <- "- " else bullet <- ""
# Convert key (e.g. LD12.2) to ref in OBIGT.bib (e.g. LD12)
thisref <- gsub("\\..*$", "", thiskey)
# Replace SLOP98 with slop98.dat, etc.
# (we don't actually cite them here to keep the year from showing -- it's annoying to see e.g. "slop98.dat (1998)")
citemark <- "@"
if(thisref=="SLOP16") { thisref <- "slop16.dat"; citemark <- "" }
if(thisref=="SLOP07") { thisref <- "slop07.dat"; citemark <- "" }
if(thisref=="SLOP98") { thisref <- "slop98.dat"; citemark <- "" }
if(thisref=="SPRONS92") { thisref <- "sprons92.dat"; citemark <- "" }
if(thisref=="OBIGT") { thisref <- paste0("OBIGT (", thermo()$ref$year[iref], ")"); citemark <- "" }
cat(bullet, citemark, thisref, " -- ", tab[i], note, "\n\n", sep="")
# Get ref2 if we're in the outer list
if(whichref!="ref2") filerefs(dat=dat[dat$ref1==names(tab)[i], ])
})
# Return all the species listed
paste(dat$name, dat$state)
}
```
```{r used, include=FALSE}
# Initialize the list of used species
used <- character()
# Initialize the list of used optional species
optused <- character()
```
This vignette, produced on `r Sys.Date()`, lists the references for thermodynamic data in the OBIGT database in CHNOSZ version `r sessionInfo()$otherPkgs$CHNOSZ$Version`.
Except for Optional Data, all data are present in the default database, which is loaded when the package is attached, or by running `reset()` or `OBIGT()`.
Each section below corresponds to one of the CSV data files in the `extdata/OBIGT` package directory.
Clicking on a button opens that section, which contains a list of primary references (from column `ref1` in the file) in chronological order.
Any secondary references (`ref2`) are listed with bullet points under the primary reference.
Each citation is followed by the number of species, and a note taken from the file `extdata/OBIGT/refs.csv`.
Additional comments (from this vignette) are present for some sections.
Abbreviations: T (temperature), P (pressure), GHS (standard Gibbs energy, enthalpy, entropy), Cp (heat capacity), V (volume), HKF (revised Helgeson-Kirkham-Flowers equations).
### Aqueous Species
### Solids
### Gases Liquids
### Optional Data
*Showing citations in all data files.*
*Press any button above to hide them.*
## `r setfile("H2O_aq.csv")`
```{r reflist, results="asis", echo=FALSE}
used <- c(used, filerefs(csvfile))
```
This file contains H2O, *e*-, and H+.
The properties of H2O are listed as NA; CHNOSZ calculates its properties using a Fortran subroutine taken from SUPRCT92 ([Johnson et al., 1992](https://doi.org/10.1016/0098-3004(92)90029-Q)) (default) or using the IAPWS-95 equations ([Wagner and Pruß, 2002](https://doi.org/10.1063/1.1461829)) or the Deep Earth Water (DEW) model ([Sverjensky et al., 2014](https://doi.org/10.1016/j.gca.2013.12.019)).
By convention, the standard Gibbs energy of formation, entropy, and heat capacity of the aqueous proton (H+) are 0 at all *T* and *P* ([e.g. Cox et al., 1989](https://www.worldcat.org/oclc/18559968)).
The formation reaction of the proton can be expressed as ½H2,(*g*) + Z = H+, where Z is the "element" of positive charge.
Because the conventional standard Gibbs energy of this reaction is 0 at all *T*, the standard entropy of the reaction is also constrained to be zero (cf. Puigdomenech et al., 1997).
Therefore, the "element" of positive charge (Z) has zero thermodynamic properties except for an entropy, *S*°*T*r, that is negative one-half that of H2,(*g*).
The standard entropy of the aqueous electron, which is a solely a pseudospecies defined by *e*- = -Z, is opposite that of Z.
Likewise, [GEM-Selektor](http://gems.web.psi.ch/) defines "independent components" to be stoichiometric units usually consisting of elements and charge; the latter, [which is named Zz](http://gems.web.psi.ch/tests/TestNaCl-dep.html) and has a standard molal entropy of -65.34 J/mol/K and heat capacity of -14.418 J/mol/K (negative one-half those of gaseous hydrogen), is negated in the formula of the fictive "aqueous electron" ([Kulik, 2006](https://doi.org/10.1016/j.chemgeo.2005.08.014)).
Despite these considerations, the final column of the thermodynamic database (`thermo()$OBIGT`) lists a charge of "0" for both the aqueous proton and electron.
Data in this this column are used in CHNOSZ only to specify the charge that is input to the "*g*-function" ([Tanger and Helgeson, 1988](https://doi.org/10.2475/ajs.288.1.19); [Shock and Helgeson, 1988](https://doi.org/10.1016/0016-7037(88)90181-0)).
Setting it to zero prevents activation of the *g*-function, which would result in non-zero contributions to thermodynamic properties, conflicting with the conventions mentioned above.
All other calculations in CHNOSZ obtain the elemental makeup, including the correct charge for the species, by parsing the chemical formulas stored in the database.
## `r setfile("organic_aq.csv")`
Charged amino acid sidechain groups have a Z parameter that is tabulated as zero; their chemical formulas indicate the correct charge.
Non-zero values of Z would yield derivatives of the omega parameter (ω) in the revised HKF equations of state for the cations and anions *that are not opposites of each other*.
This would be incompatible with group additivity of cations and anions to give a neutral species, for which the derivatives of ω are taken to be zero (cf. [Dick et al., 2006](https://doi.org/10.5194/bg-3-311-2006)).
```{r reflist, results="asis", echo=FALSE}
```
## `r setfile("inorganic_cr.csv")`
Chamosite,7A and witherite were present in sprons92.dat but not in slop98.dat or later files, and are not included in CHNOSZ.
The source of parameters used here for goethite is different from that in the slop files ([Shock, 2009](https://doi.org/10.2113/gsecongeo.104.8.1235)).
```{r reflist, results="asis", echo=FALSE}
```
## `r setfile("Berman_cr.csv")`
This file gives the identifiying information for minerals whose properties are calculated using the formulation of [Berman (1988)](https://doi.org/10.1093/petrology/29.2.445).
Thermodynamic properties for these minerals are listed as NA in `thermo()$OBIGT`; the actual data are stored separately, as CSV files in `extdata/Berman/*.csv`.
```{r reflist, results="asis", echo=FALSE}
```
## `r setfile("SUPCRT92.csv")`
These minerals and aqueous species, taken from the SUPCRT92 database, were present in earlier versions of CHNOSZ but have since been superseded by @Ber88 (minerals) and @NA03 (H2AsO3-).
The thermodynamic properties and parameters are kept here as optional data for reproducing published calculations and making comparisons with newer data.
The minerals here include all of the silicates and Al-bearing minerals from @HDNB78, as well as calcite, dolomite, hematite, and magnetite.
Use `add.OBIGT("SUPCRT92")` to load the data.
**NOTE:** Other minerals from SUPCRT92, including native elements, sulfides, halides, sulfates, and selected carbonates and oxides that do not duplicate those in the Berman dataset, are still present in the default database (**inorganic_cr.csv**).
```{r optreflist, results="asis", echo=FALSE}
```
## `r setfile("SLOP98.csv")`
These species, which were taken from or are linked to slop98.dat (or later versions) and were present in earlier versions of CHNOSZ, have been replaced by or are incompatible with species currently in the default database, including aqueous Al species [@TS01], As species [@NA03], Au, Ag, and Cu species [@AZ01; @AZ10], Pd species [@TBZ+13], Zn species [@AT14], Pt species [@TBB15], Nb species [@AKK+20], and CoCl2+ [@LBT+11].
This file also contains aqueous transuranic actinide complexes, for which estimated thermodynamic properties have been reported, but no entropies of the corresponding elements at 298.15 K are available to check the self-consistency of the GHS values for the complexes.
Use `add.OBIGT("SLOP98")` to load the data.
**NOTE:** Many other species found in slop98.dat and later versions are still present in the default database.
```{r optreflist, results="asis", echo=FALSE}
```
## `r setfile("AD.csv")`
This file has parameters for aqueous nonelectrolytes in the Akinfiev-Diamond model [@AD03].
Use `add.OBIGT("AD")` to load the data; see `demo(AD)` for an example.
```{r optreflist, results="asis", echo=FALSE}
```
## `r setfile("AS04.csv")`
This file has data for aqueous SiO2 from @AS04 and a HSiO3- modified to be consistent with the SiO2 here.
This file also has H4SiO4 from an earlier publication [@Ste01] that is roughly consistent with the SiO2 here.
Use `add.OBIGT("AS04")` to load the data; see `demo(aluminum)` for an example.
```{r optreflist, results="asis", echo=FALSE}
```
## `r setfile("DEW.csv")`
The Deep Earth Water (DEW) model extends the applicability of the revised HKF equations of state to 60 kbar.
Accuracy of the thermodynamic calculations at these conditions is improved by revised correlations for the a1 HKF parameter, as described by [Sverjensky et al. (2014)](https://doi.org/10.1016/j.gca.2013.12.019).
The thermodynamic parameters for species were taken from the May 2017 and January 2019 versions of the DEW spreadsheet.
The following species are present in the spreadsheet, but are not used here because the parameters are unchanged from the default database in CHNOSZ: B(OH)3, Br-, Ca+2, Cl-, Cs+, F-, H+, H2, He, I-, K+, Kr, Li+, Mg+2, Na+, Ne, O2, Rb+, Rn, SO4-2.
Besides using `add.OBIGT("DEW")` to load these data, you should also run `water("DEW")` to activate the DEW equations in CHNOSZ.
See `demo(DEW)` for some examples.
Most of the comments below were transcribed from the DEW spreadsheet. (Comments in parentheses were added by JMD.)
```{r optreflist, results="asis", echo=FALSE}
optused <- c(optused, filerefs(csvfile))
```
## `r setfile("GEMSFIT.csv")`
[Miron et al. (2016)](https://doi.org/10.1016/j.gca.2016.04.026) and [Miron et al. (2017)](https://doi.org/10.2475/07.2017.01) described an internally consistent thermodynamic dataset for aqueous species in the system Ca-Mg-Na-K-Al-Si-O-H-C-Cl that was obtained by using the [GEMSFIT](https://doi.org/10.1016/j.apgeochem.2014.10.013) package.
Use `add.OBIGT("GEMSFIT")` to load the data.
```{r optreflist, results="asis", echo=FALSE}
```
Total count of species: References were found for `r length(used)` of `r nrow(thermo()$OBIGT)` species in the default OBIGT database and `r length(optused)` optional species.
# References