Fanno Flow Simulator Back
Compressible Flow Simulator

Fanno Flow Simulator — Compressible Duct Flow with Friction

Explore adiabatic compressible flow in a constant-area duct with wall friction. Sweep inlet Mach, gamma, Darcy friction factor and L/D to watch the Fanno-line state point evolve interactively.

Parameters
Inlet Mach M_1
Specific-heat ratio γ
Darcy friction factor f
Duct L/D

Perfect gas, adiabatic, 1-D, steady flow is assumed. f is the Darcy friction factor (same as on a Moody chart). When the actual 4fL/D exceeds the inlet 4fL*/D the flow is choked and the exit Mach is locked at M=1.

Results
Exit Mach M_2
Choking length 4fL*/D
Temperature ratio T_2/T_1
Pressure ratio P_2/P_1
Duct Schematic

Left = state 1 (inlet) / right = state 2 (exit) / arrow length = local velocity / wavy lines on the walls = friction / color gradient indicates relative temperature

Fanno Line (T-s Diagram)

y = T/T* / x = (s − s*)/c_p / upper branch = subsonic, lower branch = supersonic / blue dot = state 1, red dot = state 2 / orange line = path 1 → 2

Theory & Key Formulas

Fanno flow is the idealized model of adiabatic compressible flow in a constant-area duct with wall friction. Friction always drives the flow toward M=1 — the subsonic branch accelerates and the supersonic branch decelerates.

Choking distance (dimensionless) from a Mach number M to M=1:

$$\frac{4 f L^*}{D_h} = \frac{1 - M^2}{\gamma M^2} + \frac{\gamma+1}{2\gamma}\ln\!\left(\frac{(\gamma+1)M^2}{2 + (\gamma-1)M^2}\right)$$

The exit Mach M_2 is obtained numerically from the duct length L through:

$$\frac{4 f L^*_2}{D_h} = \frac{4 f L^*_1}{D_h} - \frac{4 f L}{D_h}$$

Temperature and pressure ratios are expressed against the sonic reference state:

$$\frac{T}{T^*} = \frac{\gamma+1}{2 + (\gamma-1)M^2}, \qquad \frac{P}{P^*} = \frac{1}{M}\sqrt{\frac{\gamma+1}{2 + (\gamma-1)M^2}}$$

T_2/T_1 and P_2/P_1 are simply the ratios of these reference forms. If the actual 4fL/D exceeds 4fL*_1/D the flow chokes and the exit is locked at M=1.

What is the Fanno Flow Simulator

🙋
I keep hearing that "the longer a natural-gas pipeline gets, the more its mass flow saturates." What is the actual physics behind that?
🎓
That is exactly Fanno flow. In an adiabatic, constant-area duct with wall friction, friction always pushes the flow toward M=1. A subsonic inlet keeps accelerating downstream, and with a long enough pipe the exit reaches M=1 — the flow is choked, and the pipe simply cannot pass any more mass. With the defaults (M_1 = 0.30, γ = 1.4, f = 0.020, L/D = 50) the simulator returns M_2 ≈ 0.474.
🙋
So we only get from M_1 = 0.30 to M_2 = 0.47. If I keep stretching L/D will the exit Mach really climb all the way to 1?
🎓
Yes. As L/D grows, 4fL/D approaches the inlet 4fL*/D (about 5.30 here). At L/D ≈ 66 the exit hits exactly M=1 and the duct is choked. Beyond that you have to lower the inlet pressure or the inlet Mach to fit a longer pipe. Push the L/D slider up in the simulator and you will see M_2 latch at 1.000 with the red CHOKED badge.
🙋
In the right-hand T-s diagram the M=1 point sits at the rightmost edge with two branches splitting from it. What does that mean?
🎓
That is the Fanno curve. The y-axis is T/T*, x-axis is dimensionless entropy. The upper branch is subsonic, the lower branch is supersonic, and they meet at M=1 — the maximum entropy point. In an adiabatic duct entropy must rise, so the state can only travel rightward along the curve toward sonic conditions. You should see the orange path running from the blue inlet dot down-right along the subsonic branch to the red exit dot.
🙋
What if I set a supersonic inlet, say M_1 = 2.0? The behavior should flip, right?
🎓
Try it. Now friction decelerates the flow from M_1 = 2.0 toward M=1, and on the T-s diagram the state slides up-left along the supersonic branch from a lower-right starting point toward sonic conditions. Looks opposite to the subsonic case but the physics — entropy rising while the state heads to M=1 — is identical. That symmetry is the most beautiful part of Fanno flow.

