Merge pull request #696 from OpenWaterAnalytics/dev-fcv-fix

Fixes Possible Incorrect Solution for Flow Control Valves
This commit is contained in:
Lew Rossman
2022-08-11 10:41:39 -04:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -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 - 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 "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. - 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.

View File

@@ -7,7 +7,7 @@ Description: updates hydraulic status of network elements
Authors: see AUTHORS Authors: see AUTHORS
Copyright: see AUTHORS Copyright: see AUTHORS
License: see LICENSE 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; 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; return status;
} }