Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Been recently looking into fluid simulations again. This time I've testing if I can make a good SPH simulation but only having "average" cell particles. It seems to work surprisingly well, and it doesn't need sorting either. Explanation thread👇🧵

15,816 görüntüleme • 1 yıl önce •via X (Twitter)

11 Yorum

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

This is a follow-up of my method from here where particles were stored on the grid itself. This posed a problem since when there are more than 2 particles per cell they average out and information is lost (for ex. velocity difference between particles)

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

This produces a artificial numerical viscosity which becomes detrimental when wanting to have more than 1 particle per cell. On top of that this doesn't allow keeping any persistent information on the particles themselves.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

So my second idea was "what if we only average the particles for the force/density computations only". Its not something you can do in Shadertoy, as you need some kind of rasterization to splat the particles on the gird. Here I show cell averages with mass > 1 with red spheres

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

I used atomicAdd's for splatting the particle properties, which means using compute shaders. But you can also use the hardware rasterizer, which I plan on trying later, which should allow me to port this to VRChat.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

The rendering here uses my compute ellipsoid rasterizer which I worked on a while ago. It analytically projects the ellipsoids onto the screen and fills in the pixels inside the ellipse.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Algorithms that "average" or "merge" particles to reduce the amount of computation aren't new, for example to do gravity simulations efficiently there is the Barnes-Hut algorithm, where you build an entire hierarchy of particle averages on a tree (usually quad/octree)

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Then depending on the distance, you select the appropriate "LOD" of the particles when computing the force. This results in O(NlogN) compute time for gravity instead of O(N^2). For "local" fluid simulations the win is more negligible, just a constant factor.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

While such an approach does reduce the computational overhead, the system will no longer strictly conserve energy, as the interaction is no longer exactly "pairwise", the force is not symmetric i.e. Newton's third law is broken.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Without a viscosity term the approximate SPH simulation does start to boil with time, which is expected. But thankfully even a low viscosity fixes this.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Not sure if I have seen this applied for Lagrangian fluid simulations before, you may correct me if someone already did something like that (probably yes).

Lucid Scientific, Inc. profil fotoğrafı
Lucid Scientific, Inc.1 yıl önce

Expand the possibilities of your metabolic research. Resipher tracks real-time cellular oxygen consumption in standard 96-well plates, delivering continuous real-time data directly from your incubator. Request a free virtual demo or quote today >>

Benzer Videolar

Elon Musk on how to win at life if the simulation theory is true: Elon: "I do have a theory of why, if simulation theory is true, then it is actually very likely that the most interesting outcome is the most likely. Because only the simulations that are interesting will continue. The simulators will stop any simulations that are boring, because they're not interesting." Joe: "But here's the question about the simulation theory. Is the simulation run by anyone, or is..." Elon: "It would be run by someone. The program, like, in this reality that we live in, we run simulations all the time. When we try to figure out if the rocket's gonna make it, we run thousands, sometimes millions of simulations, just to figure out which path is the good path for the rocket, and where can it go wrong, where can it fail." "But when we do these millions of simulations of what can happen with the rocket, we ignore the ones where everything goes right, because we have to address the situations where it goes wrong." "For AI simulations as well, all these things, we keep the simulations going that are the most interesting to us." "So if simulation theory is accurate, if it is true, who knows, then the simulators will only continue to run the simulations that are most interesting. Therefore, from a Darwinian perspective, the only surviving simulations will be the most interesting ones." "The only rule is you must keep it interesting, or the boring simulations will be terminated."

Naruto

206,664 görüntüleme • 4 gün önce