Frequently Asked Questions

The f in this tool is the Darcy friction factor, the value read directly from a Moody chart. Some textbooks use the Fanning friction factor instead, with the conversion 4·f_F = f_D — the formula 4fL*/D in this simulator assumes the Darcy form. A typical hydraulically smooth pipe in turbulent flow has f_D ≈ 0.02, while rough commercial pipes may sit between 0.04 and 0.06.
Once the exit reaches M=1 the mass flow at that section is locked at the maximum value allowed by the upstream conditions. Lowering the back pressure further does nothing because the exit cannot exceed Mach 1, so the pipe is simply not able to carry more flow. This is the same physics that produces critical flow at the throat of a converging nozzle. Real designs avoid choking by widening D or lowering the inlet Mach.
Because the flow is adiabatic, the total enthalpy h_0 = h + V²/2 is conserved. In the subsonic branch the velocity V grows downstream, so the static temperature T must drop to compensate. With the defaults the drop is mild (T_2/T_1 ≈ 0.974), but if the inlet is at a low Mach number and the exit reaches near M=1, T_2/T_1 can fall to about 0.83. On the supersonic branch the deceleration causes T to rise.
Fanno flow is the "adiabatic + frictional" idealization, while Rayleigh flow is the "frictionless + heat-addition" idealization. Both apply to constant-area compressible duct flow, and both push the flow toward M=1, but they trace different curves on a T-s diagram and have different entropy histories. Real combustors and heat exchangers contain both effects, and engineers approximate the dominant one with one of the two models.

Real-World Applications

Long-distance pipeline design: Natural-gas and compressed-air pipelines that span tens or hundreds of kilometers are sized by Fanno-flow analysis. From the required exit flow and inlet pressure, engineers back out the diameter that prevents choking and decide whether booster compressors are needed. Even though the strict adiabatic assumption is corrected for heat transfer with the surroundings, Fanno flow is the unavoidable starting point of the calculation.

Rocket and jet engine ducting: Propellant feed lines on liquid rockets, bleed-cooling ducts on gas turbines and after-cooler runs on jet engines all use Fanno flow to evaluate how far the exit Mach can climb for a given run length. A bleed line that chokes deprives downstream cooling air, which can cause catastrophic failure, so designers keep 4fL*/D well above the predicted 4fL/D at all operating points.

Supersonic wind-tunnel diffusers: A supersonic test section is followed by a diffuser that decelerates the supersonic stream for recovery. Because friction acts as in Fanno flow, the diffuser length and exit Mach are linked by the choking limit. Too long a diffuser chokes and ruins the test condition; too short demands a larger downstream vacuum-pump capacity. The trade-off is a textbook Fanno-flow design problem.

HVAC and high-speed ventilation ducts: Even in building ventilation (Mach 0.1 - 0.3) strict pressure-drop calculations include the Fanno-flow correction. Low-Mach ducts can use the incompressible Darcy-Weisbach equation, but high-speed kitchen exhausts and process-air ducts in factories may need the compressible Fanno analysis to avoid undersizing the fan.

Common Misconceptions and Cautions

The most common error is to assume that "friction always decelerates a flow". In subsonic Fanno flow friction actually accelerates the gas. It looks counter-intuitive but it follows directly from the adiabatic assumption combined with mass conservation, and the simulator demonstrates it immediately with the default case (subsonic M_1 = 0.30 accelerates to M_2 = 0.474). Only the supersonic branch decelerates.

The next pitfall is to think a duct can be lengthened without limit. Fanno flow has a hard upper bound 4fL*_1/D — beyond that the flow chokes and the exit is locked at M=1. Push the L/D slider in the simulator and you will see the CHOKED badge appear. In practice engineers compute this limit first and design with a safety factor of 1.3 to 2.

A third caution is the distinction between the Darcy and the Fanning friction factor. This tool uses the Darcy factor, the value plotted on a Moody chart. Texts that use the Fanning factor f_F obey 4·f_F = f_D, and confusing the two underestimates pressure drop by a factor of 4. Always verify which definition a paper or textbook is using before transferring its values.