bonsai_ipcc.industry.chemical package

Submodules

bonsai_ipcc.industry.chemical.elementary module

Greenhouse Gas Emission Calculations for Chemical Production

This script calculates CO2 and CH4 emissions from chemical production using IPCC Tier 1-3 methods. It includes functions for:

Tier 1: CO2 emissions using emission factors Tier 2: CO2 emissions via mass balance Tier 3: Direct measurement of CO2 emissions Detailed analysis of combustion, process vent, and flaring emissions Fugitive and process vent methane emissions These reusable functions leverage annual production data, emissions factors, and mass balances. Ensure all input data units are consistent when using these functions.

Author: @Albertkwame Affiliation: Aalborg University, Copenhagen Email: ako@plan.aau.dk

bonsai_ipcc.industry.chemical.elementary.e_combustion(fa_i_k: float, ncv_k: float, ef_k: float) float[source]

Calculate the CH4 emissions from the combustion of a specific fuel k for petrochemical product i.

This is a part of Equation 3.28 from the IPCC guidelines. The function calculates the emissions for one type of fuel and should be used inside a loop to sum the emissions for all types of fuel.

Parameters: - fa_ij_k: The amount of fuel k consumed for production of petrochemical i, in tonnes. - ncv_k: The net calorific value of fuel k, in TJ/tonne. - ef_k: The CH4 emission factor of fuel k, in kg/TJ.

Returns: - CH4 emissions from the combustion of fuel k for product i.

bonsai_ipcc.industry.chemical.elementary.e_flare(fg_i_k: float, ncv_k: float, ef_k: float) float[source]

Calculate the CH4 emissions from the flaring of a specific gas k for petrochemical product i.

This is a part of Equation 3.29 from the IPCC guidelines. The function calculates the emissions for one type of flared gas and should be used inside a loop to sum the emissions for all types of flared gas.

Parameters: - fg_ij_k: The amount of gas k flared during production of petrochemical i, in tonnes. - ncv_k: The net calorific value of flared gas k, in TJ/tonne. - ef_k: The CH4 emission factor of flared gas k, in kg/TJ.

Returns: - CH4 emissions from the flaring of gas k for product i.

bonsai_ipcc.industry.chemical.elementary.e_hfc_23_by_monitoring(c_i: float, p_i: float) float[source]

Calculate total HFC-23 emissions from individual process streams by monitoring reactor product (Equation 3.36).

Parameters:
  • c_i (float) – Concentration of HFC-23 relative to the HCFC-22 product (kg HFC-23/kg HCFC-22).

  • p_i (float) – Mass flow of HCFC-22 from the plant reactor (kg).

Returns:

Total HFC-23 emissions for the given plant.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.e_hfc_23_direct_method(c_ij: float, f_ij: float) float[source]

Calculate total HFC-23 emissions from individual process streams using the direct method (Equation 3.34).

Parameters:
  • c_ij (float) – Concentration of HFC-23 in the stream (kg HFC-23).

  • f_ij (float) – Mass flow of the stream (kg).

Returns:

Total HFC-23 emissions for the given stream.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.e_hfc_23_proxy_method(e_ij: float) float[source]

Calculate total HFC-23 emissions from individual process streams using proxy methods (Equation 3.35).

Parameters:

e_ij (float) – Emissions from each plant and stream determined by the proxy methods (kg).

Returns:

Total HFC-23 emissions for the given stream.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.e_i(c_i: float, p_i: float, tf: float, r_i: float) float[source]

Calculate the emissions of HFC-23 from an individual facility based on in-process measurements (Equation 3.40).

Parameters:
  • c_i (float) – The concentration of HFC-23 in the reactor product at facility i (kg HFC-23/kg HCFC-22).

  • p_i (float) – The mass of HCFC-22 produced at facility i while this concentration applied (kg).

  • tf (float) – The fractional duration during which this HFC-23 is actually vented to the atmosphere (dimensionless).

  • r_i (float) – The quantity of HFC-23 recovered from facility i for use as chemical feedstock, and hence destroyed (kg).

