Skip to content
/ ponyo Public

🌊 A 2D, semi-Lagrangian fluid solver.

Notifications You must be signed in to change notification settings

mwalczyk/ponyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ponyo

🌊 A 2D, semi-Lagrangian fluid solver.

Description

A semi-Lagrangian fluid solver based on Robert Bridson's book, Fluid Simulation for Computer Graphics (2nd Edition). This implementation uses a staggered marker-and-cell (MAC) grid with second-order Runge Kutta interpolation during the backwards particle trace. Currently, the pressure solve is accomplished using the Gauss-Seidel method.

Tested On

  • Windows 8.1, Windows 10, Ubuntu 18.04
  • NVIDIA GeForce GTX 970M, NVIDIA GeForce GTX 980
  • Rust compiler version 1.37.0-nightly (nightly may not be required)

To Build

  1. Clone this repo.
  2. Make sure πŸ¦€ Rust installed and cargo is in your PATH.
  3. Inside the repo, run: cargo build --release.

To Use

There are several optional command-line arguments that can be used to configure the simulation:

USAGE:
    ponyo.exe [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --frame_count <COUNT>             Sets the number of frames that will be rendered
    -o, --output_directory <DIRECTORY>    Sets the directory where images will be rendered to
    -r, --resolution <WIDTHxHEIGHT>       Sets the resolution of the simulation, in pixels

Note that if you are running the executable via cargo, you must place an additional set of hyphens before any command-line arguments. For example: cargo run -- -o /renders.

Credits

Throughout the creation of this project, several papers and tutorials were particularly helpful:

  1. Fluid Flow for the Rest of Us [link]
  2. Fluid Simulation for Computer Graphics: A Tutorial in Grid Based and Particle Based Methods [link]
  3. Gauss-Seidel Method for Solving Simultaneous Linear Equations [link]

A few existing repositories were helpful as well, most notably Incremental Fluids, a series of tutorials written by Benedikt Bitterli, whose projection method was key to my understanding of the pressure solve.

License

Creative Commons Attribution 4.0 International License

About

🌊 A 2D, semi-Lagrangian fluid solver.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages