1
2
Fork
You've already forked cfluid
0
Terminal-based 2D fluid simulator
  • Rust 98%
  • Nix 2%
yvt 7c39de5abf fix(app): clamp particle velocity
The wrap-around logic breaks if particles cross the boundary more than
once between frames, leaving them outside the viewport.
Fixes panics caused by out-of-bounds access (#3).
2026年05月04日 10:54:11 +09:00
docs doc: add a screenshot 2023年01月31日 00:57:54 +09:00
src fix(app): clamp particle velocity 2026年05月04日 10:54:11 +09:00
.gitignore chore(nix): add Nix flake 2023年02月01日 02:01:20 +09:00
build.rs feat(app): increase particle density 2023年01月31日 00:15:03 +09:00
Cargo.lock feat(app): list keyboard commands 2023年01月30日 09:32:22 +09:00
Cargo.toml chore: exclude flake.{nix,lock}, rust-toolchain.toml, /docs 2023年02月01日 20:23:06 +09:00
flake.lock chore: update flake.lock 2024年01月04日 00:11:42 +09:00
flake.nix chore(nix): add Nix flake 2023年02月01日 02:01:20 +09:00
LICENSE doc: license under GPL-3.0-or-later 2023年01月27日 01:54:35 +09:00
README.md doc: warn not to run it remotely 2023年02月01日 12:56:07 +09:00
rust-toolchain.toml init 2023年01月23日 23:29:03 +09:00

CFluid

Terminal-based 2D fluid simulator

Prerequisites

  • A very fast terminal emulator supporting 24bpp colors (e.g., Alacritty). Normal ones like macOS Terminal and GNOME Terminal will not cut it.

  • A fast, unmetered network connection to the host machine if you want to run it remotely over SSH (not recommended due to excessive network traffic generated).

  • rustup to build the program.

Usage

# Monotone particles (use mouse to disturb)
cfluid
# Monotone particles on very thick fluid
cfluid -v 1e5
# Particles with trails colored by velocity
cfluid --heatmap velocity --trails
# Cool screensaver
cfluid --heatmap velocity --trails -s

Bibliography

[Stam01] Stam, Jos. (2001). "A Simple Fluid Solver based on the FFT." Journal of Graphics Tools. 6. 10.1080/10867651.2001.10487540.

[Green11] Green, D.A. (2011). "A colour scheme for the display of astronomical intensity images." Bulletin of the Astronomical Society of India, vol.39, pp.289--295. 10.48550/arXiv.1108.5083.

License

This program is licensed under GNU General Public License v3.0 or later.