Dam Break


1. Create Case

After opening SimFlow, we will now create a new case dam_break

1. Go to New panel
2. Provide chosen name dam_break
3. Click Create Case

2. Import Geometry

Firstly we need to Download Geometry: dam.stl

1. Click Import Geometry
2. Select geometry file dam.stl
3. Click Open

3. Geometry

After importing geometry, it will appear in the 3D panel.

1. Click Fit View to zoom the geometry

4. Enable Geometry Meshing

Now we need to enable meshing for the newly imported geometry.

1. Go to Hex Meshing panel
2. Enable meshing on the dam geometry

5. Base Mesh

Now we are going to define the computational domain in the Base Mesh panel.

1. Go to Base tab
2. Define initial mesh extends

Min[m] -20 0 0
Max[m] 30 30 20

3. Define mesh division

Division 70 45 30

6. Base Mesh Boundaries

To be able to define different conditions on each boundary of the domain we need to assign an individual name to each side of the base mesh.

1, 2, 3. Define boundary names accordingly

X- inlet
X+ outlet
Y- sides
Y+ sides
Z- bottom
Z+ top

4. Define boundary types accordingly

Z- wall

7. Material Point

We need to tell the meshing algorithm where the mesh should be retained.

1. Go to Point tab
2. Set coordinates of the material point

Material Point 5 15 5

8. Start Meshing

In this step, we will start the meshing process.

1. Go to Mesh tab
2. Press Mesh button to start meshing process

9. Mesh

After meshing process is finished the mesh will be loaded and displayed. To show what is inside of mesh, we can zoom in, or hide other meshes.

1. Click Graphic Object List
2. Select Mesh to show meshes list

10. Mesh - Toggle Visibility

You can toggle the visibility of different objects to examine desired ones.

1. Hide top boundary to look inside the mesh

11. Setup Solver

To analyze water flow over a dam we will use Inter (interFoam) solver. This solver is able to model two-phase flow with a free surface.

1. Go to Setup panel
2. Select Multiphase filter
3. Pick Inter (interFoam)
4. Select solver

12. Boundary Conditions - Inlet (Flow)

At the inlet, we will apply a constant water flow rate in order to simulate water supplied by a river.

1. Go to Boundary Conditions panel
2. Select inlet boundary
3, 4, 5. Set the following parameters accordingly

p-ρgh Fixed Flux Pressure

U Variable Height Inlet
Flow Rate [m3/s] 250

13. Boundary Conditions - Inlet (Phases)

We will modify the default phase fraction boundary condition to properly interact with velocity boundary condition.

1. Go to Phases tab
2. Select the following boundary condition accordingly

phase1 Zero Gradient

14. Boundary Conditions - Outlet (Flow)

On the outlet we want the water to freely flow out of the domain.

1. Select outlet boundary
2. Go to Flow tab
3, 4. Set the following boundary conditions accordingly

p-ρgh Fixed Flux Pressure
U Inlet-Outlet

15. Boundary Conditions - Sides (Flow)

We want sides to be impermeable but did not provide any friction.

1. Select sides boundary
2, 3. Set the following boundary conditions accordingly

p-ρgh Zero Gradient
U Slip

16. Boundary Conditions - Sides (Phases)

1. Go to Phases tab
2. Set the following boundary condition accordingly

phase1 Zero Gradient

17. Geometry for Initialization

As an initial state, we want some water to already be behind the dam. For this purpose, we need to create geometry defining the initial location of water.

1. Go to Geometry panel
2. Create Box geometry
3. Change name to water_init
4. Define parameters accordingly

Origin[m] -20 0 0
Dimensions[m] 20 30 9

18. Geometry - Water Initialization

The gray box behind the broken dam geometry indicates the water we have created for the initialization part

1. Exit edit mode and Deselect the geometry using buttons or by clicking Esc to have a proper view of the geometry

19. Initialization

We will use the water_init geometry to select the region where water phase fraction should be applied.

1. Go to Initial Conditions panel
2. Switch to Patch tab
3. Enable initialization on water_init
4. Expand Fields list
5. Select phase1 fraction for initialization
6. Set initial value of phase1 to 1

