SPF-OST / pytrnsys_gui

Graphical user interface for pytrnsys
https://pytrnsys.readthedocs.io
GNU General Public License v3.0
3 stars 4 forks source link

Disallow connections of components to themselves #370

Open zuckerruebe opened 1 year ago

zuckerruebe commented 1 year ago

Currently the GUI and mass flow solver allow, e.g., a pump to connect to itself. However, since the mass flow solvers is only given the information about which components connect to each other - and not which ports connect each other - it cannot distinguish between, to use the above example of a pump connected to itself, a pump connected to itself in the "correct" or "incorrect" direction: in both cases the export for the mass flow solver will be identical. That means that in one of the cases it's quite unclear what will happen.

I've double checked and what happens is that the mass flow solver fails to find a solution for both cases.

Which is the least bad thing that can happen, but it must still appear a bit weird to the user that the solver cannot solve the most straight-forward system of a pipe connected to itself in the correct way.

For that reason, we should simply not allow components to connect to themselves directly, both in the solver and also in the GUI.