|
Laminar and Turbulent Flow Tutorial
This interactive tutorial demonstrates Laminar and Turbulent Flow, fundamental concepts in fluid dynamics. The simulation visualizes how fluid particles move through a pipe, showing the transition from smooth, ordered laminar flow (low Reynolds number) to chaotic, turbulent flow (high Reynolds number). The tutorial provides real-time visualization of particle motion, velocity profiles, boundary layers, obstacle interactions, and dye dispersion.
The simulation provides a real-time visualization of: (1) Particle Flow - hundreds of particles moving through a pipe with parabolic velocity profile, (2) Reynolds Number Control - adjustable parameter (Re) that determines flow regime, (3) Color Coding - particles change color based on flow regime (blue for laminar, red for turbulent), (4) Preset Scenarios - dropdown with pre-configured scenarios for quick exploration (Laminar Flow, Transition, Turbulent Flow, Reynolds Experiment, Wake Visualization, Streamlined Study, Boundary Layer Study), (5) Obstacle Mode - toggle to add obstacles with multiple shapes (Circle, Square, Triangle, Diamond, Airfoil, Canoe) showing how flow separates and creates wake turbulence (Von Kármán vortex street), obstacles are draggable with the mouse, (6) Boundary Layer Visualization - shows the viscous sublayer near pipe walls where flow velocity drops to zero (no-slip condition), (7) Dye Injection (Tracer) - click and drag to inject dye particles that demonstrate diffusion and mixing, recreating the famous Reynolds Dye Experiment, works even when paused, (8) Wake Turbulence - particles behind obstacles in turbulent flow show oscillating vortex patterns, (9) Dynamic Boundary Layer - boundary layer thickness changes with Reynolds number, (10) Simulation Controls - Play/Pause toggle, Step Forward/Backward for frame-by-frame analysis, Animation Speed slider (0.1-1.0) for detailed observation (thick for laminar, thin for turbulent), (9) Viscous Damping - particles near walls experience friction and reduced turbulence, (10) Real-time Physics - all effects update continuously as you adjust parameters.
Understanding Laminar Flow: At low Reynolds numbers (Re < 2000), fluid moves in smooth, parallel layers with no mixing between layers. The velocity profile is parabolic (Poiseuille flow), with maximum speed at the center and zero speed at the walls. Particles follow predictable paths, and dye injected into the flow remains in a coherent stream. This is the regime of smooth, ordered motion where viscous forces dominate.
Understanding Turbulent Flow: At high Reynolds numbers (Re > 2500), the flow becomes chaotic with rapid mixing. The velocity profile becomes flatter in the center (due to mixing), but still drops to zero at the walls. Particles move erratically, and dye injected into the flow disperses rapidly throughout the pipe. This is the regime where inertial forces dominate, creating eddies, vortices, and efficient mixing.
Understanding the Boundary Layer: The boundary layer is the "buffer zone" between a solid object (like a pipe wall or an airplane wing) and the free-flowing fluid around it. It indicates how much the object is dragging the fluid (or vice versa). The boundary layer is the thin region near solid surfaces where viscous effects are significant. Even in turbulent flow, the fluid touching the wall must be stationary (no-slip condition). The boundary layer thickness (δ) decreases as Reynolds number increases - thick for laminar flow, thin for turbulent flow. This creates a "viscous sublayer" where turbulence cannot penetrate, demonstrating that friction always dominates at the wall.
The "No-Slip" Condition (The Golden Rule): The most important concept is that fluid touching a solid surface does not move. If you look at water rushing through a pipe at 100 mph, the water molecules directly touching the metal wall are at 0 mph. They are stuck. The water just above them is moving at 1 mph, the layer above that at 10 mph, and so on, until you reach the full speed in the center. The Boundary Layer (δ) is simply the thickness of this transition zone - the distance from the wall where the fluid goes from 0% to 99% of the free stream speed.
Why is this practically important?
A. Drag and Fuel Efficiency (Aerodynamics)
For airplanes and cars, the boundary layer is the source of Skin Friction Drag:
- Thick Boundary Layer (Turbulent): Creates a lot of drag. The air is chaotic and "grabs" the surface, pulling the plane backward.
- Thin Boundary Layer (Laminar): Creates less drag initially but is unstable.
- Practical Use: Engineers design wings to keep the boundary layer laminar (smooth/thin) for as long as possible to save fuel. If the boundary layer "separates" (breaks off the surface), the plane stalls and falls out of the sky.
B. Heat Transfer (Computer Cooling / Radiators)
The boundary layer acts like an insulating blanket:
- If you are trying to cool a hot computer chip with a fan, a thick laminar boundary layer is bad. The heat gets trapped in that slow-moving air near the surface and can't escape into the fast air stream.
- Practical Use: Engineers actually want Turbulence here. They add bumps or fins to "trip" the boundary layer, making it turbulent. This mixes the hot air near the surface with the cold air above, cooling the chip faster.
C. Pipe Flow (Plumbing / Oil)
- In a pipe, the boundary layer grows from the walls inward. Eventually, the layers from the top and bottom meet in the center. When they meet, the flow is "Fully Developed."
- Practical Use: This tells engineers how much pressure (pump power) is lost to friction. A pipe with a thick, turbulent boundary layer requires massive pumps to push the fluid because the "effective" diameter of the pipe is smaller due to the drag at the walls.
Visualizing it in the Simulation: In this simulation:
- Laminar Mode: You will see a parabolic curve. The "slow" particles (green/blue) extend far into the center of the pipe. This indicates a Thick Boundary Layer where viscous forces are dominating a large portion of the pipe.
- Turbulent Mode: You will see a "plug" profile. The particles in the center are all moving fast (red), and the speed only drops to zero very close to the wall. This indicates a Thin Boundary Layer.
In short: The Boundary Layer is the region where the fluid "feels" the friction of the wall. Outside of it, the fluid doesn't even know the wall exists.
NOTE : The simulation uses HTML5 Canvas for high-performance 2D rendering. The physics uses heuristic approximations rather than solving full Navier-Stokes equations for real-time performance. The parabolic velocity profile (u = U_max × (1 - r²/R²)) is accurate for fully developed pipe flow. Obstacle collision uses simple geometric deflection. Wake turbulence uses oscillating sine waves to simulate vortex shedding. Boundary layer thickness is calculated heuristically based on Reynolds number. Dye diffusion uses random walk with intensity scaling with Reynolds number. The simulation makes abstract fluid dynamics concepts tangible through visual particle motion.
Simulation Approach: Hybrid Kinematic Method
This simulation does not numerically solve Partial Differential Equations (PDEs) in real-time. It does not run a Computational Fluid Dynamics (CFD) solver like the Navier-Stokes equations. Instead, it uses a Hybrid Kinematic Approach that combines an analytical solution for steady-state laminar flow with procedural noise for turbulent flow.
1. Laminar Mode: Analytical Solution (Real Physics)
For laminar flow (Re < 2000), the simulation uses the exact analytical solution to the Navier-Stokes equations for steady, incompressible flow in a pipe (Hagen-Poiseuille Flow).
u(r) = U_max × (1 - r²/R²)
Because the geometry is a simple pipe, we don't need to solve the PDE grid cell-by-cell every frame. We already know the solution is a parabola. The simulation simply maps this formula to particle velocities. Accuracy: 100% (for an ideal infinite pipe). This is real physics, not an approximation.
2. Turbulent Mode: Procedural Noise (Visual Approximation)
For turbulent flow (Re > 2500), solving the Navier-Stokes equations in a browser using vanilla JavaScript would be too computationally heavy and prone to instability. Instead, we use Procedural Perturbation:
- Velocity Profile: We flatten the parabola to approximate the "plug-like" profile of real turbulent flow (velocity is roughly constant across the center).
- Chaotic Motion: We apply Perlin-like noise or superposition of sine waves. Instead of calculating pressure gradients, we add a random vector to the Y-position when Re is high.
- Oscillating Eddies: We oscillate this vector over time to create the illusion of "eddies" moving downstream.
- Accuracy: Visual only. It mimics the statistics of turbulence (mixing, randomness) without calculating the dynamics.
3. Obstacle Interaction: Geometric Heuristics
A real CFD simulation would use a solver (like the Finite Volume Method) to calculate high pressure in front of the cylinder and low pressure behind it. Our simulation uses Geometric Vector Math:
- Collision: We calculate the distance between the particle and the obstacle center. If the particle is inside the obstacle, we push it out to the tangent.
- Wake: We define a "Shadow Zone" behind the obstacle. If a particle enters this region, we artificially increase its "jitter" value to simulate vortex shedding.
Why This Approach?
This hybrid kinematic method provides several advantages over a full PDE solver:
| Feature |
This Approach (Kinematic) |
Real CFD Solver (Navier-Stokes) |
| Performance |
60+ FPS on mobile devices |
< 5 FPS (in JavaScript) or requires WebGL/WASM |
| Stability |
Never "blows up" or produces NaN errors |
Highly sensitive to time-step size (Δt) |
| Code Size |
~100 lines of logic |
Thousands of lines / heavy libraries |
| Pedagogy |
Instant feedback when slider moves |
Requires "convergence time" after changes |
In Summary: We are not simulating the forces between water molecules (which requires supercomputers). We are simulating the path the water takes based on known physics formulas. It's like an animation that follows the rules of physics, rather than a physics engine calculating the rules from scratch.
Mathematical Model
The simulation implements fundamental fluid dynamics relationships:
1. Reynolds Number: The Tug-of-War Score
The Reynolds number determines the flow regime and represents a "tug-of-war" between two opposing forces:
Re = (ρ × v × D) / μ
Where: ρ is fluid density, v is characteristic velocity, D is pipe diameter, and μ is dynamic viscosity. In the simulation, Re is directly adjustable (0-5000).
The Tug-of-War:
- Inertia (Momentum): The fluid's desire to keep moving forward because it has mass and speed (think of a bowling ball thrown fast).
- Viscosity (Friction): The fluid's desire to stick together and resist movement (think of honey or glue).
Practical Meaning:
- Low Re (< 2000): Viscosity Wins (The "Honey" Mode)
- The fluid is "sticky" relative to its speed. It flows in organized, parallel layers (Laminar Flow).
- Visual: Imagine pouring cold syrup or honey. It folds over itself smoothly.
- Behavior: Dye forms a perfect straight line. It does not mix.
- Example: Blood flowing through capillaries. The blood moves slowly and vessels are tiny, so viscosity dominates.
- High Re (> 4000): Inertia Wins (The "Water" Mode)
- The fluid is moving too fast or is too heavy for its own stickiness to hold it together. Organized layers shatter into chaos (Turbulent Flow).
- Visual: White-water rafting or water shooting out of a fire hose.
- Behavior: Dye explodes into a cloud instantly.
- Example: Air flowing over a speeding car or plane wing. The air moves so fast that its "stickiness" is negligible.
- Transition Zone (2000-4000): The "Flickering" State
- The flow wants to be smooth, but a tiny bump or vibration can instantly trigger a burst of chaos. This is notoriously difficult to predict or simulate.
Why This Matters for Engineers:
- Scaling (Wind Tunnel Logic): To test a giant airplane design, engineers build a tiny model. To make the tiny model behave like the giant plane, they must match their Reynolds Numbers. If the Re matches, the physics matches.
- Mixing vs. Transport:
- Chemical Engineers: Want High Re (Turbulence) to mix chemicals quickly.
- Oil Pipelines: Want Low Re (Laminar). Turbulence creates drag and wastes energy.
In This Simulation: When you move the slider from 100 to 4000:
- At Re = 100: You are simulating a fluid that feels like Olive Oil. Viscosity is strong enough to suppress any jitters.
- At Re = 4000: You are simulating a fluid that feels like Water. The speed is so high that viscosity can no longer dampen the "random noise," so particles scatter.
Flow Regime Thresholds: Re < 2000 is laminar, 2000-2500 is transition, Re > 2500 is turbulent.
2. Parabolic Velocity Profile (Poiseuille Flow)
For fully developed laminar flow in a pipe:
u(r) = U_max × (1 - r²/R²)
Where: u(r) is velocity at distance r from center, U_max is maximum velocity (at center), and R is pipe radius. This profile applies to laminar flow. In turbulent flow, the profile becomes flatter in the center due to mixing, but still follows this general shape near walls.
3. Boundary Layer Thickness
The boundary layer is the "buffer zone" between a solid object and the free-flowing fluid. It represents the transition zone where fluid velocity goes from 0% (at the wall) to 99% (free stream). The thickness depends on Reynolds number:
δ ≈ R × (500 / Re) (Turbulent)
δ ≈ R × 0.4 (Laminar)
For laminar flow, the boundary layer is thick (viscous forces dominate large area). For turbulent flow, the boundary layer becomes very thin, but still exists at the wall where velocity must be zero (no-slip condition). The boundary layer indicates how much the object is dragging the fluid - thick layers mean more drag, thin layers mean less drag (but potentially less stable).
4. Wake Turbulence (Von Kármán Vortex Street)
Behind an obstacle in turbulent flow, vortices are shed alternately:
v_y = A × sin(k × x - ω × t) × exp(-α × x)
Where: A is amplitude (scales with Re), k is wavenumber, ω is frequency, α is decay constant. The exponential decay ensures turbulence settles downstream. The simulation uses this heuristic to create realistic-looking wake patterns.
5. Diffusion (Dye Dispersion)
Dye particles experience different diffusion rates:
D_turbulent >> D_molecular
In laminar flow, diffusion is molecular (very slow, dye stays in a line). In turbulent flow, "eddy diffusion" dominates (very fast, dye disperses rapidly). The simulation uses random walk with intensity scaling as (Re - 2300) / 2000 to model this effect.
Turbulent Flow (Re > 2500)
Flow Information
Flow Regime: Laminar
Reynolds Number: 1000
Particle Count: 800
Dye Particles: 0
Tip: Click and drag on the canvas to inject dye tracer particles.
In laminar flow, dye stays in a line. In turbulent flow, dye disperses rapidly.
Usage Example
Follow these steps to explore Laminar and Turbulent Flow:
-
Initial View: When you first load the simulation, you'll see:
- Hundreds of blue particles flowing through a pipe with a smooth parabolic velocity profile
- Particles move fastest at the center and slowest near the walls
- The flow is laminar (Re = 1000), showing ordered, parallel streamlines
- Real-time information showing Reynolds number and flow regime
-
Use Presets (Quick Start): The Preset dropdown provides quick access to common scenarios:
- Laminar Flow (Re=1000): Perfect starting point - smooth, ordered flow with boundary layer visible
- Reynolds Experiment (Re=1000): Ideal for dye injection demonstrations - inject dye and watch it stay in a line
- Turbulent Flow (Re=4000): See chaotic, mixing flow with red particles
- Wake Visualization (Re=4000): High Re with circular obstacle - observe Von Kármán vortex street
- Streamlined Study (Re=4000): Compare different obstacle shapes at high Re
- Selecting a preset automatically configures all relevant parameters. You can then manually adjust any setting - the preset will reset to "Custom" to indicate you've customized it.
-
Adjust Reynolds Number: Use the Reynolds Number slider:
- Re < 2000 (Laminar): Particles flow in smooth, parallel layers. Color is blue. Velocity profile is parabolic. No mixing between layers.
- 2000 ≤ Re ≤ 2500 (Transition): Flow begins to show instability. Some particles start moving erratically.
- Re > 2500 (Turbulent): Flow becomes chaotic. Particles move erratically. Color changes to red. Mixing is rapid throughout the pipe.
- Key Insight: Reynolds number is the ratio of inertial forces to viscous forces. Low Re means viscosity dominates (smooth flow). High Re means inertia dominates (chaotic flow).
-
Enable Obstacle Mode: Check the Enable Obstacle checkbox and select a shape from the Shape dropdown:
- An obstacle appears in the center of the pipe (shape depends on selection: Circle, Square, Triangle, Diamond, Airfoil, or Canoe)
- Particles flow around the obstacle, splitting and rejoining
- Drag the obstacle with your mouse to reposition it anywhere in the pipe - this works even when the simulation is paused
- Compare shapes: Try different obstacle shapes at the same Reynolds number to see how streamlined shapes (airfoil, canoe) create minimal wake compared to blunt shapes (square, diamond)
- In Laminar Flow (Re < 2000): Particles split smoothly around the obstacle and rejoin cleanly downstream. The flow remains ordered.
- In Turbulent Flow (Re > 2500): A wake zone appears behind the obstacle. Particles in this zone turn yellow and show oscillating vortex patterns (Von Kármán vortex street). The wake extends downstream with decreasing intensity.
- Key Insight: The obstacle demonstrates flow separation. In laminar flow, separation is minimal. In turbulent flow, separation creates a low-pressure wake with alternating vortices that shed downstream.
-
Show Boundary Layer: Check the Show Boundary Layer checkbox:
- Semi-transparent green overlay appears along the top and bottom walls
- Particles inside the boundary layer turn green to indicate high friction zones
- Dynamic Thickness: The boundary layer thickness changes with Reynolds number:
- Laminar (Re < 2000): Thick boundary layer (≈40% of radius). The parabolic profile fills most of the pipe.
- Turbulent (Re > 2500): Thin boundary layer (thickness ≈ R × 500/Re). The velocity profile is flatter in the center.
- Viscous Damping: Particles in the boundary layer experience friction:
- Velocity decreases as particles approach the wall
- Turbulence is suppressed (even in high Re flow, the wall region is laminar - the "viscous sublayer")
- Wake turbulence cannot penetrate the boundary layer
- Key Insight: The "no-slip condition" means fluid velocity is zero at the wall. No matter how turbulent the center flow is, the fluid touching the wall must be stationary. This creates the boundary layer where viscous forces always dominate.
-
Dye Injection (Reynolds Experiment): Click and drag on the canvas:
- Bright cyan dye particles are injected at your cursor position
- Dye particles follow the flow and fade out over 2-3 seconds
- In Laminar Flow (Re < 2000):
- Dye stream remains a tight, coherent line
- Minimal vertical spreading (only molecular diffusion)
- The dye line follows the parabolic velocity profile
- In Turbulent Flow (Re > 2500):
- Dye stream explodes and disperses rapidly
- High vertical mixing (eddy diffusion dominates)
- Dye spreads throughout the pipe cross-section
- Oscillating patterns show large-scale eddies
- Key Insight: This recreates Osborne Reynolds' famous 1883 experiment. He injected dye into a pipe and observed that below Re ≈ 2000, the dye stayed in a line (laminar), but above Re ≈ 2500, the dye mixed rapidly (turbulent). This visual demonstration makes the concept of "diffusivity" tangible - turbulent flow mixes efficiently, which is why we stir coffee rather than waiting for molecular diffusion.
-
Adjust Particle Count: Use the Particle Count slider:
- Range: 200 to 1200 particles
- More particles = denser visualization but slower performance
- Fewer particles = faster performance but sparser visualization
- Key Insight: The particle count doesn't affect the physics - it only affects visualization density. The flow behavior depends solely on Reynolds number.
-
Adjust Base Speed: Use the Base Speed slider:
- Range: 1.0 to 10.0 (arbitrary units)
- Controls the overall flow velocity
- Higher speed = faster particle motion
- Key Insight: Base speed affects visualization speed but not the flow regime. The Reynolds number (which you control directly) determines whether flow is laminar or turbulent.
-
Control Animation Speed: Use the Animation Speed slider:
- Range: 0.1 to 1.0 (playback speed multiplier)
- 1.0 = normal speed, 0.5 = half speed, 0.1 = very slow (frame-by-frame observation)
- Lower speeds allow detailed study of particle motion, wake patterns, and dye diffusion
- The visual rendering remains smooth, but physics updates less frequently at lower speeds
- Key Insight: Use slow speeds (0.2-0.3) to carefully observe wake formation, vortex shedding, and dye mixing patterns
-
Step Through Simulation: Use the control buttons for detailed analysis:
- Pause Button: Click to pause the simulation. When paused, you can examine the current state, drag obstacles, inject dye, or step through frames
- Step Forward: Advances the simulation by one physics step. If running, it pauses first, then steps. Perfect for frame-by-frame analysis
- Step Backward: Reverses by one step using saved history. Only enabled when paused and history exists. Great for reviewing specific moments
- Run Button: Resumes continuous simulation playback
- Key Insight: Pausing and stepping allows you to study complex phenomena like wake formation, dye diffusion, and boundary layer behavior in detail
-
Observe Flow Regime Transition: Slowly increase Reynolds number from 1000 to 3000:
- Watch particles change from blue (laminar) to red (turbulent)
- Observe the transition zone (2000-2500) where flow becomes unstable
- Notice how particle paths change from smooth curves to chaotic motion
- If boundary layer is visible, watch it get thinner as Re increases
- Key Insight: The transition is not instantaneous. There's a range (2000-2500) where flow can be either laminar or turbulent depending on disturbances. This is why engineers design systems to stay well below Re = 2000 for guaranteed laminar flow.
-
Compare Obstacle Behavior: Enable obstacle and compare low vs high Re:
- Low Re (Laminar): Smooth flow around obstacle, minimal wake, particles rejoin cleanly
- High Re (Turbulent): Large wake zone with yellow particles showing vortex shedding, oscillating patterns downstream
- This demonstrates why streamlined shapes are critical for high-speed vehicles - they minimize wake drag
- Key Insight: The Von Kármán vortex street is a real phenomenon. It's why flags flutter, why chimneys can oscillate in wind, and why submarines must be carefully designed to avoid wake-induced vibrations.
-
Experiment with Dye Injection: Try injecting dye at different positions:
- Inject at center: Dye follows the fastest flow path
- Inject near wall: Dye moves slowly (boundary layer effect)
- Inject behind obstacle (turbulent): Dye gets caught in wake vortices
- Compare laminar vs turbulent: The dramatic difference in dye dispersion clearly shows why turbulent flow is used for mixing applications
- Key Insight: Dye injection is the classic way to visualize flow patterns. Engineers use smoke in wind tunnels and dye in water tunnels to see flow separation, wake patterns, and mixing zones.
Tip: Start with default settings (Re = 1000, laminar) to see smooth, ordered flow. Then increase Re to 3000 to see turbulent chaos. Enable the obstacle to see flow separation. Show the boundary layer to understand the no-slip condition. Finally, inject dye to see the Reynolds experiment in action. The combination of all these visualizations makes abstract fluid dynamics concepts tangible and memorable.
Parameters
Followings are short descriptions on each parameter
-
Reynolds Number (Re): The dimensionless parameter that determines flow regime. Range: 0-5000. Re = (ρ × v × D) / μ, where ρ is density, v is velocity, D is pipe diameter, μ is viscosity. Re < 2000 is laminar (smooth, ordered flow). 2000 ≤ Re ≤ 2500 is transition (unstable). Re > 2500 is turbulent (chaotic, mixing flow). This is the primary control that determines all flow behavior. The simulation directly uses Re to calculate particle velocities, turbulence intensity, boundary layer thickness, and diffusion rates.
-
Particle Count: Number of background flow particles displayed (200-1200). More particles create a denser visualization but may reduce performance. Fewer particles show sparser flow but run faster. This parameter only affects visualization density, not the physics. The flow behavior is determined solely by Reynolds number.
-
Base Speed: Overall flow velocity multiplier (1.0-10.0, arbitrary units). Controls how fast particles move across the screen. Higher values = faster motion. Lower values = slower motion (easier to observe details). This affects visualization speed but not flow regime - Reynolds number (controlled separately) determines laminar vs turbulent behavior.
-
Animation Speed: Playback speed multiplier (0.1-1.0). Controls how fast the simulation runs. 1.0 = normal speed, 0.5 = half speed (easier to observe details), 0.1 = very slow (frame-by-frame observation). Lower speeds allow detailed study of particle motion, wake patterns, and dye diffusion. The simulation always draws smoothly, but physics updates less frequently at lower speeds.
-
Preset: Dropdown menu with pre-configured scenarios for quick exploration:
- Custom: Default mode - manually adjust all parameters
- Laminar Flow (Re=1000): Smooth, ordered flow with boundary layer visible
- Transition (Re=2250): Critical transition zone between laminar and turbulent
- Turbulent Flow (Re=4000): High Reynolds number chaotic flow
- Reynolds Experiment (Re=1000): Perfect setup for dye injection demonstration
- Wake Visualization (Re=4000): High Re with circular obstacle to observe wake patterns
- Streamlined Study (Re=4000): High Re with square obstacle to compare shape effects
- Boundary Layer Study: Shows boundary layer at transition Reynolds number
Selecting a preset automatically configures Reynolds number, obstacle settings, boundary layer visibility, and animation speed. The preset resets to "Custom" when you manually adjust any parameter.
-
Enable Obstacle: Toggle checkbox to add an obstacle in the center of the pipe. When enabled, particles must flow around it. In laminar flow, particles split smoothly and rejoin. In turbulent flow, a wake zone appears behind the obstacle with yellow particles showing vortex shedding (Von Kármán vortex street). The obstacle shape can be selected from the Shape dropdown (Circle, Square, Triangle, Diamond, Airfoil, Canoe). Different shapes create different wake patterns - streamlined shapes (airfoil, canoe) have minimal wake, while blunt shapes (square, diamond) create large wakes. Obstacles can be dragged with the mouse to reposition them.
-
Obstacle Shape: Dropdown to select obstacle geometry. Options include Circle (default), Square, Triangle, Diamond, Airfoil (streamlined), and Canoe (streamlined spindle). Each shape has different aerodynamic properties - streamlined shapes (airfoil, canoe) have low drag and minimal wake, while blunt shapes (square, diamond) create large wakes with vortex shedding. The shape affects both collision detection and wake physics.
-
Show Boundary Layer: Toggle checkbox to visualize the boundary layer near pipe walls. When enabled, a semi-transparent green overlay appears along top and bottom walls, and particles inside the boundary layer turn green. The boundary layer thickness is dynamic - thick for laminar flow (≈40% of radius), thin for turbulent flow (thickness ≈ R × 500/Re). Particles in the boundary layer experience viscous damping (reduced velocity and suppressed turbulence), demonstrating the "no-slip condition" where fluid velocity is zero at walls.
-
Step Forward Button: Advances the simulation by one physics step. If the simulation is running, it will pause first, then step forward. Useful for frame-by-frame analysis of particle motion, wake formation, and dye diffusion. Each step updates particle positions and physics, then redraws the frame.
-
Step Backward Button: Reverses the simulation by one step, restoring the previous state from history. Only available when the simulation is paused and history exists. Disabled when no history is available or when the simulation is running. Useful for reviewing specific moments in the flow evolution.
-
Play/Pause Button: Toggles simulation playback. When running, the button shows "Pause" and the simulation updates continuously. When paused, the button shows "Run" and the simulation freezes, allowing you to examine the current state, drag obstacles, inject dye, or step through frames manually. The simulation can be paused and resumed at any time.
-
Reset Button: Clears all particles, resets the simulation to initial state, clears step history, and restarts the simulation. Useful for starting fresh or clearing accumulated particles for better visibility. The simulation will be running after reset.
-
Clear Dye Button: Removes all injected dye particles while keeping background flow particles. Useful for clearing dye tracers without resetting the entire simulation. Does not affect step history or simulation state.
-
Flow Regime: Real-time display showing current flow state: "Laminar" (Re < 2000), "Transition" (2000 ≤ Re ≤ 2500), or "Turbulent" (Re > 2500). This helps you understand which regime you're observing.
-
Reynolds Number Display: Shows the current Reynolds number value. Updates in real-time as you adjust the slider.
-
Particle Count Display: Shows the current number of background flow particles. Updates when you change the particle count slider.
-
Dye Particles Display: Shows the current number of injected dye tracer particles. Increases as you click/drag to inject dye, decreases as particles fade out or leave the screen.
Controls and Visualizations
Followings are short descriptions on each control and visualization element
-
Reynolds Number Slider: Primary control for flow regime (0-5000). Moving the slider immediately changes particle behavior, colors, and flow characteristics. This is the most important control - it determines whether flow is laminar or turbulent.
-
Particle Count Slider: Adjusts visualization density (200-1200 particles). More particles = denser flow visualization. Fewer particles = sparser visualization but better performance.
-
Base Speed Slider: Controls overall flow velocity (1.0-10.0). Higher = faster particle motion. Lower = slower motion for detailed observation.
-
Animation Speed Slider: Controls simulation playback speed (0.1-1.0). 1.0 = normal speed, lower values = slower updates for detailed observation. The visual rendering remains smooth, but physics updates less frequently at lower speeds, allowing frame-by-frame study of complex phenomena.
-
Preset Dropdown: Quick access to pre-configured scenarios. Selecting a preset automatically sets Reynolds number, obstacle state/shape, boundary layer visibility, and animation speed. Resets to "Custom" when any parameter is manually adjusted. Presets include Laminar Flow, Transition, Turbulent Flow, Reynolds Experiment, Wake Visualization, Streamlined Study, and Boundary Layer Study.
-
Enable Obstacle Checkbox: Toggles the obstacle in the center of the pipe. When enabled, particles flow around the obstacle, demonstrating flow separation and wake formation. The wake behavior differs dramatically between laminar (smooth) and turbulent (vortex street) regimes. Obstacles can be dragged with the mouse to reposition them, even when paused.
-
Obstacle Shape Dropdown: Selects the obstacle geometry (Circle, Square, Triangle, Diamond, Airfoil, Canoe). Different shapes create different wake patterns - streamlined shapes minimize wake, while blunt shapes create large wakes. The shape affects both visual appearance and physics behavior.
-
Show Boundary Layer Checkbox: Toggles boundary layer visualization. When enabled, green overlay and green particles show the viscous region near walls. The thickness updates dynamically with Reynolds number.
-
Step Forward Button: Advances simulation by one physics step. Pauses running simulation first if needed. Enables frame-by-frame analysis.
-
Step Backward Button: Reverses simulation by one step using saved history. Only enabled when paused and history exists. Allows reviewing previous states.
-
Play/Pause Button: Toggles continuous simulation playback. When paused, you can drag obstacles, inject dye, step through frames, or examine the current state. When running, the simulation updates continuously.
-
Reset Button: Clears all particles, resets simulation state, clears history, and restarts the simulation.
-
Clear Dye Button: Removes all dye tracer particles while keeping background flow.
-
Canvas (Click and Drag): Interactive dye injection. Click and drag on the canvas to inject bright cyan dye particles at your cursor position. The dye follows the flow and demonstrates diffusion - staying in a line for laminar flow, dispersing rapidly for turbulent flow. This recreates the Reynolds Dye Experiment.
-
Flow Particles (Background): Hundreds of small particles representing fluid elements:
- Blue Particles: Laminar flow (Re < 2000). Move in smooth, parallel layers with parabolic velocity profile.
- Red Particles: Turbulent flow (Re > 2500). Move erratically with chaotic mixing.
- Yellow Particles: Wake turbulence behind obstacle in turbulent flow. Show oscillating vortex patterns.
- Green Particles: Boundary layer region (when boundary layer visualization is enabled). Experience viscous damping near walls.
-
Obstacle: When obstacle mode is enabled, a gray obstacle appears in the center of the pipe (shape depends on selected option: Circle, Square, Triangle, Diamond, Airfoil, or Canoe). Particles cannot pass through it and must flow around. The obstacle demonstrates flow separation and wake formation. In turbulent flow, the wake shows characteristic Von Kármán vortex street patterns. The obstacle can be dragged with the mouse to reposition it anywhere in the pipe, even when the simulation is paused. Different shapes create different wake patterns - streamlined shapes (airfoil, canoe) have minimal wake, while blunt shapes (square, diamond) create large wakes.
-
Boundary Layer Overlay: When boundary layer visualization is enabled, semi-transparent green rectangles appear along the top and bottom walls. Dashed green lines indicate the boundary layer edge. The thickness is dynamic - thick for laminar flow, thin for turbulent flow. This visualizes the region where viscous forces dominate and velocity drops to zero at the wall (no-slip condition).
-
Dye Tracer Particles (Cyan): Injected by clicking and dragging on the canvas. Bright cyan particles that follow the flow and fade out over 2-3 seconds. In laminar flow, dye stays in a coherent line (minimal diffusion). In turbulent flow, dye disperses rapidly throughout the pipe (high eddy diffusion). This is the classic Reynolds Dye Experiment visualization.
-
Color Legend: Shows the meaning of different particle colors:
- Blue: Laminar flow
- Red: Turbulent flow
- Yellow: Wake turbulence
- Green: Boundary layer
- Cyan: Dye tracer
-
Flow Information Panel: Real-time display showing:
- Flow Regime: Laminar, Transition, or Turbulent
- Reynolds Number: Current value
- Particle Count: Number of background particles
- Dye Particles: Number of active dye tracers
- Tip: Instructions for using dye injection
Key Concepts
-
Reynolds Number: The fundamental dimensionless parameter in fluid dynamics:
- Definition: Re = (ρ × v × D) / μ = (inertial forces) / (viscous forces)
- Physical Meaning: Ratio of momentum (inertia) to viscous drag. High Re means inertia dominates (turbulent). Low Re means viscosity dominates (laminar).
- Critical Values: Re < 2000 = laminar, 2000-2500 = transition, Re > 2500 = turbulent (for pipe flow).
- Key Insight: The same fluid can be laminar or turbulent depending on velocity, pipe size, and viscosity. Water in a small tube is laminar, but water in a large pipe at the same speed can be turbulent.
Reynolds number determines flow regime, velocity profiles, boundary layer thickness, wake patterns, and diffusion rates.
-
Laminar Flow: Smooth, ordered flow with parallel streamlines:
- Characteristics: No mixing between layers, predictable particle paths, parabolic velocity profile, low energy dissipation.
- Velocity Profile: u(r) = U_max × (1 - r²/R²) - maximum at center, zero at walls.
- Applications: Microfluidics, blood flow in capillaries, lubrication, precision manufacturing.
- Key Insight: Laminar flow is energy-efficient (low drag) but poor for mixing. It's preferred when you want controlled, predictable flow.
-
Turbulent Flow: Chaotic flow with rapid mixing:
- Characteristics: Rapid mixing, unpredictable particle paths, flatter velocity profile in center, high energy dissipation.
- Velocity Profile: Still parabolic near walls (no-slip), but flatter in center due to mixing.
- Applications: Mixing, heat transfer, combustion, industrial processes.
- Key Insight: Turbulent flow has high drag (energy loss) but excellent mixing. It's preferred when you need rapid dispersion or heat transfer.
-
Boundary Layer: The "buffer zone" between a solid object and the free-flowing fluid around it. It indicates how much the object is dragging the fluid:
- No-Slip Condition (The Golden Rule): Fluid touching a solid surface does not move. If water rushes through a pipe at 100 mph, the molecules directly touching the wall are at 0 mph. The Boundary Layer (δ) is the thickness of the transition zone where fluid goes from 0% to 99% of free stream speed.
- Thickness: δ ≈ R × 0.4 for laminar, δ ≈ R × (500/Re) for turbulent. Turbulent boundary layers are thinner but still exist.
- Viscous Sublayer: Even in turbulent flow, there's a thin layer at the wall where flow is laminar. Turbulence cannot penetrate to the wall itself.
- Practical Applications:
- Aerodynamics: Source of Skin Friction Drag. Engineers design wings to keep boundary layer laminar (thin) to save fuel. If it separates, the plane stalls.
- Heat Transfer: Acts like an insulating blanket. Engineers add bumps/fins to "trip" the boundary layer into turbulence, mixing hot air near surface with cold air above for better cooling.
- Pipe Flow: Determines pressure loss and pump power requirements. Thick turbulent boundary layers reduce effective pipe diameter, requiring more pump power.
- Visualization in Simulation: Laminar mode shows thick boundary layer (slow particles extend far into center). Turbulent mode shows thin boundary layer (fast particles in center, speed drops to zero very close to wall).
- Key Insight: The boundary layer is where the fluid "feels" the friction of the wall. Outside of it, the fluid doesn't even know the wall exists. Understanding boundary layer behavior is critical for designing efficient vehicles, pipes, and heat exchangers.
-
Flow Separation and Wake: What happens when flow encounters an obstacle:
- Laminar Separation: Minimal separation, smooth flow around obstacle, small wake.
- Turbulent Separation: Large separation zone, low-pressure wake, vortex shedding (Von Kármán vortex street).
- Von Kármán Vortex Street: Alternating vortices shed behind a bluff body in turbulent flow. Creates oscillating wake patterns.
- Key Insight: Wake creates drag. Streamlined shapes minimize separation and wake size. This is why aircraft, cars, and submarines are carefully shaped.
-
Diffusion and Mixing: How substances spread in flow:
- Molecular Diffusion (Laminar): Very slow, dye stays in a line. Diffusion rate D_molecular is small.
- Eddy Diffusion (Turbulent): Very fast, dye disperses rapidly. Diffusion rate D_turbulent >> D_molecular.
- Reynolds Experiment: Osborne Reynolds (1883) injected dye into pipe flow. Below Re ≈ 2000, dye stayed in a line. Above Re ≈ 2500, dye mixed rapidly. This established the Reynolds number as the key parameter.
- Key Insight: Turbulent flow mixes efficiently, which is why we stir coffee (create turbulence) rather than waiting for molecular diffusion. This is also why turbulent flow is used in chemical reactors and heat exchangers.
-
Parabolic Velocity Profile (Poiseuille Flow): The characteristic velocity distribution in pipe flow:
- Formula: u(r) = U_max × (1 - r²/R²), where r is distance from center, R is pipe radius.
- Physical Cause: Viscous drag at walls creates shear stress. Fluid near walls is slowed by friction, creating the parabolic shape.
- Laminar vs Turbulent: Both have parabolic profiles, but turbulent flow is flatter in the center due to mixing. The wall region is always parabolic (boundary layer).
- Key Insight: The velocity profile determines flow rate, pressure drop, and energy dissipation. Understanding this profile is essential for pipe design and flow measurement.
-
Applications: Laminar and turbulent flow concepts are essential for:
- Aerodynamics: Aircraft design (minimize drag), wind turbines (maximize energy capture), vehicle design (streamlining).
- Pipe Flow: Water distribution, oil pipelines, HVAC systems (pressure drop, flow rate, energy requirements).
- Heat Transfer: Turbulent flow enhances heat transfer (why we use fans, why heat exchangers have fins).
- Chemical Engineering: Mixing in reactors, mass transfer, process design.
- Biomedical: Blood flow in vessels, drug delivery, microfluidics.
- Environmental: River flow, atmospheric dynamics, ocean currents.
|
|