Back to all tutorials

Turbidity Current - CFD Simulation CFD Software Tutorial

1. Introduction

In this tutorial, we address the simulation of a 3-phase immiscible flow scenario. Following the opening of the gate, the mud starts moving within the water. We consider the air above the water to model real-world conditions of the water’s surface. Towards the conclusion, the simulation results are compared with experimental data.

2. 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

3. Create Case

Open SimFlow and create a new case named turbidity current

  1. Click New
  2. Provide name turbidity current
  3. Click Create to open a new case
simflow-launcher

4. Base Mesh

In this tutorial, we consider a 2D simulation where the base mesh defines the entire tank. To do this we will use the Plate type which lets us create rectangular grid.

  1. Go to Hex Meshing panel
  2. Switch to Base tab
  3. Select the Plate as a Base Mesh Type
  4. Set the size of the base mesh
    Min \({\sf [m]}\)00
    Max \({\sf [m]}\)4.30.2
  5. Define the number of divisions
    Division141066
Turbidity Current 02 Base mesh

5. Base Mesh Boundaries

We need to assign individual names to each side of the base mesh. This will allow us to apply different conditions to each side.

  1. Define boundary names accordingly
    X- left
    X+ right
    Y- bottom
    Y+ top
  2. Define boundary types accordingly
    X- wall
    X+ wall
    Y- wall
    Y+ patch
Turbidity Current 03 Base mesh Boundaries

6. Start Meshing

Everything is now set up for meshing.

  1. Go to Mesh tab
  2. Press the Mesh button to start meshing process
Turbidity Current 04 Meshing

7. Mesh

After the meshing process is finished the mesh will appear in the graphics window.

  1. Zoom in to the left side of the mesh - use the Scroll Wheel or drag mouse with RMB (right mouse button) pressed
Turbidity Current 04 Mesh 3

8. Refine Mesh - Bottom (I)

We will refine the mesh to improve spatial discretization in the near-wall region. It is important in the initial location of the fluid mud suspension. To increase near-wall mesh resolution we usually add a boundary layer during the meshing process. However, SimFlow allows modifying existing mesh as well. We can add a boundary layer to a selected boundary or we can split near-wall cells. The latter option is very handy when it is required to refine boundary layer cells in order to advise desired y+ value without remeshing whole domains. In this tutorial, we will demonstrate the usage of the splitting approach.

  1. Expand options list for bottom boundary
  2. Select Refine
Turbidity Current 05 Refine 1

9. Refine Mesh - Bottom (II)

Refine Wall Layer option will divide the first cell adjacent to the boundary into two cells.

  1. Select Refine Wall Layer
Turbidity Current 06 Refine 2

10. Refine Mesh - Left (I)

We will also refine the mesh for the left boundary in the same manner.

  1. Expand options list for left boundary
  2. Select Refine
Turbidity Current 07 Refine 3

11. Refine Mesh - Left (II)

  1. Select Refine Wall Layer
Turbidity Current 08 Refine 4

12. Examine Mesh

After the refining process is finished the mesh should appear in the graphics window. Use the scroll wheel in your mouse to zoom in the left bottom corner and examine the mesh refinement region.

  1. Zoom in to the bottom left corner of the mesh
Turbidity Current 09 Mesh check

13. Create Geometry - Mud

The initial mesh represents the entire tank. We need to specify where the mud suspension and water are initially located inside the domain. For this purpose, we need to create additional geometries.

  1. Go to Geometry panel
  2. Select Create Box
  3. Change geometry name from box_1 to mud
    (double click to edit name and press Enter to confirm)
  4. Set the origin and box dimensions
    Origin \({\sf [m]}\)00-0.05
    Dimensions \({\sf [m]}\)0.2450.150.1
Turbidity Current 10 Geometry Mud

14. Create Geometry - Water

The second box defines the water phase.

  1. Select Create Box
  2. Change geometry name from box_1 to water
  3. Set the origin and box dimensions
    Origin \({\sf [m]}\)0.2450-0.05
    Dimensions \({\sf [m]}\)4.0550.150.1
Turbidity Current 11 Geometry Water

15. Select Solver - Multiphase Inter

