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 "40d:Water pressure"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Attempting to revise the model to fit all observed behavior)
Line 23: Line 23:
  
 
===Current Best Pressure Model===
 
===Current Best Pressure Model===
*1. Water normally has 0 pressure.
+
# Water normally has 0 pressure.
*2. If a water source attempts to create water but cannot because the output tile is already 7/7, IFF there is also 7/7 water below the output tile, it will become pressurized to pressure level 1.
+
# If a water source (including pumps) attempts to create water in its output tile but cannot due to it being full already, it will pressurize the output tile (it remains pressure 0, but this allows it to pressurize the tile below it and give it pressure 1).
*3. Sourced 7/7 water tiles with more than 0 pressure first attempt to generate water in (potentially distantly) connected low-water (below 7/7) tiles on the same level. (It is unclear what pressure such generated water starts with).
+
# Water sources attempt to generate water in tiles adjacent to pressurized tiles. They will not generate water in tiles above pressurized tiles unless the water source has '''nowhere''' else to generate '''any''' water, and they will never generate water above the water source's z-level.
*4. If sourced 7/7 water tiles with more than 0 pressure cannot generate water with rule 2, they instead will generate water above themselves if there is room for it. (Such generated water appears to start with 1 less pressure than the water below it)
+
# The amount of water generated per tick does NOT appear to increase as the radius of the water blob increases. Water being generated on two z-levels at once has been observed to generate faster on the lower level, but it is unclear if this actually means that lower levels have more water generated, or if some other factor was at work.
*5. If sourced 7/7 water tiles with more than 0 pressure cannot generate water with rule 2 or rule 3, they instead transmit their pressure level to lower-pressured adjacent water tiles, and to 7/7 water tiles below themselves (and possibly 7/7 tiles above?).
+
# For water sources, seemingly random valid pressurized tiles are chosen to generate water at each tick.
*6. Pressure which is transmitted downward is increased by 1.
+
# The pressurization state spreads from a tile to adjacent, above, or below tiles only if both are 7/7, and only if the pressurized tile has no tiles adjacent, above, or below itself which it could generate water in.
*7. Pressure which is transmitted upward is decreased by 1.
+
# Pressure which is transmitted downward is increased by 1. 7/7 water which falls and remains 7/7 also increases in pressure {{verify}}.
*8. Pumps do not transmit pressure. Water which comes out of pumps has 0 pressure. (Note that you must ensure that output water does not contact input water, or pressure WILL be transmitted through the connection)
+
# Pressure which is transmitted upward is decreased by 1.
*9. Water tiles which drop below 7/7 density become 0 pressure.
+
# Tiles with 0 pressure can be considered 'pressurized' for the purpose of generating water (they have no speed bonus).
*10. Pressurized water moves much faster than 0 pressure water, with each level of pressurization seemingly providing greater speed. It also seems to increase the rate at which water is created.
+
# Pumps do not transmit pressure. Water which comes out of pumps has 0 pressure. (Note that you must ensure that output water does not contact input water, or pressure WILL be transmitted through the connection)
*11. 'Sourced' water means water which is connected via 7/7 tiles to a water source, which includes the edge-of-map tiles where water enters the map, actively pumping pumps which have water to pump, and possibly aquifers.
+
# Water tiles which drop below 7/7 density become 0 pressure and unpressurized.
 +
# Pressure makes water moves faster, with each level of pressure seemingly providing greater speed.
  
 
===Anomalies===
 
===Anomalies===
 
* If you drop a fixed amount of water several levels down a shaft into another room, you can end up with more water than you started with. {{version|33g}}
 
* If you drop a fixed amount of water several levels down a shaft into another room, you can end up with more water than you started with. {{version|33g}}
* Pumps can turn into seemingly infinite water generators (though they can be stopped by blocking their input with a hatch, or by disconnecting their power).{{version|33g}} The above model currently appears to match this behavior (possibly not in all circumstances which may cause it).
+
* Pumps can turn into seemingly infinite water generators (though they can be stopped by blocking their input with a hatch, or by disconnecting their power).{{version|33g}} The above model currently appears to match this behavior if pumps are considered water sources. Perhaps pumps are not removing water from their input if they are unable to put water in the output, but they still generate water elsewhere as a source? {{verify}}
 
* A "u-bend bug" has been reported, which seemingly generates infinite amounts of water without pumps.{{version|33g}}{{verify}}
 
* A "u-bend bug" has been reported, which seemingly generates infinite amounts of water without pumps.{{version|33g}}{{verify}}
* It is also possible for water which lacks an endless source to exhibit overpressure and follow the overpressure rules. This is not a bug, but something which doesn't fit the current model. For example, if you take a 4x4 room of 7/7 water and drop it down a 1x1 shaft with a 3x1 tunnel at the bottom, which connects to another empty shaft which leads straight up, the water will fill the 3x1 and then equalize height in both shafts.
 
 
Possible Experiment: From a pump, fill a cistern which is several levels lower. Shut off the pump and the higher level tiles with hatches. Open other hatches above the cistern, combine water with unpressurized water, and see what happens.
 
  
 
