For example, this article will use this scheme:
You can download example .stks file and open it in Stokes.
In this example:
The article will use the term network core - this is how the Stokes code refers to sections of pipes between which the flow can be redistributed. If the network is a dead-end, then the flow in each section consists of the flows of sections connected to it, located further from the source. But when there is a ring, it is impossible to determine in advance how the flow will be distributed between the half-rings; it is necessary to calculate. Similarly, in the case when there is more than one source, we can find out what part of consumption will be taken over by one source and what by the second only after linking. One might call this "rings" if multi-source networks did not exist.
I (author Stokes) did not find any commonly used suitable term for designating such areas, so I came up with one for internal use. You don't have to try to look for it on the Internet.
For understanding: in the example presented, the core is black and orange pipes. And the rest are dead-end branches from the core.
Stokes has a function for automatically selecting the minimum required internal pipe diameters in the network.
The diameters are selected in such a way that the following conditions are met:
If there are rings or several sources, then all sections are divided into two types: the core of the network and dead-end sections extending from it. All pipes of the core are assigned one diameter. The autoselect algorithm tries to assign such diameters to pipes of dead-end branches so that the pressure drop per linear meter of the pipeline is approximately the same in all sections – as much as possible under given conditions.
If the pressure at the source is less than the minimum allowable for any node, obviously, it is impossible to fix the problem by changing the pipe diameters. In this case, the message "There is not enough pressure in network #XX: for nodes YY." will be displayed and autoselect for this subnet will not be performed. You need to first change the node pressures so that the source pressures are above the minimum allowable pressure for any of the other nodes (taking into account the height difference between them).
In general, Stokes selects the diameters so that the pressure and velocity are kept within the required limits with the scheme that is drawn.
But in some cases it may try to provide the network with a margin of safety for operability in case of failures:
At this stage, the program searches for such a minimum diameter that, when assigned to all pipes in the network, the pressure and flow velocity will be within the specified limits.
The diameter obtained at the last stage is assigned unchanged only to the core of the network – rings and pipes from sources to the point of merging of flows. In the example project, these are pipes in black and orange colors.
On dead-end sections extending from the ring towards consumers, Stokes tries to reduce the diameters to the minimum permissible ones. At the same time, the diameters of individual pipes in the chain from the core of the network to the consumer are selected, if possible, so that the total pressure drop is distributed between them in proportion to their length (as far as possible under given conditions). Since it is not an exact calculation of the desired diameters, but a choice from a list of options, the nearest larger one is selected for all sections. And in the last section of the chain, on the contrary, Stokes tries to reduce the diameter in order to spend the pressure reserve accumulated during these rounding up.