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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 15 05:05:20 CEST 2019


Author: jedick
Date: 2019-04-15 05:05:20 +0200 (Mon, 15 Apr 2019)
New Revision: 440

Added:
   pkg/CHNOSZ/demo/contour.R
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/examples.R
   pkg/CHNOSZ/demo/00Index
   pkg/CHNOSZ/demo/affinity.R
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/examples.Rd
Log:
add demo/contour.R - gold solubility contours on logfO2-pH diagram


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/DESCRIPTION	2019-04-15 03:05:20 UTC (rev 440)
@@ -1,6 +1,6 @@
-Date: 2019-04-13
+Date: 2019-04-15
 Package: CHNOSZ
-Version: 1.3.1-20
+Version: 1.3.1-21
 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/R/examples.R
===================================================================
--- pkg/CHNOSZ/R/examples.R	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/R/examples.R	2019-04-15 03:05:20 UTC (rev 440)
@@ -29,7 +29,7 @@
 
 demos <- function(which=c("sources", "protein.equil", "affinity", "NaCl", "density", 
   "ORP", "revisit", "findit", "ionize", "buffer", "protbuff", "yeastgfp", "glycinate",
-  "mosaic", "copper", "solubility", "gold", "wjd", "bugstab", "Shh", "saturation",
+  "mosaic", "copper", "solubility", "gold", "contour", "wjd", "bugstab", "Shh", "saturation",
   "adenine", "DEW", "lambda", "TCA", "go-IU", "bison", "AkDi"), save.png=FALSE) {
   # run one or more demos from CHNOSZ with ask=FALSE, and return the value of the last one
   for(i in 1:length(which)) {

Modified: pkg/CHNOSZ/demo/00Index
===================================================================
--- pkg/CHNOSZ/demo/00Index	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/demo/00Index	2019-04-15 03:05:20 UTC (rev 440)
@@ -15,6 +15,7 @@
 copper          Another example of mosaic(): complexation of copper with glycine species
 solubility      Solubility of calcite and CO2(gas) as a function of pH
 gold            Solubility of gold
+contour         Gold solubility contours on log fO2 - pH diagram
 wjd             Gibbs energy minimization: prebiological atmospheres and cell periphery of yeast
 dehydration     log K of dehydration reactions; SVG file contains tooltips and links
 bugstab         Formation potential of microbial proteins in colorectal cancer

Modified: pkg/CHNOSZ/demo/affinity.R
===================================================================
--- pkg/CHNOSZ/demo/affinity.R	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/demo/affinity.R	2019-04-15 03:05:20 UTC (rev 440)
@@ -1,6 +1,7 @@
 ## affinities of metabolic reactions
 ## after Amend and Shock, 2001, Fig. 7
-##  Amend, J. P. and Shock, E. L. (2001) Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria. \emph{FEMS Microbiol. Rev.} \bold{25}, 175--243. \url{https://doi.org/10.1016/S0168-6445(00)00062-0}
+##  Amend, J. P. and Shock, E. L. (2001) Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria.
+##  FEMS Microbiol. Rev. 25, 175--243. https://doi.org/10.1016/S0168-6445(00)00062-0
 # use aq state for all basis species (including O2)
 basis(c("CO2", "H2", "NH3", "O2", "H2S", "H+"), "aq")
 # we're going to make H2O
@@ -44,7 +45,8 @@
 
 ## amino acid synthesis at low and high temperatures
 ## after Amend and Shock, 1998
-##  Amend, J. P. and Shock, E. L. (1998) Energetics of amino acid synthesis in hydrothermal ecosystems. \emph{Science} \bold{281}, 1659--1662. \url{https://doi.org/10.1126/science.281.5383.1659}
+##  Amend, J. P. and Shock, E. L. (1998) Energetics of amino acid synthesis in hydrothermal ecosystems.
+##  Science 281, 1659--1662. https://doi.org/10.1126/science.281.5383.1659
 # select the basis species and species of interest
 # and set their activities, first for the 18 degree C case
 basis(c("H2O", "CO2", "NH4+", "H2", "H+", "H2S"),

Added: pkg/CHNOSZ/demo/contour.R
===================================================================
--- pkg/CHNOSZ/demo/contour.R	                        (rev 0)
+++ pkg/CHNOSZ/demo/contour.R	2019-04-15 03:05:20 UTC (rev 440)
@@ -0,0 +1,39 @@
+# CHNOSZ/demo/contour.R
+# gold solubility contours on logfO2-pH diagram
+# 20181107 initial version
+# 20190415 cleanup for demo
+
+# After Williams-Jones et al., 2009, Fig. 3
+# doi:10.2113/gselements.5.5.281
+
+# define temperature (degrees C), pressure (bar), grid resolution
+T <- 250
+P <- 500
+res <- 600
+# make smooth (TRUE) or sharp (FALSE) transitions between basis species 
+blend <- TRUE
+
+# set up system
+basis(c("Au", "Cl-", "H2S", "H2O", "oxygen", "H+"))
+species(c("Au(HS)2-", "AuHS", "AuOH", "AuCl2-"))
+# this get us close to total S = 0.01 m
+basis("H2S", -2)
+# calculate solution composition for 1 mol/kg NaCl
+NaCl <- NaCl(T = T, P = P, m_tot=1)
+basis("Cl-", log10(NaCl$m_Cl))
+# 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)
+# calculate and plot solubility
+s <- solubility(m$A.species)
+diagram(s, type="loga.balance")
+# show predominance fields
+diagram(m$A.bases, add=TRUE, col = "red", col.names = "red", limit.water = FALSE, lty = 2, italic = TRUE)
+diagram(m$A.species, add=TRUE, col = "blue", col.names = "blue", limit.water = FALSE, lwd = 2, bold = TRUE)
+# add legend and title
+dP <- describe.property(c("T", "P"), c(250, 500))
+legend("top", dP, bty = "n")
+dNaCl <- expression(NaCl == 1~mol~kg^-1)
+dS <- expression(sum(S) ~"in basis" == 0.01~mol~kg^-1)
+legend("topright", c(dNaCl, dS), bty = "n")
+title(main = ("After Williams-Jones et al., 2009, Fig. 3"), font.main = 1)

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/inst/NEWS	2019-04-15 03:05:20 UTC (rev 440)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.3.1-20 (2019-04-14)
+CHANGES IN CHNOSZ 1.3.1-21 (2019-04-15)
 ---------------------------------------
 
 - Add thermo/stoich.csv.xz (loaded as thermo()$stoich), containing a
@@ -29,6 +29,8 @@
   entropies of the elements at 298.15 K are not available to check the
   self-consistency of the GHS values for the complexes.
 
+- Add demo/contour.R for gold solubility contours on logfO2-pH diagram.
+
 CHANGES IN CHNOSZ 1.3.1 (2019-03-02)
 ------------------------------------
 

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2019-04-14 03:42:58 UTC (rev 439)
+++ pkg/CHNOSZ/man/examples.Rd	2019-04-15 03:05:20 UTC (rev 440)
@@ -16,8 +16,9 @@
   demos(which = c("sources", "protein.equil", "affinity", "NaCl",
     "density", "ORP", "revisit", "findit", "ionize", "buffer",
     "protbuff", "yeastgfp", "glycinate", "mosaic", "copper",
-    "solubility", "gold", "wjd", "bugstab", "Shh", "saturation",
-    "adenine", "DEW", "lambda", "TCA", "go-IU", "bison", "AkDi"),
+    "solubility", "gold", "contour", "wjd", "bugstab", "Shh",
+    "saturation", "adenine", "DEW", "lambda", "TCA", "go-IU",
+    "bison", "AkDi"),
     save.png=FALSE)
 }
 
@@ -47,6 +48,7 @@
     \code{copper} \tab Another example of \code{\link{mosaic}}: complexation of Cu with glycine (Aksu and Doyle, 2001) \cr
     \code{solubility} \tab Solubility of calcite (cf. Manning et al., 2013) and \CO2 (cf. Stumm and Morgan, 1996) \cr
     \code{gold} \tab Solubility of gold (Akinfiev and Zotov; 2001; Stef{\aacute}nsson and Seward, 2004; Williams-Jones et al., 2009) \cr
+    \code{contour} \tab Gold solubility contours on log fO2 - pH diagram (Williams-Jones et al., 2009) \cr
     \code{wjd} \tab \eqn{G}{G} minimization: prebiological atmospheres (Dayhoff et al., 1964) and cell periphery of yeast \cr
     \code{dehydration} \tab \logK of dehydration reactions; SVG file contains tooltips and links \cr
     \code{bugstab} \tab Formation potential of microbial proteins in colorectal cancer (Dick, 2016) \cr



More information about the CHNOSZ-commits mailing list