MEC Lecture · Computational Fluid Dynamics

Pretty Convincing?

My Opinionated Introduction to CFD

Presenter Professor Andrew Garrard MEng(hons) PhD CEng FIMechE PFHEA
Details MAC118
8 August 2026

What we will learn today

By the end of this lecture you will be able to:

  1. Outline how CFD developed into its current state of the art
  2. Explain why and how CFD is used alongside experiment and theory
  3. Describe the steps involved in simulating a fluid flow numerically
  4. Relate broad CFD concepts to the applications in the tutorials

Introduction

CFD stands for

  • C - Computational
  • F - Fluid
  • D - Dynamics

Computational fluid dynamics (CFD) is a branch of both fluid mechanics and computational physics that uses numerical analysis and data structures to analyze and solve problems that involve flows.

Wikipedia, "Computational fluid dynamics"

Alternatively

Colours for Directors

a.k.a

"The Beautiful Lie"

Contemporary uses of CFD

A simulation to determine safety for Urban Air Mobility.

A single two-bladed rotor hovering above a grey ground plane, surrounded by a dense tangle of thin blue vortex tubes that spread out across the ground, with brighter green and magenta rings trailing just below the rotor tips.
Hovering quadcopter rotor in ground effect. Image: Patricia Ventura Diaz and D-G Caprace, Tim Sandstrom. NASA/Ames.

Watch the simulations on the NASA page

A history of CFD

Fluid mechanics before computers

Two separate circles, one labelled empirical and one labelled theory, with nothing between them.
From the 17th to the 19th century, fluid mechanics was split into two disciplines.

Early CFD

The same two circles, now overlapping, with CFD occupying the region where they meet.
CFD arrives, and it is not well defined as either theory or experiment.

A third way

Empirical, theory and CFD as three circles, each joined to the other two by a double-headed arrow.
Three fields of fluid mechanics, of equal importance, each informing the others.

Driving and bottlenecking CFD progress

A log-scale chart of transistor counts per chip from 1970 to 2020, climbing in a near-straight line.
Moore's law. Via Wikimedia Commons.

Commercial computers

A Cray Y-MP supercomputer, a dark angular cabinet standing in a machine room.
A Cray Y-MP. ~1988: ~2.5 GFLOPS, ~20 million USD, ~55 million now USD. NASA Goddard, via Wikimedia Commons.
A Dell Latitude D630 laptop, open on a plain background.
A Dell Latitude D630. Core 2 Duo PC, ~2008: ~25 GFLOPS, ~1,000 USD, ~1,500 USD now. Via Wikimedia Commons.

Pushing boundaries in fluid mechanics

A slender dart-shaped vehicle streaking through high cloud, its leading edges glowing orange with the heat of the airflow.
A Lockheed Martin hypersonic vehicle.

Pushing boundaries in fluid mechanics

A flow visualization of NASA’s X‑59 supersonic, low-boom aircraft concept.
A flow visualization of NASA’s X‑59 supersonic, low-boom aircraft concept. This computational fluid dynamics simulation, produced on the Pleiades supercomputer using the NAS-developed Launch Ascent and Vehicle Aerodynamics (LAVA) code, will be used to help determine which components contribute to the pressure signatures below the aircraft that create the sonic boom in flight. Red and blue represent high and low pressure, respectively; the symmetry plane—which bisects the vehicle along its center line—is colored by Mach number. James Jensen, NASA/Ames.

https://nas.nasa.gov/pubs/stories/2021/feature_X-59.html

Wind tunnels

The most powerful wind tunnel in the world.

The JF-22 hypersonic wind tunnel at the Chinese Academy of Aerodynamics. Pandaily, https://pandaily.com/jf22-hypersonic-wind-tunnel-10km-jul2026, obtained 2026-09-11.

A couple of issues with wind tunnels

Power

The JF-22 uses 15 GW of power.

A Rolls-Royce Trent XWB turbofan, cut away along its length.
180 × Trent XWB engines.
Iron Man in flight in his red and gold armour.
5 × Iron Men.

Scale

The JF-22 has a working section of 4 m.

Real planes are bigger than 4 m across.

$$Re = \frac{\rho V L}{\mu}$$

The run time is less than 120 ms.

Why use CFD?

  • Cheaper
  • Safer
  • Unphysical problems
  • Complete dataset
  • Data after experiment
  • Increasingly automated

But...

  • No exact solution
  • No idea if the answer is correct – "black box engineering"
  • Good for some situations, not for others - this requires some wisdom

Why I like CFD

  • I can work independently
  • Easy "what if" scenarios
  • Work from anywhere

Numerical experiment

CFD can be a portable, cheap wind tunnel.

Numerical experiment

  • Used to test a model, theory or hypothesis.
  • Fewer factors are outside your control than in a physical experiment, but not none.
  • Error will occur and has to be understood and accounted for.
  • Good experimental design needs to be performed before starting.
  • Experiments should adhere to the scientific method.
  • Focus should always be maintained on the reasons for conducting the experiment.

