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.

40d:Water pressure

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Water pressure is a phenomenon apparently exhibited by some, but not all, water in Dwarf Fortress (Murky pools seem pressureless unless connected to another water source, but this is probably because pressure is only transmitted by 7/7 water).

Water which is pumped up high into an enclosed tower and then allowed to flow to the bottom, at least if pumping continues, will have tremendous pressure at the bottom of the tower. This causes the water, if released, to move with remarkable speed and to even flow up stairs, ramps, or channels. Any water which flows down will tend to flow back up, until it has equalized.

Dwarf Fortress does not model air pressure or surface friction, and magma does not have pressure.

Water Pressure Dangers

It is easy to flood your fortress accidentally by not accounting for water pressure. For example:

  • It is safe to dig out a cistern one level below a murky pool, and to channel above a few tiles of the cistern so that your dwarves can get water from it without having to go outside.
  • It is safe to refill a murky pool with water from a pump or brook/river/etc on the same level.
  • 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 cistern, which will then flow up out of your channels and flood your fort.

Mitigating the Dangers

Hatches placed over channels prevent water pressure from spewing water up out of the channels, and still allow the tiles to be used as a water source (and possibly still for fishing too).

Pumps can be used to eliminate pressure. If you allow water to fall two levels down into an enclosed area, and then pump it from one level above that, the water which comes out of the pump should have 0 pressure, rather than 1 pressure. You can even deliver water to the second-lowest level of your fortress safely in this manner. Of course, there is a downside - you still have to power the pumps. Due to the source water's pressure, the pump must be powered instead of dwarf-run (the tile the dwarf would stand on is filled by the pressurized water). Additionally, the power cannot be hooked up to the walkable tile of the pump, because the water will simply flow directly up it! Your vertical axles or gear assemblies should 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)

Water Pressure Theory

Here are two possible models for DF's water pressure.

Model #1

  • 1. Water normally has 0 pressure.
  • 2. 7/7 water tiles transmit their pressure to adjacent tiles, with higher pressure values replacing lower pressure values when they meet. (but how fast is it transmitted?)
  • 3. Pressure which is transmitted downward is increased by 1.
  • 4. Pressure which is transmitted upward is decreased by 1.
  • 5. 7/7 water tiles with more than 0 pressure can flow or spread water upward.
  • 6. Pumps do not transmit pressure. Water which comes out of pumps has 0 pressure.

Model #2

  • 1. Any given 7/7 water tile determines the highest z-level of 7/7 water which it is connected to, and can drain water from said connected tiles to spread upward so long as it does not spread above that level.
  • 2. For this model, rule #6 would likely still be true, since pumps do not form a connection between input and output water.

Further experiments, or asking Toady, may be needed to determine which is correct. The first model would probably be simpler to code, and would probably run faster (would take less CPU time to perform fluid pressure logic, provided pressure is only transmitted one or two tiles per tick). In theory, the first model could be identical in results to the second model if pressure was transmitted instantaneously to all connected tiles, and if falling water does not retain its pressure (and has to be re-pressurized by higher water once it has stopped falling).

To determine which model is more accurate:

If you drop a small amount of water a large distance downward, what pressure does it have afterwards? With model #1, it would have very high pressure. With model #2, it would have low pressure.

Theoretically this could be tested by allowing pressureless water from a pump on that level to flow into the same space as the small amount of theoretically high-pressure water. If the water fills to 7/7 and then flows up the shaft, model #1 is correct. If not, either model #2 is correct, or falling water does not retain pressure.