Fluid Mechanics · Chapter 15
Fluid Mechanics · Chapter 15

Introduction to Computational Fluid Dynamics

CFD solves the governing equations numerically, opening up flows far too complex for pencil and paper. This closing chapter lays out the fundamentals — meshing, boundary conditions, and the crucial discipline of verification and validation — then surveys the added challenges of turbulent, heat-transfer, compressible, and free-surface simulations.

Chapter Objectives

  • Translate a physical system into a computational domain, models, and boundary conditions.
  • Distinguish iterative convergence, discretization verification, and experimental validation.
  • Quantify conservation imbalance and estimate observed grid convergence.
  • Select laminar, turbulence, thermal, compressible, or free-surface models by regime.
  • Report numerical uncertainty without portraying educational verification as certification.
Section 15–1

Introduction & Fundamentals

Computational fluid dynamics solves the governing equations numerically, on a computer, for flows too complex for analytical methods. Anyone can run a CFD code — but the results are only as trustworthy as the mesh, the models, and the boundary conditions behind them.

What CFD Does

CFD discretizes the continuity and Navier–Stokes equations over a grid of small cells, replacing the continuous partial differential equations with a large system of algebraic equations solved iteratively for velocity, pressure, and other fields at every cell.

Finite-volume conservation statement
\[ \frac{d}{dt}\int_{CV}\rho\phi\,dV+\int_{CS}\rho\phi\,\mathbf{V}\!\cdot\!\mathbf{n}\,dA=\int_{CS}\Gamma_\phi\nabla\phi\!\cdot\!\mathbf{n}\,dA+\int_{CV}S_\phi\,dV \]

The Mesh (Grid)

The domain is divided into cells — structured (orderly rows) or unstructured (irregular, flexible for complex geometry). Solution accuracy hinges on mesh quality: cells must be small where gradients are steep (near walls and in wakes), and badly shaped or coarse cells corrupt the result regardless of the solver.

Boundary Conditions

Every solution is dictated by its boundary conditions: prescribed velocity or pressure at inlets and outlets, the no-slip condition at walls, and symmetry or periodic conditions where geometry allows. Wrong boundary conditions produce a converged but physically meaningless answer.

Verification vs. validation: iterative convergence asks whether the algebraic solve has settled; discretization verification asks whether mesh and time-step error are controlled; validation compares the chosen mathematical model with trustworthy measurements. None of these activities alone certifies a product or design.
coarse mesh (far field) refined mesh near the body
Figure 15–1. A computational mesh is refined where flow gradients are steep — near and around a body — and coarse in the far field to save computation. (Original schematic.)

Physical meaning

Each cell is a small control volume. Flux leaving one interior face must enter its neighbor, so global mass, momentum, and energy audits expose setup or convergence errors that a smooth contour can hide. Coordinates and outward face normals define every flux sign.

Problem-solving strategy

  1. Define the question, domain boundary, coordinates, reference pressure, property basis, and required outputs before meshing.
  2. Estimate Reynolds, Mach, Froude, and thermal regimes to choose incompressible, compressible, laminar, turbulence, energy, or interface models.
  3. Specify physically compatible inlet, outlet, wall, symmetry, initial, and reference conditions without overconstraining the equations.
  4. Monitor residuals and engineering outputs, then audit global mass, energy, and momentum balances.
  5. Repeat on systematically refined meshes and time steps; validate separately against appropriate experiments and report uncertainty.
EXAMPLE 1Outlet mass-balance audit
A steady incompressible CFD model of water at \(20^\circ\text{C}\) reports inlet flow \(0.0800\ \text{m}^3/\text{s}\), outlet A \(0.0490\ \text{m}^3/\text{s}\), and outlet B \(0.0306\ \text{m}^3/\text{s}\). Quantify imbalance.

Recognition strategy

Multiple boundary fluxes and a steady incompressible statement call for a global control-volume mass audit, not merely a residual inspection.

Given information

  • Solver-reported \(Q_{\text{in}}=0.0800\), \(Q_A=0.0490\), and \(Q_B=0.0306\), all in \(\text{m}^3/\text{s}\).
  • Supplied \(\rho=998\ \text{kg}/\text{m}^3\) at \(20^\circ\text{C}\); outlet static gauge pressure is the zero reference.

Model and interpretation

The entire domain is a steady control volume; outward flux is positive, so inlet flux is negative. Incompressibility is approximate, flow is positive downstream, and no Mach or free-surface model is involved.

Step-by-step solution
1. Sum outlet volume flow. \(Q_{\text{out}}=0.0490+0.0306=0.0796\ \text{m}^3/\text{s}\).
2. Form signed defect. \(\Delta Q=Q_{\text{out}}-Q_{\text{in}}=-0.0004\ \text{m}^3/\text{s}\), indicating reported outflow is low.
3. Normalize the defect. \(\epsilon_m=|\Delta Q|/Q_{\text{in}}\times100=0.500\%\).
4. Convert to mass rate. \(\rho|\Delta Q|=(998)(0.0004)=0.399\ \text{kg}/\text{s}\) of unresolved balance.

