Compressible Flow Calculator
Back
Compressible Flow

Compressible Flow & Mach Number Calculator

Isentropic relations · Normal shock · Oblique shock — computed and visualized in real time. Adjust M and γ, mark the operating point on P/P₀, T/T₀, ρ/ρ₀, A/A* curves.

Parameters
Mach Number M₁
M=1: sonic   M>1: supersonic
Specific Heat Ratio γ
Air: 1.40 · He: 1.67 · CO₂: 1.30
Presets

Isentropic relations:

$$\frac{T_0}{T}=1+\frac{\gamma-1}{2}M^2$$ $$\frac{P_0}{P}=\left(1+\frac{\gamma-1}{2}M^2\right)^{\!\gamma/(\gamma-1)}$$ $$\frac{A}{A^*}=\frac{1}{M}\left[\frac{2}{\gamma+1}\left(1+\frac{\gamma-1}{2}M^2\right)\right]^{\!(\gamma+1)/[2(\gamma-1)]}$$

Normal shock (Rankine-Hugoniot):

$$M_2=\sqrt{\frac{M_1^2(\gamma-1)+2}{2\gamma M_1^2-(\gamma-1)}}$$ $$\frac{P_2}{P_1}=\frac{2\gamma M_1^2-(\gamma-1)}{\gamma+1}$$
Results
P/P₀
T/T₀
ρ/ρ₀
A/A*
Isentropic Relations vs Mach Number

What is Compressible Flow & Mach Number?

🙋
What exactly is a Mach number? I hear about jets being "supersonic," but what does the number itself mean?
🎓
Basically, the Mach number (M) is just the speed of an object divided by the speed of sound in the surrounding fluid. So, M=1 means you're flying exactly at the speed of sound. In this simulator, the "Mach Number M₁" slider directly controls this. Try moving it from 0.5 to 2.0 and watch how the flow field changes from subsonic to supersonic.
🙋
Wait, really? Why does the fluid's behavior change so drastically just by crossing M=1? And what's that "Specific Heat Ratio γ" parameter for?
🎓
Great question! When you go faster than sound, pressure disturbances can't travel upstream to warn the incoming flow, causing a sudden, discontinuous "shock wave." The ratio γ (gamma) is a property of the gas—like air (γ≈1.4) or exhaust (γ≈1.33)—that determines how compressible it is. Change γ in the simulator and you'll see how it affects the shock angle and pressure ratios.
🙋
Okay, so we have shocks. What's the "Deflection Angle θ" then? Is that like a wing's angle of attack?
🎓
Exactly! For an oblique shock, θ is the angle a solid surface, like a supersonic wing or a ramp, turns the flow. A common case is the sharp leading edge of a Concorde's wing. Adjust the θ slider with a supersonic M₁, and you'll see the shock wave angle change. If you turn it too much, the simulator will show a detached bow shock, which happens in front of blunt re-entry capsules.

Physical Model & Key Equations

The core of compressible flow analysis is the isentropic flow relations. They describe how key properties like temperature (T) and pressure (P) change with Mach number when the flow is smooth and reversible (no shocks). The "stagnation" or "total" values (T₀, P₀) are what you'd measure if you brought the flow to rest isentropically.

$$\frac{T_0}{T}=1+\frac{\gamma-1}{2}M^2$$ $$\frac{P_0}{P}=\left(1+\frac{\gamma-1}{2}M^2\right)^{\!\gamma/(\gamma-1)}$$

Where: M is the Mach number, γ (gamma) is the specific heat ratio, T₀/P₀ are stagnation (total) temperature/pressure, and T/P are the static temperature/pressure in the moving flow.

When a supersonic flow encounters an obstacle or turn, it can form a shock wave—a nearly instantaneous jump in flow properties. The normal shock relations are the most fundamental, giving the downstream Mach number M₂ and property ratios directly from the upstream M₁ and γ.

