Black FridayUpgrade your career this Black Friday. Get up to ₹60,000 Scholarship on IIT programsUp to ₹60K Black Friday Scholarship52 seats leftOffer ends Fri, 27 Nov, 11:59 pm IST.

Black Friday Scholarship – IIT Jammu & IIT Roorkee

The best Black Friday deal isn't a gadget. It's your next career move.

Get up to ₹60,000 Black Friday Scholarship on our PG programs with IIT Jammu and iHUB DivyaSampark, IIT Roorkee. IIT certification, 12 live sessions with IIT faculty and 100% placement assistance.

Only 52 seats left. Offer ends Fri, 27 Nov, 11:59 pm IST

3,905 engineers placed since 2019 · 1,276 hiring companies

By submitting you agree to our Terms and Privacy Policy.

Your free demo class is requested

Browse courses

How Does CFD Work? The Numerical Approach Explained with Worked Examples

What happens inside a CFD solver: how the flow equations become one algebraic equation per cell, why codes iterate instead of inverting the matrix, explicit vs implicit time steps and the SIMPLE pressure loop. With three calculations you can rerun: a heated plate solved four ways, a 1-million-cell storage count and an aluminium rod that blows up at the wrong time step.

How Does CFD Work? The Numerical Approach Explained with Worked Examples

CFD (computational fluid dynamics) works by turning the equations of fluid flow, which no one can solve by hand for a real shape, into millions of simple algebraic equations, one set for every small cell of a mesh, and then solving them over and over until they all balance. The numerical approach is that chain: discretise space and time, assemble a sparse matrix, iterate it with a linear solver inside a pressure-velocity loop, and check the result. This guide walks through each link with three small calculations you can rerun yourself.

In short

  • A solver never sees a derivative. It sees one equation per cell, of the form "my value depends on my neighbours' values", and a 1-million-cell 3D mesh gives a matrix in which only 0.0007% of the entries are non-zero (7 million of ).
  • How you solve that matrix decides your run time. On our 63 × 63 cell plate, Gauss-Seidel needed 3,866 sweeps to cut the error by a million; multigrid, the family Fluent and OpenFOAM use for pressure, needed 4 cycles.
  • Time-stepping has a speed limit. An explicit scheme on a 5 mm aluminium grid is stable only for s; at 0.154 s it swings between −79 °C and 180 °C after 16 steps. An implicit scheme ran stably with 1.25 s steps.
  • Incompressible flow has no equation for pressure, so codes iterate one out of the continuity equation: the SIMPLE loop (Patankar and Spalding, 1972) and its transient cousins PISO and PIMPLE.
  • Current tools (checked 23 Nov 2026): Ansys Fluent 2026 R1 extends its GPU solver to VOF with energy and sliding meshes; the free Ansys Student licence caps fluid models at 1 million cells.

Learn it hands-on: the Skill-Lync Introduction to CFD using MATLAB and OpenFOAM course has you write these solvers yourself before you use a commercial code. Compare every option on the CFD courses page, or talk to a Skill-Lync counsellor.

How does CFD work, step by step?

Every CFD code, from Ansys Fluent to OpenFOAM, runs the same six-step chain: write the conservation equations, split the domain into cells, convert the equations into one algebraic equation per cell, assemble those into a sparse matrix, solve the matrix iteratively inside a loop that couples pressure and velocity, and check that the answer is converged and mesh-independent.

Flow diagram of the six numerical steps in a CFD solver: 1 equations (mass, momentum, energy PDEs), 2 mesh, 3 discretise into one algebraic equation per cell, 4 assemble a sparse matrix A x = b, 5 iterate with a linear solver and pressure loop, 6 check residuals, mesh study and test data; steps 4 and 5 repeat until the equations balance
The numerical chain. Steps 1 to 3 happen once when you set up a case; steps 4 and 5 run thousands of times; step 6 is your job, not the solver's.

