CUDA Accelerated Computational Fluid Simulation

15418 Project - Abhishek Yadav & Preetam Amancharla

View on GitHub

Final Writeup


We are going to create a high resolution dynamic fluid simulator with the aim of efficiently using the large amount of parallelism in the CUDA-enabled NVIDIA GTX 780 GPU. The simulator is based on the Navier-Stokes equations which describes the motion of viscous fluids. Another goal of this project is to compare performance against a 2.2 GHz intel core i7 processor.


We need a quantitative representation of a fluids’ state to simulate its behavior. Velocity and pressure are the most important quantity that we can represent since they describe how a fluid moves and its interaction with surroundings. Thus we represent a fluid as a vector and pressure field across the space of the fluid.

Grid Image

If the velocity and pressure are known for the initial time t = 0, then the state of the fluid over time can be described by the Navier-Stokes equations for incompressible flow.

These equations are derived from applying Newton’s second law to fluid motion with the assumption that the stress in the fluid is the sum of a diffusing viscous term and a pressure term. The key to fluid simulation is to determine the current velocity and pressure field at each time step using these equations.

Our application is compute-intensive since we need to continuously solve the Navier-Stakes equations for all particles across the Cartesian grid at every time step. A time step consists of the following step in code (ref: :

u = advect(u); u = diffuse(u); u = addForces(u); computePressure(u); u = subtractPressureGradient(u, p);

Thus, this problem will benefit with parallelism since we can parallelize these computations for all the Cartesian points. Also, a lot of temporary storage is needed and the memory model of a GPU would help reduce latency for the application.

The Challenge


Goals & Deliverables

Plan To Achieve

Update ((Checkpoint)): We still think we can achieve the above goals effectively.

Hope To Achieve

Update ((Checkpoint)):


For the demo, we hope to showcase a few examples of visual fluid simulation and explain the speedup obtained because of using the GPU with support from analytical data we collect.

Update (04/19/16): At our demo, we hope to show the following:

Platform Choice

We will be implementing the simulator in C++ using the CUDA platform to work with the NVIDIA GTX 780 GPU. The ghc41 lab machine contains this GPU. For the CPU implementation, we will use the quad-core 2.2 GHz Intel Core i7 processors which are contained in ghc[47 -84]. The OpenMP API would be used to support parallelism on the CPU.

These systems are a good choice for our fluid simulator since the GPU is the fastest one available and is well suited to a compute-intensive project due to high scope for parallelism. The i7 processor would be a good benchmark to analyze CPU performance and compare it with the GPU's performance.

Updated Detailed Schedule (Checkpoint)

Date Goals Status Lead
April 10, Sunday Complete a sequential implementation of the Navier Stokes equation that works on small grid dimensions. Completed Abhishek and Preetam
April 15, Friday Setup a graphical representation of our implementation to visually see the fluid simulation. Completed Abhishek and Preetam
April 21, Thursday Simply parallelize the sequential implementation for the NVIDIA GTX 780 GPU. In Progress Abhishek
April 24, Sunday Explore ideas related to how more aspects of the project can be parallelized. In Progress Preetam
April 28, Thursday Optimize the parallel implementation to achieve a higher speedup. Not Started TBA
May 1, Sunday Parallelize for the i7 processor and compare results with the GPU. Not Started TBA
May 05, Thursday Work on improving the graphical interface and fixing bugs in the project. Not Started TBA
May 09, Monday Explore further possibilities and additions to the project. Not Started TBA

Work Completed So Far(Checkpoint)

Concerning Issues(Checkpoint)

Note: Since we are still finding an effective way to show fluid simulation we do not have preliminary results at this time.