I had planned to submit this for macondo, so unfortunately I’m really behind on devlogs. So below is a recap of a few things.
I first read up on fluid simulators, about implementations like stable fluids, or more particle-based versions. I got a basic skeleton (diffuse, advect, project) and made sure I understood most of the logic.
I then wrote up the advection logic. This took an unfortunate amount of time; I started with a basic manual implementation, but then with some review from DS V4, it was suggested I implement a multigrid logic for performance, so I followed some guides (and advice from V4) to implement it.
I then worked on the diffusion script (I’m separating all parts into different scripts for max clean-ness :D). It wasn’t so bad, but I had to do a bit of research, read up on conjugate gradient solvers, but with some help it was fine.
Projection was a pain; seemingly it affected border conditions, and had to be done multiple times, or could be optimised or something, but it seems to almost work. (Still diverges? I’m not sure.) Ahhh, but the output logs still show significant issues. One day it’ll work.
I then used matplotlib to make a changing visualisation. I would like for it to be a TUI visualisation (with braille?), but for now it works.
After a long break (school international tours, and other stuff), I continued, first by converting the matplotlib visualisation into a TUI ascii-gradient-based terminal text visualisation, using ansi codes for alternate buffers and overwrite to efficiently create the TUI.
That’s a really short recap of my progress; there seem to be a lot of physics accuracy issues, performance optimisations, stuff to learn about numpy vectorisation, etc. But it’s already really cool to watch the visualisation! And the ascii turned out really nice.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.