CHNOSZ

Thermodynamic calculations and diagrams for geochemistry

Thermodynamic database with minerals and inorganic and organic aqueous species.
Balance reactions with basis species, calculate standard Gibbs energy, equilibrium constant, and chemical affinity.
Make Eh–pH, logfO2–pH, and other types of chemical activity diagrams.
CRAN Downloads DOI GitHub
What is it?

The CHNOSZ package for R provides an integrated set of tools for thermodynamic calculations in aqueous geochemistry and geobiochemistry. It has functions for writing balanced reactions to form species from user-selected basis species and for calculating the standard molal properties of species and reactions, including the standard Gibbs energy and equilibrium constant (details). Calculations of the non-equilibrium chemical affinity and equilibrium chemical activity of species can be portrayed on diagrams as a function of temperature, pressure, or activity of basis species; in two dimensions, this gives a maximum affinity or predominance diagram. The diagrams have formatted chemical formulas and axis labels, and water stability limits can be added to Eh-pH, logfO2-T, and other diagrams with a redox variable. The package has been developed to handle common calculations in aqueous geochemistry, such as solubility due to complexation of metal ions, mineral buffers of redox or pH, and changing the basis species across a diagram ("mosaic diagrams"). CHNOSZ also implements a group additivity algorithm for the standard thermodynamic properties of proteins.

An Example
Based on a figure from Yang et al. (2018)
Fe-O-H-S
add.OBIGT("SUPCRT92")
basis(c("Fe", "H2", "H2S", "H2O"),
  c("cr", "aq", "aq", "liq"))
species(c("hematite", "pyrite",
  "pyrrhotite", "magnetite"))
a <- affinity(H2S = c(-4, -1.5),
  H2 = c(-6, -1), T = 300, P = 700)
diagram(a, fill = "terrain")
title(main = "Fe-O-H-S")
legend("bottomright",
  c("300 °C, 700 bar"))
More diagrams All examples
Documentation
Installation
  1. Get R from the Comprehensive R Archive Network (CRAN).
  2. Start an R session, then use these commands to install and load the package and run the examples from the help files:
  3. install.packages("CHNOSZ")
    library(CHNOSZ)
    examples()
    
    
  4. To install the development version, use this command instead:
  5. install.packages("CHNOSZ",
      repos = "https://R-Forge.R-project.org")
    
    
Weblinks
  • GeoTPD: Shiny interface by Evgeniy Bastrakov
  • pyCHNOSZ: Python wrapper by Grayson Boyer

logKcalc

Equilibrium constants for GWB thermodynamic data files

DOI GitHub
Package vignettes:
About

CHNOSZ and logKcalc are free software made available under the GPL. The maintainer of these packages is Jeffrey Dick. Please contact him at j3ffdick@gmail.com.

But wait, there's more! Swipe across or click the next tab for R Packages for Geochemical Biology: canprot, chem16S, and JMDplots.

Last updated: 2024-03-03