calcBgGD {biogas} | R Documentation |
Calculate Biogas Production from Gas Density Data (GD-BMP)
Description
calcBgGD
(for calculate biogas from GD (gas density) measurements) calculates cumulative biogas, methane production and production rates from mass loss and volume measurements for any number of bottles.
Usage
calcBgGD(
# Main arguments
dat,
temp.vol,
temp.grav,
pres.vol,
pres.grav,
# Column names
id.name,
time.name,
vol.name,
m.pre.name = NULL,
m.post.name,
comp.name = 'xCH4',
# Settings
vented.mass = FALSE,
averaging = 'final',
temp.init = NULL,
pres.init = NULL,
headspace = NULL,
vol.hs.name = NULL,
headcomp = 'N2',
# Calculation method and other settings
vmethod = 'vol',
comp.lim = c(0, 1),
comp.sub = NA,
imethod = 'linear',
extrap = FALSE,
addt0 = TRUE,
showt0 = TRUE,
dry = FALSE,
# Warnings and messages
std.message = TRUE,
check = TRUE,
# Units and standard conditions
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')
)
Arguments
dat |
a data frame with bottle identification code, time of measurement (as |
temp.vol |
temperature at which biogas volume was measured. |
temp.grav |
temperature of bottle headspace at time of biogas venting, prior to gravimetric measurement. |
pres.vol |
pressure at which biogas volume was measured. |
pres.grav |
pressure of bottle headspace at time of biogas venting, prior to gravimetric measurement. |
id.name |
name of the bottle identification code column in |
time.name |
name of column containing time data (cumulative time) in |
vol.name |
name of the measured biogas volume column in |
m.pre.name |
name of column containing pre-venting bottle mass in |
m.post.name |
name of column containing post-venting bottle mass in |
comp.name |
name of column with biogas composition to be added to output data frame. |
vented.mass |
Set to |
averaging |
type of averaging used for calculating biogas composition.
Default is |
temp.init |
optional initial headspace temperature. Used to correct results for initial headspace. See details. |
pres.init |
optional initial headspace pressure. Used to correct results for initial headspace. See details. |
headspace |
optional data frame or length-one numeric vector with reactor headspace volume(s).
If a data frame is used, it should at least contain a |
vol.hs.name |
optional name of column containing headspace volume data in optional |
headcomp |
optional initial headspace composition used to correct results for initial headspace.
Default of |
vmethod |
method used for calculating biogas volume.
Default of |
comp.lim |
acceptable limits on calculated methane mole fraction.
Any values outside of this range are set to |
comp.sub |
Value substituted in for calculated methane mole fraction when calculated value is outside of |
imethod |
method used for interpolation of |
extrap |
should |
addt0 |
is the earliest time in |
showt0 |
should “time zero” rows be returned in the output?
Can be convenient for plotting cumulative volumes.
Only applies if |
dry |
set to |
std.message |
should a message with the standard conditions be displayed?
Default is |
check |
should input data be checked for unreasonable values (with warnings)?
Currently only composition values are checked.
Default is |
temp.std |
standard temperature for presentation of biogas and methane results.
Length one numeric vector.
Default value is 0 degrees C (set in |
pres.std |
standard pressure for presentation of biogas and methane results.
Length one numeric vector.
Default value is 1.0 atm (101325 Pa) (set in |
unit.temp |
temperature units for |
unit.pres |
pressure units for |
Details
Using volume and mass loss data from dat
, this function will calculate standardized biogas and methane production for each observation using the gas density (GD) method.
See reference below for details on the method.
Standard values and units for temperature and pressure can be globally set using the function options
.
See stdVol
.
Value
a data frame with all the columns originally present in dat
, plus others including these:
vBg |
Standardized volume of biogas production for individual event. |
xCH4 |
Calculated mole fraction of methane in biogas. |
vCH4 |
Standardized volume of methane production for individual event. |
cvBg |
Standardized cumulative volume of biogas production. |
cvCH4 |
Standardized cumulative volume of methane production. |
rvBg |
Production rate of biogas. |
rvCH4 |
Production rate of methane. |
Units are based on units in input data.
Author(s)
Sasha D. Hafner, Camilla Justesen, Jacob Mortensen
References
Justesen, C.G., Astals, S., Mortensen, J.R., Thorsen, R., Koch, K., Weinrich, S., Triolo, J.M., Hafner, S.D. 2019. Development and validation of a low-cost gas density method for measuring biochemical potential (BMP) Water (MDPI) 11(12): 2431.
See Also
calcBgMan
,
calcBgVol
,
summBg
,
interp
,
stdVol
,
options
Examples
data("UQGDBiogas")
data("UQGDSetup")
head(UQGDBiogas)
head(UQGDSetup)
cbg <- calcBgGD(UQGDBiogas,
temp.vol = 20, pres.vol = 1013.25,
temp.grav = 30, pres.grav = 1500,
id.name = 'id', vol.name = 'vol',
m.pre.name = 'mass.init', m.post.name = 'mass.final',
time.name = 'time.d', unit.pres = 'mbar')
BMP <- summBg(cbg, UQGDSetup, id.name = "id",
time.name = 'time.d', descrip.name = 'descrip',
inoc.name = "Inoculum", inoc.m.name = "m.inoc", norm.name = "m.sub.vs",
when = 'end')
BMP