RUFAS.biophysical.manure.digester.continuous_mix module#

class RUFAS.biophysical.manure.digester.continuous_mix.ContinuousMix(name: str, anaerobic_digestion_temperature_set_point: float, hydraulic_retention_time: int, biogas_leakage_fraction: float)#

Bases: Digester

Defines the behaviors and attributes of an anaerobic digester type, specifically a continuous stirred tank reactor.

Parameters#

namestr

Unique identifier of the anaerobic digester.

anaerobic_digestion_temperature_set_pointfloat

Temperature set point for the anaerobic digestion (°C).

hydraulic_retention_timeint

Number of days manure spends in the anaerobic digester (days).

biogas_leakage_fractionfloat

Fraction of biogas generated in the anaerobic digester that escapes to the atmosphere through unintended leakage and is not collected by the gas capture system (unitless).

Attributes#

_manure_in_digesterManureStream

The total amount of manure received by an anaerobic digester in a single day.

_temperature_set_pointfloat

Temperature set point for the anaerobic digestion (°C).

_hydraulic_retention_timeint

Number of days manure spends in the anaerobic digester (days).

_biogas_leakage_fractionfloat

Fraction of methane generated in the anaerobic digester that escapes to the atmosphere through unintended leakage and is not collected by the gas capture system (unitless).

__init__(name: str, anaerobic_digestion_temperature_set_point: float, hydraulic_retention_time: int, biogas_leakage_fraction: float) None#

Initializes a new Processor.

receive_manure(manure: ManureStream) None#

Receives and stores manure to be digested.

process_manure(conditions: CurrentDayConditions, time: RufasTime) dict[str, ManureStream]#

Digests manure received on the current day.

_calculate_generated_carbon_dioxide(generated_methane_volume: float) tuple[float, float]#

Calculate the mass and volume of carbon dioxide generated based on the generated methane volume.

Parameters#

generated_methane_volumefloat

The volume of generated methane from which carbon dioxide generation is calculated.

Returns#

tuple[float, float]

A tuple containing: - generated_carbon_dioxide_mass : float

The calculated mass of generated carbon dioxide.

  • generated_carbon_dioxide_volumefloat

    The calculated volume of generated carbon dioxide.

Notes#

The calculation uses the ideal gas law and the ratio of carbon dioxide to methane to determine the density, mass, and volume of the generated carbon dioxide.

_calculate_generated_methane() tuple[float, float]#

Calculates the generated methane mass and volume.

Uses the supplied temperature set point and volatile solids in the digester to compute the density of methane and its corresponding volume and mass.

Returns#

tuple[float, float]

A tuple containing: - generated_methane_mass (float): The mass of generated methane. - generated_methane_volume (float): The volume of generated methane.

_destroy_volatile_solids(total_volatile_solids_destruction: float, time: RufasTime) ManureStream#

Adjusts the quantities of solids in the manure after volatile solids are destroyed.

Parameters#

total_volatile_solids_destructionfloat

Amount of volatile solids removed from the manure (kg).

timeRufasTime

RufasTime instance tracking time of the simulation.

Returns#

ManureStream

Manure being processed by the anaerobic digester after volatile solids are removed.

_report_continuous_mix_outputs(captured_biogas_volume: float, captured_methane_volume: float, methane_leakage_mass: float, simulation_day: int) None#

Reports manure that was digested and the amounts of different things that were lost or generated in the anaerobic digestion process.

Parameters#

captured_biogas_volumefloat
Captured biogas (assumed to be composed of 40% CO2, 60% CH4) volume after accounting for leakage

on the current day (m^3).

captured_methane_volumefloat

Capture methane volume on the current day, after accounting for leakage (m^3).

methane_leakage_massfloat

The mass of methane lost to the atmosphere through unintended leakage on the current day (kg).

simulation_dayint

The current simulation day.

static _calculate_CSTR_methane_volume(total_volatile_solids: float) float#

Calculates volume of methane generated from a continuously-stirred tank reactor.

Parameters#

total_volatile_solidsfloat

Total volatile solids contained in manure (kg).

Returns#

float

Methane generation volume (m^3).

Notes#

This function originates from personal communications with subject matter experts Wei Liao (liaow@msu.edu) and April Leytem (april.leytem@usda.gov). The equation is a simplification of the IPCC Tier II estimate of CH4 emissions from anaerobic digesters, where CH4 generated in the digester is assumed to be equivalent to the amount of manure volatile solids loaded per day, multiplied by the generally-accepted methane potential value for dairy manure (240 L CH4 per kg of manure volatile solids).

static _calculate_methane_leakage(generated_methane_mass: float, generated_methane_volume: float, leakage_fraction: float) tuple[float, float]#

Calculates the mass of methane lost from an anaerobic digester as leakage.

Parameters#

generated_methane_massfloat

The mass of methane generated within the digester (kg).

generated_methane_massfloat

The volume of methane generated within the digester (m^3).

leakage_fractionfloat

Fraction of generated methane that escapes as leakage (unitless).

Returns#

tuple[float, float]
  • Mass of methane lost as leakage (kg).

  • Volume of methane lost as leakage (m^3).

_abc_impl = <_abc._abc_data object>#