We want to analyze transient, incompressible flow with several isothermal and immiscible fluids. For this purpose, we will use the Multiphase Inter (multiphaseInterFoam) solver.

  1. Go to SETUP panel
  2. Filter the solvers by choosing Multiphase models
  3. Pick Multiphase Inter (multiphaseInterFoam) solver
  4. Select solver
Turbidity Current 12 Solver

16. Transport Properties - Phases

We need to define the properties for three phases: mud, water and air. To assign material to the domain, the phase fraction parameter \(\alpha_{phase}\) is used. The parameter determines the proportion of each fluid in the domain. The value of phase fraction varies in range from 0 to 1 where \(\alpha_{phase1}=1\) means that the whole domain is filled only with the phase1, while \(\alpha_{phase1}=0\) means that the domain is filled with the second phase.

  1. Go to Transport Properties panel
  2. Set the No. of Phases to 3
  3. Rename the phases respectively
    phase1 \(\rightarrow\) mud
    phase2 \(\rightarrow\) water
    phase3 \(\rightarrow\) air
  4. Set the Surface Tension [N/m] for each pair as follows
    mud - water0
    mud - air0.07
    water - air0.07
Turbidity Current 13 Transport Properties Phases

17. Transport Properties - Mud

  1. Select the mud from the Phases list
  2. Set the density \(\rho \; [kg/m^3] \) to 1045
  3. Change Transport Model to Herschel-Bulkley
  4. Set the parameters accordingly
    \(\nu_0\) \({\sf [m^2/s]}\)2.87e-05
    \(\tau_0\) \({\sf [m^2 / s^2]}\)0
    \(k\) \({\sf [m^2/s]}\)0.034
    \(n\) \({\sf [-]}\)0.52
Turbidity Current 14 Transport Properties Mud

18. Transport Properties - Water

  1. Select the water from the Phases list
  2. Click Material Database
  3. Select the water
  4. Click Apply
Turbidity Current 15 Transport Properties Water

19. Transport Properties - Air

  1. Select the air from the Phases list
  2. Click Material Database
  3. Select the air
  4. Click Apply
Turbidity Current 16 Transport Properties Air

20. Discretization - Convection

Change the velocity discretization to the Linear Upwind scheme to minimize numerical diffusion affecting the results of the simulation.

  1. Go to Discretization panel
  2. Switch to Convection tab
  3. Click on default scheme Upwind
  4. Select Linear Upwind
Turbidity Current 17 Discretization

21. Solution - Tolerance (I)

To improve the simulation accuracy and stability for linear solver we will lower the tolerance used for pressure and velocity and increase the number of correction loops.

  1. Go to Solution panel
  2. Expand solver parameters
  3. Change Tolerance to 1e-08
Turbidity Current 18 Solution p rogh

22. Solution - Tolerance (II)

Similarly, for the velocity field.

  1. Switch to U tab
  2. Expand solver parameters
  3. Change Tolerance to 1e-08
Turbidity Current 19 Solution u

23. Operating Conditions - Gravity

Now we will set the appropriate vector of gravitational acceleration pointing in the negative direction of the y-axis.

  1. Go to Operating Conditions panel
  2. Define gravitational acceleration along negative Y axis
    g \({\sf [m/s^2]}\)0-9.810
Turbidity Current 20 Operating Conditions Gravity

24. Boundary Conditions - Top

We will specify that air is the only phase flowing in or out of the domain across the top boundary.

  1. Go to Boundary Conditions panel
  2. Select top boundary
  3. Switch to Phases tab
  4. Set mass fraction of air
    \(\alpha_{air}\) Inlet Value \({\sf [-]}\)1
Turbidity Current 21 Boundary Conditions

25. Initial Conditions - Basic

Before we start simulation we need to define the initial state. Phase fraction \(\alpha_{air}\) tells us that the whole domain is filled with the air by default.

  1. Go to Initial Conditions panel
  2. Set air phase fraction \(\alpha_{air}\) to 1
Turbidity Current 22 Initial Conditions Basic

26. Initial Conditions - Patch Mud

Using the mud geometry, we will overwrite the phase fraction value inside it. We will set the \(\alpha_{mud}\) to 1 to fill the patched geometry with the mud suspension.

  1. Switch to Patch panel
  2. Enable initialization on mud geometry
  3. Expand the Fields list
  4. Select \(\alpha_{mud}\) fraction for initialization
  5. Select \(\alpha_{air}\) fraction for initialization
  6. Patch the form \(\alpha_{mud}\) with the value of 1
