This wiki is about 0.17, the current experimental version of Factorio.

Information about 0.16, the current stable version of Factorio, can be found on stable.wiki.factorio.com.

In other languages: Česky Français Русский 中文

Difference between revisions of "Fluid system"

From Official Factorio Wiki
Jump to: navigation, search
(Changed links going to the redirect Pipe-to-ground to direct links.)
m (Pipelines: 0.17 Maximum fluid values are lower than previously reported.)
 
(29 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{Languages}}
 
{{Languages}}
'''Fluids''' are non-solid items, such as water and oil.
+
'''Fluids''' are non-solid items, such as [[water]] and [[oil]]. They can normally only exist inside entities for fluid handling (like [[pipe]]s), and buildings that have fluids as input ingredients or products (like an [[oil refinery]]).
 +
 
 +
== Fluids ==
 +
The following fluids are available in-game:
 +
 
 +
: {{Imagelink|Water}} {{Imagelink|Crude oil}} {{Imagelink|Petroleum gas}} {{Imagelink|Light oil}} {{Imagelink|Heavy oil}} {{Imagelink|Lubricant}} {{Imagelink|Sulfuric acid}} {{Imagelink|Steam}}
  
 
== Mechanics ==
 
== Mechanics ==
  
Fluids can only exist inside [[pipe]]s and certain buildings, meaning they cannot be carried by the player, moved using [[inserters]], dropped on the ground, or even dumped in a lake. They are counted in continuous fractions, rather than discrete integers. Liquids can be silently destroyed by removing buildings or pipes. Only one type of fluid can occupy a [[pipe]] at a time. Two fluids will never mix.
+
Liquids can be destroyed by removing buildings or pipes in which they are contained. Only one type of fluid can occupy a given pipe segment or [[storage tank|tank]] at a time; no two fluids will ever mix, as a pipe cannot be placed that would possibly mix two fluids. They cannot be carried by the player, moved using [[inserters]], dropped on the ground, nor stored in chests, unless the fluids are stored in [[Fluid system#Barrels|barrels]]. They cannot be spilled or even dumped in a lake, and are counted in continuous fractions, rather than discrete integers.
 +
 
 +
=== Storage ===
 +
 
 +
In the game, fluid is held in entities that behave as vessels (fluid boxes) of a defined size (volume). The vessels automatically connect to each other if their inputs/outputs are adjacent (pipes connect to all directions) and allow fluids to flow between them.
  
Fluids can be transported by [[Fluid system#Piping|piping]], [[barrel]]s, or [[fluid wagon]]s.
+
The '''volume''' of fluid contained in a fluid box is a value between 0 and the maximum volume. For instance, the pipe can hold 100 units of fluid, therefore the value in the pipe can be a number between 0 and 100. The '''level''' of fluid in a given entity is manifested by a percentage of the entity's maximum volume that is being occupied by a fluid. It can be observed in pipes and tanks; they have windows through which the fluid is seen at a certain level, or perhaps even as just a small trickle.
  
=== Pressure ===
+
=== Flow ===
  
Here "pressure" = current_fluid_level / max_amount.
+
All connected tanks and pipes are treated as a single vessel in that ''the level of fluid must be equal in all parts'', to even out pressure exacted by a higher fluid level on smaller ones. This is why level is also often referred to as ''pressure'', even though pressure is actually caused by a difference in level between two entities. All flow of fluid that happens between pipes is to achieve this balance (pumps practically ignore it and buildings disrupt it; more on that further below). The flow rate between pipes is dependent on pressure (the difference in level between the adjacent entities), it becomes slower as pipes even their levels out.
  
The pressure of a fluid in a pipe can be seen through the pipe window. A pipe with high pressure will show itself nearly full, a pipe with low pressure will show a small trickle of the fluid.
+
Coming back to how the 'level' is defined, this also means that all connected pipes and tanks attempt to even out to the same percentage of their respective volumes. For example, if 12 550 units of fluid are left to flow into a storage tank of 25 000-unit capacity with one pipe of 100-unit capacity connected, there will be 12 500 units in the storage tank and 50 units in the pipe, both being filled to the same '''percentage''' (50%) of their capacities, even though the amounts themselves are obviously unequal.
  
When two neighboring containers (pipes or fluid storage) store the same fluid at different pressure, some of the content of the fuller container will move into the less filled one. The speed of this transfer depends on the difference in pressure.  
+
Machines that produce fluids put them in their output slots, which are related to a specifically labeled output pipe socket somewhere on the machine (pressing Alt reveals the labels). The slot will attempt to empty itself into the entity connected to the machine's socket, unless it is full, or contains a non-matching fluid. Machines that consume fluids also have an accordingly labeled pipe input socket. If an entity containing the correct fluid is connected to it, the machine will start behaving like a pipe that can never be filled, meaning the fluid from connected pipes and tanks drains into the machine at a fixed rate, until the machine's input slot is full. There may be machines that have pipe sockets for both input and output (like a [[electric mining drill|drill]] placed over [[uranium ore]]). They then drain the fluid for themselves first, and once full, behave as a regular pipe that attempts to even out its level with adjacent entitites. If there are multiple output/input sockets for one fluid on a machine, their activity is distributed to them equally unless some of them are blocked/full.
  
Fluids do not flow out of a building's input tile or into its output tile. [[Pump]]s partially override pressure, putting all their content into their output tile.
+
=== Temperature ===
 +
Temperature is currently only relevant in heating water as a medium for power generation. Even though all fluids in the game have a temperature value, it is generally the default 15°C.
  
=== Volume ===
+
Energy, whether harnessed from [[fuel]] in [[boiler]]s, or from [[Nuclear power (research)|nuclear power]] through [[heat exchanger]]s, can be used to turn [[water]] to [[steam]], being a [[Energy and Work|liquid form of work]]. Steam holds energy at a ratio of 0.2 kJ per °C per unit. In other words: 0.2 kJ of work is necessary to heat a unit of steam by one °C. Since steam/water is set to have a maximum temperature of 1000°C and minimum of 15°C, the most work that can be done on one unit is 197 kJ.
  
In the game, fluid is held in fluid boxes with a defined size (equivalent to volume). Connected fluidboxes allow fluids to flow between them. For instance, each pipe is a 1x1 fluid box with a connection in each direction.
+
In practice, this is barely utilized in a great variety: Boilers only output steam of 165°C temperature, and heat exchangers only output 500°C hot steam, never hotter, never colder; if insufficient energy is supplied, the heaters do not output steam altogether. The steam also does not grow colder over time. Using the 165°C steam in a [[steam engine]] has the same effect as using it in a [[steam turbine]], although it is impractical, since turbines are made to consume 500°C (superheated) steam, generating proportionally more power. All of this makes for no need of exact calculations.
  
The volume of fluid contained in a fluid box is value between 0 and the fluidbox size, so for instance the pipe can hold 100 Units of fluid, so the value in the fluid box can be any number between 0 and 100.
+
== Transport ==
 +
Fluids can be transported through pipelines, barrels, or railway. It is generally practical to use piping for short-distance distribution to machines (or barrelling, if there is need to use belts), and railway transportation for longer distances.
  
=== Temperature ===
+
=== Pipelines ===
 +
[[File:pipes_carrying_fluids.png|thumb|200px|Many pipes, each carrying different fluids.]]
  
Work contained in [[fuel]] is converted by the [[boiler]]s or [[heat exchanger]]s to [[steam]], which is just a [[Energy and Work|liquid form of work]]. This steam holds energy at ratio of
+
'''[[Pipe|Pipes]]''' are the most basic way to channel fluids from A to B. They automatically connect to any adjacent pipe and can do so to all four cardinal directions simultaneously. [[Pipe to ground|Underground pipes]] only work in two opposite directions, linking to another underground pipe on one side, and to another entity on the other. If a pipe section becomes too long without using pumps, all fluid inside it will be "spread thin", resulting in very slow flow and preventing machines to use its contents effectively. '''[[Storage tank|Tanks]]''' behave the same as pipes, except their volume is much greater, which can cause this inconvenience over a much smaller distance if multiple tanks are used. Underground pipes can help alleviate this issue; although they can connect a distance of up to 10 tiles, their volume is always equivalent to two pipes.
0.2 kJ per °C per Unit
 
In other words: 0.2 kJ of work is necessary to heat water by one °C.
 
  
Since steam/water is set to have a maximum temperature of 500°C and minimum of 15°C, the most work that can be in an unit of water is 97 kJ.  
+
'''[[Pump]]s''' use electrical power to transfer fluids in one direction very quickly. They also block any back-flow, which means they can pressurize a section of piping, filling it as much as possible. This is very useful to counteract the "thin spread" outlined above, among other things. They can also be disabled using the [[circuit network]] which stops fluid flow through the pump.
  
== Types ==
+
The table below shows how fast will fluid flow in a pipeline with a certain frequency of pumps. If a higher flow rate is desired, pumps should be placed more frequently. Because underground pipes only count as 2 regular pipes in terms of volume, a full-length section only counts as two pipes in this table, if a pump is placed between each underground section. Placing a filled storage tank before a pump ensures maximum possible flow rate and is therefore a suitable start of any pipeline.
  
{| class="wikitable"
+
{| class="wikitable mw-collapsible mw-collapsed"
| {{imagelink|water|Water}} || Can be extracted from water using the [[offshore pump]].
 
 
|-
 
|-
| {{imagelink|steam|Steam}} || Water heated in a [[boiler]] or [[heat exchanger]]. Mainly used to produce power.
+
! Number of pipes<br>between two pumps !! Maximum flow<br>(u/sec)
 
|-
 
|-
| {{imagelink|crude-oil|Crude oil}} || Extracted from oil fields by [[Pumpjack]]s and can be converted to [[Petroleum gas]], [[Light oil]], and [[Heavy oil]].
+
| 0 (pump to pump) || 8400
 
|-
 
|-
| {{imagelink|petroleum-gas|Petroleum gas}} || Converted from [[Crude oil]]. Used to create various items.
+
| 0 (tank to pump) || 6000
 
|-
 
|-
| {{imagelink|light-oil|Light oil}} || Converted from [[Crude oil]]. Used to create various items. Can be converted into [[Petroleum gas]].
+
| 0 (pump to tank) || 8400
 
|-
 
|-
| {{imagelink|heavy-oil|Heavy oil}} || Converted from [[Crude oil]]. Can be converted to [[Light oil]] and [[Lubricant]].
+
| 0 (pump to boiler) || 6000
 
|-
 
|-
| {{imagelink|sulfuric-acid|Sulfuric acid}} || Converted from [[Sulfur]], [[Iron plate]]s, and [[Water]]. Can be used to create various items.
+
| 1 || 6000
 
|-
 
|-
| {{imagelink|lubricant|Lubricant}} || Converted from [[Heavy oil]]. Used mainly to create [[Express transport belt]]s  and [[Engine]]s.
+
| 2 || 3000
 
|-
 
|-
|}
+
| 3 || 2250
 
+
|-
== Machines ==
+
| 7 || 1500
 
+
|-
{| class="wikitable"
+
| 12 || 1285
 
+
|-
| {{imagelink|oil-refinery|Oil refinery}} || Converts [[Crude oil]] into [[Heavy oil]], [[Light oil]], and [[Petroleum gas]].
+
| 17 || 1200
 +
|-
 +
| 20 || 1169
 
|-
 
|-
| {{imagelink|chemical-plant|Chemical plant}} || Changes liquid to other forms as well as crafting some recipes that require liquids.
+
| 30 || 1112
 
|-
 
|-
| {{imagelink|pumpjack|Pumpjack}} || Extracts [[Crude oil]] from Oil fields.
+
| 50 || 1067
 
|-
 
|-
| {{imagelink|boiler|Boiler}} || Creates 165°C steam when [[fuel|fueled]].
+
| 100 || 1033
 
|-
 
|-
| {{imagelink|heat exchanger|Heat exchanger}} || Creates 500°C steam when heated using a [[nuclear reactor]].
+
| 150 || 1022
 
|-
 
|-
| {{imagelink|steam-engine|Steam engine}} || Uses steam to generate [[Electric system|electricity]].
+
| 200 || 1004
 
|-
 
|-
| {{imagelink|steam turbine|Steam turbine}} || Uses steam to generate [[Electric system|electricity]].
+
| 261 || 800
 
|-
 
|-
| {{icon|assembling-machine-2||Assembling machine 2}} or {{icon|assembling-machine-3||Assembling machine 3}} || Puts liquids into or out of [[barrel]]s.
+
| 300 || 707
 
|-
 
|-
|}
+
| 400 || 546
 
 
== Piping ==
 
<!--''This section should explain: link to liquid stacks, pipe window and how to get information out of it (animations would be handy), pipes and their max. throughput, link to maximum length of pipes, difference between pipe and pipe to ground, storage tank and its special connections and comparing to pipes (is nothing than a big pipe), pump and max. throughput (how much needed), how to make short connections, long distance piping, refreshing the pressure for more throughput, how to pump equal amounts of liquids in two directions...'' -->
 
 
 
''Piping'' is the most common way to move liquids in factorio.
 
 
 
Key entities used in piping and general fluid handling:
 
 
 
{| class="wikitable"
 
 
 
| {{imagelink|pipe|Pipe}} || Used to direct the flow of liquids.
 
 
|-
 
|-
| {{imagelink|pipe-to-ground|Pipe to ground}} || Used to cross other pipes or belts.
+
| 500 || 445
 
|-
 
|-
| {{imagelink|storage-tank|Storage tank}} || Stores liquids for later use.
+
| 600 || 375
 
|-
 
|-
| {{imagelink|offshore-pump|Offshore pump}} || Provides [[Water]] extracted from a water tile.
+
| 800 || 286
 
|-
 
|-
| {{imagelink|pump|Pump}} || Moves fluids in the direction of the arrow. Prevents fluid from moving in the opposite deirection.
+
| 1000 || 230
 
|-
 
|-
 
|}
 
|}
  
==History==
+
=== Barrels ===
 +
 
 +
'''[[Barrel]]s''' are used by [[Assembling machine]]s to effectively "bottle" fluids into an item that can be handled like any other item; carried in an inventory, placed in chests and handled by [[Inserters]]. This allows the player to transport fluids via the [[belt transport system]]. Assembling machines are also used to empty the barrels, depositing their contents to pipes and leaving an empty barrel for another use.
 +
 
 +
=== Railway ===
  
Water was the first fluid to be added to the game. In [[Version history/0.9.0|version 0.9]] the [[oil processing]] system, and therefore new fluids, including crude oil and petroleum gas, were added.
+
'''[[Railway]]''' is another method of transporting fluids, and can be conducted in two ways: Either the fluids are directly pumped into a [[fluid wagon]], or they are poured into barrels and loaded into [[cargo wagon]]s. Both methods have their distinct differences: The cargo wagon can hold different types of fluid barrels, however the fluid wagon can hold more fluid (25k versus 20k) and can be emptied and filled in mere seconds, at speeds inserters with barrels require an inadequate expenditure of resources to match; while [[Stack inserter]]s can transfer barrels quickly, machines for barreling fluids are slow.[https://forums.factorio.com/viewtopic.php?f=5&t=48185] On the other hand, the fluids can be barreled/unbarreled while trains are en route.
  
 
==See also==
 
==See also==
Line 104: Line 108:
 
* [[Oil processing]]
 
* [[Oil processing]]
 
* [[Power production]]
 
* [[Power production]]
* [http://factorioforums.com/forum/viewtopic.php?f=18&t=19851 Indepth post about fluid mechanics]
+
* [https://forums.factorio.com/viewtopic.php?f=18&t=19851 In-depth post about fluid mechanics]
 +
* [https://www.reddit.com/r/factorio/comments/6w9kwi/factorio_and_fluid_mechanics_science_facts_myths/ Another in-depth examination of fluid mechanics]
 
* [https://forums.factorio.com/viewtopic.php?f=5&t=46030 How many pumps after how many pipes for how much throughput]
 
* [https://forums.factorio.com/viewtopic.php?f=5&t=46030 How many pumps after how many pipes for how much throughput]

Latest revision as of 16:23, 24 June 2019

Fluids are non-solid items, such as water and oil. They can normally only exist inside entities for fluid handling (like pipes), and buildings that have fluids as input ingredients or products (like an oil refinery).

Fluids

The following fluids are available in-game:

Water.png
Water
Crude oil.png
Crude oil
Petroleum gas.png
Petroleum gas
Light oil.png
Light oil
Heavy oil.png
Heavy oil
Lubricant.png
Lubricant
Sulfuric acid.png
Sulfuric acid
Steam.png
Steam

Mechanics

Liquids can be destroyed by removing buildings or pipes in which they are contained. Only one type of fluid can occupy a given pipe segment or tank at a time; no two fluids will ever mix, as a pipe cannot be placed that would possibly mix two fluids. They cannot be carried by the player, moved using inserters, dropped on the ground, nor stored in chests, unless the fluids are stored in barrels. They cannot be spilled or even dumped in a lake, and are counted in continuous fractions, rather than discrete integers.

Storage

In the game, fluid is held in entities that behave as vessels (fluid boxes) of a defined size (volume). The vessels automatically connect to each other if their inputs/outputs are adjacent (pipes connect to all directions) and allow fluids to flow between them.

The volume of fluid contained in a fluid box is a value between 0 and the maximum volume. For instance, the pipe can hold 100 units of fluid, therefore the value in the pipe can be a number between 0 and 100. The level of fluid in a given entity is manifested by a percentage of the entity's maximum volume that is being occupied by a fluid. It can be observed in pipes and tanks; they have windows through which the fluid is seen at a certain level, or perhaps even as just a small trickle.

Flow

All connected tanks and pipes are treated as a single vessel in that the level of fluid must be equal in all parts, to even out pressure exacted by a higher fluid level on smaller ones. This is why level is also often referred to as pressure, even though pressure is actually caused by a difference in level between two entities. All flow of fluid that happens between pipes is to achieve this balance (pumps practically ignore it and buildings disrupt it; more on that further below). The flow rate between pipes is dependent on pressure (the difference in level between the adjacent entities), it becomes slower as pipes even their levels out.

Coming back to how the 'level' is defined, this also means that all connected pipes and tanks attempt to even out to the same percentage of their respective volumes. For example, if 12 550 units of fluid are left to flow into a storage tank of 25 000-unit capacity with one pipe of 100-unit capacity connected, there will be 12 500 units in the storage tank and 50 units in the pipe, both being filled to the same percentage (50%) of their capacities, even though the amounts themselves are obviously unequal.

Machines that produce fluids put them in their output slots, which are related to a specifically labeled output pipe socket somewhere on the machine (pressing Alt reveals the labels). The slot will attempt to empty itself into the entity connected to the machine's socket, unless it is full, or contains a non-matching fluid. Machines that consume fluids also have an accordingly labeled pipe input socket. If an entity containing the correct fluid is connected to it, the machine will start behaving like a pipe that can never be filled, meaning the fluid from connected pipes and tanks drains into the machine at a fixed rate, until the machine's input slot is full. There may be machines that have pipe sockets for both input and output (like a drill placed over uranium ore). They then drain the fluid for themselves first, and once full, behave as a regular pipe that attempts to even out its level with adjacent entitites. If there are multiple output/input sockets for one fluid on a machine, their activity is distributed to them equally unless some of them are blocked/full.

Temperature

Temperature is currently only relevant in heating water as a medium for power generation. Even though all fluids in the game have a temperature value, it is generally the default 15°C.

Energy, whether harnessed from fuel in boilers, or from nuclear power through heat exchangers, can be used to turn water to steam, being a liquid form of work. Steam holds energy at a ratio of 0.2 kJ per °C per unit. In other words: 0.2 kJ of work is necessary to heat a unit of steam by one °C. Since steam/water is set to have a maximum temperature of 1000°C and minimum of 15°C, the most work that can be done on one unit is 197 kJ.

In practice, this is barely utilized in a great variety: Boilers only output steam of 165°C temperature, and heat exchangers only output 500°C hot steam, never hotter, never colder; if insufficient energy is supplied, the heaters do not output steam altogether. The steam also does not grow colder over time. Using the 165°C steam in a steam engine has the same effect as using it in a steam turbine, although it is impractical, since turbines are made to consume 500°C (superheated) steam, generating proportionally more power. All of this makes for no need of exact calculations.

Transport

Fluids can be transported through pipelines, barrels, or railway. It is generally practical to use piping for short-distance distribution to machines (or barrelling, if there is need to use belts), and railway transportation for longer distances.

Pipelines

Many pipes, each carrying different fluids.

Pipes are the most basic way to channel fluids from A to B. They automatically connect to any adjacent pipe and can do so to all four cardinal directions simultaneously. Underground pipes only work in two opposite directions, linking to another underground pipe on one side, and to another entity on the other. If a pipe section becomes too long without using pumps, all fluid inside it will be "spread thin", resulting in very slow flow and preventing machines to use its contents effectively. Tanks behave the same as pipes, except their volume is much greater, which can cause this inconvenience over a much smaller distance if multiple tanks are used. Underground pipes can help alleviate this issue; although they can connect a distance of up to 10 tiles, their volume is always equivalent to two pipes.

Pumps use electrical power to transfer fluids in one direction very quickly. They also block any back-flow, which means they can pressurize a section of piping, filling it as much as possible. This is very useful to counteract the "thin spread" outlined above, among other things. They can also be disabled using the circuit network which stops fluid flow through the pump.

The table below shows how fast will fluid flow in a pipeline with a certain frequency of pumps. If a higher flow rate is desired, pumps should be placed more frequently. Because underground pipes only count as 2 regular pipes in terms of volume, a full-length section only counts as two pipes in this table, if a pump is placed between each underground section. Placing a filled storage tank before a pump ensures maximum possible flow rate and is therefore a suitable start of any pipeline.

Number of pipes
between two pumps
Maximum flow
(u/sec)
0 (pump to pump) 8400
0 (tank to pump) 6000
0 (pump to tank) 8400
0 (pump to boiler) 6000
1 6000
2 3000
3 2250
7 1500
12 1285
17 1200
20 1169
30 1112
50 1067
100 1033
150 1022
200 1004
261 800
300 707
400 546
500 445
600 375
800 286
1000 230

Barrels

Barrels are used by Assembling machines to effectively "bottle" fluids into an item that can be handled like any other item; carried in an inventory, placed in chests and handled by Inserters. This allows the player to transport fluids via the belt transport system. Assembling machines are also used to empty the barrels, depositing their contents to pipes and leaving an empty barrel for another use.

Railway

Railway is another method of transporting fluids, and can be conducted in two ways: Either the fluids are directly pumped into a fluid wagon, or they are poured into barrels and loaded into cargo wagons. Both methods have their distinct differences: The cargo wagon can hold different types of fluid barrels, however the fluid wagon can hold more fluid (25k versus 20k) and can be emptied and filled in mere seconds, at speeds inserters with barrels require an inadequate expenditure of resources to match; while Stack inserters can transfer barrels quickly, machines for barreling fluids are slow.[1] On the other hand, the fluids can be barreled/unbarreled while trains are en route.

See also