/SPHFluid

Interactive 3D Fluid Simulation based on SPH

Primary LanguageASPMIT LicenseMIT

SPH Fluid Simulator on GPU
Yang Zhou

0. Overview
This is a real-time fluid simulation application using smooth particle
hydrodynamic method[1]. The application is made in Unity. Just play it to have
some fun!! Youtube Video: https://youtu.be/gWqLvkn-wLY

The executable is in Release/ folder

1. Contribution
-1.1 We implemented a GPGPU version of SPH simulation in HLSL / Direct Compute.
Since the nature of SPH is parallel. This is much faster than the original CPU
version, it enables us to simulate a huge number of particles in realtime.

-1.2 We implemented a GPGPU version of Marching Cube algorithm to visualize the
fluid simulated based on the first chapter of GPU Gem 3 [2]. Again, this is much
faster than the original CPU version. The precomputed table is available from [2].

-1.3 We wrote a simple water shader (transparent, reflective (cube map)) to
render the fluid. This is done in Unity's ShaderLab/Cg shader language.

2. System / Compatibility
This application can only run on Windows (7 or higher). Also, the system must
support shader model 5.0 or higher to run it (because we are doing lots of stuffs
on GPU).

3. Parameter
-3.1 There are a lot of parameters you can tweak before simulation. The most obvious
two are particle number and mesh resolution. The higher the mesh resolution is,
the finer the marching cube grid will be (and also the slower it would be).
-3.2 Change time step will allow the simulation go faster (but not so precise).
-3.3 We have two different grid size levels in 3 dimensions to allow you to
switch between a larger world and a smaller world.
-3.4 The remaining parameters are mostly fluid properties. Please refer to the
original paper to see their meanings.

4. Control
Arrow Key: Camera moving
Right mouse button: rotate Camera view direction
Ball interaction: Add some fun by moving a ball and let it collide with fluid!
(see screen for controls)

Reference:
[1] Müller, Matthias, David Charypar, and Markus Gross. "Particle-based fluid
simulation for interactive applications." Proceedings of the 2003 ACM
SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association
, 2003.
[2] Geiss, Ryan. "Generating complex procedural terrains using the GPU." GPU
gems 3 (2007): 7-37.