Computational Fluid Dynamics cover
Interactive book · Semester 5-8

Computational Fluid Dynamics

Discretise an equation, watch a scheme wiggle, run SIMPLE by hand, solve a lid-driven cavity live and prove your mesh is fine enough

26 chapters, 26 interactives, few words. This book covers the computational fluid dynamics course of mechanical engineering: the governing equations and how they behave, finite differences from Taylor series, the errors in a numerical answer, iterative solvers and the Thomas algorithm, finite volumes for diffusion in 1-D and 2-D, explicit and implicit time steps, convection-diffusion schemes from central differencing to QUICK, false diffusion, von Neumann stability and the CFL number, stream function and vorticity, the staggered grid and SIMPLE, boundary layers and flow past a cylinder, turbulence and the k-ε model, the grid independence test and fluid-structure coupling. Every solver on the page runs in your browser on the same few test problems, so the numbers in one chapter carry into the next.

  • AUCME368Computational Fluid Dynamics and Heat Transfer
  • VTUBME403Fluid Mechanics (Module 5: introduction to CFD)
  • SPPU402044FComputational Fluid Dynamics
  • MUMEDLO5013Computational Methods
  • KTUPEMET521Computational Fluid Dynamics

By Skill-Lync · Updated 23 Nov 2026 · 26 chapters · 26 interactives · free, no sign-up

Chapter 1

Analytical, experimental and numerical answers to one flow, and the CFD workflow

Which syllabus covers thisAU CME368 Unit I (analytical, experimental and numerical)VTU BME403 Module 5 (introduction to CFD)SPPU 402044F Unit 1 (CFD as a design tool)MU not in syllabusKTU PEMET521 Module 1 (comparison of approaches)

What is CFD, and where is it used?

Computational fluid dynamics solves the equations of fluid flow and heat transfer on a computer. The space is cut into small cells, each differential equation becomes algebra for the values in those cells, and a solver works until every cell balances. Even the one-dimensional flow in the next figure takes 4,592 node updates (112 time steps on 41 nodes). Real cases are 3-D with millions of cells: car bodies and underhood cooling, battery packs, pumps, fans, turbines, combustors, HVAC ducts and aircraft. NPTEL's IIT Kharagpur CFD course lists oil, automobile and aviation companies among the users.

Analytical, experimental or numerical: what does each give you?

Take water above a plate that suddenly starts moving. The exact answer is u/U = erfc(y/(2√(νt))): at 16 s the moving layer has a scale δ = √(νt) = 4 mm. Exact, but only because the plate and the water are infinite. A measurement gives real physics, but only at its 8 probes, each with ±3 % uncertainty (synthetic here). The numerical march on 41 nodes gives every node at every time, with a max error of 0.114 % that you can shrink, and it agrees with all 8 probes within 2σ.

One flow answered three ways: the exact solution, a measurement with its uncertainty and a numerical solution whose error shrinks with the mesh: interactive loads as you scroll

What are the steps of a CFD job?

Geometry: clean the CAD and decide what can be left out. Mesh: cut the fluid into cells, fine where things change fast. Physics: fluid properties, models, boundary and initial conditions. Solve: discretise, iterate, watch residuals and monitor values. Post-process: profiles, forces, heat flow. Verify: is the maths solved right? In the figure, going from 41 to 81 nodes cuts the error from 0.114 % to 0.029 %, four times smaller, so the scheme is second order. Validate: is it the right maths? Compare with measurements.

Where does CFD go wrong?

Mostly in the input, not the solver. In the figure, a 12 mm domain forces u = 0 at 12 mm. At 16 s that is 3δ and the error is 3.4 %. At 100 s the layer is 10 mm thick, the domain is only 1.2δ, the error is 40 % and only 1 of the 8 probes agree. The solver converged perfectly; the setup was wrong. Other usual causes: wrong properties or units, a mesh too coarse where gradients are steep, a turbulence model outside its range, and boundary conditions in the wrong place (chapter 4).

What does a numerical answer cost, and who does this work?

The explicit march has a time-step limit tied to the mesh: Δt ≤ Δy²/(2ν). Halve the spacing and you need 4 times the steps on 2 times the nodes. Going from 41 to 81 nodes raised the work from 4,592 to 36,126 updates, 7.9 times. In 3-D the same refinement multiplies cells by 8. GATE ME tests the numerical methods underneath. Automotive, aerospace and HVAC firms in India hire CFD engineers; the PG Program in CFD trains for those roles.

Predict, then check

You double the nodes of the explicit solver (41 to 81 across the same height) and keep the diffusion number at 0.4. The work, nodes × time steps, grows by about…

Worked examples

Velocity above a plate that suddenly starts moving · Plate in water at 20 °C (ν = μ/ρ = 1.0016 × 10⁻³/998.2 = 1.0034 × 10⁻⁶ m²/s) starts at U = 0.2 m/s; t = 30 s; u/U = erfc(y/(2√(νt)))
  1. δ = √(νt) = √(1.0034 × 10⁻⁶ × 30) = 5.49 mm
  2. At y = 5 mm: y/(2δ) = 5/(2 × 5.49) = 0.456; erfc(0.456) = 0.519
  3. u = 0.2 × 0.519 = 0.1039 m/s
  4. Where u falls to 1 % of U: erfc(y/(2δ)) = 0.01 gives y/(2δ) = 1.8214, so y = 3.643δ = 20 mm

Answer: u ≈ 0.104 m/s at 5 mm; the plate's motion is felt up to about 20 mm after 30 s

Explicit time step and cost for the figure's default · Domain H = 24 mm, 41 nodes, water ν = 1.0034 × 10⁻⁶ m²/s, diffusion number d = νΔt/Δy² ≤ 0.4 (stable limit 0.5), march to t = 16 s
  1. Δy = 24/40 = 0.6 mm
  2. Δt ≤ 0.4 Δy²/ν = 0.4 × (0.6 × 10⁻³)²/1.0034 × 10⁻⁶ = 0.1435 s (the limit d = 0.5 allows 0.1794 s)
  3. Steps = 16/0.1435 = 111.5, rounded up to 112; Δt = 16/112 = 0.1429 s, d = 0.398
  4. Cost = 41 × 112 = 4,592 node updates

Answer: 112 steps of 0.143 s, 4,592 updates; doubling the nodes would need 36,126

Three explicit (FTCS) steps by hand · Nodes 0-4, wall node u₀ = 1 from t = 0, all others 0, top node held at 0, d = 0.4; u_j(new) = u_j + d(u_{j+1} − 2u_j + u_{j−1}); Δy = 0.6 mm, Δt = 0.1435 s (example above)
  1. Step 1: u₁ = 0 + 0.4(0 − 0 + 1) = 0.4; u₂ = u₃ = 0
  2. Step 2: u₁ = 0.4 + 0.4(0 − 0.8 + 1) = 0.48; u₂ = 0 + 0.4(0 − 0 + 0.4) = 0.16
  3. Step 3: u₁ = 0.48 + 0.4(0.16 − 0.96 + 1) = 0.56; u₂ = 0.16 + 0.4(0 − 0.32 + 0.48) = 0.224; u₃ = 0.4 × 0.16 = 0.064
  4. Exact at y = 0.6 mm, t = 3Δt = 0.431 s: erfc(0.6/(2√(νt))) = 0.519

Answer: u₁ = 0.56 after 3 steps, 8 % above the exact 0.519: the sudden start is hard on the first steps, yet by 16 s the error is 0.11 %

Chapter 2

Governing equations: control volumes, the substantial derivative and the general transport equation

Which syllabus covers thisAU CME368 Unit I (governing equations)VTU not in syllabusSPPU 402044F Unit 1 (substantial derivative, divergence, curl)MU not in syllabusKTU PEMET521 Module 1 (general transport equation)

What is a control volume, and what does it conserve?

