Stormwater-Management-Model icon indicating copy to clipboard operation
Stormwater-Management-Model copied to clipboard

No recovery of soil moisture deficit for exfiltration from storage units

Open LRossman opened this issue 5 years ago • 0 comments

There is a bug in the storage_getlosses() function of node.c. The code only applies the Green-Ampt function for exfiltration when the storage unit’s volume is greater than FUDGE. That means that after the unit drains down completely the G-A function is not called and no recovery of soil moisture deficit can occur. The affected section of the code is shown below with the necessary corrections:

////// --- if node has some stored volume   DELETE
////if ( Node[j].newVolume > FUDGE )        DELETE
////{                                       DELETE
        // --- get node's evap. rate (ft/s) &  exfiltration object
        k = Node[j].subIndex;
        evapRate = Evap.rate * Storage[k].fEvap;
        exfil = Storage[k].exfil;
 
        // --- if either of these apply
        if ( evapRate > 0.0 || exfil != NULL) 
        {
            // --- obtain storage depth & surface area 
            depth = Node[j].newDepth;
            area = storage_getSurfArea(j, depth);
 
            // --- compute evap rate over this area (cfs)
            if (Node[j].newVolume > FUDGE) evapRate = area * evapRate;
 
            // --- find exfiltration rate (cfs) through bottom and side banks
            if ( exfil != NULL )
            {
                exfilRate = exfil_getLoss(exfil, tStep, depth, area);
            }
 
            // --- total loss over time step cannot exceed stored volume
            totalLoss = (evapRate + exfilRate) * tStep;
            if ( totalLoss > Node[j].newVolume )
            {
                lossRatio = Node[j].newVolume / totalLoss;
                evapRate *= lossRatio;
                exfilRate *= lossRatio; 
            }
        }
////}   DELETE

LRossman avatar Apr 05 '19 01:04 LRossman