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.
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.
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.
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
- Define the question, domain boundary, coordinates, reference pressure, property basis, and required outputs before meshing.
- Estimate Reynolds, Mach, Froude, and thermal regimes to choose incompressible, compressible, laminar, turbulence, energy, or interface models.
- Specify physically compatible inlet, outlet, wall, symmetry, initial, and reference conditions without overconstraining the equations.
- Monitor residuals and engineering outputs, then audit global mass, energy, and momentum balances.
- Repeat on systematically refined meshes and time steps; validate separately against appropriate experiments and report uncertainty.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.