Returns:

The HFC-23 emissions from an individual facility (kg).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.e_ij_hfc_23_proxy_method(s_ij: float, f_ij: float, por_ij: float, t: float, r_ij: float) float[source]

Calculate HFC-23 emissions from an individual process stream using the proxy method (Equation 3.38).

Parameters:
  • s_ij (float) – The standard mass emission of HFC-23 in vent stream j at plant i (kg).

  • f_ij (float) – A dimensionless factor relating the measured standard mass emission rate to the emission rate at the actual plant operating rate.

  • por_ij (float) – The proxy operating rate (such as process operating rate) at plant i during the trial (unit/hour).

  • t (float) – The total duration of venting for the year, or the period if the process is not operated continuously (hours).

  • r_ij (float) – The quantity of HFC-23 recovered for vent stream j at plant i for use as chemical feedstock, or hence destroyed (kg).

Returns:

The mass emission of HFC-23 from the process stream j at plant i (kg).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.e_ij_instantaneous_hfc_23_direct_method(c_ij: float, f_ij: float, t: float) float[source]

Calculate ‘instantaneous’ HFC-23 emissions from an individual process stream (Equation 3.37).

Parameters:
  • c_ij (float) – Concentration of HFC-23 in the gas stream from the process stream (kg HFC-23/kg gas).

  • f_ij (float) – Mass flow of the gas stream from the process stream (kg gas/hour).

  • t (float) – The length of time over which these parameters are measured and remain constant (hours).

Returns:

The ‘instantaneous’ HFC-23 emissions for the given process stream (kg).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ech4_fugitive(pp: float, ef: float) float[source]

Calculate fugitive CH4 emissions from the production of chemical i using Equation 3.23.

Parameters:
  • pp (float) – Annual production of chemical i, in tonnes.

  • ef (float) – CH4 fugitive emission factor for chemical i, in kg CH4/tonne product.

Returns:

Fugitive emissions of CH4 from production of chemical i, in kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ech4_process_vent(pp: float, ef: float) float[source]

Calculate process vent CH4 emissions from the production of chemical i using Equation 3.24.

Parameters:
  • pp (float) – Annual production of chemical i, in tonnes.

  • ef (float) – CH4 process vent emission factor for chemical i, in kg CH4/tonne product.

Returns:

Process vent emissions of CH4 from production of chemical i, in kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ech4_tier1(ech4_fugitive: float, ech4_process_vent: float) float[source]

Calculate total CH4 emissions from the production of chemical i using Equation 3.25.

Parameters:
  • ech4_fugitive (float) – CH4 fugitive emission factor for chemical i, in kg CH4/tonne product.

  • ech4_process_vent (float) – CH4 process vent emission factor for chemical i, in kg CH4/tonne product.

Returns:

Total CH4 emissions from production of chemical i, in kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ech4_tier3a(c_total_vocs: float, ch4_fraction: float, ch4_background_level: float, WS: float, PA: float) float[source]

Calculate total plant CH4 emissions from atmospheric measurement data using Equation 3.26.

Parameters:
  • c_total_vocs (float) – VOC concentration at the plant, in micrograms/m^3.

  • ch4_fraction (float) – Fraction of total VOC concentration that is CH4.

  • ch4_background_level (float) – Ambient CH4 concentration at background location, in micrograms/m^3.

  • WS (float) – Wind speed at the plant, in metres/second.

  • PA (float) – Plume area, in square metres.

Returns:

Total CH4 emissions from the plant, in micrograms/second.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ech4_tier3b(e_combustion: float, ech4_process_vent: float, e_flare: float) float[source]

Calculate the total emissions of CH4 from production of chemical i using Equation 3.27.

Parameters:
  • e_combustion (float) – Emissions of CH4 from fuel combustion, in kg.

  • ech4_process_vent (float) – Emissions of CH4 from process vents, in kg.

  • e_flare (float) – Emissions of CH4 from flared waste gases, in kg.

Returns:

The total emissions of CH4 from production of chemical i, in kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.eco2_tier1(pp: float, ef: float, gaf: float) float[source]

