Back to all tutorials

Internal Pipe Flow - CFD Simulation CFD Software Tutorial

front-image

1. Introduction

The Pipe Flow tutorial serves as an excellent introduction to SimFlow. It primarily concentrates on explaining the fundamental aspects of the software. In this tutorial, we will present the simulation of internal flow through a simple T-pipe geometry (created directly in SimFlow). This simulation will feature a single-phase, incompressible flow, consisting of two inlets and one common outlet.

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 pipe flow

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

4. Create Geometry - Cylinder 1

To build a "Pipe" geometry for the simulation, we will make use of SimFlow’s basic geometry module. This module allows for creating and editing of primitive geometries (box, cylinder, and sphere).

SimFlow also supports importing complex geometries in well known formats such as STEP, STL, IGES, and others. However, in this case, we will use a simple pipe geometry.

For this operation, we will need to create two cylinders, which we will unite in further steps into a pipe. Our initial step will involve adding the first cylinder.

  1. Go to Geometry panel
  2. Select Create Cylinder
  3. Set the cylinder dimensions:
    Length \({\sf [m]}\)0.4
    Radius \({\sf [m]}\)0.05
image

5. Create Geometry - Cylinder 2

In this step we will create second cylinder.

  1. Select Create Cylinder
  2. Set the origin and axis:
    Origin \({\sf [m]}\)0-0.40
    Axis \({\sf [-]}\)010
  3. Set the cylinder dimensions:
    Length \({\sf [m]}\)1.5
    Radius \({\sf [m]}\)0.075
image

6. Unite Geometries

In this step we will create a pipe geometry by joining two cylinders created in prior steps. For this task we will use an unite tool. This is a geometric boolean operation that will result in a single solid geometry.

  1. Select both cylinder with CTRL key pressed
  2. Click Unite Geometries
  3. New geometry will be listed below the cylinders. Double click on its name and change it from unite to pipe
image

7. Geometry - Pipe

The resulting geometry will be displayed in the graphics window.

  1. Click Fit View to zoom in the geometry
image

8. Creating Face Group - Inlet 1

In this simulation, we are dealing with an internal flow problem. The imported geometry determines the bounds of the fluid domain. To inform the program where the boundaries of the inlet and outlet mesh should be created, we will use the Face Groups.

Face Group is a set of faces that should be distinguished within a geometry. When the geometry containing the face group is used for meshing, an additional boundary is created. The boundary represents the respective face group and inherits its name.

  1. Select the first inlet face by holding CTRL key and clicking on the geometry face in a 3D view. The selection should be marked in red
  2. Click on the Face Group button in the graphics context toolbar
  3. Press Esc key to clear the selection
image

9. Creating Face Group - Inlet 2

In this step we will create a face group for the second inlet.

  1. Select the second inlet. Press CTRL key and click on the face as shown on the slide below
  2. Click on the Face Group button in the graphics toolbar
  3. Press Esc key to clear the selection
image

10. Creating Face Group - Outlet

In order to choose the outlet, we need to rotate the view so that the other end of the geometry becomes visible.

  1. Select the outlet face. Press CTRL key and click on the face
  2. Click on the Face Group button in the context toolbar
image

11. Rename Face Groups

In the Geometry Panel we can find four Face Groups under the pipe geometry. The first group, named default, contains all non-selected surfaces. These surfaces will become the pipe walls.

The three additional groups represent the inlets and the outlet of the fluid domain. We will rename those groups to make the resulting boundary names more readable.

  1. Select pipe geometry
  2. Expand Geometry Faces
  3. Change face groups names accordingly (double-click on a group name to start editing)
    group_1 \(\rightarrow\) inlet1
    group_2 \(\rightarrow\) inlet2
    group_3 \(\rightarrow\) outlet
image

12. Meshing Parameters - Pipe

In order to create the mesh, we need to specify the meshing options used for a given geometry. For the pipe, we will add the boundary layer and refine the mesh near edges by level 1.

  1. Go to Hex Meshing panel
  2. Select the pipe component
  3. Enable Mesh Geometry
  4. Enable Create Boundary Layer Mesh
  5. Set surface Refinement to Min 0 Max 1
image

13. Base Mesh - Domain

For the base mesh, we will use a box geometry. As we would like to create the mesh inside the pipe geometry, we need to make the box size a little bigger than the pipe.

  1. Go to Base tab
  2. Click on Autosize to adopt box to visible geometries
  3. Define the number of divisions
    Division2520060
image

14. Material Point

Material Point tells the meshing algorithm on which side of the geometry the mesh is to be retained.

Since we are considering flow inside the pipe we need to place the material point inside the geometry. In this case, we do not need to modify the coordinates of the material point, since the default location is already inside the pipe.

t pipe 11 point

15. Start Meshing

In this step we will initiate the meshing process.

In the meshing panel you may indicate how many CPUs would you like to use for this process. Please note that if you are using SimFlow free version you may only use serial meshing, and you may not create meshes larger than 200'000 nodes.

If you would like to test full version Request 30-day Trial

  1. Switch to Mesh tab
  2. Start the meshing process with Mesh button
image

16. Mesh

After the meshing process is finished the mesh should appear on the screen.

image

17. Boundaries

To be able to assign inlet and outlet boundary conditions we have to assign the proper boundary types.

  1. Define boundary types accordingly
    pipe wall
    pipe_inlet1 patch
    pipe_inlet2 patch
    pipe_outlet patch
