stdVol: Correct Gas Volume to 'Standard' Conditions

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

View source: R/stdVol.R

Description

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

Usage

1
2
3
4
5
6
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  # 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)

Example output

Using a standard pressure of 1 atm and standard temperature of 0 C for standardizing volume.
[1] 83.70153
Using a standard pressure of 101.325 kPa and standard temperature of 0 C for standardizing volume.
[1] 85.16649
   id           date.time days vol
1 2_1 2014-06-07 11:00:00 1.98 393
2 2_1 2014-06-08 11:00:00 2.98 260
3 2_1 2014-06-09 11:00:00 3.98 245
4 2_1 2014-06-10 11:00:00 4.98 225
5 2_1 2014-06-11 11:00:00 5.98 200
6 2_1 2014-06-12 12:00:00 7.02 175
Using a standard pressure of 1 atm and standard temperature of 0 C for standardizing volume.
   id           date.time days vol  vol.std
1 2_1 2014-06-07 11:00:00 1.98 393 365.0332
2 2_1 2014-06-08 11:00:00 2.98 260 241.4978
3 2_1 2014-06-09 11:00:00 3.98 245 227.5652
4 2_1 2014-06-10 11:00:00 4.98 225 208.9885
5 2_1 2014-06-11 11:00:00 5.98 200 185.7675
6 2_1 2014-06-12 12:00:00 7.02 175 162.5466
Using a standard pressure of 101325 Pa and standard temperature of 273.15 K for standardizing volume.
   id           date.time days vol  vol.std
1 2_1 2014-06-07 11:00:00 1.98 393 357.7102
2 2_1 2014-06-08 11:00:00 2.98 260 236.6531
3 2_1 2014-06-09 11:00:00 3.98 245 223.0000
4 2_1 2014-06-10 11:00:00 4.98 225 204.7959
5 2_1 2014-06-11 11:00:00 5.98 200 182.0408
6 2_1 2014-06-12 12:00:00 7.02 175 159.2857

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