Skip to main content

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 df/dxdf/dx 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 h=Δxh=\Delta x apart. The basis is the Taylor series.

Taylor expansions about xix_i

fi+1=fi+hfi′+h22!fi′′+h33!fi′′′+⋯f_{i+1}=f_i+h f'_i+\frac{h^2}{2!}f''_i+\frac{h^3}{3!}f'''_i+\cdots fi−1=fi−hfi′+h22!fi′′−h33!fi′′′+⋯f_{i-1}=f_i-h f'_i+\frac{h^2}{2!}f''_i-\frac{h^3}{3!}f'''_i+\cdots

Forward difference

Rearrange the first series for fi′f'_i:

fi′=fi+1−fih−h2fi′′−h26fi′′′−⋯f'_i=\frac{f_{i+1}-f_i}{h}-\frac h2f''_i-\frac{h^2}{6}f'''_i-\cdots fi′≈fi+1−fih,error=−h2fi′′=O(h)\boxed{f'_i\approx\frac{f_{i+1}-f_i}{h}},\qquad \text{error}=-\frac h2f''_i=O(h)

Backward difference

Rearrange the second series:

fi′=fi−fi−1h+h2fi′′−⋯f'_i=\frac{f_i-f_{i-1}}{h}+\frac h2f''_i-\cdots fi′≈fi−fi−1h,error=+h2fi′′=O(h)\boxed{f'_i\approx\frac{f_i-f_{i-1}}{h}},\qquad \text{error}=+\frac h2f''_i=O(h)

Central difference

Subtract the second series from the first; the even-order terms cancel:

