vol2mol: Calculate Moles of a Gas

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/vol2mol.R

Description

vol2mol calculates the moles of a gas for a measured volume, temperature, and pressure.

Usage

1
2
3
4
vol2mol(vol, gas = "CH4", temp, pres, rh = 0, 
	unit.temp = getOption('unit.temp', 'C'), 
	unit.pres = getOption('unit.pres', 'atm'), 
	tp.message = TRUE)

Arguments

vol

measured gas volume in mL. Numeric vector.

gas

chemical formula of gas. Currently options are c("CH4", "CO2", "N2", "H2"). Character vector.

temp

temperature of gas at time of volume measurement. Numeric vector.

pres

pressure of gas at time of volume measurement, in the units specified in unit.pres (default of atm). Numeric vector.

rh

relative humidity of the gas at time of measurement. Length one numeric vector between zero and 1.0. Default is zero (dry gas).

unit.temp

temperature units. Options are "C" (degrees Celcius, the default), "F", and "K". Length-one character vector.

unit.pres

pressure units. Options are "atm" (the default), "Pa", "kPa", "hPa", and "bar". Length-one character vector.

tp.message

should a message display temp and pres to avoid unit mistakes? Length one logical vector.

Details

This function uses a simple and approximate approach for the conversion, based on Charles's and Boyle's laws, with NIST values for 0 degrees C and 1.0 atm taken as the reference state (Lemmon et al. 2011). Measured volume is normalized to 1.0 atm and 0 degrees C using stdVol, and the result is divided by the molar volume at the same conditions, as reported by NIST. Resulting error should be within 0.5% for temperature and pressure close to ambient, and is usually below 0.2%.

Value

gas amount in moles as a numeric vector.

Author(s)

Sasha D. Hafner

References

Lemmon EW, McLinden MO, Friend DG. Thermophysical Properties of Fluid Systems. In Linstrom PJ, Mallard WG, editors. Chemistry WebBook, NIST Standard Reference Database Number 69. Gaithersburg, MD: National Institute of Standards and Technology, 2011.

See Also

vol2mass, mass2vol, options

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Assume we have measured 253 mL CH4 at 1.0 atm and 22 C, dry
vol2mol(253, "CH4", temp = 22, pres = 1)

# Compare to results to NIST values for the least ideal gas
# Results are within 0.5%
# Expect 0.04108 mol
vol2mol(1000, "CO2", temp = 25, pres = 1)

# Expect 0.08258 mol
vol2mol(1000, "CO2", temp = 25, pres = 2)

# Expect 0.07482 mol
vol2mol(1000, "CO2", temp = 55, pres = 2)

Example output

biogas v 1.8.0.
For updates, join the biogas mailing list--send a message to sasha.hafner@eng.au.dk.
For a web app interface to the biogas package, browse to
https://biotransformers.shinyapps.io/oba1/.
You specified a gas pressure of 1 atm and temperature of 22 C.
       CH4 
0.01047118 
You specified a gas pressure of 1 atm and temperature of 25 C.
      CO2 
0.0411512 
You specified a gas pressure of 2 atm and temperature of 25 C.
      CO2 
0.0823024 
Warning message:
In stdVol(vol, temp = temp.k, pres = pres.pa, rh = rh, pres.std = 101325,  :
  pres ranges from 202650 Pa to 202650 Pa. Is this really correct?
You specified a gas pressure of 2 atm and temperature of 55 C.
       CO2 
0.07477819 
Warning message:
In stdVol(vol, temp = temp.k, pres = pres.pa, rh = rh, pres.std = 101325,  :
  pres ranges from 202650 Pa to 202650 Pa. Is this really correct?

biogas documentation built on Jan. 8, 2020, 5:08 p.m.