Problems in SPH implementation
Hi there everyone! I'm trying to implement SPH using CPU single core. I'm having troubles in making it stable. I'd like some help in order to understand what is wrong and how could I fix it. Please, take a look at the following videos:
Water inside sphere using Kelager's parameters Water inside big box Water inside thinner box I've already tried using XSPH, the hash method to find the neighbors (now I'm using the regular grid, because the hash method didn't work for me) and two different ways of calculating the pressure force. Any ideas? Thanks! |
I'm using mostly the following articles:
Particle-Based Fluid Simulation for Interactive Applications, Matthias Müller, David Charypar and Markus Gross Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics, Micky Kelager Smoothed Particle Hydrodynamics Real-Time Fluid Simulation Approach, David Staubach It seems that the pressure force is being calculated better through Müller equation than Kelager's (both can be found in Kelager's article, one is equation 4.10 and the other is 4.11). |
I've just tested simulating steam as well (as described by Kelager):
Steam inside a sphere I'm posting here because you guys that have more experience than me in CFD simulations could have an idea of what is going on (e.g., the problem probably is with the pressure force, or viscosity, or fiding the neightbors, or with collision response, etc). I can post the Fluid class if you guys need it. Thanks! |
looking at all the videos so far, i would say that your instability is coming from lack of neighbors in some of the particles. Please check how others are handling when number of neighbors fall below certain level.
Everything else looks good. Did you try the same with with smaller time step too and see when it becomes unstable. |
Quote:
About that lack of neighbors, I've read some articles, but none talked about it. Actually, I'm not sure if that's the problem. The first and the third video shows a good number of neighbors, don't you think? Kelager says that near-incompressibility can be achieved by increasing k (gas stiffness) and decreasing the timestep. I did that and the results are totally diferente. It seems more stable actually, but it feels less like a liquid. Also, if I decrease the timestep and increase the gas stiffness, then the liquid won't stop. It only stopped when I added a kind of friction for the velocity after collision. Which is the problem with the box in your opinion? Thanks again! Observation: I've seen that in at least one video, the timestep in the record is wrong. Please, read the description in the video. There's the correct value. |
All times are GMT -4. The time now is 08:35. |