Hacker News new | past | comments | ask | show | jobs | submit login

Hi, I made this demo. This is actually all from the paper Particle-based Viscoelastic Fluid Simulation (Simon Clavet, Philippe Beaudoin, and Pierre Poulin). It is an SPH type (particle-particle interactions), not MPM (particle-grid-particle). I do a lot of MPM nowadays, and I have a multi-grid thing to help with incompressibility, but this was me re-implementing the first fluid sim paper I ever implemented.

I did the implementation in JS to help other people reading the paper, and tried to keep everything as similar as possible to the pseudocode from just this single paper. Maybe it would be cool to integrate an additional grid on which incompressibility is enforced better but I didn't want to make the source confusing.

It is also a little difficult to do density ratios with just what is shown in the paper, here the masses are set to (1, .8, .6, .4). This is what causes the lightest particles to get launched so violently in the air. Probably would be useful to integrate some ideas from the paper Density Contrast SPH Interfaces (Barbara Solenthaler, Renato Pajarola).

I started revisiting SPH because I have some new ideas to combine it with an MPM/FLIP grid for closeups. I'm trying to do a multi-scale MPM simulation that can handle better surface tension droplets in closeups while also doing extremely large scale scenes. You can see some larger scale parallel sims on my YouTube: https://www.youtube.com/c/GrantKot




Hey this was also the first fluid sim paper I ever implemented! I haven't done any grid-based simulations (except maybe the classic "Real-Time Fluid Dynamics for Games" by Jos Stam), but I've been able to greatly improve compressibility by using "Position-Based Fluids" by Miles Macklin. Someday I'll dive into WebGPU and post a JS version on HN...

Short clip of my implementation here: https://imgur.com/a/2IARiBq

I like the different fluids in your sim though, I may try that myself.


Very cool! What does the changing color of the fluid indicate, particle velocity?


I believe specific gravity.

Things like "how do you properly make a B-52?" ( http://www.cocktailhunter.com/bartender-guide/specific-gravi... ) or a Pousse Café ( https://youtu.be/4OJd_phsa5w )


Yes, particle velocity! I believe this clip is after I implemented metaballs too, so the particles blend together to make it feel more fluid-like.


I have been following your work on twitter for quite a while. Didn't know you were on YouTube as well. I guess I was doing this since one of these demos https://youtu.be/BCUh1opDGA4


Beautiful and mesmerizing. Well done




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: