Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 46 ยท Computational Fluid Dynamics

Chapter 8 overview: computational fluid dynamics

Learn the CFD workflow from geometry and mesh to solution and validation, the main numerical methods, and the hierarchy of RANS, LES and DNS.

Most flows that matter in engineering are far too complicated for pencil-and-paper solutions: air around a car, blood through a branching artery, coolant through a turbine blade, smoke in a burning building. Computational fluid dynamics (CFD) replaces the continuous equations with algebraic ones on a grid and solves them on a computer. It began in the 1960s with simple flows on mainframes, and today is a routine design tool that has replaced many wind-tunnel and water-tank tests, though it has not replaced the need for judgment about what the computer returns.

Five numbered cards: geometry, mesh, discretize, solve and check, with small drawings and arrows between them
The CFD workflow: five steps, each of which adds its own possible error.

What you will learn

  • The five steps of a CFD study and where errors come from.
  • The main discretization families: finite differences, finite volumes, finite elements.
  • The modeling hierarchy: DNS, LES, RANS.
  • The difference between verification and validation.

Key terms

  • Mesh (grid): the set of points or cells where the solution is computed.
  • Discretization: replacing derivatives by algebraic differences on the mesh.
  • Convergence: the iterative solution stops changing (iterative) or the answer stops changing as the mesh is refined (grid).
  • Verification: checking that the equations are solved correctly.
  • Validation: checking that the equations model the real flow.

The workflow

  1. Geometry

Define the domain Body, walls, inlet, outlet
Simplify Drop details that don't matter
1 / 5

Geometry and boundary conditions. Decide what part of the world you simulate and what happens at its edges: velocity or pressure at inlets and outlets, no-slip walls, symmetry planes. Wrong boundary conditions are among the most common sources of wrong answers.

Mesh. Cells must be small where the solution changes quickly (boundary layers, shear layers, wakes). For a turbulent wall flow the first cell should be placed according to y+ (lesson on the law of the wall), either y+ โ‰ˆ 1 to resolve the sublayer or y+ of 30 to 300 to use wall functions.

Discretization. Three families dominate. Finite differences replace derivatives by differences between grid values; they are simple and common on structured grids, and they are what we use in the next lessons. Finite volumes integrate the conservation laws over each cell and balance fluxes through its faces, which makes conservation exact by construction; most commercial and open-source CFD codes (including OpenFOAM) use this. Finite elements use basis functions over each element and are more common in structural mechanics and in some flow codes.

Solution. The result is a large system of algebraic equations, often with millions of unknowns, solved iteratively. Convergence is monitored through residuals, the amount by which the current solution fails to satisfy the discrete equations.

The modeling hierarchy

Chapter 6 explained that resolving all turbulent scales costs Re^(9/4) grid points. CFD therefore has three levels of ambition:

Approach What is computed Cost Typical use
DNS all scales, no model extreme research at low to moderate Re
LES large eddies; small scales modeled high unsteady flows, acoustics, mixing
RANS the mean flow; all turbulence modeled low routine engineering design

Verification and validation

Two questions must be answered separately. Verification: does the code solve the equations correctly, with small enough numerical error? You test with exact solutions (Poiseuille flow, chapter 5) and with systematic grid refinement. Validation: do the equations, with the chosen turbulence model and boundary conditions, represent the real flow? You test by comparing with experiments. A simulation can be well verified and poorly validated, and the other way round.

Common misconceptions

  • "Beautiful colored plots mean a correct answer." Plots look good even when the solution is wrong. Only verification and validation give confidence.
  • "A finer mesh is always better." A finer mesh reduces discretization error but can raise cost enormously, and cannot fix a wrong model or boundary condition.
  • "CFD replaces experiments." It complements them; real designs still use tests to validate the model.

Try it

Python A 25-line CFD solver: diffusion in one dimension

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Mesh resolution: how many cells do you need?

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does verification test?

    Verification checks numerical correctness, for example against exact solutions and grid refinement. Comparing with experiment is validation.
  2. 2. Which discretization family conserves fluxes exactly cell by cell by construction?

    Finite-volume methods balance the fluxes through each cell face, so what leaves one cell enters its neighbor.
  3. 3. Which approach models all of the turbulence?

    RANS solves for mean quantities and models the Reynolds stress; LES models only the small scales and DNS none.
  4. 4. What are residuals?

    Residuals show convergence of the iteration. They say nothing about whether the model is right.

Summary

  • A CFD study is geometry, mesh, discretization, solution and checking; every step adds error.
  • Finite differences, finite volumes and finite elements are the main discretization families.
  • DNS, LES and RANS trade cost against resolved physics.
  • Verification checks the solution of the equations; validation checks the equations against reality.

Next: Finite differences for advection and diffusion