RUFAS.biophysical.manure.storage.composting module#

class RUFAS.biophysical.manure.storage.composting.Composting(name: str, composting_type: str, storage_time_period: int, surface_area: float = inf)#

Bases: Storage

Class for managing and simulating the composting process of manure treatment.

This class simulates the composting process by considering various factors like weather, manure characteristics, and composting configurations. It provides methods for daily update of compost characteristics such as methane emissions, nitrogen content, and carbon decomposition. The calculations are based on standard composting models and environmental factors.

Parameters#

namestr

The name of the storage.

composting_typestr

The type of the composting process being used.

storage_time_periodint

The storage time period.

__init__(name: str, composting_type: str, storage_time_period: int, surface_area: float = inf)#

Initializes a manure Storage.

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

Processes manure in Composting.

Parameters#

current_day_conditionsCurrentDayConditions

The current day conditions.

timeRufasTime

The time of the simulation.

Returns#

dict[str, ManureStream]

_The processed manure stream.

_apply_dry_matter_loss(methane_emission: float, carbon_decomposition: float) None#

This function calculates and then applies the dry matter loss to the received manure in place.

Parameters#

methane_emissionfloat

The methane emission on the current day, kg/day.

carbon_decompositionfloat

The carbon decomposition on the current day, kg/day.

Raises#

ValueError

If any of the dry matter loss calculations results in negative values for received-manure non-degradable volatile solids, degradable volatile solids, or total solids.

_apply_nitrogen_losses(storage_nitrous_oxide_N: float, storage_ammonia_N: float, storage_N_loss_from_leaching: float) None#

This function applies the nitrogen losses to the received manure nitrogen and ammoniacal nitrogen in place.

Parameters#

storage_nitrous_oxide_Nfloat

The nitrogen loss through nitrous oxide emissions on the current day, kg.

storage_ammonia_Nfloat

The nitrogen loss through ammonia emissions on the current day, kg.

storage_N_loss_from_leachingfloat

The nitrogen loss through leaching on the current day, kg.

Raises#

ValueError

If the total nitrogen losses are greater than the total received manure nitrogen.

static _calculate_composting_ammonia_emissions(composting_type: CompostingType, received_manure_nitrogen: float) float#

This function calculates the total nitrogen loss to ammonia emission on the current day.

Parameters#

composting_typeCompostingType

The type of composting being used.

received_manure_nitrogenfloat

The nitrogen content of the received manure, kg.

Returns#

float

The total nitrogen loss to ammonia emission on the current day, kg.

static _calculate_composting_methane_emissions(manure_temperature: float, manure_volatile_solids: float, composting_type: CompostingType) float#

This function calculates the composting solid manure methane emission on the current day.

Parameters#

manure_temperaturefloat

The manure temperature on the current day, Celsius.

manure_volatile_solidsfloat

The manure volatile solids of the received manure, kg.

composting_typeCompostingType

The type of composting being used.

Returns#

float

The solid manure methane emission on the current day, kg/day.

static _calculate_methane_conversion_factor(manure_temperature: float, composting_type: CompostingType) float#

This function returns the methane conversion factor depending on the composting type and the temperature.

Parameters#

manure_temperaturefloat

The mean annual manure temperature, Celsius.

composting_typeCompostingType

The type of composting being used.

Returns#

float

The methane conversion factor, unitless.

_abc_impl = <_abc._abc_data object>#