logKcalc vignette 1 2 3 4 5

Using fitted thermodynamic parameters in CHNOSZ

This vignette shows how to use data for species from a GWB file in a diagram made with CHNOSZ.

This vignette was compiled on 2023-09-15 with logKcalc 0.1.1-2 and CHNOSZ 2.0.0-25.

One of the example scripts for the Act2 program in The Geochemist’s Workbench® is a mosaic diagram for the As-S-O-H system (Bethke et al., 2020: p.98). A similar diagram can be produced using the OBIGT database and CHNOSZ, but some differences are apparent because of different thermodynamic data compared to the thermo.tdat data file in GWB. In particular, the default OBIGT database has parameters for AsH3 from Schulte et al. (2001), aqueous As(OH)3 and AsO(OH)3 from Perfetti et al. (2008), and ionized As-bearing species from Nordstrom and Archer (2003), while thermo.tdat is based on the LLNL (Lawrence Livermore National Laboratory) compilation from various earlier sources.

This diagram is made using the default OBIGT database. However, the parameters for As(OH)3 are defined here if needed (they were added to OBIGT in CHNOSZ 1.4.0).

The major differences from the diagram made using thermo.tdat in GWB are a larger As(OH)3 field, the absence of orpiment and presence of native arsenic, and different aqueous speciation under relatively reducing conditions at high pH.

In order to more closely reproduce the example from GWB, we can use addOBIGT() to fit thermodynamic parameters to the log K values of dissociation reactions of species from a GWB data file. This function uses a modified version of GWB’s thermo.tdat in which the basis species are all available in OBIGT (thermo_24swapped.tdat). The fitted parameters (ΔG°, S° and Cp°) of the formed species are added to the OBIGT database, so they can be used in diagrams made in CHNOSZ.

Here, we fit the parameters for minerals and aqueous species other than As(OH)3, which is a basis species in thermo_24swapped.tdat. Although it has no stability field in the diagram, AsH3 is also updated because it appears in the dissociation reaction for realgar. Because it uses just three parameters, the fit may introduce some error, so we increase the tolerance (in log K units) for H2AsO4- to allow the checks for this species to pass. We run reset() first to make sure we are starting with the default OBIGT database and add As(OH)3 again if needed.

reset()
if(packageVersion("CHNOSZ") < "1.4.0") mod.obigt("As(OH)3", E_units = "J",
  G = -639800, H = -737300, S = 212.4, Cp = 85, V = 47.5,
  a1 = 45.2, a2 = 16.1, a3 = 43.7, a4 = -18, c1 = 186.2, c2 = -47.7, omega = 0.52, z = 0)
addOBIGT("AsH3(aq)")
addOBIGT("H2AsO4-", tolerance = 0.15)
addOBIGT("HAsO4--")
addOBIGT("As(OH)4-")
addOBIGT("AsO2OH--")
addOBIGT("AsO4---")
addOBIGT("Orpiment", "As2S3")
addOBIGT("Realgar", "AsS")
## Warning in CHNOSZ::subcrt(rxnspecies, rxncoeff, T = T): reaction among
## Realgar,H2O,H+,HS-,AsH3,As(OH)3 was unbalanced, missing O0.00100000000000033

The warning about an unbalanced reaction occurs because of the inexact representation of reaction coefficients in the GWB file due to rounding, and can be ignored.

For completeness we can even use fitted thermodynamic parameters for the S-bearing basis species that are speciated across the diagram. This does not include SO4-2, since it is a basis species in thermo_24swapped.tdat. For this example only, we include S-2, which has been recommended to be removed from thermodynamic databases (May et al., 2018) and is not present in the default OBIGT database.

addOBIGT("HSO4-")
addOBIGT("H2S(aq)")
addOBIGT("HS-")
addOBIGT("S--")

Note that repeated ‘-’ or ‘+’ signs at the end of formulas are converted into e.g. ‘-2’ for compatibility with the OBIGT database.