Turbidity Current 23 Initial Conditions Patch 1

27. Initial Conditions - Patch Water

Similarly, using the water geometry, we will overwrite the phase fraction value inside it. We will set the \(\alpha_{water}\) to 1 to fill the patched geometry with the water.

  1. Enable initialization on water geometry
  2. Expand the Fields list
  3. Select \(\alpha_{water}\) fraction for initialization
  4. Select \(\alpha_{air}\) fraction for initialization
  5. Patch the form \(\alpha_{water}\) with the value of 1
Turbidity Current 24 Initial Conditions Patch 2

28. Monitors - Create Slice

During calculation, we can observe intermediate results on a section plane. To add sampling data on a plane we need to define plane properties and also select fields that will be sampled. Note that runtime post-processing can only be defined before starting calculations and can not be changed later on.

  1. Go to Monitors panel
  2. Switch to Sampling tab
  3. Add new Slice
  4. Expand Fields menu.
  5. Choose \(\alpha_{mud}\), \(\alpha_{water}\), \(\alpha_{air}\) to be sampled on the section plane.
Turbidity Current 25 Monitors Slice

29. Run - Time Control

Before running computations adjust the time controls in order to capture appropriate time scales of the flow features.

  1. Go to RUN panel
  2. Set the Simulation Time [s] to 50
  3. Set the Time Stepping \(\Delta t\) [s] to 1e-03

This calculation will require high CPU usage and might take several hours to finish the calculation depending on the machine used. If you want to shorten the computation time, you can decrease the Simulation Time to 10s - this is enough for purpose of further postprocessing.

Turbidity Current 26 Run Time Control

30. Run - Output

We can control how often results should be saved on the hard drive. Only this data will be available for postprocessing. We will write the results in the interval of 0.1 seconds.

  1. Switch to Output tab
  2. Set the Interval [s] to 0.1
Turbidity Current 27 Run Output

31. Run - CPU

To speed up the calculation process, take advantage of parallel computing and increase the number of CPUs based on your PC’s capability. The free version allows you to use only one processor (serial mode). To get the full version, you can use the contact form to Request 30-day Trial

Estimated computation time for serial mode: over 5 hours

  1. Switch to CPU tab
  2. Click Run Simulation button
run cpu serial

32. Residuals

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

Turbidity Current 27 Residuals

33. Results - Slice (I)

Slices tab appears next to Residuals. Under this tab, we can preview results on the defined slice plane. The results preview is available during the calculation and we can track it on a regular basis. The newly calculated time step will be actualized automatically as long as the time selector points to the latest time step.
We would like to check the time when mud moves 1 meter from the initial position. For this purpose, we will use measurement tools and observe the movement of the mud.

  1. Switch to Slice tab
  2. Choose \(\alpha_{mud}\) field to display the mud phase
  3. Click Adjust range to data
  4. Set the XY orientation by clicking Viev XY
  5. Select Measure Distance from right panel
  6. Hold CTRL key and click the mesh at the lock gate to choose Start Point
  7. Hold CTRL key and click the mesh at a distance one meter from the lock gate to choose End Point
Turbidity Current 28 Results Slices 1

34. Results - Slice (II)

  1. Play with animation buttons to view the results of the analysis. Try to measure the time when the front of the current reaches a distance of 1 meter from the lock gate.
Turbidity Current 29 Results Slices 2

35. Final Results

Experimental data shows that the front of the current reaches a distance of 1m after 8.9s. It is slightly slower than the simulation results which is equal to 8.5s.

Turbidity Current 30 Results

36. Advanced Postprocessing with ParaView

This concludes the tutorial, covering all the aspects we intended to showcase. To create a finely tuned presentation of the results, you may take advantage of the seamless integration with ParaView. You can easily open simulation results in ParaView with a single click from SimFlow.

In ParaView, you can perform typical and advanced postprocessing tasks such as displaying streamlines, contour plots, vector fields, line or time plots, and calculating volume or surface integrals.

To familiarize yourself with the ParaView capabilities, it’s worth checking out our video tutorial, Paraview CFD Tutorial - Advanced Postprocessing in ParaView, in which we demonstrate some of the most commonly used post-processing techniques.