stdVol {biogas}R Documentation

Correct Gas Volume to 'Standard' Conditions

Description

stdVol corrects gas volumes to dry conditions at a specified temperature and pressure.

Usage

stdVol(vol, temp, pres, rh = 1, 
       temp.std = getOption('temp.std', as.numeric(NA)), 
       pres.std = getOption('pres.std', as.numeric(NA)), 
       unit.temp = getOption('unit.temp', 'C'), 
       unit.pres = getOption('unit.pres', 'atm'), 
       std.message = TRUE, warn = TRUE)

Arguments

vol

measured gas volume at temp temperature, pres pressure, and rh relative humidity. A numeric vector.

temp

temperature of gas in degrees C by default (see unit.temp). A numeric vector.

pres

pressure of gas in atm by default (see unit.pres). A numeric vector.

rh

relative humidity of the gas (0<= rh <= 1). Typically should be 1.0 (the default). A numeric vector.

temp.std

"standard" temperature. Default value is 0 degrees C.

pres.std

"standard" pressure. Default value is 1.0 atm.

unit.pres

pressure units for pres and pres.std arguments. Options are "atm" (the default), "Pa", "kPa", "hPa", and "bar".

unit.temp

temperature units for temp and temp.std arguments. Options are "C" (degrees Celcius), "F" (degrees Fahrenheit), and "K" (Kelvin).

std.message

should a message with the standard conditions be displayed? Default is TRUE.

warn

if TRUE, will return a warning if temperature is below 0 C or above 100 C, or if pressure is below 50 kPa or above 150 kPa.

Details

Standardisation is done in a two-step process following Hafner et al. (2015). First, the contribution of water vapor is removed and volume is corrected to the standard pressure:

vd = vm*(pm - rh*pw)/ps

where vd = dry volume at standard pressure ps, vm = measured volume at pressure pm, pw = saturation vapor pressure of water (all pressures in Pa), and rh = relative humidity (rh above). Water vapor pressure pw is calculated from the Magnus form equation given in Alduchov and Eskridge (1996) (Eqs. (21) and (22)). In the second step, the volume is adjusted for temperature.

vs = vd*Ts/T

where vs = standardised volume and Ts = standardisation temperature (K, converted from temp.std argument). This approach is based on Charles's and Boyle's laws. Comparison with calculations using the Peng-Robinson equation of state suggests that error in stdVol is around 0.1% for typical biogas with volume measured at 25 degrees C, and higher at higher temperatures (up to 0.3% at 55 degrees C).

Standard temperature and pressure and their units can be defined by the user using the temp.std, pres.std, temp.unit, and pres.unit arguments. Alternatively, standard values and units of temperature and pressure can be globally set using the function options. Default values are 0 degrees C and 1.0 atm. stdVol is vectorized, and if one argument has a shorter length than the others, it will be recycled.

Value

Standardised gas volume in the same units as vol. A numeric vector.

Author(s)

Sasha D. Hafner and Charlotte Rennuit

References

Hafner, S.D., Rennuit, C., Triolo, J.M., Richards, B.K. 2015. Validation of a simple gravimetric method for measuring biogas production in laboratory experiments. Biomass and Bioenergy 83, 297-301.

Richards, B.K., Cummings, R.J., White, T.E., Jewell, W.J. 1991. Methods for kinetic analysis of methane fermentation in high solids biomass digesters. Biomass and Bioenergy 1, 65-73.

See Also

cumBg, summBg, stdVol, options

Examples

  # 100 mL, measured at 35 C
  stdVol(100, temp = 35, pres = 1)

  # Or, with different units
  stdVol(100, temp = 35, pres = 103, unit.pres = "kPa", pres.std = 101.325)
  
  # Vectorized
  data(vol)
  head(vol)
  vol$vol.std <- stdVol(vol$vol, temp = 20, pres = 1.02)
  head(vol)
  
  #using options() (recommended!)
  oldoptions <- options(temp.std = 273.15, pres.std = 101325, 
                        unit.temp = 'K', unit.pres = 'Pa')
  vol$vol.std <- stdVol(vol$vol, temp = 293.15, pres = 101325)
  head(vol)
  options(oldoptions)

[Package biogas version 1.23.2 Index]