Lesson 6 of 16

The Continuity Equation

The Continuity Equation

For an incompressible fluid (constant density), conservation of mass requires that the volume flow rate QQ is constant along a streamtube:

A1v1=A2v2    Q=Av=constA_1 v_1 = A_2 v_2 \implies Q = Av = \text{const}

This is the continuity equation — what flows in must flow out.

Volume Flow Rate

The volume flow rate QQ is the volume of fluid passing a cross-section per unit time:

Q=AvQ = Av

where AA is the cross-sectional area (m²) and vv is the flow velocity (m/s). Units: m³/s.

Exit Velocity

Rearranging the continuity equation gives the velocity at any cross-section:

v2=A1v1A2v_2 = \frac{A_1 v_1}{A_2}

A narrowing pipe (A2<A1A_2 < A_1) produces a higher velocity — this is why water speeds up at a garden hose nozzle. A widening pipe slows the flow.

Mass Flow Rate

The mass flow rate m˙\dot{m} accounts for fluid density ρ\rho (kg/m³):

m˙=ρQ=ρAv\dot{m} = \rho Q = \rho A v

Units: kg/s. For an incompressible fluid, m˙\dot{m} is also conserved along a streamtube.

Your Task

Implement the following functions:

  • flow_rate(A, v) — returns volume flow rate Q=AvQ = Av in m³/s
  • exit_velocity(A1, v1, A2) — returns exit velocity v2=A1v1/A2v_2 = A_1 v_1 / A_2 in m/s
  • mass_flow_rate(rho, A, v) — returns mass flow rate m˙=ρAv\dot{m} = \rho A v in kg/s
Python runtime loading...
Loading...
Click "Run" to execute your code.