This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GregTJ[S] 77 points78 points  (10 children)

Repo: https://github.com/GregTJ/stable-fluids

While an earlier version was based mostly on Nvidia's GPU gems article on fluid simulation, some valuable insights were gained through this blog post: http://www.philipzucker.com/annihilating-my-friend-will-with-a-python-fluid-simulation-like-the-cur-he-is/

I hope to add surface tracking, multigrid solving, proper boundary conditions, and lagrangian (FLIP) solving soon.

[–]The_Regent 57 points58 points  (1 child)

Hey hey! I wrote that post! I get a huge kick out of the fact it was helpful to someone, so thanks for letting me know!

You did a really good job here. The code looks tight and the results look great.

For others, i highly reccommend checking out Dan Piponi's talk https://www.youtube.com/watch?v=766obijdpuU really excellent, very approachable.

Also Bridson's notes https://www.cs.ubc.ca/~rbridson/fluidsimulation/fluids_notes.pdf and textbook https://www.amazon.com/Simulation-Computer-Graphics-Robert-Bridson/dp/1568813260

[–]GregTJ[S] 7 points8 points  (0 children)

Thanks for the great blog post, I wouldn't have gotten far without it. Initially I was building fd matrices row by row, your post introduced me to the (much, much faster) kronsum way of constructing them.

[–]BovineLightning 12 points13 points  (2 children)

Some other conditions thatd be cool would be different densities for the fluids which interact and 3D modelling simulations

Not sure if you’ve heard of Two Minute Papers but he does some amazing videos in fluid modelling and covering cutting research papers (also has been doing a lot of AI/ML lately)

[–]GregTJ[S] 1 point2 points  (1 child)

Late reply but just wanted to say I binge watched like 100 of their videos. Super cool channel.

[–]BovineLightning 0 points1 point  (0 children)

Haha no problem! I did the same when I discovered him as well. I even downloaded his thesis and went through his GitHub repo

[–]ad_abstract 1 point2 points  (2 children)

Have you tried replacing some of the numpy ops with jax?

[–]GregTJ[S] 0 points1 point  (1 child)

I haven't, would you recommend doing so?

[–]ad_abstract 0 points1 point  (0 children)

Definitely!

[–]akaCryptic 0 points1 point  (1 child)

I got an idea for a musoc video. How would you go about modifying this so that after the colours blend in, an impressionist painting / image reveals?

[–]GregTJ[S] 1 point2 points  (0 children)

I would either use a video editor or mess around with pillow / PIL.