RUFAS.routines.manure.manure_treatments.anaerobic_lagoon module#
- class RUFAS.routines.manure.manure_treatments.anaerobic_lagoon.AnaerobicLagoon(weather: Weather, time: RufasTime, manure_treatment_config: ManureTreatmentConfig)#
Bases:
BaseManureTreatment
- LAGOON_DEPTH = 3.657#
The depth of the lagoon (m). Default is set to 3.657 m (12 ft).
- LAGOON_SLOPE = 2.0#
The slope of the lagoon (unitless). Default is set to 2.0.
- __init__(weather: Weather, time: RufasTime, manure_treatment_config: 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.
- _update_methane_emission(accumulated_output: ManureTreatmentDailyOutput) Tuple[float, float] #
Calculate the methane emission from the anaerobic lagoon.
Parameters#
- accumulated_outputManureTreatmentDailyOutput
A ManureTreatmentDailyOutput object containing the accumulated daily output of the anaerobic lagoon.
Returns#
- float
methane_loss: methane emission from the outdoor slurry storage treatment system, (kg \(CH_4\)/day).
- float
methane_emission_from_degradable_volatile_solids: methane emission from total degradable solids, (kg \(CH_4\)/day).
- _update_ammonia_emission(daily_output: ManureTreatmentDailyOutput) None #
Calculate the ammonia emission from the anaerobic lagoon.
Parameters#
- daily_outputManureTreatmentDailyOutput
A ManureTreatmentDailyOutput object containing the daily output of the anaerobic lagoon.
Returns#
- None
Update the storage_ammonia attribute of the daily output object.
Update the storage_ammonia attribute of the accumulated output object.
- _daily_update_helper() ManureTreatmentDailyOutput #
Update the daily output variables for the anaerobic lagoon.
Returns#
The daily output variables for the anaerobic lagoon.
- _adjust_final_manure_volume(current_day_final_manure_volume: float) float #
Adjust the final manure volume to account for the precipitation and the storage time period.
Parameters#
- current_day_final_manure_volumefloat
The final manure volume for the current simulation day (\(m^3\)).
Returns#
- float
The adjusted final manure volume.
- property sludge_accumulation_volume: float#
Returns sludge accumulation volume.
- Returns:
Sludge accumulation volume, m^3.
- property flushing_volume: float#
Returns flushing water recycled.
- Returns:
Flushing water volume, m^3
- property volume_needed: float#
Returns volume needed.
- Returns:
Volume needed, m^3.
- property lagoon_depth: float#
Get the lagoon depth.
This property provides access to the depth of the lagoon.
Returns#
- float
Lagoon depth in meters (m).
- property lagoon_slope: float#
Get the lagoon slope.
This property provides access to the slope of the lagoon.
Returns#
- float
Lagoon slope (unitless).
- _calc_lagoon_width_coefficients() tuple[float, float, float] #
Calculate the coefficients a, b, and c for the quadratic equation used to calculate lagoon width.
This method computes the coefficients based on the lagoon’s depth and slope, which are then used to solve a quadratic equation for determining the width of the lagoon.
Returns#
- tuple[float, float, float]
The coefficients a, b, and c for the quadratic equation: - a: Coefficient for the squared term, computed as 3 times the lagoon depth. - b: Coefficient for the linear term, computed as -4 times the lagoon slope times the square
of the lagoon depth.
c: Constant term, computed based on the lagoon slope, lagoon depth, and volume needed.
Raises#
- ValueError
If the coefficient for the squared term (a) is 0, as this would lead to a division by zero in subsequent calculations.
- property lagoon_width: float#
Calculate and return the lagoon width in meters.
The width of the lagoon is computed by solving a quadratic equation derived from the lagoon’s depth and slope. The coefficients for this equation are computed in the _calc_lagoon_width_coefficients method.
If the quadratic equation does not have real roots (discriminant < 0), the width is considered to be 0.0. If both roots of the quadratic equation are negative, the width is also considered to be 0.0 as negative width is not physically meaningful.
Returns#
- float
Lagoon width in meters (m). If the quadratic equation has no real solutions or both roots are negative, returns 0.0.
- property lagoon_length: float#
Calculate and return the length of the lagoon in meters (m).
The length of the lagoon is calculated as three times the width of the lagoon.
Returns#
- float
Lagoon length in meters (m).
- property lagoon_surface_area: float#
Calculate and return the surface area of the lagoon in square meters (m^2).
The surface area is calculated as the product of the number of animals in the pen and the DEFAULT_STORAGE_AREA_PER_ANIMAL constant.
Returns#
- float
Lagoon surface area in square meters (\(m^2\)).
- _calc_modeled_lagoon_volume() float #
Return modeled lagoon volume in cubic meters (\(m^3\)).
The modeled volume is used to verify that equations for surface area, with slope assumptions, match the volume needed for treatment.
The formula is composed of three parts: - Base volume (length * width * depth) - Slope correction for the sides ((slope * (depth ** 2)) * (length + width)) - Slope correction for the corners (4 * slope * (depth ** 3) / 3)
Returns#
- float
Modeled lagoon volume in cubic meters (\(m^3\)).
- _abc_impl = <_abc._abc_data object>#
- property precipitation_volume: float#
Return additional lagoon volume needed for precipitation.
The additional volume needed for precipitation is calculated as the product of the current day’s rainfall and the lagoon’s surface area.
Returns#
- float
Additional lagoon volume needed for precipitation (\(m^3\)).