A control volume is a box fixed in space that the fluid flows through. Three balances hold for it. Mass: what is stored inside changes by what flows in minus what flows out (continuity, ∂ρ/∂t + ∇·(ρV) = 0; for incompressible flow ∇·V = 0). Momentum: the stored momentum plus its net outflow changes by the pressure, viscous and body forces on the box (Newton's second law). Energy: stored energy plus net outflow changes by heat added and work done (first law). A finite-volume solver writes exactly these three balances for each of its 1 million or 100 million cells.

What do divergence and curl mean in a flow?

Divergence ∇·V is the net volume flowing out of a small box per unit volume: zero for any incompressible flow. In the figure's source flow, a 0.6 m box at (0.2, 0.1) m loses 0.698 m²/s per metre depth: 1.94 per second per unit area, against ∇·V = 2.28 /s at its centre; shrink the box and the two meet, at second order. Curl, the vorticity ω = ∂v/∂x − ∂u/∂y, is the circulation round the box per unit area: for a solid-body rotation at Ω = 1 rad/s it is 2Ω = 2 /s for any box size.

A control volume in a flow field: fluxes through each face, net outflow, divergence and the substantial derivative: interactive loads as you scroll

What is the substantial (material) derivative?

It is the rate of change you feel riding with a fluid particle: DT/Dt = ∂T/∂t + V·∇T. The first term is the change at a fixed point (local), the second is the change from moving through a non-uniform field (convective). In the figure, the temperature field T = 20 + 10x + 5y °C never changes, so ∂T/∂t = 0. Yet a particle in the shear layer at (0.2, 0.1) m moves at u = 0.197 m/s up a 10 K/m gradient and warms at 1.97 K/s. Newton's law applies to the particle, which is why D/Dt appears in the momentum equation.

Conservative or non-conservative form: why does a solver care?

The conservative form keeps the flux inside the derivative, ∇·(ρVφ); the non-conservative form expands it to ρV·∇φ + φ∇·(ρV) and drops the last term using continuity. They are equal on paper. On a mesh they are not: only the flux form makes the flux leaving one cell exactly the flux entering its neighbour, so summing 100 cell balances leaves only inflow minus outflow, to round-off (about 10⁻¹⁶ relative). That is why finite-volume codes use the conservative form, and why shocks, which have no smooth derivative, need it.

What is the general transport equation?

Every conservation law has the same four terms: storage, convection, diffusion and source. For mass φ = 1, Γ = 0, S = 0. For x-momentum φ = u, Γ = μ and S holds −∂p/∂x plus body forces: that is Navier-Stokes, ρ DV/Dt = −∇p + μ∇²V + ρg (inertia = pressure + viscous + body force, for constant μ and incompressible flow). For energy φ = T, Γ = k/cp, S = heat sources. Write one solver for this equation and it solves them all; the book's DUCT is its steady 1-D form with ρ = 1 kg/m³ and Γ = 0.05 kg/(m·s).

Predict, then check

Water flows steadily round a heated pipe bend, and the temperature at every fixed point never changes. The temperature of one fluid particle…

Worked examples

Divergence and vorticity of a velocity field · u = 2x + 3y, v = 4x − y (m/s, x and y in m), air at 20 °C (ρ = 1.204 kg/m³)
  1. ∇·V = ∂u/∂x + ∂v/∂y = 2 + (−1) = 1 /s
  2. ω = ∂v/∂x − ∂u/∂y = 4 − 3 = 1 /s, so fluid elements spin at ω/2 = 0.5 rad/s
  3. Continuity in non-conservative form: Dρ/Dt = −ρ∇·V = −1.204 × 1 = −1.204 kg/(m³·s)

Answer: ∇·V = 1 /s (not incompressible: each particle's density falls at 1.204 kg/m³ per second at this instant), ω = 1 /s

Net outflow from a square control volume · u = 4x (m/s, x in m), v = 0; square control volume of side 0.1 m centred at x = 0.3 m, unit depth
  1. East face x = 0.35 m: u = 1.4 m/s, outflow = 1.4 × 0.1 = 0.14 m²/s
  2. West face x = 0.25 m: u = 1.0 m/s, inflow = 1.0 × 0.1 = 0.1 m²/s
  3. North and south faces: v = 0, no flux
  4. Net outflow = 0.14 − 0.1 = 0.04 m²/s; per unit area 0.04/0.01 = 4 /s

Answer: 0.04 m²/s net outflow per metre depth; divided by the area it equals ∇·V = ∂u/∂x = 4 /s exactly, because u is linear

Temperature change seen by a moving particle · T = 300 + 50x − 20y K (x, y in m), also heating at 0.2 K/s at every fixed point; particle velocity V = (1.5, 0.8) m/s
  1. Local term ∂T/∂t = 0.2 K/s
  2. Convective term u ∂T/∂x + v ∂T/∂y = 1.5 × 50 + 0.8 × (−20) = 75 − 16 = 59 K/s
  3. DT/Dt = 0.2 + 59 = 59.2 K/s

Answer: The particle warms at 59.2 K/s, almost all of it from moving through the gradient

Chapter 3

Elliptic, parabolic and hyperbolic equations: characteristics and where information travels

Which syllabus covers thisAU CME368 Unit I (elliptic, parabolic, hyperbolic)VTU not in syllabusSPPU 402044F Unit 1 (mathematical behaviour)MU not in syllabusKTU PEMET521 Module 1 (classification of PDEs)

Why classify a PDE before solving it?

The type decides which boundary conditions make sense and whether you can march. A parabolic or hyperbolic problem can be marched: solve one line, step forward, never look back, like a boundary layer swept down a plate in one pass (chapter 20). An elliptic problem couples every point to every other, so the whole field must be solved together and iterated: the book's 20 × 20 heated plate takes 934 Gauss-Seidel sweeps to converge to 10⁻¹⁰ (99 with SOR, chapter 7). Pick a method that ignores the type and it either fails or wastes time.

How do you tell elliptic, parabolic and hyperbolic apart?

For A φxx + B φxy + C φyy + (lower-order terms) = 0, look at B² − 4AC, the same test that names conic sections. Negative: elliptic, like Laplace's equation for steady conduction (−4) or subsonic flow at M = 0.5 (−3). Zero: parabolic, like transient conduction φt = αφxx. Positive: hyperbolic, like the wave equation (+4) or steady supersonic flow at M = 2, where β²φxx − φyy = 0 with β² = M² − 1 = 3 gives +12. With variable coefficients the type can change from point to point.

Classify a second-order PDE as elliptic, parabolic or hyperbolic, draw its characteristics and see how far a disturbance reaches: interactive loads as you scroll

What is a characteristic?

A characteristic is a direction along which information travels and across which the solution's derivatives may jump. Its slopes solve A(dy)² − B dx dy + C(dx)² = 0. Hyperbolic equations have two real families, parabolic one, elliptic none. For M = 2 the slopes are ±0.577: the Mach lines at μ = arcsin(1/M) = 30°. A small bump in supersonic flow is felt only between them, downstream; at M = 5 the wedge narrows to 11.5°. The conic of an equation has asymptotes perpendicular to its characteristics.

What makes a problem well-posed?

Hadamard (1902): a solution exists, it is unique, and it changes only a little when the data change a little. Each type needs its own data. Elliptic: one condition on every point of a closed boundary. Parabolic: an initial state plus side conditions, but nothing at the final time. Hyperbolic: initial data on a non-characteristic line. March Laplace's equation from a starting line instead and it blows up: φ = 0 with a starting slope ∂φ/∂x = sin(10y)/10, size 0.1, grows to 110 by x = 1, and with sin(20y)/20 to 606,456.

Which type are the Navier-Stokes equations?

Mixed, and that shapes CFD solvers. Unsteady flow is parabolic in time: march time steps. Steady subsonic flow is elliptic: pressure links every point, so the whole field is iterated (chapters 18-19). Steady inviscid supersonic flow is hyperbolic: it can be marched downstream inside Mach wedges, 30° at M = 2. The thin-layer boundary-layer equations are parabolic in x and are marched along the plate (chapter 20). Transonic flow mixes elliptic and hyperbolic zones in one field, like the Tricomi equation y φxx + φyy = 0.

Predict, then check

Steady supersonic flow at Mach 2 passes a small bump on a flat wall. The pressure change from the bump is felt…

Worked examples

Classify an equation and find its characteristics · φxx + 4φxy + 3φyy = 0 (A = 1, B = 4, C = 3)
  1. B² − 4AC = 16 − 12 = 4 > 0: hyperbolic
  2. Characteristic slopes dy/dx = (B ± √(B² − 4AC))/(2A) = (4 ± 2)/2 = 3 and 1
  3. Check in A m² − B m + C = 0: 9 − 12 + 3 = 0 and 1 − 4 + 3 = 0
  4. Characteristic lines: y − 3x = constant and y − x = constant

Answer: Hyperbolic, with two families of straight characteristics of slopes 3 and 1

An equation that changes type (Tricomi) · y φxx + φyy = 0, so A = y, B = 0, C = 1; points at y = 0.5 and y = −0.5
  1. B² − 4AC = −4y: at y = 0.5 it is −2: elliptic
  2. At y = −0.5 it is +2: hyperbolic
  3. Slopes at y = −0.5: dy/dx = ±√2/(2 × (−0.5)) = ∓1.414
  4. On y = 0 it is parabolic: the line where the type switches

Answer: Elliptic above the x-axis, hyperbolic below, like subsonic and supersonic zones in transonic flow

How far downstream does a disturbance reach the opposite wall? · Steady supersonic flow in a channel 0.4 m high; a small step on the floor; M = 1.5, then M = 3
  1. M = 1.5: β = √(M² − 1) = 1.118; μ = arcsin(1/1.5) = 41.81° (= arctan(1/β))
  2. The Mach line reaches the roof at x = 0.4/tan μ = 0.447 m downstream
  3. M = 3: μ = arcsin(1/3) = 19.47°, x = 0.4/tan μ = 1.131 m

Answer: 0.45 m at M = 1.5 and 1.13 m at M = 3; the roof upstream of that never feels the step

Chapter 4

Boundary and initial conditions: inlets, outlets, walls, symmetry and an outlet placed too close

Which syllabus covers thisAU CME368 Unit I (boundary conditions and types)VTU not in syllabusSPPU 402044F Unit 1 (boundary conditions)MU not in syllabusKTU PEMET521 Module 2 (boundary and initial conditions)

Which boundary conditions does a CFD case use?

Inlet: a velocity or mass flow, plus temperature and turbulence values; or a total pressure. Outlet: a static pressure, or zero gradient (the flow carries everything out unchanged). Wall: no-slip (fluid moves with the wall) plus a thermal choice: fixed temperature, heat flux or a convective coefficient. Symmetry: no flow through the plane and no gradient across it. Periodic: what leaves one face enters its twin. Far field: free-stream values far away. One published Re 100 cylinder study placed the uniform inlet 10 diameters upstream, a zero-gradient outlet 30 downstream and slip walls 15 above and below.

Dirichlet, Neumann and Robin: what is the difference?

Dirichlet (first kind) fixes the value: a wall at 80 °C, φ = 1 at an inlet. Neumann (second kind) fixes the normal gradient, that is the flux: an insulated wall has zero. Robin (third kind) fixes a mix of the two: a convective wall, −k ∂T/∂n = h(T − T∞), or a flux inlet where convective plus diffusive flux equals ρu·φin. On the DUCT at Pe = 0.8 a flux inlet gives φ(0) = 0.551, not 1: diffusion leaks φ back upstream. The Heat and Mass Transfer book's boundary-condition interactive shows all three kinds on a slab.

How many conditions does each kind of equation need?

Elliptic: one condition at every boundary point, outlets included, because every point feels every boundary. Parabolic: an initial state and one condition on each side, never one at the final time. Hyperbolic: as many conditions at a boundary as characteristics entering through it; the wave equation needs an initial value and an initial rate. The DUCT is second order, so it needs two conditions, inlet and outlet. Drop diffusion (pure convection, first order) and only the inlet value is allowed: at high Péclet number the outlet condition hardly matters, if it is in the right place.

Why put the outlet far downstream?

Cut the DUCT (2 m, Pe = 40u) at 1.4 m with u = 0.5 m/s (Pe 20). There, the true φ is 0.9975. Fixing φ = 0 at the cut forces a false layer Γ/(ρu) = 100 mm thick and a 89 % error. A zero-gradient outlet gives 0.22 %, and at u = 5 m/s the error vanishes. But at u = 0.02 m/s (Pe 0.8) it is 61 %: the true profile is not flat there. Put outlets where the flow has stopped changing in the flow direction, and test by moving them.

Boundary conditions: a fixed-value against a zero-gradient outlet placed too close to the action, and what each does to the solution: interactive loads as you scroll

What are initial conditions, and when do they matter?

A transient problem needs the whole field at t = 0, plus the boundary conditions for all later times. In chapter 1's moving plate the water starts at rest and the wall jumps to U, so the first three explicit steps are 8 % off at the first node; by 16 s that start-up error has faded to 0.11 %. A steady solver also needs a starting field, but only as an initial guess: a better guess saves iterations, the converged answer is the same. Starting a cavity at rest or a pipe at its bulk velocity is a guess, not physics.

Predict, then check

The DUCT runs at u = 0.5 m/s (Pe 20). You end the domain at 1.4 m of the 2 m and give it a zero-gradient outlet. The largest error in φ on your domain is about…

Worked examples

A fixed-value outlet placed too early · The DUCT (L = 2 m, ρ = 1 kg/m³, Γ = 0.05 kg/(m·s), φ = 1 in, 0 at the real outlet) at u = 2 m/s; the domain is cut at x = 1.5 m
  1. Pe = ρuL/Γ = 1 × 2 × 2/0.05 = 80; layer scale Γ/(ρu) = 0.05/2 = 25 mm
  2. True φ at 1.5 m: 1 − (e^(Pe x/L) − 1)/(e^Pe − 1) = 1 − (e^60 − 1)/(e^80 − 1) ≈ 1 − e^(−20) = 1 − 2.06 × 10⁻⁹
  3. Fixed φ = 0 at 1.5 m: wrong by almost 1, squeezed into a layer about 25 mm thick
  4. Zero gradient at 1.5 m: the computed φ = 1 everywhere, wrong by 2.1 × 10⁻⁹

Answer: The fixed outlet makes an error of almost 100 % in a layer about 25 mm thick at the cut; the zero-gradient outlet is right to 2 parts in 10⁹

Flux (Robin) inlet against a fixed inlet at low Péclet number · The DUCT at u = 0.02 m/s; flux inlet ρuφ − Γ dφ/dx = ρu × 1 at x = 0, φ = 0 at x = 2 m; solution φ = 1 − e^(Pe(x/L − 1))
  1. Pe = 0.02 × 2/0.05 = 0.8
  2. Flux inlet: φ(0) = 1 − e^(−0.8) = 0.5507
  3. Fixed inlet φ(0) = 1: slope dφ/dx(0) = −(Pe/L)/(e^Pe − 1) = −0.3264 /m
  4. Total flux in with the fixed inlet: ρu × 1 − Γ dφ/dx = 0.02 + 0.05 × 0.3264 = 0.03632, which is 82 % more than the 0.02 the incoming flow carries

Answer: φ(0) = 0.551 with the flux inlet; a fixed inlet over-feeds the duct by 82 % at this Péclet number, and the difference vanishes as Pe grows

An insulated end by a ghost node · 1-D steady conduction −k d²T/dx² = q in a rod (original numbers): k = 20 W/(m·K), q = 2 × 10⁶ W/m³, nodes 5 mm apart, end node N insulated, T at the node before it = 150 °C
  1. Insulated: dT/dx = 0 at node N; central difference (T_{N+1} − T_{N−1})/(2Δx) = 0, so the ghost node T_{N+1} = T_{N−1}
  2. Node N equation: k(T_{N−1} − 2T_N + T_{N+1})/Δx² + q = 0 → 2k(T_{N−1} − T_N)/Δx² + q = 0
  3. T_N = T_{N−1} + qΔx²/(2k) = 150 + 2 × 10⁶ × 0.005²/(2 × 20) = 151.25 °C

Answer: T_N = 151.25 °C: the insulated end is the hottest node, and the Neumann condition became one algebraic equation

Chapter 5

Finite differences from Taylor series: order of accuracy, truncation, round-off and the optimum step

Which syllabus covers thisAU CME368 Unit II (first and second order, optimum step size)VTU not in syllabusSPPU 402044F Unit 1 (FDM)MU MEDLO5013 Module 1 (truncation and round-off errors)KTU PEMET521 Module 2 (Taylor series, polynomial fitting)

How does a Taylor series turn a derivative into arithmetic?

Write the function at the next grid point as a Taylor series: f(x + h) = f + h f′ + (h²/2) f″ + (h³/6) f‴ + … Solve for f′ and you get the forward difference (f(x + h) − f(x))/h plus a leftover h f″/2 + … The leftover is the truncation error: the terms you threw away. Subtract the series for f(x − h) from the one for f(x + h) and the f″ terms cancel: the central difference (f(x + h) − f(x − h))/(2h) has a leftover of only h² f‴/6. For sin x at x = 1 with h = 0.01, forward is off by 4.2e-3 and central by 9.0e-6.

What does 'order of accuracy' mean, and how do you measure it?

Order p means the error falls like hᵖ. Forward and backward differences are first order: halve h and the error halves. Central is second order: halve h and the error drops four times. You measure it, not trust it: compute the error at h and h/2, then p = log₂(e(h)/e(h/2)). For sin x at x = 1 and h = 0.01 that gives 1.00 for forward and 2.00 for central. On a log-log plot of error against h, the slope IS the order. Where f″ happens to be zero, forward looks second order: a lucky point, not a better formula.

Forward, backward and central differences against the step size: order of accuracy, round-off and the optimum step: interactive loads as you scroll

How is the second derivative approximated?

Add the two Taylor series instead of subtracting them: the odd terms cancel and f″ ≈ (f(x + h) − 2f(x) + f(x − h))/h², with error h² f⁗/12, second order. This three-point formula is the heart of every diffusion term in CFD. For sin x at x = 1 with h = 0.01 the error is 7.0e-6, against the leading-term estimate 7.0e-6. On a non-uniform grid the simple formulas lose an order: with spacings 0.10 and 0.12, the 'central' slope of sin x at x = 1 is off by 9.5e-3, against 9.0e-4 on a uniform 0.1 grid. Stretch grids gently.

What is the polynomial-fitting way to derive the same formulas?

Fit a polynomial through the stencil points and differentiate the polynomial. A straight line through x0 and x0 + h has slope (f(x0 + h) − f(x0))/h: forward difference. A parabola p = a + b s + c s² through x0 − h, x0, x0 + h has p′(x0) = b = the central difference and p″(x0) = 2c = the central second difference. Solve the 3 × 3 system for sin x at x = 1 with h = 0.1 and b = 0.5394023, exactly the central value. More points give higher-order formulas; the site's finite-difference coefficients calculator builds them for any stencil.

Why does the error grow again when h gets very small, and what is the optimum step?

A computer stores about 16 significant digits (float64, ε = 2⁻⁵² ≈ 2.2e-16). When h is tiny, f(x + h) and f(x) agree in almost every digit and the subtraction keeps only the noise; dividing by h then magnifies it like 1/h. Truncation falls with h, round-off rises: the total is a V. For forward differences of sin x at x = 1 the model optimum is h ≈ 3.8e-8 with error about 3.2e-8; central gives h ≈ 1.2e-5, error 3.9e-11. In single precision the best h is far larger.

Predict, then check

Forward difference of sin x at x = 1 in double precision. You shrink h from 1e-5 to 1e-12. The error…

Worked examples

Forward, backward and central slopes of 1/x, and their order · f(x) = 1/x at x = 2 (exact f′ = −0.25); steps h = 0.1 and h = 0.05
  1. h = 0.1: forward (1/2.1 − 1/2)/0.1 = −0.2381; backward (1/2 − 1/1.9)/0.1 = −0.26316; central (1/2.1 − 1/1.9)/0.2 = −0.25063
  2. Errors at h = 0.1: forward 0.0119, backward −0.01316, central −0.000627
  3. h = 0.05: forward −0.243902, central −0.250156; errors 0.0061 and −0.000156
  4. Error ratios when h halves: forward 1.95 (first order), central 4.01 (second order)
  5. Check: central leading term h² f‴/6 with f‴ = −6/x⁴ = −0.375 gives −0.000625 at h = 0.1

Answer: Central is about 19 times more accurate at h = 0.1, and its error quarters when h halves

Heat flux from three thermocouples in a steel wall · Thermocouples 5 mm apart read 80.0, 74.6 and 70.1 °C (original readings); k = 45 W/(m·K)
  1. Central slope at the middle one: (70.1 − 80.0)/(2 × 0.005) = −990 K/m
  2. Heat flux q = −k dT/dy = 45 × 990 = 44,550 W/m²
  3. Curvature: (80.0 − 2 × 74.6 + 70.1)/0.005² = 36,000 K/m², so the profile is not straight
  4. Slope at the FIRST thermocouple: forward (74.6 − 80.0)/0.005 = −1080 K/m; second-order one-sided (−3 × 80.0 + 4 × 74.6 − 70.1)/0.010 = −1170 K/m
  5. The first-order formula is 7.7 % low: the curvature you just computed is its error

Answer: About 44,550 W/m² at the middle sensor; at the first sensor use the second-order one-sided formula (52.7 kW/m²)

Optimum step for a central difference in double and single precision · f = eˣ at x = 1; round-off per value δ ≈ ε(|f| + |x f′|) = 2eε; central error E = h² f‴/6 + δ/h; ε = 2⁻⁵² (float64), 2⁻²³ (float32)
  1. dE/dh = h e/3 − 2eε/h² = 0 gives h* = (6ε)^(1/3)
  2. float64: h* = (6 × 2.22e-16)^(1/3) = 1.1e-5, best error 1.6e-10
  3. float32: h* = (6 × 1.19e-7)^(1/3) = 8.9e-3, best error 1.1e-4
  4. A GPU solver in single precision cannot resolve gradients as finely as a double-precision one: its best derivative has only about 4 correct digits

Answer: h ≈ 1.1e-5 in float64 (about 10 correct digits) but ≈ 8.9e-3 in float32 (about 4)

Chapter 6

Errors in a CFD answer: discretisation, iteration and round-off; consistency, stability and convergence

Which syllabus covers thisAU CME368 Unit I (numerical errors)VTU not in syllabusSPPU 402044F Unit 1 (discretization methods)MU MEDLO5013 Module 1 (error analysis, error propagation)KTU PEMET521 Module 2 (errors, consistency, stability)

What kinds of error are in a CFD answer?

Five. Modelling error: the equations are not the real physics (a turbulence model, a rigid wall, constant properties). Discretisation error: the algebraic equations on a finite mesh are not the differential equations. Iteration (convergence) error: the solver stopped before the algebraic equations were solved. Round-off: every number has finite digits. User and input error: wrong boundary condition, wrong units, wrong geometry. Only the middle three are numerical, and each can be measured separately, as the interactive does on a problem whose exact answer is known. The first and last are usually the biggest in industry.

How big is each numerical error on a real case?

Take −φ″ = π² sin πx on 32 finite volumes, exact answer sin πx. The discretisation error is 8.0e-4 and falls four times per halving of the cells (2.0e-4 on 64): second order. Gauss-Seidel stopped at a residual of 1e-3 leaves an iteration error of 9.9e-4, bigger than the discretisation error; at 1e-6 it is 9.9e-7. Round-off in double precision is 4.2e-15: negligible. In single precision the solver stalls at a residual of 1.1e-5 and round-off is 4.7e-6, growing to 1.2e-5 on 64 cells.

Split the error of a CFD answer into discretisation, iteration and round-off error, and watch each one move: interactive loads as you scroll

Why is a converged residual not an accurate answer?

The residual measures how well the current numbers satisfy the discrete equations, not how close they are to the true solution. When the residual has fallen 6 orders, the iteration error is tiny, but the discretisation error is exactly what it was: 8.0e-4 on 32 cells, a thousand times the 1e-6 residual. A smooth, converged, wrong answer is common. Residuals also hide how far the solution still has to move: Gauss-Seidel's slowest mode leaves the iteration error spread over the whole domain. Monitor the quantity you care about (drag, pressure drop, outlet temperature) as well as the residuals.

What are consistency, stability and convergence, and how are they linked?

Consistency: the truncation error goes to zero as the mesh and time step shrink, so the discrete equations become the PDE. Stability: errors (round-off included) do not grow without bound as the scheme marches. Convergence: the discrete solution approaches the exact one as the mesh is refined. The Lax equivalence theorem (Lax and Richtmyer, 1956) ties them: for a consistent scheme on a well-posed linear initial value problem, stability is necessary and sufficient for convergence. So you prove consistency with Taylor series and stability with a von Neumann analysis (chapter 16), and convergence follows.

When does single precision hurt?

Single precision (float32) keeps about 7 digits (ε = 2⁻²³ ≈ 1.2e-7), double precision about 16. Iterative solvers on fine grids lose digits because their slowest corrections are tiny: on 32 cells float32 Gauss-Seidel cannot get its residual below 1.1e-5, and the answer carries a round-off error of 4.7e-6. Refining to 64 cells raises that to 1.2e-5 while the discretisation error falls to 2.0e-4: past some mesh size, refining in single precision makes the answer worse. Commercial codes offer both; use double for fine meshes, stretched cells and small differences of large numbers.

Predict, then check

Your solver's residual has fallen 6 orders of magnitude on a 32-cell mesh. Is the answer now within about 1e-6 of the exact solution?

Worked examples

Discretisation error and its order on a known solution · −φ″ = π² sin πx on [0, 1], φ(0) = φ(1) = 0 (exact φ = sin πx), three-point central differences on nodes spaced h = 0.1 and h = 0.05
  1. Try φᵢ = A sin(πxᵢ) in (−φᵢ₋₁ + 2φᵢ − φᵢ₊₁)/h² = π² sin πxᵢ: it fits, with A = (πh/2)²/sin²(πh/2)
  2. h = 0.1: A = (0.15708)²/sin²(0.15708) = 1.008265, so the peak error is 0.827 %
  3. h = 0.05: A = 1.002059, peak error 0.2059 %
  4. Ratio 4.015 ≈ 2²: second order. Leading term π²h²/12 = 0.822 % at h = 0.1

Answer: The error is 0.83 % at h = 0.1 and quarters to 0.206 % when h halves

Stopping the iterations too early · The same problem on 32 finite volumes solved by Gauss-Seidel from φ = 0; discretisation error 8.0e-4 (converged discrete vs exact)
  1. Stop at a residual of 1e-3: 717 sweeps, iteration error 9.9e-4
  2. Total error then only 1.9e-4: by luck, the unfinished solution (still too low) cancels part of the discretisation error (too high)
  3. Stop at 1e-6: 1433 sweeps (twice the work), iteration error 9.9e-7
  4. Total error now 8.0e-4: only the discretisation error is left, and a mesh refinement can now measure it

Answer: At 1e-3 the answer looks better than it is: an iteration error of 9.9e-4 hides behind cancellation. Converge to 1e-6 (1433 sweeps instead of 717) so that what remains is the discretisation error alone

How round-off seeds an unstable scheme · An explicit (FTCS) diffusion scheme run at diffusion number d = 0.6, above the d ≤ ½ limit of chapter 12; the sawtooth mode is amplified by |1 − 4d| per step; round-off puts about 1e-16 into that mode
  1. Growth per step |1 − 4 × 0.6| = 1.4
  2. Steps to grow 1e-16 to order 1: ln(1e16)/ln(1.4) = 109.5
  3. At d = 0.5 the factor is |1 − 2| = 1: no growth, the scheme is stable

Answer: After about 110 time steps the round-off has grown into a sawtooth as large as the solution itself

Chapter 7

Iterative solvers: Jacobi, Gauss-Seidel, SOR and line-by-line, and when to stop

Which syllabus covers thisAU CME368 Unit II (accuracy of solution)VTU not in syllabusSPPU 402044F Unit 2 (implicit solution)MU MEDLO5013 Module 2 (iterative and relaxation methods)KTU PEMET521 Module 2-3 (iterative convergence, line-by-line)

Why does CFD solve its equations by iteration instead of directly?

A mesh of a million cells gives a million equations, each linking a cell to its 4-6 neighbours: a sparse matrix. Gaussian elimination fills that sparsity in, needing far too much memory and time (chapter 8 counts it). The equations are also nonlinear (chapter 9), so they are re-linearised many times and an exact solve of each linear version is wasted. Iterative methods sweep the mesh, updating each unknown from its neighbours, using only the stored coefficients. Their cost per sweep grows like the cell count, and they can stop as soon as the answer is good enough.

How do Jacobi and Gauss-Seidel differ?

Both solve each node's equation for that node: on the plate, T_P = (T_E + T_W + T_N + T_S)/4. Jacobi uses only old values from the previous sweep; Gauss-Seidel uses each new value as soon as it is computed. On THE PLATE with a 20 × 20 grid, to drop the residual 6 orders Jacobi needs 799 sweeps and Gauss-Seidel 406: about half. Their convergence factors per sweep are cos(π/n) = 0.9877 and its square 0.9755, measured on the page from the residual history. The Heat and Mass Transfer book's finite-difference interactive shows Gauss-Seidel on a slab.

Jacobi, Gauss-Seidel, SOR and line-by-line on the heated plate: residual history, spectral radius and the optimum relaxation factor: interactive loads as you scroll

What does over-relaxation do, and what is the best factor?

SOR takes the Gauss-Seidel change and multiplies it by ω > 1, guessing that the solution will keep moving the same way. For the model Laplace problem the best factor is ω_opt = 2/(1 + sin(π/n)): 1.729 on a 20 × 20 grid. There SOR needs 54 sweeps against Gauss-Seidel's 406; at ω = 1.99 it needs 1393. On 40 × 40, Gauss-Seidel needs 1390 and SOR 102: Gauss-Seidel sweeps grow like n², SOR's like n. Real CFD matrices are not the model problem, so solvers pick ω by experience.

What is line-by-line iteration, and what is multigrid?

Line-by-line solves a whole grid line at once: the unknowns along a row form a tridiagonal system, solved exactly by the TDMA (chapter 8) with the neighbouring rows held at their latest values; then the columns. Boundary information crosses a whole line in one go. On the 20 × 20 plate it needs 104 sweeps against 406 for Gauss-Seidel, but each sweep costs about 18 operations per node against 4, so the work is similar here: 0.68 against 0.59 million operations. Multigrid instead smooths on a hierarchy of coarser grids, so the slow long-wave errors die fast; its cost grows only like the cell count.

When does an iteration converge, and when do you stop it?

Diagonal dominance (the Scarborough criterion): Σ|a_nb|/|a_P| ≤ 1 at every node and < 1 at least at one. Central differencing of the DUCT at u = 1 m/s on 6 cells gives 3.33: Gauss-Seidel may diverge; upwind gives exactly 1. Stop on residuals normalised by their start value, typically 3-6 orders down (the OpenFOAM 9 pitzDaily tutorial stops at 1e-2 for pressure and 1e-3 for velocity), AND when the monitored quantity no longer changes. A 1e-3 residual on a fine mesh can still leave a sizeable iteration error (chapter 6).

Predict, then check

On the 20 × 20 heated plate, which SOR factor ω needs the fewest sweeps to drop the residual 6 orders?

Worked examples

Jacobi and Gauss-Seidel by hand on a coarse plate · THE PLATE on a 3 × 3 grid: four interior nodes, (1,1) and (2,1) on the bottom row, (1,2) and (2,2) on the top row; top edge 100 °C, other edges 0 °C; start from 0; T_P = (T_E + T_W + T_N + T_S)/4; Gauss-Seidel order: bottom row left to right, then top row
  1. Jacobi sweep 1: top nodes (100 + 0 + 0 + 0)/4 = 25, bottom nodes 0
  2. Jacobi sweep 2: top (100 + 25 + 0)/4 = 31.25, bottom (25 + 0 + 0)/4 = 6.25
  3. Gauss-Seidel sweep 1: bottom 0, 0; top-left 25, top-right (100 + 25)/4 = 31.25
  4. Gauss-Seidel sweep 2: bottom-left (25 + 0)/4 = 6.25, bottom-right (6.25 + 31.25)/4 = 9.375, top-left = 34.375, top-right = 35.9375
  5. Exact (by symmetry 3a − b = 100, 3b = a): top 37.5, bottom 12.5

Answer: After two sweeps the average error is 6.25 °C for Jacobi and 3.52 °C for Gauss-Seidel, which uses each new value at once

How many sweeps on a 50 × 50 grid? · Model Laplace problem, n = 50 intervals; residual to fall 6 orders; asymptotic convergence factors cos(π/n), cos²(π/n) and ω_opt − 1
  1. Jacobi: ρ = cos(π/50) = 0.99803; sweeps ≈ ln(1e-6)/ln ρ = 6,994
  2. Gauss-Seidel: ρ = 0.99606; sweeps ≈ 3,497
  3. SOR: ω_opt = 2/(1 + sin(π/50)) = 1.8818, ρ = ω_opt − 1 = 0.8818; sweeps ≈ 110
  4. These are asymptotic estimates: the first sweeps usually go faster than the factor suggests

Answer: About 6,994 Jacobi, 3,497 Gauss-Seidel and only about 110 SOR sweeps

Will Gauss-Seidel converge on these coefficients? · THE DUCT (Γ = 0.05 kg/(m·s), L = 2 m) on 6 cells, u = 1 m/s, ρ = 1 kg/m³: D = Γ/Δx, F = ρu
  1. D = 0.05/(2/6) = 0.15 kg/(m²·s), F = 1, cell Péclet F/D = 6.67
  2. Central: aW = D + F/2 = 0.65, aE = D − F/2 = −0.35, aP = aW + aE = 0.3
  3. Scarborough: (|aW| + |aE|)/|aP| = 3.33 > 1: not diagonally dominant
  4. Upwind: aW = D + F = 1.15, aE = D = 0.15, aP = 1.3: ratio exactly 1, and below 1 in the boundary cells

Answer: Central differencing fails the criterion (a negative coefficient), upwind satisfies it: Gauss-Seidel is guaranteed to converge only for upwind

Chapter 8

The tridiagonal matrix algorithm (Thomas algorithm) step by step

Which syllabus covers thisAU CME368 Unit IIVTU not in syllabusSPPU 402044F Unit 2 (implicit solution)MU MEDLO5013 Module 2 (Gauss elimination, LU)KTU PEMET521 Module 3 (tri-diagonal matrix algorithm)

Where do tridiagonal systems come from?

Any 1-D problem discretised with three-point stencils: each node's equation a_P φ_P = a_W φ_W + a_E φ_E + b links it to its west and east neighbours only, so the matrix has numbers on the diagonal and the two diagonals next to it, and zeros everywhere else. 1-D conduction, the DUCT's convection-diffusion, an implicit time step of a 1-D transient, the boundary-layer equations marched across a layer (chapter 20), and every grid line of a line-by-line or ADI sweep in 2-D and 3-D all give one. Six unknowns need only 4 × 6 stored numbers, not 36.

How does the Thomas algorithm work?

It is Gaussian elimination that knows where the zeros are. Forward: the first equation gives φ₁ = P₁φ₂ + Q₁. Substitute into the second and it becomes φ₂ = P₂φ₃ + Q₂, and so on to the last node, which has no east neighbour, so φₙ = Qₙ. Back: φₙ₋₁ = Pₙ₋₁φₙ + Qₙ₋₁, up to φ₁. On the book's heated rod (6 cells, ends 100 and 20 °C) the forward sweep gives P₁ = 0.3333, Q₁ = 68, … Q₆ = 32.667, and the back sweep returns 99.33 °C at the first node.

The Thomas algorithm step by step: forward elimination, the P and Q coefficients and back substitution: interactive loads as you scroll

How much cheaper is it than Gaussian elimination?

The Thomas algorithm does 8n − 6 operations: about 8 per unknown. Dense Gaussian elimination does about 2n³/3. For a million unknowns that is 8 million against 6.7e17 operations: at an assumed 10⁹ operations per second, 8 milliseconds against 21 years. Memory: six arrays of a million numbers, 48 MB, against 8 TB for the full matrix. That is why 1-D solves, and line-by-line sweeps built from them, are nearly free.

When is the TDMA safe, and what if it is not?

If the matrix is diagonally dominant (|a_P| ≥ |a_W| + |a_E| in every row), every P lies between 0 and 1 in size, the denominators never get near zero, and round-off cannot grow: no pivoting is needed. Finite-volume coefficients from Patankar's rules (positive neighbours, a_P = Σa_nb − S_P) are always dominant. Central differencing of the DUCT at u = 1 m/s on 6 cells is not (a_E = −0.35, the last a_P is −0.05): the algorithm still returns the discrete answer here, but the answer itself wiggles between −0.26 and 3.4. The trouble is the scheme, not the solver.

How is the TDMA used beyond 1-D?

Line-by-line: in 2-D, freeze the neighbouring rows, solve each row as a tridiagonal system, then each column (chapter 7). ADI (alternating direction implicit): for 2-D transient problems, split each time step into a half step implicit in x and a half step implicit in y, each a set of tridiagonal solves. Periodic problems (a ring, a periodic channel) link the last node back to the first: the cyclic TDMA handles the two extra corner terms with one more pass. Block-tridiagonal versions solve coupled variables such as velocity and pressure along a line.

Predict, then check

You double the number of unknowns in a 1-D problem. The Thomas algorithm's work…

Worked examples

The heated rod by hand · Rod 60 mm long, 6 cells of 10 mm, k = 50 W/(m·K), A = 1 cm², generation q = 2 MW/m³ (assumed, an electrically heated element), ends at 100 °C and 20 °C; boundary cells link to the end temperature over half a cell (2kA/Δx)
  1. kA/Δx = 50 × 1e-4/0.01 = 0.5 W/K; source per cell qAΔx = 2 W
  2. Interior: aW = aE = 0.5, aP = 1, b = 2. Cell 1: aP = 0.5 + 1 = 1.5, b = 2 + 1 × 100 = 102. Cell 6: aP = 1.5, b = 2 + 1 × 20 = 22
  3. Forward: P₁ = 0.5/1.5 = 0.3333, Q₁ = 102/1.5 = 68; P₂ = 0.5/(1 − 0.5 × 0.3333) = 0.6, Q₂ = (2 + 0.5 × 68)/0.8333 = 43.2
  4. Continuing: P = 0.7143, 0.7778, 0.8182, 0; Q = 33.714, 29.333, 27.273, 32.667
  5. Back: T₆ = Q₆ = 32.667, T₅ = 0.8182 × 32.667 + 27.273 = 54, then 71.33, 84.67, 94, 99.33
  6. Check: heat out at the right end 2 × 0.5 × (32.667 − 20) = 12.667 W, at the left −0.667 W (heat flows in there); sum 12 W = the 12 W generated

Answer: T = 99.33, 94, 84.67, 71.33, 54, 32.67 °C; every node is 0.5 °C above the exact parabola (the half-cell boundary flux, qΔx²/(8k))

One fully implicit time step of a cooling slab · A slab at 100 °C has both faces dropped to 0 °C; 4 interior nodes, fully implicit step with diffusion number d = αΔt/Δx² = 1: (1 + 2d)Tᵢ − d Tᵢ₋₁ − d Tᵢ₊₁ = Tᵢ(old)
  1. Coefficients: aP = 3, aW = aE = 1 (zero across the 0 °C faces), b = 100
  2. Forward: P₁ = 1/3, Q₁ = 100/3 = 33.333; P₂ = 1/(3 − 1/3) = 0.375, Q₂ = (100 + 33.33)/2.667 = 50
  3. P₃ = 1/(3 − 0.375) = 0.381, Q₃ = (100 + 50)/2.625 = 57.143; P₄ = 0, Q₄ = (100 + 57.14)/(3 − 0.381) = 60
  4. Back: T₄ = 60, T₃ = 0.381 × 60 + 57.14 = 80, T₂ = 0.375 × 80 + 50 = 80, T₁ = (1/3) × 80 + 33.33 = 60

Answer: After one step: 60, 80, 80, 60 °C, symmetric as it must be

Cost of a million-unknown line · n = 10⁶ unknowns; TDMA 8n − 6 operations; dense Gaussian elimination Σ m(2m + 3) + n² ≈ 2n³/3; an assumed 10⁹ operations per second; 8 bytes per number
  1. TDMA: 8 × 10⁶ − 6 = 7,999,994 operations → 8 ms
  2. Gauss: 6.7e17 operations → 6.7e8 s = 21.1 years
  3. Memory: dense matrix 10¹² × 8 bytes = 8 TB; TDMA's six arrays 6 × 10⁶ × 8 bytes = 48 MB

Answer: 8 ms and 48 MB against 21 years and 8 TB

Chapter 9

Under- and over-relaxation of a nonlinear problem, and why solvers diverge

Which syllabus covers thisAU CME368 Unit V (relaxation factor, stability of solver)VTU not in syllabusSPPU 402044F Unit 4 (SIMPLE iterations)MU MEDLO5013 Module 3 (fixed-point iteration, Newton-Raphson)KTU PEMET521 Module 3 (under and over relaxation)

Why are CFD equations nonlinear, and how are they solved?

Convection carries momentum with the velocity itself (ρu·∇u), so the coefficients depend on the answer. Properties change with temperature, turbulence viscosity depends on k and ε, radiation goes as T⁴. A CFD solver linearises: it freezes the coefficients at the latest values, solves the linear system (chapters 7-8), updates the coefficients and repeats. This repeated substitution (Picard iteration) is the outer loop of every segregated solver; each pass is called an iteration. Newton's method linearises using derivatives too and converges much faster near the answer, at more cost per step (the Finite Element Analysis book has a Newton-Raphson interactive).

What does under-relaxation do?

Instead of jumping to the new solution φ*, move only part of the way: φ_new = φ_old + α(φ* − φ_old) with α < 1. Take this chapter's radiating fin (a 1 mm aluminium plate fin in space, base 400 K, assumed), 150 mm long: with α = 1, Picard needs 52 iterations because each pass over-corrects and the profile swings up and down. With α = 0.725 it needs 14. On a 250 mm fin α = 1 never settles (it oscillates forever) while α = 0.6 converges in 20. Relaxation changes the path, never the converged answer.

A nonlinear problem solved by repeated substitution: under-relaxation, over-relaxation, divergence and the best factor: interactive loads as you scroll

Why is there a best α, and why does too large an α diverge?

Near the answer, one Picard pass multiplies each error pattern by a factor λ. For the fin these are negative (over-correction), down to λ = −0.698 at 150 mm. Relaxation turns λ into 1 − α(1 − λ). The best α balances the worst two patterns: 2/(2 − λmin − λmax) = 0.741, against 0.725 found by brute force on the page. Above 2/(1 − λmin) = 1.18 the worst factor exceeds 1 in size: divergence. So over-relaxation (α > 1) helps only when λ > 0 (slow, one-sided convergence, as in SOR), and hurts here.

What is Patankar's implicit relaxation, and what factors do solvers use?

Patankar puts relaxation into the equation: (a_P/α)φ_P = Σa_nb φ_nb + b + (1 − α)(a_P/α)φ_P,old. At convergence the extra terms cancel, and the larger diagonal makes the system more diagonally dominant, which inner solvers like. It acts like a false time step. Typical factors: classic SIMPLE in the OpenFOAM 2.3 pitzDaily tutorial uses 0.3 for pressure and 0.7 for velocity, k and ε; the newer SIMPLEC version uses 0.9 (chapter 19 explains why). Steady solvers in Fluent and STAR-CCM+ expose the same factors, often as pseudo-time steps or Courant numbers.

What do diverging and oscillating solvers look like, and what do you do?

Divergence: residuals climb by orders of magnitude, values go unphysical (negative temperature, k < 0), the run stops with a floating-point error. On the 250 mm fin, α = 1.3 blows up within 4 iterations. Oscillation: residuals stall at a level and saw-tooth, and monitored values swing between two states; the 250 mm fin at α = 1 sits at a residual of 8.9e-1 forever. Fixes, in order: check mesh and boundary conditions, lower the relaxation factors, start from a better initial field, use a first-order scheme first, then switch to Newton-like coupled solvers.

Predict, then check

Picard iteration on the 250 mm radiating fin oscillates forever at α = 1. What should you try?

Worked examples

A sunlit plate: fixed-point iteration with and without relaxation · A thin plate absorbs 1,500 W/m² and loses heat by convection (h = 10 W/(m²·K)) to air at 300 K and by radiation (ε = 0.9) to 300 K surroundings: T = 300 + (1500 − εσ(T⁴ − 300⁴))/h (original case); start at 300 K
  1. Solution by bisection: T* = 382.31 K
  2. α = 1: T = 450, 282.1, 459 K: each pass overshoots further
  3. Slope of the update g′(T*) = −4εσT*³/h = −1.141: |g′| > 1, so plain substitution diverges
  4. Best α for a scalar: 1/(1 − g′) = 0.467
  5. α = 0.467: T = 370.07, 382.01, 382.31, 382.31 K

Answer: Plain iteration diverges; with α = 0.47 it reaches 382.3 K in about four steps

Newton on the same plate: linearising the radiation term · F(T) = 1500 − 10(T − 300) − 0.9σ(T⁴ − 300⁴) = 0; Newton T_new = T − F/F′, F′ = −10 − 4εσT³; start at 300 K
  1. T = 396.7018, 382.7402, 382.3124, 382.312 K
  2. The error roughly squares each step: quadratic convergence
  3. In source form the radiation loss S = −εσT⁴ is linearised as Sc + Sp T with Sp = −4εσT_old³ = −5.512 W/(m²·K) at 300 K: negative, as Patankar's rule requires

Answer: Four Newton steps give 382.312 K, correct to a fraction of a millikelvin

Implicit relaxation of one cell · One cell's equation a_P φ_P = Σa_nb φ_nb + b with a_P = 12 and the right side 30 (neighbours frozen); previous value 2.0; α = 0.7
  1. Unrelaxed: φ* = 30/12 = 2.5
  2. Implicit form: (12/0.7) φ = 30 + 0.3 × (12/0.7) × 2.0 → 17.1429 φ = 40.2857 → φ = 2.35
  3. Explicit form: 2.0 + 0.7 × (2.5 − 2.0) = 2.35: the same for a single cell
  4. As a false time step: a_P(1 − α)/α = ρΔV/Δt, so Δt = 2.333 ρΔV/a_P

Answer: φ = 2.35 either way; at convergence (φ = φ_old) the implicit form reduces to the original equation

Chapter 10

The finite volume method for 1-D steady diffusion: control volumes, sources and boundary cells

Which syllabus covers thisAU CME368 Unit II (finite volume, steady 1-D diffusion)VTU not in syllabusSPPU 402044F Unit 2 (conduction by FVM)MU MEDLO5013 Module 5 (finite volume method)KTU PEMET521 Module 3 (1-D conduction, boundary conditions)

What does the finite volume method do that finite differences do not?

It cuts the domain into control volumes and writes the conservation law for each one: heat in through the west face, minus heat out through the east face, plus heat made inside, equals zero. Only the face fluxes are approximated, as k(TE − TP)/δx. Because the flux leaving one cell is exactly the flux entering its neighbour, the cells add up to the whole domain with nothing lost. In the heater strip with 10 cells, the 120 kW/m² made inside leaves as 75 kW/m² through face A and 45 kW/m² through face B, to round-off; here the split is also the exact one, on any grid.

Where do aW, aE, aP and b come from?

Write each face flux, collect the terms in TP on the left and the neighbours on the right. In the heater strip (30 mm, k = 15 W/(m·K), 4 MW/m³, assumed) with 10 cells, Δx = 3 mm: aW = aE = k/Δx = 5,000 W/(m²·K), aP = aW + aE = 10,000 and b = q Δx = 12,000 W/m² for an interior cell. The source enters b as Sc Δx and aP as −Sp Δx. Move the cell slider to the ends and watch the face terms appear in aP and b. Ten such equations form a tridiagonal system, solved by TDMA in about 8N operations.

Finite volumes for 1-D diffusion with a source: control volumes, coefficients, boundary cells and the exact answer: interactive loads as you scroll

How are the boundary cells handled, and where does the error come from?

With nodes at cell centres the face sits half a cell from the first node, so the face link is 2k/Δx = 10,000 W/(m²·K) at N = 10: aP = 15,000 and b gains 2k·TA/Δx. An insulated face adds nothing; a cooled face adds U = 1/(Δx/2k + 1/h) = 476.19. A ghost cell outside the wall, mirrored so the face value is right, gives the same equation. For a constant source the interior equations are exact, so all of the error is born at the faces: every node sits qΔx²/8k = 0.3 K too high at N = 10, for all three face-B choices, and 1.2 K at N = 5, four times more: second order.

Why must a source be written as Sc + Sp T with Sp ≤ 0?

Sp sits on the diagonal as −Sp Δx. If the source falls as T rises (Sp < 0) the diagonal grows and every solver likes it. If it rises with T (Sp > 0, a self-heating material), the diagonal shrinks. In the strip with face B held, Gauss-Seidel needs 226 sweeps with β = 0 and 1,547 at β = 3.5 %/K. Above β = 4.11 %/K (insulated 1.03, cooled 1.71 %/K) there is no steady state at all: the strip runs away, and the solver still prints numbers, which mean nothing.

What are Patankar's four rules?

1. Consistency at faces: the flux through a face is the same expression in both cells that share it, so the method conserves. 2. Positive coefficients: aP and every neighbour coefficient must be positive, or a hotter neighbour could make TP colder. 3. Negative-slope source linearisation: Sp ≤ 0. 4. aP equals the sum of the neighbour coefficients when there is no source, so a uniform temperature stays a solution. Breaking a rule does not always crash the solver; it removes the guarantee of a bounded, physical answer.

Predict, then check

The heater strip with a constant source has a max error of 0.30 K on 10 control volumes. What is it on 20?

Worked examples

Five control volumes for the heater strip · Strip 30 mm thick, k = 15 W/(m·K), q = 4 MW/m³, face A held at 30 °C, face B at 60 °C, N = 5 cells (Δx = 6 mm), nodes at cell centres
  1. Interior links: aW = aE = k/Δx = 15/0.006 = 2,500 W/(m²·K); face links 2k/Δx = 5,000
  2. Source per cell: b = qΔx = 4×10⁶ × 0.006 = 24,000 W/m²
  3. Cell 1: aP = 2,500 + 5,000 = 7,500, b = 24,000 + 5,000 × 30 = 174,000
  4. Cells 2-4: aP = 5,000, b = 24,000
  5. Cell 5: aP = 7,500, b = 24,000 + 5,000 × 60 = 324,000
  6. TDMA: T = 45, 65.4, 76.2, 77.4, 69 °C
  7. Exact at the same points: 43.8, 64.2, 75, 76.2, 67.8 °C

Answer: Peak 77.4 °C (exact peak 76.88 °C); every node is 1.2 K too high, the error made at the two half-cell faces. Heat out: 75 + 45 = 120 kW/m², exactly what is made

A cooled face: the last cell's coefficients · The same strip on N = 10 cells (Δx = 3 mm); face B cooled by a fluid at 20 °C with h = 500 W/(m²·K)
  1. Resistance from node to fluid: Δx/(2k) + 1/h = 0.0001 + 0.002 = 0.0021 m²·K/W, so U = 476.19 W/(m²·K)
  2. aW = k/Δx = 5,000, aE = 0, aP = 5,000 + 476.19 = 5,476.19
  3. b = qΔx + U T∞ = 12,000 + 476.19 × 20 = 21,523.8 W/m²
  4. Solving all 10 equations: T10 = 88.25 °C, heat to the fluid U(T10 − 20) = 32.5 kW/m²
  5. Face temperature = 20 + 32500/500 = 85 °C

Answer: aP = 5,476.19 W/(m²·K), b = 21,523.8 W/m²; 32.5 kW/m² leaves to the fluid and 87.5 kW/m² through face A

Linearising a radiation source · A thin sheet (2 mm, emissivity 0.8) losing heat by radiation from both sides to surroundings at 300 K: S = −c(T⁴ − 300⁴) with c = 2εσ/t; last iterate T* = 500 K
  1. c = 2 × 0.8 × 5.67×10⁻⁸/0.002 = 4.536×10⁻⁵ W/(m³·K⁴)
  2. S* = −c(500⁴ − 300⁴) = −2,467,747 W/m³ (a sink: the sheet loses heat)
  3. Tangent: Sp = dS/dT = −4cT*³ = −22,681 W/(m³·K) (negative: rule 3 holds)
  4. Sc = S* − Sp T* = 8,873,002 W/m³
  5. Check at 520 K: Sc + Sp × 520 = −2,921,377 vs the true −2,949,328 W/m³

Answer: S ≈ 8,873,002 − 22,681 T (W/m³). The tangent is within 0.9 % 20 K away and keeps Sp < 0; lumping all of S* into Sc (Sp = 0) also works but converges more slowly

Chapter 11

2-D steady diffusion: the five-point equation, mixed boundary conditions and the heat balance

Which syllabus covers thisAU CME368 Unit II (2-D diffusion)VTU not in syllabusSPPU 402044F Unit 2 (Dirichlet, Neumann, Robin)MU not in syllabusKTU PEMET521 Module 3 (2-D steady conduction)

What does a 2-D control volume equation look like?

Each cell now talks to four neighbours, east, west, north and south, so the equation has five temperatures. On THE PLATE (1 m square, top 100 °C, the rest 0 °C) with steel k = 43 W/(m·K) and square cells, every link aE = kΔy/Δx = 43 W/K per metre of depth, whatever the cell size. The 100 equations of a 10 × 10 grid are no longer tridiagonal; the page solves them line by line, a TDMA along every row then every column, in 57 iterations to a 10⁻⁸ °C change. Tap a cell to see its stencil.

2-D steady conduction by finite volumes: the five-point equation, fixed, insulated and convective edges and the heat balance: interactive loads as you scroll

Why is the plate's centre exactly 25 °C even on a coarse grid?

Rotate the plate four times so each edge takes a turn at 100 °C and add the four solutions: every edge is then 100 °C and the answer is 100 everywhere. The centre gets the same share from each copy, 25 °C. On a square n × n grid the discrete equations rotate the same way, so the FV centre is 25 °C exactly, even on 3 × 3. On a 6 × 4 grid the rotations no longer map cells onto cells and the centre comes out 25.31 °C. Exact agreement in one spot is symmetry, not accuracy.

How do insulated and convective edges enter the equations?

An insulated edge carries no flux: the boundary link is simply dropped, aE = 0. A convective edge connects the cell to the fluid through half a cell of steel and the film in series, U = 1/(Δx/2k + 1/h): 89.58 W/(m²·K) for Δx = 0.1 m and h = 100, against 2k/Δx = 860 for a fixed edge. Insulating the right edge lifts the centre to 36.41 °C (10 × 10 FV: 36.37); cooling it with h = 100 gives 31.52 °C (FV 31.45). The exact values come from series solutions.

Does a perfect heat balance prove the answer is right?

No. Finite volumes balance heat to round-off on every grid: heat in through the top equals heat out through the other edges to round-off. But the top-edge heat itself is 19 kW/m on 10 × 10, 22.8 on 20 × 20 and 26.6 on 40 × 40: it grows by 3.79 kW/m every time the grid doubles. The top corners jump from 100 to 0 °C, the exact flux there is infinite, and no mesh converges it. Conservation tells you the books balance, not that the numbers are true.

What changes with long thin cells, curved edges and cylinders?

On a 40 × 4 grid the cells are 25 mm by 250 mm: aE = 430 and aN = 4.3, a ratio of 100. Point Gauss-Seidel then crawls (1,479 sweeps against 203 on 10 × 10), while line-by-line, which solves each strong row at once, needs 22 iterations. Curved boundaries are met by stair-stepped cells, body-fitted grids or unstructured cells. In cylindrical coordinates the face areas grow with radius, so each coefficient carries the face radius r.

Predict, then check

THE PLATE on a 9 × 9 finite volume grid, all edges fixed (top 100 °C, others 0 °C). The centre cell is:

Worked examples

THE PLATE on 3 × 3 cells · 1 m square steel plate (k = 43 W/(m·K)), top edge 100 °C, other edges 0 °C, 3 × 3 cells, nodes at cell centres, per metre of depth
  1. Square cells: every interior link kΔy/Δx = 43 W/K; every edge link 2kΔy/Δx = 86 W/K
  2. Centre cell: aP = 4 × 43 = 172, b = 0
  3. Top-left cell: aE = aS = 43, plus 86 (west) and 86 (north): aP = 258, b = 86 × 100 = 8,600
  4. Top-middle cell: aE = aW = aS = 43, plus 86 (north): aP = 215, b = 8,600
  5. Solving the 9 equations: top row 46.43, 63.57, 46.43; middle row 15, 25, 15; bottom row 3.57, 6.43, 3.57 °C
  6. Heat in at the top = 86 × (300 − 46.43 − 63.57 − 46.43) = 12,347 W/m
  7. Heat out: left 5,590 + right 5,590 + bottom 1,167 = 12,347 W/m

Answer: Centre exactly 25 °C; 12,347 W/m enters at the top and the same leaves through the other three edges

A cooled edge cell · THE PLATE on 10 × 10 cells (Δx = Δy = 0.1 m), right edge cooled by a fluid at 0 °C with h = 100 W/(m²·K); the cell on the right edge, sixth row
  1. aW = aN = aS = kΔy/Δx = 43 W/K; aE = 0 (no cell to the east)
  2. U = 1/(Δx/2k + 1/h) = 1/(0.05/43 + 0.01) = 89.58 W/(m²·K); times the face length Δy = 0.1 m: 8.958 W/K
  3. aP = 3 × 43 + 8.958 = 137.96, b = U Δy T∞ = 0
  4. With the edge held at 0 °C instead the link would be 2kΔy/Δx = 86 W/K and aP = 215

Answer: aP = 137.96 W/K per metre; the cooled edge draws 2,869 W/m against 9,028 W/m when held at 0 °C

Long thin cells · THE PLATE on 40 cells across and 4 up (Δx = 25 mm, Δy = 250 mm), k = 43 W/(m·K)
  1. aE = aW = kΔy/Δx = 43 × 0.25/0.025 = 430 W/K
  2. aN = aS = kΔx/Δy = 43 × 0.025/0.25 = 4.3 W/K
  3. Ratio (Δy/Δx)² = 100: each cell is bound 100 times tighter to its east and west neighbours
  4. Point Gauss-Seidel to a 10⁻⁸ °C change: 1,479 sweeps; line-by-line (TDMA along rows and columns): 22 iterations

Answer: Strongly unequal coefficients slow point iteration; solve along the strong direction with TDMA, or avoid cell aspect ratios this large where gradients matter in both directions

Chapter 12

Transient diffusion: explicit, Crank-Nicolson and fully implicit schemes and their stability

Which syllabus covers thisAU CME368 Unit II (Euler, Crank-Nicolson, implicit, stability)VTU not in syllabusSPPU 402044F Unit 2 (implicit and explicit, stability)MU MEDLO5013 Module 6 (Crank-Nicolson)KTU PEMET521 Module 3 (explicit, implicit, Crank-Nicolson)

What is the θ-method?

Integrate a control volume over one time step and you must decide which temperatures drive the face fluxes: the old ones (θ = 0, explicit), the new ones (θ = 1, fully implicit) or half of each (θ = ½, Crank-Nicolson). The case: a 40 mm steel slab (α = 1.118×10⁻⁵ m²/s) at 100 °C whose faces drop to 0 °C. With 20 intervals, d = αΔt/Δx² = 0.4 and 70 steps to 10 s, the explicit march is within 0.24 K of the exact series everywhere (centre 63.8 °C). The Heat and Mass Transfer book's fdm interactive shows the basic explicit and implicit pictures.

Explicit, Crank-Nicolson and fully implicit time steps for transient conduction: accuracy, stability and the amplification factor: interactive loads as you scroll

Why must the explicit scheme keep d ≤ ½?

Each Fourier mode of the error is multiplied by G every step. For θ = 0 the shortest wave, kΔx = π, gets G = 1 − 4d, which falls below −1 once d passes ½ and the zig-zag grows. On the slab with 20 intervals that means Δt ≤ Δx²/2α = 0.179 s. At d = 0.6, |G| = 1.364 and after 47 steps the temperatures reach about 1.6 million °C. Halving Δx quarters the allowed step: 40 intervals need 1,342 steps to reach 60 s instead of 336.

Crank-Nicolson is second order and always stable. What is the catch?

Its time error falls as Δt² (the page measures slope 2; explicit and implicit give 1 and 1). But for large d its G for the shortest waves tends to −1: they survive with a sign flip every step. A sudden face drop is full of short waves, so with d ≈ 4.2 (2 steps to 3 s) the slab zig-zags near the faces (G = −0.79) and the error is 14.4 K. G stays positive only for d ≤ ½. Stable is not the same as accurate.

When is fully implicit the better choice?

Fully implicit has 0 < G < 1 for every wave and every d, so it never oscillates and damps short waves hard. The price is first-order accuracy: at d = 2 on the slab (14 steps to 10 s) it is 0.87 K off while Crank-Nicolson is 0.05 K off. Each implicit or CN step solves a tridiagonal system by TDMA, about twice the work of an explicit step, but the step can be many times larger. Steady-state solvers march in pseudo-time with implicit steps for exactly this robustness.

How do you choose Δt, and what is ADI?

Make the time error no larger than the space error. On the slab with 20 intervals the space error is about 0.05 K (CN at d = 0.4 and at d = 2 give the same 0.05 K), so a smaller Δt buys nothing; explicit at d = 0.4 adds time error and lands at 0.24 K. In 2-D an implicit step is no longer tridiagonal. ADI (Peaceman and Rachford, 1955) splits it into two half steps, implicit along x then along y, each a set of TDMA solves.

Predict, then check

On the slab you switch from explicit (d = 0.4) to Crank-Nicolson and raise d to about 4, reaching 3 s in 2 steps. What do you see?

Worked examples

The largest explicit time step · Steel slab 40 mm thick, α = 1.118×10⁻⁵ m²/s, explicit scheme, 20 and 40 intervals, march to 60 s
  1. 20 intervals: Δx = 2 mm; Δt ≤ Δx²/(2α) = (0.002)²/(2 × 1.118×10⁻⁵) = 0.179 s
  2. Steps to 60 s: 60/0.179 → 336
  3. 40 intervals: Δx = 1 mm; Δt ≤ 0.0447 s; steps to 60 s: 1,342
  4. Twice the nodes and four times the steps: 8 times the work

Answer: Δt ≤ 0.179 s on 20 intervals and 0.0447 s on 40; refining an explicit grid costs (refinement)³ in 1-D

One Crank-Nicolson step by hand · The slab on N = 4 intervals (Δx = 10 mm, three interior nodes at 100 °C, faces at 0 °C), d = 1 (Δt = 8.95 s)
  1. CN with d = 1: (1 + d)Ti − (d/2)(Ti−1 + Ti+1) = (1 − d)Ti_old + (d/2)(Ti−1_old + Ti+1_old)
  2. Right-hand sides: node 1: 0.5 × (0 + 100) = 50; node 2: 0.5 × (100 + 100) = 100; node 3: 50
  3. Equations: 2T1 − 0.5T2 = 50; −0.5T1 + 2T2 − 0.5T3 = 100; −0.5T2 + 2T3 = 50
  4. By symmetry T1 = T3: −T1 + 2T2 = 100 and 2T1 − 0.5T2 = 50 give T1 = 42.86, T2 = 71.43 °C
  5. Exact at t = 8.95 s: 48.7 and 68.54 °C

Answer: T = 42.86, 71.43, 42.86 °C after one step. At the centre CN is 2.9 K above the exact value, the net of two errors: the big time step adds 4.9 K and the 4-interval grid alone would be 2 K low (66.51 °C with time exact)

Amplification of the shortest wave · kΔx = π (the zig-zag mode), d = 2
  1. sin²(π/2) = 1
  2. Explicit: G = 1 − 4d = −7 (|G| > 1: unstable)
  3. Crank-Nicolson: G = (1 − 2d)/(1 + 2d) = −3/5 = −0.6
  4. Implicit: G = 1/(1 + 4d) = 1/9 = 0.111
  5. Exact decay over the step: e^(−d π²) = e^(−2π²) = 2.7×10⁻⁹

Answer: The true zig-zag dies in one step; implicit keeps 11 %, Crank-Nicolson keeps 60 % with a sign flip each step, explicit multiplies it by −7

Chapter 13

Steady convection-diffusion: central and upwind differencing, the Péclet number and wiggles

Which syllabus covers thisAU CME368 Unit III (central, upwind, scheme properties)VTU not in syllabusSPPU 402044F Unit 3 (convection-diffusion, Péclet number)MU not in syllabusKTU PEMET521 Module 4 (central and upwind schemes)

What is steady convection-diffusion, and what does the Péclet number measure?

A scalar φ (temperature, a concentration) is carried by the flow and spreads by diffusion: d(ρuφ)/dx = d/dx(Γ dφ/dx). The Péclet number Pe = ρuL/Γ compares the two. In the book's duct (2 m, ρ = 1, Γ = 0.05, φ = 1 in and 0 out) Pe = 40u. At u = 1 m/s, Pe = 40: the exact φ stays near 1 along the duct and drops to 0 in a thin outlet layer about Γ/(ρu) = 0.05 m thick (φ is still 0.865 at x = 1.9 m). On a grid the number that matters is the cell Péclet number P = F/D = ρuΔx/Γ.

Why does central differencing wiggle when the cell Péclet number passes 2?

Central differencing takes the face value as the average of the two nodes. That gives aW = D + F/2 and aE = D − F/2, and aE turns negative once P = F/D > 2. A negative neighbour weight means a higher φE pushes φP down: the solution zig-zags. The duct at 1 m/s on 10 cells has P = 4 and aE = −0.25: the nodes swing up to about 2 and the largest error is 1.14. With 20 cells (P = 2) the error falls to 0.368, with 40 cells to 0.107.

Steady convection-diffusion along the book's duct: central, upwind, hybrid, power-law and QUICK against the exact solution: interactive loads as you scroll

What does upwind differencing do instead, and what does it cost?

Upwind differencing takes the face value from the node the flow comes from. The coefficients become aW = D + F and aE = D: never negative, so no wiggles at any P. The duct on 10 cells at 1 m/s gives a largest error of 0.198 instead of 1.14. The price is accuracy. Upwind is first order (observed order 0.98 on the duct at Pe 4), and it behaves like extra diffusion ρuΔx/2. On those 10 cells that is 0.1, 2 times the real Γ.

What are conservativeness, boundedness and transportiveness?

Three tests for any convection scheme. Conservative: the flux leaving one cell is exactly the flux entering the next, so nothing is lost. All five schemes on this page pass, and every face of the duct carries the same total flux J = Fφ − Γ dφ/dx (the exact J is F/(1 − e^(−Pe)) = 1 at 1 m/s). Bounded: all neighbour coefficients are positive, so no node can go outside its neighbours' range. Central fails at P > 2, and QUICK always has a negative far-upstream weight. Transportive: the weights lean upstream as P grows. At P = 4 the exact ratio aW/aE = e^P is 54.6, upwind gives 1 + P = 5, and central gives −3.

So which scheme do real CFD codes use for convection?

Neither pure central nor pure first-order upwind. Central needs P ≤ 2, which for real flows means absurdly small cells: air at 2 m/s needs cells under 21 µm for the temperature equation. First-order upwind is safe but smears every gradient. Finite-volume codes therefore offer second-order upwind and bounded higher-order schemes with limiters (chapter 15). A common habit is to start a run with first order for robustness, then switch to second order for the answer you report. The hybrid and power-law schemes of chapter 14 sit between the two.

Predict, then check

The duct runs at 1 m/s on 40 cells (P = 1) with central differencing, and the profile is smooth. You raise the speed to 3 m/s on the same grid. What happens?

Worked examples

Central differencing on the duct at 0.2 m/s with 5 cells · The book's duct: L = 2 m, ρ = 1 kg/m³, Γ = 0.05 kg/(m·s), φ = 1 at the inlet, 0 at the outlet, u = 0.2 m/s, 5 equal cells, central differencing, boundary faces half a cell from the end nodes
  1. Δx = 2/5 = 0.4 m, D = Γ/Δx = 0.125, F = ρu = 0.2, P = F/D = 1.6 (below 2: no wiggles expected)
  2. Interior cells 2-4: aW = D + F/2 = 0.225, aE = D − F/2 = 0.025, aP = aW + aE = 0.25
  3. Cell 1 (inlet face at D_b = 2D = 0.25): aP = F/2 + D + 2D = 0.475, aE = 0.025, b = (F + 2D) × 1 = 0.45
  4. Cell 5 (outlet face, φ = 0): aP = 2D − F/2 + D = 0.275, aW = 0.225, b = 0
  5. Solve the 5 equations (TDMA): φ = 1, 0.9997, 0.9975, 0.9778, 0.8
  6. Exact φ = 1 − (e^(Pe(x/L − 1)) − e^(−Pe))/(1 − e^(−Pe)) with Pe = 8 at the same nodes: 0.9996, 0.9966, 0.982, 0.9096, 0.5509

Answer: φ = 1, 1, 0.998, 0.978, 0.8; the largest error is 0.2492 and no node leaves 0..1

When does central differencing fail on the duct at 1 m/s? · The duct at u = 1 m/s (Pe = 40) on 10 cells; compare central and upwind coefficients, and find the cell count central differencing needs
  1. Δx = 0.2 m, D = 0.05/0.2 = 0.25, F = 1, P = 4
  2. Central: aW = D + F/2 = 0.75, aE = D − F/2 = −0.25 (negative: wiggles)
  3. Upwind: aW = D + F = 1.25, aE = D = 0.25 (both positive)
  4. Upwind's numerical diffusion ≈ FΔx/2 = 0.1, which is 2 times the real Γ = 0.05
  5. Central needs P ≤ 2: Δx ≤ 2Γ/(ρu) = 0.1 m, so N ≥ 2/0.1 = 20 cells

Answer: On 10 cells central differencing gives aE = −0.25 and oscillates (largest error 1.14); it needs at least 20 cells. Upwind is bounded (error 0.198) but adds twice the real diffusion

Air in a ventilation duct: can central differencing be used for temperature? · Air at 20 °C (ρ = 1.204 kg/m³, k = 0.02587 W/(m·K), cp = 1007 J/(kg·K)) moving at 2 m/s along a 3 m duct, cells 5 mm long; for temperature Γ/ρ is the thermal diffusivity α = k/(ρcp) (original case)
  1. α = 0.02587/(1.204 × 1007) = 2.134 × 10⁻⁵ m²/s
  2. Cell Péclet number P = uΔx/α = 2 × 0.005/0.00002134 = 469
  3. Central differencing needs P ≤ 2: Δx ≤ 2α/u = 21.3 µm
  4. Cells along a 3 m duct at that size: 3/(21.3 × 10⁻⁶) = 140,599

Answer: No: P ≈ 469, far above 2. Central differencing would need about 140,599 cells along the duct alone, which is why real codes use upwind-based schemes

Chapter 14

Hybrid, power-law and exponential schemes: Patankar's A(|P|) function

Which syllabus covers thisAU CME368 Unit III (hybrid, power-law)VTU not in syllabusSPPU 402044F Unit 3 (convection-diffusion)MU not in syllabusKTU PEMET521 Module 4 (convection-diffusion)

Where does the exponential scheme come from?

Between two nodes with steady flow, constant F and D and no source, the 1-D equation has an exact solution: an exponential. The exponential (exact) scheme uses that curve to set the face flux, so aE = D·P/(e^P − 1) and aW = aE + F. On the book's duct this reproduces the exact solution at every node for any N and any speed. The interactive's error stays at round-off (below 10⁻¹¹) on every grid from 4 to 256 cells. Its limits: it is exact only in 1-D steady flow without sources, and an exponential costs more than a few multiplications.

What is Patankar's A(|P|) function?

Patankar wrote every scheme in one form: aE = D·A(|P|) + max(−F, 0) and aW = D·A(|P|) + max(F, 0). Only A(|P|) changes. Central 1 − 0.5|P|, upwind 1, hybrid max(0, 1 − 0.5|P|), power law max(0, (1 − 0.1|P|)⁵) and exact |P|/(e^|P| − 1). At P = 3: exact 0.1572, power law 0.1681, hybrid 0, upwind 1, central −0.5. A scheme is bounded if A(|P|) ≥ 0, which central breaks past P = 2.

Patankar's A(|P|) function: the neighbour coefficient of each scheme against the cell Péclet number, compared with the exact one: interactive loads as you scroll

What does the hybrid scheme do, and where is it worst?

The hybrid scheme (Spalding, 1970, as reported by Wikipedia) uses central differencing while |P| < 2. Beyond that it switches to upwind and drops diffusion completely. That keeps it bounded at every P. It is worst right at the switch: at P = 2 the exact aE/D is 0.313, but hybrid gives 0. On the duct at 1 m/s with 10 cells (P = 4) its largest error is 0.135, against 0.198 for upwind and 1.14 for central.

Why was the power law the default in older codes?

Patankar's power law (1980) fits the exact A(|P|) curve with a polynomial: (1 − 0.1|P|)⁵ up to |P| = 10, and zero diffusion beyond. Its worst error in aE/D is only 0.0147 (near P = 2.1), with no exponential to evaluate in every cell on every iteration. As P → 0 it differs from exact by P²/60, five times less than central's P²/12. On the duct at 1 m/s with 10 cells its largest error is 0.0054, 36 times smaller than upwind's.

What order of accuracy do these schemes reach, and what is their limit?

Refine the duct and the error falls as Δx^p. At Pe 4 (N 128 → 256): central 2, power law 1.98, upwind 0.98. Hybrid is central once P < 2, so it is second order on fine grids (1.93 at Pe 40). At Pe 40, upwind is still only at 0.87: those grids are not yet in the asymptotic range. The catch is that all of this is 1-D. In 2-D and 3-D, when the flow crosses the grid at an angle and P > 2, hybrid and power law fall back to upwind and smear the solution (chapter 15).

Predict, then check

On a cell with P = 5, which scheme gives the east coefficient aE/D closest to the exact value?

Worked examples

Coefficients of every scheme at P = 3 on the duct · The duct at u = 1.5 m/s on 20 cells: Δx = 0.1 m, D = Γ/Δx, F = ρu
  1. D = 0.05/0.1 = 0.5, F = 1.5, P = F/D = 3
  2. Exact: A = 3/(e³ − 1) = 0.1572; aE = 0.0786, aW = aE + F = 1.5786
  3. Power law: A = 0.7⁵ = 0.1681; aE = 0.084, aW = 1.584
  4. Hybrid: A = max(0, 1 − 1.5) = 0; aE = 0, aW = 1.5
  5. Upwind: A = 1; aE = 0.5, aW = 2
  6. Central: A = 1 − 1.5 = −0.5; aE = −0.25 (negative), aW = 1.25

Answer: aE = 0.0786 (exact), 0.084 (power law), 0 (hybrid), 0.5 (upwind), −0.25 (central); only central is negative

Check that the exponential scheme is exact at a node · The duct at u = 1 m/s (Pe = 40) on 10 cells, node P at x = 1.7 m with W at 1.5 m and E at 1.9 m
  1. D = 0.25, F = 1, P = 4; aE = D × 4/(e⁴ − 1) = 0.018657
  2. aW = aE + F = 1.018657, aP = aW + aE = 1.037315
  3. Exact φ = 1 − (e^(40(x/2 − 1)) − e^(−40))/(1 − e^(−40)): φW = 0.999955, φP = 0.997521, φE = 0.864665
  4. aP φP − aW φW − aE φE = 1.034743 − 1.018611 − 0.016132 = 0 (to round-off, 1e-16)

Answer: The exact solution satisfies the exponential scheme's equation exactly, so the scheme returns the exact nodal values on any grid

Where the hybrid scheme switches off diffusion · The duct at u = 0.5 m/s (Pe = 20); 8 cells
  1. Hybrid switches to upwind when P ≥ 2, so when Δx ≥ 2Γ/(ρu) = 0.2 m, i.e. 10 cells or fewer
  2. With 8 cells: Δx = 0.25 m, D = 0.2, F = 0.5, P = 2.5
  3. A(|P|): exact 2.5/(e^2.5 − 1) = 0.2236, power law 0.75⁵ = 0.2373, hybrid 0
  4. Largest duct error on 8 cells: hybrid 0.0557, power law 0.0044, upwind 0.1579

Answer: Below 10 cells the hybrid scheme throws away all diffusion; on 8 cells its error is 0.056, while the power law, which keeps 0.237·D of it, has 0.0044

Chapter 15

QUICK and false diffusion: when the flow crosses the grid at an angle

Which syllabus covers thisAU CME368 Unit III (QUICK)VTU not in syllabusSPPU 402044F Unit 2 (second order upwind, QUICK)MU not in syllabusKTU not in syllabus

What is the QUICK scheme?

QUICK (Leonard, 1979) stands for quadratic upstream interpolation. The face value comes from a parabola through two upstream nodes and one downstream node: φe = 6/8 φP + 3/8 φE − 1/8 φW for flow in +x. The interpolation is third order. In the full scheme the diffusion term is still a second-order central difference, so the duct at Pe 4 shows an observed order of 2, like central. Its advantage shows when convection dominates, where it is far less diffusive than upwind.

Why can QUICK overshoot?

Write QUICK in coefficient form for an interior cell: aW = D + 7F/8, aE = D − 3F/8, aWW = −F/8. The far-upstream weight is always negative, and aE turns negative once P > 8/3. Negative weights mean overshoots near steep changes. On the duct at 1 m/s with 10 cells (P = 4) QUICK misses by up to 1.14, as badly as central. In the 2-D front of this chapter's interactive (30°, 32 × 32) QUICK keeps the front sharp but overshoots by 9.6 %.

What is false diffusion, and how big is it?

First-order upwind in 2-D smears anything carried across the grid at an angle. The smear looks like diffusion that is not in the physics. de Vahl Davis and Mallinson's estimate (as reported by Wikipedia) gives the false diffusivity for square cells of side h. In the interactive, a sharp front carried at 30° across 32 × 32 cells with zero real diffusion arrives at x = 0.6 smeared over 0.293 L, against an estimate of 0.284 L. Refining the grid only shrinks it as √h (measured slope 0.51).

False diffusion: a sharp front carried across the grid at an angle by upwind and by a bounded second-order scheme: interactive loads as you scroll

Why is false diffusion worst at 45°, and what does grid alignment buy?

With flow along a grid line (θ = 0), upwind carries the front exactly: no smear at all. As the angle grows, each cell mixes values from two directions. On square cells this peaks at 45°, where the false diffusivity is ρUh/(2√2), about 0.354 ρUh. Stretched cells make it worse across the long side: at 30° with cells twice as tall as wide, the estimate rises from 0.0087 to 0.015 ρUL. This is why meshes are aligned with the main flow where possible: prism layers along walls, structured blocks along jets and wakes.

How do flux limiters give sharp fronts without overshoots?

A limited (TVD) scheme uses second-order upwind face values, φf = φC + ½ψ(r)(φC − φU), but shrinks the correction where the solution turns. r is the ratio of successive gradients. van Leer's limiter (1974), ψ = (r + |r|)/(1 + |r|), drops to plain upwind at a peak or valley. Sweby (1984) mapped the region where such limiters stay total-variation diminishing. In the interactive at 30° the van Leer front is 0.105 L wide, against 0.293 L for upwind and 0.108 L for QUICK, with no overshoot at all: every cell stays within 0..1.

Predict, then check

A 2-D upwind solution smears a front carried at 30° to the grid. You refine from 32 × 32 to 128 × 128 cells, 4 times finer. The smear width…

Worked examples

QUICK against van Leer at the edge of a step · Three nodes W, P, E along the flow (flow from W to E); face e between P and E. Case 1: φW = 0, φP = 1, φE = 1 (just past a step). Case 2: φW = 0, φP = 0.5, φE = 1 (a straight ramp). Case 3: φW = 0.2, φP = 0.6, φE = 0.7 (original numbers)
  1. QUICK: φe = 6/8 φP + 3/8 φE − 1/8 φW. Case 1: 0.75 + 0.375 − 0 = 1.125 (above both neighbours: overshoot)
  2. van Leer: r = (φE − φP)/(φP − φW) = 0/1 = 0, ψ = 0, φe = φP = 1 (bounded)
  3. Case 2: QUICK 0.75; van Leer r = 1, ψ = 1, φe = 0.5 + 0.5 × 0.5 = 0.75: both exact on a straight line
  4. Case 3: QUICK 0.45 + 0.2625 − 0.025 = 0.6875; van Leer r = 0.1/0.4 = 0.25, ψ = 0.5/1.25 = 0.4, φe = 0.6 + 0.5 × 0.4 × 0.4 = 0.68

Answer: Just past a step QUICK gives 1.125, 12.5 % above the data; van Leer gives 1. On smooth data both agree closely

How much false diffusion does a coarse mesh add to air flow? · Air at 20 °C (ρ = 1.204 kg/m³, μ = 1.813 × 10⁻⁵ Pa·s) at 5 m/s, first-order upwind on square 10 mm cells, flow at 45° and at 10° to the grid; de Vahl Davis and Mallinson's estimate
  1. 45°: sin 2θ = 1 and sin³θ = cos³θ = 0.3536, so Γ(false) = ρU h/(2√2) = 6.02 × 0.01/2.828 = 0.02128 kg/(m·s)
  2. Compare with the real viscosity: 0.02128/1.813 × 10⁻⁵ = 1,174 times
  3. 10°: Γ(false) = 6.02 × 0.0001 × sin 20°/(4 × 0.01 × (sin³10° + cos³10°)) = 0.00536 kg/(m·s), 296 times μ

Answer: About 1,174 times the real viscosity at 45° and 296 times at 10°: on such a mesh, upwind results show the scheme, not the air

QUICK coefficients on the duct and its positivity limit · The duct at u = 0.5 m/s on 10 cells (D = 0.25, F = 0.5, P = 2), QUICK for an interior cell
  1. aW = D + 7F/8 = 0.6875
  2. aE = D − 3F/8 = 0.0625
  3. aWW = −F/8 = −0.0625 (always negative)
  4. aP = aW + aE + aWW = 0.6875
  5. aE stays ≥ 0 while P ≤ 8/3; at u = 1 m/s (Pe 40) that needs N ≥ 3 × 40/8 = 15 cells

Answer: aW = 0.6875, aE = 0.0625, aWW = −0.0625, aP = 0.6875; QUICK is never fully positive, and aE turns negative beyond P = 8/3

Chapter 16

Von Neumann stability analysis and the CFL condition for convection

Which syllabus covers thisAU CME368 Unit III (von Neumann), V (CFL number)VTU not in syllabusSPPU 402044F Unit 2 (stability criteria)MU not in syllabusKTU PEMET521 Module 2 (numerical stability)

What is von Neumann stability analysis?

Any error on a periodic grid can be written as a sum of waves e^(ikx). For a linear scheme, each wave is multiplied by the same complex amplification factor G every time step, where G depends on β = kΔx and the Courant number. If |G| > 1 for any β, that wave grows without limit: the scheme is unstable. The method was published by Charney, Fjørtoft and von Neumann in 1950. For advection, FTCS gives |G| = √(1 + C² sin²β), 1.118 at C = 0.5. In the interactive a Gaussian pulse grows 68 times in one pass, and a square pulse blows up.

What is the CFL condition?

Courant, Friedrichs and Lewy (1928) showed that a scheme can only converge if its numerical domain of dependence contains the physical one. Upwind builds u at node i from nodes i and i − 1, so in one step the information cannot travel more than one cell: cΔt ≤ Δx, or C ≤ 1. The interactive's scan confirms it: upwind, Lax-Friedrichs and Lax-Wendroff all have max |G| ≤ 1 exactly when C ≤ 1, and at C = 1 all three shift the pulse exactly. CFL is necessary, not sufficient: FTCS is unstable at every C. The site's Courant number calculator does the arithmetic for a mesh.

Von Neumann stability and the CFL number: amplification factors of advection schemes and a pulse carried across the grid: interactive loads as you scroll

What do |G| and the phase of G tell you: dissipation and dispersion?

|G| below 1 damps a wave (dissipation). A phase different from the exact −Cβ moves a wave at the wrong speed (dispersion), so a sharp pulse sheds ripples. After one pass of a Gaussian pulse at C = 0.5 on 100 cells, upwind keeps 58 % of the peak. Lax-Friedrichs keeps only 38 %, and Lax-Wendroff keeps 97 % but leaves a ripple behind, because short waves travel too slowly. Upwind at exactly C = 0.5 has the exact phase for every wavelength, so all its error is damping.

Why is upwind diffusive? What is the modified equation?

Expand the upwind update in Taylor series and you find it solves, to leading order, u_t + c u_x = ν_num u_xx with ν_num = cΔx(1 − C)/2. That is the equation the scheme really solves. For c = 1 m/s, 100 cells over 1 m and C = 0.5, ν_num = 0.0025 m²/s. It vanishes at C = 1 (exact shift) and becomes negative, anti-diffusion and growth, for C > 1. Lax-Friedrichs adds cΔx(1 − C²)/(2C), 3 times upwind's at C = 0.5. Lax-Wendroff cancels this term and is second order.

How do implicit and steady-state solvers run at Courant numbers far above 1?

An implicit scheme solves for all new values together, so information crosses the whole grid in one step. Implicit upwind has G = 1/(1 + C(1 − e^(−iβ))), and |G| ≤ 1 for every C. At C = 100 a 4-cell wave keeps only 0.007 of its amplitude per step. Stable is not accurate, though: transients still need C near 1 where you care about timing. Steady-state solvers use the time step only as a relaxation device (chapter 9), so they can run at large C. Explicit convection-diffusion needs both C ≤ 1 and the diffusion limit d ≤ ½ (chapter 12).

Predict, then check

An explicit upwind solver carries air at 10 m/s through 1 mm cells. What is the largest stable time step?

Worked examples

Time step for an explicit upwind solver · Air at 5 m/s (the book's flat-plate speed) through 2 mm cells; explicit first-order upwind at Courant number 0.8; 1 s of flow to simulate
  1. CFL limit: Δt ≤ Δx/u = 0.002/5 = 0.4 ms
  2. At C = 0.8: Δt = 0.8 × 0.4 = 0.32 ms
  3. Steps for 1 s: 1/0.00032 = 3,125
  4. Halving the cell size in 2-D: 4 times the cells and 2 times the steps, 8 times the work

Answer: Δt = 0.32 ms, 3,125 steps per simulated second

Amplification factor of upwind at four cells per wavelength · First-order upwind for u_t + c u_x = 0 at C = 0.5; a wave four cells long, β = kΔx = 2π/4 = π/2
  1. G = 1 − C + C cos β − iC sin β = 1 − 0.5 + 0 − 0.5i = 0.5 − 0.5i
  2. |G| = √(0.5² + 0.5²) = 0.7071 per step
  3. Phase of G = −45°; the exact wave moves −Cβ = −0.5 × 90° = −45°: no phase error
  4. After 20 steps the amplitude is 0.7071²⁰ = 9.77 × 10⁻⁴

Answer: |G| = 0.7071: a 4-cell wave is damped to 0.10 % in 20 steps, with no phase error at C = 0.5

Why FTCS fails for advection and how Lax-Friedrichs fixes it · u_t + c u_x = 0 at C = 0.5, β = π/2; FTCS: G = 1 − iC sin β; Lax-Friedrichs replaces u_i by the average of its neighbours: G = cos β − iC sin β
  1. FTCS: |G| = √(1 + 0.5²) = 1.118 > 1 for every C > 0
  2. After 100 steps: 1.118¹⁰⁰ = 70,065: round-off at this wavelength grows to swamp the answer
  3. Lax-Friedrichs: |G| = √(cos² β + C² sin² β) = 0.5 ≤ 1 whenever C ≤ 1
  4. The price: its numerical diffusion cΔx(1 − C²)/(2C) is 3 times upwind's at C = 0.5

Answer: FTCS amplifies this wave 1.118 times per step (70,065 times in 100 steps); Lax-Friedrichs is stable (|G| = 0.5) but very diffusive

Chapter 17

Stream function and vorticity: the lid-driven cavity against the Ghia benchmark

Which syllabus covers thisAU CME368 Unit IV (stream function and vorticity)VTU not in syllabusSPPU 402044F Unit 4 (lid-driven cavity)MU not in syllabusKTU PEMET521 Module 4 (2-D incompressible viscous flow)

Why solve 2-D flow with a stream function and vorticity instead of u, v and p?

In 2-D incompressible flow you can define a stream function ψ with u = ∂ψ/∂y and v = −∂ψ/∂x. Any ψ then satisfies continuity automatically, so that equation disappears. Taking the curl of the two momentum equations removes pressure, leaving one transport equation for the vorticity ω and one Poisson equation linking ψ to ω. Three unknowns (u, v, p) become two (ψ, ω), and the awkward pressure-velocity coupling of chapter 19 never appears. Lines of constant ψ are streamlines, so the answer is also easy to draw.

What does the lid-driven cavity benchmark test, and how close does a 32 × 32 grid get?

A square box of side 1 is full of fluid and its lid slides at speed 1; at Re 100 one large vortex fills it, with tiny eddies in the bottom corners. Ghia, Ghia and Shin (1982) solved it on a 129 × 129 grid and tabulated centreline velocities that every code is still checked against. They report a vortex strength ψ_min of about −0.1034 at (0.617, 0.734). Our 32 × 32 solution reaches −0.1004 at (0.623, 0.743) after about 3,300 pseudo-time steps, with u on the vertical centreline within 0.0089 of Ghia's 17 points. On 64 × 64 the gap falls to 0.0028.

The lid-driven cavity solved live by stream function and vorticity, and checked against the Ghia benchmark: interactive loads as you scroll

There is no vorticity equation at a wall. How does the solver get the wall vorticity?

From the stream function. At a wall ψ = 0 and ∂ψ/∂y equals the wall speed, so a Taylor series from the wall to the first node at distance h gives Thom's formula: ω_wall = −2ψ₁/h² − 2U/h at the moving lid (the U term vanishes on a fixed wall). It is applied every step, so the walls feed vorticity into the flow. On the 32 × 32 cavity, ψ₁ = −0.02784 below the middle of the lid gives ω = −6.99. The formula is only first-order accurate at the wall, yet the interior answer still converges at second order.

How do you know the cavity answer is grid independent, and when does a grid fail outright?

Run three grids. At Re 100, ψ_min is −0.09109 on 16 × 16, −0.10043 on 32 × 32 and −0.10276 on 64 × 64. The changes shrink four times per halving, so the observed order is 2.00. Richardson extrapolation gives −0.10354, within 0.0002 of Ghia, and the GCI of the finest grid is 0.94 %. At Re 400 a 16 × 16 grid converges without complaint to a wrong flow: ψ_min −0.0523 against Ghia's −0.1139, u off by 0.31. A converged residual is not a correct answer.

What are the limits of the stream function-vorticity method?

It is a 2-D method. In 3-D the stream function becomes a vector potential and vorticity has three components, so you trade four unknowns for six and the advantage is gone. Pressure is not computed. If you need wall forces, you recover it afterwards from a Poisson equation built from the velocity field. Inflow and outflow boundaries are awkward because ω has no natural boundary value there. Benchmarks also carry misprints: Ghia's printed Re 400 v at x = 0.9063 (−0.238) is far from our 64 × 64 result (−0.360) and from two modern solutions (−0.388, −0.398).

Predict, then check

The cavity at Re 100 is converged on 32 × 32 (ψ_min −0.1004). You rerun it on 64 × 64. What happens to ψ_min?

Worked examples

Wall vorticity by Thom's formula · A cavity grid with spacing h = 0.05, lid speed 1 m/s. ψ at the first node below the lid = −0.031; ψ at the first node above the bottom wall = −0.0012 (stream function in m²/s)
  1. Lid: ω = −2ψ₁/h² − 2U/h = −2(−0.031)/0.0025 − 2(1)/0.05 = 24.8 − 40 = −15.2 s⁻¹
  2. Bottom (fixed): ω = −2ψ₁/h² = −2(−0.0012)/0.0025 = 0.96 s⁻¹
  3. These values are set at the start of every step, before the interior vorticity is advanced

Answer: ω = −15.2 s⁻¹ under the lid and 0.96 s⁻¹ on the bottom wall

Velocity and vorticity at a node from ψ · Grid spacing 0.1 m. ψ at P = −0.052, E = −0.047, W = −0.049, N = −0.038, S = −0.051 m²/s
  1. u = (ψN − ψS)/2h = (−0.038 + 0.051)/0.2 = 0.065 m/s
  2. v = −(ψE − ψW)/2h = −(−0.047 + 0.049)/0.2 = −0.01 m/s
  3. ∇²ψ = (ψE + ψW + ψN + ψS − 4ψP)/h² = 0.023/0.01 = 2.3 s⁻¹
  4. ω = −∇²ψ = −2.3 s⁻¹ (negative: clockwise rotation)

Answer: u = 0.065 m/s, v = −0.01 m/s, ω = −2.3 s⁻¹

How long the 32 × 32 cavity takes to settle · The book's cavity at Re 100 on 32 × 32 (h = 1/32), explicit pseudo-time step Δt = 0.4 × the smallest of the diffusion limit h²Re/4, the convection limit 2/Re and h; it stops when the largest vorticity change per unit time falls below 1e-6
  1. h²Re/4 = 0.0244, 2/Re = 0.02, h = 0.0312: the smallest is 0.02
  2. Δt = 0.4 × 0.02 = 0.008
  3. 3,319 steps × 0.008 = 26.6 time units

Answer: About 27 time units: the lid slides about 27 cavity widths before the flow stops changing

Chapter 18

The checkerboard pressure field and the staggered grid

Which syllabus covers thisAU CME368 Unit IV (pressure gradient term, staggered grid)VTU not in syllabusSPPU 402044F Unit 4 (SIMPLE)MU not in syllabusKTU PEMET521 Module 4 (staggered grid)

How is the pressure gradient term written when p and u live at the same nodes?

The momentum equation for the control volume around node P needs the pressure force −(p_e − p_w)A on its faces. With pressures stored only at nodes, the natural choice is linear interpolation, p_e = (p_P + p_E)/2 and p_w = (p_W + p_P)/2. Subtract them and p_P cancels: the force on node P depends only on p_E − p_W, two nodes apart. That is second-order accurate for smooth pressure, but node P never sees its own pressure.

What is the checkerboard pressure field, and why can a collocated solver not see it?

Add a zig-zag of +A, −A, +A … to any smooth pressure. At every interior node p_E and p_W carry the same sign of the zig-zag, so their difference, and the force, is unchanged. With A = 10 Pa on Δx = 0.1 m the collocated force −∂p/∂x stays exactly at the smooth 50 Pa/m, while the adjacent-node differences swing between 250 and −150 Pa/m. Continuity is just as blind: a zig-zag velocity interpolates to the same face value everywhere. So a solver can converge to a wavy, wrong pressure field.

A checkerboard pressure field that a collocated grid cannot see, and the staggered grid that sees it: interactive loads as you scroll

How does the staggered grid fix it?

Harlow and Welch (1965) stored pressure at cell centres and each velocity component on the cell faces, half a cell away. The u on the face between P and E is driven by (p_P − p_E)/Δx, adjacent nodes only Δx apart, so a checkerboard of amplitude A shows up as ±2A/Δx and the momentum equations push it back out. Continuity for a pressure cell uses the face velocities directly, with no interpolation, so a zig-zag velocity leaves an imbalance of ±2B per cell and the pressure correction removes it.

What does the staggered grid cost?

Bookkeeping. In 2-D there are three grids (p, u, v), in 3-D four, each with its own control volumes, indices and boundary rules. A 100 × 100 cell grid holds 10,000 pressures, 10,100 u values and 10,100 v values. Convective fluxes need velocities interpolated onto other grids' faces, and on curved or unstructured meshes the face-normal velocity changes direction from face to face, which makes the method painful. Textbook and research codes on Cartesian grids still use it because it is robust and conserves mass exactly.

How do collocated codes avoid the checkerboard?

With Rhie-Chow interpolation (Rhie and Chow, 1983). The face mass flux is the interpolated node velocity plus a correction: d × (mean of the two node pressure gradients − the face gradient (p_E − p_P)/Δx). For a smooth field the two gradients agree, so the term is zero for any quadratic and of order Δx² for a cubic. For a checkerboard it equals ±2A/Δx, so continuity now feels adjacent-node pressure differences. Most general-purpose finite volume codes on unstructured meshes keep all variables at cell centres and use this kind of interpolation.

Predict, then check

On a collocated grid with Δx = 0.1 m the pressure reads 100, 90, 100, 90, 100 … Pa. What pressure force per unit volume does the central-difference momentum equation feel at an interior node?

Worked examples

Node gradient against face gradient · Pressures at five collocated nodes 0.05 m apart: 120, 104, 118, 100, 116 Pa
  1. Node 2: (118 − 120)/0.1 = −20 Pa/m; node 3: (100 − 104)/0.1 = −40 Pa/m; node 4: (116 − 118)/0.1 = −20 Pa/m
  2. Faces 1-2: (104 − 120)/0.05 = −320 Pa/m; 2-3: (118 − 104)/0.05 = 280 Pa/m; 3-4: −360 Pa/m; 4-5: 320 Pa/m
  3. The node values are small and smooth; the face values swing by hundreds of Pa/m, because the field hides a zig-zag of about ±8 Pa

Answer: Collocated: −20, −40, −20 Pa/m; staggered: −320, 280, −360, 320 Pa/m

A zig-zag velocity that passes continuity · Collocated velocities along a row of equal cells: 2.0, 1.0, 2.0, 1.0, 2.0 m/s; face values by linear interpolation
  1. Every face value = (2.0 + 1.0)/2 = 1.5 m/s
  2. Net outflow per unit area for any interior cell = 1.5 − 1.5 = 0
  3. If the same numbers sat on the faces of a staggered grid, a cell would see 2 − 1 = 1 m/s of imbalance

Answer: The collocated check reports perfect continuity for a velocity field that is obviously wrong; the staggered check catches it

Size of the Rhie-Chow correction · Collocated pressures with a 300 Pa/m smooth fall plus a checkerboard of 8 Pa, Δx = 0.02 m, face coefficient d = 2.5e-4 m³·s/kg (assumed)
  1. Node gradients (central): both −300 Pa/m, the checkerboard cancels
  2. Face gradient (p_E − p_P)/Δx = −1100 Pa/m
  3. Correction term = face − mean of nodes = −1100 − (−300) = −800 Pa/m
  4. Face velocity change = −d × term = −2.5e-4 × (−800) = 0.2 m/s

Answer: The face flux changes by 0.2 m/s per face, alternating in sign, so continuity now reacts to the checkerboard

Chapter 19

Pressure-velocity coupling: SIMPLE, SIMPLEC and PISO

Which syllabus covers thisAU CME368 Unit IV (SIMPLE and its variants, PISO)VTU not in syllabusSPPU 402044F Unit 4 (SIMPLE)MU not in syllabusKTU PEMET521 Module 4 (pressure correction, SIMPLE)

Why is pressure the hard part of incompressible flow?

There are four unknowns (u, v, w, p) and four equations (three momentum, one continuity), but no equation for pressure itself. Continuity does not contain p; it only says the velocity field must be divergence-free. In incompressible flow pressure is whatever it has to be to make that happen. Pressure-based solvers turn this into an iteration: guess p, solve momentum for the velocities, then correct p and the velocities until continuity holds. Density-based solvers for compressible flow get p from an equation of state instead.

What are the steps of SIMPLE, and what does it converge to on a duct?

SIMPLE (Patankar and Spalding, early 1970s): 1, guess p*. 2, solve the momentum equations for u*. 3, solve a pressure-correction equation built from continuity for p′, keeping only u′ = d(p′_P − p′_E) and dropping the neighbours' corrections. 4, set p = p* + αp p′ and correct u. 5, repeat. On the page's duct with 5 pressure nodes it stops in 46 iterations at 2.009 kg/s, while Bernoulli says 1.700. The 18 % gap is the first-order upwind momentum: 1.849 on 9 nodes, 1.773 on 17.

The SIMPLE algorithm on a duct: guessed pressure, momentum, pressure correction and under-relaxation iteration by iteration: interactive loads as you scroll

Why does SIMPLE need under-relaxation, and how much?

Dropping the neighbours' velocity corrections makes p′ too large, so the pressure is only partly corrected, p = p* + αp p′, and momentum is relaxed with αu. A common pairing is αp + αu ≈ 1: OpenFOAM's classic simpleFoam tutorial uses p 0.3 and U 0.7. On the duct that pair converges in 46, 60 and 66 iterations on 5, 9 and 17 nodes. Push αp to 1 with αu 0.7 and SIMPLE takes 21 iterations on 5 nodes, 71 on 9 and diverges on 17.

What does SIMPLEC change, and is it always faster?

SIMPLEC (Van Doormaal and Raithby, 1984) keeps part of the dropped neighbour term: d = A/(aP/αu − Σa_nb) instead of A αu/aP. The pressure correction is then about right, so αp = 1 works. Newer OpenFOAM tutorials switch to it with U 0.9. On the duct SIMPLEC with αp 1 and αu 0.7 converges on every grid (47, 60, 63 iterations), including where SIMPLE diverges. Tuned for speed, though, SIMPLE wins here (17 against 25 on 5 nodes). The gain is robustness, not guaranteed speed.

Where do SIMPLER, PISO and coupled solvers fit?

SIMPLER (Patankar, 1979) solves a pressure equation for p from the velocities and uses p′ only to correct the velocities, so a good pressure field arrives in fewer iterations. PISO (Issa, 1986) is built for transient flow: one predictor and two corrector steps per time step, with no outer iterations when the time step is small. Coupled solvers solve momentum and continuity together as one block system, using more memory per iteration but needing far fewer iterations. Whatever the method, watch residuals and monitor values: OpenFOAM's tutorial stops at 1e-2 for p and 1e-3 for U.

Predict, then check

SIMPLE converges on the 17-node duct with αp 0.3, αu 0.7 in 66 iterations. You raise αp to 1 to speed it up. What happens?

Worked examples

One SIMPLE iteration on the duct · The page's duct, 5 pressure nodes: face areas 0.55, 0.45, 0.35, 0.25 m², node areas 0.60 … 0.20 m², ρ = 1.204 kg/m³, p0 = 30 Pa, p_out = 0. Guess ṁ = 1 kg/s (u = ṁ/ρa) and p* = 30, 22.5, 15, 7.5, 0 Pa; αp = 0.3, αu = 0.7
  1. Mass flux F = 1 kg/s at every node, so aP = 1 at faces 2-4; face 1 adds the inlet term: aP = 1 + 0.5 × (0.55/0.6)² = 1.4201
  2. Momentum (relaxed, solved face by face from the inlet): u* = 3.169, 5.134, 6.143, 6.61 m/s
  3. d = a αu/aP = 0.2711, 0.315, 0.245, 0.175; mass imbalance Σ|b′| = 1.476 kg/s
  4. Pressure correction (3 equations): p′ = −0.929, 2.098, 5.233 Pa
  5. Correct: p2 = 22.5 + 0.3 × (−0.929) = 22.221 Pa; u4 = 7.525 m/s, ṁ = 2.265 kg/s, now the same through every face

Answer: After one iteration ṁ = 2.265 kg/s (converged discrete value 2.009); continuity is satisfied exactly, momentum is not yet

The answer SIMPLE converges to, against Bernoulli · The same duct. Exact: Bernoulli from 30 Pa stagnation to 0 Pa at the 0.20 m² outlet. Discrete: the converged upwind momentum equations summed from inlet to outlet
  1. Bernoulli: u_exit = √(2 × 30/1.204) = 7.059 m/s, ṁ = 1.204 × 0.20 × 7.059 = 1.700 kg/s
  2. Summed discrete equations: p0 − p_out = ṁ² S, S = 1/(2ρA₁²) + (1/ρ)[(1/a₁ − 1/A₁)/a₁ + Σ (1/a_i − 1/a_{i−1})/a_i]
  3. S = 7.432 → ṁ = √(30/S) = 2.009 kg/s
  4. With 9 and 17 nodes: 1.849 and 1.773 kg/s; the error halves with each halving of Δx (first order)

Answer: The 5-node SIMPLE answer is 18 % high; converging the iterations cannot remove a discretisation error

SIMPLE and SIMPLEC velocity-correction coefficients · A u-face with aP = 12 kg/s, neighbour coefficients Σa_nb = 10.5 kg/s, face area 0.02 m², αu = 0.7; the pressure correction across the face is 3 Pa
  1. SIMPLE: d = A αu/aP = 0.02 × 0.7/12 = 0.001167 m³·s/kg, u′ = d × 3 = 0.0035 m/s
  2. SIMPLEC: d = A/(aP/αu − Σa_nb) = 0.02/(17.143 − 10.5) = 0.003011 m³·s/kg, u′ = 0.00903 m/s
  3. Ratio 2.58: SIMPLEC's larger d accounts for the neighbours moving too, so less pressure relaxation is needed

Answer: u′ = 0.0035 m/s with SIMPLE, 0.00903 m/s with SIMPLEC

Chapter 20

Computing a boundary layer by marching: velocity and thermal layers on a flat plate

Which syllabus covers thisAU CME368 Unit III (boundary layer flow), IV (thermal boundary layer)VTU not in syllabusSPPU not in syllabusMU not in syllabusKTU not in syllabus

Why can a boundary layer be computed by marching downstream, one station at a time?

Inside a thin layer the streamwise diffusion ν ∂²u/∂x² is tiny next to ν ∂²u/∂y², and the pressure across the layer is the outer pressure. Drop those terms and the equations become parabolic in x: information only travels downstream. On the book's flat plate (air at 20 °C, 5 m/s) the layer at 0.5 m is 6.07 mm thick, 1.21 % of x. So no outlet condition is needed, and each station is one small implicit solve across the layer instead of one huge elliptic system.

What does the solver do at each station of the march?

It writes the momentum equation at the new station with central differences across a stretched grid and a second-order backward difference in x. The convecting u and v are lagged from the last guess, so each pass is a linear tridiagonal system, solved by the Thomas algorithm; v then follows from continuity, and the pass repeats (Picard) until nothing changes by 10⁻⁷. On 40 cells the march takes 312 steps with about 10 passes each and gives Cf√Re_x = 0.6664 at 0.5 m, 0.34 % above Blasius.

A flat-plate boundary layer computed by marching downstream: velocity and thermal layers against the Blasius solution: interactive loads as you scroll

What is the Blasius solution, and how do you know the march is right?

On a flat plate the profile keeps its shape if y is scaled by √(νx/U): u/U = f′(η), with f‴ + ½ f f″ = 0. Our own shooting gives f″(0) = 0.33206, so Cf√Re_x = 0.664, and u reaches 99 % at η = 4.91 (pages round to 5.0). Displacement thickness is 1.721 and momentum thickness 0.664 in the same units. The march is never told any of this, yet its profiles collapse onto f′(η). At the end of the 1 m plate δ99 = 8.52 mm.

How does the Prandtl number change the thermal layer the march computes?

The energy equation has the same form with ν replaced by ν/Pr, so it is marched on the same grid after the velocity. Pohlhausen's exact Nu_x/√Re_x is 0.2927 at Pr 0.7 and 0.6459 at Pr 7, close to the 0.332 Pr^(1/3) correlation. The thermal layer is 1.15 times the velocity layer at Pr 0.7 and 0.5 times at Pr 7. At Pr = 1 the two equations are identical and the march gives θ = u exactly. The Heat and Mass Transfer book has the correlations for design.

Where does a boundary-layer march stop being trustworthy?

At the leading edge the layer is thinner than a cell, so the first stations are wrong; they are forgotten downstream (starting at 1 mm instead of 0.1 mm moves Cf at 1 m by 0.04 %). The error falls as Δy² and as Δx² (observed orders 1.99 and 2.06). Under an adverse pressure gradient the wall flow reverses at separation and marching breaks down. At 5 m/s transition starts near Re_x = 5 × 10⁵, about 1.51 m down the plate: see the Fluid Mechanics book.

Predict, then check

The march starts from a badly wrong profile (u = U everywhere off the wall) at x = 0.1 mm. By x = 1 m, how much does that start still matter?

Worked examples

Blasius thickness, skin friction and drag on the book's plate · Air at 20 °C (ν = 1.506 × 10⁻⁵ m²/s, ρ = 1.204 kg/m³) at 5 m/s over a smooth flat plate 1 m wide. Find Re_x, δ99, Cf and τw at x = 0.4 m, and the drag on one side of the first 0.4 m.
  1. Re_x = U x/ν = 5 × 0.4/(1.506 × 10⁻⁵) = 132,819: laminar (below 5 × 10⁵)
  2. δ99 = 4.91 x/√Re_x = 4.91 × 0.4/364.4 = 5.39 mm (the rounded 5.0 gives 5.49 mm)
  3. Cf = 0.664/√Re_x = 1.8223 × 10⁻³
  4. τw = Cf × ½ρU² = 1.8223 × 10⁻³ × 15.05 = 0.0274 Pa
  5. Average Cf over 0 to x is twice the local value (1.328/√Re_x), so drag = 1.328/√Re_x × ½ρU² × 0.4 × 1 = 0.0219 N

Answer: Re_x = 132,819, δ99 ≈ 5.39 mm, Cf = 1.822 × 10⁻³, τw ≈ 0.027 Pa, drag ≈ 0.022 N per side

One implicit marching station by hand · Scaled boundary-layer equation u ∂u/∂x = ∂²u/∂y² (v taken as 0 for this hand step), Δy = 0.5, Δx = 0.01, backward difference in x with the old profile u = 0, 0.3, 0.6, 0.85, 1 at y = 0, 0.5, 1, 1.5, 2 used as the convecting velocity (lagged). Wall u = 0, edge u = 1. Find the new u at the three interior nodes.
  1. Each node: (u_old/Δx + 2/Δy²) u_j − (1/Δy²)(u_(j−1) + u_(j+1)) = u_old²/Δx
  2. Coefficients: b = 38, 68, 93; a = c = −4; right sides d = 9, 36, 76.25 (the edge value 1 × 4 added to the last)
  3. Forward sweep: P1 = −0.10526, Q1 = 0.23684; P2 = −0.05919, Q2 = 0.54673; Q3 = 0.84556
  4. Back substitution: u3 = 0.8456, u2 = Q2 − P2 u3 = 0.5968, u1 = Q1 − P1 u2 = 0.2997
  5. Check: substituting back satisfies all three equations; the profile has thickened (each interior u fell a little)

Answer: u ≈ 0.3, 0.597, 0.846 at y = 0.5, 1, 1.5

Heat lost by a warm plate (Pohlhausen) · The book's plate held at 60 °C in air at 20 °C and 5 m/s (k = 0.02587 W/(m·K), Pr = 0.71). Find the local Nusselt number, h and the heat flux at x = 0.5 m.
  1. Re_x = 5 × 0.5/(1.506 × 10⁻⁵) = 166,023
  2. Pohlhausen (exact similarity) at Pr 0.71: Nu_x/√Re_x = θ′(0) = 0.2942, so Nu_x = 119.9 (the 0.332 Pr^(1/3) correlation gives 120.7)
  3. h_x = Nu_x k/x = 119.9 × 0.02587/0.5 = 6.202 W/(m²·K)
  4. q = h ΔT = 6.202 × 40 = 248.1 W/m²
  5. Thermal layer δt99 ≈ 6.87 mm, slightly thicker than the velocity layer because Pr is below 1

Answer: Nu_x ≈ 120, h ≈ 6.2 W/(m²·K), q ≈ 248 W/m²

Chapter 21

External flow over a cylinder: regimes, shedding, drag and how to set up the case

Which syllabus covers thisAU not in syllabusVTU BME403 lab (flow over an aerofoil or cylinder)SPPU 402044F Unit 4 (flow over a circular cylinder)MU not in syllabusKTU not in syllabus

How does the flow behind a circular cylinder change as the Reynolds number Re = UD/ν rises?

Below about Re 5 the flow stays attached. Then two standing eddies form behind it; computed bubble lengths are 0.93 D at Re 20 and 2.35 D at Re 40, a line that reaches zero near Re 6.9. Near Re 47 the pair goes unstable and vortices shed alternately: the Kármán street. From Re 188.5 the street turns three-dimensional. From about 300 to 2 × 10⁵ the boundary layer separates laminar and the wake is turbulent. Near 3.6 × 10⁵ the drag crisis comes.

What is the Strouhal number, and how fast does a cylinder shed vortices?

St = f D/U is the shedding frequency made dimensionless. Roshko's fit St = 0.212 − 4.5/Re holds from Re 50 to 150 and gives 0.167 at Re 100 (Williamson measured 0.166). From Re 300 to 2,000 it is 0.212 − 2.7/Re, and St stays close to 0.2 up to about 10⁵. A 2 mm wire in a 0.75 m/s breeze is at Re 100 and sheds at 62.9 Hz: that is the hum of a wire in the wind.

Flow past a cylinder: regimes against Reynolds number, the shedding frequency, the drag curve and the size of a sensible domain: interactive loads as you scroll

Why does the drag coefficient of a cylinder fall, flatten and then suddenly drop?

At very low Re viscous friction dominates and Cd is large: Lamb's formula gives 12.6 at Re 1. Tritton measured 2.22 at Re 20 and 1.48 at Re 40; 2-D computations give 1.33 to 1.42 at Re 100. Then pressure drag from the wide wake dominates and Cd sits near 1 to 1.2. Near Re 3.6 × 10⁵ the boundary layer turns turbulent before it separates, the separation moves back, the wake narrows below one diameter and Cd drops from about 1.2 to 0.3.

When is a 2-D simulation of a cylinder good enough?

Up to Re 188.5 the real wake is two-dimensional, so a 2-D laminar run is the right model, and published 2-D runs at Re 100 agree with experiment on St to within about 6 %. Above that the first 3-D instability (mode A) has a spanwise wavelength of 3.96 D, so a 3-D run needs a span of at least about 4 D and periodic sides. In the subcritical range the wake is turbulent: use LES, or unsteady RANS with care, never a 2-D laminar mesh.

How do you set up a cylinder case so the answer can be trusted?

One published Re 100 study used a domain 40 D long and 30 D high with the cylinder 10 D from the inlet, slip top and bottom, and found 35,172 and 55,362 cells within 1 % of each other: an example, not a rule. Resolve the wall (at Re 10⁴ a 2 mm wire in air needs a first cell near 6.9 µm), take about 100 time steps per shedding period, check the Courant number, and run until the lift history repeats before averaging Cd and reading St.

Predict, then check

A 2 mm wire in a 0.75 m/s breeze (Re 100) sheds at 62.9 Hz. Double the wind speed. The shedding frequency…

Worked examples

Shedding frequency of a pipe across a stream · A 25 mm pipe crosses a river channel where water at 20 °C (ν = 1.003 × 10⁻⁶ m²/s) flows at 0.4 m/s. Find Re, the regime and the shedding frequency.
  1. Re = U D/ν = 0.4 × 0.025/(1.003 × 10⁻⁶) = 9,966
  2. Between 300 and 2 × 10⁵: subcritical, laminar separation with a turbulent wake
  3. St ≈ 0.21 (Norberg measured 0.204 to 0.213 at Re 3,000 to 8,000; the round value is 0.2)
  4. f = St U/D = 0.21 × 0.4/0.025 = 3.36 Hz (with St = 0.2: 3.2 Hz)

Answer: Re ≈ 9,966, subcritical, f ≈ 3.4 Hz (period about 0.3 s)

Time step for a Re 100 shedding case · A 2-D laminar run at Re 100 with a 10 mm cylinder in water (ν = 1.003 × 10⁻⁶ m²/s), 100 time steps per shedding period, near-wake cells Δx = D/20. Find U, f, Δt and the Courant number; what Δt keeps the Courant number at 0.5?
  1. U = Re ν/D = 100 × 1.003 × 10⁻⁶/0.010 = 10.034 mm/s
  2. St = 0.212 − 4.5/100 = 0.167; f = St U/D = 0.1676 Hz, period T = 5.968 s
  3. Δt = T/100 = 0.0597 s; Δx = D/20 = 0.5 mm
  4. Courant = U Δt/Δx = 1.198 (it is 20/(100 St) whatever D and the fluid)
  5. For Courant 0.5: Δt = 0.5 Δx/U = 0.0249 s, about 240 steps per period

Answer: Δt ≈ 0.06 s gives Courant ≈ 1.2; Courant 0.5 needs Δt ≈ 0.025 s (240 steps per period)

Drag before and after the drag crisis · A 0.3 m cylinder in air at 20 °C (ν = 1.506 × 10⁻⁵ m²/s, ρ = 1.204 kg/m³). Take Cd ≈ 1.2 at Re 2 × 10⁵ and ≈ 0.3 just past the crisis at Re 4 × 10⁵. Compare the drag per metre at the two speeds.
  1. Re 2 × 10⁵: U = Re ν/D = 10.04 m/s; ½ρU² = 60.7 Pa; F = ½ρU² D Cd = 60.7 × 0.3 × 1.2 = 21.8 N/m
  2. Re 4 × 10⁵: U = 20.08 m/s; ½ρU² = 242.7 Pa; F = 242.7 × 0.3 × 0.3 = 21.8 N/m
  3. The speed doubled, the dynamic pressure rose 4 times, and Cd fell 4 times
  4. The crisis Re depends on roughness and free-stream turbulence, so a CFD model must capture transition to predict it

Answer: About 21.8 N/m at 10 m/s and 21.8 N/m at 20.1 m/s: the same drag at twice the speed

Chapter 22

Turbulence: scales, the energy cascade, Reynolds averaging, and DNS, LES and RANS

Which syllabus covers thisAU CME368 Unit I (time-averaged equations), V (LES, DNS)VTU not in syllabusSPPU 402044F Unit 5 (scales, RANS, DNS, LES)MU not in syllabusKTU not in syllabus

What is turbulence, and where does its energy go?

Turbulence is unsteady, three-dimensional, swirling motion over a wide range of eddy sizes. The mean flow feeds the biggest eddies, about the size of the pipe; they break into smaller ones, and viscosity turns the smallest into heat. The rate is ε, in W/kg. In the book's pipe (water, 50 mm, 1 m/s) the pressure falls 211.1 Pa per metre, and that pumping power per kilogram of water is the dissipation: ε = f U³/(2D) = 0.2115 W/kg.

How small are the smallest eddies, and how many cells would resolving them take?

Kolmogorov's scales depend only on ν and ε. In the book's pipe η = (ν³/ε)^(1/4) = 46.7 µm, with a time scale of 2.18 ms. The biggest eddies are about D, so D/η = 1,070. The textbook rule ε ≈ U³/D gives 15 µm and D/η = Re^(3/4) = 3,335, but it overstates a pipe's ε about 95 times. Cells of size η in a pipe 10 D long: 9.6 × 10⁹.

Turbulence scales of the book's pipe: the energy cascade, Kolmogorov scales and what DNS, LES and RANS would cost: interactive loads as you scroll

What is Reynolds averaging, and why does it create the closure problem?

Split each velocity into a mean and a fluctuation, u = ū + u′, and average the equations. The mean needs a long enough window: on the page's synthetic signal a window of 0.1 D/U gives a mean 0.9738 U, and 100 D/U gives 0.9999 U with u′/U = 5.19 %. Averaging the convection term leaves new unknowns, the Reynolds stresses −ρ u′v′. There are more unknowns than equations: that is the closure problem a turbulence model solves.

What do DNS, LES and RANS each resolve, and what do they cost?

DNS resolves every eddy down to η; LES resolves the big eddies and models the small ones; RANS models all of them and solves only the mean. For the book's pipe, 10 D long, at an assumed 1 µs per cell per time step: DNS 9.6 × 10⁹ cells, about 65 years; wall-resolved LES 1.6 × 10⁷ cells, about 47 hours; steady RANS 3.5 × 10⁵ cells, about 12 minutes. That is why design work runs on RANS.

How fast does the cost of resolving turbulence grow with Reynolds number?

With ε ≈ U³/ℓ the DNS cell count grows as Re^(9/4). With the pipe's real ε from its friction factor it grows as Re^(33/16) ≈ Re^2.06, so doubling the speed multiplies the cells by 4.2, and the time steps grow too. For a flat-plate layer Choi and Moin estimated Re^(37/14) for DNS, Re^(13/7) for wall-resolved LES and Re^1 for wall-modelled LES. RANS cost barely grows, which is why industrial CFD uses it and the k-ε model.

Predict, then check

You double the speed in the book's pipe (Re 49,830 → 99,661). Roughly how many times more cells does a DNS need?

Worked examples

Kolmogorov scales of the book's pipe · Water at 20 °C (ρ = 998.2 kg/m³, ν = 1.003 × 10⁻⁶ m²/s) in a smooth 50 mm pipe at a bulk speed of 1 m/s. Find Re, the Blasius friction factor, the pressure gradient, ε and the Kolmogorov length, time and velocity scales.
  1. Re = U D/ν = 49,830; f = 0.316 Re^(−1/4) = 0.02115
  2. Δp/L = f ρ U²/(2D) = 0.02115 × 998.2 × 1/(0.1) = 211.1 Pa/m
  3. ε = pumping power per unit mass = (Δp/L) U/ρ = 0.2115 W/kg
  4. η = (ν³/ε)^(1/4) = 46.7 µm; τη = √(ν/ε) = 2.178 ms; vη = (νε)^(1/4) = 21.46 mm/s
  5. Check: vη η/ν = 1, the smallest eddies have a Reynolds number of 1

Answer: η ≈ 47 µm, τη ≈ 2.18 ms, vη ≈ 21.5 mm/s

How many cells would a DNS of an air duct need? · Air at 20 °C (ν = 1.506 × 10⁻⁵ m²/s) in a smooth 200 mm duct at 10 m/s, a 2 m (10 D) length, cells of size η. Use Colebrook's smooth-pipe law for f; compare the rule ε ≈ U³/D.
  1. Re = 10 × 0.2/(1.506 × 10⁻⁵) = 132,819, beyond Blasius's range; Colebrook (smooth) by iteration: f = 0.01697
  2. ε = f U³/(2D) = 42.42 W/kg; η = (ν³/ε)^(1/4) = 94.7 µm
  3. Volume = π/4 × 0.2² × 2 = 0.0628 m³; cells = volume/η³ = 7.4 × 10¹⁰
  4. With the rule ε ≈ U³/D = 5,000 W/kg: η = 28.7 µm and 2.6 × 10¹² cells
  5. A RANS mesh for the same duct (y+ ≈ 1, assumed O-grid): about 4.1 × 10⁵ cells

Answer: About 7.4 × 10¹⁰ cells for DNS (2.6 × 10¹² by the rough rule), against about 4.1 × 10⁵ for RANS

Reynolds averaging of a measured signal · Eight velocity samples at one point in water: u = 1.12, 0.94, 1.05, 0.88, 1.10, 0.97, 1.02, 0.92 m/s and v = −0.06, 0.05, −0.02, 0.07, −0.05, 0.01, −0.01, 0.03 m/s. Find ū, u′rms, the turbulence intensity and the Reynolds shear stress −ρ u′v′ (ρ = 998.2 kg/m³).
  1. ū = sum/8 = 1.000 m/s; v̄ = 0.0025 m/s
  2. u′ = u − ū = 0.12, −0.06, 0.05, −0.12, 0.1, −0.03, 0.02, −0.08
  3. u′rms = √(mean of u′²) = 0.0811 m/s; intensity u′rms/ū = 8.11 %
  4. mean of u′v′ = −0.00344 m²/s² (negative: with y pointing away from the wall, faster-than-mean fluid is moving towards it)
  5. −ρ u′v′ = 3.43 Pa, a stress the averaged equations cannot compute without a model

Answer: ū = 1.00 m/s, u′rms ≈ 0.081 m/s (8.1 %), −ρu′v′ ≈ 3.4 Pa

Chapter 23

Mixing length, eddy viscosity and the law of the wall

Which syllabus covers thisAU CME368 Unit V (mixing length model)VTU not in syllabusSPPU 402044F Unit 5 (turbulence modelling)MU not in syllabusKTU not in syllabus

What is an eddy viscosity?

Averaging the Navier-Stokes equations leaves extra unknowns, the Reynolds stresses −ρu′v′, made by turbulent eddies carrying momentum. Boussinesq (1877) proposed treating them like a viscous stress: τt = ρ νt du/dy. The eddy viscosity νt belongs to the flow, not the fluid. In the book's pipe the mixing-length model gives νt up to 202 times ν at y+ ≈ 850, and exactly 0 at the wall. Mixing length, k-ε and k-ω are all ways of computing νt. Its weak spot: it assumes the stresses line up with the mean strain, which fails in swirl and strong curvature.

How does Prandtl's mixing length give the velocity profile?

Prandtl (1925) set νt = l²|du/dy| with l = κy near a wall. Van Driest (1956) damped l close to the wall with the factor 1 − e^(−y+/26). Put that into the shear balance τ = τw(1 − y/R), solve the quadratic for du/dy and integrate: that is the whole solver behind the figure. For the book's pipe (Re_τ 1,281) it gives a bulk speed of 0.951 m/s against the true 1 m/s, and a friction coefficient 10.5 % high, because it has no outer 'wake'. Without the damping the bulk speed drops to 0.63 m/s.

The law of the wall from a mixing-length model of the book's pipe: sublayer, buffer and log layer, and where your first cell sits: interactive loads as you scroll

What are the viscous sublayer, buffer layer and log layer?

Near a wall, lengths are measured in wall units y+ = y uτ/ν and speeds as u+ = u/uτ. Below y+ 5 (the viscous sublayer) u+ = y+. Above y+ 30 (the log layer) u+ = (1/κ) ln y+ + B with κ = 0.41 and B = 5.0. Between them, the buffer layer, neither law holds; the two lines cross at y+ 10.8. In the book's pipe ν/uτ = 19.5 µm, so the sublayer is only 0.098 mm thick, 0.4 % of the radius. In the model, viscous and turbulent stress are equal at y+ 10.5.

Wall functions or resolve the wall?

Resolving the wall means a first cell centre at y+ ≈ 1 and a low-Reynolds-number model (k-ω SST, low-Re k-ε): in the book's pipe that is a 39 µm first cell. Wall functions skip the sublayer: the first cell centre sits in the log layer, y+ 30-300 (OpenFOAM's guidance), and the log law supplies the wall shear. Here that is a 1.17-11.7 mm cell; the top of that range is almost half the 25 mm radius, so the pipe sets the real limit. Wall functions save many cells but assume an equilibrium log layer: separation, strong pressure gradients and low Re break them.

Why is a first cell in the buffer layer bad?

At y+ 5-30 neither law is right, so neither treatment is. At y+ 12 the sublayer law u+ = y+ is 31 % above Spalding's single formula for the whole inner layer, and the log law is 21 % off the other way. A wall function placed there reads the wrong wall shear; a low-Re model gets a cell 12 times too tall. Move the cell to y+ ≈ 1 or to y+ ≥ 30. The site's y+ calculator gives the height before meshing; check y+ again after the run, because uτ changes along the wall. The model in the figure also sits 3.7 % above Spalding at y+ 40, a reminder that it is a model.

Predict, then check

A k-ε run with standard wall functions shows y+ = 12 at the first cell. What is the right fix?

Worked examples

First-cell height for the book's pipe · Water at 20 °C (ρ 998.2 kg/m³, μ 1.0016 mPa·s) in a 50 mm pipe at 1 m/s; cell-centred solver; targets y+ = 1 and y+ = 50
  1. Re = ρUD/μ = 998.2 × 1 × 0.05/1.0016 × 10⁻³ = 49,830
  2. Blasius f = 0.316 Re^−0.25 = 0.02115; τw = fρU²/8 = 2.639 Pa
  3. uτ = √(τw/ρ) = 0.05142 m/s; viscous length ν/uτ = 19.51 µm
  4. Cell centre at y+ = 1: first cell height = 2 × 1 × 19.51 = 39 µm
  5. Cell centre at y+ = 50 (wall functions): height = 2 × 50 × 19.51 µm = 1.95 mm

Answer: About 39 µm to resolve the wall, about 2 mm for wall functions

Eddy viscosity 1 mm from the wall · The book's pipe (uτ = 0.05142 m/s, ν = 1.0034 × 10⁻⁶ m²/s); a point 1 mm from the wall, mixing length l = κy, log-law velocity gradient du/dy = uτ/(κy)
  1. y+ = 1 mm/19.51 µm = 51.2: in the log layer
  2. du/dy = 0.05142/(0.41 × 0.001) = 125.4 1/s
  3. νt = l² du/dy = (0.41 × 0.001)² × 125.4 = κ uτ y = 2.108 × 10⁻⁵ m²/s
  4. νt/ν = κ y+ = 21; with Van Driest damping the factor (1 − e^(−51.2/26))² = 0.741 lowers it to 15.6

Answer: νt ≈ 21 ν (about 16 ν with damping): turbulence already carries most of the stress 1 mm from the wall

Is this mesh right for wall functions? · The book's pipe run at 2 m/s instead (Re about 99,700, near the top of the Blasius range); first cell 0.5 mm tall; standard wall functions
  1. Re = 99,661; f = 0.01779; τw = 8.877 Pa; uτ = 0.0943 m/s; ν/uτ = 10.64 µm
  2. Cell centre at 0.25 mm: y+ = 0.25/0.01064 = 23.5: buffer layer
  3. For y+ ≥ 30 the cell must be at least 2 × 30 × 10.64 µm = 0.64 mm
  4. Or resolve the wall: 2 × 1 × 10.64 = 21.3 µm with a low-Re model

Answer: No: y+ ≈ 23 is in the buffer layer. Use a first cell of at least 0.64 mm, or about 21 µm with a low-Re model

Chapter 24

The k-ε model: transport equations, constants, wall functions and inlet values

Which syllabus covers thisAU CME368 Unit V (k-ε, high and low Re models)VTU not in syllabusSPPU 402044F Unit 5 (two-equation model)MU not in syllabusKTU not in syllabus

What do the k and ε equations say?

k is the turbulent kinetic energy per unit mass (half the sum of the squared velocity fluctuations, m²/s²) and ε is the rate it is dissipated into heat (m²/s³). Each has a transport equation: rate of change plus convection equals diffusion (νt/σ) plus production minus destruction. k is produced by mean shear and destroyed by ε; ε is produced in proportion C1 ε/k times the k production and destroyed as C2 ε²/k. Then νt = Cμ k²/ε. Two transported scales give a length k^1.5/ε and a time k/ε, so nothing like a mixing length has to be prescribed. At the book's pipe inlet k/ε = 0.42 s.

Where do the constants come from, and why C2 = 1.92?

The standard set is Cμ 0.09, C1 1.44, C2 1.92, σk 1.0, σε 1.3 (Launder and Spalding, 1974; OpenFOAM's defaults). They were fitted to simple flows. Behind a grid there is no shear, so k only decays: the model predicts k ∝ t^−n with n = 1/(C2 − 1) = 1.087. Comte-Bellot and Corrsin measured n of 1.16-1.37, best fit 1.25, which needs C2 = 1.80. The model keeps 76 % more k than that fit after 100 eddy times. C2 = 1.92 is a compromise that predicts shear flows better.

The k-ε model: decay of grid turbulence, the model constants and inlet k, ε and ω from intensity and length scale: interactive loads as you scroll

What k and ε do you give at an inlet?

From a turbulence intensity I and a length scale ℓ: k = 1.5(UI)², ε = Cμ^0.75 k^1.5/ℓ, ω = ε/(Cμ k). For a fully developed pipe the usual guesses are I = 0.16 Re^(−1/8) and ℓ = 0.07 D. For the book's pipe that is I = 4.14 % and ℓ = 3.5 mm, so k = 0.00257 m²/s², ε = 0.00612 m²/s³, ω = 26.4 1/s and νt/ν = 97. Codes define ℓ differently: typed as a 'classical' length, the same 3.5 mm gives ε = 0.00335; as a 'dimensional' one (CFX style), 0.0372. Read your solver's manual.

What are high-Re and low-Re k-ε models, and where does k-ω SST fit?

Standard k-ε is a high-Reynolds-number model: it assumes turbulence dominates viscosity, which is false below y+ ≈ 30. So it needs wall functions with the first cell centre at y+ 30-300. Low-Re k-ε variants add damping functions so they can be integrated to the wall on a y+ ≈ 1 mesh. Menter's k-ω SST blends k-ω near the wall with k-ε away from it and is the usual choice for y+ ≈ 1 meshes and separating flows. Realizable and RNG k-ε change Cμ and the ε equation to handle swirl and spreading rates better. In the book's pipe, y+ 1 is a 39 µm cell and y+ 30 a 1.17 mm cell.

Where does k-ε go wrong?

Stagnation points: production grows with the strain squared, so k piles up where flow hits a body and heat transfer there is over-predicted. Adverse pressure gradients: separation comes too late or not at all, so diffusers and stalled wings look better than they are. Swirl and strong curvature: one isotropic νt cannot follow the stresses. Even its own calibration case is imperfect: n = 1.087 against the measured 1.25. Use k-ε for attached, shear-dominated industrial flows. Check anything with separation against k-ω SST or data.

Predict, then check

At a pipe inlet you double the length scale ℓ and keep the intensity I. What happens to ε and νt?

Worked examples

Inlet k, ε and ω for an air-conditioning duct · Air at 20 °C (ρ 1.204 kg/m³, μ 1.813 × 10⁻⁵ Pa·s), 400 × 250 mm duct, 3 m/s; I = 0.16 Re^(−1/8), ℓ = 0.07 D_h, mixing-length form
  1. D_h = 4A/P = 4 × 0.1/1.3 = 0.3077 m; Re = ρUD_h/μ = 61,301
  2. I = 0.16 × 61,301^(−1/8) = 4.03 %; ℓ = 0.07 × 0.3077 = 21.5 mm
  3. k = 1.5 × (3 × 0.0403)² = 0.02196 m²/s²
  4. ε = 0.09^0.75 × k^1.5/ℓ = 0.02483 m²/s³; ω = ε/(0.09 k) = 12.56 1/s
  5. νt/ν = 0.09 k²/(ε ν) = 116

Answer: k ≈ 0.022 m²/s², ε ≈ 0.0248 m²/s³, ω ≈ 12.6 1/s (νt ≈ 116 ν)

How fast does grid turbulence decay? · Behind a wind-tunnel grid k0 = 0.24 m²/s² and ε0 = 1.8 m²/s³ (assumed); standard C2 = 1.92
  1. n = 1/(C2 − 1) = 1/0.92 = 1.087
  2. t0 = n k0/ε0 = 1.087 × 0.24/1.8 = 0.1449 s
  3. After 1 s: k = 0.24 × (1 + 1/0.1449)^−1.087 = 0.0254 m²/s²
  4. With the measured n = 1.25 (C2 = 1.8): k = 0.0211 m²/s²

Answer: k falls to about 10.6 % of k0 in 1 s by the model (8.8 % with the measured exponent)

Eddy viscosity and scales from k and ε · A water mixing layer at 20 °C where k = 0.06 m²/s² and ε = 0.9 m²/s³
  1. νt = Cμ k²/ε = 0.09 × 0.06²/0.9 = 3.6 × 10⁻⁴ m²/s
  2. νt/ν = 359
  3. Length scale k^1.5/ε = 16.3 mm; time scale k/ε = 0.0667 s

Answer: νt ≈ 359 ν, with eddies of about 16 mm turning over in about 0.067 s

Chapter 25

Mesh generation, refinement and the grid independence test

Which syllabus covers thisAU CME368 Unit V (mesh refinement, grid independence test)VTU not in syllabusSPPU 402044F Unit 1 (meshed vs meshless)MU not in syllabusKTU PEMET521 Module 4 (presenting CFD results)

Structured or unstructured mesh?

A structured mesh numbers its cells (i, j, k), so neighbours are found by arithmetic and no connectivity table is stored: the book's 64 × 64 cavity grid is 4,096 such cells. It is cheap and accurate when lines follow the flow, but hard to fit around complex parts. An unstructured mesh (tetrahedra or polyhedra) fills any shape automatically and stores, for every face, the two cells it joins. Most industrial meshes are hybrid: prism layers on walls, tetrahedra or polyhedra in the core. Cell quality (aspect ratio, skewness, non-orthogonality) matters as much as count: see the Finite Element Analysis book's mesh quality interactive and the site's mesh quality calculator.

How do you refine a mesh, and how fast may cells grow?

h-refinement makes cells smaller, p-refinement raises the scheme's order, local refinement adds cells only in wakes or shear layers, and adaptive refinement lets an error indicator choose. Near walls, prism layers start at a first height h1 and grow by a ratio g, so n = ln(1 + T(g − 1)/h1)/ln g layers fill a thickness T. For the book's pipe (h1 = 39 µm for y+ 1) and T = 5 mm: 18 layers at g = 1.2 against 129 uniform cells. AIAA-style gridding guidelines (SPICES-2020) keep g below 1.25; sudden jumps in cell size add truncation error.

How do you prove a mesh is fine enough?

Celik et al. (2008): solve on three grids refined by r > 1.3 each, take a monitored value φ on each and find the observed order p from how the differences shrink. Richardson extrapolation then estimates the grid-converged value, and the grid convergence index GCI is a ±band on the finest result. For the book's cavity ψ_min on 16², 32², 64²: p = 2.00, extrapolated −0.10354, GCI = 0.94 %. The 64² value −0.10276 is within that band of the grid-converged answer; Ghia's 129² value is −0.1034.

The grid independence test: three meshes, the observed order, Richardson extrapolation and the grid convergence index: interactive loads as you scroll

What if the observed order looks wrong?

An order far from the scheme's formal one (0.7 or 4 for a second-order code) says the grids are not yet in the asymptotic range, the monitored value is polluted by iteration error or interpolation, or the solution oscillates between grids (the differences change sign; Celik's Table 1 has such a case). A check: GCI on the coarse pair divided by r^p times GCI on the fine pair should be near 1: 1.023 for the cavity. The duct by central differencing gives p = 2.01 and GCI = 0.017 %; its true error, 0.014 %, lies inside the band.

What is the difference between verification and validation?

In the AIAA guide's words, verification checks that a model implementation 'accurately represents the developer's conceptual description of the model and the solution to the model': are the equations solved right (grid and iteration error)? Validation checks 'the degree to which a model is an accurate representation of the real world': are they the right equations? Chapter 23's mixing-length pipe is verified (6,000 instead of 3,000 integration steps change the bulk speed by 0.0001 %) yet its friction coefficient is 10.5 % off: verified, not validated. Monitor quantities you care about (drag, pressure drop, peak temperature), not just residuals.

Predict, then check

Three grids with r = 2 give 0.500 (fine), 0.510 and 0.530 (coarse). What is the observed order p?

Worked examples

Grid convergence index of the book's cavity · Lid-driven cavity, Re 100, primary-vortex ψ_min = −0.09109 (16²), −0.10043 (32²), −0.10276 (64²); r = 2
  1. ε21 = φ2 − φ1 = 0.002332; ε32 = φ3 − φ2 = 0.009343
  2. p = ln(ε32/ε21)/ln 2 = 2.002 (r21 = r32, so no iteration is needed)
  3. φext = (2^p φ1 − φ2)/(2^p − 1) = −0.10354
  4. e_a = |(φ1 − φ2)/φ1| = 2.27 %; GCI = 1.25 × 0.02269/(2^p − 1) = 0.94 %

Answer: Observed order 2.00 (the scheme is second order) and GCI_fine = 0.94 %: ψ_min = −0.10276 ± 0.00097

Grid convergence of a drag coefficient · A 3-D car-mirror model (original numbers): Cd = 0.3412 on 9.6 million cells, 0.3440 on 3.5 million, 0.3492 on 1.2 million
  1. h ∝ N^(−1/3): r21 = (9.6/3.5)^(1/3) = 1.4; r32 = (3.5/1.2)^(1/3) = 1.429 (both above 1.3)
  2. ε21 = 0.0028, ε32 = 0.0052, same sign: monotonic convergence
  3. Fixed-point iteration of p = |ln(ε32/ε21) + q(p)|/ln r21: p = 1.61
  4. Cd,ext = 0.3373; e_a = 0.82 %; GCI_fine = 1.43 %

Answer: Cd = 0.3412 ± 1.4 % (extrapolated 0.3373)

How many prism layers? · The book's pipe, first cell 39 µm (y+ 1, cell-centred), layers to cover 5 mm
  1. g = 1.15: n = ln(1 + 0.005 × 0.15/0.00003903)/ln 1.15 = 21.51 → 22 layers; last cell 0.735 mm
  2. g = 1.2: n = 18 layers; last cell 0.866 mm
  3. Uniform 39 µm cells would need 129

Answer: 22 layers at g = 1.15 or 18 at g = 1.2, instead of 129 uniform cells

Chapter 26

Fluid-structure interaction: one-way and two-way coupling and the added-mass instability

Which syllabus covers thisAU not in syllabusVTU not in syllabusSPPU 402044F Unit 6 (fluid-structure interaction)MU not in syllabusKTU not in syllabus

One-way or two-way coupling?

One-way coupling solves the flow once, passes the wall pressures to a structural model and ignores how the structure's motion changes the flow: fine for a stiff bracket in wind. Two-way coupling exchanges forces and motion every time step: flutter, vortex-induced vibration of risers, heart valves, fuel sloshing, flexible hoses. In this chapter's piston model, one-way coupling leaves out the water's added mass entirely: with a 1 m water column (9.98 kg of fluid on a 5 kg piston) it predicts 10.07 Hz instead of the true 5.82 Hz.

Lagrangian, Eulerian and ALE: why does the fluid mesh move?

Structural codes are Lagrangian: the mesh moves with the material. Flow codes are Eulerian: the mesh stays fixed and fluid passes through it. Where a wall moves, the fluid mesh has to follow it. The ALE (arbitrary Lagrangian-Eulerian) method lets mesh nodes move with their own velocity, neither fixed nor attached to the fluid, and convects with the velocity relative to the mesh. If the piston here moved 10 mm and only the 2 mm cells beside it took the motion, they would invert; ALE smooths the 10 mm over the whole 1 m column, about 1 % per cell.

Monolithic or partitioned coupling?

A monolithic solver puts fluid and structure unknowns in one matrix: robust, but it needs a dedicated code. A partitioned scheme couples an existing CFD code and an existing finite element code. Each step, the structure's interface motion goes to the fluid (the Dirichlet side) and the fluid's interface force goes to the structure (the Neumann side), repeated until the two agree. That reuse is why most industrial FSI is partitioned. Its cost is sub-iterations: for the piston with ma/ms = 2.00, fixed relaxation ω = 0.5 needs 23.2 sub-iterations per step; Aitken needs 3.

What is the added-mass instability?

Fluid that must accelerate with a structure acts as extra mass ma. A partitioned pass computes the force from the last guess of the motion, so each pass multiplies the interface error by −ma/ms. Once the added mass exceeds the structure's own mass, the error grows and the run blows up. Smaller time steps do not help: in this model the limit is ma/ms = 1 at every step size (Causin, Gerbeau and Nobile, 2005). Light structures in dense fluids (arteries, thin panels in water) are the hard cases; 1 m of air gives ma/ms = 0.0024. Below the limit one pass is stable but damped: at ma/ms = 0.5 it loses 29 % of the amplitude in 3 periods.

Fluid-structure coupling: one-way and two-way, the added-mass instability of partitioned coupling and relaxation that cures it: interactive loads as you scroll

How do relaxation and Aitken cure it?

Under-relax the update: new guess = old + ω(computed − old). The error factor becomes 1 − ω(1 + ma/ms), so sub-iterations converge for ω < 2/(1 + ma/ms) and in one pass at ω = 1/(1 + ma/ms). For the default (ma/ms = 2.00, with the time step's small spring term) ω_opt = 0.338; ω = 0.5 gives a factor of −0.48, hence about 23 passes a step. Aitken's method (Küttler and Wall, 2008) estimates ω from the last two residuals. With one unknown it finds the optimum after one pass (3 passes a step); real interfaces with thousands of unknowns need more.

What is vortex-induced vibration lock-in?

A cylinder sheds vortices at f = St U/D with St ≈ 0.2 over a wide range of Re (chapter 21). When f approaches the structure's natural frequency fn, the shedding can lock on to the motion and the amplitude grows. Lock-in starts near a reduced velocity U/(fn D) = 1/St = 5 (our arithmetic from St). Example: a 60 mm pipe with fn = 4 Hz locks in near U = 5 × 4 × 0.06 = 1.2 m/s. Simulating it needs two-way coupling, a moving mesh and enough cycles to settle.

Predict, then check

A partitioned FSI run with one coupling pass per step blows up. Halving the time step will:

Worked examples

Added-mass ratio of a piston on a water column · A 2 kg piston of 80 mm bore closing a 0.6 m column of water at 20 °C (original numbers)
  1. A = π × 0.08²/4 = 5.027 × 10⁻³ m²
  2. ma = ρAL = 998.2 × 0.005027 × 0.6 = 3.011 kg
  3. ma/ms = 3.011/2 = 1.505 > 1: one pass per step multiplies the error by −1.51
  4. ω_opt = 1/(1 + 1.505) = 0.399

Answer: ma/ms ≈ 1.51: explicit coupling diverges; relax with ω ≈ 0.4 or use Aitken

Sub-iterations with a fixed relaxation factor · ma/ms = 1.5; interface error must fall by 10⁶ every time step; try ω = 0.3 and ω = 0.7
  1. ω = 0.3: factor = 1 − 0.3 × 2.5 = 0.25; passes = ln(10⁻⁶)/ln 0.25 → 10
  2. ω = 0.7: factor = 1 − 0.7 × 2.5 = −0.75; passes → 49 (oscillating)
  3. ω_opt = 1/2.5 = 0.4 gives a factor of 0: one pass

Answer: 10 passes at ω = 0.3, 49 at ω = 0.7; the converging range is 0 < ω < 0.8

Vortex-induced vibration of a pipe in a current · A 60 mm instrument pipe in a river, first natural frequency 4 Hz, St = 0.2
  1. Lock-in near U/(fn D) = 1/St = 5: U = 5 × 4 × 0.06 = 1.2 m/s
  2. At 0.8 m/s it sheds at f = 0.2 × 0.8/0.06 = 2.67 Hz, below fn

Answer: Expect large vibration as the current approaches about 1.2 m/s

Keep going

Recommended reading

  • An Introduction to Computational Fluid Dynamics: The Finite Volume Method, H. K. Versteeg and W. Malalasekera
  • Numerical Heat Transfer and Fluid Flow, S. V. Patankar
  • Computational Fluid Dynamics: The Basics with Applications, J. D. Anderson
  • Computational Methods for Fluid Dynamics, J. H. Ferziger, M. Perić and R. L. Street
  • Computational Fluid Dynamics and Heat Transfer, P. S. Ghoshdastidar
  • Turbulent Flows, S. B. Pope

How this book was made

Chapters follow the official syllabi listed above. Every interactive's formulas and every worked-example number were checked by script. Explanations, animations and examples are original to Skill-Lync.

From the exam to a core job

Talk to a counsellor.

Ask how CFD engineers use computational fluid dynamics on real projects, and what the PG Program in CFD covers.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.