CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problems in SPH implementation (https://www.cfd-online.com/Forums/main/195766-problems-sph-implementation.html)

YardenJ2R November 16, 2017 14:37

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!

YardenJ2R November 17, 2017 12:11

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).

YardenJ2R November 17, 2017 15:20

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!

arjun November 17, 2017 17:55

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.

YardenJ2R November 20, 2017 10:00

Quote:

Originally Posted by arjun (Post 671959)
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.

First of all, thank you for your reply!

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.