EasyFOAMtutorials

Tutorial 9 of 19

Lifting sluice gate

A shape that moves during the run: a gate lifts and the water behind it runs out underneath.

about 20 minIntermediateFree surfaceHydraulic structuresMoving shapes

Gates and valves change the flow by moving. In EasyFOAM any solid shape can be given a motion: it can move to a new position over a set time, swing back and forth, or float. The mesh stretches to follow the shape while the run goes on.

Here a sluice gate holds back water 0.5 m deep, with a 0.1 m gap under it. A tenth of a second into the run the gate starts to lift, and half a second later the gap has doubled.

What you will learn

  • give a shape a motion: how far, from when, for how long
  • follow the motion while the run goes on
  • know what a stretching mesh can and cannot do

Computer time: a few seconds for the mesh and about a minute for the run, on two cores.

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 Lifting sluice gate.
Lifting sluice gate, 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 gate.
  2. Click Create project.
Lifting sluice gate, step 2: Name the project

3The gate and its motion

The gate is a box 0.1 m thick whose lower edge is 0.1 m above the bed. At the bottom of its settings is Motion. Moves to a new position asks for three things: how far the shape ends up from where it is drawn, when it starts, and how long the move takes. It moves at a steady speed in between.

  1. The shape gate. The list notes that it moves.
  2. The lower edge of the gate is at z = 0.1 m.
  3. Motion: Moves to a new position.
  4. Moves by: 0, 0, 0.1, so 0.1 m straight up.
  5. Starts at 0.1 s and Takes 0.5 s.
Lifting sluice gate, step 3: The gate and its motion

4The channel

The channel is 3 m long and 1 m high, modelled as a slice two cells thick. Both ends are closed walls, the top is open to the air.

  1. Corner (max): 3, 0.1, 1.
  2. Cells: 60, 2, 20, which makes 5 cm cubes.
  3. bed is a wall and atmosphere an opening.
  4. Click Mesh in the toolbar (or press F5).
Lifting sluice gate, step 4: The channel

5Water behind the gate

The flow type is Free surface: water and air; a shape can only move in a run in time, and all free-surface runs are. Scroll down to Water and air: the water starts on the upstream side only, one box from the end wall to the face of the gate, 0.5 m deep.

  1. One box of water: from 0, 0, 0 to 1.5, 0.1, 0.5.
Lifting sluice gate, step 5: Water behind the gate

6Run for two seconds

Nothing is special about the run settings: a moving shape needs no extra choices here.

  1. End time: 2 s.
  2. Save every: 0.1 s.
  3. Processor cores: 2.
  4. Click Run in the toolbar (or press F6).
Lifting sluice gate, step 6: Run for two seconds

7Follow the gate

The Motion tab plots how far each moving shape has travelled. The gate waits for a tenth of a second, rises steadily, and stops 0.1 m higher.

  1. Open the Motion tab.
  2. Where the gate is now.
Lifting sluice gate, step 7: Follow the gate

8The water runs out

In the Results step, look at the moment just after the gate has stopped, at 0.7 s. The water is shooting through the gap, twice as high now as at the start, and running down the channel. Step through the saved times and you can see the gate itself rise in the 3D view.

  1. Saved time: 0.7.
  2. Show: Water surface, coloured by U, the speed.
Lifting sluice gate, step 8: The water runs out

9What a moving mesh can and cannot do

The mesh is not rebuilt when a shape moves. The cells around the shape are stretched and squeezed to follow it, and their number stays the same. That is quick and robust, but it sets limits:

  • Keep a movement well below the gap between the shape and the nearest wall.
  • A gate can open further or close part of the way. It cannot shut completely, because the cells under it would be squeezed to nothing. Leave a small gap.
  • Moving shapes cannot be combined with mesh refinement at the water surface.

10Try it yourself

  • Lift the gate more slowly (Takes 1.5 s) and compare the surge downstream.
  • Lower it instead: Moves by 0, 0, -0.05 halves the gap.
  • Choose Swings back and forth with an amplitude of 0.05, 0, 0 and a period of 1 s to turn the gate into a wave paddle.