Live data from Hacker News

Fast real time fluid simulator based on MPM algorithm

kotsoft.github.io

51–56 of 56 posts

Re: Fast real time fluid simulator based on MPM algorithm

#51
post #29

Earlier quoted context omitted.

They do actually. Red > orange > green > blue. Let it settle.

But there are still bubbles within layers, no?

I'm not sure if the between layers thing might be a similar thing to when bubbles show up on the sides and bottom of a glass of water. Some of the bubbles are also staying because once it's settled down, there isn't enough action to cause them to pop. The constant associated with the surface tension in the sim can also be turned down.

Re: Fast real time fluid simulator based on MPM algorithm

#52
post #16

Nice. I like how it's full screen and responds fluidly to changing the browser window size. Cool how it pauses when switching browser tabs. My RTX-3080* hums a little louder during the sim but not too much. I'm getting about 57 fps @ 3440x1440. *Actually probably my CPU fan doing the humming.

Thanks. It's a WebAssembly simulation so mostly CPU and very light on the GPU because it's just drawing points. It will actually run on mobile too with multitouch.

Re: Fast real time fluid simulator based on MPM algorithm

#53

For someone with high-school level understanding of classical Newtonian mechanics, what would be the best way forward to learn Continuum Mechanics and things like MPM, etc.? Any book/course recommendations?

Continuum mechanics in itself is a very different subject from particle-based methods to approximate continuum mechanics, like MPM. To actually learn continuum mechanics you need first a good understanding of vector calculus. But this is not necessary at all for using and tweaking particle based methods.

I see. What are the pre-requisites for understanding and playing around with MPM then? It's very hard to figure this out as someone who hasn't studied physics for a decade.

Re: Fast real time fluid simulator based on MPM algorithm

#54

Earlier quoted context omitted.

Continuum mechanics in itself is a very different subject from particle-based methods to approximate continuum mechanics, like MPM. To actually learn continuum mechanics you need first a good understanding of vector calculus. But this is not necessary at all for using and tweaking particle based methods.

I see. What are the pre-requisites for understanding and playing around with MPM then? It's very hard to figure this out as someone who hasn't studied physics for a decade.

Disclaimer: I'm not an MPM expert at all, but I work in computational fluid dynamics.

I would suggest to start with the paper I link to below. First skim read it to understand the structure. Then try to follow in detail the parts that interest you most, and play with the code they provide. If you encounter concepts you don't understand, which are necessary for progressing, go look those up on Wikipedia or Google Books (for textbooks).

https://www.researchgate.net/publication/336796234_Material_...

And don't be discouraged by the math notation. It's mostly just shorthand for things you probably understand very well in code.

For example the capital sigma (sideways M) with a letter "p" or something underneath simply means "loop over the range of the index p, and sum up the following expression for the different values of the index".

The capital delta (triangle pointing up) means "difference", for example delta-t is the increment from one time step to the next.

The upside-down delta is the Nabla, which means gradient, which means derivative in each spatial dimension.

Re: Fast real time fluid simulator based on MPM algorithm

#55

Earlier quoted context omitted.

I see. What are the pre-requisites for understanding and playing around with MPM then? It's very hard to figure this out as someone who hasn't studied physics for a decade.

Disclaimer: I'm not an MPM expert at all, but I work in computational fluid dynamics. I would suggest to start with the paper I link to below. First skim read it to understand the structure. Then try to follow in detail the parts that interest you most, and play with the code they provide. If you encounter concepts you don't understand, which are necessary for progressing, go look those up on Wikipedia or Google Book…

Thanks!

Re: Fast real time fluid simulator based on MPM algorithm

#56
post #4

Looks like this is the repo https://github.com/kotsoft/kotsoft.github.io

You probably also want to check the project from the same author that has more control sliders and code in human readable format instead of compiled wasm. Demo : https://kotsoft.github.io/particle_based_viscoelastic_fluid/ Code : https://github.com/kotsoft/particle_based_viscoelastic_fluid... Video : https://www.youtube.com/watch?v=3OxC4oqy74U edit : you probably also want to check one of the mentioned link : https:/…

Oh wow, great, thank you!
Post reply on HN