From 854abdf5d29776f4921d0759c76e855601238145 Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Wed, 9 Dec 2020 20:26:13 -0500 Subject: [PATCH] Update hydraul.c Fixes a bug that was adding time on-line to a closed pump's energy usage for the time step just prior to when a rule-based control re-opens it. --- src/hydraul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hydraul.c b/src/hydraul.c index c1a839d..6ce427d 100755 --- a/src/hydraul.c +++ b/src/hydraul.c @@ -895,7 +895,7 @@ void addenergy(Project *pr, long hstep) // Skip closed pumps pump = &net->Pump[j]; k = pump->Link; - if (hyd->LinkStatus[k] <= CLOSED) continue; + if (pump->Energy.CurrentEffic == 0.0) continue; q = MAX(QZERO, ABS(hyd->LinkFlow[k])); // Find pump-specific energy cost