[CHNOSZ-commits] r767 - in pkg/CHNOSZ: . R inst inst/extdata/Berman/testing inst/tinytest man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 20 02:50:55 CET 2023


Author: jedick
Date: 2023-02-20 02:50:55 +0100 (Mon, 20 Feb 2023)
New Revision: 767

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/add.OBIGT.R
   pkg/CHNOSZ/R/info.R
   pkg/CHNOSZ/R/subcrt.R
   pkg/CHNOSZ/R/util.data.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/inst/extdata/Berman/testing/BA96_OBIGT.csv
   pkg/CHNOSZ/inst/tinytest/test-util.data.R
   pkg/CHNOSZ/man/util.data.Rd
Log:
Allow calculations for aq species with CGL model


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/DESCRIPTION	2023-02-20 01:50:55 UTC (rev 767)
@@ -1,6 +1,6 @@
 Date: 2023-02-20
 Package: CHNOSZ
-Version: 1.9.9-58
+Version: 1.9.9-59
 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/add.OBIGT.R
===================================================================
--- pkg/CHNOSZ/R/add.OBIGT.R	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/R/add.OBIGT.R	2023-02-20 01:50:55 UTC (rev 767)
@@ -130,9 +130,8 @@
     else stop(paste("file", file, "doesn't have", paste(species[ina], collapse=", ")))
   }
   id2 <- paste(to2$name,to2$state)
-  # Check if the data is compatible with thermo$OBIGT
-  tr <- tryCatch(rbind(to1, to2), error = identity)
-  if(inherits(tr, "error")) stop(paste(file, "is not compatible with thermo$OBIGT data frame."))
+  # Check if the data table is compatible with thermo$OBIGT
+  if(!identical(colnames(to1), colnames(to2))) stop(paste(file, "does not have same column names as thermo$OBIGT data frame."))
   # Match the new species to existing ones
   does.exist <- id2 %in% id1
   ispecies.exist <- na.omit(match(id2, id1))

Modified: pkg/CHNOSZ/R/info.R
===================================================================
--- pkg/CHNOSZ/R/info.R	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/R/info.R	2023-02-20 01:50:55 UTC (rev 767)
@@ -229,11 +229,11 @@
 
   # Perform consistency checks for GHS and EOS parameters if check.it = TRUE
   # Don't do it for the AD species 20190219
