RUFAS.routines.field.soil.manure_pool module#
- class RUFAS.routines.field.soil.manure_pool.ManurePool(manure_dry_mass: float = 0.0, manure_applied_mass: float = 0.0, manure_field_coverage: float = 0.0, manure_moisture_factor: float = 0.0, water_extractable_inorganic_phosphorus: float = 0.0, water_extractable_organic_phosphorus: float = 0.0, stable_inorganic_phosphorus: float = 0.0, stable_organic_phosphorus: float = 0.0, organic_phosphorus_runoff: float = 0.0, inorganic_phosphorus_runoff: float = 0.0, annual_runoff_manure_inorganic_phosphorus: float = 0.0, annual_runoff_manure_organic_phosphorus: float = 0.0, annual_decomposed_manure: float = 0.0)#
Bases:
object
Class that stores and tracks attributes of machine and grazing applied manure.
- manure_dry_massfloat, default 0
The dry weight equivalent of manure mass on the field that was applied by machine or grazers (kg).
- manure_applied_massfloat, default 0
The dry weight equivalent of the most recent application of manure applied by machine or grazers (kg).
- manure_field_coveragefloat, default 0
Fraction of the field that is covered by machine- or grazer-applied manure, between [0, 1] (unitless).
- manure_moisture_factorfloat, default 0
Fraction representing the current moisture level of the machine- or grazer-applied manure on the field, between [0, 0.9] (unitless).
- water_extractable_inorganic_phosphorusfloat, default 0
Amount of water extractable inorganic phosphorus on the field that was applied by machine or grazers (kg).
- water_extractable_organic_phosphorusfloat, default 0
Amount of water extractable organic phosphorus on the field that was applied by machine or grazers (kg).
- stable_inorganic_phosphorusfloat, default 0
Amount of stable inorganic phosphorus on the field that was applied by machine or grazers (kg).
- stable_organic_phosphorusfloat, default 0
Amount of stable organic phosphorus on the field that was applied by machine or grazers (kg).
- organic_phosphorus_runofffloat, default 0.0
Amount of organic phosphorus from machine- or grazer-applied manure dissolved in and removed by runoff (kg).
- inorganic_phosphorus_runofffloat, default 0.0
Amount of inorganic phosphorus from machine- or grazer-applied manure dissolved in and removed by runoff (kg).
- annual_decomposed_manurefloat, default 0.0
Amount of annual manure decomposed/mineralized (kg).
- __init__(manure_dry_mass: float = 0.0, manure_applied_mass: float = 0.0, manure_field_coverage: float = 0.0, manure_moisture_factor: float = 0.0, water_extractable_inorganic_phosphorus: float = 0.0, water_extractable_organic_phosphorus: float = 0.0, stable_inorganic_phosphorus: float = 0.0, stable_organic_phosphorus: float = 0.0, organic_phosphorus_runoff: float = 0.0, inorganic_phosphorus_runoff: float = 0.0, annual_runoff_manure_inorganic_phosphorus: float = 0.0, annual_runoff_manure_organic_phosphorus: float = 0.0, annual_decomposed_manure: float = 0.0) None #
- daily_manure_update(rainfall: float, field_size: float, mean_air_temperature: float) float #
This method conducts daily operations on manure including decomposition, assimilation and returns the total assimilation.
Parameters#
- rainfallfloat
The amount of rainfall on the current day (mm).
- field_sizefloat
The size of the field (ha).
- mean_air_temperaturefloat
Mean air temperature on the current day (degrees C).
return#
- float
The total amount of assimilated phosphorus (kg).
- runoff_reset()#
Helper method to reset phosphorus runoff
- leach_phosphorus_pools(rainfall: float, runoff: float, field_size: float) tuple[float, float] #
This method handles all calls to the methods that determine how much phosphorus is leached from manure, how that leached phosphorus is distributed.
Parameters#
- rainfallfloat
The amount of rainfall on the current day (mm).
- runofffloat
The amount of runoff from rainfall on the current day (mm).
- field_sizefloat
The size of the field (ha).
- adjust_manure_moisture_factor(rainfall: float, temperature_factor: float) None #
Adjusts the moisture factor of manure on the soil surface based on the current day’s precipitation level.
Parameters#
- rainfallfloat
The amount of rainfall on the current day (mm).
- temperature_factorfloat
The temperature factor on the current day (unitless).
- determine_decomposed_surface_manure(temperature_factor: float) tuple[float, float] #
This method calculates how much manure in both the machine and grazer-applied pools decompose on a given day, and how much the field coverage changes as a result.
Parameters#
- temperature_factorfloat
The temperature factor on the current day (unitless).
Returns#
- Tuple[float, float]
- decomposed_manure_mass_change: change in the mass of applied manure on the field surface
decomposed on this day (kg).
- decomposed_manure_coverage_change: change in field coverage of applied manure on the field
surface (unitless).
- determine_assimilated_surface_manure(temperature_factor: float, field_size: float) tuple[float, float] #
Determines how much manure is assimilated into the soil profile and how much the manure coverage is reduced by on the current day.
Parameters#
- temperature_factorfloat
The temperature factor on the current day (unitless).
- field_sizefloat
The area of the field (ha).
Returns#
- tuple[float, float]
assimilated_manure: Amount of manure that is assimilated on a given day (kg). manure_coverage: Amount of decrease in the fraction of field covered by manure on a given day (unitless).
- static _determine_temperature_factor(mean_air_temperature: float) float #
Calculates the temperature factor for the current day
Parameters#
- mean_air_temperaturefloat
The average air temperature of the current day (degrees Celsius).
Returns#
- float
The temperature factor on the current day (unitless).
References#
SurPhos [2], pseudocode_soil [S.5.D.I.1]
- static _determine_dry_matter_decomposition_rate(temperature_factor: float) float #
Calculates the rate of manure dry matter decomposition on the current day.
Parameters#
- temperature_factorfloat
The temperature factor on the current day (unitless).
Returns#
- float
The rate of manure dry matter decomposition on the current day (unitless).
References#
SurPhos [1], pseudocode_soil [S.5.D.III.4]
- static _determine_dry_manure_matter_assimilation(moisture_factor: float, temperature_factor: float, manure_cover_area: float, is_dung: bool) float #
Calculates the mass of dry manure matter applied by machine assimilated into the soil that day.
Parameters#
- moisture_factorfloat
Manure moisture factor, in range [0.0, 1.0] (unitless).
- temperature_factorfloat
The temperature factor on the current day (unitless).
- manure_cover_areafloat
Area of the field covered by manure (ha).
- is_dungbool
Was the manure being assimilated applied by animals grazing in the field (true / false).
Returns#
- float
The amount of manure dry matter that is assimilated into the soil by macroinvertebrates (bioturbation) on the current day (kg).
References#
SurPhos [3, 7], pseudocode_soil [S.5.D.III.4] (Note the equation in the pseudocode is wrong)
- static _determine_moisture_change(rainfall: float, current_moisture: float, current_mass: float, original_mass: float, temperature_factor: float) float #
This function determines the daily change in the moisture factor of the maure based on the current days precipitation conditions.
Parameters#
- rainfallfloat
Amount of rainfall on the current day (mm).
- current_moisturefloat
Current value of the moisture factor (unitless).
- current_massfloat
Current mass of dry matter content in the manure (kg).
- original_massfloat
The mass of manure dry matter content originally applied to the field (kg).
Returns#
- float
The change the moisture factor of the manure application on this day.
References#
SurPhos [5, 6], pseudocode_soil [S.5.D.III.1]
- static _determine_rain_manure_dry_matter_ratio(rainfall: float, manure_dry_matter: float, manure_coverage: float) float #
Calculates the ratio of rainfall to manure dry matter currently on the field.
Parameters#
- rainfallfloat
Amount of rainfall on the current day (mm).
- manure_dry_matterfloat
Current mass of manure dry matter on the field (kg).
- manure_coveragefloat
Area of the field covered by manure (ha).
Returns#
- float
The ratio of rainfall to manure dry matter currently on the field (cubic cm per g).
References#
SurPhos Theoretical Documentation [11]
- static _determine_phosphorus_leached_from_surface(rainfall: float, runoff: float, field_size: float, manure_dry_mass: float, field_coverage: float, water_extractable_phosphorus: float, is_organic: bool) dict[str, float] #
This method determines how much phosphorus is leached from the given pool, how that phosphorus is distributed between runoff and soil infiltration, and how much phosphorus remains in the given pool.
Parameters#
- rainfallfloat
The amount of rainfall on the current day (mm).
- runofffloat
The amount of runoff from rainfall on the current day (mm).
- field_sizefloat
Area of the field (ha).
- manure_dry_massfloat
Dry-weight equivalent of manure on the field (kg).
- field_coveragefloat
Percent of the field covered by manure, in range [0.0, 1.0] (unitless).
- water_extractable_phosphorusfloat
The mass of the water extractable phosphorus pool that is being leached from (kg).
- is_organicbool
Is the phosphorus being leached organic (True / False).
Returns#
- dict (keys listed below)
new_phosphorus_pool_amount: amount of phosphorus in the pool after leaching from it (kg). infiltrated_phosphorus: amount of phosphorus that infiltrates into the soil profile (kg). runoff_phosphorus: amount of phosphorus that leaves the field dissolved in runoff (kg).
Notes#
This method follows the steps outlined for how to calculate phosphorus lost from a field’s surface as outlined by the section with the header “Phosphorus Leaching from Manure by Rain” (page 8). Generally, the steps are
Calculate the ratios of rainfall to manure mass and rainfall to runoff on the given day.
Calculate the amounts of water extractable phosphorus lost by the surface manure pools on a given day.
- Calculate how much of the leached phosphorus runs off the field and how much infiltrates the soil based on
the ratios calculated above.
Determine how much phosphorus is remains in the surface pool after leaching.
Return all the above amounts of phosphorus (lost to runoff, infiltrated soil, still on field surface).
- static determine_mineralized_surface_phosphorus(phosphorus_amount: float, rate: float, temperature_factor: float, moisture_factor: float) float #
Calculates the amount of phosphorus that mineralizes into water-extractable inorganic phosphorus on the current day from the given pool.
Parameters#
- phosphorus_amountfloat
The amount of phosphorus in the pool that is being mineralized (kg).
- ratefloat
The rate factor for the type of phosphorus being mineralized (unitless).
- temperature_factorfloat
The temperature factor on the current day (unitless).
- moisture_factorfloat
The moisture factor of the given manure pool on the current day (unitless).
Returns#
- float
The amount of phosphorus that is mineralized from that pool that is passed (kg).
References#
SurPhos theoretical documentation eqn. [4]
Notes#
As defined in the paragraph on page 6 of the SurPhos theoretical documentation underneath eqn. [4], the rates for stable organic Phosphorus, stable inorganic phosphorus, and water-extractable organic phosphorus are 0.01, 0.0025, and 0.1, respectively.
- static determine_assimilated_phosphorus_amount(assimilation_ratio: float, phosphorus_amount: float) float #
Calculates the amount of phosphorus that is removed through assimilation on a given day.
Parameters#
- assimilation_ratiofloat
Ratio of manure mass assimilated to amount present before assimilation (unitless).
- phosphorus_amountfloat
The amount of phosphorus in the pool being removed from (kg).
Returns#
- float
The amount of phosphorus removed from the pool (kg).
- static _determine_phosphorus_distribution_factor(rainfall: float, runoff: float) float #
Calculates a factor used to determine the concentration of Phosphorus dissolved in runoff, based on the ratio of rainfall to runoff.
Parameters#
- rainfallfloat
Amount of rainfall on the current day (mm).
- runofffloat
The amount of runoff from rainfall on the current day (mm).
Returns#
- float
The ratio of rainfall to runoff adjusted for use in determining dissolved Phosphorus concentrations.
References#
SurPhos [13], pseudocode_soil [S.5.D.II.2]
- static _determine_water_extractable_phosphorus_leached(manure_water_extractable_phosphorus: float, rainfall_to_dry_manure_ratio: float, is_from_cow: bool, organic_phosphorus: bool) float #
Determines the amount of water extractable organic or inorganic phosphorus leached by rainfall.
Parameters#
- manure_water_extractable_phosphorusfloat
The amount of water extractable phosphorus from manure on the field (kg).
- rainfall_to_dry_manure_ratiofloat
The ratio of rainfall to manure dry matter on soil surface (cubic centimeters per gram).
- is_from_cowfloat
Is the water extractable inorganic phosphorus from cow manure (true / false).
- organic_phosphorus: bool
True for organic phosphorus calculation, False for inorganic phosphorus.
Returns#
- float
The amount of water extractable phosphorus leached from manure on the soil surface by rain on the given day (kg).
References#
SurPhos [9, 10], pseudocode_soil [S.5.D.I.3, II.1]
Details#
Phosphorus leaching from cow manure is determined with a different set of constants than non-cow manure, which is why the is_from_cow parameter is necessary.
- static _determine_water_extractable_phosphorus_runoff_concentration(manure_leached: float, rainfall: float, field_size: float, distribution_factor: float) float #
Calculates the concentration of water extractable phosphorus in runoff on the current day.
Parameters#
- manure_leachedfloat
Mass of water extractable phosphorus leached from surface manure by rain on the current day (kg).
- rainfallfloat
Amount of rainfall on the current day (mm).
- field_sizefloat
Size of the field (ha).
- distribution_factorfloat
Factor accounting for runoff to rainfall ratio on the current day (unitless).
Returns#
- float
The concentration of water extractable phosphorus in runoff on the current day (milligrams per liter).