Home › CFD Handbook › Compressible flow calculator
Compressible flow calculator: stagnation conditions, choked flow and normal shocks
Find the Mach number, stagnation pressure, choked mass flow and normal shocks of a gas flow.
Calculator
When is a flow compressible?
A gas flow is compressible when its density changes so much with the speed that a constant density no longer gives the right pressures, and for a given gas that change depends only on the Mach number [1]. The Mach number is the flow speed divided by the local speed of sound, and for an ideal gas the speed of sound follows from the temperature:
a = √(γRT), M = V/a (1)
Here γ is the ratio of specific heats and R the specific gas constant (NACA 1135, eqs. 29b and 30). For air at 20 °C the calculator gives a = 343.3 m/s, with γ = 1.4 (NACA 1135) and R = 287.117 J/(kg·K) from Lemmon et al. (2000) [2]. The density at rest, ρ0, relates to the density ρ of the moving gas by:
ρ0/ρ = (1 + (γ − 1)/2 M²)1/(γ − 1) (2)
This is the reciprocal of NACA 1135, eq. 45. To see what the density change does, set the isentropic p0 − p beside the constant-density estimate ½ρV², both with the static density ρ. The shortfall is the share of the true p0 − p that constant density misses. The velocity error is how much too high the velocity comes out when you read a measured p0 − p, from a pitot tube say, with incompressible Bernoulli:
How much error you accept is your call. The default, a velocity error of 1 %, comes from C. Wassgren’s course notes for ME 30800 at Purdue University [3]. They show that the error depends only on the Mach number and γ, and conclude that air can be treated as incompressible below about M 0.3 if 1 % is acceptable. Our calculation puts the line at M 0.282. It is a teaching criterion, not a physical limit.
eV = √((p0 − p)/(½ρV²)) − 1 (3)
Under Limit and details you can type another limit, anything above zero and up to 50 %. The line depends on γ only, so helium reaches 1 % at M 0.283, almost where air does.
The default compressed-air line runs at M 0.414, with a density at rest 8.8 % above the static density and a velocity error of 2.2 %, so the calculator advises the Ideal Gas density model. For the example Slow duct flow, air at 20 m/s, constant density is fine. The verdict judges the speed at the section you typed. A pressure drop or heating along the domain also changes the density and can call for Ideal Gas where this check passes. For the solver, see the STAR-CCM+ section.
Stagnation pressure and temperature
The stagnation pressure and temperature, also called total pressure and total temperature, are the values a gas would reach if it were brought to rest without losses and without heat transfer [1], as at the stagnation point of a pitot tube in subsonic flow. The static pressure is the one the moving gas has, the one a wall tap reads.
Stagnation pressure formula
For isentropic flow of a perfect gas the ratio of total to static pressure depends on the Mach number and γ alone. This is the stagnation pressure equation the calculator uses, NACA 1135, eq. 44, written for p0/p:
p0/p = (1 + (γ − 1)/2 M²)γ/(γ − 1) (4)
Both pressures in (4) are absolute. The stagnation pressure calculator above takes your static pressure, temperature and flow and gives p0 gauge and absolute.
Total temperature
The total temperature follows from the energy equation of an adiabatic flow, cpT + V²/2 = cpT0 (NACA 1135, eq. 32b), with cp = γR/(γ − 1) for a perfect gas. Written with the Mach number it is eq. 43 [1]:
T0/T = 1 + (γ − 1)/2 M², T0 = T + V²/(2cp) (5)
So the total temperature depends only on the static temperature and the speed, not on the pressure.
The default case worked through
The calculator opens on a compressed-air line: static 2.000 bar g and 20 °C at a wall tap and 1.000 kg/s through a 50.0 mm bore, with ambient and Reference Pressure at 101 325 Pa. That gives V = 142.3 m/s and M = 0.414, with a static density of 3.580 kg/m³.
With (4) and (5) the total pressure is 2.378 bar g (3.391 bar a) and the total temperature 30.07 °C (303.22 K). Bernoulli with constant density puts p0 − p 4.2 % too low, and that is the gap the loupe shows between the two upper rungs of the pressure ladder.
Load the default case in the calculator ↑
Pressure and temperature can each be static or total, and the flow a velocity, a mass flow with a size, or a Mach number. The example Tank to pipe mixes them: a static 1 bar g in the pipe and the total 20 °C of the tank. With 0.5 kg/s through 40 mm the static temperature in the pipe comes out at 7.39 °C.
With both values total, as in From total conditions (6 bar g and 20 °C, 0.5 kg/s through 25 mm), there are two answers, M 0.390 (shown) and M 1.954 (under Solution). The bore passes at most 0.8125 kg/s, so the field refuses 0.9 kg/s and shows that maximum.
Choked flow
Choked flow is the state in which the smallest section of a gas flow runs at Mach 1, so that a lower back pressure no longer increases the mass flow. For given total conditions the mass flow per unit area is largest at Mach 1, so a throat cannot pass more than it does at the speed of sound [1].
Critical pressure ratio
A converging nozzle or an orifice treated as isentropic chokes when the back pressure is at or below p*, the static pressure at Mach 1. A converging–diverging nozzle chokes earlier, at a back pressure set by its area ratio: 0.9372 of p0 for Ae/At = 2.0 (below). The ratio p*/p0 follows from (4) with M = 1:
p*/p0 = (2/(γ + 1))γ/(γ − 1) (6)
For γ = 1.4 that is 0.5283; other gases are in the gas presets. The ratio is between absolute pressures: air from 6 bar g chokes for any back pressure at or below 3.705 bar a, which is 2.692 bar g.
Choked mass flow through an orifice or nozzle
Once the throat is at Mach 1, the mass flow depends only on the total state upstream, the gas and the throat area A, times a discharge coefficient Cd. This is the choked flow equation, built from NACA 1135, eqs. 43, 44 and 30:
ṁ = CdAp0 √(γ/(RT0)) (2/(γ + 1))(γ + 1)/(2(γ − 1)) (7)
For air this is ṁ = 0.04041 CdAp0/√T0 in SI units (A in m², p0 in Pa, T0 in K). The Choked flow tab opens on a leak, air at 6 bar g and 20 °C through a 5 mm hole to the atmosphere with Cd = 1.00: choked, 117.0 kg/h.
Above the critical ratio the throat pressure equals the back pressure pb and the flow is not choked. With r = pb/p0 the mass flow is then:
ṁ = CdAp0 √(2γ/((γ − 1)RT0)) √(r2/γ − r(γ + 1)/γ) (8)
In the example Small pressure drop the same 6 bar g supply discharges against a back pressure of 5 bar g, above p*, and the hole passes 83.99 kg/h, 0.7179 of the choked value. Under Find, you can ask the reverse: Size an orifice wants 50 kg/h from the same supply and gets a 3.27 mm bore.
Load the leak example in the calculator ↑
The choked flow calculator in the Choked flow tab treats the throat as an ideal, isentropic converging nozzle and scales its mass flow by your Cd, referred to the throat area you type. The examples use Cd = 1, which gives the largest leak and the smallest bore; at Cd = 0.6 Size an orifice needs 4.22 mm. The tool accepts 0 < Cd ≤ 1 but offers no typical values, as we found no primary source to cite, so use a measured value or your supplier’s.
Liquids choke as well, in control valves, through flashing and cavitation. That case is on our page on choked flow and cavitation in control valves.
Isentropic flow relations and tables
The isentropic flow equations give the static-to-total ratios of pressure, temperature and density, and the area ratio, as functions of the Mach number alone, for a perfect gas that flows without losses and without heat transfer [1]. The first three are the reciprocals of (5), (4) and (2), as NACA 1135 writes them in eqs. 43 to 45:
T/T0 = (1 + (γ − 1)/2 M²)−1, p/p0 = (1 + (γ − 1)/2 M²)−γ/(γ − 1), ρ/ρ0 = (1 + (γ − 1)/2 M²)−1/(γ − 1) (9)
The Isentropic and shock tab (Tables on a phone) opens at M 2 in air, with p/p0 = 0.1278, T/T0 = 0.5556 and ρ/ρ0 = 0.2300. For supersonic flow it also gives the Mach angle μ = arcsin(1/M), 30.00° here, and Make a table adds q/p0 (eq. 48) and V/a* (eq. 50). The calculator reproduces 241 values of NACA 1135 Tables I and II within half a unit of the last printed digit.
Area ratio A/A*
A/A* is the area of a section divided by the area at which the same flow would be at Mach 1. It comes from the mass flow being the same in both sections (NACA 1135, eq. 80, inverted) [1]:
A/A* = (1/M) [(2/(γ + 1)) (1 + (γ − 1)/2 M²)](γ + 1)/(2(γ − 1)) (10)
Every area ratio above one has a subsonic and a supersonic Mach number: for A/A* = 3 they are M 0.197 and M 2.637, and you pick the branch in the list. A nozzle that is to reach Mach 2 at its exit needs an exit area 1.688 times its throat area.
Isentropic flow tables
For an isentropic flow calculator rather than a duty point, use the Isentropic and shock tab: it takes any one of M, p/p0, T/T0, ρ/ρ0, A/A* or the Mach angle and gives the rest. Under Make a table you get the columns from M 0 to at most 10 as a CSV file of up to 2001 rows with 6 significant digits.
For air with γ = 1.4 there are also two ready tables to download, isentropic flow from M 0 to 3 and normal shocks from M1 1 to 4 in steps of 0.05, each as CSV and as an A4 sheet at 300 dpi with 4 significant figures as NACA prints them.
Normal shock relations and tables
A normal shock is a thin jump at right angles to the flow from supersonic to subsonic speed, across which the total temperature stays the same and the total pressure falls [1]. It is not isentropic: the entropy rises, and that rise is the total-pressure loss.
p2/p1 = 1 + (2γ/(γ + 1))(M1² − 1), ρ2/ρ1 = (γ + 1)M1²/(2 + (γ − 1)M1²), T2/T1 = (p2/p1)/(ρ2/ρ1) (11)
M2² = (1 + (γ − 1)/2 M1²)/(γM1² − (γ − 1)/2) (12)
p02/p01 = [(γ + 1)M1²/((γ − 1)M1² + 2)]γ/(γ − 1) [(γ + 1)/(2γM1² − (γ − 1))]1/(γ − 1) (13)
These normal shock equations are NACA 1135, eqs. 93 to 96 and 99. At M1 = 2, where the shock row of the tab opens, the gas leaves at M2 = 0.5774 with 4.500 times the static pressure, and p02/p01 = 0.7209: 28 % of the total pressure is lost. At M1 = 3 the loss is far larger, with p02/p01 = 0.3283.
M2 never falls below √((γ − 1)/(2γ)), whatever M1. The calculator refuses a normal shock with M1 below Mach 1, because the entropy would fall.
A pitot tube in a supersonic stream reads the total pressure behind its own normal shock, not p01, and the Rayleigh pitot formula (NACA 1135, eq. 100) relates that reading to the static pressure ahead [1]: at M1 = 2 it is 5.640 times as high. The shock row makes the same tab a normal shock calculator: under Normal shock, given you pick M1, M2, one of its ratios or, for a pitot reading, p1/p02, and it gives the rest. Make a table gives them for M1 from 1 to at most 10 as a CSV file.
Shocks in a converging–diverging nozzle
A converging–diverging (de Laval) nozzle shows every regime of isentropic nozzle flow with a normal shock as the back pressure falls. The calculator draws one with Ae/At = 2.0, the exit area over the throat area, and three back-pressure ratios divide the regimes:
The tab opens with M1 = 2 in the shock row and the shock at pb/p0 = 0.6263. Set pb/p0 to 0.75 and the shock moves to As/At = 1.400: the gas meets it at M1 = 1.763, loses 17 % of its total pressure and leaves the exit at M 0.380.
Stagnation inlet, mass flow inlet or pressure outlet in Simcenter STAR-CCM+
In Simcenter STAR-CCM+ a stagnation inlet takes the total pressure and total temperature of an imaginary plenum at rest upstream, plus a flow direction. A mass flow inlet takes the mass flow and a total temperature instead, and a pressure outlet the static pressure downstream. Use a stagnation inlet when you know the state upstream, a mass flow inlet when you know the mass flow, and pair either with a pressure outlet [4].
Avoid a velocity inlet here: it fixes the velocity but not the total energy. Keep the Outlet boundary type off this set-up too, because it cannot share a continuum with a stagnation inlet or a pressure outlet [4].
Gauge and absolute pressure
Simcenter STAR-CCM+ works in gauge pressure. Every pressure you set on a stagnation inlet, a mass flow inlet or a pressure outlet is relative to the Reference Pressure of the continuum, 101 325 Pa unless you change it [4]. So in the default case the Total Pressure to type is 237 809 Pa, not the absolute 339 134 Pa.
The gauge pressure you type in the calculator counts from your ambient pressure, while the value for STAR-CCM+ counts from the Reference Pressure; they match only when the two are equal, as when the calculator opens.
For a high-speed case with Ideal Gas you can also set the Reference Pressure to zero, and the gauge values are then absolute. For low-speed runs the documentation advises an ambient value, and zero does not suit a run with the Incompressible option [4].
The Total Pressure field function that STAR-CCM+ reports is gauge as well, so add the Reference Pressure before you compare it with the calculator’s absolute p0. With a temperature-dependent cp, STAR-CCM+ works from the enthalpy instead of the constant-γ formulas, so its values drift from this calculator’s [4].
The settings to copy
Under the result, Simcenter STAR-CCM+ settings to copy lists the fields of the boundary type you pick, by their names in the simulation tree, and Copy settings puts them on the clipboard as text, with pressures in pascals and temperatures in kelvin. Three of the fields need explaining.
STAR-CCM+ reads the Supersonic Static Pressure only while the inflow at the boundary is supersonic, and a poor value can make the run diverge if that happens [4]. For a subsonic inflow the calculator therefore says the field is not used.
For a mass flow inlet, set the Specification Option under Mass Flow Option to Mass Flow Rate, the flow for the whole boundary in kg/s. In a 2D axisymmetric model that rate is per radian, so the calculator divides it by 2π [4].
At a pressure outlet the Static Temperature is used only if flow comes back in through the boundary. Where the flow leaves the domain supersonic, the solver takes the outlet pressure from the interior and ignores the value you set [4]. Our post on pressure outlet options covers the backflow settings.
The inlet also needs turbulence values. Our turbulence boundary conditions calculator gives them, and the Reynolds number calculator the Reynolds number at the same state.
Gas model and solver
For a compressible run the gas needs the Ideal Gas model, with its Incompressible property Off. The default air of a new STAR-CCM+ simulation works out at a ratio of specific heats of about 1.4006 from its constant specific heat and molecular weight (our arithmetic, since Siemens does not state γ) [4]. The calculator uses γ = 1.4.
For the solver, the documentation recommends Coupled Flow for highly compressible flow such as transonic or supersonic flow. The segregated solver can handle mildly compressible flow but is not suited to shocks or high Mach numbers [4]. The documentation gives no Mach number for the switch, so the calculator shows the density change and the Bernoulli error at your state instead. Our post on coupled solver settings covers the solver side.
How the calculator works
This compressible flow calculator treats the gas as calorically perfect, with a constant γ and R, and the flow as quasi-one-dimensional and isentropic except across a normal shock, the model NACA Report 1135 uses for its tables [1]. Inside, every pressure is absolute in Pa, and only the values for Simcenter STAR-CCM+ are turned into gauge values. Units are converted with factors built from the exact definitions in NIST SP 811 [5]. Where this page gives no source for a relation or a number, it is our own derivation or calculation from the cited ones.
Combining (1), (2) and (5), the mass flow per unit area through a section with total conditions p0 and T0 is:
ṁ/A = p0/√(RT0) · φ(M), φ(M) = √γ M (1 + (γ − 1)/2 M²)−(γ + 1)/(2(γ − 1)) (14)
φ is largest at Mach 1, 0.6847 for γ = 1.4, and with that maximum (14) becomes (7) for Cd = 1. Everything else follows from the Mach number, and the Duty point tab finds it by one of four routes:
Inverses without a closed form, such as A/A* or, from M1 = 1.0005 upward, p02/p01, use a bracketed Newton iteration and return their starting Mach number to 10⁻⁹ relative in our tests.
For air the calculator checks the constant γ twice against the equation of state of Lemmon et al. (2000) [2], which our air and water page uses for the specific heat of air: once with a cp that follows temperature at 1 bar, and, in the Duty point tab, once with real air at your pressure, at the same entropy, with the enthalpy raised by V²/2. Every preset also gets a check of the compressibility factor Z against 1 %, from NIST data for the gases other than air [6].
Gas presets
The presets take γ of the real gas at 300 K and 1 bar from the NIST Chemistry WebBook [6], and R from the molar gas constant [7] and the standard atomic weights [8]. Air keeps the γ = 1.4 of NACA 1135 and the R of Lemmon et al. (2000). The last column is the pressure up to which |Z − 1| stays within 1 % on the 300 K isotherm.
Limits
A constant γ is the main assumption. Simcenter STAR-CCM+’s own guideline for air treats it as calorically perfect, with a constant specific heat, below about Mach 3, and the calculator notes any Mach number above 3. A hot gas can fall outside a constant γ at a low Mach number too. For air the calculator also flags any T0 − T or p0 − p more than 1 % off the value with a cp that follows temperature at 1 bar, our own threshold. In the example Hot air, 800 °C at 150 m/s (M 0.228), that cp moves the total temperature by −1.46 K, 13 % of T0 − T. The settings to copy give two Total Temperatures: 1084.35 K for the constant specific heat that STAR-CCM+’s default air keeps unless you change it, and 1082.89 K for a temperature-dependent cp [4].
In the Duty point tab a second note flags the pressure effect when real air at your pressure moves T0 − T or p0 − p more than 1 % from the cp(T) value: at M 0.5 and 20 °C from about 7.7 bar absolute static pressure. In the Choked flow tab the Z check covers it.
At high pressure, or near the critical point, a gas is no longer ideal and the Z check shows a note. Below its critical temperature a gas may condense, and at or above its saturation pressure the calculator says it would. In every tab the notes show under the answer.
A gas mixture, such as an exhaust gas, goes in as Own gas with one γ and one R for the whole mixture, with 1 < γ ≤ 1.7 and no real-gas check.
The flow is quasi-one-dimensional: one state per section, no wall friction and no heat transfer along a duct, so a long pipe needs another method. The examples are constructed duties, not measured cases.
References and changelog
References
[1] Ames Research Staff, Equations, Tables, and Charts for Compressible Flow, NACA Report 1135, 1953. NASA Technical Reports Server, document 19930091059. ntrs.nasa.gov
[2] E. W. Lemmon, R. T Jacobsen, S. G. Penoncello and D. G. Friend, Thermodynamic Properties of Air and Mixtures of Nitrogen, Argon, and Oxygen From 60 to 2000 K at Pressures to 2000 MPa, Journal of Physical and Chemical Reference Data 29(3), 331–385, 2000. doi.org
[3] C. Wassgren, Notes on Thermodynamics, Fluid Mechanics, and Gas Dynamics, Purdue University, ME 30800, reading “Compressible flow: stagnation and sonic conditions”, 2021, problem comp_24. engineering.purdue.edu
[4] Simcenter STAR-CCM+ documentation (2606), Siemens Digital Industries Software, User Guide and Knowledge Base.
[5] A. Thompson and B. N. Taylor, Guide for the Use of the International System of Units (SI), NIST Special Publication 811, 2008 edition, Appendix B. nvlpubs.nist.gov
[6] NIST Chemistry WebBook, NIST Standard Reference Database 69, Thermophysical Properties of Fluid Systems: nitrogen, oxygen, carbon dioxide, argon, helium, hydrogen and methane. webbook.nist.gov
[7] NIST Reference on Constants, Units, and Uncertainty: the molar gas constant (CODATA). physics.nist.gov
[8] IUPAC Commission on Isotopic Abundances and Atomic Weights, Abridged Standard Atomic Weights, 2024. www.ciaaw.org
Changelog
November 2026: first published, with the calculator and this guide. Each cited statement was checked against the saved text of its source, and the Simcenter STAR-CCM+ statements against the Siemens documentation (2606). Relations and numbers given without a source are our own derivations and calculations, and every example number is the calculator’s own result.
Questions about compressible flow

