The Hong Kong Polytechnic UniversityDepartment of Aeronautical and Aviation EngineeringBack to the lab ↗

MODEL RECORD

Compressible Ducts

The governing assumptions, quantities, numerical method and limits of this teaching model.

Verification checks consistency with the declared equations. It does not establish experimental accuracy for an aircraft or facility.

Version: compressible-ducts-1.0.0 · 23 October 2026 (UTC)

Scope

Two separate analytical experiments describe a steady, constant-area circular duct. Fanno flow retains wall friction and sets heat transfer to zero. Rayleigh flow retains prescribed heat addition and sets wall friction to zero. Neither experiment combines both effects. The inlet static pressure, static temperature and Mach number are prescribed; there is no back-pressure boundary condition and no calculation of inlet adjustment, shock location or unstart.

The gas obeys p = rho R T with constant gamma = 1.4, R = 287.05 J kg^-1 K^-1 and cp = gamma R/(gamma - 1) = 1004.675 J kg^-1 K^-1. These are illustrative air constants. They are not a variable-property, reacting-air model. A visible warning is raised if a solved static temperature leaves 200–800 K; those thresholds are teaching flags, not certified error bounds. No empirical accuracy is asserted inside the band either.

Variables, units and conventions

SymbolMeaningInternal unit / convention
xStreamwise coordinate, positive downstreamm; graphs use x/L
D, LCircular diameter and requested lengthm
MAxial velocity / local speed of sounddimensionless
p, T, rho, uStatic pressure, static temperature, density, mean axial velocityPa absolute, K, kg/m3, m/s
p0, T0Local isentropic stagnation pressure and temperaturePa absolute, K
GConstant mass flux rho ukg/(m2 s)
qHeat added to one kilogram of flow since the inletJ/kg, positive for heating
f_DDarcy friction factor, prescribed constantdimensionless; f_D = 4 f_Fanning
delta sSpecific entropy relative to the same case's inletJ/(kg K)
*Sonic reference state on the same Fanno or Rayleigh lineM = 1

The circular area sets mass flow G pi D^2/4. Fanno geometry is entered as L/D and D. Rayleigh's default length is 6 m and heat is uniform per unit axial length: q(x) = q_requested x/L. Its length changes the physical heat distribution and transit time, but not a given total-heat endpoint in this analytical model.

Closure from conservation laws

Both modes enforce G = rho u, p = rho R T, u = M sqrt(gamma R T), and h0 = cp T + u^2/2 = cp T0.

Let a = (gamma - 1)/2. Local stagnation properties are

T0 = T (1 + a M^2)
p0 = p (1 + a M^2)^[gamma/(gamma - 1)]
delta s = cp ln(T/T1) - R ln(p/p1).

Stagnation pressure is a hypothetical local isentropic deceleration property. Its definition does not make the actual duct flow isentropic.

Fanno chapter

No heat or shaft work gives T0 = T01. The differential momentum balance with the Darcy convention is

dp + rho u du + (f_D/D) rho u^2 dx/2 = 0.

Integrating the mass, energy and momentum equations gives the remaining friction exposure

F(M) = (1 - M^2)/(gamma M^2)
     + (gamma + 1)/(2 gamma)
       ln[(gamma + 1) M^2 / (2 + (gamma - 1) M^2)].
F(M1) - F(M(x)) = f_D x/D.

Each station is solved on the interval between the prescribed M1 and 1, using bounded bisection. The other mathematical branch is never substituted. Then

T/T1 = (1 + a M1^2)/(1 + a M^2)
p/p1 = (M1/M) sqrt(T/T1).

The sonic length is L*/D = F(M1)/f_D. At f_D = 0 there is no finite friction-driven choking length; the properties remain at the inlet state. The application explicitly labels f_D rather than treating Darcy and Fanning factors interchangeably.

Rayleigh chapter

With no wall friction the conserved momentum flux is p + rho u^2 = p + G u. The energy input is q = cp (T0 - T01). Define

H(M) = T0/T0* = 2 (gamma + 1) M^2 (1 + a M^2)/(1 + gamma M^2)^2.
T0* = T01/H(M1).
H(M(x)) = [T01 + q(x)/cp]/T0*.
q* = cp (T0* - T01).

