SPH Fluid Simulator

An efficienc CPU based implementatio of SPH

June 2024
Technologies Used
C++ VTK CompactNSearch

Overview

Implementation of a full SPH pressuer solver, using WCSPH and PBF, as well as an explicit viscossity, cohesion and adhesion model. For improves scene setup, the setting can be defined in a scene file, specifying the simulation parameters. Core project was build as part of a uni project.

Key Features

  • Implementation of the explicit WCSPH and implicit PBF Pressure solver
  • Addition of emitters, adhesion and cohesion model
  • Sampling of surfaces with boundary particles and export of the particles to vtks
  • Full surface reconstruction with mesh smoothing using Marching Cubes

Technical Implementation

  • Use of CompactNSearch for fast and efficient neighborhood searches
  • Levaraging OMP and SOAs for blazing fast iterations and quickest possible computations
  • Use of boundary particles for boundary interactions
  • Implementation of Marching Cubes for surface reconstruction

Results & Learnings

  • Enhanced understanding of lagrangian discretization using SPH
  • Actual understanding of how pressure solvers work and which parameters matter
  • Importance of performance oriented implementation, to reduce computation time

Demo

Renders of the results (generated using Blender):

Single Dam Break Scene

Effects of Adhesion and Cohesion