v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "v0.31:Pressure"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (Rated article "Exceptional" using the rating script)
 
(59 intermediate revisions by 19 users not shown)
Line 1: Line 1:
{{av}}
+
{{quality|Exceptional|16:12, 26 December 2011 (UTC)}}{{av}}
{{elven}}
 
  
There are several mechanisms at work that try to simulate '''water pressure''' in game. While on the whole amazingly accurate, there are several unexpected quirks concerning speed and displacement. Never think you are on the safe side, especially when trying to trick the game.
+
Dwarf Fortress features some pretty complex behavior in an attempt to simulate '''fluid mechanics'''. One aspect of this behavior is seen in the form of '''pressure'''. The basic idea here is quite simple - certain forms of '''[[flow|fluids]]''' movement exert '''pressure''', causing them to potentially move ''upwards'' into other areas.
  
A [http://www.bay12games.com/forum/index.php?topic=32453.0 technical explanation by Kanddak] from the Bay12 Forum outlines in detail what is known of the in-game fluid mechanics from player testing.
+
==Summary==
 +
Contrary to what many people may believe, pressure is '''not''' a property of a body of liquid. Pressure is simply one of 3 rules by which liquids can be moved - the others are "falling" (when the tile beneath contains less than 7/7 of liquid) and "spreading out" (when the liquid levels of two adjacent tiles are averaged, possibly pushing items around).
  
==Hydrostatic water pressure==
+
The following types of liquid movement follow the rules of pressure:
Dwarf Fortress attempts to replicate [http://en.wikipedia.org/wiki/Fluid_statics#Pressure_in_fluids_at_rest hydrostatic water pressure].
+
* Water falling downward into ''more'' water
 +
* [[River]]/brook source tiles (whether the map edge or the "delta" where the river itself begins) generating water
 +
** [[Lake]]s (surface or subterranean), [[ocean]]s, and the [[magma sea]] refilling from the map edge do '''not''' exhibit pressure
 +
* [[Screw pump]]s moving water '''or''' magma
  
This is probably one of the most prominent components, as Toady discussed it at length in an interview with [http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=10 gamasutra].
+
When a liquid is moved (or created) with pressure, it attempts to locate the nearest tile on the same Z-level as its destination tile (for falling water, this is 1 Z-level ''beneath'' its original location) by moving north, south, east, west, down, or up. As it tries to locate an appropriate destination, the liquid will first only try to move sideways and downward - only when this fails will it attempt to move upward. Pressure will not propagate through diagonal gaps.
  
In layman's terms, if you have a body of water that is higher than an open space below it (such as a tall tower full of water and a hose from it, or a {{l|lake}} over a mine), and an open route between them, then the water at the lowest {{|z-level}} will be 'pressed' by the weight of the water above it.  
+
==A demonstration of pressure using U-Bends==
 +
A U-Bend is a channel that digs down, and curves back up. With '''pressure''' a [[flow|fluid]] will be pushed up the other side of the u-bend. By understanding how pressure works in a u-bend you should be able to adapt this knowledge to use fluids in any configuration you desire without any unexpected surprises that could make life in your fortress more '''[[fun]]''' than anticipated. '''[[Water]]''' and '''[[magma]]''' both behave very differently with regards to pressure, so read carefully.
  
As a simple model, think of a pipe shaped like a "J". If you pour water in the taller end of the pipe, it will come "up" out of the lower end until the water levels on both sides are equal.  If you put your thumb over the lower end and fill the taller end, then release your thumb, the water will move with remarkable speed, and water will continue to come "up" out that lower end until all the water in the taller part is at the same level as the lower part.  This is one part of Dwarf Fortress "water pressure" -  that if the source is higher, water can come up {{l|stair|stairs}}, up {{l|ramp|ramps}}, and over {{l|channel|channels}}, and will continue flowing until it runs out of space or runs out of water above it.
+
===Water in a U-Bend===
 +
The following three diagrams demonstrate different ways water might behave in a u-bend. In all three cases, the water source is on the left side of the diagram and water is filling the area to the right. In the first example (Diagram A), we have water taken directly from a (flat) river used to fill a u-bend. In this case, the river is free to flow off the edge of the map, so the only pressure comes from the water tile on the top of the left side (highlighted in green) falling downward (into the tile highlighted in red), so the water on the right side stops one level below the river itself.
  
Note that DF water pressure does not ''exactly'' match natural hydrostatic water pressure - it fills to a {{l|z-level|z-level}} ''one level lower'' than the source.  (This is for reasons of CPU time-saving, as stated by [[Toady]]; the game stops not when all ends of the system are on the same level, but when the far levels are one-lower than the source.) The above behavior does only apply to finite water sources like murky pools, artificially created reservoirs and any body of water connected to an infinite water source only diagonally. More to the point, it applies always, but is in many cases not the final mechanism causing equilibrium.
+
In the next example (Diagram B), a '''dam''' has been placed, preventing the river from flowing off the edge of the map. In this case, the pressure exerted by the river source (highlighted in red) allows the water to fill up the remaining level of the u-bend. Use caution when placing a dam on your river.
  
== Pressure from infinite water sources ==
+
The final example (Diagram C), demonstrates how a '''[[pump|screw pump]]''' exerts pressure - in this case, the water fills up to the same level as the pump's output tile (highlighted in red).
Different from the above, a river that pushes water into a tunnel system will fill it up to the z-level of the river itself, but not higher (again, unless only connected by diagonal flow, see below).
 
  
When the water source is a {{l|river}} which is allowed to drain off the edge of the map, the final Z-level will never fill - however, if a {{l|dam|dam}} prevents the river from draining, it will continue to fill up to its own Z-level.
+
With these three simple examples, you should be ready to go build your enormous plumbing masterpiece, and be relatively safe from any unanticipated flooding. If you plan to work with [[magma]] as well however, you should read further.
  
== Other/Missing mechanisms==
+
{|
Dwarf Fortress does not model surface friction nor air pressure, so the water will not slow in transit nor will 'trapped air bubbles' form. Unless pumped, magma does not have pressure unless it is pressurized with a {{l|pump}} (it cannot flow up, and doesn't appear to move at greater speeds).
+
! Diagram A !! Diagram B !! Diagram C
 +
|- align="center"
 +
| Undammed River || Dammed River || Screw Pump
 +
|-
 +
| {{diagram|spaces=yes|\
 +
▓[#00F]≈[#00F]≈[#00F]≈[#00F]≈[#00F][#080]≈▓  ▓
 +
▓▓▓▓▓[#00F][#800]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓[#00F]≈[#00F]≈[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓▓▓▓▓▓▓}}
 +
| {{diagram|spaces=yes|\
 +
▓[#00F][#800]≈[#00F][#800]≈[#00F][#800]≈[#00F][#800]≈[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
▓▓▓▓▓[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓[#00F]≈[#00F]≈[#00F]≈[#00F]≈[#00F]≈▓
 +
    ▓▓▓▓▓▓▓}}
 +
| {{diagram|spaces=yes|\
 +
▓    ÷÷[#00F][#800]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
▓[#00F]≈[#00F]≈[#00F]≈[#00F][#080]≈▓▓[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
▓▓▓▓▓▓▓[#00F]≈▓[#00F]≈[#00F]≈[#00F]≈▓
 +
      ▓[#00F]≈[#00F]≈[#00F]≈[#00F]≈[#00F]≈▓
 +
      ▓▓▓▓▓▓▓}}
 +
|}
  
As can be expected, if water is continuously pushed into a room, either by an unlimited water source like a river or by means of a {{l|pump}}, the water will not stop when the room is filled, but search for an outlet, even on higher z-levels. If there is an outlet, but it can not take all the water coming in, the water will look for further outlets.  
+
===Magma in a U-bend===
 +
'''[[Magma]]''' does not exert pressure when it falls downward. In our first magma example (Diagram A) we show how this works by creating a short u-bend and connecting it up to a magma pipe - it simply fills the lowest point and makes no further attempt to go back up.
  
It's possible for dwarf-built {{l|pump|pumps}} to pick liquid up and lift it higher, possibly back to the source and thus creating a closed cycle. Beware that operating pumps obey the same pressure rules as infinite water sources, capable of pushing both water '''and''' magma down through tunnels and back up to the original Z-level of the pump's output tile.
+
In the second diagram (Diagram B) we see how with the addition of a single [[screw pump]], the entire situation changes dramatically - when the screw pump moves magma to the right side, it does so using the rules of pressure and allows the area to fill up to the level of the pump. Accidentally flooding your fortress with [[magma]] is considerably more [[fun]] than a flood of [[water]].
  
== Dangers ==
+
  '''Diagram A'''      '''Diagram B'''
It is easy to flood your fortress accidentally by not accounting for water pressure. For example:
+
  Magma Pipe      Screw Pump
* It is safe to dig out a {{l|cistern}} one level below a murky pool, and to channel above a few tiles of the {{l|cistern}} so that your dwarves can get water from it without having to go outside.
+
  Side View      Side View<br />
* It is safe to refill a murky pool with water from a pump or brook/river/etc on the same level.
+
    ▒<font color="red">≈≈≈</font>▒            %%<font color="red">≈</font>▒<font color="red">≈≈≈</font>▒    %% = [[Pump]]
* It is not safe to do both to the same pool! The water from the pump/brook/river/whatever will fill the pool to 7/7, and will then pressurize the water in the {{l|cistern}}, which will then flow up out of your channels and flood your fort.
+
    ▒<font color="red">≈≈≈</font>▒  ▒    ▒<font color="red">≈≈≈</font>▒▒<font color="red">≈</font>▒<font color="red">≈≈≈</font>▒      <font color="red">≈</font> = Magma
 +
    ▒<font color="red">≈≈≈</font>▒  ▒    ▒<font color="red">≈≈≈</font>▒▒<font color="red">≈</font>▒<font color="red">≈≈≈</font>▒      ▒ = Solid Ground
 +
    ▒<font color="red">≈≈≈≈≈≈≈</font>▒    ▒<font color="red">≈≈≈</font>▒▒<font color="red">≈≈≈≈≈</font>▒
 +
    ▒<font color="red">≈≈≈</font>▒▒▒▒▒    ▒<font color="red">≈≈≈</font>▒▒▒▒▒▒▒▒
 +
 
 +
==Advanced Pressure==
 +
=== Lazy model ===
 +
Pressure is a lazy model, but will ''always'' behave like above. For example, a system on z0 receives water from a cistern z3 in amounts of ~3/tick. This system consists of a tree of passages, one tile wide, and contains 'underpasses' on z-1. Water will flow into the system to a depth of 7 before coming up on the other side of a the first underpass, as is expected. However, if faced with ''two'' underpasses, it will choose the nearest one and fill all the system on the other side of that underpass to a depth of 7 before filling the system on the other side of the far underpass. Similarly, if faced with multiple exits from the system, the whole flow will flow out of ''one'' exit, the nearest lowest one.{{verify}}
  
 
===Waterfalls===
 
===Waterfalls===
Waterfalls are of special concern. If you tap river section ''downstream'' from a waterfall, the water will be under additional pressure as it is coming from above the river's surface. It is absolutely critical to reduce the pressure in such a system if you do not wish flooding, the easiest way being diverting the water diagonally - although if used solely for a complex drowning trap or other purpose, flooding may be desirable.{{verify}}
+
Waterfalls are of special concern. When drawing water from a waterfall it is important to understand that, since the water is falling '''on top of''' the river's surface, the pressure exerted when it falls down into the river will permit it to pass through U-bends that would normally not be filled when using a flat undammed river - if you tap into a river below a waterfall just as you would above it, you could very easily flood your fortress.
  
== Mitigating dangers ==
+
==Neutralizing Pressure==
=====Diagonal Flow=====
+
There are two methods for neutralizing fluid pressure: diagonal connections and screw pumps. Knowing how to manipulate pressure as needed allows you to quickly move fluids wherever you wish in your fortress allowing you to build things a dwarf can be proud of.  
Obviously the game treats water connected only by a diagonal tile as ''not'' connected in terms of "pressure" but ''only'' in terms of "diffusion". A common adaption of this behaviour is feeding water through a diagonal tile "to take the pressure out": 
 
  
Pressure cannot push water through diagonal gaps between tiles - instead, it will merely flow through if the water level on the other side is low enough.
+
===Diagonal Flow===
 +
Liquids moving via pressure can only move to [[orthogonal]]ly adjacent tiles. When faced with a diagonal gap, pressure will fail to move the liquid, forcing the liquid to instead spread out. By forcing fluids through a diagonal connection you can prevent pressure from propagating past a certain point.  
  
'''Top View'''<br />
+
This does not work on a vertical basis - water only travels straight up and down to different Z-levels, never diagonally.
                ######
 
        #########<font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font>########
 
  <font color="blue">'''Direction->'''</font> <font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font>#<font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font> <font color="#2FB6FF">-></font>
 
  <font color="blue">'''  of    ->''' </font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font>#<font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font> <font color="#2FB6FF">-></font>
 
  <font color="blue">'''  Flow  ->'''</font> <font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font><font color="blue">≈</font>#<font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font><font color="#2FB6FF">≈</font> <font color="#2FB6FF">-></font>
 
        ###########<font color="#2FB6FF">≈</font>#########
 
                  ###<br />
 
  # = wall, constructed or undug
 
  <font color="blue">≈</font> = pressurized water
 
  <font color="#2FB6FF">≈</font> = neutral/normal water pressure
 
  
This does not work on a vertical basis - water only travels vertically to a different z-level, never diagonally.
+
If you wish to maintain the rate of '''[[flow]]''' after de-pressurizing, it's recommended that you have more diagonals than water tiles - that is, if the source is 3-tiles wide, you may wish 4 or more diagonal passages.
  
A result of this is that a tunnel system that spans several z-levels, but is connected to a river only by a diagonal tile, will fill only to one z-level lower than the river, but if an orthogonal connection is created, it will fill up another level.
+
'''Top View'''
 +
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
 +
  > > >      ▒  >  >  >
 +
4Z Deep    ▒    1Z Deep
 +
  > > >    ▒    >  >  >
 +
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  
If you wish to maintain the rate of flow after de-pressurizing, it's recommended that you have more diagonals than water tiles - that is, if the source is 3-tiles wide, you may wish 4 or more diagonal passages.
+
'''Side View''' <br />
 +
▒≈≈≈▒
 +
▒≈≈≈▒
 +
▒≈≈≈▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒
 +
▒≈≈≈≈≈≈≈≈RRR≈≈≈≈≈≈≈▒    RRR = Regulator design as seen in top view
 +
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  
=====Hatches=====
+
===Pumps===
{{l|Hatch|Hatch}}es can be placed over {{l|channel|channels}}, {{l|stair|stairs}}, {{l|ramp|ramps}} etc to prevent {{l|water}} moving vertically but still allow the tile to be used, even as a water source (and possibly still for fishing too).
+
Since water pressure does not propagate through pumps, it is possible to fill a pool from a "pressurized" source using a screw pump without it overflowing. Of course, there is a downside - you still have to run the pumps and due to the source water's pressure, the pump must be [[power]]ed instead of [[pump operator|run by a dwarf]], as the tile the dwarf needs to stand on is filled by water. Furthermore, the pump will likely need to be powered from above or below (as water would simply flow around a gear or axle placed next to the pump), though creative setups are still possible by using additional screw pumps to transmit power.
  
=====Pumps=====
+
Your vertical axles or gear assemblies need to be placed above the solid tile of the pump, and there must not be a channel over the walkable pump tile. (Water can only flow straight upward, not up and to the side at the same time.) Multiple adjacent pumps will also transfer '''power''' between themselves automatically.
Water pressure does not propagate through pumps, so it is possible to fill a pool using a screw pump without it having the same pressure as its source. Of course, there is a downside - you still have to run the pumps and due to the source water's pressure, the pump must be {{l|power|powered}} instead of {{l|pump operator|run by a dwarf}}, as the tile the dwarf needs to stand on is filled by water. Furthermore, the pump will likely need to be powered from above or below (as water would simply flow around a gear or axle placed next to the pump), though creative setups are still possible by using additional screw pumps to transmit power.
 
 
 
Your vertical {{l|axle|axles}} or gear assemblies need to be placed above the unwalkable tile of the pump, and there must not be a channel over the walkable pump tile. (Water can only flow straight upward, not up and to the side at the same time.) Multiple adjacent pumps will also [[40d:Power#Power transfer|transfer power]] between themselves automatically.
 
  
 
  Side view
 
  Side view
 
                        
 
                        
     Power  Water     Key
+
     Power  Water       Key
       ↓    ↓↓↓↓↓     # = Normal wall
+
       ↓    ↓↓↓↓↓       ▒ = Normal wall
  ######<font color="brown">║</font>###<font color="blue">#</font><font color="blue"><b>≈≈≈≈≈</b></font>     <font color="blue">#</font> = Wall that pressurised water would flow into if it were to be dug out
+
  ▒▒▒▒▒▒<font color="brown">║</font>▒▒▒<font color="blue">▒≈≈≈≈≈</font>       <font color="blue"></font> = Wall that pressurised water would flow into if it were to be dug out
  ######<font color="brown">║</font>####<font color="blue">#</font><font color="blue"><b>≈≈≈≈</b></font>      <font color="#2FB6FF">≈</font> = Regular water
+
  ▒▒▒▒▒▒<font color="brown">║</font>▒▒▒▒<font color="blue">▒≈≈≈≈</font>       <font color="#4080FF">≈</font> = Regular water
  _ ___#<font color="brown">║</font><font color="blue">#######</font><font color="blue"><b>≈≈</b></font>      <font color="blue"><b>≈</b></font> = Pressurised water
+
  _ ___▒<font color="brown">║</font><font color="blue">▒▒▒▒▒▒▒≈≈</font>       <font color="blue">≈</font> = Pressurised water
  #<font color="#2FB6FF">≈≈≈≈≈</font><font color="green"><b>%%</b></font><font color="blue"><b>≈≈≈≈≈≈≈≈</b></font>      <font color="green"><b>%%</b></font> = Pump
+
  <font color="#4080FF">≈≈≈≈≈</font><font color="red">%%</font><font color="blue">≈≈≈≈≈≈≈≈</font>      <font color="red">%%</font> = Pump
  #######<font color="blue">#</font><font color="blue"><b>≈</b></font><font color="blue">#######</font>     <font color="brown">║</font> = Axle
+
  ▒▒▒▒▒▒▒<font color="blue">▒≈▒▒▒▒▒▒▒</font>       <font color="brown">║</font> = Axle
  ########<font color="blue">#</font>#######      _ = Floor
+
  ▒▒▒▒▒▒▒▒<font color="blue"></font>▒▒▒▒▒▒▒      _ = Floor
 
 
Do note that the water output from the screw pump '''will''' be pressurized according to the "infinite water source" behavior, but said pressure will be independent of the source and can be subsequently 'reset' by additional pumps or diagonal gaps.
 
 
 
== Overall behavior ==
 
  
* If a tile contains water which is floating on top of another tile of 7/7 water (and apparently only if there is no water above it{{verify}}), the water in the upper Z-level will be pushed downward and moved to the nearest orthogonal (not diagonal) tile on the lowest available Z-level, up to the Z-level just below the top. Each tile of liquid performs this check once every few steps. This type of pressure applies only to water, and is what causes large bodies of water multiple Z-levels deep to rapidly drain when opened.
+
Do note that the screw pump '''will''' still exert pressure when filling the pool, but said pressure will be independent of the source and can be subsequently blocked by diagonal gaps.
* If a liquid source (river/brook source, underground river waterfall tile, map edge, or [[40d:screw pump|screw pump]] output) attempts to create liquid in its output tile but cannot due to it being full already, the liquid will be created in the nearest orthogonal (not diagonal) tile on the lowest available Z-level, up to the ''same'' Z-level as the source. This applies to both water and magma, and can be observed by damming a river.
 
* Liquids adjacent (both orthogonally and diagonally) to non-full tiles will flow into them and average their depths, pushing lightweight objects and creating flow (which will power [[40d:water wheel|water wheel]]s) if the depth difference was 2 or more.
 
  
See [http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=9] and [http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=10] for more info from Toady.
+
==Hatches==
 
+
[[Hatch cover|Hatches]] can be placed over [[channel]]s, [[stair]]s, [[ramp]]s, etc. to prevent [[water]] from moving vertically but will still allow the tile to be used, even as a water source (and possibly still for fishing too).
===Movies of pressure experiments===
 
* [http://mkv25.net/dfma/movie-283-grandwaterpressureexperiment] - Showing that pumps output 0-pressure water even from a high-pressure source, that water will not flow up and to the side at the same time (has to flow straight up), and a few other things
 
* [http://mkv25.net/dfma/movie-284-firstwaterpressureexperimentreproduced] - Showing that pressure is not transmitted through non-7/7 tiles.
 
* [http://mkv25.net/dfma/movie-285-waterpressureinriverexperiment] - Pump turned into infinite water generator, but still provided useful information on how overpressure causes upward flooding. The infinite water generation behavior has since been fixed.
 
* [http://mkv25.net/dfma/movie-288-waterpressureexperiment4] - Uses three pumps connected to different tunnel layouts to test a few of these rules: One tunnel has three accessible z-levels. The second tunnel has one accessible z level and periodic shafts up. The third has only one accessible z level with no shafts. The bottom level of all three filled first, and the shafts did not fill until the bottom was filled. The second level of the three-high tunnel did not begin filling until the first was full. They did not all fill the bottom at once, but this is believed to be due to the order in which their pumps are placed on the river.
 
  
 
== See Also==
 
== See Also==
:* {{l|flow|flow}}
+
* [http://www.bay12forums.com/smf/index.php?topic=32453.0 Hydrodynamics Education] forum thread
:* ((l|river}}
+
* [[flow]]
 
+
* [[river]]
{{l|Water FAQ}}
 
  
[[Category:Physics]]
+
{{Category|Physics}}

Latest revision as of 16:12, 26 December 2011

This article is about an older version of DF.

Dwarf Fortress features some pretty complex behavior in an attempt to simulate fluid mechanics. One aspect of this behavior is seen in the form of pressure. The basic idea here is quite simple - certain forms of fluids movement exert pressure, causing them to potentially move upwards into other areas.

Summary[edit]

Contrary to what many people may believe, pressure is not a property of a body of liquid. Pressure is simply one of 3 rules by which liquids can be moved - the others are "falling" (when the tile beneath contains less than 7/7 of liquid) and "spreading out" (when the liquid levels of two adjacent tiles are averaged, possibly pushing items around).

The following types of liquid movement follow the rules of pressure:

  • Water falling downward into more water
  • River/brook source tiles (whether the map edge or the "delta" where the river itself begins) generating water
    • Lakes (surface or subterranean), oceans, and the magma sea refilling from the map edge do not exhibit pressure
  • Screw pumps moving water or magma

When a liquid is moved (or created) with pressure, it attempts to locate the nearest tile on the same Z-level as its destination tile (for falling water, this is 1 Z-level beneath its original location) by moving north, south, east, west, down, or up. As it tries to locate an appropriate destination, the liquid will first only try to move sideways and downward - only when this fails will it attempt to move upward. Pressure will not propagate through diagonal gaps.

A demonstration of pressure using U-Bends[edit]

A U-Bend is a channel that digs down, and curves back up. With pressure a fluid will be pushed up the other side of the u-bend. By understanding how pressure works in a u-bend you should be able to adapt this knowledge to use fluids in any configuration you desire without any unexpected surprises that could make life in your fortress more fun than anticipated. Water and magma both behave very differently with regards to pressure, so read carefully.

Water in a U-Bend[edit]

The following three diagrams demonstrate different ways water might behave in a u-bend. In all three cases, the water source is on the left side of the diagram and water is filling the area to the right. In the first example (Diagram A), we have water taken directly from a (flat) river used to fill a u-bend. In this case, the river is free to flow off the edge of the map, so the only pressure comes from the water tile on the top of the left side (highlighted in green) falling downward (into the tile highlighted in red), so the water on the right side stops one level below the river itself.

In the next example (Diagram B), a dam has been placed, preventing the river from flowing off the edge of the map. In this case, the pressure exerted by the river source (highlighted in red) allows the water to fill up the remaining level of the u-bend. Use caution when placing a dam on your river.

The final example (Diagram C), demonstrates how a screw pump exerts pressure - in this case, the water fills up to the same level as the pump's output tile (highlighted in red).

With these three simple examples, you should be ready to go build your enormous plumbing masterpiece, and be relatively safe from any unanticipated flooding. If you plan to work with magma as well however, you should read further.

Diagram A Diagram B Diagram C
Undammed River Dammed River Screw Pump
÷ ÷

Magma in a U-bend[edit]

Magma does not exert pressure when it falls downward. In our first magma example (Diagram A) we show how this works by creating a short u-bend and connecting it up to a magma pipe - it simply fills the lowest point and makes no further attempt to go back up.

In the second diagram (Diagram B) we see how with the addition of a single screw pump, the entire situation changes dramatically - when the screw pump moves magma to the right side, it does so using the rules of pressure and allows the area to fill up to the level of the pump. Accidentally flooding your fortress with magma is considerably more fun than a flood of water.

  Diagram A       Diagram B
  Magma Pipe      Screw Pump
  Side View       Side View
≈≈≈▒ %%≈≈≈▒ %% = Pump≈≈≈▒ ▒ ▒≈≈≈▒▒≈≈≈ = Magma ▒≈≈≈▒ ▒ ▒≈≈≈▒▒≈≈≈▒ ▒ = Solid Ground ▒≈≈≈≈≈≈≈▒ ▒≈≈≈▒▒≈≈≈≈≈▒ ▒≈≈≈▒▒▒▒▒ ▒≈≈≈▒▒▒▒▒▒▒▒

Advanced Pressure[edit]

Lazy model[edit]

Pressure is a lazy model, but will always behave like above. For example, a system on z0 receives water from a cistern z3 in amounts of ~3/tick. This system consists of a tree of passages, one tile wide, and contains 'underpasses' on z-1. Water will flow into the system to a depth of 7 before coming up on the other side of a the first underpass, as is expected. However, if faced with two underpasses, it will choose the nearest one and fill all the system on the other side of that underpass to a depth of 7 before filling the system on the other side of the far underpass. Similarly, if faced with multiple exits from the system, the whole flow will flow out of one exit, the nearest lowest one.[Verify]

Waterfalls[edit]

Waterfalls are of special concern. When drawing water from a waterfall it is important to understand that, since the water is falling on top of the river's surface, the pressure exerted when it falls down into the river will permit it to pass through U-bends that would normally not be filled when using a flat undammed river - if you tap into a river below a waterfall just as you would above it, you could very easily flood your fortress.

Neutralizing Pressure[edit]

There are two methods for neutralizing fluid pressure: diagonal connections and screw pumps. Knowing how to manipulate pressure as needed allows you to quickly move fluids wherever you wish in your fortress allowing you to build things a dwarf can be proud of.

Diagonal Flow[edit]

Liquids moving via pressure can only move to orthogonally adjacent tiles. When faced with a diagonal gap, pressure will fail to move the liquid, forcing the liquid to instead spread out. By forcing fluids through a diagonal connection you can prevent pressure from propagating past a certain point.

This does not work on a vertical basis - water only travels straight up and down to different Z-levels, never diagonally.

If you wish to maintain the rate of flow after de-pressurizing, it's recommended that you have more diagonals than water tiles - that is, if the source is 3-tiles wide, you may wish 4 or more diagonal passages.

Top View
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
 > > >      ▒   >  >  >
4Z Deep    ▒    1Z Deep
 > > >    ▒     >  >  >
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Side View 
▒≈≈≈▒ ▒≈≈≈▒ ▒≈≈≈▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒≈≈≈≈≈≈≈≈RRR≈≈≈≈≈≈≈▒ RRR = Regulator design as seen in top view ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

Pumps[edit]

Since water pressure does not propagate through pumps, it is possible to fill a pool from a "pressurized" source using a screw pump without it overflowing. Of course, there is a downside - you still have to run the pumps and due to the source water's pressure, the pump must be powered instead of run by a dwarf, as the tile the dwarf needs to stand on is filled by water. Furthermore, the pump will likely need to be powered from above or below (as water would simply flow around a gear or axle placed next to the pump), though creative setups are still possible by using additional screw pumps to transmit power.

Your vertical axles or gear assemblies need to be placed above the solid tile of the pump, and there must not be a channel over the walkable pump tile. (Water can only flow straight upward, not up and to the side at the same time.) Multiple adjacent pumps will also transfer power between themselves automatically.

Side view
                      
    Power  Water       Key
      ↓    ↓↓↓↓↓       ▒ = Normal wall
▒▒▒▒▒▒▒▒▒▒≈≈≈≈≈        = Wall that pressurised water would flow into if it were to be dug out
▒▒▒▒▒▒▒▒▒▒▒≈≈≈≈        = Regular water
_ ___▒▒▒▒▒▒▒▒≈≈        = Pressurised water
▒≈≈≈≈≈%%≈≈≈≈≈≈≈≈      %% = Pump
▒▒▒▒▒▒▒▒≈▒▒▒▒▒▒▒        = Axle
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒       _ = Floor

Do note that the screw pump will still exert pressure when filling the pool, but said pressure will be independent of the source and can be subsequently blocked by diagonal gaps.

Hatches[edit]

Hatches can be placed over channels, stairs, ramps, etc. to prevent water from moving vertically but will still allow the tile to be used, even as a water source (and possibly still for fishing too).

See Also[edit]