Problem Description
Simulating fluids has real-life applications in everyday situations and is highly relevant in both practical and leisure computer graphics rendering situations. Examples of use cases include modeling ocean currents, gas flows, novel fluid
interactions, and of course, the plethora of liquid-containing-scenes in films, advertisements, and games.
SPH solvers have well established themselves within the field of fluid modeling; however, requiring small time steps and large smoothing radius and particle count make them difficult and compute-intensive vis-a-vis real-time applications. By
using a implicit system like PBD, we'll develop an iterative solver which preserves the incompressibility and convergence guarantees of SPH's, while also resolving issues like tensile instability, time step, and smoothing radius.
We'll use
NVIDIA’s "Position Based Fluids" paper as our technical reference.
Goals and Deliverables
Baseline Plan
Our plan is to render visualizations of fluids in image and video formats to gain a deeper understanding of fluid dynamics and particle interaction in computer graphics. We will accomplish this by implementing an iterative density solver
(following the aforementioned NVIDIA paper) within a Positional Based Dynamics Framework.
The first step is understanding the physics. We'll then learn how WebGL works, and take a look at existing PBD solvers. To maintain incompressibility, we'll add a constant density constraint. To prevent tensile instability, we'll add an
artificial pressure. Then we'll implement the solver's functionality following Macklin and Muller's pseudocode (which recalculates particle position using Newton's forces as nonlinear constraints).
An example simulation taken from Macklin and Muller.
|
Taken from Macklin and Muller. This image shows the particles.
|
An online interactive demo similar to what we're trying to create.
|
Caustic patterns in water.
|
We believe this project is challenging but feasible in the time given. Rendering fluids requires us to learn basic fluid dynamics and modeling equations, but the generality of this task means we have many resources available for help.
To measure quality, we'll compare our render time and computational resources to benchmarks provided in relevant research papers. The primary goal here is to render accurate, reliable, and robust fluid simulations in a reasonable time period
(within 5 minutes on our PC's). For a given rendering, we can measure metrics like particle count and time step. We can perform experiments by varying frame time, steps/frame, and iterations/step, and compare our results with other fluid modeling
frameworks. Following Macklin and Muller, we can even keep track of a time distribution over the steps that occur within each iteration.
With this project, we hope to shed some light on how one's understanding of particle physics and the graphics pipeline changes as a result of extending a solid-rendering implementation to fluids. We'll seek out the differences between explicit
and implicit, position and impulse-based approaches, and explore the space of solutions between these approaches. Having little JavaScript experience among us means we'll also learn how to use libraries like WebGL and three.js to render and
display the simulations.
Lastly, we'll build out an informative and engaging website, showing the journey and approach that we took as well as sharing the resources and follow-up questions we discovered.
Aspirational Plan
If we complete the baseline plan, we aim to create an online simulator application that will allow users to manipulate the fluid simulation with particle size and viscosity controls in real time. The user will also be able to apply additional
external forces with the mouse. We can add more parameters to the application, such as gravity, "spikiness", as well as a function to move or modify the lighting in a scene. Our team personally enjoyed caustic effects between water and walls,
so we could render a swimming-pool-type scene.
If we really have time, we can explore, definitely test, and possibly implement different approaches beyond our constant-density PBD solver. This includes other PBD designs as well as SPH solvers and alternative frameworks like FLIP and FEM.
Rendering instantly or in milliseconds is an aspirational goal for our project. If we create a interactive web app, adapting the scene to user commands with low latency is vital to seamless user experience. We will need to explore techniques
for optimizing the fluid simulations.