Back to all tutorials

Blood Flow - CFD Simulation SimFlow Tutorial

1. Introduction

This tutorial focuses on a non-Newtonian fluid, specifically modeling blood using the Bird-Carreau transport model. We will use a time-variable inlet velocity profile to map the heart rate. Additionally, we will showcase the post-computation process of calculating wall shear stress and visualizing it through ParaView.

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 blood_flow

  1. Go to New panel
  2. Provide name blood_flow
  3. Click Create Case
Blood Flow 01 Launcher

4. Import Geometry

Firstly, we need to Download GeometriesInletOutlet01Outlet02Wall

  1. Click Import Geometry
  2. Select all geometry files inlet.stl outlet01.stl outlet02.stl wall.stl
  3. Click Open
Blood Flow 02 Import geometry

5. Imported Geometry Units

The STL format does not contain the unit information which are defined during the geometry export. If we do not know the exported unit, we can estimate it based on the total size of imported geometries. The size is displayed next to Geometry size label. In our case, the default unit meter is correct.

  1. To confirm default unit meter, press OK
Blood Flow 02 unit

6. Geometry - Blood Vessel

After importing geometry it will appear in the 3D window.

  1. Click Fit View to zoom in on the geometry
Blood Flow 03 Geometry check

7. Display Geometry - Blood Vessel

We will change the color of the wall to distinguish it from the other geometries.

  1. Select the wall from geometry list or hold CTRL key and click on the wall face
  2. Click Change Object Display Properties
  3. Select green color
  4. Approve by clicking OK
Blood Flow 04 Geometry color

8. Meshing Parameters - Inlet

In the Hex Meshing panel, we will change meshing properties associated with geometry objects. We want to apply the same settings to all geometries. We will set the parameters for the first surface and copy the configuration to the remaining geometries.

  1. Go to Hex Meshing panel
  2. Select the inlet component
  3. Enable Mesh Geometry
  4. Set Refinement to Min 1 Max 1
Blood Flow 05 Meshing Properties 1

9. Meshing Parameters - Copy

We want to apply the same settings to all geometries. We will copy the configuration from the inlet to the remaining geometries.

  1. Select the inlet
  2. Click Copy Meshing Properties
  3. Select all the remaining faces as a target outlet01 outlet02 wall
  4. Click Copy
Blood Flow 06 Meshing Properties 2

10. Base Mesh - Domain

Under the Base tab we will define the domain of the background mesh.

  1. Go to Base tab
  2. Click on Autosize
  3. Define the number of divisions
Blood Flow 07 Base Mesh

11. 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 blood vessel we need to place the material point inside the geometry.

  1. Go to Point tab
  2. Specify location inside blood vessel geometry
    Material Point00-1e-03

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

Blood Flow 08 Material Point

12. Start Meshing

Everything is now set up for meshing

  1. Go to Mesh tab
  2. Press Mesh button to start meshing process
Blood Flow 09 Meshing

13. Mesh

After the meshing process, the mesh will appear in the graphics window. Use the scroll wheel in your mouse to zoom into the model.

  1. Open the Console by clicking the icon in the lower right corner
Blood Flow 10 Mesh

14. Check Mesh

Check the mesh quality and statistics.

  1. Expand the Options list next to default region
  2. Select Check option
  3. Checks summary will be displayed on the command window. It also shows checking criteria.
Blood Flow 11 Mesh check

15. Mesh - Boundaries

  1. Set the following boundaries types accordingly
    inlet Patch
    outlet01 Patch
    outlet02 Patch
    wall Wall
Blood Flow 12 Boundaries

16. Select Solver - PIMPLE

We want to analyze the transient, incompressible flow with non-newtonian fluid to model the blood flow. For this purpose, we will use the PIMPLE (pimpleFoam) solver.

  1. Go to SETUP panel
  2. Filter the solvers by choosing Incompressible flow
  3. Pick PIMPLE (pimpleFoam) solver
  4. Select solver
Blood Flow 13 Solver

17. Turbulence

Due to the small diameter of the vessel and high viscosity of the fluid, it can be assumed that the flow remains laminar.

  1. Go to Turbulence panel
  2. Make sure the Laminar model is selected
Blood Flow 14 Turbulence

18. Transport Properties

For the demonstration purpose, we will model the blood as non-newtonian fluid using the Bird-Carreu model. We will operate on quantities divided by density and we do not need to specify the density. However, we have to take this fact into account during postprocessing.

  1. Go to Transport Properties panel
  2. Change Transport Model to Bird-Carreau
  3. Set the parameters accordingly
    \(\nu_0\) \({\sf [\frac{m^2}{s}]}\)3.3e-06
    \(\nu_{\infty}\) \({\sf [\frac{m^2}{s}]}\)1.32e-05
    \(K\) \({\sf [s]}\)0.6046
    \(n\) \({\sf [-]}\)0.3742
Blood Flow 15 Transport Properties

19. Boundary Conditions - Inlet (I)

The flow in the blood vessels is oscillatory in time. We will define the inlet velocity using the time history of one oscillation period. To do so we will use a table input option. The rest of the boundaries conditions we will leave as default.

  1. Go to Boundary Conditions panel
  2. Select the inlet boundary
  3. Set the Velocity Inlet character
  4. Change the Type of the velocity to the Fixed Mean Value
  5. Change the Value [m/s] to the table
  6. Click on Edit Table
Blood Flow 16 Boundary Conditions

20. Boundary Conditions - Inlet (II)

