๐ง Smoothed particle hydrodynamics
Simulation
Section titled โSimulationโ๐ฏ A somewhat more elaborate demo using the Helion library
ยฉ๏ธ Hydrodynamics based on Smoothed Particle Hydrodynamics (SPH) Fluid Simulation with WebGL
Implementation
Section titled โImplementationโThere are two coordinate frames:
- SPH-domein: coordinates for the physics and calculations for neighbor cells.
- Helion-world: coordinates with which Circle and camera render particles.
These coordinates need not be identical. The view translates the SPHParticle.position
during synchronization.
+---------------------------------------------+ | SPHParticle | | โ | | Velocity, pressure, mass, density, position | +---------------------------------------------+ โ โ โผ +-----------------------------------+ | SPHParticleView.synchronizeWith() | | โ | | SPH-domein โ Helion-wereld | +-----------------------------------+ โ โ โผ +---------------------------------------+ | Circle | | โ | | Draw particle at transformed position | +---------------------------------------+