📝 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 Name | Description | Emoji |
---|---|---|
f | Initial infiltration rate (set to 0.0). | 💧 |
fp | Potential infiltration rate. | 🌧️ |
fa | Water available for infiltration. | 🌊 |
f0 | Initial infiltration capacity. | 🌦️ |
fmin | Minimum infiltration capacity. | 🌥️ |
df | Difference between initial and minimum infiltration capacities. | ☁️ |
kd | Decay rate of infiltration capacity. | ⏲️ |
kr | Regeneration rate of infiltration capacity. | ⏰ |
🔄 Logic Breakdown
📌 Initialize Local Variables: Set local variables using values from the Horton infiltration object and other provided constants.
🚫 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.
💧 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.🌧️ 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).
🌥️ 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.
🎉 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:
Post a Comment