[CHNOSZ-commits] r289 - in pkg/CHNOSZ: . man man/macros

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 11 03:20:33 CET 2017


Author: jedick
Date: 2017-11-11 03:20:33 +0100 (Sat, 11 Nov 2017)
New Revision: 289

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/man/CHNOSZ-package.Rd
   pkg/CHNOSZ/man/basis.Rd
   pkg/CHNOSZ/man/examples.Rd
   pkg/CHNOSZ/man/macros/macros.Rd
   pkg/CHNOSZ/man/nonideal.Rd
   pkg/CHNOSZ/man/subcrt.Rd
   pkg/CHNOSZ/man/util.water.Rd
Log:
document discontinuity in demo(NaCl); add \Psat to macros.Rd


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/DESCRIPTION	2017-11-11 02:20:33 UTC (rev 289)
@@ -1,6 +1,6 @@
 Date: 2017-11-11
 Package: CHNOSZ
-Version: 1.1.0-86
+Version: 1.1.0-87
 Title: Thermodynamic Calculations for Geobiochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
@@ -8,8 +8,6 @@
     person("R Core Team", role = "ctb",
       comment = "code derived from R's pmax()")
     )
-Author: Jeffrey Dick [aut, cre],
-  R Core Team [ctb]
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>
 Depends: R (>= 3.1.0)
 Suggests: limSolve, testthat, knitr, rmarkdown, tufte, RSVGTipsDevice

Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd
===================================================================
--- pkg/CHNOSZ/man/CHNOSZ-package.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/CHNOSZ-package.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -10,11 +10,9 @@
 
 \section{Warm Tips}{
   \itemize{
-    \item Be sure to check out the vignette titled \emph{An Introduction to CHNOSZ}. Run \code{\link{help.start}()}, select \sQuote{Packages} then \sQuote{CHNOSZ} followed by \sQuote{User guides, package vignettes and other documentation}.
-    \item Running the examples from the help pages is a good way to become more familiar with the usage of the functions. After running \code{help.start()}, select \sQuote{Packages} then \sQuote{CHNOSZ} and then select a function of interest. Individual examples can be run by pasting the example block into the \R window.
+    \item To view the manual, run \code{help.start()} then select \sQuote{Packages} and \sQuote{CHNOSZ}. Examples in the function help pages can be run by pasting the code block into the \R console.
+    \item Be sure to check out the vignette titled \emph{An Introduction to CHNOSZ}, which is available by following the link in \code{help.start} to \sQuote{User guides, package vignettes and other documentation}.
     \item Run the command \code{\link{examples}()} to run all of the examples provided in CHNOSZ. This should take about a minute.
-    \item Also try out \code{\link{demos}()} to run the demos (longer examples that are not part of the main help pages).
-    \item To learn how to update the thermodynamic database, look at \code{\link{add.obigt}}.
   }
 }
 

Modified: pkg/CHNOSZ/man/basis.Rd
===================================================================
--- pkg/CHNOSZ/man/basis.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/basis.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -4,8 +4,6 @@
 \title{Define Basis Species}
 \description{
 Define the basis species of a chemical system.
-Change their physical states or chemical activities or fugacities.
-Get the reaction coefficients of basis species in formation reactions of species.
 }
 
 \usage{
@@ -20,8 +18,6 @@
 }
 
 \details{
-\code{basis} is used to define the basis species in a thermodynamic system.
-
 The basis species represent the possible range of chemical compositions for all the species of interest.
 Any valid set of basis species used here must meet two conditions: 1) the number of basis species is the same as the number of chemical elements (including charge) in those species and 2) the square matrix representing the elemental stoichiometries of the basis species has a real inverse.
 
@@ -37,9 +33,7 @@
 
 Whenever \code{basis} is called with NULL values of both \code{state} and \code{logact}, the new set of species, if they are a valid basis set, completely replaces any existing basis definition.
 If this occurs, any existing species definition (created by the \code{species} function) is deleted.
-However, \code{\link{swap.basis}} can be used to change the species (the compositions and/or physical states thereof) in the basis set while maintaining the list of species of interest, with the added benefit of equivalence of the chemical potentials of the elements before and after the swap.
-
-Call \code{basis} with \code{delete} set to TRUE or code{species} set to \code{""} to clear the basis definition.
+Call \code{basis} with \code{delete} set to TRUE or \code{species} set to \samp{""} to clear the basis definition.
 This also deletes the \code{\link{species}} list, if any.
 
 If the value of \code{basis} is one of the keywords in the following table, the corresponding set of basis species is loaded, and their activities are given preset values.
