| thermo {CHNOSZ} | R Documentation |
Thermodynamic Database and System Settings
Description
Run reset() to reset all of the data used in CHNOSZ to default values.
This includes the computational settings, thermodynamic database, and system settings (chemical species).
The system settings are changed using basis and species.
To clear the system settings (the default, i.e. no species loaded), run basis(""); to clear only the formed species, run species(delete = TRUE)
The thermodynamic database is changed using add.OBIGT and mod.OBIGT.
To restore the default database without altering the species settings, run OBIGT().
The computational settings are changed using water, P.units, T.units, E.units, and some other commands (e.g. mod.buffer).
All the data are stored in the thermo data object in an environment named CHNOSZ.
thermo() is a convenience function to access or modify parts of this object, in particular some computational settings, for example, thermo("opt$ideal.H" = FALSE) (see nonideal).
The source data are provided with CHNOSZ as *.csv files in the extdata/thermo and extdata/OBIGT directories of the package.
These files are used to build the thermo object, which is described below.
Usage
reset()
OBIGT(no.organics = FALSE)
thermo(...)
Arguments
no.organics |
logical, load the database without data files for organic species (NOTE: CH4 is listed as an “inorganic” species)? |
... |
list, one or more arguments whose names correspond to the setting to modify |
Format
-
thermo()$optList of computational settings. Square brackets indicate default values. Note that the units ofG.tolandCp.toldepend on theE_unitsfor each species inthermo()$OBIGT. Therefore, species withE_unitsof ‘J’ have a lower absolute tolerance for producing messages (because 4.184 J = 1 cal).E.unitscharacter The user's units of energy ([‘J’] or ‘cal’) (see subcrt)T.unitscharacter The user's units of temperature ([‘C’] or ‘K’) P.unitscharacter The user's units of pressure ([‘bar’] or ‘MPa’) statecharacter The default physical state for searching species [‘aq’] (see info)watercharacter Computational option for properties of water ([‘SUPCRT’] or ‘IAPWS’; see water)G.tolnumeric Difference in G above which check.GHSproduces a message (cal mol-1) [100]Cp.tolnumeric Difference in Cp above which check.EOSproduces a message (cal K-1 mol-1) [1]V.tolnumeric Difference in V above which check.EOSproduces a message (cm3 mol-1) [1]varPlogical Use variable-pressure standard state for gases? [ FALSE] (seesubcrt)IAPWS.satcharacter State of water for saturation properties [‘liquid’] (see util.water)paramininteger Minimum number of calculations to launch parallel processes [1000] (see palply)ideal.Hlogical Should nonidealignore the proton? [TRUE]ideal.elogical Should nonidealignore the electron? [TRUE]nonidealcharacter Option for charged species in nonideal[Bdot]Setchenowcharacter Option for neutral species in nonideal[bgamma0]Bermancharacter User data file for mineral parameters in the Berman equations [ NA]maxcoresnumeric Maximum number of cores for parallel calculations with palply[2]ionize.aanumeric Calculate properties of ionized proteins when H+ is in basis species (see affinity) [TRUE] -
thermo()$elementDataframe containing the thermodynamic properties of elements taken from Cox et al., 1989, Wagman et al., 1982, and (for Am, Pu, Np, Cm) Thoenen et al., 2014. The standard molal entropy (S(Z)) at 25 °C and 1 bar for the “element” of charge (Z) was calculated fromS(H2,g) + 2S(Z) = 2S(H+), where the standard molal entropies of H2,g and H+ were taken from Cox et al., 1989. The mass ofZis taken to be zero. Accessing this data frame usingmassorentropywill select the first entry found for a given element; i.e., values from Wagman et al., 1982 will only be retrieved if the properties of the element are not found from Cox et al., 1989.elementcharacter Symbol of element statecharacter Stable state of element at 25 °C and 1 bar sourcecharacter Source of data massnumeric Mass of element (in natural isotopic distribution; referenced to a mass of 12 for 12C) snumeric Entropy of the compound of the element in its stable state at 25 °C and 1 bar (cal K-1 mol-1) nnumeric Number of atoms of the element in its stable compound at 25 °C and 1 bar -
thermo()$OBIGTThis dataframe is a thermodynamic database of standard molal thermodynamic properties and equations of state parameters of species. “OrganoBioGeoTherm” is the name of a Windows GUI interface to SUPCRT92 that was produced in Harold C. Helgeson's Laboratory of Theoretical Geochemistry and Biogeochemistry at the University of California, Berkeley. The OBIGT database was originally distributed with that program, and was the starting point for the database in CHNOSZ.
Note the following database conventions:
The combination of
nameandstatedefines a species inthermo()$OBIGT. A species cannot be duplicated (this is checked when runningreset()).English names of inorganic gases are used only for the gas state. The dissolved species is named with the chemical formula. Therefore,
info("oxygen")refers to the gas, andinfo("O2")refers to the aqueous species.
Each entry is referenced to one or two literature sources listed in
thermo()$refs. Usethermo.refsto look up the citation information for the references. See the vignette OBIGT for a complete description of the sources of data.The identifying characteristics of species and their standard molal thermodynamic properties at 25 °C and 1 bar are located in the first 13 columns of
thermo()$OBIGT:namecharacter Species name abbrvcharacter Species abbreviation formulacharacter Species formula statecharacter Physical state ref1character Primary source ref2character Secondary source datecharacter Date of data entry (ISO 8601 extended format) modelcharacter Model for thermodynamic properties of the species E_unitscharacter Units of energy: ‘J’ for Joules or ‘cal’ for calories Gnumeric Standard molal Gibbs energy of formation from the elements (J|cal mol-1) Hnumeric Standard molal enthalpy of formation from the elements (J|cal mol-1) Snumeric Standard molal entropy (J|cal mol-1 K-1) Cpnumeric Standard molal isobaric heat capacity (J|cal mol-1 K-1) Vnumeric Standard molal volume (cm3 mol-1) modelmust be one of ‘H2O’, ‘HKF’, ‘CGL’, ‘Berman’, ‘AD’, or ‘DEW’. ‘H2O’ is reserved for liquid water, the properties of which are calculated using one of several available models (seewater). Most aqueous species use ‘HKF’ (the revised Helgeson-Kirkham-Flowers model). Properties of aqueous species withmodelset to ‘AD’ are calculated using the Akinfiev-Diamond model, and those with ‘DEW’ are calculated using theDEWmodel. Many minerals in the default database use the ‘Berman’ model (seeBerman). All other species use ‘CGL’ (general crystalline, gas, liquid model). Properties of these species are calculated using a heat capacity function with up to six terms; the exponent on the final term can be defined in the database (see below).The meanings of the remaining columns depend on the model for each species. The names of these columns are compounded from those of the parameters in the HKF equations of state and general heat capacity equation; for example, column 13 is named
a1.a. Scaling of the values by integral powers of ten (i.e., orders of magnitude; OOM) for the HKF parameters (this also includes the DEW model) is based on the usual (but by no means universal) convention in the literature.Columns 15-22 for aqueous species (parameters in the revised HKF equations of state). NOTE: Most older papers use units of calories for these parameters, so ‘cal’ is listed here; the actual units for each species are set in the
E_unitscolumn.a1numeric a1 * 10 (cal mol-1 bar-1) a2numeric a2 * 10-2 (cal mol-1) a3numeric a3 (cal K mol-1 bar-1) a4numeric a4 * 10-4 (cal mol-1 K) c1numeric c1 (cal mol-1 K-1) c2numeric c2 * 10-4 (cal mol-1 K) omeganumeric ω * 10-5 (cal mol-1) Znumeric Charge Columns 15-22 for crystalline, gas and liquid species (CP =
a+bT+cT-2 +dT-0.5 +eT2 +fTlambda). NOTE: As of CHNOSZ 2.0.0, OOM scaling for heat capacity coefficients has been removed, and new entries use units of Joules unless indicated by settingE_unitsto ‘cal’.anumeric a(J K-1 mol-1)bnumeric b(J K-2 mol-1)cnumeric c(J K mol-1)dnumeric d(J K-0.5 mol-1)enumeric e(J K-3 mol-1)fnumeric f(J K-lambda-1 mol-1)lambdanumeric λ (exponent on the fterm)Tnumeric Positive value: Temperature (K) of polymorphic transition or phase stability limit Tnumeric Negative value: Opposite of temperature (K) limit of CP equation (see FAQ for details) Columns 15-17 for aqueous species using the Akinfiev-Diamond model. Note that the
ccolumn is used to store the\xiparameter. Columns 18-22 are not used.anumeric a(cm3 g-1)bnumeric b(cm3 K0.5 g-1)cnumeric \xidnumeric XX1NAenumeric XX2NAfnumeric XX3NAlambdanumeric XX4NAZnumeric ZNA -
thermo()$refsReferences for thermodynamic data.keycharacter Source key authorcharacter Author(s) yearcharacter Year citationcharacter Citation (journal title, volume, and article number or pages; or book or report title) notecharacter Short description of the compounds or species in this data source URLcharacter URL -
thermo()$buffersDataframe which contains definitions of buffers of chemical activity. Each named buffer can be composed of one or more species, which may include any species in the thermodynamic database and/or any protein. The calculations provided by
bufferdo not take into account polymorphic transitions of minerals, so individual polymorphs of such minerals must be specified in the buffers.namecharacter Name of buffer speciescharacter Name of species statecharacter Physical state of species logactnumeric Logarithm of activity (fugacity for gases) -
thermo()$proteinData frame of amino acid compositions of selected proteins. Most of the compositions were taken from the SWISS-PROT/UniProt online database (Boeckmann et al., 2003) and the protein and organism names usually follow the conventions adopted there. In some cases different isoforms of proteins are identified using modifications of the protein names; for example, ‘MOD5.M’ andMOD5.Nproteins of ‘YEAST’ denote the mitochondrial and nuclear isoforms of this protein. Seepinfoto search this data frame by protein name, and other functions to work with the amino acid compositions.proteincharacter Identification of protein organismcharacter Identification of organism refcharacter Reference key for source of compositional data abbrvcharacter Abbreviation or other ID for protein chainsnumeric Number of polypeptide chains in the protein Ala...Tyrnumeric Number of each amino acid in the protein -
thermo()$groupsThis is a dataframe with 22 columns for the amino acid sidechain, backbone and protein backbone groups ([Ala]..[Tyr],[AABB],[UPBB]) whose rows correspond to the elements C, H, N, O, S. It is used to quickly calculate the chemical formulas of proteins that are selected using theiproteinargument inaffinity. -
thermo()$basisInitiallyNULL, reserved for a dataframe written bybasisupon definition of the basis species. The number of rows of this dataframe is equal to the number of columns in “...” (one for each element)....numeric One or more columns of stoichiometric coefficients of elements in the basis species ispeciesnumeric Rownumber of basis species in thermo()$OBIGTlogactnumeric Logarithm of activity or fugacity of basis species statecharacter Physical state of basis species -
thermo()$speciesInitiallyNULL, reserved for a dataframe generated byspeciesto define the species of interest. The number of columns in “...” is equal to the number of basis species (i.e., rows ofthermo()$basis)....numeric One or more columns of stoichiometric coefficients of basis species in the species of interest ispeciesnumeric Rownumber of species in thermo()$OBIGTlogactnumeric Logarithm of activity or fugacity of species statecharacter Physical state of species namecharacter Name of species -
thermo()$stoichA precalculated stoichiometric matrix for the default database. This is a matrix, not a data frame, and as such can accept duplicated row names, corresponding to chemical formulas of the species. Seeretrieve, and the first test ininst/tinytest/test-retrieve.Rfor how to update this.rownamescharacter Chemical formulas from thermo()$OBIGT...numeric Stoichiometry, one column for each element present in any species -
thermo()$Bdot_acircValues of ion size parameter (Å) for species, taken from the UT_SIZES.REF file of the HCh package (Shvarov and Bastrakov, 1999), which is based on Table 2.7 of Garrels and Christ, 1965. This is used innonidealwith the default ‘Bdot’ method. Custom ion size parameters can be added to this vector; to override a default value for a species, either replace the numeric value for that species or prepend a named numeric value (for duplicated species, the first value is used). Seedemo("yttrium")for an example of adding and overriding species. -
thermo()$BermanA data frame with thermodynamic parameters for minerals in the Berman equations, assembled from files in ‘extdata/Berman’ and used inBerman.
Note on polymorphic transitions
To enable the calculation of thermodynamic properties of polymorphic transitions, higher-temperature polymorphs of minerals are listed in OBIGT with states ‘cr2’, ‘cr3’, etc.
The standard thermodynamic properties of high-temperature polymorphs at 25 °C and 1 bar are apparent values that are consistent with given values of enthalpy of transition (where available) at the transition temperature (T_{tr}).
See the FAQ question “How can minerals with polymorphic transitions be added to the database?” for details of the retrieval of standard thermodynamic properties of polymorphs used in OBIGT.
References
Cox, J. D., Wagman, D. D. and Medvedev, V. A., eds. (1989) CODATA Key Values for Thermodynamics. Hemisphere Publishing Corporation, New York, 271 p. https://www.worldcat.org/oclc/18559968
Garrels, R. M. and Christ, C. L. (1965) Solutions, Minerals, and Equilibria, Harper & Row, New York, 450 p. https://www.worldcat.org/oclc/517586
Thoenen, T., Hummel, W., Berner, U. and Curti, E. (2014) The PSI/Nagra Chemical Thermodynamic Database 12/07. Paul Scherrer Institut. https://www.psi.ch/en/les/database
Wagman, D. D., Evans, W. H., Parker, V. B., Schumm, R. H., Halow, I., Bailey, S. M., Churney, K. L. and Nuttall, R. L. (1982) The NBS tables of chemical thermodynamic properties. Selected values for inorganic and C1 and C2 organic substances in SI units. J. Phys. Chem. Ref. Data 11 (supp. 2), 1–392. https://srd.nist.gov/JPCRD/jpcrdS2Vol11.pdf
See Also
Other data files, including those supporting the examples and vignettes, are documented separately at extdata.
Examples
## Where are the data files in CHNOSZ?
system.file("extdata", package = "CHNOSZ")
# What files make up OBIGT?
# Note: file names with _aq, _cr, _gas, or _liq
# are used in the default database
dir(system.file("extdata/OBIGT", package = "CHNOSZ"))
## Exploring thermo()$OBIGT
# What physical states are present
unique(thermo()$OBIGT$state)
# Formulas of ten random species
n <- nrow(thermo()$OBIGT)
thermo()$OBIGT$formula[runif(10)*n]
## Adding an element
old <- thermo()$element
# Element symbol, state, source (can be anything),
# mass, entropy, and number in compound
Xprops <- data.frame(element = "X", state = "cr",
source = "user", mass = 100, s = 100, n = 1)
new <- rbind(old, Xprops)
thermo(element = new)
# Now "X" is recognized as an element in other functions
mass("X10")
# Restore default settings to remove X
reset()