Skip to content
CoreSource checked

Stable Fluids

Stable Fluids advances physical or agent state under forces, constraints, or collisions.

Quick Facts

Compact metadata for implementation and discovery.

Category
Simulation
Difficulty
Intermediate
Family
Simulation
Tier
Core
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
1
Code example
Ready
Visualization
Ready

Overview

Stable Fluids is a simulation method that advances physical or agent state using forces, constraints, collisions, or transport. It is useful when stability, plausibility, or physical behavior needs an explicit update rule.

Core Concepts

time stepstate updateconstraint or forceconstraints

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n t)

Average

O(n t)

Worst

O(n t)

Space

O(n)

When to Use

  • Use Stable Fluids when the simulated system matches its force, collision, or constraint model.
  • Use it when time-step limits and stability checks can be enforced.

When Not to Use

  • Avoid when the time step, collision model, or constraints make the method unstable.
  • Avoid when visual plausibility is enough and a cheaper approximation is acceptable.

What It Does

  • Computes simulation within Simulation workloads (O(n t) time, O(n) space).
  • Works by It is useful when stability, plausibility, or physical behavior needs an explicit update rule.
  • Maintains key invariants across time step, state update, constraint or force.

Use Cases

  • Physics simulation
  • Animation
  • Fluid or particle systems

Inputs

  • Physical state
  • Forces, constraints, or collision geometry
  • Time step

Outputs

  • Updated state
  • Collision response
  • Simulated motion or field

Key Formulas (1)

Semi-Lagrangian advection

qnext(x) = qcurrent(x − δt · velocity(x))
q_next(x) = q_current(x - delta_t * velocity(x))

Samples backward along velocity to advect quantities stably.

Pseudocode

  1. 1.Initialize positions, velocities, fields, constraints, or agents
  2. 2.Compute forces, collisions, constraints, or transport
  3. 3.Advance state by the time step
  4. 4.Resolve constraints or collisions
  5. 5.Return the updated simulation state

Canonical Example

Input
state at time t with delta_t = 0.016
Output
state at time t + delta_t
Explanation
Stable Fluids applies its update rule to advance the simulation by one step.

Implementation Notes

  • Clamp or adapt time steps when stability depends on them.
  • Keep collision, force, and constraint phases independently testable.

Common Pitfalls

  • Large time steps can create unstable motion even when equations are correct.
  • Resolving constraints in the wrong order can inject energy or jitter.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Show particles, bodies, or fields evolving as each simulation step is applied.

Stable Fluids mechanism walkthrough step 1 of 5x₀x₁x₂x*
Step 1 of 5: Initialize positions, velocities, fields, constraints, or agents
simulation

Notes

Stable Fluids operates in O(n t) time and O(n) space within the Simulation family. Key governing relation: q_next(x) = q_current(x - delta_t * velocity(x)). Often compared with Euler Integration and Verlet Integration.

Sources (1)

What each reference supports for this entry.

Fluid Simulation for Computer Graphics

Book

Fluid and simulation reference for state updates or fluid behavior in Stable Fluids.

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Often paired withEuler Integration

Stable Fluids can be combined with Euler Integration in simulation pipelines that need compatible state updates.

Tags

Simulation