Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Why is this flooding happening?  (Read 16574 times)

spook54321

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #15 on: May 06, 2013, 10:10:22 am »

Here are the pictures!

Spoiler: Z Level 0 (click to show/hide)

Spoiler: Z Level -1 (click to show/hide)

Spoiler: Z Level -2 (click to show/hide)

This is just as much a flow issue as a pressure issue.  The water is flowing off the map downriver.  If I stop the off-map flow in the river, the two rooms on the top of z -1 will flood.  This is the only difference between diagram A and diagram B in the wiki.

Jez9999, did you stop the river from flowing off the map?
Logged
It's the same reason why sharks don't attack lawyers, professional courtesy.

This (small) sig of mine

slothen

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #16 on: May 06, 2013, 12:25:20 pm »

But if you have a diagonal on -1 (BEFORE the water falls to the next level), you've removed pressure, right?  So, from then on, the water shouldn't be able to go "up" any levels, should it?  I thought only pressure could make water go "up".

I treat diagonal bends with 7/7 behind them as a pressurized source.  That is, I assume that if there is a water source behind the diagonal, then water will always fill up to 7/7 on the same level as that diagonal, regardless of weather there is a u-bend or not (although this is not true).  I think that myself and others make this assumption because its both convenient, errs on the side of caution (at worst the water rises up to 1 z-level lower than what we planned, although if you're using a pressure-plate behind a u-bend as a source regulator, then there is a suppose a possibility of disaster) , and makes sense conceptually.  Having re-read the article (several times, in detail  :-X, double-read the part about green/red tiles) it appears that 'falling' water is any time you have 7/7 water in an 'open space' tile.  In your screenshots (the OP's), it looks like water is indeed behaving in a manner such that the river itself is pressurized.  This could have happened if you're on a biome border and the downstream part of the river froze first.  Later unfreezing would not fix this.  Or if the part of the river you're tapping has a waterfall upstream of it (within the embark).

Rereading this whole thing made me consider a frightening situation.  You embark on day 1 of spring on a waterfall embark.  The downstream part of the waterfall freezes.  Water continues to flow from upstream, and the river overflows its banks, flooding the embark, but forming a wall of ice on the biome border.  Ice that further blocks the outflow of water everywhere.  if this occurred in a valley of a particular shape, you could literally have your starting 7 drown standing at the wagon in the early spring.
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku

jez9999

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #17 on: May 06, 2013, 12:33:04 pm »

Here are the pictures!
Could you post these with the Ironhand tileset for those of us whose ASCII comprehension is mediocre at best?  :)

Quote
Jez9999, did you stop the river from flowing off the map?
Come to think of it, on my test map the river empties out into the ocean.  Perhaps that behaves similarly to a dammed river?
Logged

slothen

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #18 on: May 06, 2013, 12:46:29 pm »

Quote
Jez9999, did you stop the river from flowing off the map?
Come to think of it, on my test map the river empties out into the ocean.  Perhaps that behaves similarly to a dammed river?

bingo.  river source tiles are pressurized.  The exit tiles are not source tiles, and thus pressurized water from the source can always path-out before needing to path up, and will always do so, causing undammed rivers to behave as if they are not pressurized.  I don't know much about how ocean edge-tiles work, but I'm sure you don't see little 2/7's and 4/7's on the edge like you would at the downstream end of a river.  So the river source tiles (and the ocean source as well?) is generating water without a place to send it, hence it can't find a destination for water through only downward and sideways pathing, so it begins pathing upward therefore flooding to the same z-level as the source water despite the u-bend.
« Last Edit: May 06, 2013, 07:13:17 pm by slothen »
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku

jez9999

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #19 on: May 06, 2013, 06:47:34 pm »

I'm gonna do the same test on a map where the river flows through to confirm this therory.
Logged

jez9999

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #20 on: May 07, 2013, 04:49:16 am »

Yep, it appears you're right slothen.  I tried the same experiment on a map where there was a river flowing through rather than into the sea, and it does only reach level z-1 of the river tiles.  Therefore a river running into the sea behaves the same way as a dammed river.  I'll update the wiki.
Logged

jez9999

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #21 on: May 07, 2013, 05:01:03 am »

OK I updated the wiki article to indicate that flowing into the sea actually counts as a dammed river.