===Movies of pressure experiments, and save files for them===
 
===Movies of pressure experiments, and save files for them===
Line 47: Line 45:
 
* [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-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-285-waterpressureinriverexperiment] - Pump turned into infinite water generator, but still provided useful information on how overpressure causes upward flooding.
 
* [http://mkv25.net/dfma/movie-285-waterpressureinriverexperiment] - Pump turned into infinite water generator, but still provided useful information on how overpressure causes upward flooding.
 +
 +
===Possible Future Experiment===
 +
* Have a pump pumping water into a 3-wide tunnel with a 1-wide tunnel below it. Have another pump pumping water into a 1-wide tunnel with a 3-wide tunnel below it. Observe whether the bottom tunnel's water spreads faster in both cases or just in the smaller tunnel.
 +
* From a pump, fill a cistern which is several levels lower. Shut off the pump and the higher level tiles with hatches once the whole thing is 7/7. Open other hatches above the cistern, combine water with unpressurized water, and see what happens.
 +
* Use three pumps connected to different tunnel layouts to test a few of these rules: One tunnel should have three accessible z-levels. The second tunnel should have one accessible z level and periodic shafts up. The third should have only one accessible z level with no shafts. Observe whether water appears in the shafts before it does at the same positions in the three-high level, and observe whether the shaftless one hits the end first. If the above model is correct, no water should appear in the second tunnel's shafts until the tunnel itself is completely full. Will the water then appear in all the shafts simultaneously?

Revision as of 02:55, 6 January 2008

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

What follows here are several rules which specify how water pressure affects water's behavior. These were written to fit experimentally observed behavior as best as possible. (There used to be two models here, but the second one couldn't be reconciled with the observed results of the water-overpressure-in-river experiment)

Current Best Pressure Model

  1. Water normally has 0 pressure.
  2. If a water source (including pumps) attempts to create water in its output tile but cannot due to it being full already, it will pressurize the output tile (it remains pressure 0, but this allows it to pressurize the tile below it and give it pressure 1).
  3. Water sources attempt to generate water in tiles adjacent to pressurized tiles. They will not generate water in tiles above pressurized tiles unless the water source has nowhere else to generate any water, and they will never generate water above the water source's z-level.
  4. The amount of water generated per tick does NOT appear to increase as the radius of the water blob increases. Water being generated on two z-levels at once has been observed to generate faster on the lower level, but it is unclear if this actually means that lower levels have more water generated, or if some other factor was at work.
  5. For water sources, seemingly random valid pressurized tiles are chosen to generate water at each tick.
  6. The pressurization state spreads from a tile to adjacent, above, or below tiles only if both are 7/7, and only if the pressurized tile has no tiles adjacent, above, or below itself which it could generate water in.
  7. Pressure which is transmitted downward is increased by 1. 7/7 water which falls and remains 7/7 also increases in pressure [Verify].
  8. Pressure which is transmitted upward is decreased by 1.
  9. Tiles with 0 pressure can be considered 'pressurized' for the purpose of generating water (they have no speed bonus).
  10. Pumps do not transmit pressure. Water which comes out of pumps has 0 pressure. (Note that you must ensure that output water does not contact input water, or pressure WILL be transmitted through the connection)
  11. Water tiles which drop below 7/7 density become 0 pressure and unpressurized.
  12. Pressure makes water moves faster, with each level of pressure seemingly providing greater speed.

Anomalies

  • If you drop a fixed amount of water several levels down a shaft into another room, you can end up with more water than you started with. v33g
  • Pumps can turn into seemingly infinite water generators (though they can be stopped by blocking their input with a hatch, or by disconnecting their power).v33g The above model currently appears to match this behavior if pumps are considered water sources. Perhaps pumps are not removing water from their input if they are unable to put water in the output, but they still generate water elsewhere as a source? [Verify]
  • A "u-bend bug" has been reported, which seemingly generates infinite amounts of water without pumps.v33g[Verify]

Movies of pressure experiments, and save files for them

  • [1] - Showing that pressure is not transmitted through non-7/7 tiles.
  • [2] - 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
  • [3] - Pump turned into infinite water generator, but still provided useful information on how overpressure causes upward flooding.

Possible Future Experiment

  • Have a pump pumping water into a 3-wide tunnel with a 1-wide tunnel below it. Have another pump pumping water into a 1-wide tunnel with a 3-wide tunnel below it. Observe whether the bottom tunnel's water spreads faster in both cases or just in the smaller tunnel.
  • From a pump, fill a cistern which is several levels lower. Shut off the pump and the higher level tiles with hatches once the whole thing is 7/7. Open other hatches above the cistern, combine water with unpressurized water, and see what happens.
  • Use three pumps connected to different tunnel layouts to test a few of these rules: One tunnel should have three accessible z-levels. The second tunnel should have one accessible z level and periodic shafts up. The third should have only one accessible z level with no shafts. Observe whether water appears in the shafts before it does at the same positions in the three-high level, and observe whether the shaftless one hits the end first. If the above model is correct, no water should appear in the second tunnel's shafts until the tunnel itself is completely full. Will the water then appear in all the shafts simultaneously?