The user-facing workflow (geometry, meshing, boundary conditions, solving, post-processing) is covered in our CFD simulation workflow guide. This article is about what happens inside the "solve" button, because that is where most beginner runs go wrong and where interviewers dig.

Why can't CFD solve the Navier-Stokes equations directly?

The Navier-Stokes equations are non-linear partial differential equations, and exact solutions exist only for a handful of idealised flows such as fully developed flow in a straight pipe. For a car, a pump or a heat exchanger there is no formula, so CFD replaces the continuous equations with an approximate set of algebraic equations that a computer can solve.

All the equations a solver carries (momentum, energy, turbulence quantities, species) share one shape, the transport equation for a quantity :

Storage plus convection equals diffusion plus a source. The fundamentals of CFD guide derives this and works a convection-diffusion example by hand; here we follow what the solver does with it next.

How is a partial differential equation turned into algebra?

The domain is divided into cells, and the equation is integrated over each cell so that what flows in through the faces, minus what flows out, equals what is stored or generated inside. That is the finite volume method. Face values are estimated from neighbouring cell centres, which leaves one algebraic equation per cell linking it to its neighbours.

Three families of methods do this job, and you will meet all three in textbooks:

MethodWhat it doesWhere you see it
Finite difference (FDM)Replaces derivatives at grid points; simple and very accurate on regular gridsResearch codes, teaching, DNS on simple boxes
Finite volume (FVM)Balances fluxes over each cell, so mass and momentum are conserved exactly per cell; works with any cell shapeAnsys Fluent, Simcenter STAR-CCM+, OpenFOAM
Finite element (FEM)Solves a weighted-integral (weak) form with shape functions; handles complex geometry and coupling with structuresMultiphysics codes such as COMSOL; structural FEA

For the detailed comparison, see discretization methods in CFD.

Worked example 1: the equations for a heated plate

Take a square plate with its top edge held at 100 °C and the other three edges at 0 °C, and ask for the steady temperature inside. With no flow and no source, the transport equation reduces to . Divide the plate into equal square cells. Balancing the heat conducted through the four faces of a cell P with neighbours E, W, N and S gives:

Each cell's temperature is the average of its four neighbours. That one line is the whole discretised physics. On a 63 × 63 grid it is written 3,969 times, once per cell, and together the equations form a matrix system with 3,969 unknowns. The answer has a check built in: by symmetry, four such plates with a different hot edge each add up to a plate at 100 °C everywhere, so the centre of ours must be exactly 25 °C. Our solver gets 25.00 °C.

You can watch the same problem converge interactively in the free 2D heat conduction solver.

Why do CFD codes use iterative solvers instead of solving the matrix directly?

Because the matrix is huge and almost empty. A cell only talks to its neighbours, so each row of the matrix has about seven non-zero entries in 3D. A direct method such as Gaussian elimination fills in the empty entries as it works, costing far more memory and time. Iterative solvers only ever touch the non-zeros.

The numbers for a modest 1-million-cell mesh (computed 23 Nov 2026, script in our run folder):

  • Full matrix: entries, or 8 TB at 8 bytes each.
  • Non-zeros with a 7-point stencil: 7 million, about 88 MB stored in compressed sparse row form.
  • So 99.9993% of the matrix is zeros, and a direct solver that fills them in would need many times more memory than the whole case.

A real case is bigger still. A 10-million-cell external aerodynamics run with the k-ω SST turbulence model carries six unknowns per cell (three velocity components, pressure, k and ω): 60 million values updated on every outer iteration.

Worked example 2: Jacobi vs Gauss-Seidel vs multigrid

We solved the heated plate on three grids with four classic iterative methods and counted how many passes each needed to cut the residual (the amount by which the cell equations are out of balance) by a factor of one million:

Iterations to reduce the residual by 106, heated-plate problem (GS = Gauss-Seidel, MG = multigrid V-cycles; computed 23 Nov 2026)
GridCellsJacobiGSSORMG
15 × 15225571295415
31 × 319612,0761,074814
63 × 633,9697,4433,8661584

