# Sloshing Tank

## 1. Create Case

In this tutorial, we are going to perform two analyses of the sloshing tank. In the first one, we will consider the tank without any support structure, on the second, we will analyze the tank with internal baffles.

After opening SimFlow, we will create a new case named sloshing_tank_no_baffles

1. Go to panel

2. Provide name sloshing_tank_no_baffles

3. Click

## 2. Import Geometry - Tank

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

2. Select geometry files: baffle_1.stl baffle_2.stl tank.stl

3. Click

## 3. Display Geometry

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

1. Click 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. 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

## 4. 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

1. Select

## 6. Extract Geometry - Tank (I)

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

1. Extend Options list next to the tank geometry

2. Select Extract Features

1. Select

## 8. Meshing Parameters - Tank

In order to create the mesh, we need to specify geometries 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

## 9. Base Mesh

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

1. Go to Base tab

2. Click on

3. Define the number of divisions
Division1062526

## 10. Material Point

Material Point indicates 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 Point402

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

## 11. Start Meshing

Everything is now configured and ready to be meshed.

1. Go to Mesh tab

2. Press the button to start meshing process

## 12. 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

## 13. Select Solver - Inter

To analyze water behavior we will use Inter (interFoam) solver. This solver is dedicated to model two-phase flow with interface capturing capabilities.

1. Go to SETUP panel

2. Select filter

3. Select Multiphase model filter

4. Pick Inter (interFoam) solver

5. solver

## 14. Dynamic Mesh

To model tank deceleration we will use a dynamic mesh feature. The dynamic mesh allows transforming 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 .

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

## 15. Turbulence

In the turbulence panel, enable turbulence modeling and select Raynolds 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

## 16. Transport Properties

In the transport properties panel we will define water and air properties. We will leave the default values for phase1 (water) and phase2 (air). To assign each of the materials to the domain, the phase fraction parameter $$\alpha_{phase}$$ is used. The parameter determines the proportion of each fluid in the given point in space. The phase fraction value varies in range from 0 to 1, where $$alpha_{phase1}=1$$ denotes phase1, while $$alpha_{phase1}=0$$ denotes remaining fluid - the second phase.

1. Go to Transport Properties panel

2. Rename the phases as appropriate
phase1 $$\rightarrow$$ water
phase2 $$\rightarrow$$ air

## 17. 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.85300

## 18. Create Geometry - Water

Before we will 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. Set the origin and box dimensions
Origin $$\sf{[m]}$$1-1.50.4
Dimensions $$\sf{[m]}$$1431.8

## 19. Initial Conditions - Basic

Before we will start the calculation we need to define the fluid state at the time zero. We will specify velocity to be equal to -11.853 m/s which corresponds to the initial tank velocity. Phase fraction $$\alpha_{water} =0$$ tells us that the whole domain is filled with air by default.

1. Go to Initial Conditions panel

2. Set the initial velocity
U-11.85300

## 20. 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

## 21. 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 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. Select Create Slice

4. Expand Fields list

5. Select the water phase $$\alpha_{water}$$

6. Set the normal along Y axis
Normal $$\sf{[-]}$$010

## 22. 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

## 23. 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

## 24. 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

## 25. Run - CPU

To speed up the calculation process increase the number of CPUs basing on your PC capability. We recommend using at least 4 cores for this tutorial. If you are using a free version you can use the contact form to Request 30-day Trial

Estimated computation time for 2 processors: 50 minutes

1. Switch to CPU tab

2. Change the solver to parallel

3. Define the number of processors

4. Click button

## 26. Results - Slice

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 actualized automatically as long as the time selector points to the latest time step.

1. Change tab to Slice

2. Set the View XY

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

## 27. Results - Force

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

## 28. 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 top menu

2. Select Save as…​

3. Type new name sloshing_tank_baffles

4. Model will be saved in the same workspace (parent folder) by the default

5. Press

After saving, we will open a new case.

1. Extend File options from top menu

2. Select Open…​

3. Select case sloshing_tank_baffles

4. Press

## 30. Meshing Parameters - Baffle 1

In the new case, we will add the baffles inside the tank. The baffles 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

## 31. 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

## 32. 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 button to start meshing process

## 33. 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

## 34. 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

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

Previously 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

## 36. Run Second Case

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

1. Go to RUN panel

2. Click button

## 37. 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

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

Under the force tab, we will display the resultant force acting on a 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. Clisk Plot Data from File button

## 39. Import Results

1. Navigate to the folder with a previous simulation sloshing_tank_no_baffles . The forces were automatically saved under the following path
…​/sloshing_tank_no_baffles/simlostProcessing/forceMonitorTankInDefault/0

2. Select the file force.dat

3. Press

## 40. Results Summary

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

1. Select Data Series

## 41. Results - Data Series

We will leave only the sloshing force (force along 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

## 42. 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.