Aggregates transport, treatment, chemical usage, and displacement credits to produce net leakage estimates for AMS-III.H.

calculate_leakage_emissions_iiih(
  data,
  sludge_mass_col = "sludge_tonnes",
  transport_distance_col = "transport_distance_km",
  transport_emission_factor_col = "transport_ef_tco2_per_tkm",
  sludge_treatment_emission_factor_col = "sludge_treatment_ef_tco2_per_tonne",
  chemical_dosage_col = "chemical_usage_tonnes",
  chemical_emission_factor_col = "chemical_ef_tco2_per_tonne",
  displaced_fossil_fuel_col = "displaced_fossil_fuel_gj",
  displaced_fossil_fuel_emission_factor_col = "displaced_fossil_fuel_ef_tco2_per_gj",
  group_cols = NULL,
  output_col = "leakage_emissions_tco2e"
)

Arguments

data

Tibble containing leakage monitoring data.

sludge_mass_col

Column storing sludge transported off-site in tonnes.

transport_distance_col

Column storing transport distance in kilometres.

transport_emission_factor_col

Column storing emission factors in tCO2 per tonne-kilometre.

sludge_treatment_emission_factor_col

Optional column storing emission factors for sludge treatment.

chemical_dosage_col

Optional column storing chemical usage in tonnes.

chemical_emission_factor_col

Optional column storing emission factors in tCO2 per tonne of chemical.

displaced_fossil_fuel_col

Optional column storing fossil fuel displaced by biogas utilisation in GJ.

displaced_fossil_fuel_emission_factor_col

Optional column storing emission factors in tCO2 per GJ (credited as negative leakage).

group_cols

Optional character vector specifying grouping columns.

output_col

Name of the output column for leakage emissions in tCO2e.

Value

Tibble containing grouped leakage emissions in tCO2e.

Examples

leakage <- tibble::tibble(
  site_id = c("WW1", "WW2"),
  sludge_tonnes = c(450, 320),
  transport_distance_km = c(25, 40),
  transport_ef_tco2_per_tkm = c(0.0001, 0.00012)
)
calculate_leakage_emissions_iiih(leakage, group_cols = "site_id")
#> Error in dplyr::mutate(data_tbl, .transport_component = .data[[sludge_mass_col]] *     .data[[transport_distance_col]] * .data[[transport_emission_factor_col]],     .treatment_component = if (!is.null(sludge_treatment_emission_factor_col)) {        .data[[sludge_mass_col]] * .data[[sludge_treatment_emission_factor_col]]    } else {        0    }, .chemical_component = if (!is.null(chemical_dosage_col) &&         !is.null(chemical_emission_factor_col)) {        .data[[chemical_dosage_col]] * .data[[chemical_emission_factor_col]]    } else {        0    }, .displacement_component = if (!is.null(displaced_fossil_fuel_col) &&         !is.null(displaced_fossil_fuel_emission_factor_col)) {        .data[[displaced_fossil_fuel_col]] * .data[[displaced_fossil_fuel_emission_factor_col]]    } else {        0    }, .leakage_component = .transport_component + .treatment_component +         .chemical_component - .displacement_component):  In argument: `.treatment_component = if (...) NULL`.
#> Caused by error in `.data[["sludge_treatment_ef_tco2_per_tonne"]]`:
#> ! Column `sludge_treatment_ef_tco2_per_tonne` not found in `.data`.