OpenWaterAnalytics / EPANET-Matlab-Toolkit

A Matlab class for EPANET water distribution simulation libraries
https://www.youtube.com/playlist?list=PLasF_QN6wZjRNj-B8zumGlnAXxLnCa_07
European Union Public License 1.2
75 stars 61 forks source link

EMT incorrectly reads valve setting when its fixed status is OPEN or CLOSED not 'NONE' #168

Closed stephen-young closed 2 years ago

stephen-young commented 4 years ago

Describe the bug When a valve in the network has a fixed status of "closed" or "OPEN" in the status section of the .inp file, the epanet object does assign the correct number for its setting.

I've put two networks in valve_issue_networks.zip to illustrate the problem. Both networks have a PRV that has a pressure setting of 30 m. Both networks are identical except for the initial/fixed status of the valve is "open" in one and "none" in the other.

When I load the network where the valve's initial status is "none" and query the valve's initial setting with getLinkInitialSetting, the valve's setting is read correctly as 30 but when I load the network where the valve's initial status is "open", the setting has a value of -3.048e+09.

When computing a hydraulic analysis with the "open" valve with the incorrect setting, the results show the expected behaviour of the valve setting being ignored but what if there was a control statement in the network that made the valve become active? Would the PRV setting of -3.048+09 be respected by the hydraulic solver?

To Reproduce

net = epanet('simple_network_1P1T1D1V_valve_status_none.inp');
net.getLinkInitialSetting(net.LinkValveIndex) % Valve setting read correctly

net2 = epanet('simple_network_1P1T1D1V_valve_status_open.inp');
net.getLinkInitialSetting(net.LinkValveIndex) % Valve setting read incorrectly as -3.048e+09

Desktop (please complete the following information):

Mariosmsk commented 4 years ago

Thanks for the issue! I have reposted your issue to EPANET because I think this is an EPANET bug, not EMT. https://github.com/OpenWaterAnalytics/EPANET/issues/583

maserukabendicto commented 3 years ago

have experienced the following three issues with this.