Again bisection retains the inlet branch between M1 and 1. Mass and momentum then yield

p/p1 = (1 + gamma M1^2)/(1 + gamma M^2)
T/T1 = (M/M1)^2 (p/p1)^2.

Heating raises T0 but does not always raise static T. Along a Rayleigh line static T has its maximum at M = 1/sqrt(gamma), whereas the maximum T0 and entropy occur at M = 1. The “Heat, yet cool?” preset begins at M1 = 0.88, above the static-temperature maximum, and adds 95% of the remaining heat to the sonic state. It therefore demonstrates decreasing T and increasing T0 without violating the energy balance.

Sonic boundary and impossible requests

Loading below the sonic limit gives a complete smooth solution. Loading equal to the limit gives M = 1 at the requested exit. A request above the limit has no complete steady continuation on the prescribed inlet branch:

  • The solution stops at x/L = available loading / requested loading.
  • The exact sonic station is included, but the remaining interval is hatched and has no property values.
  • exit is null; the headline Mach and losses are explicitly labelled “at sonic limit”, not exit results.
  • Probing an unresolved station returns null, and CSV exports contain no invented downstream rows.
  • No normal shock is silently inserted. A different boundary-value problem is needed to predict changed inlet flow, shocks or transients.

The classification tolerance is max(1e-12, 1e-10 times the available loading). It handles floating-point equality at the sonic limit, not physical slack. A sonic inlet with positive loading has zero solvable downstream length. At zero loading a sonic inlet is explicitly flagged as sonic/choked, and the entire duct remains at M = 1; it is not described as unchoked.

Visual and interaction contract

The duct is a schematic side section. Colour gives a uniform section-averaged scalar, not a 2D CFD field or a boundary-layer profile. Tracers follow the calculated velocity through an integrated travel-time map. Their clock is slowed and its physical/display ratio is shown. Both cases use the same clock, but each displayed strip has its own x/L coordinate. Marker count is not density.

Reference A is a frozen configuration. All live controls affect B. Each chapter retains a separate pair, and copied experiment links record both full configurations. The initial A is the same default inlet with zero friction/heat. Charts use common A/B axes; normalised p, T, p0 and T0 use each case's own inlet reference. The probe thermodynamic state is solved analytically at the requested position rather than linearly interpolating sampled thermodynamic values.

The line plots use 181 spatial samples for display. Bisection is bounded to 70 iterations. Only tracer travel time is integrated and interpolated numerically. Changing controls solves a new steady state; the moving markers do not depict the adjustment transient. Reduced-motion preference starts markers paused.

Verification evidence

Run node verify.js from this directory. It writes verification.json and exits non-zero if a check fails. Checks include:

  1. Property consistency cp/(cp-R) = gamma.
  2. Hand-evaluated special-case Fanno and Rayleigh landmarks and sonic references.
  3. Exact zero-loading limits over both branches, including sonic inlet.
  4. 29,160 sampled states: branch bounds, mass and energy closure, entropy increase, total-pressure decrease and Rayleigh momentum conservation.
  5. An independently derived Rayleigh velocity quadratic obtained by eliminating pressure and temperature from the three balances.
  6. Fanno integrated momentum including the wall-shear term, evaluated independently by Simpson quadrature in Mach number.
  7. Fourth-order Runge–Kutta integration of the Fanno differential equation, refined at 20, 40 and 80 steps and compared with the analytical branch.
  8. The Rayleigh static-temperature maximum and heating with static cooling.
  9. Invalid input rejection, sonic-inlet boundary, unresolved probe behaviour and tracer-domain containment.
  10. Analytical probe conservation at positions not included in the display sample grid.

These checks verify the implementation against its governing model. They do not validate an actual duct, engine, friction correlation, heat-transfer system or real-gas property range. There is no calibration to experimental data.

Remaining scope

Combined friction and heating, cooling, shocks, variable area, non-uniform wall heat transfer, heat-transfer coefficient or wall temperature, variable gas properties, fuel/chemistry, multidimensional boundary layers and unsteady inlet/outlet interaction remain outside version 1.0. Related links lead to the existing nozzle, normal-shock and gas-turbine chapters.