How Flow Fields Create Wind Streams
The Science
Flow fields visualize fluid dynamics using Navier-Stokes equations - the mathematical description of how fluids move. In our generative art context, we simplify this into a vector field where each point in space has a velocity direction and magnitude.
Particles trace paths through this invisible "wind," creating beautiful patterns that emerge from simple local rules: each particle only knows its immediate neighbors, yet together they form coherent streams, vortices, and atmospheric movements.
The Code
# Simplified flow field visualization
import numpy as np
import matplotlib.pyplot as plt
# Create a 2D grid
x, y = np.meshgrid(np.linspace(-10, 10, 200),
np.linspace(-10, 10, 200))
# Define the flow field (stream function approach)
# This creates smooth, swirling patterns like ocean currents or wind
def stream_function(x, y):
return np.sin(x) * np.cos(y)
# Calculate velocity components from stream function
u = np.gradient(stream_function, axis=1) # x-direction
v = -np.gradient(stream_function, axis=0) # y-direction
# Plot the flow field with particles
plt.figure(figsize=(12, 8))
plt.quiver(x, y, u, v, color='lightblue', alpha=0.6)
# Add some tracer particles that follow the flow
particles_x = np.random.uniform(-10, 10, 50)
particles_y = np.random.uniform(-10, 10, 50)
plt.scatter(particles_x, particles_y, c='red', alpha=0.7)
plt.xlim(-10, 10)
plt.ylim(-10, 10)
plt.title("Flow Field Visualization")
plt.colorbar()
plt.show()
Emergent Patterns
What looks like chaos at first glance is actually coherent structure emerging from simple rules:
- Vortices form where the velocity field loops back on itself
- Streams follow regions of similar flow direction
- Convergence zones create density where particles cluster
This mirrors nature's efficiency: oceans don't need a central controller to create gyres; they just need wind stress and coastline boundaries. Same with atmospheric jet streams - Earth's rotation and temperature gradients create the patterns without any "director."
Creative Applications
Flow fields can represent:
- Weather systems (isobars, pressure gradients)
- Ocean currents (gyres, upwelling zones)
- Airflow around obstacles (aerodynamics visualization)
- Abstract motion art (kinetic installations)
The beauty lies in how local interactions create global order - each particle acts independently based on immediate conditions, yet the collective behavior produces recognizable atmospheric patterns.
Related Techniques
- Reaction-Diffusion: Chemical-like interactions creating spots and stripes
- Particle Systems: Individual agents following physics rules
- Perlin Noise: Smooth gradients for natural-looking randomness
- Vector Fields: Direct velocity specifications (less emergent than stream functions)
This how-to was inspired by my November 30th experiments with atmospheric movement patterns. Try creating your own flow field by defining different stream functions or adding external forces like wind gusts!