Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dynamic Swimming Pool Water Level Adjuster  (Read 1570 times)

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Dynamic Swimming Pool Water Level Adjuster
« on: September 01, 2011, 05:29:35 pm »

I present to you:The Dynamic Swimming Pool Water Level Adjuster! (Feel free to suggest a better name.)
A contraption that dynamically adjusts a swimming pool to a level of exactly n/7 of water, whichever n you prefer.

Example: n = 4
Code: [Select]
Design:

#######
#RRRRR#
#.....#
#.....#
#.....#
#.....#
#_____#
##BBB##
IF....#
#######

R = Ramp
. = Floor
_ = Channel (without ramp)
B = Bridge (raises N or S)
F = Floodgate
I = Pressurized water inlet

The bridge and the floodgate are linked to the same lever, which can be operated on repeat by a sparedwarf (pun intended) while you use the water to train soldiers or do whatever you had in mind for this water! The theory is as follows: When the bridge raises, exactly 7 tiles of pond are cut off. The four tiles behind the bridge are subsequently filled completely with water. When the floodgate closes and the bridge lowers, the 28 units of water are dispersed to fill the 7 tiles cut off from the pond. If the pond water level was lower than 4/7, then less than 28 units were cut off by the raising bridge and the water level rises slowly, and vice versa, if the pond water level was higher than 4/7, the water level slowly lowers to 4/7, eventually creating a perfectly smooth 4/7 pond level, even when continuing to operate. The channel is there to prevent dwarves from accidentally losing a dimension.

For a n/7 setup, you need 7 - n bridge tiles and n empty tiles between the floodgate and the bridge.
Due to the slowly-adjusting nature of the setup, you can build many (and/or bigger versions) of these adjusters into the same pond to speed up the process, especially with large ponds. If you wish to dynamically adjust the water level, you can build setups for different water levels into the same pond and always use the one that creates the water level you desire.

Code: [Select]
Design for n = 3:
#######
#RRRRR#
#.....#
#.....#
#.....#
#.....#
#_____#
##BBBB#
IF...##
#######

Design for n = 5:
#######
#RRRRR#
#.....#
#.....#
#.....#
#.....#
#_____#
##BB###
IF...##
##..###
#######

And so on.

</mood>
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #1 on: September 01, 2011, 06:13:33 pm »

Note: It may be easier to make the whole thing 7 tiles wide, and then load the fill area (the southern part of the diagram) with floodgates, so that you can manually adjust chamber size without having to re-dig anything.

This method will require a lot of water, and not function instantly.  A drowning dwarf is very much in trouble.  There are easier ways to accomplish a swimming pool, but I compliment the method used here to normalize depth.

krenshala

  • Bay Watcher
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #2 on: September 01, 2011, 06:29:15 pm »

Looks like bridge volume plus fill volume always equals 7.

I wonder if you can (easily) get things set up so you can use GirlInHat's floodgate suggestion with seven (six?) individual bridges and have each open floodgates cause a particular bridge to not operate, while closed floodgates (removing space from the fill area) would have their corresponding bridge sections open/close as the device cycles.
Logged
Quote from: Haspen
Quote from: phoenixuk
Zepave Dawnhogs the Butterfly of Vales the Marsh Titan ... was taken out by a single novice axedwarf and his pet war kitten. Long Live Domas Etasastesh Adilloram, slayer of the snow butterfly!
Doesn't quite have the ring of heroics to it...
Mother: "...and after the evil snow butterfly was defeated, Domas and his kitten lived happily ever after!"
Kids: "Yaaaay!"

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #3 on: September 01, 2011, 06:40:24 pm »

If you made raising bridges in binary sizes (1, 2, 4) instead of floodgates in the south you should be able to control the exact number of cells filled with less levers / parts, anything from 0 - 7 units with only 3 levers needed.

They could be arranged them so they all touch both the input and output squares :-

The only thing now to work out is that the middle-bridge from the original design is a set size, not variable, so that's still something to iron out.

Design:

Code: [Select]
#######
#RRRRR#
#.....#
#.....#
#.....#
#.....#
#_____#
##BBB##
#2214444#
###F####
###I####

EDIT: thinking here, to solve the middle-bridge control problem :-

Modified design below :-

Code: [Select]
#######
#RRRRRRR#
#.......#
#.......#
#.......#
#_______#
#2214444# <= linked to 7 "water release levers" in binary pattern
#2214444# <= linked to 3 "control levers"
###F#### <=linked to ALL the "water release levers"
###I####

So first you'd set the 3 control levers to set the correct number of inlet squares open.

Then, you cycle one of the (7?) water release levers, each of which opens the floodgate and controls a combination of bridges

By choosing the appropriate settings, you should be able to control the exact water levels.

This design is using 6 bridges, 10 levers + MANY mechanisms. Hopefully there's a simpler way than this ;)

I hope the diagonal water pressure don't stop this working effectively, as well.
« Last Edit: September 01, 2011, 07:02:19 pm by Reelyanoob »
Logged

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #4 on: September 01, 2011, 06:41:29 pm »

<double post, sorry>
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #5 on: September 01, 2011, 06:59:40 pm »

Any room that is 7xN can be filled to a specified level if you fill a certain number of tiles.  I've always planned but never implemented an idea for this.  The basic idea would be:
Code: [Select]
#########
#.......#
#1111111#
#22222223
#########
1 = A wall of floodgates or a bridge, to restrict water flor.
2 = A 7 wide chamber filled with floodgates, each individually levered.
3 = Intact floodgate.