Questions about compressible flow, choked flow or a stagnation inlet set-up? We reply within one day.
Ask a technical question →
What is the difference between static and stagnation pressure?
The static pressure is the pressure of the moving gas, the one a wall tap reads. The stagnation (total) pressure is what the gas would reach if it were brought to rest without losses. For a perfect gas their ratio depends only on the Mach number and γ: p₀/p = (1 + (γ − 1)/2·M²)^(γ/(γ − 1)). In the default compressed-air line, static 2.000 bar g at M 0.414 gives a total pressure of 2.378 bar g.
What is the critical pressure ratio for air?
For air with γ = 1.4 the critical pressure ratio p*/p₀ is 0.5283. A converging nozzle or an orifice treated as isentropic chokes when the absolute back pressure is at or below that share of the absolute total pressure upstream; a converging–diverging nozzle chokes earlier, at a back pressure set by its area ratio. Other gases have other ratios, from 0.4867 for argon to 0.5470 for carbon dioxide.
When does a nozzle or orifice choke?
A converging nozzle or an orifice chokes when the back pressure falls to p*: the throat reaches Mach 1 and the mass flow stops rising. From then on it depends only on the total pressure and temperature upstream, the gas, the throat area and the discharge coefficient, as the choked flow equation shows. A converging–diverging nozzle chokes earlier, at its first critical back pressure, 0.9372 of p₀ for Aₑ/Aₜ = 2.0. Air from 6 bar g through a 5 mm hole to the atmosphere is choked and passes 117.0 kg/h.
Is a normal shock isentropic?
No. The entropy rises across a normal shock, so the total pressure falls while the total temperature stays the same. At M₁ = 2 in air the shock keeps p₀₂/p₀₁ = 0.7209 of the total pressure and loses 28 %. The flow on each side of the shock is isentropic, and the jump itself follows the normal shock relations.
Are pressures in Simcenter STAR-CCM+ gauge or absolute?
The pressures you set on a stagnation inlet, a mass flow inlet or a pressure outlet are gauge values, relative to the Reference Pressure of the continuum, 101 325 Pa unless you change it. The calculator shows each value to type as gauge with the absolute value beside it. With Ideal Gas in a high-speed case you can set the Reference Pressure to zero, and then gauge and absolute are the same.
Should I use a stagnation inlet or a mass flow inlet?
Use a stagnation inlet when you know the total pressure and temperature upstream, for example from a tank or a plenum, and a mass flow inlet when you know the mass flow. Both take a Total Temperature and a Supersonic Static Pressure, and both go with a pressure outlet. In some complex turbomachinery cases the inlet flow direction is hard to establish with stagnation and pressure boundaries; for those the Simcenter STAR-CCM+ documentation suggests an initial solution with a mass flow inlet, then the switch to the stagnation inlet.
Is a constant γ good enough, or do I need cp(T)?
Simcenter STAR-CCM+’s guideline treats air as calorically perfect, with a constant γ, below about Mach 3, and the calculator notes any Mach number above 3. A hot gas can still be off at a low Mach number. For air the calculator therefore repeats its result with a cp that follows temperature, from Lemmon et al. (2000) at 1 bar, and shows a note when T₀ − T or p₀ − p is more than 1 % off, our own threshold. In the example Hot air, at M 0.228, T₀ − T is 13 % off. The pressure effect is not in this note: the Duty point tab has a second note for real air at your pressure, and the Z check flags a gas that is no longer ideal.
Why are the results not valid for a real gas?
The relations assume an ideal gas with a constant γ. At high pressure, or near the critical point, the compressibility factor Z moves away from one and the results become approximate. The calculator shows a note when |Z − 1| exceeds 1 %. For carbon dioxide at 300 K that happens above 2 bar, for nitrogen above 114 bar. Carbon dioxide can also condense: choked from 40 bar g and 20 °C, the ideal-gas throat would sit at 22.43 bar a and 255.69 K, above the saturation pressure there (21.28 bar a), so the calculator warns that the ideal-gas result does not hold.


