Fluid simulation

On this page 8

Fluid simulation is the numerical computation of how a liquid moves through space and time, solved frame by frame so that water, mud, honey or lava behave plausibly in a rendered shot. In 3D graphics & animation, it belongs to the Simulation & effects toolset and sits between particle systems and smoke solvers: the artist defines sources, colliders and forces, and the solver produces a sequence of volumes or meshes that are cached and rendered.

Production fluid solvers approximate the Navier-Stokes equations, which describe conservation of momentum and mass in a fluid. Film and game studios rarely aim for engineering accuracy. The goal is visual plausibility at a controllable cost, which is why the field favors hybrid methods, adaptive resolution and heavy caching over exact physics.

How a fluid solver advances each time step

A fluid solver repeats the same sequence of operations for every time step, and several steps usually fit inside one animation frame. Each step moves the fluid, applies external influences and then corrects the velocity field so that the liquid does not gain or lose volume.

  1. Advection carries velocity and other quantities along the current flow.
  2. External forces such as gravity, wind or custom force fields are added.
  3. Collision handling pushes fluid out of colliders and applies boundary conditions.
  4. Pressure projection solves a large linear system that makes the velocity field divergence free, which enforces incompressibility.
  5. Surface extraction converts the result into a level set or polygon mesh for rendering.

The pressure solve is usually the most expensive stage, because it couples every cell of the domain. Solvers use a preconditioned conjugate gradient method or a multigrid scheme here, and their convergence tolerance has a direct effect on whether a liquid slowly shrinks or keeps its volume.

Step size is governed by the CFL condition: fluid should not travel more than a few cells in a single step. Fast splashes therefore require more simulation substeps, and an artist who lowers the substep count to save time often sees particles tunnel through thin colliders.

Grid, particle and hybrid methods

Fluid simulation methods differ mainly in where the fluid state is stored: on a fixed grid, on moving particles, or on both. Each choice trades detail, stability and memory differently.

MethodState stored onStrengthWeakness
Eulerian gridFixed voxel gridStable pressure solveNumerical dissipation blurs detail
SPHParticles onlyNo grid, natural splashesHard to keep incompressible
FLIPParticles and gridLively, low dissipationNoisy surfaces, needs particle count
APICParticles and gridPreserves rotation, less noiseSlightly more damping than FLIP
Position based fluidsParticles with constraintsFast, robust for real timeLess physical, can look soft
Main families of fluid simulation methods

The FLIP fluid approach dominates film liquids because it transfers velocity changes rather than whole velocities between particles and grid, which keeps small swirls alive. Many tools blend FLIP with a small share of PIC, typically a FLIP ratio of 0.9 to 0.99, to calm the noise. Smoothed-particle hydrodynamics remains common in real-time and engineering contexts where a grid is impractical.

Key parameters that shape the result

A handful of settings control most of the look and the cost of a liquid simulation. Understanding them saves more time than any hardware upgrade, because resolution scales the cost cubically in three dimensions.

ParameterWhat it controlsTypical effect of raising it
Voxel sizeSpatial resolution of the gridSmaller cells add detail and memory use
Particle separationDensity of fluid particlesFiner splashes, larger caches
SubstepsTime steps per frameBetter collisions, longer simulation
ViscosityResistance to shear flowThicker, slower liquid such as honey
Surface tensionCohesion at the free surfaceRounder droplets, beading on objects
Narrow band widthDepth of simulated layerMore volume simulated below the surface
Core fluid simulation parameters

Halving the voxel size multiplies the cell count by roughly eight times, and simulation time often grows even faster because more substeps are needed. For this reason studios run low-resolution previews for timing and art direction, then increase resolution only for approved shots.

Fluid simulation compared with neighboring effects

Fluid simulation in the narrow sense means liquids with a free surface, which distinguishes it from gas solvers and other procedural effects in the same Topic. The boundaries matter when choosing a tool and planning a shot.

EffectMediumTypical outputKey difference
Liquid simulationWater, oil, mudMesh or level setTracks a sharp free surface
Smoke and fire simulationGas and combustionDensity and temperature volumesNo surface, buoyancy driven
Ocean simulationOpen sea surfaceDisplacement mapsSpectral waves, not a full solver
Whitewater simulationFoam, spray, bubblesSecondary particlesDerived from a base liquid sim
Granular simulationSand, snow, grainParticlesFriction instead of fluid pressure
Fluid simulation and related effects

Large water shots usually combine these layers: a spectral ocean for the distant surface, a FLIP simulation near the action, and whitewater particles for foam and mist. The layers are blended at render time so that the expensive solver covers only the region the camera actually inspects.

Tools and production workflow

Production fluid work follows a set up, simulate, cache, mesh, render pipeline, and every stage writes data to disk. Houdini is the industry reference for FLIP liquids, while Maya uses Bifrost, Blender ships Mantaflow, and 3ds Max artists often rely on tyFlow or third-party plugins.

  • Simulation cache files store particles or volumes per frame and can reach hundreds of gigabytes for a hero shot.
  • Meshing converts particles into a surface; smoothing and dilation settings strongly affect the final look.
  • Colliders need clean, closed geometry with enough thickness relative to the voxel size.
  • Retiming and wedging (running variations of one parameter) help directors choose a take without repeated manual tweaking.

Limitations and common mistakes

Most failed fluid simulations come from scale and resolution errors rather than solver bugs. A short diagnostic list helps narrow the cause quickly.

SymptomLikely causeFix
Water looks like syrupScene built at wrong scaleModel in real meters or adjust gravity
Volume slowly disappearsLoose pressure toleranceTighten solver tolerance or iterations
Fluid leaks through wallsCollider thinner than a voxelThicken collider or add substeps
Blobby, noisy surfaceToo few particles per cellRaise particle count, refine meshing
Simulation explodesExtreme forces or tiny gapsReduce force strength, clean geometry
Frequent fluid simulation problems

Real-world scale is the single most important warning: a liquid in a cup modeled ten times too large falls slowly and reads as a giant flood. Real-time engines face a different limit, because they rarely afford a full 3D solve and instead fake liquids with height fields, shaders and short particle bursts.

Put simply

Fluid simulation lets the computer work out how water would really move. Nobody has to draw every splash by hand. The artist pours virtual liquid into a scene and adds walls and objects. The software then calculates where each tiny piece of liquid goes, frame after frame.

Think of a box filled with millions of tiny marbles. They push on each other and refuse to be squeezed. The result looks like real water because it follows the same basic rules of motion. It needs much computing time, so artists test small versions first.

In practice

A small visual effects team works on a commercial in which a glass bottle falls into a kitchen sink full of water. The artist rebuilds the sink at real-world scale in meters, imports the animated bottle as a collider, and runs a FLIP simulation with a coarse particle separation to check timing in about twenty minutes.

After the director approves the motion, the artist refines the particle separation, raises the substeps to four per frame to keep the fast bottle from passing through the liquid, and adds a whitewater pass for bubbles. The final simulation runs overnight on one workstation, produces roughly 180 GB of cache, and is meshed and rendered with a refractive water shader. The result is a six-second shot that reads as real water without any hand-animated splash.