Class SlimPhosphorusFunctions

java.lang.Object
net.simplace.sim.components.experimental.slim.SlimPhosphorusFunctions

public class SlimPhosphorusFunctions extends Object
  • Constructor Details

    • SlimPhosphorusFunctions

      public SlimPhosphorusFunctions()
  • Method Details

    • Leaching

      public static SlimPhosphorusFunctions.LeachingResult Leaching(Double[] dissolved, Double[] waterContent, Double[] waterFlow, Double fertilizer, Double lowerBoundaryConcentration)
      Calculates phosphorus leaching in (layered) soil. Moves dissolved P with the water flow between soil layers. If the the water flow of a specific layer l is positive, then P is moved from the layer to the layer below. Else P is moved from the layer below to the layer. The amount is calculated by the water flow times the P concentration of the layer where the water comes from (i.e. l when flow is positive, l+1 when negative).
      Parameters:
      dissolved - Amount of dissolved P per layer [g/m^2]
      waterContent - Water content per layer mm
      waterFlow - Water moving from one layer to the layer below. When negative, water moves from the layer below. [mm/day]
      fertilizer - Amount of P fertiliser [g/m^2]
      lowerBoundaryConcentration - P concentration in the lower boundary g/(mm*m^2)
      Returns:
      Updated Dissolved P per layer [g/m^2] and DissolvedFlow per layer [g/(m^2 day)]
    • PoolsInterchange

      public static SlimPhosphorusFunctions.PoolsInterchangeResult PoolsInterchange(Double[] dissolved, Double[] adsorbed, Double[] fixed, Double[] adsorptionCoefficients, Double[] fixationCoefficients)
      Moves phoshporus between the three inorganic pools: dissolved, adsorbed and fixed. Change rates depend on the difference between the pools and the coefficients. There is an interchange between dissolved and adsorbed and between adsorbed and fixed. Flows can go in both direction, but reverse rates fixed->adsorbed->dissolved are only 1/10 of the rates dissolved->adsorbed->fixed. See Formulas (238) and (243) in Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      dissolved - Amount of dissolved P per layer [g/m^2]
      adsorbed - Amount of adsorbed P per layer [g/m^2]
      fixed - Amount of fixed P per layer [g/m^2]
      adsorptionCoefficients - adsorption coefficients per layer
      fixationCoefficients - fixation coefficients per layer
      Returns:
      Updated pools in g/m^2 and change rates between pools in g/(m^2 day)
    • Avail

      public static SlimPhosphorusFunctions.AvailResult Avail(Double[] dissolved, Double[] rootlength, Double maxUptakeRate)
      Calculates plant available P. Plant available P per layer is limited by dissolved p and the maximum root uptake capacity (which is maxUptakeRate times rootlength).
      Parameters:
      dissolved - amount of dissolved P per layer [g/m^2]
      rootlength - length of seminal and lateral roots per layer [m/m^2]
      maxUptakeRate - maximum uptake rate per one metre root [g/(m day)]
      Returns:
      TotalAvail and Avail per layer [g/(m^2 day)]
    • Uptake

      public static SlimPhosphorusFunctions.UptakeResult Uptake(Double[] dissolved, Double[] avail, Double totalAvail, Double demand)
      Performs the P uptake by plant. Plant P uptake is limited by demand and availability. If demand exceeds availability, all dissolved P is taken up. Else the uptake amount per layer is proportional to the ratio demand/avail.
      Parameters:
      dissolved - amount of dissolved P per layer [g/m^2]
      avail - crop available P per layer [[g/(m^2 day)]
      totalAvail - total crop available P [g/(m^2 day)]
      demand - daily P demand of the plat [g/(m^2 day)]
      Returns:
      updated Dissolved P per layer [g/m^2], TotalUptake and Uptake per layer [g/(m^2 day)], TotalAvail and Avail per layer [g/(m^2 day)]
    • CalculateFlowCoefficients

      public static SlimPhosphorusFunctions.FlowCoefficients CalculateFlowCoefficients(int weatheringdegree, Double[] dissolvedconcentration, Double[] clay, Double[] caco3, Double[] ph, Double[] bsa)
      Calculates adsorption and fixation coefficients based on soil properties for different soil types. See formulas (239)-(242) and (244)-(245) from Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      weatheringdegree - 0:calcareous, 1:slightly weathered, 2: moderate weathered, 3: highly weathered soil [-]
      dissolvedconcentration - concentration of dissolved P per layer [ppm]
      clay - soil clay content per layer [%]
      caco3 - CaCO3 concentration per layer [%]
      ph - soil pH per layer [-]
      bsa - base saturation by the ammonium acetate method [%]
      Returns:
      adsorption coefficients per layer [-] and fixation coefficients per layer [-]
    • CalculateFlowCoefficientsCalcareous

      public static SlimPhosphorusFunctions.FlowCoefficients CalculateFlowCoefficientsCalcareous(Double[] caco3)
      Calculates adsorption and fixation coefficients for calcareous soils. See formulas (239) and (244) from Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      caco3 - CaCO3 concentration per layer [%]
      Returns:
      adsorption coefficients per layer [-] and fixation coefficients per layer [-]
    • CalculateFlowCoefficientsSlightlyWeathered

      public static SlimPhosphorusFunctions.FlowCoefficients CalculateFlowCoefficientsSlightlyWeathered(Double[] dissolvedconcentration)
      Calculates adsorption and fixation coefficients for slightly weathered, non-calcareous soils. See formulas (240) and (245) from Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      dissolvedconcentration - amount of fixed P per layer [g/m^2]
      Returns:
      adsorption coefficients per layer [-] and fixation coefficients per layer [-]
    • CalculateFlowCoefficientsModeratelyWeathered

      public static SlimPhosphorusFunctions.FlowCoefficients CalculateFlowCoefficientsModeratelyWeathered(Double[] ph, Double[] bsa)
      Calculates adsorption and fixation coefficients for moderately weathered, non-calcareous soils. See formulas (241) and (245) from Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      ph - soil pH per layer
      bsa - base saturation by the ammonium acetate method [%]
      Returns:
      adsorption coefficients per layer [-] and fixation coefficients per layer [-]
    • CalculateFlowCoefficientsHighlyWeathered

      public static SlimPhosphorusFunctions.FlowCoefficients CalculateFlowCoefficientsHighlyWeathered(Double[] clay)
      Calculates adsorption and fixation coefficients for highly weathered, non-calcareous soils. See formulas (242) and (245) from Williams, Izaurralde: The Apex Model, 2005
      Parameters:
      clay - soil clay content per layer [%]
      Returns:
      adsorption coefficients per layer [-] and fixation coefficients per layer [-]
    • AmountFromConcentration

      public static Double AmountFromConcentration(Double concentration, Double thickness, Double bulkdensity)
      Calculates amount of P from P-concentration in one layer.
      Parameters:
      concentration - mg P per kg soil [ppm]
      thickness - layer thickness [m]
      bulkdensity - layer bulkdensity [g/cm^3]
      Returns:
      P-amount [g/m^2]
    • AmountFromConcentration

      public static Double[] AmountFromConcentration(Double[] concentration, Double[] depth, Double[] bulkdensity)
      Calculates amout of P from P-concentration in all layers.
      Parameters:
      concentration - mg P per kg soil in each layer [ppm]
      thickness - layer thickness [m]
      bulkdensity - layer bulkdensity [g/cm^3]
      Returns:
      P-amount in each layers [g/m^2]
    • ConcentrationFromAmount

      public static Double ConcentrationFromAmount(Double amount, Double thickness, Double bulkdensity)
      Calculates P-concentration from P-amount for one layer.
      Parameters:
      amount - phosphorus amount in the layer [g/m^2]
      thickness - layer thickness [m]
      bulkdensity - layer bulkdensity [g/cm^3]
      Returns:
      P-concentration [ppm]
    • ConcentrationFromAmount

      public static Double[] ConcentrationFromAmount(Double[] amount, Double[] depth, Double[] bulkdensity)
      Calculates P-concentration from P-amount in all layers.
      Parameters:
      amount - phosphorus amount per layer [g/m^2]
      thickness - layer thickness [m]
      bulkdensity - layer bulkdensity [g/cm^3]
      Returns:
      P-concentration in each layer [ppm]