mass2vol: Calculate Biogas Production Gravimetrically

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

View source: R/mass2vol.R

Description

mass2vol calculates biogas volume based on measured reactor mass loss.

Usage

1
2
3
4
5
6
7
mass2vol(mass, xCH4, temp, pres, 
  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'), 
  value = "CH4", headspace = NULL, headcomp = 'N2', 
  temp.init = NULL, std.message = TRUE)

Arguments

mass

reactor mass loss in g. A numeric vector.

xCH4

biogas mole fraction of methane. Must be normalised so xCH4 + xCO2 = 1.0. A numeric vector.

temp

the temperature of biogas as it exited the reactor. A length-one numeric vector. Degrees Celcius by default (see unit.temp argument).

pres

the pressure of biogas as it exited the reactor. A length-one numeric vector. Atmospheres (atm) by default (see unit.pres argument).

temp.std

standard temperature for presentation of biogas and methane results. Default value is 0 degrees C. Argument is passed to stdVol. Length one numeric vector.

pres.std

standard pressure for presentation of biogas and methane results. Default value is 1.0 atm. Argument is passed to stdVol. Length one numeric vector.

unit.temp

temperature units for temp and temp.std arguments. Default is "C". Argument is passed to stdVol.

unit.pres

pressure units for pres and pres.std arguments. Default is "atm". Argument is passed to stdVol.

value

what should be returned? Default is "CH4", which returns methane volume in mL. "all" returns biogas, methane, and carbon dioxide volumes.

headspace

(optional) reactor headspace volume in mL. Used to correct for effect of initial reactor headspace on mass loss. A numeric vector.

headcomp

(optional) composition of the initial reactor headspace. Only required if headspace argument is specified. Used to correct for effect of initial reactor headspace on mass loss. Currently, the only option is "N2" for dinitrogen gas. Use of any other value will be ignored with a warning.

temp.init

(optional) initial headspace temperature in unit.temp units. Used to correct for effect of initial reactor headspace on mass loss.

std.message

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

Details

This function uses the method described in Hafner et al. (2015) to calculate biogas production from reactor mass loss. It is essential that the only change in reactor mass is due to biogas removal! Users are advised to read the original reference before applying the method. This function is vectorized. Instead of using this function directly when working with multiple measurements on multiple reactors, use the cumBg function (which can call up mass2vol).

Standard values and units of temperature and pressure can be globally set using the function options.

Value

volume of methane in mL as a numeric vector (if value = "CH4") or a matrix with columns for biogas, methane, and carbon dioxide volumes in mL.

vBg

standardised volume of biogas in mL

vCH4

standardised volume of methane in mL

vCH4

standardised volume of carbon dioxyde in mL

All volumes are standardised using pres.std and temp.std arguments (see stdVol).

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.

See Also

vol2mass, stdVol, cumBg, options

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  # Volume of methane if measured mass loss was 3.1 g
  mass2vol(3.1, xCH4 = 0.65, temp = 35, pres = 1)

  # More details
  mass2vol(3.1, xCH4 = 0.65, temp = 35, pres = 1, value = "all")
  
  # Vectorized
  data("massw")
  massw$massloss <- massw$start - massw$end
  massw$vCH4 <- mass2vol(massw$massloss, xCH4 = 0.65, temp = 35, 
                         pres = 1)
  massw
  

Example output

Using a standard pressure of 101325 Pa and standard temperature of 273.15 K for standardizing volume.
[1] 1675.698
Using a standard pressure of 101325 Pa and standard temperature of 273.15 K for standardizing volume.
          vBg     vCH4     vCO2
[1,] 2574.059 1675.698 898.3613
Using a standard pressure of 101325 Pa and standard temperature of 273.15 K for standardizing volume.
    id  start    end massloss     vCH4
1  2_1 1200.6 1196.1      4.5 2432.464
2  2_2 1217.7 1213.0      4.7 2540.574
3  2_3 1194.9 1190.3      4.6 2486.519
4  2_4 1194.5 1188.2      6.3 3405.450
5  2_5 1196.3 1189.8      6.5 3513.560
6  2_6 1207.7 1201.0      6.7 3621.669
7 2_10 1192.7 1187.8      4.9 2648.684
8 2_11 1194.4 1189.6      4.8 2594.629
9 2_12 1192.2 1187.4      4.8 2594.629

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