Water

Water simulation resources

(Incomplete) List of movies featuring cg water

Smoothed particle hydrodynamics

Smoothed particle hydrodynamics (SPH) is a method to simulate fluid flow using particles. Instead of dividing a volume into a grid, particles are used to represent the values of the simulation over the volume. The main idea behind this approach is that physical quantities can be smoothed over the volume; that is the quantity of a point in space can be computed with a weighted sum over the nearby particles.

In general, a quantity A is computed as follows:

If the smoothing kernel is even and normalized (integrates to 1) (Müller 2003), the interpolation is of second order accuracy.

The derivative of the quantity A is defined as:

and the laplacian is defined in the same way.

An inherit problem of the SPH is that the derivative isn't necessarily symmetric or vanishes if the quantity A is constant. One way of seeing the derivative is as the exact derivative of an approximate function. More about this can be read in (Smoothed particle hydrodynamics, J J Monaghan)

Water using particles

In short, the movement of a fluid is governed by two equations, the mass conservation equation, and the conservation of momentum.

One advantage of computing these equations using particles is that the equations are simplified:

The navier stokes equation can then be expressed as:

The pressure force depends on the different pressures on the particles, so for each timestep, a new pressure has to be computed before the acceleration is computed. This is done with the ideal gas law:  p = k*\rho , where k is a gas constant. For numerical stability an offset can be used to compute the density as  p = k*(\rho - \rho_0) , where \rho_0 is the rest density (of water 1000 kg/m^3).

In short the procedure to simulate water with particles is:

for each dt:
    for each particle p:
        ComputePressure()
    for each particle p:
        ComputeForces()
        UpdateVelocityAndPosition()

References


2011-03-29 17:45