Verification

Units: Volume-flow differences retain \(\text{m}^3/\text{s}\), multiplication by density produces \(\text{kg}/\text{s}\), and normalized imbalance is dimensionless.

Signs and direction: With outward-positive normals, the net signed flux is \(-0.0004\ \text{m}^3/\text{s}\); the negative sign means less reported outflow than inflow.

Plausibility: The outlets account for \(99.5\%\) of inlet flow. Whether \(0.500\%\) is acceptable depends on the study’s declared accuracy target and sensitivity, not a universal threshold.

Final result: Signed volume imbalance is \(-4.00\times10^{-4}\ \text{m}^3/\text{s}\), or \(0.500\%\) in magnitude.

Engineering interpretation

This audit flags numerical or reporting error for investigation; it does not establish mesh independence, energy conservation, physical validation, or certification of the model.

Section 15–2

Laminar CFD Calculations

The Most Tractable Case

Laminar, steady, incompressible flow is where CFD is most reliable: the equations are solved directly with no turbulence model, so results closely match analytical and experimental data when the mesh is adequate. It is the natural setting for checking grid independence.

Grid independence is not established by one refinement. Use a consistent refinement ratio, compare the same integrated quantity, reduce iterative error below the observed grid change, and examine whether convergence is monotonic. Geometry and boundary-condition placement must remain comparable.

EXAMPLE 2Observed spatial order
Three systematically refined steady meshes with size ratio \(r=2\) predict pressure drop \(112.0\), \(118.0\), and \(119.5\ \text{Pa}\) from coarse to fine. Estimate observed order and extrapolated value.

Recognition strategy

Three solutions on a constant refinement ratio permit an observed-order check and Richardson extrapolation because changes are monotonic.

Given information

  • Computed \(\phi_3=112.0\ \text{Pa}\), \(\phi_2=118.0\ \text{Pa}\), \(\phi_1=119.5\ \text{Pa}\), with \(r=2\).
  • Air properties are held at a supplied \(300\ \text{K}\), inlet total pressure is absolute, and reported pressure drop is a positive static-pressure difference.

Model and interpretation

The domain, models, and boundary conditions are unchanged; characteristic cell size halves each refinement. Flow is \(x\)-positive. Richardson analysis is approximate and assumes asymptotic, monotonic spatial convergence.

Step-by-step solution
1. Compare differences. \(\phi_1-\phi_2=1.5\ \text{Pa}\) and \(\phi_2-\phi_3=6.0\ \text{Pa}\), which share sign and indicate monotonic convergence.
2. Estimate order. \(p=\ln[(\phi_2-\phi_3)/(\phi_1-\phi_2)]/\ln r=\ln(4)/\ln(2)=2.00\).
3. Extrapolate. \(\phi_{\text{ext}}=\phi_1+(\phi_1-\phi_2)/(r^p-1)=119.5+1.5/(4-1)=120.0\ \text{Pa}\).
4. Quantify fine-grid difference. \(|120.0-119.5|/120.0\times100=0.417\%\), excluding an added safety factor.

Verification

Units: Ratios inside logarithms are dimensionless, observed order has no units, and extrapolated pressure retains pascals.

Signs and direction: Positive pressure drop is defined from inlet to outlet; successive predictions rise toward the extrapolated positive value without oscillation.

Plausibility: Each refinement reduces the solution change by four, exactly consistent with observed second-order behavior for \(r=2\); this supports educational discretization verification, not certification or validation.

Final result: Observed order is \(p=2.00\); extrapolated pressure drop is \(120.0\ \text{Pa}\), \(0.417\%\) above the fine result.

Engineering interpretation

The sequence is encouraging, but a formal uncertainty statement needs the organization’s selected procedure, mesh-quality evidence, iterative-error control, and review of other quantities of interest.

Grid Independence

A solution should not change meaningfully when the mesh is refined further. Establishing grid independence — running successively finer meshes until the result stops shifting — is the essential first credibility test of any CFD study.

Section 15–3

Turbulent CFD Calculations

The Turbulence Closure Problem

Turbulence spans a vast range of eddy sizes. Resolving all of them directly (DNS) is prohibitively expensive for most engineering flows, so the equations are time-averaged — producing the Reynolds-averaged Navier–Stokes (RANS) equations, which contain extra unknown stress terms that must be modeled.

Turbulence Models

Models such as \(k\text{-}\varepsilon\) and \(k\text{-}\omega\) supply the missing Reynolds stresses with additional transport equations. They are approximations calibrated to certain flow classes; no single model is best for all flows, so model choice is itself an engineering decision requiring judgment and validation.

Hierarchy of approaches: RANS (cheap, models all turbulence) → LES (resolves large eddies, models small ones) → DNS (resolves everything, research only). Cost climbs steeply with fidelity.

Compute Reynolds number using a defensible length and temperature-dependent properties before selecting closure. Near-wall resolution must match the chosen wall treatment; a familiar model name does not guarantee suitability for separation, swirl, buoyancy, or transition.

Section 15–4

