Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outfall head bug downstream of filled_circular pipe #154

Closed
MitchHeineman opened this issue Dec 18, 2023 · 7 comments
Closed

Outfall head bug downstream of filled_circular pipe #154

MitchHeineman opened this issue Dec 18, 2023 · 7 comments
Assignees
Labels
addressed Issues that have been addressed. Pending merge before closing. bug
Milestone

Comments

@MitchHeineman
Copy link

When a filled_circular pipe lies immediately upstream of an outfall, hydraulic depth in the outfall is pinned at zero for both free and normal boundary conditions. This issue is present in all SWMM versions going back to at least 5.0.013

[TITLE]
;;Project Title/Notes
SWMM 5.2.4 bug for outfall downstream of filled circular pipe
Head at MH13 incorrectly pinned at zero
M. Heineman, Dec. 2023

[OPTIONS]
;;Option Value
FLOW_UNITS GPM
FLOW_ROUTING DYNWAVE
LINK_OFFSETS DEPTH

START_DATE 04/17/2023
START_TIME 00:00:00
REPORT_START_DATE 04/17/2023
REPORT_START_TIME 02:00:00
END_DATE 04/20/2023
END_TIME 12:00:00
REPORT_STEP 00:05:00
ROUTING_STEP 0:00:01

[JUNCTIONS]
;;Name Elevation MaxDepth InitDepth SurDepth Aponded
;;-------------- ---------- ---------- ---------- ---------- ----------
MH15 37.1 14.5 0 0 0
MH17 37.5 14 0 0 0
MH17a 37.5 14 0 0 0
MH15a 37.1 14.5 0 0 0

[OUTFALLS]
;;Name Elevation Type Stage Data Gated Route To
;;-------------- ---------- ---------- ---------------- -------- ----------------
MH13 36.8 FREE NO
MH13a 36.8 FREE NO

[CONDUITS]
;;Name From Node To Node Length Roughness InOffset OutOffset InitFlow MaxFlow
;;-------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ----------
MH17 MH17 MH15 1054 0.013 0 0 0 0
MH15 MH15 MH13 923 0.013 0 0 0 0
MH17a MH17a MH15a 1054 0.013 0 0 0 0
MH15a MH15a MH13a 923 0.013 0 0 0 0

[XSECTIONS]
;;Link Shape Geom1 Geom2 Geom3 Geom4 Barrels Culvert
;;-------------- ------------ ---------------- ---------- ---------- ---------- ---------- ----------
MH17 CIRCULAR 4.5 0 0 0 1
MH15 FILLED_CIRCULAR 4.5 0.1 0 0 1
MH17a CIRCULAR 4.5 0 0 0 1
MH15a CIRCULAR 4.5 0 0 0 1

[INFLOWS]
;;Node Constituent Time Series Type Mfactor Sfactor Baseline Pattern
;;-------------- ---------------- ---------------- -------- -------- -------- -------- --------
MH17 FLOW FlowScenarios FLOW 1.0 1.0
MH17a FLOW FlowScenarios FLOW 1.0 1.0

[TIMESERIES]
;;Name Date Time Value
;;-------------- ---------- ---------- ----------
FlowScenarios 0 1075
FlowScenarios 13 1075
FlowScenarios 13.1 2150
FlowScenarios 24 2150
FlowScenarios 24.1 2950
FlowScenarios 36 2950
FlowScenarios 36.1 7000
FlowScenarios 48 7000
FlowScenarios 48.1 9500
FlowScenarios 60 9500
FlowScenarios 72 1075
FlowScenarios 120 1075

[COORDINATES]
;;Node X-Coord Y-Coord
;;-------------- ------------------ ------------------
MH15 444158.723 626513.005
MH17 443280.476 626538.351
MH17a 443281.743 626257.008
MH15a 444165.059 626277.285
MH13 445143.481 626468.895
MH13a 445145.958 626249.404

@cbuahin cbuahin self-assigned this Dec 21, 2023
@cbuahin cbuahin added this to the v5.3.0 milestone Jan 16, 2024
@cbuahin
Copy link
Collaborator

cbuahin commented Jan 16, 2024

@MitchHeineman, It appears SWMM adjusts the link offset to nodes including outfalls by the thickness of the deposition in the pipe. For non-zero offsets, SWMM sets the depth of the outfall to zero instead of the normal or critical depth as seen here , which ends up being replaced by FUDGE (0.0001) in dwflow.c basically discharging all the flow entering the pipe. I would think in such cases, we could assume ycritical to simulate waterfall flow as outfall nodes have no storage. I suspect there is a good reason why this decision was made. @LRossman are you able to shed some light on this?

@LRossman
Copy link
Collaborator

The issue exists not just for partly filled circular pipes but for any link with a non-zero offset at a free or normal outfall node. The problem is in the following lines of the outfall_setOutfallDepth() function in node.c:

    switch ( Outfall[i].type )
    {
      case FREE_OUTFALL:
        if ( z > 0.0 ) Node[j].newDepth = 0.0;
        else Node[j].newDepth = MIN(yNorm, yCrit);
        return;

      case NORMAL_OUTFALL:
        if ( z > 0.0 ) Node[j].newDepth = 0.0;
        else Node[j].newDepth = yNorm;
        return;

The fix is to replace these lines with:

    switch ( Outfall[i].type )
    {
      case FREE_OUTFALL:
        Node[j].newDepth = z + MIN(yNorm, yCrit);
        return;

      case NORMAL_OUTFALL:
        Node[j].newDepth = z + yNorm;
        return;

This results in the following depths at the two outfalls (MH13 connected to a partly filled circular pipe and MH13a connected to a regular circular pipe) in @MitchHeineman 's example:
image

@cbuahin
Copy link
Collaborator

cbuahin commented Jan 17, 2024

@LRossman , that makes sense. Is there a reason it was returning zero previously or is that just a bug?

@cbuahin
Copy link
Collaborator

cbuahin commented Jan 17, 2024

Also, I believe the following snippet in the function node_setOutletDepth in node.c should also be modified.

      default:
        if ( z > 0.0 ) Node[j].newDepth = 0.0;
        else Node[j].newDepth = MIN(yNorm, yCrit);

to

Node[j].newDepth = z + MIN(yNorm, yCrit);

right?

cbuahin added a commit that referenced this issue Jan 17, 2024
@cbuahin cbuahin added the addressed Issues that have been addressed. Pending merge before closing. label Jan 17, 2024
@LRossman
Copy link
Collaborator

The function was returning 0 because of the if ( z > 0.0 ) Node[j].newDepth = 0.0; line, as z (the connecting conduit's offset) was non-zero (for partly filled circular pipes the filled depth is added to whatever offset the user specified).

Yes, the "default" condition in node_setOutletDepth should also be corrected as you indicated.

@cbuahin
Copy link
Collaborator

cbuahin commented Jan 18, 2024

I understand that it is zero because of the line you reference. I referenced it in my original comment. I just wanted to understand if there was some theoretic/hydraulic rationale behind why that code was used in the first place.

@LRossman
Copy link
Collaborator

I believe my thinking was that if the connecting pipe's outlet is above the outfall node invert (due to the offset) then there is a free fall of water from the pipe onto the node (i.e., an air gap) and the node wouldn't see the critical (or normal) flow depth occurring in the pipe.

@cbuahin cbuahin closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed Issues that have been addressed. Pending merge before closing. bug
Projects
None yet
Development

No branches or pull requests

4 participants