How to use it: Want 3/7 deep?  Open the right-most 3 floodgates of the "2" group.  Open the "3" group to allow water in (or use a hatch above to preserve water).  Close "3" group to create a 3x1 room of enclosed water.  Open group "1" to let that flow into the main room, which will fill to 3/7.

Use of hatches may help control the flow of water and dwarves, and this method may be expanded for any size of room.  The basic idea is to double the room size, and then control the water content of the copy room before it empties into the main room.

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #6 on: September 01, 2011, 07:12:35 pm »

Hold on, if you open the right-most 3 of the 2 group and fill them (with 3 x 7 = 21 units of water), then lower bridge#1, there will be 2 x 7 + 3 = 17 open cells, which will have to share the 21 units of water. This is definitely not "3 deep"

I'm pretty good with algebra so I'll work out some equations to use in future water designs :-

- Call # of "target" cells X
- Call Target Water Level K
- KX is water needed for the target room
- But water must equalize with a greater area, call the fill-area Y
- 7Y is the amount of water held in the fill area.
- there is an additional 1 cell needed for the floodgate between the two areas
- Total area = X + Y + 1
- Total water needed = K(X + Y + 1)

7Y = KX + KY + K

We already know X and K, so solve for Y :-

7Y - KY = K(X + 1)

Y = K(X + 1) / (7 - K)

So, if X = 7 and K = 3

Y = 3 * 8 / 4 = 6.

...

So that implies to fill a 1x7 room to 3/7 (with a 1x1 floodgate holding back the water), we need a filler pool of 6 cells

EDIT: I'm not sure my math worked out 100%, i'm checking over it


Ahh, it did work, the 6x1 pool holds 42 units of water. Once the floodgate is opened, the total area is 14 units. 42/14 = 3.

« Last Edit: September 01, 2011, 07:28:02 pm by Reelyanoob »
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #7 on: September 01, 2011, 07:20:58 pm »

Exactly, you overlooked the enormous amount of water destroyed by your bridges.

Code: [Select]
#########
#RRRRRRR#
#.......#
#.......#
###___###
#BD...DB#
###...###
#BD...DB#
###...###
#BD...DB#
####B####
IIF.dd###
###ddd###
#########

How it works: Link up all the Floodgates and Bridges to one lever. To set water level to 4/7, close 4 Doors and 2 doors. Then start mashing. Caution: All water has to pass through the lowest B tile, so this construction could be a lot slower and could possibly stop just under your desired water level, because the water would have to flow across the whole room to replace the water mashed by the upper Bridges. Although in combination with a slow repeater, it might work, but still slow.
The point: Too much dwarfy might just not work. But I can always be convinced of the opposite, if another design works better.
Logged

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #8 on: September 01, 2011, 07:21:44 pm »

The best way to just fill a certain level of water is to have it all in a column above the swimming pool. Then there's no "splashing" or lost water at "edges" or anything like that. It doesn't work (I don't think) for this design of auto-leveller, though. This is pretty cool.
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

Reelyanoob

  • Bay Watcher
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #9 on: September 01, 2011, 07:41:54 pm »

@MagmaMcFry: I'm not convinced about your latest design ;)

You were on a better track at the start

And the problem with girlinhat's idea was that she forgot to take into account the exact number of cells which need to be filled with water, it includes both the input pool and target area. She seems to only have taken the target area into account.

It's not because of the bridges destroying water or anything like that.

Although ... her design could be effective if pumped repeatedly. e.g. Open part of the "2" section fill with water, then open ALL of the 2 section. Now that would fill the 2-section to the set level 3/7 in her example.

Then, you could open the 1-bridge and equalize the water in north and south sections. With repeated pumping, this would equalize the water to the desired level.

girlinhat did you leave a step out of your instructions? Although doing it this way would be a pain to automate.
« Last Edit: September 01, 2011, 07:53:27 pm by Reelyanoob »
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Dynamic Swimming Pool Water Level Adjuster
« Reply #10 on: September 02, 2011, 06:51:29 am »

The main idea is to cut off 7 cells (the bridge tiles count as cells), fill n of them with water, destroy the water in the other cells (by closing the bridge, the water gets destroyed automatically) and open all 7 cells up again.

loads of math
Your math is correct, and this design works if you want to fill a pool with a specified level in one go. But if you repeat your process, you will eventually end up with an even 6/7.
My design is independent of pool size, and does not adjust the water in one go.

Any room that is 7xN can be filled to a specified level if you fill a certain number of tiles.  I've always planned but never implemented an idea for this.  The basic idea would be:
Code: [Select]
#########
#.......#
#1111111#
#22222223
#########
1 = A wall of floodgates or a bridge, to restrict water flor.
2 = A 7 wide chamber filled with floodgates, each individually levered.
3 = Intact floodgate.

How to use it: Want 3/7 deep?  Open the right-most 3 floodgates of the "2" group.  Open the "3" group to allow water in (or use a hatch above to preserve water).  Close "3" group to create a 3x1 room of enclosed water.  Open group "1" to let that flow into the main room, which will fill to 3/7.
This design will, in one go, create 3/17 water level, and, on repeat, eventually create 3/10 of water.
If R is the room area, F is the fill area and B is the bridge area (the "1" area in Girlinhat's design), then one cycle will fill an empty pool to the height F/(R+F+B), and repeated usage will eventually result in a height of F/(F+B). That last formula is the principle of my designs. The pond size doesn't matter in the resulting height, only in the fill speed.
Also, a non-empty pool will not produce weird results.
Logged