@@ -66,10 +60,6 @@
 Returns the value of \code{thermo$basis} after any modifications; or, if \code{delete} is TRUE, its value before deletion (invisibly).
 }
 
-\section{Side Effects}{
-If the new basis definition meets all requirements, it is stored in \code{\link{thermo}$basis}, replacing any previous basis definition.
-}
-
 \seealso{
   \code{\link{info}} to query the thermodynamic database in order to find what species are available. 
   \code{\link{makeup}} is used by \code{basis} to generate the stoichiometric matrix from chemical formulas.

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/examples.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -70,6 +70,11 @@
 The proteins in the calculation are 24 carboxylases from a variety of organisms.
 There are 12 ribulose phosphate carboxylase and 12 acetyl-coenzyme A carboxylase; 6 of each type are from nominally mesophilic organisms and 6 from nominally thermophilic organisms, shown as blue and red symbols on the diagrams.
 The activities of hydrogen at each temperature are calculated using \eqn{\log a_{\mathrm{H_{2}}_{\left(aq\right)}}=-11+3/\left(40\times T\left(^{\circ}C\right)\right)}{logaH2 = -11 + 3/40 * T(degC)}; this equation comes from a model of relative stabilities of proteins in a hot-spring environment (Dick and Shock, 2011).
+
+In the \samp{NaCl} demo, the \logK lines calculated at \Psat and P=500 bar show discontinuities at 355 \degC.
+Although not realistic, this behavior is consistent with the output of \acronym{SUPCRT92} (Johnson et al., 1992) at 500 bar.
+This is probably due to a transition between different regimes for the properties of water as coded in SUPCRT's \code{H2O92D.F}, which is used by CHNOSZ.
+(Note that SUPCRT does not output thermodynamic properties above 350 \degC at \Psat; see Warning in \code{\link{subcrt}}.)
 }
 
 \references{
@@ -95,6 +100,8 @@
 
 Garrels, R. M. and Christ, C. L. (1965) \emph{Solutions, Minerals, and Equilibria}, Harper & Row, New York, 450 p. \url{http://www.worldcat.org/oclc/517586}
 
+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\degC. \emph{Comp. Geosci.} \bold{18}, 899--947. \url{https://doi.org/10.1016/0098-3004(92)90029-Q}
+
 Lowe, A. R., Cox, J. S. and Tremaine, P. R. (2017) Thermodynamics of aqueous adenine: Standard partial molar volumes and heat capacities of adenine, adeninium chloride, and sodium adeninate from \emph{T} = 278.15 K to 393.15 K. \emph{J. Chem. Thermodyn.} \bold{112}, 129--145. \url{https://doi.org/10.1016/j.jct.2017.04.005}
   
 Manning, C. E., Shock, E. L. and Sverjensky, D. A. (2013) The chemistry of carbon in aqueous fluids at crustal and upper-mantle conditions: Experimental and theoretical constraints. \emph{Rev. Mineral. Geochem.} \bold{75}, 109--148. \url{https://doi.org/10.2138/rmg.2013.75.5}

Modified: pkg/CHNOSZ/man/macros/macros.Rd
===================================================================
--- pkg/CHNOSZ/man/macros/macros.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/macros/macros.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -36,3 +36,4 @@
 \newcommand{\degC}{\ifelse{latex}{\eqn{^{\circ}}C}{\ifelse{html}{\out{°}C}{°C}}}
 \newcommand{\le}{\ifelse{latex}{\eqn{\le}}{\ifelse{html}{\out{≤}}{≤}}}
 \newcommand{\ge}{\ifelse{latex}{\eqn{\ge}}{\ifelse{html}{\out{≥}}{≥}}}
+\newcommand{\Psat}{\ifelse{latex}{\eqn{P_{\mathrm{SAT}}}}{\ifelse{html}{\out{<i>P</i><sub>SAT</sub>}}{Psat}}}

Modified: pkg/CHNOSZ/man/nonideal.Rd
===================================================================
--- pkg/CHNOSZ/man/nonideal.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/nonideal.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -46,7 +46,7 @@
 Currently, \samp{G} is the only adjusted molal property that is calculated (but this can be used by \code{\link{subcrt}} to calculate adjusted equilibrium constants).
 
 \code{Bdot} calculates the \dQuote{B-dot} deviation function (Helgeson, 1969) a.k.a. extended term parameter (written as b_gamma; Helgeson et al., 1981) for activity coefficients in NaCl solutions at high temperature and pressure.
-Data at Psat and 0.5 to 5 kb are taken from Helgeson (1969, Table 2 and Figure 3) and Helgeson et al. (1981, Table 27) and extrapolated values at 10 to 30 kb from Manning et al. (2013, Figure 11).
+Data at \Psat and 0.5 to 5 kb are taken from Helgeson (1969, Table 2 and Figure 3) and Helgeson et al. (1981, Table 27) and extrapolated values at 10 to 30 kb from Manning et al. (2013, Figure 11).
 Furthermore, the 10 to 30 kb data were used to generate super-extrapolated values at 40, 50, and 60 kb, which may be encountered using the \code{\link{water.DEW}} calculations.
 If all \code{P} correspond to one of the isobaric conditions, the values of \code{Bdot} at \code{T} are calculated by spline fits to the isobaric data.
 Otherwise, particular (dependent on the \code{T}) isobaric spline fits are themselves used to construct isothermal splines for the given values of \code{T}; the isothermal splines are then used to generate the values of \code{Bdot} for the given \code{P}.

Modified: pkg/CHNOSZ/man/subcrt.Rd
===================================================================
--- pkg/CHNOSZ/man/subcrt.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/subcrt.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -87,17 +87,16 @@
 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.
+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}{
-Comparison of the output of \code{subcrt} with that of \acronym{SUPCRT92} indicates the two give similar values of properties for neutral aqueous species up to 1000 \degC and 5000 bar.
-Changes were made in CHNOSZ 0.9-9 to improve the calculation of the \eqn{g}{g}- and \eqn{f}{f}-functions (Shock et al., 1992) for the partial derivatives of the omega parameter which are used by the \code{\link{hkf}} function, so thermodynamic properties of charged aqueous species over the temperature range 0 to 1000 \degC are now mostly consistent with \acronym{SUPCRT92}.
-Note, however, that while \acronym{SUPCRT92} limits calculations at Psat to 350 \degC (\dQuote{beyond range of applicability of aqueous species equations}), there is no corresponding limit in place in \code{subcrt} (or \code{\link{hkf}}), so that inapplicable calculations will be performed up to the critical temperature (373.917 \degC) without any warning.
-It is probably for this reason that there is a noticeable jump in the value of \logK at Psat shown in the one of the examples (\code{demo("NaCl")}).
+Although \acronym{SUPCRT92} prohibits calculations above 350 \degC at \Psat (\dQuote{beyond range of applicability of aqueous species equations}), there is no corresponding limit in place in \code{subcrt} (or \code{\link{hkf}}).
+Therefore, CHNOSZ can perform calculations up to the critical temperature (373.917 \degC) at \Psat, but these settings represent untested extrapolations.
+Unexpected results are evident in the discontinuity in the value of \logK at \Psat shown in \code{\link{demos}("NaCl")}.
 }
 
 \value{

Modified: pkg/CHNOSZ/man/util.water.Rd
===================================================================
--- pkg/CHNOSZ/man/util.water.Rd	2017-11-10 18:11:18 UTC (rev 288)
+++ pkg/CHNOSZ/man/util.water.Rd	2017-11-11 02:20:33 UTC (rev 289)
@@ -30,7 +30,7 @@
 The \code{property} for this function can be one of \samp{P.sigma} (saturation vapor pressure in MPa), \samp{dP.sigma.dT} (derivative of saturation vapor pressure with respect to temperature), or \samp{rho.liquid} or \samp{rho.vapor} (density of liquid or vapor in kg m\eqn{^{-3}}{^-3}).
 
 \code{rho.IAPWS95} implements a root-finding technique (using \code{\link{uniroot}}) to determine the values of density for the stable phase of \H2O at the given temperature and pressure.
-The \code{state} option is used internally in order to determine the stable phase at conditions close to saturation (0.9999*Psat <= P <= 1.00005*Psat, where Psat is the saturation pressure calculated by \code{\link{WP02.auxiliary}}).
+The \code{state} option is used internally in order to determine the stable phase at conditions close to saturation (0.9999*\Psat <= P <= 1.00005*\Psat, where \Psat is the saturation pressure calculated by \code{\link{WP02.auxiliary}}).
 Alternatively, the user can specify a \code{state} of \samp{liquid} or \samp{vapor} to force the calculation of density for the corresponding phase, even if it is metastable (e.g. superheated water, supercooled steam; this option has no effect in the supercritical region).
 The \code{state} is set in calls by \code{\link{water.IAPWS95}} to the value in \code{thermo$opt$IAPWS.sat} (default \samp{liquid}) so that higher-level functions (\code{\link{water}}, \code{\link{subcrt}}) take properties for that state along the saturation curve.
 Diagnostic messages are printed if \code{trace} is positive (it is also included in the call to \code{uniroot}).



More information about the CHNOSZ-commits mailing list