Something for everyone

Seven stacked bars from engineering application at the top down to hardware.
The CFD stack: every answer rests on six layers the engineer never sees.

Some of my work

  • Simulation of a "personal cloud"
  • Prediction of smoke ingress and movement in offshore installations
  • GRP spraying of boat hulls
  • Electric motor cooling
  • Fuel cell electrochemical modelling
Cutaway of a motor with coloured streamlines through the windings and velocity vectors fanning past the rotor poles.
Cooling and windage loss in a switched reluctance motor.
Three stages side by side: a bare cylindrical manifold, streamlines spiralling along it, then a dense vector field.
Swirl in a fuel cell stack manifold.

Commercial software

In the recent past

Dedicated CFD platforms

  • Fluent
  • CFX
  • STAR-CD
  • COMSOL (general)
  • OpenFOAM (open source)

Now

Large multiphysics packages

  • Ansys (Synopsys)
  • Dassault Systèmes
  • CAD bolt-ons (not very good)
  • COMSOL (general)
  • OpenFOAM (open source)

At Sheffield we use Ansys Fluent.

Fluent started in Sheffield

A crowded, brightly coloured painting of Sheffield: Victorian buildings, a pub, a tram, a football match in the foreground, and the white Fluent offices flying international flags at the back.
Joe Scarborough's painting of Fluent Europe's Sheffield, commissioned in 2000.

How CFD works

From equations to numbers.

The Navier–Stokes equations

Conservation of mass

$$\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0$$

Conservation of momentum, in $x$, $y$ and $z$

$$\rho\left(\frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} + w\frac{\partial u}{\partial z}\right) = -\frac{\partial p}{\partial x} + \mu\left(\frac{\partial^{2} u}{\partial x^{2}} + \frac{\partial^{2} u}{\partial y^{2}} + \frac{\partial^{2} u}{\partial z^{2}}\right) + \rho g_{x}$$

$$\rho\left(\frac{\partial v}{\partial t} + u\frac{\partial v}{\partial x} + v\frac{\partial v}{\partial y} + w\frac{\partial v}{\partial z}\right) = -\frac{\partial p}{\partial y} + \mu\left(\frac{\partial^{2} v}{\partial x^{2}} + \frac{\partial^{2} v}{\partial y^{2}} + \frac{\partial^{2} v}{\partial z^{2}}\right) + \rho g_{y}$$

$$\rho\left(\frac{\partial w}{\partial t} + u\frac{\partial w}{\partial x} + v\frac{\partial w}{\partial y} + w\frac{\partial w}{\partial z}\right) = -\frac{\partial p}{\partial z} + \mu\left(\frac{\partial^{2} w}{\partial x^{2}} + \frac{\partial^{2} w}{\partial y^{2}} + \frac{\partial^{2} w}{\partial z^{2}}\right) + \rho g_{z}$$

$u$, $v$, $w$ velocity components · $p$ pressure · $\rho$ density · $\mu$ dynamic viscosity

Solving the Navier–Stokes equations

The Navier–Stokes equations cannot be solved analytically.

Despite what Sam Altman says

Screen grab of BBC News from 8 September 2026, showing Sam Altman's face as the cover image and the headline "OpenAI says it cracked 90-year-old maths problem in 88 hours". https://www.bbc.co.uk/news/articles/cy7zygy3rl2o, 8 September 2026.
OpenAI didn't solve the Navier–Stokes equations. From BBC News, https://www.bbc.co.uk/news/articles/cy7zygy3rl2o, 8 September 2026.

Basic conservation equation

A control volume drawn as a dashed blob, with an arrow bringing mass in across the boundary on the left and an arrow carrying mass out across it on the right, and the change of mass inside written in the middle.
Mass is conserved. The mass entering across the boundary minus the mass leaving across it is the mass accumulated inside.
The same control volume with momentum crossing the boundary in on the left and out on the right, three further arrows pressing inward on the boundary to represent forces, and the change of momentum inside written in the middle.
Momentum is also conserved in the same way, but has a third route in: forces on the boundary.

Discretising

Typical CFD simulation workflow

Eight green boxes in a column joined by downward arrows: create geometry, mesh geometry, define physics (energy, turbulence, species), define boundary conditions, define initial conditions, select solver and settings, run solver (and wait), post-process results.
The steps of running a CFD simulation.

The more holistic CFD simulation workflow

Six boxes in a column joined by downward arrows: determine the aim, determine the modelling strategy, actually do the CFD (the only green box), analyse the results, check the results are right, perform alternative tests. An arrow loops from the last box back up to the modelling strategy.
Running the simulation is one step of six in a CFD study.

The complete CFD simulation workflow

The six-step study on the right and the eight-step simulation pipeline on the left, with two faint lines fanning out from the green 'actually do the CFD' box to the top and bottom of the pipeline, showing that the whole pipeline sits inside that one step.
The whole simulation pipeline is one box in the study.

Geometry creation

This is basically CAD. But the fluid needs to be created, not (necessarily) the solid.

