|
Bernoulli's Principle Tutorial
This interactive tutorial demonstrates Bernoulli's Principle, one of the most fundamental concepts in fluid dynamics. Bernoulli's Principle states that as the speed of a fluid increases, its pressure decreases. This inverse relationship between velocity and pressure explains many everyday phenomena, from how airplanes fly to how carburetors work.
The simulation provides a real-time visualization of: (1) Particle Streamlines - hundreds of particles flowing from left to right, showing how fluid accelerates through constrictions, (2) Pressure Heatmap - color gradient overlay (Blue for high pressure/low speed, Red for low pressure/high speed) visualizing pressure changes throughout the flow field, (3) Venturi Effect Mode - a pipe with configurable inlet, neck, and outlet diameters, demonstrating how fluid accelerates and pressure drops in the constriction, with real-time pressure gauges (Manometers) 50 px above the canvas bottom and a velocity overlay plot above the pipeline showing centerline velocity vs. position, (4) Airfoil Lift Mode - a wing profile (NACA airfoil) showing how faster flow over the curved upper surface creates lower pressure, resulting in upward lift, with velocity vectors and lift force visualization, (5) Streamline Bundling - particles pack and expand according to pipe geometry (conservation of mass), (6) Dynamic Pressure Calculations - real-time pressure values from Bernoulli's equation, (7) Smoke Trace Injection - click or drag on the canvas to inject dye that stays visible while moving and fades only when stuck on a surface, (8) Angle of Attack (Airfoil mode) and Inlet/Neck/Outlet Diameter (Venturi mode) - parameters shown or hidden by mode, (9) Inlet Velocity and Animation Speed (0.1–2×) - adjust flow and playback speed, (10) Step Fwd / Step Bwd / Run–Stop - single-step or continuous animation, (11) Real-time Telemetry - live pressure and force readouts.
Understanding Bernoulli's Principle: Bernoulli's Principle is a consequence of the conservation of energy in fluid flow. When a fluid flows through a constriction (like a Venturi tube), it must speed up to maintain the same flow rate (continuity equation: A₁v₁ = A₂v₂). According to Bernoulli's equation, this increase in velocity must be accompanied by a decrease in pressure to conserve energy. This principle explains why airplanes can fly (faster air over the wing creates lower pressure above, generating lift), why carburetors mix fuel with air (air speeds up through a narrow passage, pressure drops, and fuel is drawn in), and why shower curtains get sucked inward (fast-moving air between the curtain and wall has lower pressure).
The Venturi Effect: When fluid flows through a pipe that narrows, the fluid accelerates in the narrow section. According to Bernoulli's Principle, this acceleration causes the pressure to drop. This is the Venturi Effect, named after Italian physicist Giovanni Battista Venturi. The Venturi Effect is used in many applications: carburetors (to mix fuel with air), atomizers (to create fine sprays), and flow meters (to measure flow rate by measuring pressure drop). In the simulation, you can see particles accelerate and pack closer together in the neck, while the pressure gauges show the pressure drop.
Airfoil Lift: An airfoil (wing cross-section) is designed with a curved upper surface and a flatter lower surface. As air flows over the wing, it must travel faster over the curved top surface to meet the air flowing under the wing at the trailing edge. This faster flow creates lower pressure above the wing, while the slower flow below creates higher pressure. The pressure difference results in an upward force called lift. The simulation shows this with velocity vectors (longer arrows on top), pressure colors (red on top = low pressure, blue on bottom = high pressure), and a lift force arrow. Adjusting the angle of attack changes how much lift is generated.
NOTE : The simulation uses HTML5 Canvas for high-performance 2D rendering. The physics uses simplified potential flow theory and Bernoulli's equation rather than solving full Navier-Stokes equations for real-time performance. In Venturi mode, pipe geometry is defined by inlet/neck/outlet diameters; throat and constriction extent are derived from the drawn breakpoints, and velocity (hence pressure) follows that geometry. The airfoil uses a simplified potential flow model where velocity is higher on the upper curved surface; the NACA 4-digit formula defines the shape. Flow particles that enter solid regions (airfoil or outside the pipe) are respawned after a short stick delay; smoke traces stay at full opacity while moving and fade only when stuck, then are removed when off-screen. The simulation makes abstract fluid dynamics concepts tangible through particle motion, velocity overlay, and pressure visualization.
Mathematical Model
The simulation implements Bernoulli's Principle through the fundamental equations of fluid dynamics:
1. Bernoulli's Equation: The Energy Balance
Bernoulli's equation is derived from the conservation of energy for an incompressible, inviscid fluid:
P + ½ρv² + ρgh = constant
Where: P is static pressure, ρ is fluid density, v is velocity, g is gravitational acceleration, and h is height. For horizontal flow (h constant), this simplifies to:
P + ½ρv² = constant
This equation shows that as velocity increases, pressure must decrease to keep the sum constant. This is the core of Bernoulli's Principle.
2. Continuity Equation: Conservation of Mass
For incompressible flow, mass must be conserved. This leads to the continuity equation:
A₁v₁ = A₂v₂
Where: A is cross-sectional area and v is velocity. This means that when a pipe narrows (A decreases), the velocity must increase (v increases) to maintain the same flow rate. This is why fluid accelerates in a Venturi tube.
3. Venturi Effect: Combining Continuity and Bernoulli
In a Venturi tube, the continuity equation tells us the velocity increases in the neck. Bernoulli's equation then tells us the pressure must decrease:
P₂ = P₁ - ½ρ(v₂² - v₁²)
Where subscript 1 is the inlet and subscript 2 is the neck. Since v₂ > v₁, we have P₂ < P₁. The pressure drop is proportional to the square of the velocity difference.
4. Airfoil Lift: Pressure Differential
For an airfoil, the lift force is generated by the pressure difference between the upper and lower surfaces:
L = ½ρv²ACₗ
Where: L is lift force, ρ is air density, v is velocity, A is wing area, and Cₗ is the lift coefficient. For small angles of attack, Cₗ ≈ 2π × α (where α is angle of attack in radians). The pressure difference arises because the curved upper surface forces air to travel faster, creating lower pressure above the wing.
5. NACA Airfoil Geometry
The simulation uses the NACA 4-digit series to define the airfoil shape. The airfoil is defined by:
- Thickness Distribution: y_t = 5t × c × (0.2969√x - 0.1260x - 0.3516x² + 0.2843x³ - 0.1015x⁴)
- Camber Line: Defined by maximum camber (m) and position of maximum camber (p)
- Upper/Lower Surfaces: Calculated by adding/subtracting thickness perpendicular to the camber line
This provides a mathematically accurate wing profile that demonstrates real aerodynamic behavior.
High Pressure / Low Speed
Low Pressure / High Speed
Smoke Trace (Click or drag to inject)
Live Telemetry
Inlet Pressure: 101.3 kPa
Neck Pressure: 101.3 kPa
Outlet Pressure: 101.3 kPa
Pressure Top: 101.3 kPa
Pressure Bottom: 101.3 kPa
Net Lift Force: 0.0 N
Tip: Click or drag on the canvas to inject smoke traces (streamlines). Use Step Fwd/Bwd or Run/Stop to control animation; adjust Animation Speed for slow-motion or fast playback. In Venturi mode, the plot above the pipe shows centerline velocity vs. position.
Usage Example
Follow these steps to explore Bernoulli's Principle:
-
Initial View (Venturi Mode): When you first load the simulation, you'll see:
- Hundreds of colored particles flowing from left to right through a pipe
- A pressure heatmap overlay showing blue (high pressure) in wide sections and red (low pressure) in the narrow neck
- Three pressure gauges (Manometers) showing pressure at inlet, neck, and outlet
- Particles accelerate and pack closer together in the narrow neck section (streamline bundling)
-
Observe the Venturi Effect:
- Watch particles speed up as they enter the narrow neck
- Notice how particles pack closer together vertically in the neck (conservation of mass - same number of particles must pass through smaller area)
- See the pressure drop in the neck gauge - pressure decreases as velocity increases
- The pressure heatmap shows red (low pressure) in the neck and blue (high pressure) in wide sections
- Key Insight: This demonstrates the inverse relationship between velocity and pressure. As the pipe narrows, velocity increases (continuity equation), so pressure must decrease (Bernoulli's equation).
-
Adjust Inlet Velocity: Use the Inlet Velocity slider (10–100 m/s). Higher velocity gives a larger pressure drop in the neck. Watch the pressure gauges and the velocity overlay plot update in real-time. The pressure difference scales as ΔP ∝ v².
-
Venturi Diameters (Venturi mode only): Use Inlet Diameter, Neck Diameter, and Outlet Diameter sliders to change the pipe geometry. Flow and pressure are derived from the drawn pipe. Gauges are placed 50 px above the canvas bottom.
-
Animation Speed: Use the slider (0.1–2×) to slow down or speed up particle and smoke motion. At 0.1×, streamlines stay visible across the full canvas; at 2×, flow advances quickly.
-
Step Fwd / Step Bwd / Run–Stop: Use Run or Stop to toggle continuous animation. Step Fwd advances one frame (stops first if running); Step Bwd restores the previous state from history. Reset clears particles and smoke traces.
-
Switch to Airfoil Mode: Click Switch to Airfoil:
- A NACA airfoil (wing) appears in the center of the canvas
- Particles flow around the wing, with faster flow over the curved upper surface
- The pressure heatmap shows red (low pressure) above the wing and blue (high pressure) below
- Velocity vectors (yellow arrows) show longer arrows on top (faster) and shorter arrows on bottom (slower)
- A green lift arrow points upward, showing the net force generated by the pressure difference
- A red dot marks the stagnation point (where velocity is zero and pressure is maximum)
- Key Insight: The curved upper surface forces air to travel faster, creating lower pressure above. The pressure difference generates lift, allowing airplanes to fly.
-
Adjust Angle of Attack: Use the Angle of Attack slider (Airfoil mode only):
- Range: -15° to +30°
- Positive angles increase lift (wing tilted up)
- Negative angles decrease lift or create downward force
- Watch the lift force in the telemetry update in real-time
- The lift is approximately proportional to angle of attack for small angles: L ∝ α
- Key Insight: Increasing angle of attack increases the pressure difference, generating more lift. However, at very high angles (stall), the flow separates and lift decreases dramatically.
-
Inject Smoke Traces: Click or drag on the canvas:
- A concentrated line of cyan particles is injected at the click position; dragging injects multiple traces along the path
- These particles follow the flow, visualizing streamlines
- In Venturi mode, watch the streamline accelerate and compress in the neck; the velocity overlay plot above the pipe shows centerline speed vs. x
- In Airfoil mode, watch streamlines split around the wing and see how the upper streamline travels faster
- Smoke traces stay visible while moving; they fade only when stuck on a surface (airfoil or pipe wall) and are removed when off-screen
- Key Insight: Streamlines show the path that fluid particles follow. In steady flow, streamlines never cross, and the spacing between streamlines is inversely proportional to velocity (closer together = faster flow).
-
Compare Pressure Values: Observe the telemetry panel:
- Venturi Mode: Shows inlet, neck, and outlet pressures. The neck pressure is always lower than inlet/outlet.
- Airfoil Mode: Shows top and bottom pressures, plus net lift force. Top pressure is lower than bottom pressure, creating upward lift.
- All pressures are in kilopascals (kPa). Standard atmospheric pressure is ~101.3 kPa.
- Key Insight: The pressure values are calculated using Bernoulli's equation in real-time. As you adjust velocity or angle of attack, watch how the pressures change to maintain energy conservation.
-
Observe the Pressure Heatmap: The color gradient overlay shows pressure throughout the flow:
- Blue regions: High pressure, low velocity (wide sections of pipe, bottom of airfoil)
- Red regions: Low pressure, high velocity (narrow sections, top of airfoil)
- The heatmap updates in real-time as you adjust parameters
- Key Insight: The heatmap makes the inverse relationship between velocity and pressure immediately visible. Wherever you see red (fast flow), pressure is low. Wherever you see blue (slow flow), pressure is high.
Tip: Start in Venturi mode to understand the basic principle: narrow pipe = faster flow = lower pressure. Use the diameter sliders and watch the velocity overlay above the pipe. Switch to Airfoil mode to see how this principle creates lift; adjust the angle of attack. Click or drag to inject smoke traces—they stay visible while moving and fade only when stuck. Use Step Fwd/Bwd or Run/Stop with Animation Speed to inspect flow frame-by-frame or in slow motion. The combination of particle motion, velocity plot, pressure heatmap, and telemetry makes Bernoulli's Principle tangible and memorable.
Parameters
Followings are short descriptions on each parameter
-
Mode: Toggle between two simulation modes:
- Venturi Effect: Demonstrates flow through a pipe that narrows in the middle. Shows how fluid accelerates and pressure drops in the constriction. Includes pressure gauges (Manometers) at inlet, neck, and outlet.
- Airfoil Lift: Demonstrates flow around a NACA airfoil (wing cross-section). Shows how faster flow over the curved upper surface creates lower pressure, generating lift. Includes velocity vectors, lift force arrow, and stagnation point.
-
Inlet Velocity (v): The initial flow velocity in meters per second (10-100 m/s). This is the velocity of the fluid entering the system. Higher velocities create larger pressure differences. In Venturi mode, the velocity in the neck increases proportionally to maintain continuity (A₁v₁ = A₂v₂). In Airfoil mode, higher inlet velocity increases the lift force (L ∝ v²). The pressure drop is proportional to the square of velocity: ΔP ∝ v².
-
Angle of Attack (α): The angle at which the airfoil is tilted relative to the incoming flow (-15° to +30°). Only active in Airfoil mode. Positive angles (wing tilted up) increase lift. Negative angles decrease lift or create downward force. For small angles, lift is approximately proportional to angle of attack: Cₗ ≈ 2π × α. The lift force updates in real-time in the telemetry panel.
-
Step Bwd / Step Fwd: Step backward restores the previous simulation state (particles and smoke) from history; step forward advances one frame (stops continuous run first if it was running). Enables frame-by-frame analysis.
-
Run/Stop Button: Toggles continuous animation. When stopped, particles and smoke freeze; you can still change parameters, step forward/backward, or inject smoke. Useful for examining a single frame or slow-motion via Animation Speed.
-
Reset Button: Resets all particles to their initial positions, clears smoke traces, and clears step-back history. Useful for starting fresh or clearing accumulated traces.
-
Animation Speed: Slider from 0.1× to 2× (default 1×). Scales how far particles and smoke move per frame. Slow mode keeps streamlines visible across the full flow; fast mode advances flow quickly.
-
Inlet / Neck / Outlet Diameter (Venturi mode only): Sliders control pipe geometry. All critical points (throat, constriction extent) and flow are derived from the drawn pipe. Parameters are hidden in Airfoil mode.
-
Pressure Gauges (Manometers): Visual indicators showing pressure at key locations. In Venturi mode, three gauges show inlet, neck, and outlet pressures. The neck gauge always shows lower pressure than inlet/outlet. In Airfoil mode, the telemetry shows top and bottom pressures. All pressures are in kilopascals (kPa). Standard atmospheric pressure is ~101.3 kPa.
-
Pressure Heatmap: Color gradient overlay showing pressure throughout the flow field. Blue indicates high pressure/low speed regions. Red indicates low pressure/high speed regions. The heatmap updates in real-time as you adjust parameters, making the inverse relationship between velocity and pressure immediately visible.
-
Smoke Traces: Click or drag on the canvas to inject cyan dye. Click creates a short line of particles; dragging injects along the path. Dye stays at full opacity while moving and fades only when stuck on a surface (airfoil or pipe wall); off-screen traces are removed automatically. Useful for streamlines in both Venturi and Airfoil modes, and independent of animation speed.
-
Velocity Overlay Plot (Venturi mode): A 2D plot above the pipeline shows centerline velocity magnitude vs. x. Highlights acceleration in the neck and recovery in the outlet. Height and position follow the pipe geometry.
Controls and Visualizations
Followings are short descriptions on each control and visualization element
-
Mode Toggle Button: Switches between Venturi Effect and Airfoil Lift modes. The button text updates to show the current mode and what it will switch to.
-
Inlet Velocity Slider: Controls the initial flow velocity (10-100 m/s). Higher velocities create larger pressure differences and faster particle motion. The pressure calculations update in real-time.
-
Angle of Attack Slider: Controls the airfoil tilt angle (-15° to +30°). Only active in Airfoil mode. Adjusting this changes the lift force, which is displayed in the telemetry panel.
-
Run/Stop Button: Toggles continuous animation. When stopped, use Step Fwd/Bwd for single frames.
-
Step Bwd / Step Fwd Buttons: Advance or restore one frame; stepping stops continuous run first. History is limited for Step Bwd. Reset clears history.
-
Reset Button: Resets particle positions, clears smoke traces, and clears step-back history.
-
Animation Speed Slider: Range 0.1–2×. Controls how far particles and smoke move per frame. Slow (e.g. 0.1×) keeps long streamlines visible; fast (e.g. 2×) advances flow quickly.
-
Inlet / Neck / Outlet Diameter Sliders: Shown in Venturi mode only. Set pipe diameters; flow and gauges use geometry derived from these values.
-
Canvas (Click or Drag to Inject): Click or drag on the canvas to inject smoke traces. Dye stays visible while moving; it fades only when stuck on a surface and is removed when off-screen.
-
Velocity Overlay Plot: In Venturi mode, a plot above the pipe shows centerline velocity vs. x. Updates with diameter and inlet velocity.
-
Flow Particles: Hundreds of colored particles representing fluid elements:
- Particles are colored by speed: blue (slow) → cyan → yellow → red (fast)
- In Venturi mode, particles follow the pipe geometry (compress/expand with breakpoints); they wrap when they pass the right edge
- In Airfoil mode, particles flow around the wing; those that enter the airfoil respawn after a short stick delay to avoid residual buildup
- Motion is scaled by Animation Speed (0.1–2×)
-
Pressure Heatmap Overlay: Semi-transparent color gradient showing pressure throughout the flow field:
- Blue: High pressure, low velocity regions
- Red: Low pressure, high velocity regions
- Updates in real-time as parameters change
- Makes the inverse velocity-pressure relationship immediately visible
-
Venturi Pipe (Venturi Mode): A pipe that narrows in the middle:
- Inlet, neck, and outlet widths are set by the diameter sliders (defaults 200 / 80 / 200 px)
- Throat and constriction extent are derived from the pipe geometry
- Particles accelerate in the neck; velocity overlay plot above the pipe shows centerline speed vs. position
- Three pressure gauges (50 px above bottom) show pressure at inlet, neck, and outlet
-
NACA Airfoil (Airfoil Mode): A mathematically accurate wing cross-section:
- Curved upper surface and flatter lower surface
- Red dot marks the stagnation point (leading edge, where velocity is zero)
- Velocity vectors (yellow arrows) show flow direction and relative speed
- Green lift arrow shows the net upward force
- Angle of attack can be adjusted to change lift
-
Pressure Gauges (Manometers): Visual pressure indicators:
- Cyan tubes with fluid levels proportional to pressure
- In Venturi mode: three gauges at inlet, neck, and outlet
- Neck gauge always shows lower pressure
- Values displayed in kilopascals (kPa)
-
Velocity Vectors (Airfoil Mode): Yellow arrows on the airfoil surface:
- Show flow direction and relative speed
- Longer arrows on upper surface (faster flow)
- Shorter arrows on lower surface (slower flow)
- Visualize the velocity difference that creates pressure difference
-
Lift Force Arrow (Airfoil Mode): Green arrow pointing upward:
- Shows the net lift force generated by pressure difference
- Length is proportional to lift magnitude
- Label shows lift value in Newtons (N)
- Updates in real-time as angle of attack or velocity changes
-
Smoke Trace Particles (Cyan): Injected by clicking or dragging on the canvas:
- Click creates a short line of particles; drag injects multiple traces along the path
- Stay at full opacity while moving; fade only when stuck on a surface (airfoil or pipe wall); removed when off-screen
- Useful for visualizing streamlines around obstacles or through constrictions
-
Live Telemetry Panel: Real-time pressure and force readouts:
- Venturi Mode: Shows inlet, neck, and outlet pressures (kPa)
- Airfoil Mode: Shows top pressure, bottom pressure, and net lift force (N)
- Updates continuously as parameters change
- Values calculated using Bernoulli's equation
-
Color Legend: Shows the meaning of colors:
- Blue: High pressure / Low speed
- Red: Low pressure / High speed
- Cyan: Smoke trace particles
Key Concepts
-
Bernoulli's Principle: The fundamental relationship between velocity and pressure in fluid flow:
- Statement: As the speed of a fluid increases, its pressure decreases (and vice versa).
- Mathematical Form: P + ½ρv² = constant (for horizontal flow)
- Physical Cause: Conservation of energy. When fluid accelerates, kinetic energy (½ρv²) increases, so potential energy (pressure) must decrease.
- Key Insight: This is not a cause-and-effect relationship - velocity and pressure change together to conserve energy. The cause is usually a change in geometry (like a constriction) that forces velocity to change.
Bernoulli's Principle explains many everyday phenomena: airplane flight, carburetors, atomizers, shower curtains, and more.
-
Venturi Effect: The specific application of Bernoulli's Principle to flow through a constriction:
- What Happens: When fluid flows through a narrow section, it must speed up (continuity equation), so pressure drops (Bernoulli's equation).
- Continuity Equation: A₁v₁ = A₂v₂ (mass conservation)
- Pressure Drop: ΔP = ½ρ(v₂² - v₁²) = ½ρv₁²((A₁/A₂)² - 1)
- Applications: Carburetors (mix fuel with air), atomizers (create fine sprays), flow meters (measure flow rate), Venturi meters (measure pressure drop to calculate flow).
- Key Insight: The pressure drop is proportional to the square of the area ratio. A 2:1 area ratio creates a 4:1 velocity ratio and significant pressure drop.
-
Airfoil Lift: How wings generate upward force using Bernoulli's Principle:
- Geometry: Curved upper surface, flatter lower surface
- Flow Behavior: Air must travel faster over the curved top to meet air flowing under the wing at the trailing edge
- Pressure Difference: Faster flow above = lower pressure above. Slower flow below = higher pressure below.
- Lift Force: L = ½ρv²ACₗ, where Cₗ ≈ 2π × α for small angles
- Angle of Attack: Tilting the wing increases the pressure difference and lift (up to stall angle)
- Key Insight: Lift is generated by the pressure difference, not by air "bouncing off" the bottom of the wing. The curved upper surface is crucial - a flat wing would generate much less lift.
-
Continuity Equation: Conservation of mass in fluid flow:
- Formula: A₁v₁ = A₂v₂ (for incompressible flow)
- Physical Meaning: The same amount of fluid must pass through every cross-section per unit time
- Consequence: When area decreases, velocity must increase (and vice versa)
- Visualization: In the simulation, particles pack closer together in narrow sections - this is streamline bundling, showing that the same number of particles must pass through a smaller area, so they must move faster.
- Key Insight: Continuity tells us velocity changes. Bernoulli's equation then tells us pressure must change to conserve energy.
-
Streamlines: The paths that fluid particles follow:
- Definition: Curves that are everywhere tangent to the velocity vector
- Properties: In steady flow, streamlines never cross. The spacing between streamlines is inversely proportional to velocity.
- Visualization: Smoke traces in the simulation show individual streamlines. In Venturi mode, streamlines get closer together in the neck (faster flow). In Airfoil mode, streamlines split around the wing, with closer spacing on top (faster flow).
- Key Insight: Streamlines are a powerful visualization tool. They show flow direction, and their spacing shows relative velocity. Closer together = faster flow = lower pressure.
-
Stagnation Point: The point where flow velocity is zero:
- Location: At the leading edge of the airfoil (marked with red dot)
- Pressure: Maximum pressure (all kinetic energy converted to pressure: P = P₀ + ½ρv²)
- Physical Meaning: The fluid "stops" at this point before splitting around the wing
- Key Insight: The stagnation point is where the flow divides. Above it, flow speeds up (lower pressure). Below it, flow may slow down or speed up depending on geometry (pressure changes accordingly).
-
Applications: Bernoulli's Principle is essential for:
- Aerodynamics: Aircraft design (lift generation), wind turbines (energy extraction), vehicle design (reducing drag)
- Fluid Systems: Pumps, compressors, flow measurement (Venturi meters, Pitot tubes)
- Industrial Processes: Atomizers (spray painting, fuel injection), carburetors (fuel-air mixing), ejectors (mixing fluids)
- Everyday Phenomena: Shower curtains (sucked inward by fast air flow), curve balls in sports (pressure difference causes deflection), chimney draft (pressure difference drives flow)
|
|