[CHNOSZ-commits] r656 - in pkg/CHNOSZ: . demo inst/extdata/OBIGT vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 20 05:55:13 CET 2021


Author: jedick
Date: 2021-03-20 05:55:12 +0100 (Sat, 20 Mar 2021)
New Revision: 656

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/gold.R
   pkg/CHNOSZ/inst/extdata/OBIGT/refs.csv
   pkg/CHNOSZ/vignettes/CHNOSZ.dia
   pkg/CHNOSZ/vignettes/CHNOSZ.png
   pkg/CHNOSZ/vignettes/OBIGT.bib
   pkg/CHNOSZ/vignettes/multi-metal.Rmd
Log:
More adjustments for new solubility() arguments


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2021-03-19 14:33:28 UTC (rev 655)
+++ pkg/CHNOSZ/DESCRIPTION	2021-03-20 04:55:12 UTC (rev 656)
@@ -1,6 +1,6 @@
-Date: 2021-03-19
+Date: 2021-03-20
 Package: CHNOSZ
-Version: 1.4.0-25
+Version: 1.4.0-26
 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/gold.R
===================================================================
--- pkg/CHNOSZ/demo/gold.R	2021-03-19 14:33:28 UTC (rev 655)
+++ pkg/CHNOSZ/demo/gold.R	2021-03-20 04:55:12 UTC (rev 656)
@@ -151,13 +151,13 @@
   basis("H+", "QMK")
   # Estimate solution composition for 1.5 m NaCl and 0.5 m KCl
   chl <- chloride(T = seq(150, 550, 10), P = 1000, m_NaCl = 1.5, m_KCl = 0.5)
-#  # Calculate affinity and solubility, considering speciation of sulfur
-#  bases <- c("H2S", "HS-", "SO4-2", "HSO4-")
-#  m <- mosaic(bases, T = seq(150, 550, 10), `Cl-` = log10(chl$m_Cl), `K+` = log10(chl$m_K), P = 1000, IS = chl$IS)
-#  s <- solubility(m$A.species)
+  # Calculate solubility of gold
   species("Au")
   iaq <- info(c("Au(HS)2-", "AuHS", "AuOH", "AuCl2-"))
   s <- solubility(iaq, T = seq(150, 550, 10), `Cl-` = log10(chl$m_Cl), `K+` = log10(chl$m_K), P = 1000, IS = chl$IS)
+#  # Uncomment to calculate solubility considering speciation of sulfur
+#  bases <- c("H2S", "HS-", "SO4-2", "HSO4-")
+#  s <- solubility(iaq, bases = bases, T = seq(150, 550, 10), `Cl-` = log10(chl$m_Cl), `K+` = log10(chl$m_K), P = 1000, IS = chl$IS)
   # Make diagram and show total log molality
   diagram(s, ylim = c(-10, -3), col = col, lwd = 2, lty = 1)
   diagram(s, add = TRUE, type = "loga.balance", lwd = 3, lty = 2)

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/refs.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/refs.csv	2021-03-19 14:33:28 UTC (rev 655)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/refs.csv	2021-03-20 04:55:12 UTC (rev 656)
@@ -202,6 +202,7 @@
 SHA14.3,"D. A. Sverjensky et al.",2014,"Geochim. Cosmochim. Acta 129, 125-145","Fitted to @HP97 data with a<sub>1</sub> pred. from the sum of the ions and used to predict the volume",https://doi.org/10.1016/j.gca.2013.12.019
 SHA14.4,"D. A. Sverjensky et al.",2014,"Geochim. Cosmochim. Acta 129, 125-145","BO<sub>2</sub><sup>-</sup>: revised a<sub>1</sub>-a<sub>4</sub> using delkappan for BO<sub>2</sub><sup>-</sup> instead of B(OH)<sub>4</sub><sup>-</sup> used by @SH88; @SSWS97",https://doi.org/10.1016/j.gca.2013.12.019
 PD15,"G. S. Pokrovski and J. Dubessy",2015,"Earth Planet. Sci. Lett. 411, 298-309","trisulfur radical ion",https://doi.org/10.1016/j.epsl.2014.11.035
+LA16,"D. E. LaRowe and J. P. Amend",2016,"ISME J. 10, 1285-1295","fatty acids and saccharides",https://doi.org/10.1038/ismej.2015.227
 SLOP16.1,"E. L. Shock et al.",2016,"slop16.dat computer data file",""Enthalpy changed to be compatible with the equation ΔH=ΔG+TΔS for the formation reaction from elements."",https://doi.org/10.5281/zenodo.2630820
 SLOP16.2,"E. L. Shock et al.",2016,"slop16.dat computer data file","Zn(Ac)<sub>3</sub><sup>-</sup>: "Enthalpy changed to be compatible with the equation ΔH=ΔG+TΔS for the formation reaction from elements. See footnote h in table 2 of @SSH97."",https://doi.org/10.5281/zenodo.2630820
 SLOP16.3,"E. L. Shock et al.",2016,"slop16.dat computer data file","formaldehyde: "Entropy corrected to be compatible with the equation ΔH=ΔG+TΔS for the formation reaction from elements. See footnote i in table 2 of @SS93."",https://doi.org/10.5281/zenodo.2630820

Modified: pkg/CHNOSZ/vignettes/CHNOSZ.dia
===================================================================
(Binary files differ)

Modified: pkg/CHNOSZ/vignettes/CHNOSZ.png
===================================================================
(Binary files differ)

