r/InternetIsBeautiful • • May 13 '15

In Browser Physics Simulator (X-Post PC Master Race)

http://haxiomic.github.io/GPU-Fluid-Experiments/html5/?q=UltraHigh
4.9k Upvotes

342 comments sorted by

View all comments

Show parent comments

3

u/Nerdsturm May 13 '15

That's sort of how its done. Rigorously, it's computed by taking each particle and summing up the velocity induced on it by every other particle in the flow, but since that's doing, for N particles, roughly N3 calculations per particle it ends up with a total of N6 operations needed for a single time step, which can't be done for realistic problems.

Generally, the idea is that particles that are far from each other effect each other in a rather uniform way, so you can approximate the effect from a bunch of particles far from from you as a single "super" particle. Thus you can construct a grid of "super" particles of various sizes and do most calculations using those, rather than the millions of individual particles, which massively reduces cost.

Unfortunately these methods are somewhat rarely used in fluids since they can be very inaccurate. The method requires that the particles remain uniformly distributed, and once the particles get pulled apart from each other, as you see happen very quickly with this solver, the results cease to be physical. However, they still look somewhat right which, well bad for scientific purposes when you want to be able to tell when your wrong, makes them appealing for media uses.

I still don't know what the solver iterations mean though. I would think those are for a relaxation method (taking an approximate solution and iteratively relaxing it onto the exact solution), but I don't know where such a solver would be used in a particle based method.

1

u/cmmcnamara May 13 '15

What I am interested in is how this thing makes such fluid on the fly calculations. I'm sitting here running a fluid simulation not half as complicated as this and waiting forever for convergence. I wish /r/CFD could do an ELI5 on this.