[CHNOSZ-commits] r873 - in pkg/CHNOSZ: . demo inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 15 12:05:16 CET 2025


Author: jedick
Date: 2025-02-15 12:05:15 +0100 (Sat, 15 Feb 2025)
New Revision: 873

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/contour.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/man/examples.Rd
Log:
Add optional data and update conditions in demo/contour.R


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2025-02-15 07:43:39 UTC (rev 872)
+++ pkg/CHNOSZ/DESCRIPTION	2025-02-15 11:05:15 UTC (rev 873)
@@ -1,6 +1,6 @@
 Date: 2025-02-15
 Package: CHNOSZ
-Version: 2.1.0-44
+Version: 2.1.0-45
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/demo/contour.R
===================================================================
--- pkg/CHNOSZ/demo/contour.R	2025-02-15 07:43:39 UTC (rev 872)
+++ pkg/CHNOSZ/demo/contour.R	2025-02-15 11:05:15 UTC (rev 873)
@@ -1,47 +1,64 @@
 # CHNOSZ/demo/contour.R
 # Gold solubility contours on logfO2-pH diagram
-# After Williams-Jones et al., 2009, Fig. 3
-# doi:10.2113/gselements.5.5.281
+# After Williams-Jones et al. (2009) doi:10.2113/gselements.5.5.281
+#   and Ding et al. (2023) doi:10.1016/j.oregeorev.2022.105231
+#   with optional data from Tagirov et al. (2024) doi:10.1016/j.gca.2024.08.022
 # 20181107 initial version
 # 20190415 cleanup for demo
+# 20250215 add IGEM data and adjust conditions to reproduce plot from Ding et al.
+
 library(CHNOSZ)
 
-# Define temperature (degrees C), pressure (bar), grid resolution
+# Define plot resolution
+res <- 600
+# Define temperature (degrees C), pressure (bar)
 T <- 250
-P <- 500
-res <- 600
+P <- 300
+# Define molality of NaCl and total S
+m_NaCl <- 1
+sum_S <- 0.01
+# Define ranges of pH and logfO2
+pH <- c(1, 10)
+O2 <- c(-40, -30)
 # Make smooth (TRUE) or sharp (FALSE) transitions between basis species 
 blend <- TRUE
 
-# Set up system
-basis(c("Au", "Cl-", "H2S", "H2O", "oxygen", "H+"))
-iaq <- info(c("Au(HS)2-", "AuHS", "AuOH", "AuCl2-"))
-species(iaq)
-# This gets us close to total S = 0.01 m
-basis("H2S", -2)
-# Calculate solution composition for 1 mol/kg NaCl
-NaCl <- NaCl(m_NaCl = 1, T = T, P = P)
-basis("Cl-", log10(NaCl$m_Clminus))
-# Calculate affinity with changing basis species
-bases <- c("H2S", "HS-", "HSO4-", "SO4-2")
-m <- mosaic(bases, pH = c(2, 10, res), O2 = c(-41, -29, res), T = T, P = P, IS = NaCl$IS, blend = blend)
-# Show predominance fields for S-species
-diagram(m$A.bases, col = 8, col.names = 8, lty = 2, italic = TRUE)
-# Show predominance fields for Au-species
-# Plot multiple times to get deeper color
-diagram(m$A.species, add=TRUE, col = 7, col.names = 7, lwd = 2, bold = TRUE)
-diagram(m$A.species, add=TRUE, col = 7, col.names = 7, lwd = 2, bold = TRUE)
-diagram(m$A.species, add=TRUE, col = 7, col.names = 7, lwd = 2, bold = TRUE)
+for(i in 1:2) {
 
-# Calculate and plot solubility of Au (use named 'bases' argument to trigger mosaic calculation)
-species("Au")
-s <- solubility(iaq, bases = bases, pH = c(2, 10, res), O2 = c(-41, -29, res), T = T, P = P, IS = NaCl$IS, blend = blend)
-# Convert to ppb
-s <- convert(s, "ppb")
-diagram(s, levels = c(1, 10, 100, 1000), add = TRUE)
-# Add legend and title
-dP <- describe.property(c("T", "P"), c(250, 500))
-legend("top", dP, bty = "n", inset = c(0, 0.06))
-lx <- lex(lNaCl(1), lS(0.01))
-legend("topright", lx, bty = "n", inset = c(0.1, 0.05))
-title(main = ("Solubility of gold (ppb), after Williams-Jones et al., 2009, Fig. 3"), font.main = 1)
+  # Use the default database for the first diagram
+  if(i == 1) reset()
+  # Use IGEM data for the second diagram
+  if(i == 2) add.OBIGT("IGEM")
+
+  # Set up system
+  basis(c("Au", "Cl-", "H2S", "H2O", "oxygen", "H+"))
+  iaq <- retrieve("Au", c("H", "O", "S", "Cl"), state = "aq")
+  species(iaq)
+  basis("H2S", log10(sum_S))
+  # Calculate solution composition for given NaCl molality
+  NaCl <- NaCl(m_NaCl = m_NaCl, T = T, P = P)
+  basis("Cl-", log10(NaCl$m_Clminus))
+  # Calculate affinity with changing basis species across diagram
+  bases <- c("H2S", "HS-", "HSO4-", "SO4-2")
+  m <- mosaic(bases, pH = c(pH, res), O2 = c(O2, res), T = T, P = P, IS = NaCl$IS, blend = blend)
+  # Show predominance fields for S-species
+  diagram(m$A.bases, col = 8, col.names = 8, lty = 3, italic = TRUE)
+  # Show predominance fields for Au-species
+  d <- diagram(m$A.species, col = 4, col.names = 4, lty = 2, bold = TRUE, add = TRUE)
+  # Add dot-dash line for water stability limit
+  water.lines(d, lty = 4)
+
+  # Calculate and plot solubility of Au (use named 'bases' argument to trigger mosaic calculation)
+  species("Au")
+  s <- solubility(iaq, bases = bases, pH = c(pH, res), O2 = c(O2, res), T = T, P = P, IS = NaCl$IS, blend = blend)
+  # Convert to ppb
+  s <- convert(s, "ppb")
+  diagram(s, levels = c(1, 10, 100, 1000), col = 1, add = TRUE)
+  # Add legend and title
+  dP <- describe.property(c("T", "P"), c(T, P))
+  lexpr <- lex(dP, lNaCl(m_NaCl), lS(sum_S))
+  legend("topright", lexpr, bty = "n")
+  if(i == 1) title(main = ("Gold solubility (ppb), after Ding et al., 2023 (default data)"), font.main = 1)
+  if(i == 2) title(main = ("Gold solubility (ppb), after Ding et al., 2023 (optional data)"), font.main = 1)
+
+}

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2025-02-15 07:43:39 UTC (rev 872)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2025-02-15 11:05:15 UTC (rev 873)
@@ -15,7 +15,7 @@
 \newcommand{\Cp}{\ifelse{latex}{\eqn{C_P}}{\ifelse{html}{\out{<I>C<sub>P</sub></I>}}{Cp}}}
 \newcommand{\DG0}{\ifelse{latex}{\eqn{{\Delta}G^{\circ}}}{\ifelse{html}{\out{Δ<I>G</I>°}}{ΔG°}}}
 
