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.

No comments:

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...