Any information on current fluid mechanics

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Any information on current fluid mechanics

Post by Zanthra »

While investigation a suggestion regarding my Global Tick Time Scale Mod, I found some strangeness regarding fluid flow in pipes and other entities with double fluid box height and half base_area. I filled one tank up to 25k fluid and had another empty tank, connecting them were 31 pipes. The fluid flowed very quickly from the source to the destination as expected, but it did not stop at equilibrium of around 12k in each tank. Instead the source tank emptied to around 2-3k fluid before the flow reversed and started filling the source tank again in a oscillation.

This looked a lot like a PID controller unwinding a large integral portion. This is not reflected in the fluid mechanics refrences on the wiki, but looking at the history, the latest those were added was around 2018, long before the 0.17 patch that optimized the fluid simulation. Are there any current refrences on how fluid flow functions, or does anyone have a detailed explanation?

Thanks

Laie
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Fri Dec 25, 2020 6:18 pm
Contact:

Re: Any information on current fluid mechanics

Post by Laie »

I know no more about the fluid system than what I picked up from the wiki, but I just tried something similar and cannot confirm your observation (v. 1.1.25):

Tank -> 30 pipes ->tank

I filled the first tank and 29 pipes with water, then cut the pipes coming from the pump, and placed the 30th pipe to connect the second tank. Things quickly settled down at a reported 13k for both tanks. Within the resolution of that progress bar tank indicator, it seemed as if the receiving tank overfilled just a little at first, but the number never went above 13k and there was no noticeable oscillation.

My first though: perhaps liquids now have momentum / inertia?

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Any information on current fluid mechanics

Post by Zanthra »

My observation of oscillation was with a mod changing the fluid box height and base area (2x height, 1/2 base area), in the hopes of making an approximation of 2x fluid flow rates.

I am thinking you are right about the momentum. Something along the lines of if fluid has been flowing in one direction, allow more to flow than the diference in height would notmally allow for, which does make some sense. We know that pipes can normally move 12,000 fluid per second, which means that it needs to be able to move 200 units per tick. If it simply levels with adjacent fluid boxes, it would theoretically only be able to move 50 per tick. I expect that the momentum is tuned to work smoothly with normal height fluid boxes, and has substantial difficulty with odd height fluid boxes instead.

I am hoping someone might know how the momentum is calculated tick by tick so I can create a sort of out of game fluid simulation and find the values for fluid box height and base area that closest approximate 2x fluid flow rates.

Post Reply

Return to “Gameplay Help”