Computational fluid dynamics
How computational fluid dynamics solves the Navier–Stokes equations numerically, with turbulence models, to predict flow, heat and mass transfer around and inside engineered and natural systems.
What it is
Computational fluid dynamics (CFD) uses numerical methods and computers to predict how liquids and gases move, and how they transport heat, species and momentum. It solves the equations of fluid mechanics on a computational mesh, giving velocity, pressure, temperature and concentration fields everywhere in the domain, including regions where measurements are difficult. CFD is used in aerospace (wings, engines), automotive (drag, cooling), energy (turbines, combustion, nuclear), buildings and HVAC, chemical reactors and mixers, biomedical flows (blood in arteries, airways), electronics cooling, weather and ocean modeling, and sports engineering.
It answers questions such as: What is the drag or lift on this shape? How uniform is the temperature in this heat exchanger or room? Where do recirculation zones or hot spots form? How does a pollutant disperse? What happens if the design is changed? CFD lets engineers test many designs virtually, but needs careful choice of models and validation, since a pretty picture is not automatically a correct one.
Fundamentals
Governing equations
Fluid motion is governed by conservation of mass, momentum and energy. For an incompressible Newtonian fluid with constant properties, the Navier–Stokes equations are ∇·u = 0 and ρ(∂u/∂t + u·∇u) = −∇p + μ∇2u + f, where u is velocity, p pressure, ρ density, μ dynamic viscosity and f body forces such as gravity. Energy and species transport add equations of the advection–diffusion type, and compressible flow adds density variation through an equation of state. The Reynolds number, Re = ρ U L/μ, compares inertial and viscous forces: low Re (below about 2,000 in a pipe) gives smooth laminar flow, and high Re gives chaotic turbulence with eddies over a wide range of sizes. Other key numbers are the Mach number (compressibility, important above about 0.3), Prandtl, Rayleigh and Péclet numbers. The equations are discretized mainly by the finite volume method (see finite volume method), and sometimes by finite elements, finite differences or lattice Boltzmann methods (see lattice Boltzmann).
Turbulence modeling
Resolving all turbulent scales, direct numerical simulation (DNS), needs a number of grid points that scales roughly as Re9/4 in space, which is prohibitive for engineering Reynolds numbers, so models are used:
- RANS (Reynolds-averaged Navier–Stokes): averages the equations in time, so turbulence appears as Reynolds stresses −ρ⟨u′iu′j⟩, which must be modeled. Eddy-viscosity models relate them to the mean strain through μt: Spalart–Allmaras (aerodynamics), k–ε (free flows, with wall functions) and k–ω SST (good for boundary layers and separation) are standard. RANS is the industrial workhorse, with the lowest cost, but struggles with strong separation and unsteady flows.
- LES (large-eddy simulation): resolves large eddies and models only the small ones through a subgrid-scale model (Smagorinsky, dynamic or WALE). It is far more accurate for unsteady flows but several orders of magnitude costlier near walls.
- Hybrid RANS–LES (DES, DDES) uses RANS near walls and LES in separated regions.
Near walls, either the mesh resolves the viscous sublayer (y+ ≈ 1) or wall functions bridge it (30 < y+ < 300), where y+ = uτ y/ν with friction velocity uτ.
Meshing and numerical settings
The mesh controls accuracy and cost. Rules of practice: refine in boundary layers (prism layers with growth ratio about 1.1–1.3), wakes, shear layers and regions of strong gradients; keep cells smooth, with low skewness and non-orthogonality; and use enough cells to capture the geometry. Meshes may be structured, unstructured, polyhedral or hybrid, with adaptive refinement. Discretization schemes should be at least second-order for production runs, with bounded convection schemes. Steady problems are solved by iteration to convergence, and transient problems by time stepping with a Courant number around or below 1 for accuracy (explicit) or a time step resolving the physical time scale (implicit, typically 10–100 steps per characteristic period). Pressure–velocity coupling (SIMPLE, PISO, coupled) and boundary conditions (velocity or mass-flow inlet, pressure outlet, no-slip wall, symmetry, periodic) must be chosen carefully, with inlet turbulence intensity and length scale specified, and the domain made large enough that boundaries do not distort the flow (for external aerodynamics, often 5–10 body lengths upstream and 10–20 downstream).
Verification, validation and uncertainty
Credible CFD requires verification (are the equations solved correctly?), through grid-convergence studies on three or more systematically refined meshes, with Richardson extrapolation and the grid convergence index (GCI), time-step studies, and iterative-convergence checks, and validation (are the right equations solved?), by comparing with experiments such as wind-tunnel data, PIV or LDV (see wind tunnel testing, particle image velocimetry, laser Doppler velocimetry) or benchmark cases. Check integral balances (mass and energy imbalance below about 1%) and monitor quantities such as lift, drag or outlet temperature, not just residuals. Uncertainty comes from the turbulence model, boundary conditions, geometry and numerics, and best-practice guidelines (ERCOFTAC, AIAA, ASME V&V 20, NASA) provide checklists.
Software, hardware and trends
Commercial tools include ANSYS Fluent and CFX, Siemens STAR-CCM+, COMSOL, Simcenter and Autodesk CFD; open-source options include OpenFOAM, SU2, Code_Saturne and Nek5000.
Typical applications and limits
Applications are listed above; limits include model uncertainty (especially turbulence, transition and combustion), the cost of LES and DNS, dependence on mesh and boundary conditions, and the need for expert judgment about what is realistic.
Basic operation
- Define goals and physics. Decide the quantities of interest and whether flow is laminar, turbulent, compressible or reacting.
- Prepare geometry. Clean the CAD model, simplify unimportant details and define the fluid domain.
- Generate the mesh. Add boundary-layer and local refinement, and check mesh quality.
- Set up the physics. Choose models, fluid properties, boundary and initial conditions, and numerical schemes.
- Solve. Run steady or transient simulations, watching residuals and monitors.
- Verify. Test mesh and time-step independence and check balances.
- Validate and post-process. Compare with data, then plot fields, streamlines and integral results.
- Collect the output. You obtain flow, thermal and force results; turbulence model choice and mesh studies are covered in the video.
Good practice
- Estimate first. Calculate Reynolds number and expected values by hand.
- Match the turbulence model to the flow. Justify the choice.
- Keep y+ consistent. Match mesh to the wall treatment.
- Demonstrate mesh independence. Report grid-convergence results.
- Validate against measurements. Use experiments or benchmarks.
- Report uncertainty and limits. State assumptions, since decisions about safety, such as fire, ventilation or aerodynamics, require validated models and expert review.
Key terms
- Navier–Stokes equations — the equations describing momentum conservation in a viscous fluid.
- Reynolds number — the ratio of inertial to viscous forces.
- RANS / LES / DNS — turbulence approaches from fully modeled to fully resolved.
- y+ — a dimensionless distance from the wall used to select wall treatment.
- Boundary layer — the thin region near a wall where velocity changes from zero to the free stream value.
- Grid convergence index — a measure of discretization error from mesh refinement.
- Wall function — a model bridging the near-wall region without resolving it.
Video coming soon
About five minutes on Computational fluid dynamics: how it works in detail, how the data is acquired, and how it is analyzed.
More in 4.2 Computational Modeling and Simulation
- Density functional theory (DFT)
- Ab initio methods (Hartree-Fock, post-HF)
- Semi-empirical/DFTB
- Molecular dynamics
- Coarse-grained modeling
- QM/MM
- Monte Carlo
- Kinetic Monte Carlo
- Finite element analysis
- Finite difference method
- Finite volume method
- Computational fluid dynamics
- Discrete element method
- Lattice Boltzmann
- Phase-field modeling
- FDTD
- Multiscale modeling
- CALPHAD
- Topology optimization
- Reduced-order modeling
- Digital twins
- Agent-based modeling
- System dynamics
- Climate modeling (GCM/RCM)
- Hydrological modeling
- Species distribution modeling
- SPICE circuit simulation
- TCAD device simulation
- EM simulation
- MIMO/OFDM simulation
- Power system load-flow and stability analysis
- Quantum circuit design and simulation
