Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Two Experiments with a Major River  (Read 3101 times)

Kanddak

  • Bay Watcher
    • View Profile
Two Experiments with a Major River
« on: August 23, 2009, 01:15:00 pm »

Just a little hydrodynamics research I carried out today.
For reference, here's my current theory of water: http://www.bay12games.com/forum/index.php?topic=32453.0

Experiment 1: Relative speeds of different methods of water movement

Abstract:
I wanted to provide a demonstration of different ways of moving water for the benefit of a forums poster who was questioning the best way to fill a cistern. (http://www.bay12games.com/forum/index.php?topic=40774.0)
The poster originally questioned the merits of simply connecting a river to an aqueduct to a cistern, versus pumping water from the river into the aqueduct and cistern, versus connecting the aqueduct to the river and then pumping it from the aqueduct into the cistern at the cistern end.
I designed an experiment intended to demonstrate the relative speeds of pumped water, water under pressure, and water flowing horizontally. However, failure to account for the effects of the sourced water of a major river caused the various cisterns to fill in an order other than what was predicted, with pipes closer to the source of the river receiving water first.
As a result, I was lead to the hypothesis that rivers place new water onto the map using a shortest-path algorithm, similar but not identical to that used by screw pumps and water pressure effects.

Video: http://mkv25.net/dfma/movie-1618-riverexperiment1cisternfillcomparison

Details:
Spoiler (click to show/hide)

Experiment 2: Pathfinding algorithm for river water

Abstract:
After the failure of Experiment 1 I wanted to test the behavior of river flow more precisely. I hypothesized that it would not be able to pathfind through diagonal openings.
I designed an experiment using three pairs of channels. One pair was a control where water could enter both channels orthogonally. In the other two pairs, one channel had a diagonal opening at its entrance.
Consistent with my hypothesis, water flowed more slowly through the diagonal openings.

Video: http://mkv25.net/dfma/movie-1619-riverexperiment2pathfindingofriverwater

Details:
Spoiler (click to show/hide)

Experiment 1B:

With the information gained from Experiment 2, Experiment 1 was repeated with a diagonal opening preventing river flow from flooding the pipes. This modification caused the experiment to behave as originally predicted.

Video: http://mkv25.net/dfma/movie-1620-riverexperiment1b

Details:
Spoiler (click to show/hide)
« Last Edit: August 23, 2009, 01:22:20 pm by Kanddak »
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

Dorfus

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #1 on: August 23, 2009, 02:13:55 pm »

Didn't expect my thread to spark any research! So basically, pumping out from a river directly is far quicker and letting water make its way anywhere. I guess pumps will pump at their speed until the water has nowhere else to go. I was worried that a pump would still be limited as it would be 'blocked' by the water it has just pumped out, but now there's empirical evidence that that's not the case. Nice one :)

And you also showed that the more pressure the water is under the faster it will flow. You noted a slight difference with 1z level of water, what about 10? Is there a point at which pressure from one large cistern pushing water down and then through a pipe into another cistern is quicker than pumping it directly?
Logged

Magua

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #2 on: August 23, 2009, 03:35:54 pm »

Awhile ago, there was a question of whether you could make a dwarven water cannon -- pump the water up to the highest z-level, then drop it into a cylinder with a floodgate at the bottom.  Fill.  Get something in front of the floodgate, open it, and, the theory goes, the water should shoot out with phenomenal force.

I'm going to get around to testing this, just as soon as I can get the orcs under control...
Logged
Also, you can manufacture vomit at a smelter.  Subsequently removing the smelter spews vomit over a surprising area.

Dorfus

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #3 on: August 23, 2009, 04:30:34 pm »

If I understand the water implementation of the game, it doesn't flow across 7/7 tiles. Water under pressure gives the appearance of flowing faster and further, so the chances are the projectile would be immediately submerged in 7/7 water on the first tick of the water flowing and as a result not get pushed anywhere. Good for flashdrowning something though. Also good for multiple pressureplate triggers
Logged

Kanddak

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #4 on: August 23, 2009, 06:16:12 pm »

I could have explained why using lots of z-levels wouldn't make water go any faster (again, review the theory of water: http://www.bay12games.com/forum/index.php?topic=32453.0 ) but I decided I'd better just show it.

Experiment: Speed of pressurized water as a function of altitude.

Abstract:
Water flows more quickly when falling under pressure to a lower z-level. This leads many players to assume that an increased difference in altitude will further increase the speed of flow. My own experience with water, however, suggested that relative altitude would determine only the level to which pressurized water would rise, not the speed at which it would travel.
I performed an experiment in which a two-level-high and a five-level-high cistern containing equivalent volumes of water were drained simultaneously.
The taller cistern actually drained more slowly than the shorter one, showing that an increased altitude difference does not cause an increase in flow rate.

Video: http://mkv25.net/dfma/movie-1621-pressurevsaltitude

Details:
Spoiler (click to show/hide)
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

Neruz

  • Bay Watcher
  • I see you...
    • View Profile
Re: Two Experiments with a Major River
« Reply #5 on: August 23, 2009, 08:52:40 pm »

By the way, a theory was postulated as to why rivers cannot natively fill up a U bend to equal level; only to level -1. The reason for this (it is believed) is because the edge of the map counts as a lower level for water to flow to, so once the U bend is filed up to level -1, the new water just paths straight off the map.

This seems to be supported by the fact that damming the river results in it acting as expected; the U bend fills up to equal level rather than level -1 if the river filling it is dammed.

Kanddak

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #6 on: August 23, 2009, 10:26:52 pm »

By the way, a theory was postulated as to why rivers cannot natively fill up a U bend to equal level; only to level -1. The reason for this (it is believed) is because the edge of the map counts as a lower level for water to flow to, so once the U bend is filed up to level -1, the new water just paths straight off the map.

This seems to be supported by the fact that damming the river results in it acting as expected; the U bend fills up to equal level rather than level -1 if the river filling it is dammed.
That is a beautifully testable hypothesis!

And the verdict is...
Yes! http://mkv25.net/dfma/movie-1622-riverpressureversusdam

I've known for a while without thinking to spell out that the pressure pathfinding algorithm will always fill up one compartment at a time, only going through a U-bend if it's unavoidable. With the riverbed always having an opening at the end of the map... kind of obvious in hindsight. Very nice.
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

GildedBear

  • Bay Watcher
    • View Profile
Re: Two Experiments with a Major River
« Reply #7 on: August 24, 2009, 12:22:05 am »

In your 1B experiment you forgot to test the newly discovered behaviour against the speeds of the diagonal pipes. It seems to me that directly tapping a river with no diagonals would be the fastest way to fill a cistern regardless of where it is hooked up when compared with diagonal connections. A diagonaled pump might rival it for speed though since they both use the 'pressure' teleportation. It might also be useful to do experiment 1 three more times, giving each pipe a chance in the upstream spot to see if there is any difference in who fills first.
Logged

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Two Experiments with a Major River
« Reply #8 on: August 24, 2009, 12:45:12 am »

To supplement the U-bend effect:

The pressure teleportation of water preferentially goes in these directions preferentially: down (highest preference), north/south/east/west, and up (lowest preference). As such, water will teleport to the end of the map where it's draining, rather than to the end of the U-bend.
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.