Sunday, October 22, 2023

SWMM5 Function Name: modHorton_getInfil Overview Modified Horton

 

📝 Function Overview

Function Name: modHorton_getInfil

Purpose: Computes the modified Horton infiltration for a subcatchment.

Inputs:

  • infil: A pointer to a Horton infiltration object.
  • tstep: Runoff time step in seconds.
  • irate: Net "rainfall" rate in ft/sec (rainfall + snowmelt + runon).
  • depth: Depth of ponded water in feet.

Output: Returns the infiltration rate in ft/sec.


🕵️ Local Variables

Variable NameDescriptionEmoji
fInitial infiltration rate (set to 0.0).💧
fpPotential infiltration rate.🌧️
faWater available for infiltration.🌊
f0Initial infiltration capacity.🌦️
fminMinimum infiltration capacity.🌥️
dfDifference between initial and minimum infiltration capacities.☁️
kdDecay rate of infiltration capacity.⏲️
krRegeneration rate of infiltration capacity.

🔄 Logic Breakdown

  1. 📌 Initialize Local Variables: Set local variables using values from the Horton infiltration object and other provided constants.

  2. 🚫 Special Cases - No or Constant Infiltration: If the difference between initial and minimum infiltration capacities is negative or the decay rate is negative, return an infiltration rate of 0.0 (no infiltration). If there's no difference between the two capacities or the decay rate is 0, then return either the initial infiltration capacity or the available water for infiltration, whichever is smaller.

  3. 💧 Compute Water Available for Infiltration: Calculate the total water available for infiltration (fa) by adding the net rainfall rate to the ponded water depth divided by the time step.

  4. 🌧️ Water is Available for Infiltration:

    • Check for saturated conditions. If cumulative infiltration equals or exceeds the maximum, return 0.0 (no further infiltration).
    • Compute the potential infiltration rate (fp) which decreases over time due to soil saturation.
    • Set the actual infiltration rate (f) to the smaller of the available water and the potential infiltration rate.
    • Update the cumulative infiltration value by adding the current infiltration value (after subtracting the minimum infiltration capacity).
  5. 🌥️ Reduce Cumulative Infiltration for Dry Condition: If the regeneration rate is positive, then reduce the cumulative infiltration value. This represents the drying or recovery of the soil.

  6. 🎉 Return Value: The function returns the infiltration rate (f).


This code implements a modified Horton infiltration model which represents how soil infiltration capacity decreases over time as soil becomes more saturated. The model also accounts for the regeneration of infiltration capacity as the soil dries out. The function computes and returns the actual infiltration rate for a given time step based on these principles.

SWMM5 Function Name: horton_getInfil Overview

 

📝 Function Overview

Function Name: horton_getInfil

Purpose: Computes the Horton infiltration for a subcatchment.

Inputs:

  • infil: A pointer to a Horton infiltration object.
  • tstep: Runoff time step in seconds.
  • irate: Net "rainfall" rate in ft/sec (rainfall + snowmelt + runon - evaporation).
  • depth: Depth of ponded water in feet.

Output: Returns the infiltration rate in ft/sec.


🕵️ Local Variables

Variable NameDescriptionEmoji
iterIteration counter.🔄
faWater available for infiltration.🌊
fpPotential infiltration rate (initialized to 0).🌧️
Fp, F1Cumulative infiltration at start and end of time step.💧
t1Future cumulative time.
tlimLimit time for determining flat portion of infiltration curve.🛑
ex, ktIntermediate variables for calculations.🔢
FF, FF1Intermediate variables for Newton-Raphson method.🔣
rRatio used for Newton-Raphson method and exponential calculations.📊
Other variables (f0, fmin, Fmax, tp, df, kd, kr)Derived from infil object and represent various Horton infiltration parameters.📈

🔄 Logic Breakdown

  1. 📌 Initialize Local Variables: Extract and set local variables using values from the Horton infiltration object and other provided constants.

  2. 🚫 Special Cases - No or Constant Infiltration: If the difference between initial and minimum infiltration capacities is less than zero, or the decay rate is less than zero, return an infiltration rate of 0.0 (no infiltration). If there's no difference between the two capacities or the decay rate is 0, then return either the initial infiltration capacity or the available water for infiltration, whichever is smaller.

  3. 💧 Compute Water Available for Infiltration: Calculate the total water available for infiltration (fa) by adding the net rainfall rate to the ponded water depth divided by the time step.

  4. 🌧️ Water is Available for Infiltration:

    • Compute the average infiltration rate over the time step.
    • Use various conditions to determine the potential infiltration rate and adjust the future cumulative time tp.
    • If necessary, solve for tp using the Newton-Raphson method.
    • Limit cumulative infiltration to a maximum value Fmax.
  5. 🌥️ Regeneration of Infiltration Capacity: If the regeneration rate kr is positive, then adjust the cumulative time tp to account for regeneration of the soil's infiltration capacity. Update the cumulative infiltration value based on this regeneration.

  6. 🎉 Return Value: Update the tp value in the Horton infiltration object and return the infiltration rate (fp).


This code implements the Horton infiltration model which represents how soil infiltration capacity decreases over time as the soil becomes saturated. The model also accounts for the regeneration of infiltration capacity as the soil dries out. The function computes and returns the actual infiltration rate for a given time step based on these principles. The code includes special cases for constant infiltration and uses an iterative Newton-Raphson method to adjust infiltration rates when soil infiltration capacity is limiting.

AI Rivers of Wisdom about ICM SWMM

Here's the text "Rivers of Wisdom" formatted with one sentence per line: [Verse 1] 🌊 Beneath the ancient oak, where shadows p...