Implements Equation 3.15 to calculate the CO2 emissions for chemical production using Tier 1 emission factors.

This method computes the CO2 emissions by considering the annual production of the chemical, its specific CO2 emission factor, and a geographic adjustment factor, as per Equation 3.15.

Parameters:
  • pp (float) – Annual production of chemical i, in tonnes.

  • ef (float) – CO2 emission factor for chemical i, in tonnes CO2/tonne product produced.

  • gaf (float) – Geographic Adjustment Factor (GAF) as a percentage for Tier 1 CO2 emission factors for ethylene production.

Returns:

The calculated CO2 emissions from the production of chemical i, in tonnes.

Return type:

float

Examples

>>> eco2_tier1(1000, 0.5, 100)
500.0

Notes

The GAF should be provided as a percentage value where 100 represents no adjustment, less than 100 indicates a reduction, and more than 100 indicates an increase in the CO2 emissions due to geographic efficiency differences.

bonsai_ipcc.industry.chemical.elementary.eco2_tier2(fa_fc, pp_pc, sp_sc) float[source]

Implements Equation 3.17 to calculate CO2 emissions from the production of chemical i using the Tier 2 mass balance method. Equation has been subdivided.

Parameters:
  • fa_fc (float) – Annual carbon content of feedstock, in tonnes.

  • pp_pc (float) – Annual carbon content of primary petrochemical, in tonnes.

  • sp_sc (float) – Annual carbon content of secondary product, in tonnes.

Returns:

CO2 emissions from the production of chemical i, in t/yr.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ef_carbon_balance(cbe: float, f_efficiency_loss: float, fcc: float = 0.81) float[source]

Calculate the HFC-23 emission factor from carbon balance efficiency (Equation 3.32).

Parameters:
  • cbe (float) – Carbon balance efficiency, percent.

  • f_efficiency_loss (float) – Factor to assign efficiency loss to HFC-23, fraction.

  • fcc (float) – Factor for the carbon content of this component (default is 0.81 kg HFC-23/kg HCFC-22).

Returns:

The HFC-23 emission factor calculated from carbon balance efficiency.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ef_fluorine_balance(fbe: float, f_efficiency_loss: float, ffc: float = 0.54) float[source]

Calculate the HFC-23 emission factor from fluorine balance efficiency (Equation 3.33).

Parameters:
  • fbe (float) – Fluorine balance efficiency, percent.

  • f_efficiency_loss (float) – Factor to assign efficiency loss to HFC-23, fraction.

  • ffc (float) – Factor for the fluorine content of this component (default is 0.54 kg HFC-23/kg HCFC-22).

Returns:

The HFC-23 emission factor calculated from fluorine balance efficiency.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.ef_hfc23_average(carbon, flurine)[source]

Calculate average of carbon and flurine emission factor (as described on page 3.13)

Parameters:
  • carbon (float) – hfc23 emission factor for carbon balance (kg/kg)

  • flurine (float) – hfc23 emission factor flurine balance (kg/kg)

Returns:

hfc23 average emission factor of (kg/kg)

Return type:

float

bonsai_ipcc.industry.chemical.elementary.fa_fc(fa, fc) float[source]

Implements Equation 3.17 to calculate the carbon input of the production of chemical i using the Tier 2 mass balance method.

Parameters:
  • fa (float) – Annual consumption of feedstock k for production of chemical i, in tonnes.

  • fc (float) – Carbon content of feedstock k, in tonnes C/tonne feedstock.

Returns:

annual carbon content of feedstock, in t/yr.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.pp_i(fa, spp) float[source]

Implements Equation 3.16 to estimate the annual production of a chemical using feedstock consumption and specific production factors.

Parameters:
  • fa (float) – annual consumption for the production of chemical (i), in tonnes.

  • spp (float) – primary product production factor for chemical (i), in tonnes of primary product per tonne of feedstock consumed.

Returns:

The estimated annual production of the chemical (PP_i), in tonnes.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.pp_pc(pp, pc) float[source]

