From 2d783041a4506a1e3e0ddb35c9aa0aa375b4ac5f Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Mon, 8 Aug 2022 18:08:45 -0400 Subject: [PATCH 1/2] Fix for FCV problem This update prevents a solution where the computed loss coefficient for a FCV at its flow setting would be less than the user supplied fully opened coefficient. --- ReleaseNotes2_3.md | 2 ++ src/hydstatus.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ReleaseNotes2_3.md b/ReleaseNotes2_3.md index 3e3f924..7042988 100644 --- a/ReleaseNotes2_3.md +++ b/ReleaseNotes2_3.md @@ -22,6 +22,8 @@ This document describes the changes and updates that have been made in version 2 - changing the absolute tolerance used to compare the closeness of test results to benchmark values from 0 to 0.0001 - dropping the "correct decimal digits" test - dropping the check for identical status report content since it prevents accepting code changes that produce more accurate solutions in fewer iterations. + - A possible loss of network connectivity when evaluating a Pressure Sustaining Valve was prevented. + - Having the implied loss coefficient for an active Flow Control Valve be less than its fully opened value was prevented. diff --git a/src/hydstatus.c b/src/hydstatus.c index 4013ec9..d0f1d02 100644 --- a/src/hydstatus.c +++ b/src/hydstatus.c @@ -7,7 +7,7 @@ Description: updates hydraulic status of network elements Authors: see AUTHORS Copyright: see AUTHORS License: see LICENSE -Last Updated: 05/15/2019 +Last Updated: 08/08/2022 ****************************************************************************** */ @@ -394,6 +394,15 @@ StatusType fcvstatus(Project *pr, int k, StatusType s, double h1, double h2) { status = ACTIVE; } + + // Active valve's loss coeff. can't be < fully open loss coeff. + else if (status == ACTIVE) + { + if ((h1 - h2) / SQR(hyd->LinkFlow[k] < pr->network.Link[k].Km) + { + status = XFCV; + } + } return status; } From 6ccddb811d205ea4ec0fd0fce1c7b1b0acf7597d Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Mon, 8 Aug 2022 18:37:07 -0400 Subject: [PATCH 2/2] Update hydstatus.c --- src/hydstatus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hydstatus.c b/src/hydstatus.c index d0f1d02..f3cae46 100644 --- a/src/hydstatus.c +++ b/src/hydstatus.c @@ -398,7 +398,7 @@ StatusType fcvstatus(Project *pr, int k, StatusType s, double h1, double h2) // Active valve's loss coeff. can't be < fully open loss coeff. else if (status == ACTIVE) { - if ((h1 - h2) / SQR(hyd->LinkFlow[k] < pr->network.Link[k].Km) + if ((h1 - h2) / SQR(hyd->LinkFlow[k]) < pr->network.Link[k].Km) { status = XFCV; }