Hi!

Iam trying to develop a very basic 2d SPH program in python and it seems that in this forum there are actually some people who know more about this topic^^

I have read a ton of literature but as English is not my main language im running into a few problems here. Right now I created a basic SPH program that calculates the movement based purely on the pressure gradients. I think my main problem is the understanding of the basic kernel interpolation.

I see the same formulas everywhere but sometimes I wish someone supplied a basic example with values to compare with.

to calculate the density of a specific particle i need to use this:

- 2D Kernels:

I don’t really understand what they normalization factors (15/pih^6) are for and no kernel that is supplied online does actually equal to “1”. Some are even called the same but the volume created by the kurve (for 2D) is not even close to one. Also i found different formulas for the same kernel. the Spiky Kernel can be written as “factor * (h-r)^3” or “factor * (1-(r/h))^3”.

“factor * (h-r)^3” with the factor being “10/(PI()*I3^5)” does actually provide the same volume even if “h” is changed. So I assumed it should be correct. The value is actually ~ 4.6 (not 1!)

I tried it in excel for 2d! i hope i did it the right way. maybe my whole understanding of how it works is wrong...

As I use different Kernels for calculating the density (poly6) and pressure (spiky) I think the totally different values do fu** up my calculations. Using poly6 my density estimation is around “455” while using the spiky kernel leads to densitys in the range of millions! This brings me to my second question

2. People talk about using the rest density ( for “p = (p – p0)” ) like a real density! They use 1000 kg/m³ for it. But isn’t the density basically a pseudo density? How can I compute realistic densities and values out of a summation of weighted mass points? Like I said – my rest density is highly influenced by the kernel and is between 100 and 10000000

attachments:

- simple excel sheet in rar. maybe someone can edit it to be correct?

it goes all boom:

no viscosity so kinetic energy is preserved?

hm?

**Edited by Peacekeeper, 31 March 2014 - 07:02 PM.**