Read the table column by column:

  • Jacobi updates every cell from the old values of its neighbours. Simple, and slow.
  • Gauss-Seidel uses each new value as soon as it is computed, which halves the work here (3,866 vs 7,443). But every time the grid is refined by 2×, it needs about 4× as many sweeps, because a correction only travels one cell per sweep.
  • SOR (successive over-relaxation) overshoots each update by a factor ω (1.906 on the finest grid). It cuts the work by 24× but still grows with the grid.
  • Multigrid smooths the error on the fine grid, then solves for the remaining smooth error on coarser and coarser grids, where it travels across the domain in a few steps. Its cycle count does not grow with the mesh: 4 cycles at 3,969 cells, about as much work as 21 Gauss-Seidel sweeps.
Log-log plot of normalised residual against iteration count for the 63 by 63 plate: multigrid reaches the 1e-6 target in 4 V-cycles, SOR in 158 sweeps (its residual first rises before falling), Gauss-Seidel in 3,866 and Jacobi in 7,443
Residual histories on the 63 × 63 plate. The dashed line is the 10−6 target. Note the log scale on both axes: multigrid needs about 1,000 times fewer passes than Gauss-Seidel, and about 180 times less work once each V-cycle is counted as 5.3 sweeps.

This is why the pressure equation, the hardest and stiffest one in incompressible CFD, is almost always handed to a multigrid solver. OpenFOAM's own user guide example solves pressure with GAMG (geometric-algebraic multigrid, tolerance , relative tolerance 0.01) and velocity and turbulence with a symmetric Gauss-Seidel smoother (tolerance , relative tolerance 0.1). Ansys Fluent uses an algebraic multigrid (AMG) solver for the same reason.

What is a residual in CFD, and when is a solution converged?

A residual is how far the discretised equations are from being satisfied with the current values: plug the latest values back into every cell equation and add up the imbalance. Solvers report it scaled or normalised, and a run is called converged when the residuals have fallen by several orders and the quantities you care about have stopped changing.

Ansys Fluent's default stopping criterion is a scaled residual of for most equations and for energy, but Ansys's own documentation says there is no universal rule. Three checks together are safer than any single number:

  1. Residuals have dropped at least three orders of magnitude and flattened out.
  2. Monitored outputs (drag force, pressure drop, outlet temperature) are flat over the last few hundred iterations.
  3. Mass and energy balance: what goes in equals what comes out, to a fraction of a percent.

Convergence only proves the algebra is solved. Whether the algebra matches reality is a separate question of mesh independence and validation, covered in convergence criteria in CFD and errors and uncertainties in CFD.

What is the difference between explicit and implicit time-stepping?

An explicit scheme computes each cell's new value directly from its neighbours' old values: cheap steps, but the time step must stay below a stability limit. An implicit scheme solves for all the new values together in one matrix each step: costlier steps that can be much larger without blowing up.

For transient conduction, the explicit (forward-time, centred-space) update and its stability limit are:

The implicit (backward Euler) version uses the new values on the right-hand side, which couples every cell to its neighbours at the same time level:

Worked example 3: an aluminium rod heated at one end

A 100 mm aluminium rod (thermal diffusivity m²/s) starts at 20 °C. At time zero its left end is held at 100 °C and its right end stays at 20 °C. We use 21 grid points, so mm, and simulate 10 seconds. The explicit limit is:

Aluminium rod after 10 s, three time-stepping choices (computed 23 Nov 2026)
SchemerΔt (s)StepsResult
Explicit0.400.10397Max error 0.11 °C vs exact; 65.7 °C at 25 mm (exact 65.6)
Explicit0.5970.15465Unstable: −79 to 180 °C after 16 steps, about 3 × 108 °C by 10 s
Implicit4.851.258Stable; max error 1.42 °C; 64.3 °C at 25 mm
Two plots of temperature along the 100 mm rod. Left, after 10 s: explicit r = 0.40 and implicit r = 4.85 points both sit on the exact curve falling from 100 C to 20 C. Right: explicit at r = 0.597 after 16 steps zig-zags between about -79 C and 180 C around the exact curve
Left: both stable runs match the exact series solution. Right: just 20% over the limit, the explicit scheme's shortest wave grows by a factor of |1 − 4r| = 1.39 every step until the numbers are meaningless.

