SWMM 5.1.010 bug: Rain garden has no infiltration

I think I found a mistake in SWMM. I described the problem and provided a solution as below. Correct me if I am wrong.

Problem: Rain garden has no infiltration in SWMM 5.1.010


  1. When computing runoff outflow from a single LID unit, “lidproc_getOutflow” uses “biocellFluxRates” to compute flux rates from the layers, of a bio retention cell LID. From lidproc_getOutflow() in lidproc.c (SWMM5.1.010)
    //... determine which flux rate function to use
    switch (theLidProc->lidType)
    case BIO_CELL:
    case RAIN_GARDEN:     fluxRates = &biocellFluxRates;  break;
  1. On the other hand, rain garden has no storage layer, and the “storage.kSat" is set to 0 when initialize LID objects. From lid_create() in lid.c (SWMM5.1.010)
    //... initialize LID objects
    for (j = 0; j < LidCount; j++)
        LidProcs[j].lidType = -1;
        LidProcs[j].surface.thickness = 0.0;
        LidProcs[j].surface.voidFrac = 1.0;
        LidProcs[j].surface.roughness = 0.0;
        LidProcs[j].surface.surfSlope = 0.0;
        LidProcs[j].pavement.thickness = 0.0;
        LidProcs[j].soil.thickness = 0.0;
        LidProcs[j].storage.thickness = 0.0;
        LidProcs[j].storage.kSat = 0.0;
  1. Then, “StorageInfil” is set to 0 by the “getStorageInfilRate()” function, since storage.kSat == 0 From getStorageInfilRate() in lidproc.c (SWMM5.1.010)
double getStorageInfilRate()
//  Purpose: computes infiltration rate between storage zone and
//           native soil beneath a LID.
//  Input:   depth = depth of water storage zone (ft)
//  Output:  returns infiltration rate (ft/s)
    double infil = 0.0;
    double clogFactor = 0.0;
    if ( theLidProc->storage.kSat == 0.0 ) return 0.0;
  1. Finally, in the “biocellFluxRates” function, when no storage layer present, “SoilPerc” is computed but later set to 0 by this following piece of code, since StorageInfil == 0 From biocellFluxRates() in lidproc.c (SWMM5.1.010)
    //... special case of no storage layer present
    if ( theLidProc->storage.thickness == 0.0 )
        StorageEvap = 0.0;
        maxRate = MIN(StorageInfil, SoilPerc);
        SoilPerc = maxRate;
        StorageInfil = maxRate;
  1. So far, both soil percolation and storage infiltration is set to 0 for rain garden. Rain garden will never have infiltration.

My solution is to either add a switch control in biocellFluxRates function where SoilPerc is not reset to 0 when dealing with rain garden, or, initialize LID units with super large seepage rate (the storage.kSat variable).

By the way, I copied these code from openSWMM SWMM code viewer.

Lew Rossman

I believe you are correct, based both on your code analysis and running a simple example. The fix would be to add a Seepage Rate parameter (same as used by the Storage Layer) to the Rain Garden that reflects the Ksat of the native soil underneath the garden which may be different than the plant growth media used in the garden. This native Ksat would then be used to initialize storage.Ksat.

For now the work around is to use a bio-retention cell, instead of a rain garden, with a very small storage layer thickness (like 1 mm), which is what was done in version 5.0 before the separate Rain Garden LID was introduced.

Robert Dickinson

Revisting this issue a Rain Garden modeled a Bio Cell with most of the Drain and Storage information set to 0 works very well. Shouldn't the Rain Garden just have the Bio Cell Dialogs with less restrictions on the Storage Tabs or certain data in the Storage or Drain Tab's of the GUI blocked out?