Skip to main content

Module fluids

Module fluids 

Source
Expand description

SPH fluid simulation, height-field water, buoyancy, and fluid rendering integration.

§Components

  • SphParticle — position, velocity, density, pressure, mass, neighbors
  • SphSimulation — Weakly Compressible SPH (WCSPH) with cubic spline kernel, pressure force, viscosity, surface tension, solid repulsion, CFL-adaptive timestep
  • DensityGrid — spatial hash for O(1) average neighbor lookup
  • FluidRenderer — iso-surface extraction as glyph positions/colors for GlyphPool
  • WaterSurface — height-field shallow-water equations with wave propagation, damping, and rain-drop ripples
  • BuoyancyForce — compute buoyant force on a RigidBody submerged in water

Structs§

BuoyancyForce
Compute the buoyant force on a rigid body submerged in a WaterSurface.
DensityGrid
Spatial hash grid for O(1) average neighbor search.
FluidGlyph
Glyph data for rendering a fluid.
FluidRenderer
Extracts density iso-surface points and colors for integration with GlyphPool.
SphParticle
A single SPH fluid particle.
SphSimulation
Weakly Compressible SPH (WCSPH) fluid simulation.
WaterSurface
Height-field water simulation using the shallow water equations.

Functions§

cubic_kernel
Cubic spline kernel W(r, h).
cubic_kernel_grad
Gradient of cubic spline kernel dW/dr (scalar, radial).
kernel_gradient
Gradient vector: dW/dx = (dW/dr) * (r_vec / r)