From 58ff46f2c4975dd32d06a1f1f7e05aa3f779dbb8 Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Thu, 16 Nov 2017 13:27:33 -0500 Subject: [PATCH] Outfall backflow flow balance fix --- src/routing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routing.c b/src/routing.c index 55b9592dc..812e608ee 100644 --- a/src/routing.c +++ b/src/routing.c @@ -804,7 +804,7 @@ void removeOutflows(double tStep) // --- update mass balance with flow and mass leaving the system // through outfalls and flooded interior nodes q = node_getSystemOutflow(i, &isFlooded); - if ( q != 0.0 ) + if ( q > 0.0 ) { massbal_addOutflowFlow(q, isFlooded); for ( p = 0; p < Nobjects[POLLUT]; p++ ) @@ -813,6 +813,7 @@ void removeOutflows(double tStep) massbal_addOutflowQual(p, w, isFlooded); } } + else massbal__addInflowFlow(EXTERNAL_INFLOW, -q); // --- update mass balance with mass leaving system through negative // lateral inflows (lateral flow was previously accounted for)