Class SPHSystem

Smoothed-particle hydrodynamics system

Todo

Make parameters customizable in the constructor

Constructors

Properties

densities: number[]
density: number

Density of the system (kg/m3).

Default

1
eps: number

Default

0.000001
neighbors: Body[][]
particles: Body[]

The particles array.

pressures: number[]
smoothingRadius: number

Distance below which two particles are considered to be neighbors. It should be adjusted so there are about 15-20 neighbor particles within this radius.

Default

1
speedOfSound: number

Default

1
viscosity: number

Viscosity of the system.

Default

0.01

Methods

  • Add a particle to the system.

    Parameters

    Returns void

  • Get neighbors within smoothing volume, save in the array neighbors

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • r: number

    Returns number

  • Remove a particle from the system.

    Parameters

    Returns void

  • Returns void

  • Parameters

    • r: number

    Returns number