OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

A problem occurred when the control rules were applied to the FCV valve #707

Open Zcy1187949797 opened 1 year ago

Zcy1187949797 commented 1 year ago

Hello, I found a conundrum when I was taking control statements on the FCV valve. The details are as follows: My expectation is that when the tank level behind the valve is higher than 1.2 meters, the FCV set the flow rate from 4 to 5, and the valve is closed. But after the actual simulation, only changed the valve set value, and did not close the valve. @PO7V}JY6PYX ~S Z(1@H26 XJ27_K6$TBFCGI8`0J`ER%5 The control statements are as follows: RULE 1 IF TANK 9 LEVEL ABOVE 1.2 THEN VALVE 9 SETTING IS 5 AND VALVE 9 STATUS IS CLOSED Sincere request to solve, thank you very much

LRossman commented 1 year ago

Your rule contains two conflicting actions to apply to Valve 9 - set its flow rate to 5 and close it (which essentially sets the flow rate to 0). An action clause for a link will replace an earlier appearing action for the link only if it belongs to a rule with a higher priority. In this case the STATUS CLOSED action is ignored since it has the same priority as SETTING IS 5 action which is the one that winds up being applied.

A more logically consistent rule statement would change the last clause to:

ELSE VALVE 9 STATUS IS CLOSED