The trade-off is the one you make in real transient CFD. The implicit run took 12 times fewer steps for a 1.4 °C error, which is why commercial pressure-based solvers default to implicit time-stepping. Large steps still lose accuracy on fast events, so for convection the time step is chosen from the Courant number instead; see the Courant number and stability condition, or work it out with the Courant number calculator.

How does a CFD solver find the pressure?

In incompressible flow there is no equation that gives pressure directly. Pressure is whatever value makes the velocity field satisfy continuity (mass in equals mass out of every cell). Pressure-based solvers therefore guess a pressure, solve momentum, then derive a pressure correction that fixes the mass imbalance, and repeat. The classic version is the SIMPLE algorithm.

Flowchart of the SIMPLE algorithm: guess pressure, solve momentum for velocities, solve the pressure-correction equation from continuity, correct pressure and velocity with under-relaxation, solve other transport equations such as k, omega and temperature, then check whether residuals are small; if not, start the next iteration
The SIMPLE loop (Semi-Implicit Method for Pressure-Linked Equations), developed by Patankar and Spalding at Imperial College in the early 1970s.

Three variants cover most of what you will set in practice:

  • SIMPLE / SIMPLEC for steady flow. The corrections are damped with under-relaxation factors: too high and the run diverges, too low and it crawls. Fluent's user guide advises starting from the default factors and reducing them if the residuals keep rising after the first 4 or 5 iterations. Our under-relaxation guide covers tuning.
  • PISO (Issa, 1986) for transient flow: several pressure corrections inside one time step instead of outer iterations.
  • PIMPLE, OpenFOAM's blend of the two, which allows larger transient steps; the number of pressure corrections per step is the nCorrectors setting.

Fluent also offers a coupled pressure-based algorithm that solves momentum and continuity together instead of one after the other. Ansys describes it as more robust and efficient than the segregated approach for steady single-phase flow.

Where is the numerical approach heading in 2026?

Two shifts matter for anyone learning CFD now. First, GPUs: Ansys's 2026 R1 release brought volume-of-fluid with energy, sliding meshes, joule heating and hybrid-precision arithmetic to the Fluent GPU solver, so cases that once needed a CPU cluster now run on a single workstation card. The numerics in this article are the same; the matrix just lives on a GPU.

Second, licence limits shape what students can practise. The free Ansys Student licence caps fluid problems at 1 million cells or nodes, and OpenFOAM (v2606 from OpenCFD, June 2026; OpenFOAM 14 from the OpenFOAM Foundation, July 2026) has no cell limit, which makes it the usual choice for anyone who wants to see and change the solver settings themselves. AI surrogate models are growing too, but they are trained on CFD results; see AI surrogates vs CFD solvers.

How should you learn the numerical side of CFD?

Write a small solver before you rely on a big one. Coding a 1D conduction problem, a 2D Laplace solver and a lid-driven cavity in MATLAB or Python teaches discretisation, stability, iteration and convergence in a few weeks, and it makes every Fluent or OpenFOAM setting you meet later make sense.

A practical order:

  1. Fluid mechanics and heat transfer basics: the free Fluid Mechanics and Computational Fluid Dynamics books on Skill-Lync.
  2. Your own solvers: the three worked examples above, then a cavity flow with SIMPLE. Skill-Lync's Introduction to CFD using MATLAB and OpenFOAM is built around this.
  3. One production code properly: Ansys Fluent or OpenFOAM, with meshing and turbulence modelling.
  4. For solver-developer roles, C++ and the OpenFOAM source: the CFD solver development programme.

