-
Notifications
You must be signed in to change notification settings - Fork 6
OpenLB
OpenLB is an open-source C++ library for performing lattice Boltzmann method (LBM) simulations. It is designed for computational fluid dynamics (CFD) applications and supports high-performance computing (HPC). OpenLB is widely used in academia and industry for simulating complex fluid flow problems, including turbulence, multiphase flows, and heat transfer.
Within Voreen, OpenLB enables the generation of flow simulations directly integrated into the visualization pipeline.
Respective demo workspaces and data can be found in the module folder.
The general procedure for building Voreen is outlined in the Build Instructions To enable OpenLB functionality, specifically for simulating fluid flows, you must include the following Voreen modules:
- VRN_MODULE_FLOWANALYSIS
- VRN_MODULE_FLOWSIMULATION
- Open the CMake GUI (either using the existing cache or starting from scratch).
- Select the modules VRN_MODULE_FLOWANALYSIS and VRN_MODULE_FLOWSIMULATION.
- Press
Configure
,Generate
and build Voreen again. -
For Linux:
In Build Instructions after starting the build of Voreen with typingņinja
you can also typeninja OpenLB
and start a further building process. -
For Windows:
Due to Windows-specific limitations, you will need to use WSL (Windows Subsystem for Linux). See the section OpenLB for Windows.
To leverage OpenLB in Voreen, two processors are available:
- FlowSimulation
- FlowSimulationCluster
Both processors support the creation of simulation ensembles. The key difference is that FlowSimulationCluster allows for execution across computing clusters, facilitating HPC environments.
Three use cases demonstrate how OpenLB can be used in Voreen:
UseCase A - Simulating flow based on geometries in .stl
format.
UseCase B - Simulating flow based on measured flow data.
UseCase C - Analysis of simulations and measurements.
To use OpenLB with Voreen on Windows, you need to:
- Enable the module FLOWSIMULATION.
- Install a Linux distribution via WSL (e.g.: Ubuntu 24.04).
WSL installation
- Open Windows terminal and type
wsl --install
- After the installation, you have to restart your computer. Then starting Ubuntu and setting a username and password delivers
In the Ubuntu Terminal
- Setup the Ubuntu environment with
sudo apt-get update, sudo apt-get upgrade, sudo apt install gcc g++ make
- Install some packages for better usage of OpenLB
sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev
- Furthermore we need a version of vtk. In our example for Ubuntu 24.04 we take vtk9
sudo apt install libvtk9-dev
In the explorer
- Open the module path in your voreen repositors
relative-path\voreen\voreen\modules\flowsimulation\ext
and copy the folderopenlb
to the Ubuntu system that has been created with WSLubuntu\home\user-name
. -
Note: The folder
openlb
contains aconfig.mk
file, which has to be adjusted. Here, we suggest a specific setting oriented on Ubuntu 24.04 considering vtk9. - Open the openlb folder in the ubuntu path and copy paste the entries from
_config.mk
toconfig.mk
so that both files contain the same information. - Then, copy and past the following into the end of the
config.mk
file
# optional include paths
CXXFLAGS += -I/usr/include/vtk-9.1
# optional linker flags
LDFLAGS := -lvtkCommonCore-9.1 -lvtkIOXML-9.1 -lvtkCommonDataModel-9.1
In the Ubuntu terminal
- Navigate to
openlb/voreen
and type inmake
. Note that there are probably problems depending on the permission level of root and the user. To solve them, transfer the folder rights to your user by
sudo chown -R user_name:user_name ~/openlb
Build Voreen again: After all of the beforementioned steps, build Voreen again with CMake and Visual Studio as described Build Instructions. Make sure to select the module FLOWSIMULATION. Other interesting modules in this context are VESSELNETWORKANALYSIS, VTK, FLOWANALYSIS and ENSEMBLEANALYIS.