I still have one more question, to all you experts out there.  :)  In diagram A of that article, it shows that the undammed river tiles to the left do not exert pressure because they are flowing.  It then shows the one river tile to the right exerting a downward pressure to the tile below it.  My question is, why does it exert this downward pressure?  If this tile is flowing too, then wouldn't it fail to exert downward pressure, like the other flowing river tiles?  Obviously this diagram is correct as experiments have shown, but does anyone have an idea as to why, given the game mechanics?
Logged

Fenrisson

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #22 on: May 07, 2013, 05:37:21 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.
Logged

jez9999

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #23 on: May 07, 2013, 05:46:59 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.
Huh??
Logged

Spitfire

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #24 on: May 07, 2013, 05:58:06 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.

DF ONLY accounts for static pressure. Dynamic pressure isn't simulated.
Logged
Quote from: Rex_Nex
Wanting boobs is primal, not something sparked by the degradation of humanity.

Fenrisson

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #25 on: May 07, 2013, 05:59:11 am »

For all not familliar with hydrostatic behaviour:

static pressure + dynamic pressure = total pressure

the static pressure is what is experienced by the accumulated wheigt of all particles above the observer

the dynamic pressure is the kinestatic energy that is generally generated from potential energie in form of elevation or pressurisation.

One can probably find such things on Wikipedia...
Logged

Fenrisson

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #26 on: May 07, 2013, 06:02:01 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.

DF ONLY accounts for static pressure. Dynamic pressure isn't simulated.

by the looks of the spoilers above DF simulates the dynamic pressure as a form of horizontal  static pressure - otherwise there wouldn't be a difference between the damned an the flowing river!
Logged

Spitfire

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #27 on: May 07, 2013, 11:53:22 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.

DF ONLY accounts for static pressure. Dynamic pressure isn't simulated.

by the looks of the spoilers above DF simulates the dynamic pressure as a form of horizontal  static pressure - otherwise there wouldn't be a difference between the damned an the flowing river!

The dynamic part of pressure is proportional to fluid velocity. In RL the total pressure of a flowing river is HIGHER than a damned river. So the DF effect that water rises further when tapped to a damned river has nothing to do with reality.

I agree what's described in Diagram A in the wiki is a bit odd. I can find no correlation to real effects, so I'm assuming a programming artefact. (Namely fluid simulation, when having to choose if to put a tile of water at the end of a u-bend or on the outflow of the river, always opts for the outflow.)

If you can name a fluid dynamics effect that would explain the strange behaviour in Diagram A, I will listen. I can say dynamic pressure is not it.
Logged
Quote from: Rex_Nex
Wanting boobs is primal, not something sparked by the degradation of humanity.

slothen

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #28 on: May 07, 2013, 01:35:14 pm »

Sorry for the long post and lack of ascii diagrams.

OK I updated the wiki article to indicate that flowing into the sea actually counts as a dammed river.

I still have one more question, to all you experts out there.  :)  In diagram A of that article, it shows that the undammed river tiles to the left do not exert pressure because they are flowing.  It then shows the one river tile to the right exerting a downward pressure to the tile below it.  My question is, why does it exert this downward pressure?  If this tile is flowing too, then wouldn't it fail to exert downward pressure, like the other flowing river tiles?  Obviously this diagram is correct as experiments have shown, but does anyone have an idea as to why, given the game mechanics?

Understanding the diagrams is what allowed me to answer your questions.  In diagram, A, the river itself is not considered pressurized because it has open space on the same z-level that water can teleport to without having to path upward.  The tile at the right is only special because it has water below it, thus this tile is also not pressurized, but it is inducing pressure on the level below.  The river itself does not need to be pressurized to generate pressure in water below it.

I'm pretty sure river source tiles behave exactly like screwpumps.  Each tick they attempt teleport a 7/7 block of water into a square that probably already has 7/7 water in it.  It first attempts to find a destination using down and sideways pathing trough other tiles that have 7/7 water.  An undamed river always has enough space to fit enough water in near the downstream edge of the map.  Failing that, it repeats the process allowing pathing up to the same level.

If you have a filled U-bend next to an undammed river, and the river will always teleport the water to the end of the river, and never to the top of the far-end of the u-bend.  This is because the source tiles will always find a place to put the 7/7 water before needing to do the pathing check that includes upward movement.  However, the mere existence if a u-bend means there is water over other water, and whenever this is true the water on top will attempt to find a home on the z-level below using any type of pathing (again, through other 7/7 water), although the game has some ways to avoid exhaustively doing this every tick.

Water being pumped/generated, water being physically above other water, and water spreading out to adjacent empty space (does not involve teleporting) are the only ways water moves.