fi+1−fi−1=2hfi′+h33fi′′′+⋯f_{i+1}-f_{i-1}=2hf'_i+\frac{h^3}{3}f'''_i+\cdots fi′≈fi+1−fi−12h,error=−h26fi′′′=O(h2)\boxed{f'_i\approx\frac{f_{i+1}-f_{i-1}}{2h}},\qquad \text{error}=-\frac{h^2}{6}f'''_i=O(h^2)

Summary

SchemeFormulaTruncation errorOrder
Forward(fi+1−fi)/h(f_{i+1}-f_i)/h−h2f′′-\tfrac h2f''1st
Backward(fi−fi−1)/h(f_i-f_{i-1})/h+h2f′′+\tfrac h2f''1st
Central(fi+1−fi−1)/2h(f_{i+1}-f_{i-1})/2h−h26f′′′-\tfrac{h^2}{6}f'''2nd

Halving hh 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 f(x)=sin⁡xf(x)=\sin x (x in radians), evaluate f′(x)f'(x) at x=1.0x=1.0 using forward, backward and central differences with h=0.1h=0.1 and then h=0.05h=0.05. Compare with the exact value, find the percentage errors and verify the order of accuracy of each scheme.

Answer

Exact: f′(1)=cos⁡1=0.54030f'(1)=\cos 1=0.54030.

Values needed: sin⁡0.9=0.783327\sin0.9=0.783327, sin⁡0.95=0.813416\sin0.95=0.813416, sin⁡1.0=0.841471\sin1.0=0.841471, sin⁡1.05=0.867423\sin1.05=0.867423, sin⁡1.1=0.891207\sin1.1=0.891207.

h = 0.1

  • Forward: sin⁡1.1−sin⁡1.00.1=0.891207−0.8414710.1=0.49736\dfrac{\sin1.1-\sin1.0}{0.1}=\dfrac{0.891207-0.841471}{0.1}=0.49736
  • Backward: 0.841471−0.7833270.1=0.58144\dfrac{0.841471-0.783327}{0.1}=0.58144
  • Central: 0.891207−0.7833270.2=0.53940\dfrac{0.891207-0.783327}{0.2}=0.53940

h = 0.05

  • Forward: 0.867423−0.8414710.05=0.51904\dfrac{0.867423-0.841471}{0.05}=0.51904
  • Backward: 0.841471−0.8134160.05=0.56111\dfrac{0.841471-0.813416}{0.05}=0.56111
  • Central: 0.867423−0.8134160.1=0.54008\dfrac{0.867423-0.813416}{0.1}=0.54008

Errors

SchemehhValueError% error
Forward0.10.49736-0.042947.95
Forward0.050.51904-0.021263.93
Backward0.10.58144+0.041147.61
Backward0.050.56111+0.020813.85
Central0.10.53940-0.000900.17
Central0.050.54008-0.000230.04

Order of accuracy

Ratio of errors when hh is halved:

  • Forward: 0.04294/0.02126=2.02≈210.04294/0.02126=2.02\approx2^1, so first order.
  • Backward: 0.04114/0.02081=1.98≈210.04114/0.02081=1.98\approx2^1, so first order.
  • Central: 0.00090/0.000225=4.0=220.00090/0.000225=4.0=2^2, so second order.

Here error means (numerical −- exact). The signs agree with theory: the forward formula equals f′+h2f′′f'+\tfrac h2f'', and since f′′=−sin⁡x<0f''=-\sin x<0 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 O(h)O(h) and central is O(h2)O(h^2).

  • Practice · 5 marks

Derive the central difference formula for the second derivative d2f/dx2d^2f/dx^2 and state its order. For f(x)=x4f(x)=x^4, estimate f′′(1.2)f''(1.2) using h=0.2h=0.2 and h=0.1h=0.1, and compare with the exact value.

Answer

Derivation

Add the Taylor series of fi+1f_{i+1} and fi−1f_{i-1}:

fi+1+fi−1=2fi+h2fi′′+h412fi′′′′+⋯f_{i+1}+f_{i-1}=2f_i+h^2f''_i+\frac{h^4}{12}f''''_i+\cdots

Solve for fi′′f''_i:

fi′′≈fi+1−2fi+fi−1h2,error=−h212fi′′′′=O(h2)\boxed{f''_i\approx\frac{f_{i+1}-2f_i+f_{i-1}}{h^2}},\qquad \text{error}=-\frac{h^2}{12}f''''_i=O(h^2)

It is second-order accurate, and it uses three points (stencil i−1, i, i+1i-1,\ i,\ i+1). It is the basic formula for diffusion terms.

Numerical for f=x4f=x^4 at x=1.2x=1.2

Exact: f′′=12x2=12×1.44=17.28f''=12x^2=12\times1.44=17.28.

h = 0.2: f(1.0)=1.0f(1.0)=1.0, f(1.2)=2.0736f(1.2)=2.0736, f(1.4)=3.8416f(1.4)=3.8416

f′′≈1.0−2(2.0736)+3.84160.22=0.69440.04=17.36f''\approx\frac{1.0-2(2.0736)+3.8416}{0.2^2}=\frac{0.6944}{0.04}=17.36

h = 0.1: f(1.1)=1.4641f(1.1)=1.4641, f(1.3)=2.8561f(1.3)=2.8561

f′′≈1.4641−2(2.0736)+2.85610.01=0.1730.01=17.30f''\approx\frac{1.4641-2(2.0736)+2.8561}{0.01}=\frac{0.173}{0.01}=17.30
hhEstimateError
0.217.36+0.08
0.117.30+0.02
exact17.280

The error falls by a factor of 4 when hh is halved, confirming second-order accuracy. It also matches theory: h212f′′′′=0.0412×24=0.08\dfrac{h^2}{12}f''''=\dfrac{0.04}{12}\times24=0.08 for h=0.2h=0.2.

Answer: f′′(1.2)≈17.36f''(1.2)\approx17.36 (h=0.2h=0.2) and 17.3017.30 (h=0.1h=0.1); 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 hph^p, the scheme is of order pp, written O(hp)O(h^p). For small hh, the error behaves as E≈ChpE\approx Ch^p, so halving hh reduces the error by a factor 2p2^p.

The order is found from two grids by

p=ln⁡(E1/E2)ln⁡(h1/h2)p=\frac{\ln(E_1/E_2)}{\ln(h_1/h_2)}

First order against second order

PointFirst-order schemeSecond-order scheme
ExampleForward, backward, upwindCentral difference, Crank-Nicolson
Error∝h\propto h∝h2\propto h^2
Halving hhError halvesError falls to 1/4
StencilSmaller (two points)Larger (three points)
BehaviourNumerical diffusion, but stable and boundedLess diffusion; may give oscillations (dispersion)
Cost for given accuracyNeeds finer meshCoarser mesh enough

Consistency, stability, convergence

  • Consistency: the truncation error tends to zero as h,Δt→0h,\Delta t\to0; 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 r=αΔt/Δx2≤0.5r=\alpha\Delta t/\Delta x^2\le0.5 and C=uΔt/Δx≤1C=u\Delta t/\Delta x\le1.
  • 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 10610^{6} 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:

kd2Tdx2+q˙=0k\frac{d^2T}{dx^2}+\dot q=0

Central difference at an interior node ii:

kTi+1−2Ti+Ti−1Δx2+q˙=0 ⇒ −Ti−1+2Ti−Ti+1=q˙Δx2kk\frac{T_{i+1}-2T_i+T_{i-1}}{\Delta x^2}+\dot q=0\ \Rightarrow\ -T_{i-1}+2T_i-T_{i+1}=\frac{\dot q\Delta x^2}{k}
 x=0     0.025    0.05    0.075    0.1
 (0)------(1)------(2)------(3)------(4)
 100 C                               200 C

Data: Δx=0.1/4=0.025\Delta x=0.1/4=0.025 m.

q˙Δx2k=106×(0.025)220=31.25 K\frac{\dot q\Delta x^2}{k}=\frac{10^6\times(0.025)^2}{20}=31.25\ \text{K}

with T0=100T_0=100 and T4=200T_4=200.

Nodal equations

  • Node 1: 2T1−T2=31.25+100=131.252T_1-T_2=31.25+100=131.25
  • Node 2: −T1+2T2−T3=31.25-T_1+2T_2-T_3=31.25
  • Node 3: −T2+2T3=31.25+200=231.25-T_2+2T_3=31.25+200=231.25

In matrix form:

[2−10−12−10−12][T1T2T3]=[131.2531.25231.25]\begin{bmatrix}2&-1&0\\-1&2&-1\\0&-1&2\end{bmatrix}\begin{bmatrix}T_1\\T_2\\T_3\end{bmatrix}=\begin{bmatrix}131.25\\31.25\\231.25\end{bmatrix}

Solution (elimination)

From node 1: T1=(131.25+T2)/2T_1=(131.25+T_2)/2. From node 3: T3=(231.25+T2)/2T_3=(231.25+T_2)/2. Substitute in node 2:

−131.25+T22+2T2−231.25+T22=31.25 ⇒ T2−181.25=31.25-\frac{131.25+T_2}{2}+2T_2-\frac{231.25+T_2}{2}=31.25\ \Rightarrow\ T_2-181.25=31.25 T2=212.5 ∘C,T1=131.25+212.52=171.875 ∘C,T3=231.25+212.52=221.875 ∘CT_2=212.5\ ^\circ\text{C},\quad T_1=\frac{131.25+212.5}{2}=171.875\ ^\circ\text{C},\quad T_3=\frac{231.25+212.5}{2}=221.875\ ^\circ\text{C}

Exact solution

T(x)=T0+(TL−T0)xL+q˙2kx(L−x)T(x)=T_0+(T_L-T_0)\frac xL+\frac{\dot q}{2k}x(L-x)

At x=0.025x=0.025: 100+25+25000×0.025×0.075=171.875100+25+25000\times0.025\times0.075=171.875. Similarly 212.5 and 221.875 at 0.05 and 0.075.

Nodexx (m)FDM (°C)Exact (°C)
10.025171.875171.875
20.050212.5212.5
30.075221.875221.875

The two agree exactly because the exact solution is a quadratic, and the central difference formula for d2T/dx2d^2T/dx^2 has an error proportional to T′′′′T'''', which is zero here. The maximum temperature lies slightly beyond node 3, between 0.075 and 0.1 m.

Answer: T1=171.9T_1=171.9 °C, T2=212.5T_2=212.5 °C, T3=221.9T_3=221.9 °C (equal to the exact values).

  • Practice · 8 marks

A metal bar has thermal diffusivity α=9.7×10−5\alpha = 9.7\times10^{-5} m²/s. It is modelled with nodes 0 to 5 at spacing Δx=0.02\Delta x = 0.02 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 ∂T/∂t=α ∂2T/∂x2\partial T/\partial t=\alpha\,\partial^2T/\partial x^2 and its stability limit. (b) Find the largest stable time step. (c) With Δt=1\Delta t = 1 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:

Tin+1−TinΔt=αTi+1n−2Tin+Ti−1nΔx2\frac{T_i^{n+1}-T_i^n}{\Delta t}=\alpha\frac{T_{i+1}^n-2T_i^n+T_{i-1}^n}{\Delta x^2} Tin+1=Tin+r (Ti+1n−2Tin+Ti−1n),r=αΔtΔx2T_i^{n+1}=T_i^n+r\,(T_{i+1}^n-2T_i^n+T_{i-1}^n),\qquad r=\frac{\alpha\Delta t}{\Delta x^2}

The scheme is first order in time and second order in space. By von Neumann analysis the amplification factor is G=1−4rsin⁡2(θ/2)G=1-4r\sin^2(\theta/2); ∣G∣≤1|G|\le1 requires

r≤12r\le\frac12

(equivalently the coefficient of TinT_i^n, 1−2r1-2r, must not be negative.)

(b) Maximum time step

Δtmax=0.5 Δx2α=0.5×(0.02)29.7×10−5=2.06 s\Delta t_{max}=\frac{0.5\,\Delta x^2}{\alpha}=\frac{0.5\times(0.02)^2}{9.7\times10^{-5}}=2.06\ \text{s}

(c) Two steps with Δt=1\Delta t=1 s

r=9.7×10−5×1(0.02)2=0.2425(<0.5, stable)r=\frac{9.7\times10^{-5}\times1}{(0.02)^2}=0.2425\quad(<0.5,\ \text{stable})

Step 1 (from 100, 20, 20, 20, 20, 0):

  • T1=20+0.2425(20−40+100)=20+19.40=39.40T_1=20+0.2425(20-40+100)=20+19.40=39.40
  • T2=20+0.2425(20−40+20)=20.00T_2=20+0.2425(20-40+20)=20.00
  • T3=20+0.2425(20−40+20)=20.00T_3=20+0.2425(20-40+20)=20.00
  • T4=20+0.2425(0−40+20)=20−4.85=15.15T_4=20+0.2425(0-40+20)=20-4.85=15.15

Step 2 (from 100, 39.40, 20, 20, 15.15, 0):

  • T1=39.40+0.2425(20−78.8+100)=39.40+9.99=49.39T_1=39.40+0.2425(20-78.8+100)=39.40+9.99=49.39
  • T2=20+0.2425(20−40+39.40)=20+4.70=24.70T_2=20+0.2425(20-40+39.40)=20+4.70=24.70
  • T3=20+0.2425(15.15−40+20)=20−1.18=18.82T_3=20+0.2425(15.15-40+20)=20-1.18=18.82
  • T4=15.15+0.2425(0−30.3+20)=15.15−2.50=12.65T_4=15.15+0.2425(0-30.3+20)=15.15-2.50=12.65
Node012345
t = 0100202020200
t = 1 s10039.4020.0020.0015.150
t = 2 s10049.3924.7018.8212.650

Heat diffuses in from the hot end, and node 4 cools towards the 0 °C end.

Answer: r≤0.5r\le0.5, Δtmax=2.06\Delta t_{max}=2.06 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 ∂T/∂t=α ∂2T/∂x2\partial T/\partial t=\alpha\,\partial^2T/\partial x^2, let r=αΔt/Δx2r=\alpha\Delta t/\Delta x^2 and δ2Ti=Ti+1−2Ti+Ti−1\delta^2T_i=T_{i+1}-2T_i+T_{i-1}.

Discretised forms

  • Explicit (FTCS): Tin+1=Tin+r δ2Ti nT_i^{n+1}=T_i^n+r\,\delta^2T_i^{\,n}. The right side uses only old values, so each new value is found directly.
  • Fully implicit (BTCS): Tin+1=Tin+r δ2Ti n+1T_i^{n+1}=T_i^n+r\,\delta^2T_i^{\,n+1}, or −rTi−1n+1+(1+2r)Tin+1−rTi+1n+1=Tin-rT_{i-1}^{n+1}+(1+2r)T_i^{n+1}-rT_{i+1}^{n+1}=T_i^n. This needs a tridiagonal system solved each step (Thomas algorithm).
  • Crank-Nicolson: average of the two, Tin+1=Tin+r2(δ2Ti n+δ2Ti n+1)T_i^{n+1}=T_i^n+\dfrac r2\left(\delta^2T_i^{\,n}+\delta^2T_i^{\,n+1}\right). Also tridiagonal.

Comparison

PropertyExplicitImplicitCrank-Nicolson
Time level of spatial termsnnn+1n+1average of nn and n+1n+1
AccuracyO(Δt,Δx2)O(\Delta t,\Delta x^2)O(Δt,Δx2)O(\Delta t,\Delta x^2)O(Δt2,Δx2)O(\Delta t^2,\Delta x^2)
StabilityConditional: r≤0.5r\le0.5UnconditionalUnconditional
Work per stepVery smallMatrix solveMatrix solve
Time stepRestricted by stabilityChosen by accuracyChosen by accuracy
WeaknessTiny Δt\Delta t on fine meshOnly first-order in time; dampsMay oscillate for large rr

Remarks

  • With the explicit scheme, halving Δx\Delta x forces Δt\Delta t 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 Δt\Delta t still gives a poor transient.
  • Practice · 6 marks

For the linear convection equation ∂ϕ/∂t+u ∂ϕ/∂x=0\partial\phi/\partial t+u\,\partial\phi/\partial x=0 with u=2u = 2 m/s, grid spacing Δx=0.1\Delta x = 0.1 m and time step Δt=0.04\Delta t = 0.04 s, find the Courant number. The values of ϕ\phi 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

C=uΔtΔx=2×0.040.1=0.8C=\frac{u\Delta t}{\Delta x}=\frac{2\times0.04}{0.1}=0.8

The physical shift in one step is uΔt=0.08u\Delta t=0.08 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)

ϕin+1=ϕin−C(ϕin−ϕi−1n)\phi_i^{n+1}=\phi_i^n-C(\phi_i^n-\phi_{i-1}^n)
  • ϕ1=300−0.8(300−300)=300.0\phi_1=300-0.8(300-300)=300.0
  • ϕ2=320−0.8(320−300)=304.0\phi_2=320-0.8(320-300)=304.0
  • ϕ3=360−0.8(360−320)=328.0\phi_3=360-0.8(360-320)=328.0
  • ϕ4=400−0.8(400−360)=368.0\phi_4=400-0.8(400-360)=368.0

(b) Central difference (FTCS)

ϕin+1=ϕin−C2(ϕi+1n−ϕi−1n)\phi_i^{n+1}=\phi_i^n-\frac C2(\phi_{i+1}^n-\phi_{i-1}^n)
  • ϕ1=300−0.4(320−300)=292.0\phi_1=300-0.4(320-300)=292.0
  • ϕ2=320−0.4(360−300)=296.0\phi_2=320-0.4(360-300)=296.0
  • ϕ3=360−0.4(400−320)=328.0\phi_3=360-0.4(400-320)=328.0
  • ϕ4=400−0.4(400−360)=384.0\phi_4=400-0.4(400-360)=384.0
Node1234
Old300320360400
Upwind300.0304.0328.0368.0
Central292.0296.0328.0384.0

Comments

  • Upwind results stay between the old minimum (300) and maximum (400): the scheme is bounded and stable for C≤1C\le1.
  • 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 uΔx2(1−C)∂2ϕ∂x2\dfrac{u\Delta x}{2}(1-C)\dfrac{\partial^2\phi}{\partial x^2}, which acts like an extra diffusion (numerical or false diffusion) with coefficient
Γnum=uΔx2(1−C)=2×0.12(1−0.8)=0.02 m2/s\Gamma_{num}=\frac{u\Delta x}{2}(1-C)=\frac{2\times0.1}{2}(1-0.8)=0.02\ \text{m}^2/\text{s}

that smears sharp gradients. For C=1C=1 it vanishes and the scheme is exact in 1D.

  • Remedies: finer grids, higher-order bounded schemes (QUICK, TVD, second-order upwind) with limiters.

Answer: C=0.8C=0.8; 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

PointFinite difference (FDM)Finite volume (FVM)Finite element (FEM)
BasisTaylor series; PDE at grid pointsIntegral conservation law over each cellWeighted residual / variational form with shape functions
UnknownsPoint valuesCell-average valuesNodal values with interpolation inside the element
MeshMainly structuredStructured or unstructuredUnstructured, complex shapes
ConservationNot guaranteedExact (flux in = flux out for each cell)Global, not local, unless special form
Complex geometryDifficultEasyVery easy
Typical useResearch, simple geometry, heat conductionFluent, OpenFOAM, STAR-CCM+, CFXStructural analysis, some fluid problems
SimplicitySimplest to codeModerateMore complex mathematically

Why FVM is preferred

  1. It is derived from the integral form, so mass, momentum and energy are conserved locally in each control volume, even on a coarse mesh.
  2. It works on unstructured meshes, so complex industrial geometry can be meshed automatically.
  3. The physical meaning of each term (flux through a face) is clear, which makes boundary conditions and upwind schemes natural.
  4. 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 df/dxdf/dx at a boundary node x0x_0, using nodes x0,x1,x2x_0, x_1, x_2 with uniform spacing hh. 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 k=0.6k = 0.6 W/m·K.

Answer

Derivation

Expand f1f_1 and f2f_2 about x0x_0:

f1=f0+hf0′+h22f0′′+h36f0′′′f_1=f_0+hf'_0+\frac{h^2}{2}f''_0+\frac{h^3}{6}f'''_0 f2=f0+2hf0′+2h2f0′′+4h33f0′′′f_2=f_0+2hf'_0+2h^2f''_0+\frac{4h^3}{3}f'''_0

Eliminate f0′′f''_0: compute 4f1−f24f_1-f_2:

4f1−f2=3f0+2hf0′−2h33f0′′′4f_1-f_2=3f_0+2hf'_0-\frac{2h^3}{3}f'''_0 f0′≈−3f0+4f1−f22h,f0′=approx+h23f0′′′+⋯ ⇒ O(h2)\boxed{f'_0\approx\frac{-3f_0+4f_1-f_2}{2h}},\qquad f'_0=\text{approx}+\frac{h^2}{3}f'''_0+\cdots\ \Rightarrow\ O(h^2)

The first-order formula is f0′≈(f1−f0)/hf'_0\approx(f_1-f_0)/h. The second-order formula is important for evaluating wall shear stress and wall heat flux without needing a node outside the domain.

Numerical

Data: f0=50, f1=46, f2=40f_0=50,\ f_1=46,\ f_2=40 °C, h=0.5×10−3h=0.5\times10^{-3} m.

First-order:

dTdx≈46−500.5×10−3=−8000 K/m\frac{dT}{dx}\approx\frac{46-50}{0.5\times10^{-3}}=-8000\ \text{K/m}

Second-order:

dTdx≈−3(50)+4(46)−402×0.5×10−3=−150+184−4010−3=−6000 K/m\frac{dT}{dx}\approx\frac{-3(50)+4(46)-40}{2\times0.5\times10^{-3}}=\frac{-150+184-40}{10^{-3}}=-6000\ \text{K/m}

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, q′′=−k dT/dxq''=-k\,dT/dx:

q′′=−0.6×(−6000)=3600 W/m2q''=-0.6\times(-6000)=3600\ \text{W/m}^2

(first-order would give 4800 W/m², about 33% higher.)

Answer: gradient −8000-8000 K/m (1st order), −6000-6000 K/m (2nd order); q′′=3.6q''=3.6 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 ↗