RUFAS.routines.manure.manure_treatments.base_manure_treatment module#
- class RUFAS.routines.manure.manure_treatments.base_manure_treatment.BaseManureTreatment(weather: Weather, time: RufasTime, manure_treatment_config: ManureTreatmentConfig | Tuple[ManureTreatmentConfig, ManureTreatmentConfig])#
Bases:
ABC
Base class for all manure treatment classes.
- Attributes:
weather: A Weather object. time: A RufasTime object. config: A ManureTreatmentConfig object containing the configuration for the manure treatment.
- __init__(weather: Weather, time: RufasTime, manure_treatment_config: ManureTreatmentConfig | Tuple[ManureTreatmentConfig, ManureTreatmentConfig]) None #
Initializes the BaseManureTreatment class.
- Args:
weather: A Weather object. time: A RufasTime object. manure_treatment_config: A ManureTreatmentConfig object containing the
configuration for the manure treatment.
- Private attributes:
_sim_day: The current simulation day. _current_pen: The current pen object. _manure_handler_daily_output: The daily output of the manure handler. _current_manure_treatment_daily_input: The current input data assigned based on the
input data passed into the daily_update() method.
_manure_separator: Present in the separator - digester - separator - lagoon scenario. _manure_separator_daily_output: Only present in the digester - separator - lagoon scenario. _accumulated_output: Summation of all daily outputs.
- property accumulated_output: ManureTreatmentDailyOutput#
Returns the accumulated output of the manure treatment. Returns ——- ManureTreatmentDailyOutput
A ManureTreatmentDailyOutput object containing the accumulated output of the manure treatment.
- property manure_separator_after_digestion_daily_output: ManureSeparatorDailyOutput | None#
Returns the daily output of the intervening separator in the digester - separator - lagoon scenario.
- Returns:
A ManureSeparatorDailyOutput object containing the daily output of the intervening separator in the digester - separator - lagoon scenario.
- _initialize_private_attributes_during_update(sim_day: int, current_pen: ManureManagerPen, manure_handler_daily_output: ManureHandlerDailyOutput, manure_treatment_daily_input: LiquidManurePortionProtocol, manure_separator: BaseManureSeparator, manure_separator_after_digestion: BaseManureSeparator) None #
Initializes the private attributes of the class.
- Args:
sim_day: The current simulation day. current_pen: The current pen. manure_handler_daily_output: The daily output of the manure handler. manure_treatment_daily_input: The daily input of the manure treatment. manure_separator: The manure separator. manure_separator_after_digestion: The manure separator between the digestor and lagoon.
- _initialize_daily_output_during_update(manure_treatment_daily_input: LiquidManurePortionProtocol) ManureTreatmentDailyOutput #
Initializes the daily output of the manure treatment, which will be subsequently modified.
Typically, this method should be called at the beginning of the _daily_update_helper() method. The generated ManureTreatmentDailyOutput object can then be modified depending on the nature of the manure treatment subclass.
- Args:
- manure_treatment_daily_input: A LiquidManurePortionProtocol object containing
the daily input of the manure treatment.
- Returns:
A ManureTreatmentDailyOutput object containing the daily output of the manure treatment.
- daily_update(manure_handler_daily_output: ManureHandlerDailyOutput, manure_treatment_daily_input: LiquidManurePortionProtocol, pen: ManureManagerPen, sim_day: int, manure_separator: BaseManureSeparator | None = None, manure_separator_after_digestion: BaseManureSeparator | None = None) ManureTreatmentDailyOutput #
Calculates the daily output of the manure treatment.
- Args:
- manure_handler_daily_output: A ManureHandlerDailyOutput object containing the
daily output of the manure handler.
- manure_treatment_daily_input: A LiquidManurePortionProtocol object containing
the daily input of the manure treatment.
pen: A ManureManagerPen object. sim_day: The current simulation day. manure_separator: A optional BaseManureSeparator object meant to be used in the special
case of digester-separator-lagoon configuration triple.
- manure_separator_after_digestion: An optional BaseManureSeparator object meant to be used in the special
case of digester-separator-lagoon configuration triple.
- Returns:
- A ManureTreatmentDailyOutput object containing the output of the manure
treatment for the current simulation day.
- abstractmethod _daily_update_helper() ManureTreatmentDailyOutput #
Helper method for the daily_update() method.
This method is called immediately after the private attributes of the class are initialized, and it is up to the subclass to decide what to put in here.
- Returns:
- A ManureTreatmentDailyOutput object containing the output of the manure
treatment for the current simulation day.
- static _determine_outdoor_storage_temperature(air_temperature: float) float #
Determines the temperature of the manure in outdoor liquid and slurry storages.
Parameters#
- air_temperaturefloat
The current day’s ambient air temperature (°C).
Returns#
- float
The estimated temperature of the manure storage (°C).
References#
This function clamps stored manure temperature to between 0 and 35 °C. Between 0 and 35 °C, outdoor stored liquid manure temperature is assumed to be equal to ambient air temperature. These bounds were based on personal communication and recommendations from A. Leytem (april.leytem@usda.gov) and A. VanderZaag (andrew.vanderzaag@AGR.GC.CA). These bounds are also support by work from Genedy and Ogejo, 2021 (https://doi.org/10.1016/j.compag.2021.106234) who observed similar minimum and maximum liquid manure temperatures in outdoor clay pit and concrete tank manure storages.
- calc_methane_emission(*args, **kwargs) float #
Calculates the methane emission of the manure treatment.
For those treatments that do not produce methane emission, this method will return 0.0. Otherwise, the method will be overridden by the subclass.
- calc_ammonia_emission(*args, **kwargs) float #
Calculates the ammonia emission of the manure treatment.
For those treatments that do not produce ammonia emission, this method will return 0.0. Otherwise, the method will be overridden by the subclass.
- _get_nitrous_oxide_emissions_factor(manure_treatment_type: ManureTreatmentType, manure_cover: str) float #
Get the correct nitrous oxide emissions factor based on manure treatment type and cover.
Parameters#
- manure_treatment_typeManureTreatmentType
The type of manure treatment.
- manure_coverstr
The type of cover for the manure. Options are: cover, crust, no cover, and N/A.
Returns#
- float
Nitrous oxide emission factor for different manure treatment and storage systems (kg N2O/kg manure N).
- _get_current_day_average_temperature_celsius() float #
Returns the average temperature of the current day in Celsius.
- Returns:
The average temperature of the current day in Celsius.
- _get_current_day_rainfall() float #
Return the rainfall of the current day in meters (m).
Returns#
- float
The rainfall of the current day in meters (m).
- _adjust_accumulated_output(manure_treatment_daily_output: ManureTreatmentDailyOutput) None #
Adjust the accumulated output by either resetting it or adding the daily output to it.
Notes#
The accumulated output will be reset on the first day of every storage time period.
Parameters#
- manure_treatment_daily_outputManureTreatmentDailyOutput
The daily output from the manure treatment system.
- 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).
- _abc_impl = <_abc._abc_data object>#