Modified: pkg/CHNOSZ/vignettes/OBIGT.bib
===================================================================
--- pkg/CHNOSZ/vignettes/OBIGT.bib	2021-03-19 14:33:28 UTC (rev 655)
+++ pkg/CHNOSZ/vignettes/OBIGT.bib	2021-03-20 04:55:12 UTC (rev 656)
@@ -298,6 +298,17 @@
   doi       = {10.1007/s00239-014-9616-1},
 }
 
+ at Article{LA16,
+  author    = {LaRowe, Douglas E. and Amend, Jan P.},
+  journal   = {ISME Journal},
+  title     = {The energetics of anabolism in natural settings},
+  year      = {2016},
+  number    = {6},
+  pages     = {1285--1295},
+  volume    = {10},
+  doi       = {10.1038/ismej.2015.227},
+}
+
 @Article{LD12,
   author    = {LaRowe, Douglas E. and Dick, Jeffrey M.},
   journal   = {Geochimica et Cosmochimica Acta},

Modified: pkg/CHNOSZ/vignettes/multi-metal.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/multi-metal.Rmd	2021-03-19 14:33:28 UTC (rev 655)
+++ pkg/CHNOSZ/vignettes/multi-metal.Rmd	2021-03-20 04:55:12 UTC (rev 656)
@@ -790,8 +790,8 @@
 ```
 
 The resulting diagram is similar to Figure 2 of @Sve87; that diagram also shows calculations of the solubility of Cu and concentration of SO~4~^-2^ in model Cu ore-forming fluids.
-The `solubility()` function can be used to make these calculations.
-By combining it with the output of `mosaic()`, we use the solubilities of the stable minerals across the diagram to calculate the total concentration of Cu in solution, including its complexes.
+The `solubility()` function can be used to calculate the total concentration of Cu in different complexes in solution (listed in the `iaq` argument).
+The `bases` argument triggers a `mosaic()` calculation, so that the solubility corresponds that that of stable minerals at each point on the diagram.
 The pH for these calculations is set to 6, and the molality of free Cl^-^, which affects the formation of the Cu chloride complexes, is estimated based on the composition of fluids from Table 2 of @Sve87 (ca. 80000 mg Cl / kg H~2~O) and the `NaCl()` function in CHNOSZ.
 This also gives an estimated ionic strength, which is used in the following `mosaic()` and `affinity()` calls to calculate activity coefficients.
 
@@ -798,11 +798,8 @@
 <button id="B-solubility" onclick="ToggleDiv('solubility')">Show code</button>
 <div id="D-solubility" style="display: none">
 ```{r solubility, eval = FALSE}
-# Set up plot and system with aqueous Cu species
 par(mfrow = c(1, 3))
 basis("pH", 6)
-iCu.aq <- retrieve("Cu", c("O", "H", "Cl", "S"), "aq")
-species(iCu.aq)
 # Estimate the molality of Cl for ca. 80,000 mg/kg solution (Table 2 of Sverjensky, 1987)
 m_tot <- 80000 / mass("Cl") / 1000
 calc <- NaCl(T = T, m_tot = m_tot)
@@ -809,13 +806,14 @@
 # Use log molality here, not log activity, because
 # activity coefficients are calculated by setting IS below
 basis("Cl-", log10(calc$m_Cl))
+# Dissolve copper to form aqueous Cu complexes
+species("copper")
+iaq <- retrieve("Cu", c("O", "H", "Cl", "S"), "aq")
 
-# Calculate affinities for aqueous Cu species while changing both Fe and Cu minerals
+# Function to calculate solubility of Cu for stable assemblages of Fe and Cu minerals
 mfun <- function() {
-  mFeCu <- mosaic(list(bFe, bCu), S2 = c(-34, -10, res1), O2 = c(-55, -40, res1),
+  s <- solubility(iaq, bases = list(bFe, bCu), S2 = c(-34, -10, res1), O2 = c(-55, -40, res1),
     T = T, IS = calc$IS, stable = list(dFe$predominant, dCu$predominant))
-  # Calculate concentration of Cu
-  s <- solubility(mFeCu$A.species)
   s <- convert(s, "ppm")
   diagram(aFeCu, names = NA, col = "gray", fill = fill)
   diagram(s, type = "loga.balance", levels = 10^(-3:3), add = TRUE)
@@ -849,11 +847,13 @@
 CuCl3 <- expr.species("CuCl3-2")
 title(bquote("Helgeson (1969)"~.(CuCl2)~and~.(CuCl3)), line = 0.9)
 
-# Set up system with SO4-2 (to dissolve S2(gas))
-species("SO4-2")
-aSO4 <- affinity(S2 = c(-34, -10, res1), O2 = c(-55, -40, res1), T = T, IS = calc$IS)
+# Set up system to dissolve S2(gas)
+basis(c("S2", "copper", "hematite", "oxygen", "H2O", "H+", "Cl-"))
+basis("pH", 6)
+species("S2")
 # Calculate concentration of SO4-2
-s <- solubility(aSO4, in.terms.of = "SO4-2")
+iaq <- info("SO4-2")
+s <- solubility(iaq, S2 = c(-34, -10, res1), O2 = c(-55, -40, res1), T = T, IS = calc$IS, in.terms.of = "SO4-2")
 s <- convert(s, "ppm")
 # DIAGRAM 3
 diagram(aFeCu, names = NA, col = "gray", fill = fill)



More information about the CHNOSZ-commits mailing list