Now, we accept diagram A to be correct.  What is not covered by the diagrams is what happens if suddenly floodgates simultaneously dam the river on both ends.  Now we have standing 7/7 water on one side of the u-bend, with empty space on the other.  Since we've also closed off the source tiles, no water is teleporting in, and so the 1-z level difference on each side of the u-bend will remain in equillibrium.  This should be easy to confirm by making a very small u-bend and filling it with pond jobs on one side only.

Our notion of "pressure" is just what we observe of all this pathing and water teleporting.  This is what the game is trying to model, after all, but its a result of what part of the algorithm the game is on, its not some monolithic variable that applies to some water but not other.  For example, we think of pumps as always inducing pressure, but the rivers show us that pumps will not induce pressure as long as there is sufficient room on the same z-level or z-levels reachable through sideways and downward pathing only.

Magma is identical except the 'falling' rule never causes it to path upward ever.  I have no idea how any of this applies to the magma sea, semi-molten-rock, or if map-edge tiles that are by-default submerged behave like river-sources (I think they just count as permanent 7/7 water and water flows from them only when the edges themselves are below 7/7).

Another interesting experiment would be to pump into a closed u-bend with the pump outputting on z0.  If you put a long corridor on the far side of z-1, then water should reach z0 on the far side before reaching the end of the z-1 corridor.  I think this would be so because the pumped water will be in pressurized mode "path anywhere," and it should choose the shortest path even if a longer but lower path is available.  Then repeat the experiment but with a long corridor on the close side of z-1 (with infinite drainage/map edge at the end).  In this case the water will never crawl up the far side of the u-bend, because it will always find a destination before moving into 'path upward' mode.  I think I can be pretty confident about the second test, the first one is a bit more murky, and would tell is if water tries to find teh shortest path, or if it exhaustively searches each z-level before moving upward again.
« Last Edit: May 07, 2013, 01:59:17 pm by slothen »
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku

Fenrisson

  • Bay Watcher
    • View Profile
Re: Why is this flooding happening?
« Reply #29 on: May 08, 2013, 04:28:41 am »

To me it seems that the DF-physics are closer to reality than we all thought. It seems, that if the distance between the flowing tiles and the channel is large enough, the dynamic-pressure-behavior disapers as it would in real life. it only accounts for static pressure while the total pressure remains the same.

DF ONLY accounts for static pressure. Dynamic pressure isn't simulated.

by the looks of the spoilers above DF simulates the dynamic pressure as a form of horizontal static pressure - otherwise there wouldn't be a difference between the damned an the flowing river!

The dynamic part of pressure is proportional to fluid velocity. In RL the total pressure of a flowing river is HIGHER than a damned river. So the DF effect that water rises further when tapped to a damned river has nothing to do with reality.

I agree what's described in Diagram A in the wiki is a bit odd. I can find no correlation to real effects, so I'm assuming a programming artefact. (Namely fluid simulation, when having to choose if to put a tile of water at the end of a u-bend or on the outflow of the river, always opts for the outflow.)

If you can name a fluid dynamics effect that would explain the strange behaviour in Diagram A, I will listen. I can say dynamic pressure is not it.

First of all I think we have to consider that DF is only trying to simulate the behaviour of hydro-pressure, I wasn't saying that the pressure features of DF are even close to reality. Still it seems DF is able to make a difference between standing water and flowing water of the same height - which I found a nice feature given the rather blunt simulation of DF-flow. The real issue is, that rivers in DF do not flow due to elevation but rather due to a artificial water source, where water is generated by the will of Armok. As spitfire pointed out in real life the water level should rise when a river is damned due to the potential energy of the water upstream diverting its dynamic pressure back into potential energy an therefore applying static pressure on the water below. Due to the lack elevation difference this is impossible to simulate in DF-rivers. What DF seems to do is not accounting for the static pressure of a water tile until no further flow on the same z-level is possible. Therefore DF is simulating something like dynamic pressure...

Back to the original problem: In the first post of jez9999 the question was (I hope I got that right) why the tunnel on the inside end of the u-bend is being flooded, since the water is being taken out of the a flowing river, and on the same z-level as the bottom of the river (therefore the flowing water). The wiki says, that the water shouldn't do so (diagram A). To me this behaviour makes sense (see first paragraph). I believe the flood is happening because DF is able to notice tiles that are not in flowing direction are not accounted as being part of the flow system (maybe flow has something like a pathing-algorithm noticing dead ends). Therefore the dynamic pressure behaviour stated above does not apply to them.
Logged
Pages: 1 [2] 3