Implements Equation 3.17 to calculate carbon output of the production of chemical i using the Tier 2 mass balance method.

Parameters:
  • pp (float) – Annual production of primary chemical product i, in tonnes.

  • pc (float) – Carbon content of primary chemical product i, in tonnes C/tonne product.

Returns:

annual carbon content of primary petrochemical, in t/yr.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.sp_acrylonitrile_j(fp_acrylonitrile, ssp) float[source]

Implements Equation 3.19 to estimate the annual production of a secondary product j from acrylonitrile production.

Parameters:
  • fp_acrylonitrile (float) – acrylonitrile production from feedstock k, t/yr

  • ssp (float) – specific secondary product production factor for secondary product j and feedstock k, t/t

Returns:

Total annual production of the secondary product.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.sp_ethylene_j(fa_ethylene, ssp) float[source]

Implements Equation 3.18 to estimate the annual production of a secondary product j from ethylene production.

Parameters:
  • fa_ethylene_k (float) – ethylene production from feedstock k, t/yr

  • ssp (float) – secondary product product production factor for secondary product, t/t

Returns:

Total annual production of the secondary product, t/yr

Return type:

float

bonsai_ipcc.industry.chemical.elementary.sp_sc(sp, sc) float[source]

Implements Equation 3.17 to calculate CO2 emissions from the production of chemical i using the Tier 2 mass balance method.

Parameters:
  • sp (float) – Annual amount of secondary product j produced from the production process for chemical i, in tonnes.

  • sc (float) – Carbon content of secondary product j, in tonnes C/tonne product.

Returns:

annual carbon content of secondary product, in t/yr.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.st_ij(ct_ij: float, ft_ij: float, por_t_ij: float) float[source]

Calculate the standard emission for the proxy method (Equation 3.39).

Parameters:
  • ct_ij (float) – The average mass fractional concentration of HFC-23 in vent stream j at plant i during the trial (kg HFC-23/kg gas).

  • ft_ij (float) – The average mass flow rate of vent stream j at plant i during the trial (kg/hour).

  • por_t_ij (float) – The proxy quantity (such as process operating rate) at plant i during the trial (unit/hour).

Returns:

The standard mass emission of HFC-23 in vent stream j at plant i (‘unit’ in units compatible with the factors in Equation 3.38).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.tier1_e_hfc_23(ef_default: float, p_hcfc_22: float) float[source]

Estimate HFC-23 emissions from HCFC-22 production using the Tier 1 default factor. This is a part of Equation 3.30 from the IPCC guidelines.

Parameters:
  • ef_default (float) – HFC-23 default emission factor, kg HFC-23/kg HCFC-22.

  • p_hcfc_22 (float) – Total HCFC-22 production, kg.

Returns:

Estimated HFC-23 emissions, kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.tier1_e_k(ef_default_k: float, p_k: float) float[source]

Calculate the production-related emissions of fluorinated greenhouse gases (Equation 3.41).

Parameters:
  • ef_default_k (float) – Default emission factor for the greenhouse gas (kg/kg).

  • p_k (float) – Total production of the fluorinated greenhouse gas (kg).

Returns:

Production-related emissions of the greenhouse gas (kg).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.tier2_e_hfc_23(ef_calculated: float, p_hcfc_22: float, f_released: float) float[source]

Estimate HFC-23 emissions from HCFC-22 production using calculated factors from process efficiencies (Tier 2). This is a part of Equation 3.31 from the IPCC guidelines.

Parameters:
  • ef_calculated (float) – HFC-23 calculated emission factor, kg HFC-23/kg HCFC-22.

  • p_hcfc_22 (float) – Total HCFC-22 production, kg.

  • f_released (float) – Fraction of the year that this stream was released to atmosphere untreated.

Returns:

Estimated HFC-23 emissions, kg.

Return type:

float

bonsai_ipcc.industry.chemical.elementary.tier3_e_k_direct(c_ij: float, f_ij: float, t: float) float[source]

