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

Max depth not checked in MODBASKETHANDLE cross section

Open Tiehong opened this issue 2 years ago • 3 comments

We may find a bug related to MODBASKETHANDLE cross section. If user inputs the following parameters:

[XSECTIONS] ;;Link Shape Geom1 Geom2 Geom3 Geom4 Barrels Culvert
;;-------------- ------------ ---------------- ---------- ---------- ---------- ---------- ---------- C1 MODBASKETHANDLE 1.09 3 0.9 0 1

image

According to the SWMM5 source code in xsect_setParams() in xsect.c file:

case MOD_BASKET:
    if ( p[1] <= 0.0 ) return FALSE;
    if ( p[2] < p[1]/2.0 ) p[2] = p[1]/2.0;
    xsect->yFull = p[0]/ucf;
    xsect->wMax  = p[1]/ucf;

    // --- radius of circular arc
    xsect->rBot = p[2]/ucf;

    // --- angle of circular arc
    theta = 2.0 * asin(xsect->wMax / 2.0 / xsect->rBot);
    xsect->sBot = theta;

    // --- height of circular arc
    xsect->yBot = xsect->rBot * (1.0 - cos(theta/2.0));
    xsect->ywMax = xsect->yFull - xsect->yBot;

    // --- area of circular arc
    xsect->aBot = xsect->rBot * xsect->rBot /
                  2.0 * (theta - sin(theta));

    // --- full area
    xsect->aFull = (xsect->yFull - xsect->yBot) * xsect->wMax +
                   xsect->aBot;

    // --- full hydraulic radius & section factor
    xsect->rFull = xsect->aFull / (xsect->rBot * theta + 2.0 *
                    (xsect->yFull - xsect->yBot) + xsect->wMax);
    xsect->sFull = xsect->aFull * pow(xsect->rFull, 2./3.);

    // --- area corresponding to max. section factor
    xsect->sMax = xsect_getSofA(xsect, Amax[MOD_BASKET]*xsect->aFull);
    break;

radius (p[2]) is checked and compared with width (p[1]) and changed from 0.9 to 1.5; however, max depth/geom1 (p[0]) is not checked and verified, thus yFull is less than yBot and results negative ywMax.

RECT_ROUND may have similar issue.

Tiehong avatar Oct 04 '22 13:10 Tiehong

Maybe that error should be checked in the UX or with a validation rule?

dickinsonre avatar Oct 04 '22 18:10 dickinsonre

case RECT_ROUND:
    if ( p[1] <= 0.0 ) return FALSE;
    if ( p[2] < p[1]/2.0 ) p[2] = p[1]/2.0;

has the same issue.

dickinsonre avatar Oct 04 '22 21:10 dickinsonre

Feasible dimensions for the modified baskethandle shape must satisfy the following conditions:

R >= W/2

and

 H > R * (1 - cos(asin(W/(2*R)))

where H is total height (p[0]), W is bottom width (p[1]) and R is the radius of curvature (p[2]). In retrospect it might have been better to have the user specify the height of the bottom section rather than the total height so that the second condition wouldn't be needed. Then if R was < W/2 it could just be set to W/2 with no negative results. But as it stands now the engine's input reader should issue a fatal error if the second condition is not met and a similar check should be made for the Rectangular - Round shape.

LRossman avatar Oct 05 '22 14:10 LRossman

Closed in Release v5.2.2

michaeltryby avatar Jun 09 '23 21:06 michaeltryby