Compute isentropic nozzle flow properties (Mach number, area ratio A/A*, pressure, temperature, density) in real time. Add optional normal shock to explore supersonic inlet and thrust nozzle design scenarios.
Fluid & Conditions
1.101.67
Air=1.4, Steam=1.3, Ar=1.67
0.015.0
1.025.0
Both subsonic and supersonic solutions are computed
// Nozzle flow animation
(function() {
const el = document.getElementById('nozzleAnimCanvas');
const ctx = el.getContext('2d');
const NPART = 80;
const particles = [];
let animT = 0;
function getParams() {
const M_exit_el = document.getElementById('mStatVal');
const M_exit = M_exit_el ? parseFloat(M_exit_el.textContent) || 1.5 : 1.5;
const gamma_el = document.getElementById('gamma');
const gamma = gamma_el ? parseFloat(gamma_el.value) || 1.4 : 1.4;
return { M_exit, gamma };
}
function resize() {
const dpr = window.devicePixelRatio || 1;
const w = el.parentElement.clientWidth - 36;
const H = Math.round(w * 0.4);
if (Math.abs(el.width - w * dpr) > 2 || el.height !== H * dpr) {
el.width = w * dpr;
el.height = H * dpr;
el.style.height = H + 'px';
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
particles.length = 0;
for (let i = 0; i < NPART; i++) {
particles.push({ x: Math.random() * w, y: H/2 + (Math.random()-0.5) * H * 0.3, speed: 1 });
}
}
return { W: w, H };
}
// Convergent-divergent nozzle profile
function nozzleHalfHeight(x, W, H) {
const throatX = W * 0.5;
const inletH = H * 0.42;
const throatH = H * 0.18;
const exitH = H * 0.38;
if (x <= throatX) {
const t = x / throatX;
return inletH + (throatH - inletH) * t * t;
} else {
const t = (x - throatX) / (W - throatX);
return throatH + (exitH - throatH) * t;
}
}
function machAtX(x, W, M_exit) {
// Linear interpolation: M=0.3 at inlet, M=1 at throat, M=M_exit at exit
const throatX = W * 0.5;
if (x <= throatX) {
const t = x / throatX;
return 0.3 + (1.0 - 0.3) * t;
} else {
const t = (x - throatX) / (W - throatX);
return 1.0 + (M_exit - 1.0) * t;
}
}
// Mach number to color: subsonic=blue, sonic=green, supersonic=red
function machColor(M) {
if (M < 1) {
const t = M;
return `rgb(0,${Math.round(100 + t*80)},255)`;
} else {
const t = Math.min(1, (M - 1) / 2);
return `rgb(${Math.round(t*230)},${Math.round(200 - t*200)},${Math.round(255 - t*255)})`;
}
}
function frame() {
const { W, H } = resize();
const { M_exit } = getParams();
animT += 1/60;
ctx.clearRect(0, 0, W, H);
ctx.fillStyle = '#001F3F';
ctx.fillRect(0, 0, W, H);
const cy = H / 2;
// Draw colored Mach number background
const NX = 80;
for (let i = 0; i < NX; i++) {
const x = (i / NX) * W;
const x2 = ((i+1) / NX) * W;
const M = machAtX(x, W, M_exit);
const h = nozzleHalfHeight(x, W, H);
ctx.fillStyle = machColor(M);
ctx.globalAlpha = 0.35;
ctx.fillRect(x, cy - h, x2 - x + 1, h * 2);
}
ctx.globalAlpha = 1;
// Draw nozzle walls
ctx.strokeStyle = '#007BFF';
ctx.lineWidth = 3;
ctx.beginPath();
for (let i = 0; i <= 100; i++) {
const x = (i / 100) * W;
const h = nozzleHalfHeight(x, W, H);
if (i === 0) ctx.moveTo(x, cy - h);
else ctx.lineTo(x, cy - h);
}
ctx.stroke();
ctx.beginPath();
for (let i = 0; i <= 100; i++) {
const x = (i / 100) * W;
const h = nozzleHalfHeight(x, W, H);
if (i === 0) ctx.moveTo(x, cy + h);
else ctx.lineTo(x, cy + h);
}
ctx.stroke();
// Throat marker
ctx.strokeStyle = 'rgba(255,255,255,0.5)';
ctx.lineWidth = 1;
ctx.setLineDash([3, 3]);
const throatX = W * 0.5;
const throatH = nozzleHalfHeight(throatX, W, H);
ctx.beginPath();
ctx.moveTo(throatX, cy - throatH - 8);
ctx.lineTo(throatX, cy + throatH + 8);
ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = 'rgba(255,255,255,0.6)';
ctx.font = '9px Roboto Mono';
ctx.textAlign = 'center';
ctx.fillText('Throat M=1', throatX, cy - throatH - 12);
// Particles
for (let p of particles) {
const M = machAtX(p.x, W, M_exit);
const h = nozzleHalfHeight(p.x, W, H);
// Check if inside nozzle
if (Math.abs(p.y - cy) > h * 0.95) {
p.x = 2;
p.y = cy + (Math.random() - 0.5) * nozzleHalfHeight(0, W, H) * 1.8;
}
const spd = 1.5 + M * 2.5;
p.x += spd;
if (p.x > W) {
p.x = 2;
p.y = cy + (Math.random() - 0.5) * nozzleHalfHeight(0, W, H) * 1.8;
}
ctx.beginPath();
ctx.arc(p.x, p.y, 1.5, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(255,255,255,0.7)';
ctx.fill();
}
// Labels
ctx.fillStyle = 'rgba(255,255,255,0.8)';
ctx.font = 'bold 10px Roboto Mono';
ctx.textAlign = 'left';
ctx.fillText('M_exit = ' + M_exit.toFixed(2), 8, 16);
requestAnimationFrame(frame);
}
frame();
})();
What is Isentropic Nozzle Flow?
🙋
What exactly is an isentropic nozzle? I've heard of rocket nozzles, but what makes the flow "isentropic"?
🎓
Basically, it's a nozzle where the flow is both adiabatic (no heat transfer) and reversible. This means no energy is lost to friction or shocks, so entropy is constant. In practice, it's an ideal model for high-speed gas flow. Try selecting the "Input Mode" in the simulator above to choose between entering Mach number or area ratio—this is the fundamental starting point for all the calculations.
🙋
Wait, really? So if it's ideal, why is it useful? And what's this "A/A*" area ratio I see in the tool?
🎓
Great question! It's useful because it gives us the theoretical limit for performance, like a perfect engine. The area ratio $A/A^*$ is key. $A$ is the cross-sectional area at any point in the nozzle, and $A^*$ is the "throat" area where the flow becomes sonic (Mach = 1). For instance, to accelerate flow to supersonic speeds in a rocket, the nozzle must expand after the throat, so $A/A^*$ > 1. Move the input slider in the simulator and watch how the area ratio changes dramatically with Mach number.
🙋
Okay, that makes sense for smooth flow. But what about the "Add Normal Shock" option? What happens if a shock forms inside the nozzle?
🎓
Ah, now we're getting into real-world complications! A normal shock is a sudden, irreversible compression wave. If back pressure is too high, a shock can form in the diverging section, causing the flow to abruptly drop from supersonic to subsonic. Temperature and pressure jump up, but total pressure drops—that's a loss. Toggle the "Add Normal Shock" switch in the simulator. You'll see all the downstream properties change instantly, which is a common case in over-expanded rocket nozzles during sea-level testing.
Physical Model & Key Equations
The core of isentropic flow is the relationship between the local Mach number ($M$) and the area ratio ($A/A^*$), derived from conservation of mass, momentum, and energy for an ideal gas.
Here, $\gamma$ is the specific heat ratio (e.g., ~1.4 for air). $A^*$ is the throat area where $M=1$. This equation tells you the nozzle shape needed to achieve a desired Mach number.
When a normal shock is present, we use the Rankine-Hugoniot relations to find the property changes across the shock. The key is the upstream Mach number ($M_1$), which must be > 1.
$M_2$ is the subsonic Mach number after the shock. The pressure and temperature ratios across the shock, $p_2/p_1$ and $T_2/T_1$, are also functions of $M_1$ and $\gamma$. These jumps represent irreversible losses in total pressure.
Frequently Asked Questions
If the nozzle geometry is fixed, choose A/A*; if you want to directly specify the flow state (velocity), choose Mach number. For example, A/A* is convenient for nozzle design where the throat area is known, while Mach number is useful for determining wind tunnel operating conditions.
It allows you to verify the pressure and temperature rise when a shock wave occurs inside a supersonic intake or nozzle. For example, it is useful for quantitatively evaluating the shock wave position during engine startup and the performance degradation when operating off-design.
These are ideal values based on the isentropic assumption, so corrections accounting for losses (friction and heat transfer) are necessary in actual design. However, they are effective for understanding theoretical limits and trends, making them suitable for preliminary design studies and educational purposes.
A larger γ (e.g., changing from 1.4 for air to 1.67 for argon) results in higher pressure and temperature ratios at the same Mach number, promoting greater nozzle expansion. When dealing with combustion gases (γ ≈ 1.2–1.3), please set the value according to the actual working fluid.
Real-World Applications
Rocket Engine Nozzles: The bell-shaped nozzle on rockets like the SpaceX Merlin is designed using these principles. The area ratio $A/A^*$ determines the exit Mach number and thrust. Engineers use this simulator's calculations to optimize expansion for different altitudes, where ambient pressure changes.
Supersonic Wind Tunnels: To generate a steady supersonic flow for testing aircraft models, a wind tunnel uses a convergent-divergent (de Laval) nozzle. The design precisely follows the isentropic area-Mach relation. The "Add Normal Shock" feature models what happens if the test section conditions are incorrectly matched.
Steam Turbines & Gas Turbines: The nozzles that direct high-pressure steam or combustion gases onto turbine blades operate with compressible flow. CAE software uses these fundamental equations to predict efficiency and prevent condensation shocks (in steam) or performance losses.
High-Speed Inlets for Jet Engines: For aircraft like the SR-71 Blackbird, the inlet must slow supersonic air to subsonic speeds for the engine. This often involves a series of oblique shocks, but normal shock analysis (like in this tool) provides the foundational understanding of the pressure and temperature rise during deceleration.
Common Misconceptions and Points of Caution
Model assumptions: The mathematical model used here relies on simplifying assumptions such as linearity, homogeneity, and isotropy. Always verify that your real system satisfies these assumptions before applying results directly to design decisions.
Units and scale: Many calculation errors arise from unit conversion mistakes or order-of-magnitude errors. Pay close attention to the units shown next to each parameter input.
Validating results: Always sanity-check simulator output against physical intuition or hand calculations. If a result seems unexpected, review your input parameters or verify with an independent method.
Related Engineering Fields
Structural & Mechanical Engineering: Solid mechanics, elasticity theory, and materials science form the foundation for many of the governing equations used here.
Fluid & Thermal Engineering: Fluid dynamics and heat transfer share similar mathematical structures (conservation equations, boundary-value problems) and frequently appear in multi-physics problems alongside structural analysis.
Control & Systems Engineering: Dynamic system analysis, state-space methods, and signal processing connect to the time-dependent behaviors modeled in this simulator.