I'm learning Rust and really wanted to work on a fluid simulation project. Why not do both at the same time?
The idea is to slowly build a fluid simulator. We start with the basics, just making particles interact respecting physics laws, and iteratively add features to interact with the simulation. Right now, you can already run it and see some particles moving around. Let's see how far we get next week 👀
Animated overview of fluid simulator. The GIF is running at 30 FPS, so you might experience a lack of fluidness you wouldn't using the simulator. You should trust the small number at top left corner for accurate FPS rate.
For technical details of the project, please check the implementation docs.
Running the simulation is very easy because of Rust. Simply clone the repo and do a cargo run on your terminal. All dependencies are going to be automatically donwloaded and handled, the program will be compiled and the simulation will start. If you want to make use of the highest performance available, do a cargo run --release. That way, Rust will optmize the program and you'll be able to run a whole bunch of particles. On my AMD Ryzen 7 7840HS, I was able to run about 20K particles at 60 FPS for a full simulation and about 70K particles at 60FPS without particle cluttering.