20. Slice Monitor (I)

Usually, we do data postprocessing when the computation is finished. However, it is handy to be able to see a preview of the results during the calculation. To do this, we need to use the Monitors panel where we might sample data in a specified point or section plane. In this tutorial, we will add a section plane, going through the center of our mesh.

1. Go to Monitors panel
2. Select Sampling tab
3. Click on Create Slice button to enable sampling data on a section plane
4. Set slice parameters accordingly

Normal to 0 -1 0
Point to 8 15 15.5

21. Slice Monitor (II)

Finally, we need to choose which data should be sampled on the section plane.

1. Expand available Fields list
2. Select U αphase1 and ρ

22. Slice Monitor (III)

After exiting Edit Mode, we will be able to see a preview of the mesh section plane in the graphics panel.

1. Click Exit Edit Mode to have a proper view of the geometry and slice

23. Time Controls

For multiphase simulations, we usually want the solver to automatically determine the proper time step. This should lead to good stability and reduce simulation time.

1. Go to Run panel
2. Specify simulation duration to 60 seconds
3. Change Time Stepping to Automatic
4. Set initial time step Initial Δt [s] to 1e-2
(solver will start computation with this value and adjust it in the next iterations)

In some situations, it might be necessary to use smaller time step values than the one provided by default configuration. To force solver reducing it you need to change the Max Co [-] (Courant Number). This property is used by the solver to automatically estimate the desired time step value.

24. Write Control & Run

Before we will start computations we will specify interval for writing data.

1. Go to Output tab
2. Set Write Control Interval [s] to 0.5 seconds
(The results will be written to the hard drive every 0.5 seconds of simulation time)
3. Click Run Simulation button

25. Preview Results on Slice

When the calculation is started SimFlow will automatically open the Residual plots tab. When data is written to the disk for the first time new tab Slices will appear next to Residuals. Under this tab, we can preview results on the defined slice plane.

1. Go to Slices tab
2. Select alpha.phase1 to display the location of the water phase

alpha.phase1 equal to 1 indicate water phase
alpha.phase1 equal to 0 indicate air phase

3. Click Adjust range to data

26. Start Postprocessing - ParaView

When the computations are finished start the ParaView software.

1. Go to Postprocessing panel
2. Start ParaView

You might also start ParaView when the simulation is still in progress to observe intermediate results

27. ParaView - Load Results

After opening the ParaView, we have to load the results of the simulation from SimFlow.

1. Select your case
2. Click Apply button to load results into ParaView

28. ParaView - Create Clip (I)

We want to show how the water surface looks like. Additionally, we want the water surface to be colored based on the local velocity to better understand the flow behavior. In the first step, we will create a Clip.

1. Make sure your case is selected Dam_Break
2. Create Clip

29. ParaView - Create Clip (II)

After creating clip

1. Make sure that Clip is selected
2. Set Clip Type to Scalar
3. Set Scalars to alpha.phase1
4. Define water surface threshold Value to 0.2
5. Make sure that Invert option is unchecked
6. Apply changes

30. ParaView - Coloring

After the clip is created we can color water surface with velocity and choose color scale preset. While being still in the Properties panel.

1. Select U (velocity) field
2. Click Choose Preset button, a new window will appear (next step)

31. ParaView - Choose Preset

We can now select Color Preset of your choosing.

1. Choose the jet preset.
2. Apply changes
3. Close Choose Preset window

32. ParaView - Adjust Data Range and Play

1. Change visible time step to Last Frame
2. Fit colors range by clicking Rescale to Data Range
3. Move to the First Frame
3. Click Play to show simulation results

33. ParaView - Results

After correctly defining configuration you should be able to see similar results in the graphics 3D view.

34. ParaView - Add Opacity

We can also add opacity attribute to surface colors.

1. Click Edit if you do not see the Color Map Editor panel
2. Select Enable opacity mapping for surfaces
3. Select Use log scale when mapping data to opacity

35. ParaView - Results with Opacity

This website uses cookies to offer you the best experience online. By continuing to use our website, you agree to the use of cookies.