EasyFOAMtutorials

Tutorial 5 of 19

Dam break

Water and air with a free surface: a column of water collapses in a tank.

about 20 minBeginnerFree surface

Rivers, spillways, tanks and waves all have a free surface: water below, air above, and a boundary between them that moves. EasyFOAM follows it by storing, for every cell, the share of the cell that is full of water (a number between 0 and 1 called alpha.water).

The dam break is the simplest such case. A column of water stands in one corner of a tank; at time zero the invisible dam holding it disappears. The tank is a thin slice, one cell thick, so the run is quick.

What you will learn

  • choose the free-surface flow type
  • say where the water is at the start
  • leave the top of the tank open to the air
  • run in time, with a time step that adjusts itself, and step through the saved moments

Computer time: a few seconds for the mesh and about a minute for the run.

1Open the example

Start EasyFOAM. This case is one of the examples on the start page: it comes with every setting filled in, and this tutorial walks through each of them so that you understand the case and could build it yourself.

  1. Click Dam break.
Dam break, step 1: Open the example

2Name the project

The project is an ordinary folder that EasyFOAM creates for you.

  1. Type a name, for example dambreak.
  2. Click Create project.
Dam break, step 2: Name the project

3A tank with an open top

There are no shapes, so go straight to the Mesh step. The tank is 0.584 m wide and high and one cell (14.6 mm) thick. Look at the names of the faces: three of them are walls, the top is atmosphere, and the front and back are empty because nothing happens through the thickness.

  1. Corner (max): 0.584, 0.0146, 0.584.
  2. Cells: 46, 1, 46.
  3. zMax, the top, is named atmosphere and has the type patch: an opening.
  4. yMin and yMax are empty.
  5. Click Mesh in the toolbar (or press F5).
Dam break, step 3: A tank with an open top

4Water and air

In the Physics step the flow type is what makes this a free-surface case. Once it is chosen, the fluid you pick is the water, and a new group of settings for the air and the water's starting position appears below.

  1. Flow type: Free surface: water and air.
  2. Turbulence: Laminar is enough for this short, violent event.
  3. Fluid: Water.
Dam break, step 4: Water and air

5Where the water starts

Scroll down to Water and air. Gravity points down the z axis. The table lists boxes that are full of water at the start; everything else is air. Here there is one box: the column, 0.146 m wide and 0.292 m high, in the corner.

  1. Gravity: 0, 0, -9.81.
  2. One box of water: from 0, 0, 0 to 0.1461, 0.0146, 0.292.
Dam break, step 5: Where the water starts

6The open top

The top of the tank must let air in and out as the water moves, without holding the water in. That is what Open to the atmosphere does. EasyFOAM chose it by itself because of the name.

  1. Select atmosphere.
  2. Condition: Open to the atmosphere.
Dam break, step 6: The open top

7Running in time

This is a transient run: it marches forward in small time steps. You choose how long to simulate and how often to save. The time step looks after itself: EasyFOAM shortens it when the water moves fast, so that nothing crosses more than a cell in one step (that is what the Courant number measures).

  1. End time: 1 s.
  2. Time step: 0.001 s to start with.
  3. Keep the Courant number below 0.8: leave it ticked.
  4. Save every: 0.05 s, which gives 20 saved moments.
  5. Click Run in the toolbar (or press F6).
Dam break, step 7: Running in time

8The run

This small case takes only a few seconds. While a run goes on, the line at the bottom of the window shows how far it is and how much of the tank is filled with water. That share should stay the same from start to end: a quick check that no water is lost.

  1. In a run in time the residuals do not fall to zero; they stay at a steady, low level.
  2. The Run step shows that the run reached the end time.
Dam break, step 8: The run

9The collapse

When the run ends, look at alpha.water on a slice: red is water, blue is air. At 0.2 s the column has slumped and a tongue of water is racing along the floor.

  1. Saved time: 0.2.
  2. Quantity: alpha.water.
  3. Show: Slice through the flow.
  4. Slice plane: Normal to y.
Dam break, step 9: The collapse

10The splash

Step through the saved times. By 0.5 s the water has hit the far wall, climbed it and is falling back on itself.

  1. Saved time: 0.5. Use the arrow keys to step through the others.
Dam break, step 10: The splash

11Try it yourself

  • Use 92, 1, 92 cells: the water surface becomes sharper and the splash shows more detail.
  • In the Physics step choose Free surface, sharper interface as the flow type and compare.
  • Make the column taller, or add a second box of water on the other side.
  • Click Open in ParaView and press play to watch the collapse as a film.