Search code examples
algorithmsimulationphysicsgame-physicsparticle-system

SPH fluid - kernel derivitive


I'm currently trying to create an SPH fluid simulator. To get started I've tried to implement the paper from Müller. So the whole algorithm is based on calculating three different forces (pressure, viscosity and surface tension).

The pressure-force can be calculated with equation 9 where the derivitive of the kernel function is the partial derivitive whit respect to r_{i,x} r_{i,y} r_{i,z}. So we get a three dimensional vector out of it.

But for viscosity and surface tension we need the second derivitive of W which should be a three dimensional vector too but equation 14 and 19 expect a scalar?

Anyone got a hint for me?


Solution

  • I cannot see any major problems in equations 14, and 19 (but I do not claim to understand the paper too thoroughly). Could it be that the notation has just lead you astray?

    The kernel function W(r) is a scalar field (vector parameter, scalar result). If we take its gradient 𝛁W, we get a vector field. However, if we take the Laplacian (𝛁²) of W, it is the same as calculating the divergence of the vector field, i.e., 𝛁·𝛁W. This, in turn, gives a scalar field by the definition of divergence.

    So, with this in mind it seems that both equations 9 and 14 look reasonably sane.