-\section{Changes in CHNOSZ version 2.1.0-44 (2025-02-15)}{
+\section{Changes in CHNOSZ version 2.1.0-45 (2025-02-15)}{
 
   \subsection{OBIGT DEFAULT DATA}{
     \itemize{
@@ -39,7 +39,7 @@
       \item Add Pd(HS)\s{4}\S{-2} and Pt(HS)\s{4}\S{-2} from
       \href{https://doi.org/10.1016/j.gca.2024.12.019}{Laskar et al. (2024)}.
 
-      \item Add Sn chloride complexes and updated parameters for Sn\S{+2},
+      \item Add Sn chloride complexes and updated parameters for Sn\S{+2} and
       Th\S{+4} from \href{https://doi.org/10.1016/j.gsf.2023.101624}{Liu et al.
         (2023)}.
 
@@ -100,6 +100,11 @@
       \item Revise \file{demo/sum_S.R} for log \emph{f}O\s{2} - log \emph{m} ΣS
       diagram and add solubility contours for Fe and Au.
 
+      \item Update \file{demo/contour.R} to use conditions taken from
+      \href{https://doi.org/10.1016/j.oregeorev.2022.105231}{Ding et al.
+        (2023)} and optional data for Au species from IGEM RAS, including
+      polynuclear Au\s{2}S\s{2}\S{-2}.
+
     }
   }
 

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2025-02-15 07:43:39 UTC (rev 872)
+++ pkg/CHNOSZ/man/examples.Rd	2025-02-15 11:05:15 UTC (rev 873)
@@ -47,7 +47,7 @@
     \item{arsenic}{Another example of \code{\link{mosaic}}: Eh-pH diagram for the system As-O-H-S (Lu and Zhu, 2011)}
     \item{solubility}{Solubility of calcite (cf. Manning et al., 2013) and \CO2 (cf. Stumm and Morgan, 1996)}
     \item{gold}{Solubility of gold (Akinfiev and Zotov; 2001; Stef{\aacute}nsson and Seward, 2004; Williams-Jones et al., 2009)}
-    \item{contour}{Gold solubility contours on a log fO2 - pH diagram (Williams-Jones et al., 2009)}
+    \item{contour}{Gold solubility contours on a log fO2 - pH diagram (Ding et al., 2023)}
     \item{sphalerite}{Solubility of sphalerite (Akinfiev and Tagirov, 2014)}
     \item{minsol}{Solubilities of multiple minerals}
     \item{dehydration}{\logK of dehydration reactions; SVG file contains tooltips and links}
@@ -117,6 +117,8 @@
 
 Dick, J. M. (2015) Chemical integration of proteins in signaling and development. \emph{bioRxiv}. \doi{10.1101/015826}
 
+Ding, Z., Sun, X., Hu, S., Chen, H., Li, D., Fu, Y., Xu, L., Wu, Z., and Huang, F.. (2023) Role of carbonaceous material in gold precipitation for orogenic gold deposits: A case study of the Bangbu gold deposit in southern Tibet, China. \emph{Ore Geol. Rev.} \bold{152}, 105231. \doi{10.1016/j.oregeorev.2022.105231}
+
 Garrels, R. M. and Christ, C. L. (1965) \emph{Solutions, Minerals, and Equilibria}, Harper & Row, New York, 450 p. \url{https://www.worldcat.org/oclc/517586}
 
 Guan, Q., Mei, Y., Etschmann, B., Testemale, D., Louvel, M. and Brugger, J. (2020) Yttrium complexation and hydration in chloride-rich hydrothermal fluids: A combined \emph{ab initio} molecular dynamics and \emph{in situ} X-ray absorption spectroscopy study. \emph{Geochim. Cosmochim. Acta} \bold{281}, 168--189. \doi{10.1016/j.gca.2020.04.015}



More information about the CHNOSZ-commits mailing list