-  if(check.it & !"xi" %in% colnames(this)) {
+  if(check.it & this$model != "AD") {
     # Check GHS if they are all present
     if(sum(naGHS)==0) calcG <- checkGHS(this)
     # Check tabulated heat capacities against EOS parameters
-    calcCp <- checkEOS(this, this$state, "Cp")
+    calcCp <- checkEOS(this, this$model, "Cp")
     # fill in NA heat capacity
     if(!is.na(calcCp) & is.na(this$Cp)) {
       message("info.numeric: Cp of ", this$name, "(", this$state, ") is NA; set by EOS parameters to ", round(calcCp, 2), " ", this$E_units, " K-1 mol-1")
@@ -243,9 +243,9 @@
       calcCp <- Berman(this$name)$Cp
       this$Cp <- calcCp
     }
-    # check tabulated volumes - only for aq (HKF equation)
-    if(identical(this$state, "aq")) {
-      calcV <- checkEOS(this, this$state, "V")
+    # check tabulated volumes - only for HKF model (aq species)
+    if(this$model %in% c("HKF", "DEW")) {
+      calcV <- checkEOS(this, this$model, "V")
       # fill in NA volume
       if(!is.na(calcV) & is.na(this$V)) {
         message("info.numeric: V of ", this$name, "(", this$state, ") is NA; set by EOS parameters to ", round(calcV, 2), " cm3 mol-1")

Modified: pkg/CHNOSZ/R/subcrt.R
===================================================================
--- pkg/CHNOSZ/R/subcrt.R	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/R/subcrt.R	2023-02-20 01:50:55 UTC (rev 767)
@@ -195,11 +195,10 @@
     ispecies = iphases, model = model, stringsAsFactors = FALSE)
   # Make the rownames readable ... but they have to be unique
   if(length(unique(iphases))==length(iphases)) rownames(reaction) <- as.character(iphases)
-  # Which are aqueous species
-  isaq <- reaction$state == "aq"
-  # Save this test for debugging 20220920
-  isaq.model <- toupper(reaction$model) %in% c("HKF", "AD", "DEW")
-  stopifnot(all(isaq == isaq.model))
+  # Which species use models for aqueous species
+  # This breaks things if we have state = "aq" and model = "CGL" 20230220
+  #isaq <- reaction$state == "aq"
+  isaq <- toupper(reaction$model) %in% c("HKF", "AD", "DEW")
 
   # Produce message about conditions
   if(length(species)==1 & convert==FALSE) {
@@ -337,9 +336,8 @@
     H2O.PT <- water(c("rho", eosprop), T = T, P = P)
   }
 
-  # Crystalline, gas, liquid (except water) species
-  cglstates <- c("liq", "cr", "gas", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", "cr8", "cr9")
-  iscgl <- reaction$state %in% cglstates & reaction$name != "water"
+  # Crystalline, gas, or liquid (except water) species
+  iscgl <- reaction$model %in% c("CGL", "Berman")
 
   if(TRUE %in% iscgl) {
     param <- OBIGT2eos(thermo$OBIGT[iphases[iscgl],], "cgl", fixGHS = TRUE, toJoules = TRUE)

Modified: pkg/CHNOSZ/R/util.data.R
===================================================================
--- pkg/CHNOSZ/R/util.data.R	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/R/util.data.R	2023-02-20 01:50:55 UTC (rev 767)
@@ -159,8 +159,8 @@
   }
 }
 
-checkEOS <- function(eos, state, prop, ret.diff=FALSE) {
-  # Compare calculated properties from equation-of-state parameters with reference (tabulated) values.
+checkEOS <- function(eos, model, prop, ret.diff = FALSE) {
+  # Compare calculated properties from thermodynamic parameters with reference (tabulated) values.
   # Print message and return the calculated value if tolerance is exceeded
   # or NA if the difference is within the tolerance.
   # 20110808 jmd
@@ -167,7 +167,8 @@
   thermo <- get("thermo", CHNOSZ)
   # Get calculated value based on EOS
   Theta <- 228  # K
-  if(identical(state, "aq")) {
+  if(model %in% c("HKF", "DEW")) {
+    # Run checks for aqueous species
     if(prop=="Cp") {
       ## Value of X consistent with IAPWS95
       #X <- -2.773788E-7
@@ -191,7 +192,7 @@
       units <- "cm3 mol-1"
     }
   } else {
-    # All other states
+    # Run checks for non-aqueous species (i.e., CGL)
     if(prop=="Cp") {
       refval <- eos$Cp
       Tr <- 298.15
@@ -273,27 +274,27 @@
     ntot <- nrow(tdata)
     # Where to keep the results
     DCp <- DV <- DG <- rep(NA,ntot)
-    # First get the aqueous species
-    isaq <- tdata$state=="aq"
-    if(any(isaq)) {
-      eos.aq <- OBIGT2eos(tdata[isaq,], "aq")
-      DCp.aq <- checkEOS(eos.aq, "aq", "Cp", ret.diff = TRUE)
-      DV.aq <- checkEOS(eos.aq, "aq", "V", ret.diff = TRUE)
-      cat(paste("check.OBIGT: GHS for", sum(isaq), "aq species in", what, "\n"))
-      DG.aq <- checkGHS(eos.aq, ret.diff = TRUE)
+    # First get the species that use HKF equations
+    isHKF <- tdata$model %in% c("HKF", "DEW")
+    if(any(isHKF)) {
+      eos.HKF <- OBIGT2eos(tdata[isHKF,], "HKF")
+      DCp.HKF <- checkEOS(eos.HKF, "HKF", "Cp", ret.diff = TRUE)
+      DV.HKF <- checkEOS(eos.HKF, "HKF", "V", ret.diff = TRUE)
+      cat(paste("check.OBIGT: GHS for", sum(isHKF), "species with HKF model in", what, "\n"))
+      DG.HKF <- checkGHS(eos.HKF, ret.diff = TRUE)
       # Store the results
-      DCp[isaq] <- DCp.aq
-      DV[isaq] <- DV.aq
-      DG[isaq] <- DG.aq
+      DCp[isHKF] <- DCp.HKF
+      DV[isHKF] <- DV.HKF
+      DG[isHKF] <- DG.HKF
     }
     # Then other species, if they are present
-    if(sum(!isaq) > 0) {
-      eos.cgl <- OBIGT2eos(tdata[!isaq,], "cgl")
-      DCp.cgl <- checkEOS(eos.cgl, "cgl", "Cp", ret.diff = TRUE)
-      cat(paste("check.OBIGT: GHS for", sum(!isaq), "cr,gas,liq species in", what, "\n"))
+    if(sum(!isHKF) > 0) {
+      eos.cgl <- OBIGT2eos(tdata[!isHKF,], "cgl")
+      DCp.cgl <- checkEOS(eos.cgl, "CGL", "Cp", ret.diff = TRUE)
+      cat(paste("check.OBIGT: GHS for", sum(!isHKF), "cr,gas,liq species in", what, "\n"))
       DG.cgl <- checkGHS(eos.cgl, ret.diff = TRUE)
-      DCp[!isaq] <- DCp.cgl
-      DG[!isaq] <- DG.cgl
+      DCp[!isHKF] <- DCp.cgl
+      DG[!isHKF] <- DG.cgl
     }
     # Put it all together
     out <- data.frame(table = what, ispecies = 1:ntot, name = tdata$name, state = tdata$state, E_units = tdata$E_units, DCp = DCp, DV = DV, DG = DG)

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2023-02-20 01:50:55 UTC (rev 767)
@@ -25,15 +25,14 @@
 
       \item A \code{model} column has been added to the OBIGT thermodynamic
       database. This specifies the model for calculating standard thermodynamic
-      properties and will eventually supersede the heuristics for determining
-      the model based on values in other columns. Currently used models are
-      \samp{H2O} (water), \samp{HKF} (revised Helgeson-Kirkham-Flowers),
-      \samp{CGL} (heat capacity equation for crystalline, gas, and liquid
-      species), \samp{Berman} (Berman equations), \samp{AD} (Akinfiev-Diamond),
-      and \samp{DEW} (Deep Earth Water model, a variation of HKF). All OBIGT
-      data files that can be read using \code{add.OBIGT()} must have this
-      column; there is no back-compatibility support for data files in the old
-      format.
+      properties. Currently available models are \samp{H2O} (water), \samp{HKF}
+      (revised Helgeson-Kirkham-Flowers model for aqueous species), \samp{CGL}
+      (heat capacity equation for crystalline, gas, and liquid species),
+      \samp{Berman} (Berman model for minerals), \samp{AD} (Akinfiev-Diamond
+      model for aqueous species), and \samp{DEW} (Deep Earth Water model, a
+      variation of HKF). All OBIGT data files that can be read using
+      \code{add.OBIGT()} must have this column; there is no back-compatibility
+      support for data files in the old format.
 
       \item Backward compatibility for OBIGT data files without an
       \code{E_units} column has been removed.
@@ -40,7 +39,7 @@
 
       \item Order-of-magnitude (OOM) scaling of heat capacity coefficients for
       the CGL model in OBIGT data files has been removed. OOM scaling of HKF
-      (including DEW) model parameters is still in effect.
+      and DEW model parameters is still in place.
 
       \item Change license from GPL (>= 2) to GPL-3.
 

Modified: pkg/CHNOSZ/inst/extdata/Berman/testing/BA96_OBIGT.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/Berman/testing/BA96_OBIGT.csv	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/inst/extdata/Berman/testing/BA96_OBIGT.csv	2023-02-20 01:50:55 UTC (rev 767)
@@ -1,21 +1,21 @@
-name,abbrv,formula,state,ref1,ref2,date,E_units,model,G,H,S,Cp,V,a1.a,a2.b,a3.c,a4.d,c1.e,c2.f,omega.lambda,z.T
-almandine,Alm,Si3Fe3Al2O12,cr,BA96.1,NA,03.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-anthophyllite,Ath,Mg7Si8O24H2,cr,BA96.1,NA,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-cordierite,Cd,Mg2Al4Si5O18,cr,Ber88,BA96.2,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-enstatite,En,MgSiO3,cr,Ber88,BA96.2,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-fayalite,Fa,Fe2SiO4,cr,BA96.1,NA,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-ferrosilite,Fsl,SiFeO3,cr,BA96.1,NA,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-forsterite,Fo,Mg2SiO4,cr,Ber88,BA96.3,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-hematite,Hm,Fe2O3,cr,Ber88,BA96.2,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-ilmenite,Ilm,FeTiO3,cr,Ber88,BA96.4,03.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-magnetite,Mt,Fe3O4,cr,Ber88,BA96.2,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-pyrope,Py,Mg3Al2Si3O12,cr,Ber88,BA96.3,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-rutile,Rt,TiO2,cr,Ber88,BA96.2,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-spinel,Sp,MgAl2O4,cr,Ber88,BA96.3,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-talc,Tc,Mg3Si4O12H2,cr,Ber88,BA96.4,01.Oct.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-Fe-cordierite,fCd,Fe2Al4Si5O18,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-geikelite,Gk,MgTiO3,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-hercynite,Hc,FeAl2O4,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-iron-a,aFe,Fe,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-iron-g,gFe,Fe,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
-orthocorundum,Ok,Al2O3,cr,BA96,NA,12.Dec.17,J,Berman,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+name,abbrv,formula,state,ref1,ref2,date,model,E_units,G,H,S,Cp,V,a1.a,a2.b,a3.c,a4.d,c1.e,c2.f,omega.lambda,z.T
+almandine,Alm,Si3Fe3Al2O12,cr,BA96.1,NA,03.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+anthophyllite,Ath,Mg7Si8O24H2,cr,BA96.1,NA,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+cordierite,Cd,Mg2Al4Si5O18,cr,Ber88,BA96.2,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+enstatite,En,MgSiO3,cr,Ber88,BA96.2,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+fayalite,Fa,Fe2SiO4,cr,BA96.1,NA,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+ferrosilite,Fsl,SiFeO3,cr,BA96.1,NA,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+forsterite,Fo,Mg2SiO4,cr,Ber88,BA96.3,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+hematite,Hm,Fe2O3,cr,Ber88,BA96.2,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+ilmenite,Ilm,FeTiO3,cr,Ber88,BA96.4,03.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+magnetite,Mt,Fe3O4,cr,Ber88,BA96.2,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+pyrope,Py,Mg3Al2Si3O12,cr,Ber88,BA96.3,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+rutile,Rt,TiO2,cr,Ber88,BA96.2,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+spinel,Sp,MgAl2O4,cr,Ber88,BA96.3,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+talc,Tc,Mg3Si4O12H2,cr,Ber88,BA96.4,01.Oct.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+Fe-cordierite,fCd,Fe2Al4Si5O18,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+geikelite,Gk,MgTiO3,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+hercynite,Hc,FeAl2O4,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+iron-a,aFe,Fe,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+iron-g,gFe,Fe,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA
+orthocorundum,Ok,Al2O3,cr,BA96,NA,12.Dec.17,Berman,J,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA

Modified: pkg/CHNOSZ/inst/tinytest/test-util.data.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-util.data.R	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/inst/tinytest/test-util.data.R	2023-02-20 01:50:55 UTC (rev 767)
@@ -116,8 +116,18 @@
 mod.OBIGT("test_J2", formula = "C0", state = "cr", E_units = "J", a = 41.84, b = 418.4, f = 4.184, lambda = -1)
 expect_equal(subcrt("test_cal2", T = 25)$out[[1]]$Cp, subcrt("test_J2", T = 25)$out[[1]]$Cp, info = info)
 
-# reference
+info <- "We can define an aqueous species with CGL model"
+# Test added 20230220
+icr <- mod.OBIGT("fake_cr", formula = "Na2Cl2", state = "cr", model = "CGL", G = -1000, H = -1000, S = 10, Cp = 10, V = 10)
+iaq <- mod.OBIGT("fake_aq", formula = "Na2Cl2", state = "aq", model = "CGL", G = -1000, H = -1000, S = 10, Cp = 10, V = 10)
+# Make sure info() runs (message is from checkEOS())
+expect_message(info(iaq), "differs", info = info)
+expect_silent(info(iaq), info = info)
+# Make sure subcrt() runs
+expect_equal(subcrt(iaq)$G, subcrt(icr)$G)
 
+# Reference
+
 # Richard, L. and Helgeson, H. C. (1998) Calculation of the thermodynamic properties at elevated 
 #   temperatures and pressures of saturated and aromatic high molecular weight solid and liquid 
 #   hydrocarbons in kerogen, bitumen, petroleum, and other organic matter of biogeochemical interest. 

Modified: pkg/CHNOSZ/man/util.data.Rd
===================================================================
--- pkg/CHNOSZ/man/util.data.Rd	2023-02-20 00:16:05 UTC (rev 766)
+++ pkg/CHNOSZ/man/util.data.Rd	2023-02-20 01:50:55 UTC (rev 767)
@@ -14,8 +14,8 @@
 }
 
 \usage{
-  thermo.refs(key=NULL, keep.duplicates=FALSE)
-  checkEOS(eos, state, prop, ret.diff = FALSE)
+  thermo.refs(key = NULL, keep.duplicates = FALSE)
+  checkEOS(eos, model, prop, ret.diff = FALSE)
   checkGHS(ghs, ret.diff = FALSE)
   check.OBIGT()
   dumpdata(file)
@@ -27,12 +27,13 @@
   \item{key}{character, numeric, or list; bibliographic reference key(s)}
   \item{keep.duplicates}{logical, keep duplicated references?}
   \item{eos}{dataframe, equations-of-state parameters in the format of \code{thermo()$OBIGT}}
-  \item{state}{character, physical state of species}
+  \item{model}{character, thermodynamic model (see \code{\link{thermo}})}
   \item{prop}{character, property of interest (\samp{Cp} or \samp{V})}
   \item{ret.diff}{logical, return the difference between calculated and tabulated values?}
   \item{ghs}{dataframe, containing G, H and S, in the format of \code{thermo()$OBIGT}}
   \item{file}{character, path to a file}
   \item{compound}{character, name of compound(s) in group additivity calculation}
+  \item{state}{character, physical state of species}
 }
 
 \details{
@@ -45,10 +46,9 @@
 In that case, a single reference for each species is returned, ignoring anything in \code{thermo()$OBIGT$ref2}.
 
 \code{checkEOS} compares heat capacity and volume calculated from equation-of-state parameters with reference (tabulated) values at 25 \degC and 1 bar and prints a message and returns the calculated value if tolerance is exceeded.
-The Helgeson-Kirkham-Flowers equations of state parameters are in \code{eos}, which is a data frame with columns (and column names) in the same format as \code{\link{thermo}$OBIGT}.
-The \code{prop}erty can be one of \samp{Cp} or \code{V}.
-The code only distinguishes between \code{state}s of \samp{aq} and all others.
-The default tolerances, given in \code{thermo()$opt$Cp.tol} and \code{thermo()$opt$V.tol}, are 1 cal/K.mol for Cp and 1 cm3/mol for V.
+The thermodynamic parameters should be provided in \code{eos}, which is a data frame with columns (and column names) in the same format as \code{\link{thermo}$OBIGT}.
+The \code{prop}erty can be one of \samp{Cp} or \samp{V}.
+The default tolerances, given in \code{thermo()$opt$Cp.tol} and \code{thermo()$opt$V.tol}, are 1 J/K.mol or 1 cal/K.mol for Cp and 1 cm3/mol for V.
 If \code{ret.diff} is TRUE, the differences are returned irrespective of their values, and no messages are printed.
 
 \code{checkGHS} compares G (standard molal Gibbs energy of formation from the elements) calculated from H (standard molal enthalpy of formation) and S (standard molal entropy) with reference (tabulated) values of G at 25 \degC and 1 bar.



More information about the CHNOSZ-commits mailing list