Tutorial: Multi-Phase Flow


Visualization of multiphase flow done with simscale
Multi-phase Flow Visualization

The tutorial project is a sample tank filling case setup. The channel is enclosed by walls on all sides with an open boundary for the top face. Initially there will be column of water in the fall area, while water enters from an Inlet and discharges into the column. The rest of the domain is filled with air as the base medium.

Create Simulation

As a first step, import the tutorial project into the SimScale workbench.

Import tutorial project into workbench

By importing the tutorial project, a new project will be created for you, and the ‘Workbench’ will open with the prepared tutorial geometry already loaded into the viewer.

Workbench view of Simscale for multiphase flow tutorial with simscale
Workbench View
  • To create a new simulation, click on the “+” button next to ‘Simulations’ in the tree or the “Create Simulation” button on the geometry panel.
Creating a simulation in SimScale
Creating a Simulation
  • Select the “Multiphase” analysis type and click “Create Simulation“.
Simulation List in SimScale
Simulation List
  • A new simulation tree containing all parameters and settings needed to define the conditions of the analysis will be created.
Simulation tree of Simscale
Simulation Tree
  • All setup steps that are completed are highlighted with a green check. Steps that require some user input are shown with a red circle. Steps that have a blue circle indicate optional settings.

Simulation Setup


Give an appropriate name to the simulation and apply a laminar turbulence model. Example: Multiphase

Naming the Simulation in SimScale
Naming the Simulation


The geometry is automatically assigned to the simulation

Assigned Geometry for multiphase flow simulation in simscale
Assigned Geometry

Geometry Primitive

We will create a geometry primitive to define the initial distribution between water and air in the geometry.

  • In the top right of the workbench, there will be a “Geometry” box which has a “Geometry primitives” section.
Geometry Dialog Box
Geometry Dialog Box
  • Select “Cartesian box” as our geometry primitives. A dialog box will pop up and ask for the minimum and maximum values for the box.
Cartesian Box Dialog Box in Simscale
Cartesian Box Dialog Box
  • After assigning the values, confirm the operation.


A gravity model will assigned in the vertical direction.

  • Select “Model” in the simulation tree and assign the value of gravity in the vertical direction (\(g_z\)).
  • The value of Surface tension may also be assigned, in this case the default value between air and water will suffice.
Model Interface in SimScale
Model Interface


Since the simulation consists of two phases, two materials, water and air, will be assigned to the simulation.

  • First, air will be assigned for the simulation.
Material List in Simscale
Material List
  • The next step will be to select water as our second material. This will be the same step as above.
  • Next, a phase will be assigned for each material. Air will be assigned as “phase 0” and water will be “phase 1“.
  • We will assign each material to the whole domain.
Phase Assignment in Simscale
Phase Assignment
  • The above step will be repeated for water.
  • After applying all the materials and phases, confirm the operation.

Initial Conditions

A subdomain for the phase fraction initial condition will be assigned. This will be used to define where water will be at the initial state.

  • Choose the “Initial Conditions” in the simulation tree.
  • Choose “Phase fractions
  • Add “Subdomains
  • Assign water as the phase of the subdomain
  • Assign the cartesian box created before as the subdomain.
Subdomain Interface in simscale
Subdomain Interface

Boundary Conditions

This simulation will use three boundary condition. An inlet to define where the water comes in, an atmospheric layer to define where the atmosphere starts, and a slip wall for the other parts of the geometry.


  • Select “Velocity inlet” as the first boundary condition.
Boundary Conditions Dialog Box in SimScale
Boundary Conditions Dialog Box
  • Assign a velocity for the fluid at the inlet in the x direction (\(U_x\)).
  • Assign a fluid for the inlet, in this case water will be assigned (“Value“= 1)
  • Assign the face for the inlet.
Velocity Inlet Boundary Condition in SimScale
Velocity Inlet


  • Next, a custom boundary condition will be defined for the atmosphere.
  • Select “Custom” from the boundary conditions list.
  • Define the velocity as “Pressure inlet-outlet
  • Define the modified pressure as “Total Pressure
  • Define the phase fraction as “Inlet-outlet
  • Assign the inlet value as “0
  • Assign the face for where this boundary condition will be, assign the top of the domain.
Atmosphere Boundary Condition for multiphase flow tutorial
Atmosphere Boundary Condition

No-Slip Wall

A no-slip wall boundary condition will be created for the other walls. This does not have to be manually set as SimScale automatically detects all


The tree item Numerics allows us the control the solving mechanism in detail, where default values are left as such for this case

Simulation Control

The next important tree item is Simulation Control which allows to steer the overall simulation settings. For example, the end time of the simulation and the size of the template. In this tutorial, we will leave everything as it is.

Mesh Setup

  • For this tutorial, the default mesh settings will be modified so the simulation will produce reasonable results
Mesh Settings in SimScale
Mesh Settings
  • A refinement for the domain will be defined by using a “Region refinement“.
Mesh Refinement Settings in SimScale
Mesh Refinement Settings
  • In this simulation, the maximum edge length will be 0.05 m and will be assigned to the whole volume
Region Refinement  settings in SimScale
Region Refinement
  • Confirm the refinement

Geometry Primitive

A geometry primitive will be defined for the volume. A cartesian box will be used as the geometry primitive.

  • Select the “Geometry primitives” under the mesh in the simulation tree and select “Cartesian box” as the geometry primitive.
Geometry Primitive in SimScale
Geometry Primitive
  • Set the minimum and maximum values as in the picture below.
Geometry Primitive  in SimScale
Geometry Primitive Settings
  • Confirm the operation
  • Go back to the main menu of the mesh settings and generate the mesh.
  • After the mesh operation has finished, the mesh immediately appears in the viewer and mesh elements that have been created

Start Simulation

Now the simulation setup is complete and you’re ready to start your simulation. To begin the simulation, a simulation Run needs to be created. A simulation Run creates a snapshot of the current setup and tries to compute the results based on the snapshot settings.

  • To create a new Run, click “+” next to Simulation Runs. Name your simulation and click on “Start“.
Creating a New Simulation Run in SimScale
Creating a New Simulation Run
  Starting a New Simulation Run
Starting a New Simulation Run


Computation of the results can take up to a few hours. You’ll be informed via email once your simulation run is finished. Once finished, you’re ready to analyze the results.

  • Next we will visualize the results of the simulation we just completed
  • Click on the Post-process Results button to load the results on the viewer
How to Open Post-processor in SimScale
How to Open Post-processor
  • For example, the distribution of the phases for each timestep can be visualized.
SimScale Post-processor
SimScale Post-processor
  • We can use further post-processing filters to generate a different visualization of the connecting rod according to the computed displacement field
  • A list of all the available filters can be seen on the left side.


In order to view the phases clearly, an isosurface on the domain can be enabled and this can be done by clicking the isosurface option in the post-processor and choosing the alpha.phase1 in the Iso scalar and the Map scalar box.

Post processing options in simscale
Post Processing Options

To visualize the flow correctly, the isovolume settings should be configured as such:

  • Min iso value: 0.5
  • Max iso value: 1
  • Iso scalar: alpha.phase1 [node]
  • Map scalar: Z velocity [node]

It should be considered that there are special values of the phase:

  • 0.5 : free surface of water
  • 0.1 – 1 : water
 Isovolume Visualization in simscale
Isovolume Visualization

Congratulations! This concludes this multiphase flow tutorial.

Data Privacy