RUFAS.biophysical.feed_storage.silage module#

RUFAS.biophysical.feed_storage.silage.DRY_MATTER_FRACTION_OF_EFFLUENT = 0.1035#

Number of days that loss of effluent occurs over after a crop is ensiled.

class RUFAS.biophysical.feed_storage.silage.Silage(capacity: float = inf)#

Bases: Storage

Class representing the Silage storage type, inheriting from Storage.

Methods#

calculate_days_of_effluent_loss_to_process(crop: HarvestedCrop, time: RufasTime)

Calculates the number of days to effluent loss needs to be processed for in the given crop.

calculate_dry_matter_loss_to_effluent(estimated_maximum_effluent: float, days_of_loss: int)

Calculates the total dry matter lost to effluent that occurred over the given number of days.

calculate_moisture_loss_to_effluent(estimated_maximum_effluent: float, days_of_loss: int)

Calculates the total moisture lost to effluent that occurred over the given number of days.

__init__(capacity: float = inf)#
process_degradations(weather: Weather, time: RufasTime) None#

Processes the losses of nutrients and mass to effluent in the ensiled crops, calls the parent implementation of of process_degradations to handle the fermentative loss.

Parameters#

weatherWeather

Weather instance containing all weather information for the simulation.

timeRufasTime

RufasTime instance tracking the current time of the simulation.

project_degradations(crops: list[HarvestedCrop], weather: Weather, time: RufasTime) list[HarvestedCrop]#

Projects the state of crops currently stored at a given future date.

Parameters#

cropslist[HarvestedCrop]

List of HarvestedCrops to project degradations for.

weatherWeather

Weather instance containing all weather information for the simulation.

timeRufasTime

RufasTime instance containing the date at which the state of the stored crops should be projected.

Returns#

list[HarvestedCrop]

Crops in the state they are projected to be in at the given date.

_calculate_effluent_loss(crop: HarvestedCrop, time: RufasTime) dict[str, float]#

Calculates the attributes of a crop after effluent loss.

Parameters#

cropHarvestedCrop

HarvestedCrop to calculate effluent losses from.

timeRufasTime

RufasTime instance tracking the current time of the simulation.

Returns#

dict[str, float]

Mapping of crop’s attributes to their values after effluent loss.

calculate_days_of_effluent_loss_to_process(crop: HarvestedCrop, time: RufasTime) int#

Calculates the number of days that effluent loss needs to be calculated for in an ensiled crop.

Parameters#

cropHarvestedCrop

Ensiled crop that is being degraded.

timeRufasTime

RufasTime instance containing the current time of the simulation.

Notes#

Effluent loss only occurs in an ensiled crop during the first 10 days of storage, so this method calculates the numbers of days which were in that initial 10-day period between the time when the crop was last degraded and the current time.

calculate_dry_matter_loss_to_effluent(estimated_maximum_effluent: float, days_of_loss: int) float#

Calculates the dry matter loss to effluent.

Parameters#

estimated_maximum_effluentfloat

The estimated maximum effluent.

days_of_effluent_lossint

The number of days effluent loss will be calculated for.

Returns#

float

The amount of dry matter lost to effluent, in kg.

References#

calculate_moisture_loss_to_effluent(estimated_maximum_effluent: float, days_of_loss: int) float#

Calculates the moisture loss to effluent.

Parameters#

estimated_maximum_effluentfloat

The estimated maximum effluent.

days_of_effluent_lossint

The number of days effluent loss will be calculated for.

Returns#

float

The amount of moisture lost to effluent, in kg.

References#

calculate_non_protein_nitrogen_after_effluent_loss(initial_non_protein_nitrogen: float, initial_crude_protein: float, loss_fraction: float) float#

Calculates the percentage of non-protein nitrogen in a stored crop after losing dry matter to effluent.

Parameters#

initial_non_protein_nitrogenfloat

Percentage of non-protein nitrogen in the crop before dry matter loss occurred.

initial_crude_proteinfloat

Percentage of crude protein in the crop before dry matter loss occurred.

loss_fractionfloat

Fraction of dry matter that was lost to effluent.

Returns#

float

Percentage of non-protein nitrogen remaining in the stored crop.

References#

calculate_crude_protein_after_effluent_loss(initial_crude_protein: float, loss_fraction: float) float#

Calculates the percentage of crude protein in a stored crop after losing dry matter to effluent.

Parameters#

initial_crude_proteinfloat

Percentage of crude protein in the crop before dry matter loss occurred.

loss_fractionfloat

Fraction of dry matter that was lost to effluent.

Returns#

float

Percentage of crude protein remaining in the stored crop.

References#

class RUFAS.biophysical.feed_storage.silage.Bunker(bunker_size: str | None = None)#

Bases: Silage

Class representing the Bunker type of Silage storage.

__init__(bunker_size: str | None = None)#

Initializes a Bunker instance with optional bunker size.

Parameters#

bunker_sizeOptional[str], optional

The size of the bunker, by default None

class RUFAS.biophysical.feed_storage.silage.Pile(pile_size: str | None = None)#

Bases: Silage

Class representing the Pile type of Silage storage.

__init__(pile_size: str | None = None)#

Initializes a Pile instance with optional pile size.

Parameters#

pile_sizeOptional[str], optional

The size of the pile, by default None

class RUFAS.biophysical.feed_storage.silage.Bag(bag_size: int | None = None)#

Bases: Silage

Class representing the Bag type of Silage storage.

__init__(bag_size: int | None = None)#

Initializes a Bag instance with optional bag size.

Parameters#

bag_sizeOptional[int], optional

The diameter of the bag in feet, by default None