image

18. Select Solver - SIMPLE

We want to analyze incompressible turbulent flow. For this purpose, we will use the SIMPLE (simpleFoam) solver.

  1. Go to SETUP panel
  2. Select Steady State type
  3. Select Incompressible flow filter
  4. Select SIMPLE (simpleFoam) solver
  5. Click Select button to confirm
image

19. Turbulence

We are going to use the standard \(k{-}\omega \; SST\) model to resolve turbulence.

  1. Go to Turbulence panel
  2. Select RANS modeling
  3. Select \(k{-}\omega \; SST\) model
image

20. Transport Properties - Water

As a fluid material, we will use water.

  1. Go to Transport Properties panel
  2. Open Material Database
  3. Pick up water from the list
  4. Click Apply

Selecting material from the Material Database will fill all inputs in the Transport Properties panel. We are still able to overwrite these values at any time.

image

21. Boundary Conditions - Inlet 1

Now, we will define the inlet and outlet boundary conditions. At the first inlet, we will set constant water velocity.

  1. Go to Boundary Conditions panel
  2. Select pipe_inlet1 boundary
  3. Set the Velocity Inlet character
  4. Set the inlet velocity
    U Reference Value \({\sf [m/s]}\)0.8
image

22. Boundary Conditions - Inlet 2

The second inlet will be defined using pressure inlet condition. For the pressure value, we will use 1 [kPa].

Note, for the incompressible solver, we operate using kinematic properties. And thus instead of using dynamic pressure, we are going to set a value divided by reference density – kinematic pressure \(m^2/s^2\).

  1. Select pipe_inlet2
  2. Set the total pressure value
    \(p_0\) \({\sf [m^2 / s^2]}\)1
image

23. Boundary Conditions - Outlet

At the outlet, we will apply pressure outlet character. The pressure value we will leave default 0. For the incompressible flow, pressure is always relative and we can add any constant (1 atm for example) after computation.

  1. Select pipe_outlet
  2. Set the Pressure Outlet character
image

24. Monitors – Sampling (I)

During calculation, we can observe intermediate results on a section plane. To sample data on a plane we need to define the plane and also select fields that will be sampled. Note, runtime post-processing can only be configured 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. Set slice plane normal vector
    Normal \({\sf [-]}\)100
image

25. Monitors – Sampling (II)

Additionally, to specifying the geometry we need to choose which results should be sampled.

  1. Expand Fields list
  2. Select pressure p and velocity U
image

26. Run - Time Control

Finally, we can start our computation.

Estimated computation time for single-core: 5 minutes

  1. Go to RUN panel
  2. Set the maximum Number of Iteration to 500
  3. Click Run Simulation button
image

27. Residuals

When the calculation is finished we should see a similar residual plot. All the residual values have reached \(10^{-4}\) and the solver has automatically stopped the calculation. The residuals are the measure of how results change between iteration. Reaching a very low value indicates that we have found a steady-state solution and results do not change regardless of further computations.

  1. Go to Residuals tab
image

28. Slice - Velocity Field

Slices tab appears next to the Residuals. Under this tab, we can preview results on the defined section plane.

  1. Change tab to Slices
  2. Select the velocity U
  3. Click Adjust range to data
  4. Set the YZ orientation View YZ
  5. Click Fit View
image

29. Start Postprocessing with ParaView

To access more advanced postprocessing functions, use the integrated ParaView software.

  1. Go to Postprocessing panel
  2. Run ParaView
t pipe 26 paraview

30. ParaView - Load Results

A new ParaView window should open. Load results into the ParaView. Be aware that in a steady-state simulation, SimFlow saves only the last two iterations by default. View the last one to see the final solution.

  1. Click Apply to load results into ParaView
  2. Display the results from the last frame
  3. After loading results, they will be shown in the 3D graphic window
t pipe 27 pv open

31. ParaView - Display Streamlines (I)

Advanced postprocessing features give us a possibility to display i.e., streamlines. To do that, follow these steps:

  1. Make sure the pope_flow.foam case is selected and highlighted in blue
  2. Select Stream Tracer from the top menu
  3. Change Seed Type to Point Cloud
  4. Type the center coordinate and radius of the sphere:
    Center000
    Radius0.15
  5. Increase the number of points to 150
  6. Click Apply
  7. Select the velocity U from the list
t pipe 28 pv streamlines

32. ParaView - Display Streamlines (II)

To enhance visibility, we can render the streamlines.

  1. Expand the Toggle advanced properties
  2. Scroll down to a Styling section and increase Line Width to 2
  3. Mark Render Lines As Tubes option
t pipe 29 pv streamlines style

33. ParaView - Display Transparent Geometry

We can additionally display the transparent geometry to observe how the streamlines are distributed in relation to it.

  1. Click on the eye next to the pipe_flow.foam base case to display it
  2. Select the Solid Color from the list
  3. Set the Opacity to 0.3
t pipe 30 pv opacity

34. ParaView - Streamline Results

The final results contain the transparent geometry and streamlines colored by the velocity.

t pipe 31 pv results

35. Advanced Postprocessing with ParaView

This concludes the tutorial, covering all the aspects we intended to showcase. For a finely tuned presentation of the results, you may take advantage of the more advanced features.

In ParaView, you can display streamlines, contour plots, vector fields, line or time plots, calculating volume or surface integrals and create animations.

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.