CFD with Heat Transfer

Coupling the Energy Equation

When temperature matters, the energy equation is solved alongside continuity and momentum. If fluid properties (density, viscosity) depend on temperature, the equations couple and must be solved together — as in buoyancy-driven (natural-convection) flows, where temperature differences create the very motion being computed.

Energy conservation should be audited using enthalpy and heat/work fluxes. State whether properties are constant, Boussinesq, or fully temperature dependent, and report the thermal reference state used for enthalpy differences.

Section 15–5

Compressible-Flow CFD Calculations

Capturing Shocks

Compressible CFD must handle steep gradients and discontinuities — shock waves — without spurious oscillations. Density-based solvers and shock-capturing schemes, combined with local mesh refinement at the shock, are used to resolve these features accurately.

Estimate Mach number before choosing a density model. Shock calculations require conservative mass, momentum, and total-energy equations; compare upstream/downstream static and stagnation states and distinguish physical entropy increase from numerical smearing.

EXAMPLE 3Shock-state CFD verification target
A calorically perfect-air CFD case places a normal shock in a duct. Given upstream \(M_1=2.00\), \(p_1=60.0\ \text{kPa}\) absolute, \(T_1=250\ \text{K}\), and \(\gamma=1.40\), calculate reference downstream Mach and pressure.

Recognition strategy

A supersonic upstream state and normal shock call for exact one-dimensional Rankine–Hugoniot relations as an independent verification benchmark.

Given information

  • Supplied \(M_1=2.00\), \(p_1=60.0\ \text{kPa}\) absolute, \(T_1=250\ \text{K}\), \(\gamma=1.40\), and \(R=287\ \text{J}/(\text{kg}\!\cdot\!\text{K})\).
  • The duct axis \(x\) is positive downstream; walls are adiabatic and the ideal-gas caloric model is the stated property basis.

Model and interpretation

Use a steady one-dimensional control volume enclosing the shock. Mass, momentum, and total energy are exact for the ideal model; numerical CFD will smear the discontinuity over cells. Static and stagnation states remain distinct.

Step-by-step solution
1. Confirm regime. \(M_1=2.00>1\) is supersonic, so a normal shock can produce a subsonic downstream state.
2. Compute downstream Mach. \(M_2^2=[1+(\gamma-1)M_1^2/2]/[\gamma M_1^2-(\gamma-1)/2]=1.8/5.4=0.3333\), hence \(M_2=0.577\).
3. Compute static-pressure ratio. \(p_2/p_1=1+2\gamma(M_1^2-1)/(\gamma+1)=1+2(1.4)(3)/2.4=4.50\).
4. Resolve absolute pressure. \(p_2=(4.50)(60.0)=270\ \text{kPa}\) absolute; the static pressure rise is \(210\ \text{kPa}\).
5. Define CFD comparisons. Sample uniform states away from smeared cells and compare \(M_2\) and \(p_2\), while also checking equal mass flux and conserved stagnation temperature.

Verification

Units: Mach and pressure ratio are dimensionless; multiplying the ratio by upstream kilopascals produces downstream kilopascals absolute.

Signs and direction: Flow remains positive downstream, static pressure rises across the shock, and Mach falls below one; these directions match irreversible compression.

Plausibility: The result changes \(M=2.00\) to \(0.577\) while raising static pressure by a factor \(4.50\). Stagnation temperature should remain constant, stagnation pressure should decrease, and mass, momentum, and energy fluxes must balance.

Final result: Reference downstream state is \(M_2=0.577\) and \(p_2=270\ \text{kPa}\) absolute.

Engineering interpretation

Agreement away from the shock tests equations, boundary states, and post-processing; shock thickness is mesh-and-scheme dependent and educational verification is distinct from product certification.

Section 15–6

Open-Channel-Flow CFD Calculations

Tracking the Free Surface

Free-surface flows require locating an interface whose shape is part of the solution. Techniques such as the volume-of-fluid (VOF) method track the fraction of each cell occupied by liquid, letting the solver capture waves, jumps, and overtopping without a predefined surface.

VOF introduces interface-capturing and time-step sensitivities. Froude number, gravity direction, hydrostatic initialization, interface resolution, and phase mass conservation must be checked; a steady solver may be inappropriate for intrinsically unsteady waves.

Instructor Note

The one lesson to leave the course with: CFD is a tool, not an oracle. A colorful contour plot can be completely wrong. Always check grid independence, sanity-check against a hand calculation or known result, and treat turbulence-model output as an estimate, not truth. Garbage mesh and boundary conditions in, garbage out — no matter how impressive the visualization.

Chapter recap

  • CFD discretizes conservation laws; boundary conditions and regime-appropriate models define the physical question.
  • Iterative convergence, discretization verification, and experimental validation answer different questions.
  • Mass, momentum, energy, Mach, Froude, Reynolds, grid, and time-step audits make numerical results reviewable.

Before moving on

You should be able to define a domain and references, select a model by regime, quantify conservation error, conduct a systematic refinement comparison, distinguish static and stagnation shock states, and state why verified educational output is not certification.