SPH

Summary

SPH (Smoothed Particle Hydrodynamics) is a GPU-accelerated particle-based fluid solver that simulates liquids and granular materials by treating them as collections of interacting particles. This operator uses the SPH method where each particle carries physical properties like density, pressure, and velocity, and interacts with neighbors within a smoothing radius. The solver supports two modes: Fluids for liquid simulations with viscosity and surface tension, and Grains for granular materials like sand with repulsion and attraction forces.

The simulation computes particle interactions through neighbor searches within the smoothing radius, calculating density-based pressure forces to maintain target density and optional viscosity forces for fluid thickness. You control the physical behavior through parameters like target density (incompressibility), viscosity (fluid thickness), cohesion (particle stickiness), surface tension (droplet formation), and adhesion (sticking to surfaces). The solver uses substeps and iterations to improve stability and accuracy, with adjustable time scaling for slow-motion or accelerated effects.

SPH supports multiple collision types including ground planes, bounding boxes, arbitrary collision geometry, and volumetric container geometry for creating vessels. This makes SPH suitable for water splashes, pouring liquids, sand and debris, viscous fluids like honey, and interactive particle-based effects.

Parameters

Page: SPH

Target Particles Update POP Particlesupdatepop Reference to a POP node downstream in the network. This reference will cause a feedback loop and re-injects the particles next frame.
Solver Mode Solvermode Simulation mode: Fluids for liquids with viscosity, Grains for granular materials.
Substeps Substeps Number of solver substeps per frame.
Iterations Iterations Solver iterations per substep for constraint satisfaction.
Time Scale Timescale Global time multiplier for simulation speed.
Time Step Timestep Read-only display of effective timestep, equal to 1/FPS of TouchDesigner.
Number of Particles Numparticles Particle count when no input connected.
Smoothing Radius Smoothingradius Interaction distance for neighbor particle forces.
Max Neighbors Maxneighbors Maximum neighbor count per particle for force calculations.
Initialize Initializepulse Pulse to reset simulation and spawn initial particles.
Start Startpulse Pulse to begin simulation from initialized state.
Play Play Toggle continuous simulation playback.
Step Steppulse Pulse to advance simulation by one frame while paused.

Page: Properties

Target Density Targetdensity Rest density the solver tries to maintain.
Viscosity Viscosity Fluid thickness and resistance to flow.
Cohesion Cohesion Particle attraction force creating sticky fluid behavior.
Surface Tension Surfacetension Force causing droplet formation and surface smoothing.
Adhesion Adhesion Particle sticking force to collision surfaces.
Repulsion Weight Repulsionweight Strength of particle-particle repulsion force for granular materials.
Attraction Weight Attractionweight Strength of particle-particle attraction for clumping behavior.

Page: Collisions

Enable Ground Collision Enablegroundcollision Enables infinite ground plane collision.
Ground Position Groundposition XYZ position of ground plane.
Ground Position Groundpositionx
Ground Position Groundpositiony
Ground Position Groundpositionz
Display Ground Displayground Visualizes ground plane in output.
Enable Bounding Box Enablebbox Enables box-shaped collision boundary from POP geometry.
Bounding Box Bbox A reference to a POP defining the bounding box collision bounds.
Display Bounding Box Displaybbox Visualizes bounding box collision geometry.
Lower Bounds Lowerbounds Toggle to enable lower bounding planes for XYZ axes.
Lower Bounds Lowerbounds1
Lower Bounds Lowerbounds2
Lower Bounds Lowerbounds3
Upper Bounds Upperbounds Toggle to enable upper bounding planes for XYZ axes.
Upper Bounds Upperbounds1
Upper Bounds Upperbounds2
Upper Bounds Upperbounds3
Enable Geometry Collision Enablecollisiongeo Enables collision with arbitrary POP geometry.
Collision Geometry Collisiongeo A reference to a POP defining the collision geometry for surface collision detection.
Display Collision Geometry Displaycollisiongeo Visualizes collision geometry in output.
Enable Container Geometry Enablecontainergeo Enables volumetric container collision using voxelized geometry.
Container Type Containertype Source type for container collision volume.
POP Geometry pop
SDF sdf
T3D t3d
Container Geometry Containergeo Reference to a POP geometry to voxelize into collision container.
Max Axis Resolution Maxaxisres Voxel resolution for container geometry.
Ray Direction Mode Raydirmode Method for determining ray direction when voxelizing container geometry.
Constant constant
Inside Sphere insidesphere
Ray Direction Raydir Constant ray direction vector when Ray Direction Mode is set to Constant.
Ray Direction Raydirx
Ray Direction Raydiry
Ray Direction Raydirz
Display Container Geometry Displaycontainergeo Visualizes container geometry in output.
Container SDF / T3D Containertop Reference to a 3D texture containing SDF or T3D volume for container collision.
Lower Bounds Toplowerbounds Minimum XYZ coordinates of the SDF/T3D volume bounds.
Lower Bounds Toplowerboundsx
Lower Bounds Toplowerboundsy
Lower Bounds Toplowerboundsz
Upper Bounds Topupperbounds Maximum XYZ coordinates of the SDF/T3D volume bounds.
Upper Bounds Topupperboundsx
Upper Bounds Topupperboundsy
Upper Bounds Topupperboundsz
Force Collision Forcecollision Aggressively keeps particles inside container.
Pre-Shrink Preshrink Downsamples container volume before blur for performance.
Filter Size Size Blur kernel size for smoothing container voxel field.

Page: Forces

Gravity Gravity Gravity force vector in world space.
Gravity Multiplier Gravitymultiplier Scales gravity force magnitude.
Velocity Damping Velocitydamping Global velocity decay per frame.
Static Threshold Staticthreshold Velocity threshold below which dynamic friction becomes static friction.
Dynamic Scale Dynamicscale Dynamic friction coefficient for moving particles.
Limit Acceleration Limitacc Clamps particle acceleration to prevent instability.
Max Acceleration Maxacc Maximum allowed acceleration magnitude.

Page: Common

Free Extra GPU Memory Freeextragpumem Free memory that has accumulated when output memory has grown and shrunk.

Inputs

Input 0 POP Particles In

Outputs

Output 0 POP Particles Out