A CUDA-accelerated SPH Fluid Simulator
Our project is to simulate the movement of fluid in a given time. We plan to use a position-based method to achieve scalability for our particles. We will also apply several physical constraints to make our fluid rendering more real. After we finish our fluid simulator, we will consider to accelerate the rendering time of fluid and try to reduce the processing time to make a real-time simulator as our aspirational plan.
Our ideas come from watching the final projects in previous years and we are inspired by the recent lecture of animation. We are trying to solve is to calculate the locations and movements of fluid particles. With solving this problem, we are able to extensively implement animations involves with fluid. The challenging part of this project is how to calculate the movement and positions of the particles as well as ensuring the calculation can be established within reasonable amount of time. We are trying to use the parallel computing to solve the speed issue.
We plan to use the position-based simulation method from [2] rather than the mpm method. Because mpm method involves solving equations that are not easily scalable. Position-based method is not only easier to implement but also compatible to distribute work among processors. The iteration method in [2] is Jacobi, which is “trivially parallelizable”[1].
For the program architecture, the assignment 4 will be a major reference since it’s also a simulator. It will also provide a debugging window mode and an off-screen simulation mode that only output files like assignment 3.
The workflow for the program will be :
Take in a scene file containing particle initial properties(position/velocity) and other global attributes like density and gravity.
Simulate the fluid with given duration.
Output results in debug format(contains particle positions in time order only) or render format(adapt to renderer’s file format)
Platform/Framework:
Development will be mostly on Windows 10 OS. Programming Language: C++.
A particle based fluid simulator that outputs particle positions.
The simulator can take in some demo scenes, simulate the position of fluid particles at each timestamp and output a file for further rendering(could be .vtk format[3] or file formats that mitsuba/blender can render). An OpenGL preview window will also be provided to assist debugging at runtime.
A set of fluid videos generated by 3rd party renderers with the simulation results.
By using mitsuba/blender, the simulation results can be rendered into videos. We aim to produce some demo video in scenes with fluid only. If we have enough time budget, we can support scenes with fluid and static rigid body (For aspirational plan).
It may looks like this:
(Picture reference: https://www.researchgate.net/publication/309127716_Projective_fluids)
A GPU accelerated version simulator. (For aspirational plan)
This algorithm can be parallelized in the velocity/position update phase and the Jacobi iteration phase. Some GPGPU techniques like CUDA[4] can be deployed to massively accelerate the computing progress in a million processor scale. Hopefully, this can give us a real-time simulator.
Scalability
This includes weak scaling(performance as particles per processors goes up) and strong scaling(performance as the total number of particles goes up).
Visual effect
Although this is a Computer Graphics project rather than a Physics project, where we are not aiming to simulate all physical properties of fluid, at least we should consider some physical constraints that greatly influence the visual effects to make the rendered results look like real.
Latency (for aspirational plan)
If the CUDA acceleration works really well, we can make a real-time/interactive fluid simulator and use simplified rendering technique to preview the results on the fly. Latency can be define as durations between the time when user input data and the time when the corresponding frame is rendered.
Here is our plan with scheduling the following four weeks for our final project:
Week 1. Preparation for the team and start implementing on simulation part
Week 2. Complete the simulation and rendering the fluid particles(Catch the milestone deadline)
Week 3. Debug the previous implementation and record video
Week 4. Work on final report and presentation