Chapter 3 · 12 hours
Discretization Methods
Practice questions
Practice questions and answers
10 exam-style questions on this chapter, written for this site from the official syllabus. We haven’t found past IOE papers for this subject yet; if you have some, share them in the community.
- Practice · 6 marks
Using Taylor series expansion, derive the forward, backward and central difference approximations for the first derivative and state the truncation error and order of accuracy of each.
Answer
The finite difference method (FDM) replaces derivatives by algebraic differences of function values at grid points, spaced apart. The basis is the Taylor series.
Taylor expansions about
Forward difference
Rearrange the first series for :
Backward difference
Rearrange the second series:
Central difference
Subtract the second series from the first; the even-order terms cancel:
Summary
| Scheme | Formula | Truncation error | Order |
|---|---|---|---|
| Forward | 1st | ||
| Backward | 1st | ||
| Central | 2nd |
Halving halves the error of the first-order schemes but reduces the central-difference error to one quarter. Forward and backward differences are used at boundaries and in upwind schemes, where only one side is available.
- Practice · 6 marks
For the function (x in radians), evaluate at using forward, backward and central differences with and then . Compare with the exact value, find the percentage errors and verify the order of accuracy of each scheme.
Answer
Exact: .
Values needed: , , , , .
h = 0.1
- Forward:
- Backward:
- Central:
h = 0.05
- Forward:
- Backward:
- Central:
Errors
| Scheme | Value | Error | % error | |
|---|---|---|---|---|
| Forward | 0.1 | 0.49736 | -0.04294 | 7.95 |
| Forward | 0.05 | 0.51904 | -0.02126 | 3.93 |
| Backward | 0.1 | 0.58144 | +0.04114 | 7.61 |
| Backward | 0.05 | 0.56111 | +0.02081 | 3.85 |
| Central | 0.1 | 0.53940 | -0.00090 | 0.17 |
| Central | 0.05 | 0.54008 | -0.00023 | 0.04 |
Order of accuracy
Ratio of errors when is halved:
- Forward: , so first order.
- Backward: , so first order.
- Central: , so second order.
Here error means (numerical exact). The signs agree with theory: the forward formula equals , and since its error is negative; the backward error has the opposite sign; the central error is far smaller.
Answer: Central difference is best (0.5394 and 0.5401 against exact 0.5403); forward and backward are and central is .
- Practice · 5 marks
Derive the central difference formula for the second derivative and state its order. For , estimate using and , and compare with the exact value.
Answer
Derivation
Add the Taylor series of and :
Solve for :
It is second-order accurate, and it uses three points (stencil ). It is the basic formula for diffusion terms.
Numerical for at
Exact: .
h = 0.2: , ,
h = 0.1: ,
| Estimate | Error | |
|---|---|---|
| 0.2 | 17.36 | +0.08 |
| 0.1 | 17.30 | +0.02 |
| exact | 17.28 | 0 |
The error falls by a factor of 4 when is halved, confirming second-order accuracy. It also matches theory: for .
Answer: () and (); exact 17.28.
- Practice · 5 marks
Explain truncation error and order of accuracy of a finite difference scheme. Distinguish between first-order and second-order schemes, and explain consistency, stability and convergence.
Answer
Truncation error and order
The truncation error is the part of the Taylor series dropped when a derivative is replaced by a difference formula. If the leading dropped term is proportional to , the scheme is of order , written . For small , the error behaves as , so halving reduces the error by a factor .
The order is found from two grids by
First order against second order
| Point | First-order scheme | Second-order scheme |
|---|---|---|
| Example | Forward, backward, upwind | Central difference, Crank-Nicolson |
| Error | ||
| Halving | Error halves | Error falls to 1/4 |
| Stencil | Smaller (two points) | Larger (three points) |
| Behaviour | Numerical diffusion, but stable and bounded | Less diffusion; may give oscillations (dispersion) |
| Cost for given accuracy | Needs finer mesh | Coarser mesh enough |
Consistency, stability, convergence
- Consistency: the truncation error tends to zero as ; the difference equation then approaches the original PDE.
- Stability: errors (round-off) introduced during computation do not grow without bound. Explicit schemes have conditions such as and .
- Convergence: the numerical solution tends to the exact solution as the mesh is refined.
Lax equivalence theorem: for a well-posed linear problem, a consistent scheme converges if and only if it is stable.
Other numerical errors include round-off error (finite computer precision) and iteration (convergence) error. A mesh-independence test uses systematic refinement to estimate discretisation error.
- Practice · 8 marks
A plane wall of thickness 0.1 m and thermal conductivity 20 W/m·K generates heat uniformly at W/m³. The faces are held at 100 °C (x = 0) and 200 °C (x = 0.1 m). Using the finite difference method with four equal intervals (three interior nodes), set up the nodal equations and find the temperatures at the interior nodes. Compare with the exact solution.
Answer
Governing equation and discretisation
Steady 1D conduction with generation:
Central difference at an interior node :
x=0 0.025 0.05 0.075 0.1
(0)------(1)------(2)------(3)------(4)
100 C 200 C
Data: m.
with and .
Nodal equations
- Node 1:
- Node 2:
- Node 3:
In matrix form:
Solution (elimination)
From node 1: . From node 3: . Substitute in node 2:
Exact solution
At : . Similarly 212.5 and 221.875 at 0.05 and 0.075.
| Node | (m) | FDM (°C) | Exact (°C) |
|---|---|---|---|
| 1 | 0.025 | 171.875 | 171.875 |
| 2 | 0.050 | 212.5 | 212.5 |
| 3 | 0.075 | 221.875 | 221.875 |
The two agree exactly because the exact solution is a quadratic, and the central difference formula for has an error proportional to , which is zero here. The maximum temperature lies slightly beyond node 3, between 0.075 and 0.1 m.
Answer: °C, °C, °C (equal to the exact values).
- Practice · 8 marks
A metal bar has thermal diffusivity m²/s. It is modelled with nodes 0 to 5 at spacing m. Initially the temperatures of nodes 0 to 5 are 100, 20, 20, 20, 20, 0 °C, and the end nodes are held at 100 °C and 0 °C. (a) Write the explicit FTCS scheme for and its stability limit. (b) Find the largest stable time step. (c) With s, compute the interior temperatures after two time steps.
Answer
(a) FTCS scheme
Use a forward difference in time and a central difference in space:
The scheme is first order in time and second order in space. By von Neumann analysis the amplification factor is ; requires
(equivalently the coefficient of , , must not be negative.)
(b) Maximum time step
(c) Two steps with s
Step 1 (from 100, 20, 20, 20, 20, 0):
Step 2 (from 100, 39.40, 20, 20, 15.15, 0):
| Node | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| t = 0 | 100 | 20 | 20 | 20 | 20 | 0 |
| t = 1 s | 100 | 39.40 | 20.00 | 20.00 | 15.15 | 0 |
| t = 2 s | 100 | 49.39 | 24.70 | 18.82 | 12.65 | 0 |
Heat diffuses in from the hot end, and node 4 cools towards the 0 °C end.
Answer: , s; after 2 s the interior nodes are 49.39, 24.70, 18.82, 12.65 °C.
- Practice · 5 marks
Differentiate between explicit, implicit and Crank-Nicolson time-marching schemes for the one-dimensional transient diffusion equation. Write the discretised form of each and compare accuracy, stability and cost.
Answer
For , let and .
Discretised forms
- Explicit (FTCS): . The right side uses only old values, so each new value is found directly.
- Fully implicit (BTCS): , or . This needs a tridiagonal system solved each step (Thomas algorithm).
- Crank-Nicolson: average of the two, . Also tridiagonal.
Comparison
| Property | Explicit | Implicit | Crank-Nicolson |
|---|---|---|---|
| Time level of spatial terms | average of and | ||
| Accuracy | |||
| Stability | Conditional: | Unconditional | Unconditional |
| Work per step | Very small | Matrix solve | Matrix solve |
| Time step | Restricted by stability | Chosen by accuracy | Chosen by accuracy |
| Weakness | Tiny on fine mesh | Only first-order in time; damps | May oscillate for large |
Remarks
- With the explicit scheme, halving forces to be one quarter, so cost rises about 8 times in 1D.
- Implicit methods are used in most commercial CFD solvers because stable large time steps are possible, especially for steady-state solutions and stiff problems.
- Unconditional stability does not mean accuracy: too large a still gives a poor transient.
- Practice · 6 marks
For the linear convection equation with m/s, grid spacing m and time step s, find the Courant number. The values of at nodes 0 to 5 are 300, 300, 320, 360, 400, 400. Compute the new values at nodes 1 to 4 using (a) the first-order upwind scheme and (b) the central difference scheme in space with forward Euler in time. Comment on the results and on numerical diffusion.
Answer
Courant number
The physical shift in one step is m, i.e. 0.8 of a cell, so the exact solution moves the profile to the right by 0.8 cell.
(a) First-order upwind (flow in +x, use the upstream node)
(b) Central difference (FTCS)
| Node | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| Old | 300 | 320 | 360 | 400 |
| Upwind | 300.0 | 304.0 | 328.0 | 368.0 |
| Central | 292.0 | 296.0 | 328.0 | 384.0 |
Comments
- Upwind results stay between the old minimum (300) and maximum (400): the scheme is bounded and stable for .
- The central scheme gives 292 at node 1, below the lowest old value 300 (an unphysical undershoot). Forward Euler with central space differencing is unconditionally unstable for pure convection, so these oscillations grow with time.
- Upwind is first order. Its truncation error contains , which acts like an extra diffusion (numerical or false diffusion) with coefficient
that smears sharp gradients. For it vanishes and the scheme is exact in 1D.
- Remedies: finer grids, higher-order bounded schemes (QUICK, TVD, second-order upwind) with limiters.
Answer: ; upwind 300, 304, 328, 368; central 292, 296, 328, 384; numerical diffusion 0.02 m²/s.
- Practice · 4 marks
Differentiate between the finite difference, finite volume and finite element methods used in CFD. Why is the finite volume method preferred in most commercial CFD codes?
Answer
| Point | Finite difference (FDM) | Finite volume (FVM) | Finite element (FEM) |
|---|---|---|---|
| Basis | Taylor series; PDE at grid points | Integral conservation law over each cell | Weighted residual / variational form with shape functions |
| Unknowns | Point values | Cell-average values | Nodal values with interpolation inside the element |
| Mesh | Mainly structured | Structured or unstructured | Unstructured, complex shapes |
| Conservation | Not guaranteed | Exact (flux in = flux out for each cell) | Global, not local, unless special form |
| Complex geometry | Difficult | Easy | Very easy |
| Typical use | Research, simple geometry, heat conduction | Fluent, OpenFOAM, STAR-CCM+, CFX | Structural analysis, some fluid problems |
| Simplicity | Simplest to code | Moderate | More complex mathematically |
Why FVM is preferred
- It is derived from the integral form, so mass, momentum and energy are conserved locally in each control volume, even on a coarse mesh.
- It works on unstructured meshes, so complex industrial geometry can be meshed automatically.
- The physical meaning of each term (flux through a face) is clear, which makes boundary conditions and upwind schemes natural.
- It is efficient in memory and suited to segregated pressure-based solvers such as SIMPLE.
FDM remains useful for teaching, simple domains and high-order schemes, because its formulae follow directly from the Taylor series.
- Practice · 5 marks
Derive a second-order accurate one-sided (forward) difference formula for at a boundary node , using nodes with uniform spacing . The temperatures at a wall and the next two points spaced 0.5 mm apart are 50, 46 and 40 °C. Estimate the wall temperature gradient using the first-order and the second-order formula, and find the heat flux if W/m·K.
Answer
Derivation
Expand and about :
Eliminate : compute :
The first-order formula is . The second-order formula is important for evaluating wall shear stress and wall heat flux without needing a node outside the domain.
Numerical
Data: °C, m.
First-order:
Second-order:
The successive differences are -4 and -6, so the temperature curve is getting steeper away from the wall (curvature is present). The first-order formula effectively gives the slope at mid-interval (-8000 K/m), so it overestimates the magnitude of the wall slope; the second-order formula extrapolates to the wall itself.
Wall heat flux, :
(first-order would give 4800 W/m², about 33% higher.)
Answer: gradient K/m (1st order), K/m (2nd order); kW/m² (flux directed in the +x direction).
Written from the official syllabus. Questions and answers are written for this site; check them against your class notes.
Chapter titles and hours from the IOE syllabus ↗