[CHNOSZ-commits] r76 - in pkg/CHNOSZ: . R data inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 1 18:01:55 CET 2015


Author: jedick
Date: 2015-03-01 18:01:52 +0100 (Sun, 01 Mar 2015)
New Revision: 76

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/subcrt.R
   pkg/CHNOSZ/data/opt.csv
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/data.Rd
   pkg/CHNOSZ/man/subcrt.Rd
Log:
add thermo$opt$varP to use variable-pressure standard state for gases


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/DESCRIPTION	2015-03-01 17:01:52 UTC (rev 76)
@@ -1,12 +1,12 @@
-Date: 2015-02-15
+Date: 2015-03-01
 Package: CHNOSZ
-Version: 1.0.3-13
+Version: 1.0.3-14
 Title: Chemical Thermodynamics and Activity Diagrams
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>
 Depends: R (>= 2.12.0)
 Suggests: limSolve, parallel, testthat, knitr
-Description: This package includes functions and data sets to support chemical thermodynamic 
+Description: A set of functions and data sets to support chemical thermodynamic 
   modeling in biochemistry and low-temperature geochemistry. The features include calculation
   of the standard molal thermodynamic properties and chemical affinities of reactions involving 
   minerals and/or biomolecules; a database of thermodynamic properties of aqueous, crystalline 

Modified: pkg/CHNOSZ/R/subcrt.R
===================================================================
--- pkg/CHNOSZ/R/subcrt.R	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/R/subcrt.R	2015-03-01 17:01:52 UTC (rev 76)
@@ -360,6 +360,12 @@
     out <- c(out,rep(p.H2O,length(which(isH2O==TRUE))))
   }
 
+  # use variable-pressure standard Gibbs energy for gases
+  isgas <- reaction$state %in% "gas" 
+  if(TRUE %in% isgas & "g" %in% eprop & thermo$opt$varP) {
+    for(i in which(isgas)) out[[i]]$G <- out[[i]]$G - convert(log10(P), "G", T=T)
+  }
+
   # logK
   if('logk' %in% prop) {
     for(i in 1:length(out)) {

Modified: pkg/CHNOSZ/data/opt.csv
===================================================================
--- pkg/CHNOSZ/data/opt.csv	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/data/opt.csv	2015-03-01 17:01:52 UTC (rev 76)
@@ -1,2 +1,2 @@
-Tr,Pr,Theta,Psi,R,cutoff,E.units,T.units,P.units,state,water,G.tol,Cp.tol,V.tol
-298.15,1,228,2600,1.9872,1e-10,cal,C,bar,aq,SUPCRT92,100,1,1
+Tr,Pr,Theta,Psi,R,cutoff,E.units,T.units,P.units,state,water,G.tol,Cp.tol,V.tol,varP
+298.15,1,228,2600,1.9872,1e-10,cal,C,bar,aq,SUPCRT92,100,1,1,FALSE

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/inst/NEWS	2015-03-01 17:01:52 UTC (rev 76)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.0.3-13 (2015-02-15)
+CHANGES IN CHNOSZ 1.0.3-14 (2015-03-01)
 ---------------------------------------
 
 - Add files with average amino acid compositions of proteins from Bison
@@ -45,6 +45,11 @@
 - In test-diagram.R, test that same diagrams are produced using
   'as.residue' in equilibrate() or diagram().
 
+- Add 'tplot' argument to diagram().
+
+- Add thermo$opt$varP option as a flag for subcrt() to calculate Gibbs
+  energies of gases using a variable-pressure standard state.
+
 CHANGES IN CHNOSZ 1.0.3 (2014-01-12)
 ------------------------------------
 

Modified: pkg/CHNOSZ/man/data.Rd
===================================================================
--- pkg/CHNOSZ/man/data.Rd	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/man/data.Rd	2015-03-01 17:01:52 UTC (rev 76)
@@ -54,6 +54,7 @@
       \code{G.tol} \tab numeric \tab Absolute difference between tabulated and calculated value of G above which \code{\link{checkGHS}} produces a message (cal mol\eqn{^{-1}}{^-1}).\cr
       \code{Cp.tol} \tab numeric \tab Absolute difference between tabulated and calculated value of Cp above which \code{\link{checkEOS}} produces a message (cal K\eqn{^{-1}}{-1} mol\eqn{^{-1}}{^-1}).\cr
       \code{V.tol} \tab numeric \tab Absolute difference between tabulated and calculated value of V above which \code{\link{checkEOS}} produces a message (cm\eqn{^{3}}{3} mol\eqn{^{-1}}{^-1}).\cr
+      \code{varP} \tab logical \tab Use variable-pressure standard state for gases (default \code{FALSE})? See \code{\link{subcrt}}.\cr
 }
 
     \item \code{thermo$element}

Modified: pkg/CHNOSZ/man/subcrt.Rd
===================================================================
--- pkg/CHNOSZ/man/subcrt.Rd	2015-02-15 06:42:50 UTC (rev 75)
+++ pkg/CHNOSZ/man/subcrt.Rd	2015-03-01 17:01:52 UTC (rev 76)
@@ -72,9 +72,11 @@
 However, \code{NA}s may be produced in the output of \code{subcrt} if the requisite thermodynamic or electrostatic properties of water can not be calculated at given conditions.
 Specifically, \code{NA}s are produced for calculations at \samp{Psat} when the temperature exceeds the critical temperature of H2O.
 
-
 For calculations below 273.16 K, the pressure should be set to 1, as Psat is not defined in these conditions.
 
+If \code{thermo$opt$varP} is \code{TRUE}, standard Gibbs energies of gases will be converted from a standard state at 1 bar (as used in SUPCRT) to a variable pressure standard state (see chapter 12 in Anderson and Crerar, 1993).
+This is useful for constructing e.g. boiling curves for organic compounds.
+
 }
 
 \section{Warning}{
@@ -269,6 +271,8 @@
 }
 
 \references{
+  Anderson, G. M. and Crerar, D. A. (1993) \emph{Thermodynamics in Geochemistry: The Equilibrium Model}, Oxford University Press. \url{http://www.worldcat.org/oclc/803272549}
+
   Johnson, J. W., Oelkers, E. H. and Helgeson, H. C. (1992) SUPCRT92: A software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000\eqn{^{\circ}}{°}C. \emph{Comp. Geosci.} \bold{18}, 899--947. \url{http://dx.doi.org/10.1016/0098-3004(92)90029-Q}
 
   LaRowe, D. E. and Helgeson, H. C. (2007) Quantifying the energetics of metabolic reactions in diverse biogeochemical systems: electron flow and ATP synthesis. \emph{Geobiology} \bold{5}, 153--168. \url{http://dx.doi.org/10.1111/j.1472-4669.2007.00099.x}



More information about the CHNOSZ-commits mailing list