Potential Flow Explorer
Build a flow from sources, sinks and vortices. Move the pieces and watch simple fields combine into surprising patterns.
Model assumptions
The velocity field is constructed by linear superposition of classical two-dimensional potential-flow solutions.
- Two-dimensional flow
- Incompressible flow
- Inviscid model
- Linear superposition of elementary flows
- Ideal singularities are numerically regularised only inside a very small core
- No boundary layers, separation or viscous drag
This is a potential-flow teaching model, not a CFD solution. Outside the small numerical core surrounding each singularity, the classical analytical velocity equations are used directly.
Getting started
Build two-dimensional flow fields by adding elementary solutions. A source pushes fluid radially outwards, a sink draws it inwards and a vortex adds circulation. A uniform freestream carries the combined pattern from left to right. The canvas covers x = −6 to 6 m and y = −3.5 to 3.5 m, with positive y upwards.
- Start with the default source of +8 m²/s at (−1.5, 0) and sink of −8 m²/s at (1.5, 0), in a 1.5 m/s freestream. Together they create a Rankine-oval-like pattern.
- Select an object on the canvas or in the Objects list, then change its Strength. A source with negative strength becomes a sink; a vortex with negative circulation reverses rotation.
- Use + Source, + Sink or + Vortex to add elements, and drag their markers to reposition them. Delete removes the selected element; Clear objects leaves the freestream in place.
- Hover over the canvas to probe velocity. Toggle particles, trails, streamlines and velocity vectors to inspect the field in different ways.
Try setting the freestream to zero to isolate the source–sink interaction, or add a vortex to break the symmetry. Trails start switched off; enable Trails to see recent trajectories. Pause stops particle motion while you edit. Reset restores the starting pair and default controls with trails off and resumes playback.
The mathematics
Outside their singularities, the classical elementary fields are incompressible and irrotational. Their velocity potentials satisfy Laplace’s equation. Because this equation is linear, the potentials—and their velocity fields—can be added. The pressure does not follow the same linear superposition rule.
Here is the unit vector in the freestream direction, indexes the sources and sinks, and indexes the vortices.
For an element centred at , define , and . A source or sink of strength contributes:
In this two-dimensional model, has units of : volume flow per unit depth. Positive is a source and negative a sink. The radial flux across a circle surrounding an isolated element is .
A point vortex of circulation contributes:
Circulation also has units of . Positive produces counterclockwise motion; negative produces clockwise motion. An ideal point vortex is irrotational away from its centre but has nonzero circulation around a loop enclosing it; its velocity potential is locally defined and changes by around a complete circuit.
The explorer sums all the contributions and adds , then sums all the contributions. The probe reports these components and the speed .
For the analytical building blocks and their superposition, see MIT’s Potential Flows lectures.
How it is computed
The source and vortex formulas diverge at their centres. The implementation replaces every denominator with a bounded value:
The regularised contributions are then
Outside the 0.07 m core these are the exact classical velocity formulas. Inside, velocity varies linearly with distance from the centre. This numerical regularisation is not viscous diffusion: the source core has distributed divergence and the vortex core has distributed vorticity. The ideal potential-flow assumptions apply outside those cores.
The 1,800 passive particles follow . Each animation interval is capped at 0.03 s and divided into two midpoint Runge–Kutta substeps. With substep duration , the update is:
Particles are reseeded when they leave the view or start a substep within of any element. Seeding uses the domain, inflow boundary and positive sources to keep the field populated; particle counts are not a measurement of fluid density or flux.
Streamlines are traced using the midpoint method on , with a spatial step of 0.045 m and at most 520 steps. The code uses 21 inlet seeds plus 12 seeds around each source or sink at radius 0.16 m. It traces forwards from sources and backwards from sinks; backwards tracing is a drawing technique, not reversed physical flow. The paths are cached until the field changes.
Reading the flow
Streamlines indicate the current direction field. Trails show recent particle motion and coincide with streamline curves when the settings remain fixed, up to integration error. Near stagnation points, approaches zero; the streamline tracer stops following a direction when its magnitude falls below .
Trail colours use seven relative speed bands and rescale with the freestream. Arrow lengths and opacity are capped for readability, so neither is an absolute velocity scale. Use the probe for values. A finite collection of seeds may miss closed or isolated streamline regions, particularly around vortices.
What the model assumes
This is a prescribed, inviscid flow field with stationary elements between edits. The elements do not move under each other’s induced velocities. No solid boundary is enforced, and the model does not calculate pressure, lift, drag, boundary layers, separation or turbulence. An oval-shaped dividing streamline can suggest a body outline, but no physical body has been inserted into the simulation.
The displayed particles are visual tracers. Finite timesteps, reseeding and core regularisation affect paths close to strong elements; this is not a mesh-based CFD solution. Horizontal and vertical coordinates are scaled independently to fit the canvas, so screen aspect ratio can distort geometric proportions.
