1. Download SimFlow
SimFlow is a general purpose CFD Software
To follow this tutorial, you will need SimFlow free version, you may download it via the following link:
Download SimFlow
2. Create Case
Open SimFlow and create a new case named dam_break
Go to New panel
Provide name dam_break
Click Create Case

3. Import Geometry
4. Imported Geometry Units
The STL geometry format does not store the unit in which the geometry was created. Geometry size shows the overall size of the model in each direction, which is helpful for unit selection. In our case, the default unit meter is correct.
To confirm default unit meter, press OK

5. Geometry - Dam
After importing geometry, it will appear in the 3D panel.
Click Fit View to zoom the geometry

6. Enable Geometry Meshing
Now we need to enable meshing for the newly imported geometry.
Go to Hex Meshing panel
Enable meshing on the dam geometry

7. Base Mesh
Now we are going to define the computational domain in the Base Mesh panel.
Go to Base tab
Define initial mesh extends
Min \({\sf [m]}\)-2000
Max \({\sf [m]}\)303020Define mesh division
Division704530

8. 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.
Define boundary names accordingly
X- inlet
X+ outlet
Y- sides
Y+ sides
Z- bottom
Z+ topChange boundary type
Z- wall

9. Material Point
We need to tell the meshing algorithm where the mesh should be retained.
Go to Point tab
Set coordinates of the material point
Material Point10155

10. Start Meshing
Everything is now set up for meshing
Go to Mesh tab
Press Mesh button to start meshing process

11. 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.
Click Graphic Object List
Select Mesh to show meshes list

12. Mesh - Toggle Visibility
You can toggle the visibility of different objects to examine desired ones.
Hide top boundary to look inside the mesh

13. Setup Solver - Inter
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.
Go to Setup panel
Select Multiphase filter
Pick Inter (interFoam)
Select solver

14. Boundary Conditions - Inlet (Flow)
At the inlet, we will apply a constant water flow rate in order to simulate water supplied by a river.
Go to Boundary Conditions panel
Select inlet boundary
Set the Mass Flow Inlet character
Set the mass flow rate
U Flow Rate \({\sf [m^3/s]}\)250

15. Boundary Conditions - Inlet (Phases)
We will modify the default phase fraction boundary condition to properly interact with the velocity boundary condition.
Go to Phases tab
Select the following boundary condition accordingly
\(\alpha_{phase1}\) TypeZero Gradient

16. Boundary Conditions - Outlet (Flow)
On the outlet we want the water to freely flow out of the domain.
Select outlet boundary
Go to Flow tab
4 Set the following boundary conditions accordingly
\(p- \rho gh\) TypeFixed Flux Pressure
\(U\) TypeInlet-Outlet

17. Boundary Conditions - Sides (Flow)
We want sides to be impermeable but did not provide any friction.
Select sides boundary
3 Set the following boundary conditions accordingly
\(p- \rho gh\) TypeZero Gradient
\(U\) TypeSlip

18. Boundary Conditions - Sides (Phases)
Go to Phases tab
Set the following boundary condition accordingly
\(\alpha_{phase1}\) TypeZero Gradient

19. 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.
Go to Geometry panel
Create Box geometry
Change name to water_init
Define parameters accordingly
Origin \({\sf [m]}\)-2000
Dimensions \({\sf [m]}\)20309

20. Geometry - Water Initialization
The gray box behind the broken dam geometry indicates the water we have created for the initialization part
Exit edit mode and Deselect the geometry using buttons or by clicking Esc to have a proper view of the geometry

21. Initialization
We will use the water_init geometry to select the region where water phase fraction should be applied.
Go to Initial Conditions panel
Switch to Patch tab
Enable initialization on water_init
Expand Fields list
Select \(\alpha_{phase1}\) fraction for initialization
Set initial value of \(\alpha_{phase1}\) to 1

22. 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.
Go to Monitors panel
Select Sampling tab
Click on Create Slice button to enable sampling data on a section plane
Set slice parameters accordingly
Normal \({\sf [-]}\)0-10
Point \({\sf [m]}\)81515.5

23. Slice Monitor (II)
Finally, we need to choose which data should be sampled on the section plane.
Expand available Fields list
Select \(U\), \(\alpha_{phase1}\) and \(\rho\)

24. 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.
Go to Run panel
Specify simulation duration to 60 seconds
Change Time Stepping to Automatic
Set initial time step Initial \(\Delta t [s]\) to 1e-02
(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.

25. Run - Write Control
Before we will start computations we will specify intervals for writing data.
Go to Output tab
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)

26. Run - CPU
To speed up the calculation process increase the number of CPUs basing on your PC capability. The free version allows you to use only 2 processors in parallel mode. To get the full version, you can use the contact form to Request 30-day Trial
Estimated computation time for 2 processors: 20 minutes
Switch to CPU tab
Use parallel mode
Increase the Number of processors
Click Run Simulation button

27. Residuals
When the calculation is finished we should see a similar residual plot.

28. Preview Results on Slice
When the calculation is started SimFlow will automatically open the Residuals 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.
Go to Slices tab
Set the XZ orientation View XZ
Click Fit View
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 phaseClick Adjust range to data
Play with animation buttons to view the results of the analysis

29. Postprocessing - ParaView
When the computations are finished start the ParaView software.
Go to Postprocessing panel
Start ParaView
You might also start ParaView when the simulation is still in progress to observe intermediate results

30. ParaView - Load Results
After opening the ParaView, we have to load the results of the simulation from SimFlow.
Select your case
Click Apply button to load results into ParaView

31. ParaView - Create Clip
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.
Make sure your case is selected dam_break
Create Clip
Set Clip Type to Scalar
Set Scalars to alpha.phase1
Define water surface threshold Value to 0.2
Make sure that Invert option is unchecked
Apply changes

32. 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.
Select U (velocity) field
Click Choose Preset button, a new window will appear (next step)

33. ParaView - Choose Preset
We can now select Color Preset of your choosing.
Choose the jet preset.
Apply changes
Close Choose Preset window

34. ParaView - Adjust Data Range and Play
Change visible time step to Last Frame
Fit colors range by clicking Rescale to Data Range
Move to the First Frame
Click Play to show simulation results

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

36. ParaView - Add Opacity
We can also add an opacity attribute to surface colors.
Select Clip
Click Edit if you do not see the Color Map Editor panel
Check Enable opacity mapping for surfaces
Check Use log scale when mapping data to opacity

37. ParaView - Results with Opacity