What the job market pays for these skills: Skill-Lync placement records show a median starting offer of 3.5 LPA for CFD-domain placements (n = 240; middle half 2.81 to 4.5 LPA), based on 3,711 Skill-Lync placement records up to 7 Nov 2026 (data snapshot of 15 Nov 2026). It is a self-selected sample of learners who reported a placement, mostly early-career offers from 2021-23, so treat it as a starting point; the CFD engineer salary guide adds third-party data. Interviewers test exactly the topics above, as the CFD interview questions list shows.

Frequently asked questions

Is CFD just solving the Navier-Stokes equations?

Mostly, yes. CFD solves the Navier-Stokes momentum equations together with continuity and usually energy, plus extra transport equations for turbulence, species or phases. What makes it CFD rather than pure mathematics is the numerical approach: discretising those equations on a mesh, solving the resulting algebra iteratively and proving the answer is converged and mesh-independent.

Which numerical method does Ansys Fluent use?

Ansys Fluent uses the finite volume method on cell-centred meshes of any cell shape. It offers a pressure-based solver (segregated SIMPLE-family or coupled) for low-speed flows and a density-based solver for high-speed compressible flows, and it solves the resulting linear systems with an algebraic multigrid solver. OpenFOAM and STAR-CCM+ are also finite-volume codes.

What does a residual of 1e-3 mean in CFD?

It means the scaled imbalance of the discretised equations has fallen to one-thousandth of its reference value. In Fluent that is the default stopping point for most equations (energy uses 1e-6). It is a hint, not proof: also check that monitored forces or temperatures have stopped changing and that mass and energy balance across the boundaries.

Why does my CFD simulation diverge?

The usual causes are a time step above the stability limit, under-relaxation factors set too high, poor-quality cells (high skewness or aspect ratio), boundary conditions that conflict, or starting a hard case from a bad initial guess. Start with first-order schemes and lower relaxation, fix the worst cells, then switch to second-order once the run is stable.

Can I write a simple CFD solver in Python or MATLAB?

Yes, and it is the fastest way to understand CFD. A 2D steady conduction solver like our heated-plate example is about 30 lines of Python, and a lid-driven cavity with SIMPLE fits in a few hundred. These codes are too slow for industrial meshes, but they teach discretisation, stability and convergence better than any commercial interface.

Sources and further reading

  • Skill-Lync, worked calculations for this article (calc.py: heated plate with Jacobi, Gauss-Seidel, SOR and multigrid; sparse storage; explicit and implicit rod), computed 23 Nov 2026.
  • Skill-Lync placement statistics, 3,711 records up to 7 Nov 2026, snapshot 15 Nov 2026 (CFD domain n = 240). Public list: recent placements.
  • CFD Direct, OpenFOAM user guide: fvSolution (solvers, tolerances, PIMPLE), accessed 23 Nov 2026.
  • Wikipedia, SIMPLE algorithm and PISO algorithm (Patankar and Spalding, Imperial College, early 1970s; Issa, 1986), accessed 23 Nov 2026.
  • Wikipedia, FTCS scheme (stability condition ), accessed 23 Nov 2026.
  • Wikipedia, Thermal diffusivity (aluminium 97 mm²/s), accessed 23 Nov 2026.
  • Ansys Fluent User's Guide, Judging convergence (default scaled-residual criteria), accessed 23 Nov 2026.
  • Ansys, What's new across Ansys Fluids 2026 R1, accessed 23 Nov 2026.
  • Ansys, Ansys Student (1 million cell/node fluid limit), accessed 23 Nov 2026.
  • OpenCFD, OpenFOAM v2606 release; OpenFOAM Foundation, OpenFOAM 14 release, accessed 23 Nov 2026.
  • Further reading: H. K. Versteeg and W. Malalasekera, An Introduction to Computational Fluid Dynamics: The Finite Volume Method, 2nd ed., Pearson, 2007; S. V. Patankar, Numerical Heat Transfer and Fluid Flow, 1980.
Want this on your résumé?

Talk to a counsellor.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.