$$M_2^2 = \frac{M_1^2 + \frac{2}{\gamma-1}}{\frac{2\gamma}{\gamma-1}M_1^2 - 1}$$

Physical Meaning: This equation shows that a normal shock always decelerates a supersonic flow (M₁ > 1) to a subsonic flow (M₂ < 1). The flow undergoes a sudden increase in pressure, temperature, and density, which is an irreversible, lossy process.

Frequently Asked Questions

By changing the Mach number M using the slider or numerical input field at the top of the graph, the corresponding values of P/P₀, T/T₀, ρ/ρ₀, and A/A* are calculated in real time, and a mark is automatically displayed at the corresponding position on each curve.
Yes, it can be changed in the γ input field at the top of the screen (the initial value is typically 1.4 for air). Changing γ immediately updates all calculation results and graphs for isentropic relations and shock waves.
A normal shock wave is used for one-dimensional problems where the flow impinges perpendicularly on the shock wave, while an oblique shock wave is used for two-dimensional problems where the flow strikes a surface, such as a wing or ramp, at an angle. For oblique shock waves, the relationship between the deflection angle and the wave angle can also be calculated.
A/A* is the ratio of the flow cross-sectional area to the critical cross-sectional area (where M=1). For M < 1, A/A* > 1; for M > 1 in the supersonic region, A/A* > 1 as well; at M=1, it reaches its minimum value of 1. It never becomes less than 1.

Real-World Applications

Supersonic Aircraft & Inlet Design: Engineers use these relations to design engine inlets for jets like the SR-71 Blackbird. They must slow down the supersonic incoming air to subsonic speeds for the engine compressor using a series of oblique shocks, which cause less total pressure loss than a single normal shock. The parameters in this simulator are directly used to configure boundary conditions in CFD solvers like Fluent or OpenFOAM's sonicFoam.

Rocket Nozzles & Spacecraft Re-entry: The converging-diverging nozzle of a rocket is sized using the area ratio relation (A/A*) shown in the theory. During re-entry, spacecraft like the Apollo capsule create a strong, detached bow shock. Simulating this shock structure is critical for estimating the immense heat load on the heat shield.

Wind Tunnel Testing: In supersonic wind tunnels, engineers often measure the static pressure on a model and the stagnation pressure in the settling chamber. Using the isentropic relations from this tool in reverse, they can accurately calculate the test section Mach number without directly measuring velocity.

High-Speed Aerodynamic Design: The deflection angle (θ) calculations for oblique shocks are essential for designing supersonic wings, engine nacelles, and the intakes for scramjets. By controlling shock angles, designers can manage wave drag and prevent engine unstart, where a shock is expelled from the inlet.

Common Misunderstandings and Points to Note

There are a few key points I want you to be especially mindful of when starting to use this tool. First is the point that "the specific heat ratio γ is not a fixed value". The default value of 1.4 is for air at room temperature, but γ decreases at high temperatures, like inside a jet engine, and is 1.67 for argon gas. Getting this value wrong can lead to significant errors in calculated results, particularly for temperature and pressure behind a shock wave. In practical work, the golden rule is to check the fluid and temperature range you're dealing with before setting γ.

Next, don't forget that "isentropic flow is, after all, an idealization". Real flow paths always have friction and heat conduction, so you won't get the neat temperature ratio (T/T₀) from the calculation exactly as-is. For example, in Laval nozzle design, it's standard practice to add a "safety margin" on top of the shape determined by this ideal calculation to account for losses due to friction.

Finally, make sure you correctly understand the meaning of the "maximum deflection angle" for oblique shock waves. If you use the tool to gradually increase the deflection angle θ for a Mach number of 3 and γ=1.4, the calculation should fail around 34 degrees. This signifies the limit: "under these conditions, an object cannot be turned more sharply than this." But in reality, you might need to turn it more sharply, right? In that case, the shock wave "detaches" from the object, creating a more complex interference pattern. The tool throwing an error is itself a signal of an important physical phenomenon.