Automatic detection of the flow direction

When users introduce vertical pipes, the program automatically tags the initial and final elevation of the direction of flow of the liquid they are carrying (unless these elevations are blocked).