Advertisement

Particle fluid simulation

Started by October 04, 2014 11:25 AM
12 comments, last by BRabbit27 10 years, 4 months ago

https://docs.google.com/presentation/d/1fEAb4-lSyqxlVGNPog3G1LZ7UgtvxfRAwR0dwd19G4g/edit#slide=id.p

Have you looked at LiquidFun for ideas? The above link is a slideshow describing the code.

http://google.github.io/liquidfun/

I've been doing a code review of Box2D in my spare time. It is amazing what you learn when you pick apart code like this.

Thank you very much for the links, I will take a look at it ! :)

@h4tt3n yes ... I guess what you say makes actually a lot of sense. The thing is that I was reading through some SPH papers and in those, one of the properties of the smoothing kernels is that they must be normalized. So, I have two different kernels (which you can see at the paper referenced above) which have different normalization factors, therefore, I was computing the support h for each of them. What I can actually do is set the same kernel support and then compute the correct normalization factor, am I right on this?

Advertisement

It's worth considering that whilst the equations in SPH might be "physically based", the behaviour in reality, certainly with a naive implementation, can be rather bouncy, very sensitive to things like the timestep (i.e. you have to tune your parameters for the timestep), and a tendency towards being unstable. I haven't done anything on this for quite a few years now, so may be completely out of date. However, it may be that you can get results that look more physically plausible in spite of being less physically based by using more ad hoc methods - for example see Dennis Gustafsson's blog posts.

After some more reading and thinking, I guess I found something that could help.

Basically the poly6 kernel has the form W(|r|, h) = k * (h^2 - r^2)^3 where I have to determine the value of k in order to have my kernel normalized for the desired value of the support h. Am I right on this? So if I want a smoothing kernel in the range [-0.1, 0.1] I just need to integrate this right?

Now in many of the papers proposing smoothing kernels they always have the normalization factor k depending on ? and h. Can someone explain me how to get to a normalization factor like that? Because I actually can compute the integral just as W is and get the value of the factor.

This topic is closed to new replies.

Advertisement