# Sloshing Tank - CFD Simulation

Source: https://help.sim-flow.com/tutorials/sloshing-tank
Last updated: 2026-10-14

[Video](https://help.sim-flow.com/tutorials/images/sloshing-tank.mp4)

## 1. Introduction

In this tutorial, we will explore the phenomenon of water sloshing inside a cistern during braking. This occurs due to the inertial force that pushes the water. We will conduct two analyses: the first one will involve studying the tank without any support structure, while the second one will involve analyzing the tank with internal baffles. You will learn how to simulate rigid body motion and model an internal 2D wall within the mesh. Finally, we will compare the forces acting on the cistern for both cases and plot them on one chart.

## 2. Download SimFlow

SimFlow is a general-purpose [CFD Software](https://sim-flow.com/download/cfd-simulation-software/)

To follow this tutorial, you will need the SimFlow free version. You may download it via the following link:
[Download SimFlow](https://sim-flow.com/download-simflow/)

## 3. Create Case

Open SimFlow and create a new case named *sloshing tank no baffles*

1. Click **New**
2. Provide name `sloshing tank no baffles`
3. Click **Create** to open a new case

![simflow-launcher](https://help.sim-flow.com/tutorials/images/launcher-sloshing_tank_no_baffles.png)

## 4. Import Geometry - Tank

Firstly, we need to Download Geometries[Baffle_1](https://help.sim-flow.com/tutorials/downloads/sloshing-tank/baffle_1.stl)[Baffle_2](https://help.sim-flow.com/tutorials/downloads/sloshing-tank/baffle_2.stl)[Tank](https://help.sim-flow.com/tutorials/downloads/sloshing-tank/tank.stl)

Although the baffles are not involved in the first simulation, we will import them at this stage. We can omit them when creating the first mesh and include them in the second simulation.

1. Click **Import Geometry**
2. Select geometry files: *baffle_1.stl* *baffle_2.stl* *tank.stl*
3. Click **Open**

![Sloshing Tank 02 Import geometry](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_02_Import_geometry.png)

## 5. Imported Geometry Units

The STL format does not contain the unit information which is defined during the geometry export. Therefore, you must manually specify the correct unit after import. If we do not know the exported unit, we can estimate it based on the total size of the model. The size is displayed next to the *Geometry size* label. In our case, the default unit meter is correct.

1. To confirm default unit *meter*, press **OK**

![Sloshing Tank 02 unit](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_02_unit.png)

## 6. Display Geometry

Inside the tank, there are two baffles. To view the baffles, we will reduce the tank opacity.

1. Click **Fit View** and orient the model using mouse buttons
2. Hold the *Ctrl* key and select the *tank* geometry by clicking on it with the left mouse button. The selected geometry will be highlighted in red
3. Click *Change Object Display Properties* button
4. Switch the tab to *Opacity*
5. Set the opacity to `40%`
6. Approve by clicking **OK**
7. Press `Esc` or click the **X** button to exit selection mode

![Sloshing Tank 03 Geometry check](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_03_Geometry_check.png)

## 7. Split Geometry - Tank (I)

The imported geometry is made up of a single surface. We need to split it into multiple faces for further processing.

1. Extend *Options* list next to the *tank* geometry
2. Select *Split*

![Sloshing Tank 04 Geometry Split](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_04_Geometry_Split.png)

## 8. Split Geometry - Tank (II)

1. Select **Split**

![Sloshing Tank 05 Geometry Split 2](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_05_Geometry_Split_2.png)

## 9. Extract Geometry - Tank (I)

To make sharp edges visible, we will use the *Extract Features* operation. These edges will indicate additional mesh refinement regions.

1. Extend *Options* list next to the *tank* geometry
2. Select *Extract Features*

![Sloshing Tank 06 Geometry Features 1](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_06_Geometry_Features_1.png)

## 10. Extract Geometry - Tank (II)

1. Select **Extract**

![Sloshing Tank 07 Geometry Features 2](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_07_Geometry_Features_2.png)

## 11. Meshing Parameters - Tank

In order to create the mesh, we need to specify geometry options used during the meshing. In this tutorial, we will analyze two configurations: with and without baffles. We will start with the tank itself and skip baffles for now.

1. Go to *Hex Meshing* panel
2. Select *tank*
3. Enable *Mesh Geometry*
4. Set *Refinement* to *Min 1* *Max 1*

![Sloshing Tank 08 Hex Meshing](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_08_Hex_Meshing.png)

## 12. Base Mesh

Now we will define the base mesh. The box geometry determines the background mesh.

1. Go to *Base* tab
2. Click on **Autosize**
3. Define the number of divisions
   `Division``106``25``26`

![Sloshing Tank 09 Base Mesh](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_09_Base_Mesh.png)

## 13. Material Point

Material Point indicates to the meshing algorithm on which side of the geometry the mesh is to be retained. Since we are considering fluid inside the tank, we need to place the material point inside the geometry.

1. Go to *Point* tab
2. Specify location inside tank geometry
   `Material Point``4``0``2`

You can specify the point location from the 3D view. Hold the `CTRL` key and drag the arrows to the destination.

![Sloshing Tank 10 Material Point](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_10_Material_Point.png)

## 14. Start Meshing

Everything is now configured and ready to be meshed.

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

![Sloshing Tank 11 Meshing](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_11_Meshing.png)

## 15. Examine Mesh

After the meshing is finished, the mesh will appear in the graphics window. The mesh should consist of only a single boundary.

1. Click **Fit View**

![Sloshing Tank 12 Mesh check](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_12_Mesh_check.png)

## 16. Simulation Type

We want to analyze water sloshing in a tank. For this purpose, we will use a transient simulation of two immiscible fluids (water and air) using the free-surface method.

![Simulation Panel](https://help.sim-flow.com/assets/images/go-to-simulation-panel@2x.png)

![Step 1](https://help.sim-flow.com/assets/images/solvers-selection/interFoam/01_multiphase@2x.png)

![Step 2](https://help.sim-flow.com/assets/images/solvers-selection/interFoam/02_free_surface@2x.png)

![Step 3](https://help.sim-flow.com/assets/images/solvers-selection/interFoam/03_immiscible@2x.png)

![Step 4](https://help.sim-flow.com/assets/images/solvers-selection/interFoam/04_2_fluids@2x.png)

![Step 5](https://help.sim-flow.com/assets/images/solvers-selection/interFoam/05_apply@2x.png)

## 17. Dynamic Mesh

To model tank deceleration, we will use a dynamic mesh feature. The dynamic mesh allows transforming the mesh by moving its nodes. There are several types of mesh deformation available. In this tutorial, we will use the *Rigid* type to model mesh translation as a whole.

The external file *displacement.dat* stores the motion data that we will import to SimFlow. The data describes deceleration from the initial velocity *11.853 m/s* to *0 m/s* within *5 s* .

[Download Filedisplacement.dat](https://help.sim-flow.com/tutorials/downloads/sloshing-tank/displacement.dat)

1. Go to *Dynamic Mesh* panel
2. Select *Rigid* as a *Dynamic Mesh Type*
3. Extend the motion list and select *Tabulated*
4. Indicate the path to the file *displacement.dat*

![Sloshing Tank 14 Dynamic Mesh](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_14_Dynamic_Mesh.png)

## 18. Turbulence

In the turbulence panel, enable turbulence modeling and select Reynolds Averaged Navier-Stokes (RANS). For the purpose of this tutorial, we will model the turbulence phenomenon using the *\(k{-} \varepsilon\)* model.

1. Go to *Turbulence* panel
2. Set the *RANS* turbulence formulation

![Sloshing Tank 15 Turbulence](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_15_Turbulence.png)

## 19. Transport Properties - Water

In order to define water and air, we need to go to the transport properties panel and use predefined fluid properties from the material database.

1. Go to `Transport Properties` panel
2. Change phase name from `phase1` to `water`
3. Open **Material Database**
4. Pick up `water` from the list
5. Click **Apply**

![Sloshing Tank 16 water transport properties](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_16_water_transport_properties.png)

## 20. Transport Properties - Air

Repeat the previous step for phase2 using air properties.

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 the range from 0 to 1, where \(\alpha_{phase 1}=1\) means that the whole domain is filled only with the phase1, while \(\alpha_{phase 1}=0\) means that the domain is filled with the second phase.

We will assign the \(\alpha_{phase}\) parameter in the later steps.

1. Rename the second phase
   *phase2* \(\rightarrow\) `air`
2. Verify that the density \(\rho\) and kinematic viscosity \(\nu\) match the correct properties for air

![Sloshing Tank 17 air transport properties](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_17_air_transport_properties.png)

## 21. Boundary Conditions - Tank (Flow)

The mesh consists of only one tank wall boundary. For this boundary, we will apply the velocity that matches the initial velocity of the tank.

1. Go to *Boundary Conditions* panel
2. Select the *tank* boundary
3. 4 Set the velocity type and value accordingly
   *\(U \quad Type\)*`Moving Wall Velocity`
   *\(U \quad Value\) \({\sf [m/s]}\)*`-11.853`

![Sloshing Tank 18 Boundary Conditions](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_18_Boundary_Conditions.png)

## 22. Create Geometry - Water

Before we set the initial condition, we need to define the water region. For this purpose, we will create a box that will indicate the initial location of water.

1. Go to *Geometry* panel
2. Select *Create Box*
3. Change geometry name from *box_1* to `water`
   (double-click to edit name and press Enter to confirm)
4. Expand *Properties*
5. Set the origin and box dimensions
   *Origin \({\sf [m]}\)*`1``-1.5``0.4`
   *Dimensions \({\sf [m]}\)*`14``3``1.8`

![Sloshing Tank 19 Geometry water](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_19_Geometry_water.png)

## 23. Initial Conditions - Basic

Before we start the calculation, we need to define the fluid state at time zero. We will specify the velocity to be equal to *-11.853 m/s*, which corresponds to the initial tank velocity.

To assign the material to the domain, the phase fraction parameter *\(\alpha_{phase}\)* is used. The parameter determines the proportion of each fluid at the given point in space. The phase fraction value varies in the range from 0 to 1, where *\(\alpha_{phase1}=1\)* denotes phase1, while *\(\alpha_{phase1}=0\)* denotes remaining fluid - the second phase.

At the initial state, the water phase fraction is equal to *\(\alpha_{water} =0\)*, which means that the whole domain is filled with air by default. In the next step, we will patch the bottom region with water.

1. Go to *Initial Conditions* panel
2. Set the initial velocity
   *U*`-11.853``0``0`

![Sloshing Tank 20 Initial Conditions](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_20_Initial_Conditions.png)

## 24. Initial Conditions - Patch

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

1. Switch to *Patch* tab
2. Check the *water* geometry
3. Expand the *Fields*
4. Check *\(\alpha_{water}\)*
5. Set initial value of *\(\alpha_{water}\)* to `1`

![Sloshing Tank 21 Initial Condition Patch](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_21_Initial_Condition_Patch.png)

## 25. 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 variables that will be sampled. Note that runtime postprocessing can only be defined before starting calculations and cannot be changed later on.

1. Go to *Monitors* panel
2. Switch to *Sampling* tab
3. Select *Create Slice*
4. Expand *Fields* list
5. Select the water phase *\(\alpha_{water}\)*
6. Set the normal along Y axis
   *Normal \({\sf [-]}\)*`0``1``0`

![Sloshing Tank 22 Monitors Slice](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_22_Monitors_Slice.png)

## 26. Monitors - Forces

In order to track the sloshing force on the tank boundary, we will use the force monitor.

1. Switch to *Forces* tab
2. Expand *Monitored Boundaries* list and check *tank*

![Sloshing Tank 23 Monitors Force](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_23_Monitors_Force.png)

## 27. Run - Time Control

For any simulation, it is very convenient to let the solver automatically determine the proper time step value. To use this option, we need to define time step constraints by providing the initial time step (adjusted by the solver during computations), maximal time step value and Courant number.

1. Go to *RUN* panel
2. Set the *Simulation Time [s]* to `5`
3. Change *Time Stepping* to *Automatic*
4. Set initial time step, maximum time step and Courant number accordingly
   *Initial \(\Delta t\) \({\sf [s]}\)*`1e-04`
   (solver will start computation with this value and adjust it in the next iterations)
   *Max \(\Delta t\) \({\sf [s]}\)*`0.05`
   *Max Co \({\sf [-]}\)*`1`

![Sloshing Tank 24 Run Time](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_24_Run_Time.png)

## 28. Run - Output

We can control how often results should be saved on the hard drive. Only this data will be available for postprocessing.

1. Switch to *Output* tab
2. Set the *Interval [s]* to `0.05`

![Sloshing Tank 25 Run Output](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_25_Run_Output.png)

## 29. 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](https://license.sim-flow.com/trial)

Estimated computation time for serial mode: 1.5 hours

1. Switch to *CPU* tab
2. Click **Run Simulation** button

![run cpu serial](https://help.sim-flow.com/tutorials/images/run-cpu-serial.png)

## 30. Results - Slice

The Slices tab appears next to Residuals. Under this tab, we can preview results on the defined slice planes. The results preview is available during the calculation, and we can track it on a regular basis. The newly calculated time step will be updated automatically as long as the time selector points to the latest time step.

1. Change tab to *Slice*
2. Set the *View XZ*
3. Choose *alpha.water* field to display the water phase
4. Click *Adjust range to data*
5. Play with animation buttons to view the results of the analysis

![Sloshing Tank 26 Slice no baffle](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_26_Slice_no_baffle.png)

## 31. Results - Force

An additional force tab appears next to *Slices* . Under this tab, we can view force plots. The results preview is available during the calculation, and we can use it to track the progress of the simulation as well.

1. Change tab to *Force*

![Sloshing Tank 27 Force no baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_27_Force_no_baffles.png)

## 32. Save model

We will use this simulation as a starting point for the second configuration. To do so, we will save the current model under a new name without the results.

1. Extend *File* options from the top menu
2. Select *Save as…*
3. Type new name `sloshing_tank_baffles`
4. The model will be saved in the same location by default
5. Press **OK**
6. Go to *Launcher*

![Sloshing Tank 28 Save](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_28_Save.png)

## 33. Load model

After saving, we will open a new case.

1. Select the case *sloshing tank baffles* from launcher
2. Open the case in **New Window**

![Sloshing Tank 29 Open](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_29_Open.png)

## 34. Meshing Parameters - Baffle 1

In the new case, we will add the baffles inside the tank. The baffle geometries are already loaded in SimFlow but have not been used yet. We can just turn them on and remesh the model.

1. Go to *Hex Meshing* panel
2. Select the *baffle_1*
3. Enable *Mesh Geometry*
4. Set *Refinement* to *Min 1* *Max 2*
5. Check *Create Baffle* option

![Sloshing Tank 30 Mesh parameters baffles 1](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_30_Mesh_parameters_baffles_1.png)

## 35. Meshing Parameters - Baffle 2

Repeat these steps for the second baffle.

1. Select the *baffle_2*
2. Enable *Mesh Geometry*
3. Set *Refinement* to *Min 1* *Max 2*
4. Check *Create Baffle* option

![Sloshing Tank 31 Mesh parameters baffles 2](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_31_Mesh_parameters_baffles_2.png)

## 36. Start Meshing - Second Case

We will use the same base mesh setup, so we can go directly to the meshing step.

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

![Sloshing Tank 32 Meshing baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_32_Meshing_baffles.png)

## 37. Boundary Conditions - Copy (I)

We have already defined the initial velocity of the tank. Now, we need to assign the velocities to the remaining walls. We will copy the boundary conditions from the tank to the others.

1. Go to *Boundary Conditions* panel
2. Select the *tank* boundary

![Sloshing Tank 33 Boundary Conditions baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_33_Boundary_Conditions_baffles.png)

## 38. Boundary Conditions - Copy (II)

1. Press *Copy Boundary Conditions*
2. Extend the list next to *Copy to* and press *Select All* . All boundaries will be checked
3. Press **Copy**

![Sloshing Tank 34 Boundary Conditions baffles2](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_34_Boundary_Conditions_baffles2.png)

## 39. Monitors - Forces (2nd Case)

Previously, the fluid was acting only on the tank boundary. In the current mesh, we have additional walls that should participate in force calculation as well.

1. Go to *Monitors* panel
2. Switch to *Forces* tab
3. Expand the list of *Monitored Boundaries*
4. Check all boundaries

![Sloshing Tank 35 Monitors Forces baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_35_Monitors_Forces_baffles.png)

## 40. Run Second Case

Finally, we can run the simulation using the same parameters as previously.

1. Go to *RUN* panel
2. Click **Run Simulation** button

![Sloshing Tank 36 Run baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_36_Run_baffles.png)

## 41. Results - Slice (2nd Case)

We can view the results on the slice.

1. Switch to *Slice* tab
2. Select *alpha.water* field to display the water phase
3. Click *Adjust range to data*
4. Play with animation buttons to view the results of the analysis

![Sloshing Tank 37 Slice baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_37_Slice_baffles.png)

## 42. Results - Force (2nd Case)

Under the force tab, we will display the resultant force acting on the tank caused by fluid deceleration. We will add the results from the previous simulation (without the baffles) and compare them on the same chart.

1. Change tab to *Force*
2. Click on *Fit Axes*
3. Click on *Chart Setup*
4. Set the name of the axis:
   *X Label* to *Time [s]*
   *Y Label* to *Force [N]*
5. To close the panel, press *Chart Setup* button once again or press `Esc` key
6. Click *Plot Data from File* button

![Sloshing Tank 38 Force baffles](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_38_Force_baffles.png)

## 43. Import Results

1. Navigate to the folder with the previous simulation *sloshing_tank_no_baffles* . The forces were automatically saved under the following path
   *…/sloshing_tank_no_baffles/postProcessing/forceCompositeMonitorOnTankInDefault/0*
2. Select the file *force.dat*
3. Press **Open**

![Sloshing Tank 39 Import Force](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_39_Import_Force.png)

## 44. Results Summary

A new data series will be added to the chart. We will hide the unnecessary data series for clarity.

1. Select *Data Series*

![Sloshing Tank 40 Force baffles a](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_40_Force_baffles_a.png)

## 45. Results - Data Series

We will leave only the sloshing force (force along the X direction).

1. Hide all series except *Fx* and *total_x*
2. Change series name accordingly
   *Fx* \(\rightarrow\) *Fx_baffles*
   *total_x* \(\rightarrow\) *Fx_no_baffles*
3. Click on *Options* next to *Fx_no_baffles*
4. Set the color of the series to *blue*
5. Click *Data Series* to exit or press `Esc` key

![Sloshing Tank 41 Force chart props](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_41_Force_chart_props.png)

## 46. Results Comparison

Finally, we can compare the results from both configurations. We can see that the peak force was reduced by 30% by using baffles.

![Sloshing Tank 42 Force chart comparison](https://help.sim-flow.com/tutorials/images/sloshing-tank/Sloshing_Tank_42_Force_chart_comparison.png)

## 47. 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 postprocessing techniques.

[Paraview CFD Tutorial - Advanced Postprocessing in ParaView](https://www.youtube.com/watch?v=5M6VgXyHB60&list=PLy7xPqn9xXckoD2gZgPpv8mrxillJ9PWU&index=21)
