[CHNOSZ-commits] r352 - in pkg/CHNOSZ: . inst vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 7 07:10:07 CET 2019


Author: jedick
Date: 2019-01-07 07:10:01 +0100 (Mon, 07 Jan 2019)
New Revision: 352

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/vignettes/anintro.Rmd
Log:
anintro.Rmd: add cuprite to mosaic diagram and note about balance = 1


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/DESCRIPTION	2019-01-07 06:10:01 UTC (rev 352)
@@ -1,6 +1,6 @@
-Date: 2018-12-21
+Date: 2019-01-07
 Package: CHNOSZ
-Version: 1.1.3-59
+Version: 1.1.3-60
 Title: Thermodynamic Calculations and Diagrams for Geo(bio)chemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/inst/NEWS	2019-01-07 06:10:01 UTC (rev 352)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.1.3-59 (2018-12-21)
+CHANGES IN CHNOSZ 1.1.3-60 (2019-01-07)
 ---------------------------------------
 
 NEW FEATURES
@@ -126,6 +126,11 @@
   coordinates of lines (field boundaries) on 2-D diagrams (these are
   taken from the output of contourLines()).
 
+DOCUMENTATION
+
+- anintro.Rmd: add cuprite to mosaic diagram example, and note about
+  implications of changing balance to 1.
+
 BUG FIXES
 
 - Fix a bug where subcrt()$reaction$coeffs was incorrect for reactions

Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd	2018-12-21 15:03:57 UTC (rev 351)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd	2019-01-07 06:10:01 UTC (rev 352)
@@ -61,16 +61,14 @@
 
 ## use pngquant to optimize PNG images
 knit_hooks$set(pngquant = hook_pngquant)
+pngquant <- "--speed=1 --quality=0-25"
 # pngquant isn't available on R-Forge ...
-if (!nzchar(Sys.which("pngquant"))) {
-  pngquant <- NULL 
-  # save space by using a lower resolution
-  dpi <- 50
-} else {
-  pngquant <- "--speed=1 --quality=0-25"
-  dpi <- 50
-}
+if (!nzchar(Sys.which("pngquant"))) pngquant <- NULL 
 
+## use a low resolution to save space in the package
+# change this to 72 to make higher-resolution images for the CHNOSZ web page
+dpi <- 50
+
 ## http://stackoverflow.com/questions/23852753/knitr-with-gridsvg
 ## Set up a chunk hook for manually saved plots.
 knit_hooks$set(custom.plot = hook_plot_custom)
@@ -661,7 +659,7 @@
 These diagrams are made by constructing individual diagrams for the possible basis species.
 The individual diagrams are then combined, each one contributing to the final diagram only in the range of stability of the corresponding basis species.
 
-Let's use <span style="color:green">`mosaic()`</span> to make a diagram for aqueous species and minerals in the Cu-S-Cl-`r h2o` system, similar to Figure 5a of @CPCC17.
+Let's use <span style="color:green">`mosaic()`</span> to make a diagram for aqueous species and minerals in the Cu-S-Cl-`r h2o` system.
 To know what aqueous copper chloride complexes are available in the database, we can use a fuzzy search:
 ```{r info_CuCl, results="hide"}
 info(" CuCl")
@@ -677,12 +675,12 @@
 
 Next we define the basis, and set the activities of the H<sub>2</sub>S and Cl<sup>-</sup> basis species.
 These represent the total activity of S and Cl in the system, which are distributed among the minerals and aqueous species.
-Three minerals and the aqueous copper chloride species are included:
+Four minerals and the aqueous copper chloride species are included:
 ```{r copper_setup, echo=TRUE, results="hide"}
 basis(c("Cu", "H2S", "Cl-", "H2O", "H+", "e-"))
 basis("H2S", -6)
 basis("Cl-", -0.7)
-species(c("copper", "tenorite"))
+species(c("copper", "cuprite", "tenorite"))
 species("chalcocite", "cr2")
 species(c("CuCl", "CuCl2-", "CuCl3-2", "CuCl+", "CuCl2", "CuCl3-", "CuCl4-2"))
 ```
@@ -708,6 +706,13 @@
 The smooth transitions between basis species cause the appearance of curved lines on the plot.
 Without that argument, the diagrams would be combined using the dominant basis species, and all of the line segments would be straight.
 
+Note that this diagram is balanced on Cu, so that no Cu appears in reactions between any two other species (minerals or aqueous species).
+If <span style="color:green">`diagram()`</span> is run with `balance = 1`, then the reactions are written for one mole of the mineral formulas on each side of the reaction, with the possibility of Cu appearing as an additional species to conserve the elements.
+This may be problematic, as Cu would be be present in some reactions in Eh-pH space where it is not a stable phase.
+However, it is common in low-temperature aqueous geochemical calculations to "turn off" particular redox reactions that are not thought to attain equilibrium, so decoupling a species from equilibrium may be justified in some circumstances.
+Therefore, while changing the balance constraints has important implications that should be carefully considered, it can present a possibly useful view of the system if certain assumptions are met.
+Changing the balance to 1 results in the loss of the tenorite stability field and extension of chalcocite stability to pH < 0, as shown in Figure 5a of @CPCC17.
+
 <a name="mosaicfun"></a>
 We have seen the effects of speciation of S in the basis species.
 However, the choice of other basis species can also affect the diagram.



More information about the CHNOSZ-commits mailing list