A grey three-dimensional rocket beside a cutaway blue air enclosure with an identical rocket-shaped cavity. An arrow says to create an enclosure and subtract the rocket. The air is labelled as the volume to mesh, and the rocket surface as the wall boundary.
To predict drag, mesh the air surrounding the rocket. The rocket’s surface forms a boundary of the fluid domain.

Meshing

Meshing is the task of dividing the geometry into many small "elements".

A rectangular block of fluid meshed with irregular grey triangular and tetrahedral cells, cut away to show a sphere inside it. The cells are small and tightly packed around the sphere, with thin layers wrapped around its surface, and larger further away.
A tetrahedral mesh around a sphere, with inflation layers at its surface.
  • The quality of the mesh has a dramatic impact on the results produced by the simulation.
  • Meshing is becoming an increasingly automated process.

Pre-processing

The mesh divides the fluid into cells. We now set up the calculation:

  • Which physics? Turbulence, heat transfer, chemical reactions.
  • Which fluid? Air, water, and its material properties.
  • What happens at the boundaries? Flow entering, flow leaving, solid walls.
  • How should the calculation run? Solution methods and solver settings.

Each of these decisions will have an impact on the result of the simulation.

The same mesh can be used for different calculations by changing these choices.

Solved by numerical methods

  • Some equations can be solved analytically.

  • Any question where the function of the unknown variable produces a known result can be solved numerically.

  • For example $$x = \cos x$$ $$\cos x-x = 0$$

  • Use a "predictor-corrector" method. $$r_n = \cos x_n - x_n$$

  • where $r_n$ is the residual.

Predictor-corrector

Start between $0$ and $1$; keep the half with a sign change. Angles are in radians.

Guess Calculation Residual New guess
$0.5$ $\cos(0.5) - 0.5 =$ $+0.3776$ $0.75$
$0.75$ $\cos(0.75) - 0.75 =$ $-0.0183$ $0.625$
$0.625$ $\cos(0.625) - 0.625 =$ $+0.1860$ $0.6875$
$0.6875$ $\cos(0.6875) - 0.6875 =$ $+0.0853$ $0.71875$
$0.71875$ $\cos(0.71875) - 0.71875 =$ $+0.0339$ $0.734375$
$0.734375$ $\cos(0.734375) - 0.734375 =$ $+0.0079$ $0.742188$
$0.742188$ $\cos(0.742188) - 0.742188 =$ $-0.0052$ $0.738281$
$0.738281$ $\cos(0.738281) - 0.738281 =$ $+0.0013$ $0.740234$
  • For most practical flows, the Navier–Stokes equations have no known analytical solution, so we solve them approximately using numerical methods.

Residuals

A logarithmic CFD residual plot with seven distinctly coloured curves falling over successive iterations and levelling off at separated magnitudes. Each curve is labelled beside its endpoint. Continuity stays highest and energy falls lowest.
Residuals fall as the solver iterates, then level off at different magnitudes.

Post-processing

What you think a valuable result from CFD is

Coloured streamlines sweeping past a sphere whose surface is shaded from blue on one side to red on the other.
Pictures: streamlines and surface colouring for flow past a sphere.

What an actually valuable result from CFD is

Ansys Fluent's force report for the sphere, with the total force of -0.148 N circled in red.
Numbers: Fluent's force report, with the total drag on the sphere circled.

Validation

Validation checks whether the simulation gives the right answer.

But what does “right” mean?

The answer predicts what would happen if the simulated conditions existed in the real world.

  • Simulations consist of assumptions, estimations, decisions (Mesh, models, physics and numerics) which all influence the answer.
  • The simulation will merrily and convincingly generate you an answer.
  • Just like analytical calculations, web searches, AI output, you need to check what is being produced is correct.

A convincing answer still needs validation.

You are liable.

THE ENTIRE RISK ARISING OUT OF THEIR USE REMAINS WITH THE RECIPIENT. IN NO EVENT SHALL ANSYS AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY DIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE OR OTHER DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, OR LOSS OF BUSINESS INFORMATION), EVEN IF ANSYS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

https://ansys.synopsys.com/legal/legal-notices

How to validate CFD results.

Compare the simulation result to

  • Experimental results (not necessarily yours)
  • Theoretical result (that has been validated)
  • Another CFD result (that has been validated)

If the result of the simulation is already known to validate against, why do the CFD simulation in the first place?

Summary

  • CFD complements theory and experiment; all three inform each other.
  • Computing advances have made CFD more accessible for numerical experiments.
  • Start with an engineering question and plan the study before simulating.
  • The steps in the workflow for a CFD simulation:
    • Geometry creation: define the fluid domain.
    • Meshing: divide it into cells; mesh quality affects the results.
    • Pre-processing: choose physics, fluid properties, boundaries and solver settings.
    • Solving: solve conservation equations numerically and monitor residuals.
    • Post-processing: extract useful engineering quantities, such as drag.
    • Validation: check against real-world evidence before trusting a convincing answer.