CS 184 - Final Project Proposal

Position-Based Fluid Simulator

Ashley Nguyen: 3031877941, Jennifer Zou: 3031880970, Z Wang: 25326943

In this project, we're implementing a position-based fluid simulator to render liquids for real-time applications. We'll leverage the stability and simplicity of a Position Based Dynamics (PBD) framework, and build out features like incompressibility which are critical to realistic fluid rendering. To do this, we'll follow a design from Macklin and Muller which uses constant density contraints. Our final application will display a scene and allow users to interact with the particles by changing parameters like size and viscosity as well as by applying external forces via cursor.

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.

Schedule

Resources

Original Paper:
  • "Position Based Fluids" http://mmacklin.com/pbf_sig_preprint.pdf

  • Background Literature:
  • http://matthias-mueller-fischer.ch/publications/posBasedDyn.pdf
  • http://mmacklin.com/pbf_slides.pdf
  • http://adsabs.harvard.edu/abs/2004CoPhC.157..191M
  • http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/ns.pdf

  • Reference Projects:
  • http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html
  • http://jamie-wong.com/2016/08/05/webgl-fluid-simulation/
  • https://github.com/dli/fluid
  • https://29a.ch/2012/12/16/webgl-fluid-simulation
  • https://github.com/PavelDoGreat/WebGL-Fluid-Simulation
  • https://github.com/mharrys/fluids-2d
  • https://observablehq.com/@jashkenas/webgl-fluid-simulation
  • https://github.com/ollyc2015/BathBombFluidDynamics

  • Video Inspiration:
  • https://www.youtube.com/watch?v=ureGelZPi3o
  • https://www.youtube.com/watch?v=-S8wq0dz1H4
  • https://www.youtube.com/watch?v=zmw-BTCbWMw
  • Caustic Lighting: https://www.youtube.com/watch?v=l_0k_jGwW8Y
  • Elastic Solids: https://www.youtube.com/watch?v=qd3gKVX89qo&ab_channel=CGFreiburg

  • Software:
  • WebGL
  • OCF GPU cluster: https://ocf.io/hpc
  • AWS EC2/S3 (if OCF fails)
  • Three.js
  • HTML
  • Webstorm