A deeper look into the fluid system and so many questions

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
J o
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Feb 18, 2020 7:22 am
Contact:

A deeper look into the fluid system and so many questions

Post by J o »

Dear Factorians,

While creating blueprints for my next Megabase after v1.0 release I struggle with the fluid system. More or less i would say.

(I coudn't find a better place to post this, so feel free to move if there is a better location for this.)

First of all the pumps:

I couldn't find a single way to pump at the maximum rate of 12k/s, a Pump to Pump for example has a throuput of 6k/s.
pump to pump.jpg
pump to pump.jpg (4.45 KiB) Viewed 12537 times
However, thats not quite important but i am curious to get a solution for this, just to prove that the Wiki isn't wrong in that fact.

But the real part just begin, it is well known that with increasing Pipelength the pump rate decreases in an exponential fashion (more or less according to the friction and resulting pressuredrop like described by Poiseuille's law). The Wiki states that the fluid flow depends on the fluid level in the pipe entities and thus can by considered as pressures in the entities. We know from fluidmecanics and thermodynamics that systems which are not in equillibria tend to balance themselves. Hence a pressure gradient results in a flow or in other words if there is a source like water pump or oil well the fluid flows from that location to an assambler or whatever other drain there is.

Now the deal, in the picture below everything is fine except for the most right and the most left pipe/pump layout.
Pipes and Pumps.jpg
Pipes and Pumps.jpg (29.17 KiB) Viewed 12537 times
Beginning with the layout on the right, can anybody give an physical reason why the upper pipe entity have a higher fluid level (37.5) than the lower (31.3).
Same for the left layout, from upper to lower pipe entity the fluid levels are 37.5 / 31.3 / 100.

However all fluid levels in pipe entities infront of a pump are higher than the fluid level in a pipe entity in front of that.

Now underground pipes. Uhh they are strange... really... I mean that they count always as a pipe of length 2 is not in question. Looking at the following:
pump pipe underground.jpg
pump pipe underground.jpg (284.64 KiB) Viewed 12537 times
Beginning with the left layout which is pump - pipe - undergound - pump there are a few possible fluid level states. The Pump rate is 2250/s for all pumps left as well as right.

To maintain the order from upper pipe to lower pipe entity the fluid levels can be as follows from left to right:
  • 37.5 / 31.3 / 62.5
    37.5 / 31.3 / 100
    37.5 / 31.3 / 100
    37.5 / 31.3 / 100
    37.5 / 31.3 / 100
    37.5 / 31.3 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
And for the Right side also from left to right:
  • 37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 68.8 / 62.5
    37.5 / 31.3 / 62.5
    37.5 / 31.3 / 62.5
    37.5 / 31.3 / 100
Really... I don't get it ^^

Lets get to flowing direction.
Maybe someone wondered what or if there is a preferred flowing direction since from a pipe entity there are 3 different ways to flow.
Flowing direction 1.jpg
Flowing direction 1.jpg (250.02 KiB) Viewed 12537 times
Indeed, there are preferred flowing directions. From a source to a pump, the left is preffered and the only one which pumps at all at 6k/s.
This behavior changes with more pipes between the source and the pump, for one pipe its still the Left pump which pumps the most but straight and right get a bit of fluid as well. The pump rates are from Left over straight to right: 1800/s, 1080/s and 117/s.
For 2 pipes: 1127/s, 1502/s, 362/s and for 3 pipes 1367/s, 1119/s, 498/s.
This is for my understanding logical because one entity have to be updated as first, so one way should always be preferred. However it's not always the same order of update?

But it gets even more strange. The rotation of tanks also have an significant influence of the flow direction.
Flowing direction 2.jpg
Flowing direction 2.jpg (162.13 KiB) Viewed 12537 times
Beginning with the tanks which fills fastest:

Left side: straight / left / right
Right side: left / straight / right

And why? Can it be of any use?

Just one more, the reason why I was curious in the first place.
So throuput is everything in late game, so waht about placing pumps and pipes next to each other.
double pipe pump.jpg
double pipe pump.jpg (178.29 KiB) Viewed 12537 times
Not speaking of the fluid levels of the pipes in this layout, because that's just as confusing as in the previous example the pump rates are more interesting.
Notice, that the lower 3 infinity pipes are all sources.

The pumprates of the 4 pumps in the most left layout are as follows:

2250 / 2250
2250 / 750

Second from the left:

2250 / 1875
750 / 1425

Second from the right (luckily the state for a standard 12 beacon design):

2250 / 2250
2250 / 750

And last the most right layout:

2250 / 1875
750 / 1425

Those 2 states alternate for longer underground pipe distances.
What is going on here?


Do anyone, and I am absolutly curious about this, have a clue how the fluid system really works?

I do wish you all a happy 1.0 release weekend :D
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3716
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by DaveMcW »

You are mostly right, the fluid system is biased depending on flow direction. What you missed is that it is ALSO biased depending on build order. :?

The best directions are
  • west to east
  • south to north
The best build order is in the same direction as your flow.

If you flow or build in the wrong direction, you get reduced throughput.
mrvn
Smart Inserter
Smart Inserter
Posts: 5873
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by mrvn »

When you have a pipeline with pumps then always place a pump before and after a tank. The tank has a far larger fluid box making the pump work better.

I think a tank - pump - tank will give you the maximum speed.
User avatar
J o
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Feb 18, 2020 7:22 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by J o »

ALSO biased depending on build order
Wait...

That means there is almost now way that a placed blueprint reach a maximum fluid flow. :o :shock: So the layout have to stay a good bit under the maximum flowrate :?
I think a tank - pump - tank will give you the maximum speed
I am afraid not :cry:
User avatar
J o
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Feb 18, 2020 7:22 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by J o »

I think a tank - pump - tank will give you the maximum speed
I am afraid not :cry:
Ok that was to fast... you are absolutly right, my appologies.
mrvn
Smart Inserter
Smart Inserter
Posts: 5873
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by mrvn »

J o wrote: Wed Aug 12, 2020 11:09 am
I think a tank - pump - tank will give you the maximum speed
I am afraid not :cry:
Ok that was to fast... you are absolutly right, my appologies.
Note that the maximum speed you get isn't necessarily the speed set for the pump in the prototype. Even tanks have a limited size and the combination of tank and fluid box limits the speed. Bob used to have different pumps (mk1, mk2, ...) but in the end they all had the same speed.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by orzelek »

Tbh I don't think you should be looking that in depth into fluid system.

You need to accept that parts of it especially as far as fluid flow goes work on "magic" and you won't be able to predict it's behavior.
This mainly pertains to fact that both build order and going over chunk boundaries can affect fluid system I think.
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 509
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by Yoyobuae »

J o wrote: Wed Aug 12, 2020 11:02 am
I think a tank - pump - tank will give you the maximum speed
I am afraid not :cry:
Screenshot_2020-08-12_11-09-50.png
Screenshot_2020-08-12_11-09-50.png (1.25 MiB) Viewed 12441 times
While infinity pipes maybe be "infinite" they are still pipes. Thus they have the same exact 6000 fluid/s limit as regular pipes.

In other words, every single infinity pipe you used as a source or as a sink introduced a limit of 6000 fluid/s. For fluid sources/sinks which are not throughput limited to the capacity of a single pipe you'll need to use a setup like the one in the screenshot above.

Now I personally think that the tank-pump-tank setup can be a bit bulky to work with. In some cases it might be better to just stick to 3000 fluid/s max which makes pipelines much, much easier to work with (can use underground-pump-underground, and pump-pipe-pump for corners). Or go even lower down to 1000 fluid/s, which allows up to 200 pipe tiles between pumps. Then you can join three 1000 fluid/s lines into a single 3000 fluid/s one, or split a 3000 fluid/s one back into three 1000 fluid/s lines. Or if you really want the max throughput then join four 3000 fluid/s lines into a single 12000 fluid/s tank-pump-tank line.
Last edited by Yoyobuae on Wed Aug 12, 2020 4:29 pm, edited 4 times in total.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by Qon »

If you don't stress the pipe system to the flow limits and instead have plenty of headroom with parallel lines then you don't need to care about the exact flow rate per pipe or any of the inconsistencies like build order, preferred direction and chunk based updates or whatever.

Trains with fluidtank transport fluids at long distance without pressure drops and you can barrel any vanilla liquid except steam to transport fluids without pressure concerns.

Basically, pipes are only really used when pumpjacking and as inputs to machines and don't need to be used for long distance transport. And if you have many smaller fluid processing stations instead of trying to make a few massive ones then you don't have a problem with massive throughput needed in pipes in a small area.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
J o
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Feb 18, 2020 7:22 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by J o »

If you don't stress the pipe system to the flow limits and instead have plenty of headroom with parallel lines then you don't need to care about the exact flow rate per pipe or any of the inconsistencies like build order, preferred direction and chunk based updates or whatever.
But that's the point, as a process engineer i try to layout things in the "best" way possible. Simplest example is a full belt. So why not try to achieve the same in the fluid system.
Basically, pipes are only really used when pumpjacking and as inputs to machines and don't need to be used for long distance transport. And if you have many smaller fluid processing stations instead of trying to make a few massive ones then you don't have a problem with massive throughput needed in pipes in a small area.
True, but in a late game sulfur / acid / batteries build i am working on, i have an acid production of 6812/s and a liquid gas consumption of 9430/s which is tricky but still ok. But also i have a water consumption of 39400/s which is pretty hard to layout symmatrically and even distributed.

Thanks for all the help and Happy Factorio Releas Day! :)
(That should be an official holiday don't you think? :D )
User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by 5thHorseman »

J o wrote: Fri Aug 14, 2020 5:34 am But that's the point, as a process engineer i try to layout things in the "best" way possible. Simplest example is a full belt. So why not try to achieve the same in the fluid system.
As an engineer you can appreciate that others built something that doesn't work the way you'd expect. Or want. Or think was reasonable. Or ever even dream of.

This is such a situation.

And I'm sad as well that it wasn't addressed before 1.0. Apparently they were working on it but hit some snags.
User avatar
J o
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Feb 18, 2020 7:22 am
Contact:

Re: A deeper look into the fluid system and so many questions

Post by J o »

As an engineer you can appreciate that others built something that doesn't work the way you'd expect. Or want. Or think was reasonable. Or ever even dream of.
Of course, i never criticized somebody elses design, nor do i think that i have the "best" or only working design for something. That is the point of Factorio, try it self and if you fail get inspiration from somewhere and try again, repeat until you are happy with the resuult you came up with.

The point of my satetment was, that i want to care about the underlaying mechanics of the fluid system, to design it for my personal ocd nerdness (i am pretty sure thats an official word for that :D )
the_potty_1
Inserter
Inserter
Posts: 23
Joined: Sun Aug 16, 2020 12:12 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by the_potty_1 »

J o wrote: Wed Aug 12, 2020 10:27 am
Indeed, there are preferred flowing directions.
I suspect several people misunderstood what you said here. I'm pretty sure the OP did not mean pipes work better if the fluid is being piped west. He meant, at any pipe junction, one output will be consistently given more product. Pipes need splitters.

The only place I ever really meet this problem is when dividing my petroleum gas so some goes to sulphur and the rest goes to plastic. Typically I lay a pump from the refineries into a tank, then two pumps out of that tank into two more tanks, those tanks feed plastic and sulphur respectively. The second pair of pumps act as non-return valves so if one line uses all it's gas it doesn't start stealing the other line's gas. Nevertheless, one of those second pair of tanks will generally be full, and the second one empty.

Just this week I finally cracked, sat down, and figured out how to circuit network, just to solve this. I wired both of the tanks as inputs into an arithmetic combinator, to calculate the total gas already allocated. I divided the sum by 2, and output the result arbitrarily as 'steam'. I wired the 'steam' output from the combinator into a decider combinator, and also wired the tank which was consistently full as input. The decider compares the level of 'steam' to the level in the tank, when 'steam' is higher, it outputs a 1, which turns on the pump feeding the greedy tank.

EDIT pump to pump runs at 12k/s, I'm running a line 150 pumps long to feed a nuclear plant with water. The reason yours caps at 6k/s is probably those two pipe sections you have on either end. Only use pumps, nothing else.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by disentius »

How do you feed your 12000/s line?
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 509
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by Yoyobuae »

the_potty_1 wrote: Thu Aug 20, 2020 7:45 am EDIT pump to pump runs at 12k/s, I'm running a line 150 pumps long to feed a nuclear plant with water. The reason yours caps at 6k/s is probably those two pipe sections you have on either end. Only use pumps, nothing else.
You can have one entity between pumps and still run fluids at 12k/s. But the entity in between the pumps has to have at least 200 fluid capacity, which strictly exclude any kind of pipes. The list of entities that can allow 12k/s flow flowing thru them are:
  • Pumps
  • Storage tanks
  • Fluid wagons
  • Boilers (water only)
  • Heat exchangers (water only)
  • Steam engines (steam only)
  • Steam turbines (steam only)
  • Electric mining drill placed on uranium ore (Sulfuric acid only)
A line of only pumps does yield the highest flow density though.
disentius wrote: Thu Aug 20, 2020 4:16 pm How do you feed your 12000/s line?
You can merge several lower flow lines into a storage tank (or fluid wagon) and then use that to feed the 12000/s line.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by disentius »

maxpumpspeed.png
maxpumpspeed.png (1.26 MiB) Viewed 12101 times
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 509
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: A deeper look into the fluid system and so many questions

Post by Yoyobuae »

One of my more elegant design for max flow water intakes:
Screenshot_2020-08-25_12-06-46.jpg
Screenshot_2020-08-25_12-06-46.jpg (326.58 KiB) Viewed 12079 times
Post Reply

Return to “Gameplay Help”