Page 1 of 1

Flow through split pipes

Posted: Mon Mar 28, 2016 12:11 am
by JasonC
When you put a fork in a pipe, does the flow split evenly to both sides?

For example, let's say im producing heavy oil but not nearly enough to saturate the pipe. And I have the pipe going to both making solid fuel and making lubricant. Will it go to both equally, or is there a preference depending on pipe layout?

Re: Flow through split pipes

Posted: Mon Mar 28, 2016 12:52 am
by Rockstar04
I'm not 100% sure, but it may depend on the length of the pipe after the fork. If those are equal then I would assume it is divided mostly equally.

Re: Flow through split pipes

Posted: Mon Mar 28, 2016 7:34 am
by twepy
As far as my knowledge goes there is no guarantee that liquids are divided equally at splits or perhaps better said that all chemical plants with a demand gets equal parts of heavy oil.

Personally I prefer to prioritize lubricant production over fuel block production, by giving the chemical plant which produces lubricant direct access to heavy oil, it can always produce if there is a demand for lubricant as i dont use a storage tank for lubricant. The fuel block producing plant get access through a pump, which is wired to the heavy oil storage tank with a signal wire. Next i set on the pump a condition that it should run when heavy oil is above 500 (heavy oil > 500) and now fuel block production will only run on the excess heavy oil.

Re: Flow through split pipes

Posted: Mon Mar 28, 2016 8:30 am
by BlakeMW
As a rule if the split is very symmetrical the flow will tend to also be symmetrical, but if on one side the pipe is shorter the flow will probably favor the shorter pipe (in terms of distance to consuming plant).

It is possible to do a passive split using storage tanks - tanks act as "resistors" they impede the flow of liquid, if you have a pipe split between two tanks because of tank resistance it will always find it easier to enter the less full tank and so the flow will be split between each tank.

Image

That is an example of a passive split setup, petroleum comes from the north, it is split between two tanks which deliver it fairly to the sulfur and plastics plant. This passive split technique is probably the best if you want all of a liquid to be available for use but don't want any consumer getting (completely) starved. Solutions using small pumps tend to give absolute priority to one consumer and involve storing up a buffer of unusable liquid (unless the priority consumer actually needs it), although often that is what you want.

Re: Flow through split pipes

Posted: Mon Mar 28, 2016 1:40 pm
by JasonC
Thanks all!

Re: Flow through split pipes

Posted: Mon Mar 28, 2016 5:20 pm
by XKnight
BlakeMW wrote:As a rule if the split is very symmetrical the flow will tend to also be symmetrical, but if on one side the pipe is shorter the flow will probably favor the shorter pipe (in terms of distance to consuming plant).

It is possible to do a passive split using storage tanks - tanks act as "resistors" they impede the flow of liquid, if you have a pipe split between two tanks because of tank resistance it will always find it easier to enter the less full tank and so the flow will be split between each tank.

Image

That is an example of a passive split setup, petroleum comes from the north, it is split between two tanks which deliver it fairly to the sulfur and plastics plant. This passive split technique is probably the best if you want all of a liquid to be available for use but don't want any consumer getting (completely) starved. Solutions using small pumps tend to give absolute priority to one consumer and involve storing up a buffer of unusable liquid (unless the priority consumer actually needs it), although often that is what you want.
In fact, this is not true. Liquid splitting is performed sequentially, it means first split will produce slightly bigger output than second, second split will be bigger than third and so on.

Example. Tank with 1250 water inside is connected with 2 empty pipes:
First pipe will receive (1250/2500 - 0 / 10) * 10 * 0.4 = 2 units of water
Second pipe - ((1250 - 2)/2500 - 0/10) * 10 * 0.4 = 1.9968 units
These operations are performed at the same game-tick.
Plot
The only way I found to split liquid evenly is to use pumps.

Re: Flow through split pipes

Posted: Tue Mar 29, 2016 10:12 am
by BlakeMW
I'm only interested in what works well enough in practice and experimentally. For example the passive split tanks works well enough for ensuring neither plastics nor sulfur plant get completely starved. Having designs be highly symmetrical works a lot better than an asymmetrical design, for example if you put 2 offshore pumps into one pipe, then split that pipe and put it through two strings of 14 boilers, then rejoin the pipes, this will usually work if the split and join is completely symmetrical, but if it is even slightly asymmetrical it usually completely breaks down and most the water goes via one string of boilers.

Here is an example:
Symmetrical design works fine, 100% of boilers operate.
Image

Asymmetrical design results in water heavily favoring one string and only about 67% of boilers run:
Image
(If the difference isn't obvious, I move the outlet pipe up 2 units)


I don't really care to speculate too much why the game hates the asymmetrical design, but I suspect that to optimize performance the game caches "rivers" of flow through pipe systems and has future flow take the path of least resistance which earlier flow took so if one path is substantially shorter than another path the flow favors the shorter path.

Note: Order of pipe placement is relevant because it determines simulation order, so the above slightly asymmetrical design can actually work properly if the pipes are placed in a certain order. But pipe placement order generally only provides a small bias to the simulation, if a design is good it should work and if it's bad it should not work regardless of pipe placement order.