Calculate the total production-related emissions of fluorinated greenhouse gases using Tier 3 direct method (Equation 3.42).

Parameters:
  • c_ij (float) – The concentration of the fluorinated greenhouse gas in the stream j at plant i (kg/kg).

  • f_ij (float) – The mass flow of the gas stream j at plant i (kg/hour).

Returns:

The total production-related emissions for the given plant and stream (kg).

Return type:

float

bonsai_ipcc.industry.chemical.elementary.tier3_e_k_proxy(e_ij: float) float[source]

Calculate the total production-related emissions of fluorinated greenhouse gases using Tier 3 proxy method (Equation 3.43).

Parameters:

e_ij (float) – The emissions of fluorinated greenhouse gas from each plant and stream determined by the proxy methods (kg).

Returns:

The total production-related emissions for the given plant and stream using proxy methods (kg).

Return type:

float

bonsai_ipcc.industry.chemical.sequence module

bonsai_ipcc.industry.chemical.sequence.tier1_ch4_pp(year=2006, region='GB', product='methanol', uncertainty='def')[source]

Tier 1 method total CH4 emissions calculations. Starting with data input for parameter pp (anual production of petrochemical)

Argument

yearint

year under study

regionstr

region under study

productstr

type of petrochemical product

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier1_co2_fa(year=2006, region='GB', product='methanol', uncertainty='def')[source]

Tier 1 method CO2 Emissions. Starting with data input for parameter fa (anual consumption of feedstock)

Argument

yearint

year under study

regionstr

region under study

productstr

type of petrochemical product

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier1_co2_pp(year=2006, region='GB', product='methanol', uncertainty='def')[source]

Tier 1 method CO2 Emissions. Starting with data input for parameter pp (anual production of petrochemical)

Argument

yearint

year under study

regionstr

region under study

productstr

type of petrochemical product

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier1_e_hfc23(year=2006, region='GB', uncertainty='def')[source]

Tier 1 method HFC-23 emissions based on default IPCC emission factors (Equation 3.30).

Argument

yearint

year under study

regionstr

region under study

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier1_fgas(year=2006, region='GB', product='hfc-32', uncertainty='def')[source]

Tier 1 method F-GAS emissions calculations. Starting with data input for parameter ef_default_k (production-related emissions of fluorinated greenhouse gas) and p_k (total production of fluorinated greenhouse gas k, kg)

Argument

yearint

year under study

regionstr

region under study

productstr

type of fluorinated greenhouse gas

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier2_co2(year=2006, region='GB', product='methanol', uncertainty='def')[source]

Tier 2 method CO2 Emissions.

Argument

yearint

year under study

regionstr

region under study

productstr

type of petrochemical product

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Inlcudes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier2_e_hfc23(year=2006, region='GB', uncertainty='def')[source]

Tier 2 method HFC-23 emissions based on calculated emission factors via carbon or fluorine balance eficiency methods (Equation 3.31).

Argument

yearint

year under study

regionstr

region under study

uncertaintystr

‘analytical’, ‘monte_carlo’ or a property dimension, e.g. ‘def’

returns:

VALUE – Includes the results of each step of the sequence.

rtype:

DataClass

bonsai_ipcc.industry.chemical.sequence.tier3_fgas(year: int = 2006, region: str = 'a specific plant', fgas: str = 'pfc-14', uncertainty: str = 'def')[source]

Tier 3 direct calculation of production related emissions for fluorinated greenhouse gases.

Based on data input for parameter c_ij (concentration of F-GAS ‘k’ in the gas stream vented from process stream ‘j’ at plant ‘i’) and f_ij (mass flow of the gas stream for F-GAS ‘k’ from process stream ‘j’ at plant ‘i’).

Parameters:
  • year (int) – Year under study.

  • region (str) – Region under study. For tier 3, this can be a specific plant.

  • fgas (str) – Type of fluorinated greenhouse gas.

  • uncertainty (str) – Uncertainty definition for calculations.

Returns:

VALUE – Total production-related emissions for the given product and region in the specified year.

Return type:

float

Module contents