OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
273 stars 203 forks source link

Ill-Conditioned in Epanet 2.0 but successful in Epanet 2.2 #748

Closed allenmlowe closed 10 months ago

allenmlowe commented 10 months ago

ill-conditioned.inp.txt

Submitting a network running successfully in Epanet 2.2 but should not because a part is not connected to a source. Am I missing something?

allenmlowe commented 10 months ago

Successful Net1_ill_conditioned.inp.txt

Both are successful in Epanet 2.0 and Epanet 2.2 but should not since even an isolated node is flagged as an error.

LRossman commented 10 months ago

All of the isolated nodes in the example have zero demand. This does not cause the solution matrix to be ill-conditioned and so a solution is found with zero flow in all of the isolated pipes and zero head at all the isolated nodes.

If you add some demand to any of the isolated nodes EPANET will report that a solution cannot be found with the demand node identified as being disconnected from any source. However if you run the analysis using the PDA option, EPANET will once again find a solution with the demand node having its demand reduced to 0.

allenmlowe commented 10 months ago

Thank you @LRossman for replying.

The discovery of this issue came about when we were converting a shapefile to Epanet. After initial conversion we started to run it to discover any errors in the network. We were able to correct all unconnected nodes as Epanet issued such errors.

The network has more than 10,000 nodes and pipes so inputting the node demands will take some time. However, even without completing all the nodal demands (most of them have zero demands), we started running the network to have an initial assessment. After some attempts and corrections, we were able to run the network successfully.

Although on close inspection there were numerous isolated sections because when creating the shapes files, pipes need not connect to nodes unlike when creating the network with Epanet, pipes should connect to nodes. These isolated sections have of course no demands yet, but some of the nodes should not have demands because they are transmission lines.

A simplified network with obviously unconnected section was submitted to see right away the problem. However with a large network, finding these unconnected sections becomes harder since the toolkit will not flag this as an error.

Thank you for spending time to address this issue.

LRossman commented 10 months ago

A simple way to check for unconnected nodes in a large network is to set the demand for all nodes to some arbitrary value and then run an analysis. If you are using the EPANET GUI you can use the Group Edit feature to change the demands all at once. If you are using the toolkit you can do it in code using EN_setnodevalue within a for-loop. The resulting Status Report will list all the unconnected nodes.

allenmlowe commented 10 months ago

Thank you @LRossman for the tip!