We will use a predefined velocity profile from the external file.
We need to Download Velocity Profileprofile.csv and import it to the Simflow.

  1. Click on Load Data From File
  2. Select the profile.csv file
  3. Press OK
  4. Loaded data will be presented on the chart
  5. Press Close
Blood Flow 17 Boundary Conditions Inlet

21. Initial Conditions

Before we start simulation we need to define the flow state at the time zero. We will specify a constant velocity equal to ` 0.2 m/s ` which corresponds to the initial inlet velocity.

  1. Go to Initial Conditions panel
  2. Set the initial velocity
Blood Flow 18 Initial Condition

22. Monitors - Boundary

We would like to monitor flow velocity at the outlet boundaries. The results can be later on used to calculate the volumetric and mass flow rates for each outlet.

  1. Go to Monitors panel
  2. Switch to Boundary tab
  3. Expand Fields for the outlet01
  4. Select the velocity field U
  5. Repeat this step for the outlet02 boundary.
    Selected fields will be visible next to the boundary names.
Blood Flow 19 Monitors

23. Run - Time Control

We will set the time of simulation to match the inlet velocity time range. We also want the solver to automatically determine the proper time step. This should lead to good stability and potentially reduce simulation time.

  1. Go to RUN panel
  2. Set the Simulation Time [s] to 0.9
  3. Change Time Stepping \(\Delta t[s]\) to Automatic
  4. Set initial and maximum time step (solver will start computation with initial value and adjust it in the next iterations not exceeding the maximum value)
    Initial \(\Delta t\) \({\sf [s]}\)1e-06
    Max \(\Delta t\) \({\sf [s]}\)1e-02
Blood Flow 20 Run Time Control

24. Run - Output

We can control how often results should be saved on the hard drive. We will write the results at the interval of ` 0.02 ` seconds. Note, that only saved data will be available during postprocessing.

  1. Switch to Output tab
  2. Set the Interval [s] to 0.02
Blood Flow 21 Run Output

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. The free version allows you to use only 2 processors in parallel mode. To get the full version, you can use the contact form to Request 30-day Trial

Estimated computation time for 2 processors: 1 hour

  1. Switch to CPU tab
  2. Use parallel mode
  3. Increase the Number of processors
  4. Click Run Simulation button
Blood Flow 22 Run CPU

26. Results - Outlet Velocity

Outlet boundary monitors are ploted on the charts next to Residual tab.

  1. Switch to U on outlet01 tab
  2. Click Adjust Axes
  3. Set the range for X and Y axis:
    X Min0
    X Max0.9
    Y Min0
    Y Max1.2
Blood Flow 23 Plot results

27. Calculate Wall Shear Stress

Calculations are finished, but before we start postprocessing, we will calculate wall shear stress (WSS). It can be calculated as the multiplication of dynamic viscosity and velocity gradient next to the wall. WSS is a characteristic value in medicine, used for circulatory system disease identification. Too low values are the indicators of atherosclerosis while the large WSS leads to the thickening of the vessel wall and increasing its diameter. This occurs when one vessel splits into two like in our example.

  1. Go to Calculate panel
  2. Switch to Wall tab
  3. Set the Time Range to Full Time Range
  4. Set the Wall Calculation to Wall Shear Stress
  5. Click on Calculate
Blood Flow 24 Calculate WSS

28. Postprocessing - ParaView

After computations are finished we can do complex visualization of our results with ParaView.

  1. Go to POSTPROCESSING panel
  2. Click on Run ParaView
Blood Flow 25 Postprocessing ParaView

29. ParaView - Load Results (I)

Load the results into the program.

  1. Select blood_flow.foam
  2. Click Apply to load results into ParaView
  3. After loading results they will be shown in the 3D graphic window
Blood Flow 26 ParaView Load Results 1 v2

30. ParaView - Load Results (II)

ParaView skips the initial time step by default, therefore we need to add the zero time to simulation.

  1. Uncheck Skip Zero Time
  2. Click Refresh
  3. Click Apply
  4. Set the time or time step to 0
  5. Select the velocity U from the list
Blood Flow 27 ParaView Load Results 2 v2

31. ParaView - WSS

To get the true value of the wall shear stress we need to multiply SimFlow results by the density. Please remember that for the sake of this tutorial we have created coarse mesh. We also model the vessel as rigid walls, whereas in reality, it’s hyper-elastic. Nevertheless, still we can identify the regions of extremely high and low wall shear stresses.

  1. Select blood_flow.foam
  2. Click Calculator
  3. Expand the vector list in calculator
  4. Select wallShearStress
  5. Selected vector appears in equation. Now we will multiply vector by the blood density 1060
  6. Set the ressult name to WSS
  7. Click Apply
  8. Select the wall shear stress WSS from the list
  9. Play with an animation buttons to track the results of analysis
  10. Click on Rescale to data range over all timesteps
Blood Flow 28 ParaView WSS v2

32. ParaView - Streamline (I)

Finally, we can take a look at streamlines.

  1. Select Stream Tracer from top menu
  2. Select velocity U from the vectors list
  3. Change Seed Type to Point Source
  4. Type the center coordinate and radius of the sphere:
  5. Uncheck the Show Sphere
  6. Increase the number of points to 200
  7. Click Apply
  8. Select the velocity U from the list
  9. Click on Rescale to Data Range
Blood Flow 29 ParaView Stream Line 1 v2

33. ParaView - Streamline (II)

To show the geometry together with the streamlines we will follow these steps:

  1. Click on the eye next to blood_flow.foam
  2. Select Solid Color from the list
  3. Change the opacity to 0.3
Blood Flow 30 ParaView Stream Line 2 v2

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