Page 1 of 1
Fluid pressure / viscosity?
Posted: Thu Jun 01, 2017 1:17 pm
by cicatrix
From what I understood about fluids in the game, the fluid flow model relies on the difference in levels between adjacent pipe segments.
I got an idea to model somewhat more realistic fluid flow model based on pressure / viscosity of the liquid (or gas).
As I am not very familiar with the game API, I want to ask if it's even possible to mod at all?
My goal is to enable efficient way to transport liquids over long distances through pipes (not by train/barrels) by introducing pressure.
Re: Fluid pressure / viscosity?
Posted: Thu Jun 01, 2017 1:34 pm
by bobingabout
Not as far as I know, that sort of thing is pretty much internal, and not really open to being modified.
But that's what the pumps are for.
Re: Fluid pressure / viscosity?
Posted: Thu Jun 01, 2017 2:58 pm
by Aeternus
Pumps can boost the pressure, but if you want to alter viscosity, it is a property of the fluid itself. So it is possible to set different flow rates for gases/liquids. I believe vanilla factorio has those values set to the same amount gamewide though... which is odd, steam should flow much easier then heavy oil.
Re: Fluid pressure / viscosity?
Posted: Thu Jun 01, 2017 3:06 pm
by Ranakastrasz
Aeternus wrote:Pumps can boost the pressure, but if you want to alter viscosity, it is a property of the fluid itself. So it is possible to set different flow rates for gases/liquids. I believe vanilla factorio has those values set to the same amount gamewide though... which is odd, steam should flow much easier then heavy oil.
I think they tried, or at least someone did, and it had rather wierd results due to how the fluid simulation works. It wasn't ideal, so they reverted it.
Re: Fluid pressure / viscosity?
Posted: Thu Jun 01, 2017 4:24 pm
by DerivePi
Current fluid mechanics is based on a flow to energy factor(FTE), a pressure to speed factor(PTS) and a base area (BA). The FTE and PTS factors are fluid defined where the BA is pipe defined. There is also a base elevation factor, but we ARE "in Kansas" and the elevation remains constant. You could mess around with the FTE and PTS factors but they are not independent and messing with them can give you undefined behavior. In fact, the base area is also not an independent variable, but currently works as long as you don't go less than a base are of 1.0 for any pipes you implement.
You could try :
FTE = 0.599 and PTS = 0.4 ---OR--- FTE = 0.59 and PTS = 0.409 for a less viscous material. The breaking point is (1 - FTE) / PTS > min(BA).
Of course all this is moot since the fluid implementation is going to be greatly changed in the near future. I think Wube is looking to collect all of the fluid boxes into its own Array structure and deal with each pipe line as a junction to junction system instead of a stepwise tile by tile system.
Re: Fluid pressure / viscosity?
Posted: Fri Jun 02, 2017 7:58 am
by bobingabout
Ranakastrasz wrote:I think they tried, or at least someone did, and it had rather wierd results due to how the fluid simulation works. It wasn't ideal, so they reverted it.
that was me.
Making the fluids thicker, so that they don't flow as easily works fine, but when you try to make a fluid flow easier, it creates an effect where the fluid ripples back and forth along the pipe.
Re: Fluid pressure / viscosity?
Posted: Fri Jun 02, 2017 2:12 pm
by Aeternus
Only if you go too far with it. Fluid tries to flow from high pressure to lower, to all adjacent tiles it connects to with different pressure. You only get the wave effect if the amount of fluid transferred ends up being more then half of the pressure difference - when that happens, the next tick the stuff flows back into the "vacuum" left behind by the flow. If the flow is less then half the pressure difference, then the oscillation will still occur, but is dampened each tick until smoothed out.
Re: Fluid pressure / viscosity?
Posted: Fri Jun 16, 2017 8:45 am
by bobingabout
which pretty much means that whatever the current settings are is already configured for the best flow without breaking anything.