Next we identify As-bearing species in the As-S-O-H system. We remove species with data from Nordstrom and Archer (2003), as they may conflict with the GWB dataset. However, we leave As(OH)3 in the system; although its thermodynamic parameters in OBIGT are still from Perfetti et al. (2008), the parameters of the other species were made to be consistent with the log K values for the dissociation reactions in thermo_24swapped.tdat that involve As(OH)3 as a basis species.

iaq <- retrieve("As", c("S", "O", "H"), "aq")
iaq <- iaq[!grepl("NA03", info(iaq)$ref1)]
iaq <- c(info("As(OH)3"), iaq)
icr <- retrieve("As", c("S", "O", "H"), "cr")
icr <- icr[!grepl("NA03", info(icr)$ref1)]

Now we write some code to set up the system in CHNOSZ and make a logaO2–pH mosaic diagram at 100 °C. The activity of As-bearing aqueous species is set to 10-3 and that of SO4-2 to 10-4 (this value applies to the S-bearing basis species as a whole).

# Set up basis species and system
basis(c("As(OH)3", "SO4-2", "H2O", "O2", "H+"))
basis("SO4-2", -4)
logact <- c(rep(-3, length(iaq)), rep(0, length(icr)))
species(c(iaq, icr), logact)
# Set pH and loga(O2) range and grid resolution
pH <- c(0, 14, 500)
O2 <- c(-70, -40, 500)
# Calculate reaction affinities for changing basis species
bases <- c("SO4-2", "HSO4-", "H2S", "HS-", "S-2")
m <- mosaic(bases, pH = pH, O2 = O2, T = 100, blend = TRUE)
# Make the diagram
par(cex = 2.5, mar = c(2.8, 3, 1.4, 1))
# Web colors lightcyan and lavenderblush with some transparency
fill <- c(rep("#E0FFFF88", length(iaq)), rep("#FFF0F588", length(icr)))
d <- diagram(m$A.species, fill = fill, lwd = 2)
diagram(m$A.bases, add = TRUE, col = 4, lty = 3, lwd = 2,
        col.names = 4, cex.names = 0.7, italic = TRUE)
water.lines(d)
legend("bottomleft", describe.property("T", 100), bty = "n")
title(main = "blend = TRUE", font.main = 1)

The diagram is made with the default setting of blend = TRUE to represent the continuous change of speciation between basis species. Using blend = FALSE would instead portray abrupt transitions between basis species, similar to the diagram from the Mosaic.ac2 example in GWB.

References

Bethke CM, Farrell B, Sharifi M. 2020. The Geochemist’s Workbench® Release 14 GWB Essentials Guide. Champaign, Illinois: Aqueous Solutions, LLC.

May PM, Batka D, Hefter G, Königsberger E, Rowland D. 2018. Goodbye to S2− in aqueous solution. Chemical Communications 54(16): 1980–1983. doi: 10.1039/C8CC00187A

Nordstrom DK, Archer DG. 2003. Arsenic thermodynamic data and environmental geochemistry. In: Welch AH; Stollenwerk KG, editors. Arsenic in Groundwater. New York: Springer. pp. 1–25. doi: 10.1007/0-306-47956-7_1

Perfetti E, Pokrovski GS, Ballerat-Busserolles K, Majer V, Gilbert F. 2008. Densities and heat capacities of aqueous arsenious and arsenic acid solutions to 350 °C and 300 bar, and revised thermodynamic properties of As(OH)3°(aq), AsO(OH)3°(aq) and iron sulfarsenide minerals. Geochimica et Cosmochimica Acta 72(3): 713–731. doi: 10.1016/j.gca.2007.11.017

Schulte MD, Shock EL, Wood RH. 2001. The temperature dependence of the standard-state thermodynamic properties of aqueous nonelectrolytes. Geochimica et Cosmochimica Acta 65(21): 3919–3930. doi: 10.1016/S0016-7037(01)00717-7