vol2mol {biogas}R Documentation

Calculate Moles of a Gas


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


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



measured gas volume in mL. Numeric vector.


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


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


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


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


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


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


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


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%.


gas amount in moles as a numeric vector.


Sasha D. Hafner


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


# 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)

[Package biogas version 1.23.2 Index]