Learn R Programming

CHNOSZ (version 2.3.0)

JANAF.to.OBIGT: Import thermodynamic data from NIST-JANAF tables

Description

Parse JANAF table for standard thermodynamic properties, fit a Cp equation, and add the parameters to OBIGT. Only gases are currently supported.

Usage

JANAF.to.OBIGT(file, abbrv = NULL, T_max = 1500, MAE_max = 1,
    plot_Cp = FALSE)

Value

The species index of the new species in OBIGT.

Arguments

file

character, path to JANAF txt file (can be a URL)

abbrv

character, abbreviation (or alternative name) of species for abbrv column in OBIGT

T_max

numeric, maximum T (K) for fitting Cp equation

MAE_max

numeric, maximum mean absolute error allowed for Cp equation

plot_Cp

logical, whether to make a plot of actual and predicted Cp values

Details

This function parses the file to obtain values of the species name, formula, state, standard thermodynamic properties at 25 °C and 1 bar (G, H, S, Cp), and Cp coefficients. A five-parameter Cp equation is used (see thermo) to obtain the coefficients (a, b, c, d, e). The parameters are then added to OBIGT using mod.OBIGT. If a species with the same name and state already exists, its parameters are replaced.

An error is produced for species that are not gases, or if the MAE of the Cp fit is greater than MAE_max.

References

Anderson GM. 2005. Thermodynamics of Natural Systems. 2nd ed. Cambridge, UK: Cambridge University Press. 648 p. https://search.worldcat.org/title/474880901

NIST. 1998. NIST-JANAF Thermochemical Tables. tools:::Rd_expr_doi("10.18434/T42S31")

Examples

Run this code
# Test with a local file
file <- system.file("extdata/misc/C-127.txt", package = "CHNOSZ")
# Uncomment to use a URL instead
#file <- "https://janaf.nist.gov/tables/C-127.txt"
# Add parameters to OBIGT and make a Cp plot
inew <- JANAF.to.OBIGT(file, abbrv = "acetylene", plot_Cp = TRUE)
# Show calculated properties
subcrt(inew)

Run the code above in your browser using DataLab