RUFAS.biophysical.manure.storage.storage module#

RUFAS.biophysical.manure.storage.storage.MANURE_CONVERSION_CONSTANT = 0.1175#

Factor to estimate m^3 of herd-wide manure produced per day per mature cow housed on the farm (m^3/day).

RUFAS.biophysical.manure.storage.storage.FREEBOARD_CONSTANT = 1.2#

Represents 20% volume allowance above the maximum volume of a slurry or liquid manure storage (unitless).

RUFAS.biophysical.manure.storage.storage.DEPTH_CONSTANT = 4.572#

Value for slurry or liquid manure storage depth (m).

RUFAS.biophysical.manure.storage.storage.PRECIPITATION_CONSTANT = 0.25#

The annual precipitation constant value (m).

class RUFAS.biophysical.manure.storage.storage.Storage(name: str, is_housing_emissions_calculator: bool, cover: str | StorageCover, storage_time_period: int | None, surface_area: float, capacity: float = inf)#

Bases: Processor

Base manure Storage class.

Parameters#

coverstr

What the storage will be covered with, if anything.

storage_time_periodint | None

How long manure is stored for before emptying the storage (days). None if the storage is never emptied.

surface_areafloat

The surface area of the manure storage (m^2).

capacityfloat, default math.inf

Volumetric capacity of the storage (m^3).

Attributes#

_received_manureManureStream

The total amount of manure received by a storage in a single day.

stored_manureManureStream

The current amount of manure currently held by the storage.

_capacityfloat

The volumetric capacity of the storage (m^3).

_coverStorageCover

The cover of the storage.

_storage_time_periodint | None

Interval between emptyings of the storage (days). If the storage is never emptied, this is None.

_surface_areafloat

Surface area of the manure storage (m^2).

_manure_to_processManureStream

The manure that is processed during the process_manure() method call.

intercept_mean_tempfloat

The intercept mean temperature calculate from linest function.

phase_shiftfloat

Temperature phase shift of the weather data.

amplitudefloat

The temperature amplitude of the weather data.

__init__(name: str, is_housing_emissions_calculator: bool, cover: str | StorageCover, storage_time_period: int | None, surface_area: float, capacity: float = inf) None#

Initializes a manure Storage.

intercept_mean_temp: float | None#
phase_shift: float | None#
amplitude: float | None#
property is_overflowing: bool#

True if the manure in storage exceeds the storage’s volumetric capacity, else False.

property _emptying_fraction: float#

The fraction of the accumulated stored manure that is removed from storage when the emptying time is reached. Defaults to 1.0.

_determine_outdoor_storage_temperature(simulation_day: int, minimum_manure_temperature: float) float#

Determines the temperature of the manure in outdoor liquid and slurry storages.

Parameters#

simulation_dayint

Current julian day of the year.

minimum_manure_temperaturefloat

The minimum temperature of the manure in storage (°C).

Returns#

float

The estimated temperature of the manure storage (°C).

Notes#

This function determines daily temperature of manure in liquid storage by fitting a sin/cos function. Several parameters of this function are derived and utilized here. The amplitude of simulation-wide average air temperature data, which is derived by least squares fitting cos and sin waves to temperature data, is adjusted by a fixed damping factor to reflect the smaller degree of annual variation in temperature compared to air temperature. The phase shift (time of peak of annual temperature) is also determined from simulation weather data and is adjusted to reflect the time of manure temperature change based on a fixed lag constant.

_calculate_surface_area() None#

Calculates the surface area of the storage.

receive_manure(manure: ManureStream) None#

Receives manure and puts it in storage to be processed.

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

Adds the manure received on the current day to the manure already stored, and empties the storage if scheduled.

_validate_emptying_fraction() None#

Validates that the emptying fraction is between 0.0 and 1.0.

handle_overflowing_manure(time: RufasTime) None#

Deals with excess manure when amount in storage exceeds capacity.

Parameters#

timeRufasTime

RufasTime instance tracking the current time of the simulation.

_abc_impl = <_abc._abc_data object>#
static _calculate_methane_emissions(volatile_solids: float, manure_temperature: float, is_degradable: bool) float#

Calculates methane that is emitted from liquid manure storages by calculating emissions from the degradable and non-degradable volatile solids fractions.

Parameters#

volatile_solidsfloat

Mass of volatile solids that are emitting methane (kg). Can be degradable or non-degradable.

manure_temperaturefloat

Temperature of the manure in storage (degrees C).

is_degradablebool

True if the volatile solids are degrdable, otherwise false.

Returns#

float

Methane emission from volatile solids (kg).

static _calculate_arrhenius_exponent(temperature: float) float#

Calculate the Arrhenius exponent.

Parameters#

temperaturefloat

Temperature in Celsius (degrees C).

Returns#

float

Arrhenius exponent (unitless).

Raises#

ValueError

If the temperature is not between -40 and 60 degrees Celsius.

static _calculate_cover_and_flare_methane(methane_loss: float) tuple[float, float]#

Adjust the methane burned and lost when using cover and flare cover type.

Parameters#

methane_loss: float

The amount of methane lost (kg).

Returns#

tuple[float, float]

The amount of storage methane burned and the adjusted methane loss (kg).

static _calculate_nitrous_oxide_emissions(nitrous_oxide_emissions_factor: float, nitrogen_added: float) float#

Calculates amount of nitrous oxide nitrogen emitted from a storage on a single day.

Parameters#

nitrous_oxide_emissions_factorfloat

The emission factor for nitrous oxide (kg nitrous oxide nitrogen / kg nitrogen).

nitrogen_added: float

Amount of nitrogen that was added to the storage on the current day (kg).

Returns#

float

Nitrous oxide nitrogen emissions (kg).