Uploaded May 2018 | Updated September 2026, 1 week ago
FluidX3D is a GPU-accelerated real time 3D fluid simulation based on the lattice Boltzmann method.
I've added some upgrades, namely the one-step-pull algorithm (OS-Pull) for a combined streaming-and-collide step which cuts VRAM access in half.
Particles are also calculated on the GPU. They don't impact performance much (less than 1%), since 65536 is a small number compared to 256x128x128 LBM nodes. Furthermore, if only the particle positions have to be sent over PCI-e to the CPU for graphics instead of the entire velocity field, it doubles the calculation steps per second, because then the GPU does not have to wait idle until the slow data transfer is done.
For more information about FluidX3D and my other projects, visit
projectphysx.de
Music: CMA - You're Not Alone
FluidX3D is a GPU-accelerated real time 3D fluid simulation based on the lattice Boltzmann method.
I've added some upgrades, namely the one-step-pull algorithm (OS-Pull) for a combined streaming-and-collide step which cuts VRAM access in half.
Particles are also calculated on the GPU. They don't impact performance much (less than 1%), since 65536 is a small number compared to 256x128x128 LBM nodes. Furthermore, if only the particle positions have to be sent over PCI-e to the CPU for graphics instead of the entire velocity field, it doubles the calculation steps per second, because then the GPU does not have to wait idle until the slow data transfer is done.
For more information about FluidX3D and my other projects, visit
projectphysx.de
Music: CMA - You're Not Alone

