molvol: Mol to Liter Conversion for a Gas

View source: R/molvol.R

molvolR Documentation

Mol to Liter Conversion for a Gas

Description

Converts from liter to moles for a gas.

Usage

molvol(t = 25, P = 1.013253,
   species = c("ideal", "Ar", "CO2", "CS2", "CO", "CCl4", "Cl2",
         "C2H6S", "C2H5OH", "C6H5F", "CH3F", "CH4", "CH3OH", "C5H12",
          "C3H8", "H2O", "He", "H2", "HBr", "HCl", "H2S", "Hg",
          "Kr", "NH3", "Ne", "NO", "N2", "NO2", "N2O", "O2", "PH3",
          "SiH4", "SiF4", "SO2", "Xe"),
    quantity = 1, a = 0, b = 0)

Arguments

t

temperature, ^\circC

P

True pressure, bar.

species

character vector with gasses whose molecular volume should be estimated. if NULL then the coefficients a and b are used.

quantity

mol of the gas.

a

Van der Waals constant a, a species-specific coefficient, dm^6*bar/mol^2.

b

Van der Waals constant b, a species-specific coefficient, dm^3/mol.

Value

volume of the gas, liter

Note

The coefficients a and b are species-specific; values of 0 assume an ideal gas and in general give good estimates.

Use 1/molvol to convert from liter to moles.

The default calculates the molar volume of an ideal gas

Author(s)

Karline Soetaert <karline.soetaert@nioz.nl>

References

The values of the van der Waals constants are from:

Weast RC (Ed.) 1972. Handbook of Chemistry and Physics (53rd Edn.), Cleveland:Chemical Rubber Co.

as found in: https://en.wikipedia.org/wiki/Van_der_Waals_constants_(data_page)

See Also

AtomicWeight, molweight, redfield

Examples

#molecular volume of an ideal gas.
molvol(species = "ideal", P = 1, t = 0)    # 22.710 980
molvol(species = "ideal", P = 1, t = 25)   # 24.789 598

plot(0:30, molvol(t = 0:30, species = NULL),
    xlab = "Temperature, dgC", ylab = "Molar volume")

#
molvol(a = 1.382, b = 0.03186, species = NULL, t = 0)

molvol(t = 0, species = "O2")

# the same but for all gasses
molvol(t = 0)

# table for different pressures
molvol(P = 1:5, species = "O2")

# the inverse function
1/molvol(species = "O2")

# contour plot
P    <- seq(1, 100, by = 1)
Temp <- seq(-5, 40, by = 1)

Val <- outer(X = P, Y = Temp,
      FUN = function(X, Y) molvol(P = X,  t = Y, species = "O2"))
contour(P, Temp, Val, xlab = "pressure", ylab = "temperature",
        main = "molvol", nlevel = 20, log = "x", axes = FALSE)
axis(1); axis(2); box()


marelac documentation built on Sept. 25, 2023, 5:06 p.m.