![FluidX3D [FLUID SIMULATION] Rocket Nozzle Simulation
FluidX3D is a GPU-accelerated real time 3D fluid simulation based on the lattice Boltzmann method.
Ive added arbitrary boundaries. This enables setting arbitrarily shaped walls inside the simulation box and observing the fluid flow around them.
The simulations in this video are sped up by 2x because the simulation box is quite large at 128x128x256. Keep in mind that the simulations run on a Laptop from the year 2015.
For more information about FluidX3D and my other projects, visit
http://www.projectphysx.de
Music: Soundtrack from CERN - Processing LHC Data FluidX3D [FLUID SIMULATION] Rocket Nozzle Simulation](https://i.ytimg.com/vi/nenqfD6nNGc/mqdefault.jpg)


![PhysX3D [GRAVITY SIMULATION] Ulysses slingshot on November 4th 2098
The Ulysses spacecraft was launched in 1990 to study the Sun from an orbit far off the ecliptic plane. It reached its orbit in 1992 using a slingshot maneuver on Jupiter which left its apoapsis crossing Jupiters orbit.
On November 4th 2098 it will get close to Jupiter again and do another slingshot maneuver which will raise its apoapsis beyond the orbit of Neptune.
The simulation is performed in real time on a notebook CPU based on data from the JPL. FP64 percision and RK4 integration with adaptive timestepping are being used.
More information at: http://www.projectphysx.de PhysX3D [GRAVITY SIMULATION] Ulysses slingshot on November 4th 2098](https://i.ytimg.com/vi/oFvzajmh76Y/mqdefault.jpg)

![Combined scientific CFD simulation and interactive raytracing with OpenCL (IWOCL & SYCLcon 2022)
This is my IWOCL & SYCLcon 2022 technical talk.
Extended Abstract: https://www.researchgate.net/publication/360501260_Combined_scientific_CFD_simulation_and_interactive_raytracing_with_OpenCL
Slides: https://www.iwocl.org/wp-content/uploads/06-presentation-iwocl-syclcon-2022-lehmann.pdf
0:00 Intro & Demos
4:16 Basic Idea
6:54 Lattice Boltzmann CFD
8:35 Benchmarks & Efficiency
11:33 Application
12:37 Graphics with OpenCL
23:06 Conclusions
24:16 More Demos!!
26:09 Outro
One of the main uses for OpenCL is compute applications where rendering is done externally. However separating simulation and rendering has many disadvantages, especially the slowdown caused by copying data from device to host, and needing to store raw data on the hard drive.
A much faster approach is to implement both simulation and rendering in OpenCL. The rendering kernels have direct read-only access to the raw simulation data in ultra-fast GPU memory. This eliminates almost all PCIe data transfer, allowing for interactive visualization in real time while the simulation is running.
Although OpenCL does not have existing functionality for graphical rendering, being a general compute language, it allows for implementing an entire graphics engine. On top, specific low-level optimizations make this OpenCL graphics engine outperform any existing rendering solution for this scenario, enabling fluid raytracing in real time on even non-RTX GPUs.
This is demonstrated with the software FluidX3D [1].
First I introduce the lattice Boltzmann method for simulating physically accurate fluid flow and discuss optimizations: Being a memory-bound algorithm, coalesced memory access is key. This is achieved through AoS data layout and the one-step-pull LBM streaming scheme. One-step-pull leverages that misaligned read penalty is much smaller than misaligned write penalty on most GPUs. Roofline analysis shows that with these optimizations, the LBM runs at 100% efficiency on the fastest GPUs [2].
For free surface flows, the LBM is extended with an efficient Volume-of-Fluid (VoF) implementation [3]. This allows covering new grounds in science: FluidX3D has been used to simulate more than 1600 raindrop impacts to evaluate how microplastics transition from the ocean surface into the atmosphere [4].
Rasterization on the GPU is parallelized not over pixels but lines/triangles instead. Each line/triangle is transformed from 3D to 2D screen coordinates and then rasterized onto the frame (integer array) with Bresenham [5] and z-buffer.
The raytracing graphics are based on a combination of fast ray-grid traversal and marching-cubes, leveraging that the computational grid from the LBM already is an ideal acceleration structure for raytracing. The idea is simple: Through each pixel on screen, shoot a reverse light ray out of the camera and see where it intersects with a surface in the scene. Then (recursively) calculate reflected/refracted rays and mix colors. If a ray doesnt intersect anything, its color is determined by the skybox.
With mesh surfaces consisting of triangles, computation time quickly becomes a problem, as all triangles have to be tested for intersection. To overcome this, an acceleration structure is required. While games often use a bounding volume hierarchy, the LBM already provides an ideal alternative acceleration structure: the simulation grid. The corresponding algorithm is called ray-grid traversal: When a ray shoots through the 3D grid, intersections with the surface only have to be checked for at each traversed grid cell rather than the entire grid. Triangles are generated on-the-fly with marching-cubes and ray-triangle intersections are checked with Möller-Trumbore. If an intersection has been found, the normals are calculated on the 8 grid points spanning the cell, and are trilinearly interpolated to the intersection. The interpolated surface normal makes the raytraced surface appear smooth.
On the GPU, the ray(s) for each pixel are computed in parallel. It is important how to align the OpenCL workgroups: best performance is achieved for 8x8 pixel tiles; this is about 50% faster than 64x1 tiles, because all rays of the workgroup are more likely to traverse the same grid cells, improving memory broadcasting. For marching-cubes, the algorithm by Paul Bourke [6] is implemented in OpenCL. Table size is reduced to 1/8. The Möller-Trumbore algorithm [7] is implemented branchless.
This raytracing implementation is fast enough to run in real time for even the largest lattice dimensions that fit into GPU memory. This is demonstrated on the most realistic simulation of an impacting raindrop ever done [8].
[1] https://doi.org/10.15495/EPub_UBT_00005400
[2] https://arxiv.org/abs/2112.08926
[3] https://doi.org/10.3390/computation10020021
[4] https://doi.org/10.1186/s43591-021-00018-8
[5] https://doi.org/10.1147/sj.41.0025
[6] http://paulbourke.net/geometry/polygonise/
[7] https://doi.org/10.1080/10867651.1997.10487468
[8] https://youtu.be/1g_zFsvScME Combined scientific CFD simulation and interactive raytracing with OpenCL (IWOCL & SYCLcon 2022)](https://i.ytimg.com/vi/pD8JWAZ2f8o/mqdefault.jpg)


![PhysX3D [GRAVITY SIMULATION] Extreme Performance
Durch ein bisschen Mikrooptimisierung und Verbesserung des Multithreading-Modus konnte ich nochmal den Faktor 2,3 an Rechenleistung rausholen.
Zu sehen ist das JPL-Sonnensystem mit den 178 größten Körpern, der Sonne, Planeten, Zwergplaneten, Asteroiden und Kometen. Ausgeschlossen sind Monde.
PhysX3D berechnet pro Sekunde ein Jahrzehnt. Die CPU-Auslastung links unten ist die reine Auslastung durch PhysX3D, sie ist nicht ganz 100%, weil das Videoaufnahmetool (Game-DVR) selbst Rechenleistung frisst.
Mehr Informationen auf: http://www.projectphysx.de
Musik: Chris Zabriskie - Cylinder Five PhysX3D [GRAVITY SIMULATION] Extreme Performance](https://i.ytimg.com/vi/sAMPQV5_p6I/mqdefault.jpg)
