C1049 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C10 · Lesson 49 · Simulating fields with FDTD

Maxwell's equations stepped forward on a grid

Closed-form answers run out quickly: a real antenna on a phone, a connector on a board, a radar reflection off an aircraft. Engineers solve those with field simulators, and one of the simplest and most widely used is the finite-difference time-domain method, FDTD. It divides space into a grid of tiny cells, stores E and H at staggered points, and steps Faraday's and Ampère's laws forward in time, a few lines of arithmetic per cell per step. Kane Yee published the scheme in 1966; the course's own wave pictures use it. Its two rules of thumb, a time step limited by the cell size and enough cells per wavelength, decide whether a simulation is right or wildly wrong.

  • On a grid, waves don't travel at exactly c: the discrete equations make them a little slow, more so for short wavelengths. The curve is the simulated speed over c against the number of cells per wavelength, N.
  • S is the Courant number, cΔt/Δz. At S = 1 the one-dimensional scheme is exact. Lower S and the error appears: about 1% at 10 cells per wavelength, falling as 1/N2.
  • Above S = 1 the scheme is unstable: errors grow without limit, which is why the time step is capped.

Predict

A 1D FDTD grid has 1 mm cells. What is the longest time step that stays stable?

Name it

The Yee scheme in one dimension

Store Ex at whole-numbered grid points and times, and Hy halfway between in both space and time. Faraday's and Ampère's laws become

Hk+12n+12=Hk+12n−12−ΔtμΔz(Ek+1n−Ekn)
Ekn+1=Ekn−ΔtεΔz(Hk+12n+12−Hk−12n+12)

Each step updates every H from the E's beside it, then every E from the new H's. Materials enter through ε and μ cell by cell, so a dielectric slab is just a range of cells with a different ε.

Stability

The Courant number S=cΔt/Δz must satisfy S ≤ 1 in 1D (S ≤ 1/3 for cubic cells in 3D). Above that the scheme is unstable.

Accuracy

Waves on the grid travel at

vc=NπSsin−1⁡(Ssin⁡πN)

for N cells per wavelength: exact at S = 1 in 1D, otherwise slow by an error that falls as 1/N2. The usual rule is 10 to 20 cells per wavelength at the highest frequency of interest, and finer cells around small features.

Boundaries, sources and cost

A metal wall is E = 0. An open boundary needs an absorbing layer (the perfectly matched layer, PML) so waves leave without reflecting. Sources are usually a Gaussian pulse added to E at a cell, which covers a whole band of frequencies in one run. A 3D simulation has (L/Δ)3 cells and needs about L/(cΔt) steps per crossing, so halving the cell size costs 16 times the work.

Worked example

A 2.4 GHz antenna is simulated with 20 cells per wavelength in 3D. What cell size and time step are needed?

Show the solution
  1. Cell size. λ = 125 mm, so Δ=125mm20=6.25mm
  2. Time step. The 3D Courant limit is Δt=Δc3=6.25×10−33×108×1.732s=12ps

Answer cells of 6.25 mm and a time step of 12 ps.

Worked example

A 1D run uses S = 0.5 and 10 cells per wavelength. How fast do its waves travel?

Show the solution
  1. Numerical speed. 100.5πsin−1⁡(0.5sin⁡18∘)=0.988 so the waves run 1.2% slow.
  2. Over a long run. After crossing 50 wavelengths the wave would lag by more than half a wavelength.
  3. Finer cells. Doubling to 20 cells cuts the error to 0.3%.

Answer the waves travel at 0.988 of their true speed, 1.2% slow.

Worked example

A 1D FDTD grid of 1000 cells uses 20 cells per wavelength at 1 GHz with a Courant number of 1. What are the cell size and time step, and how many steps does a pulse take to cross?

Show the solution
  1. Cell size. λ = 30 cm, so Δx=30cm20=15mm
  2. Time step. At S = 1, Δt=Δxc=50ps
  3. Crossing time. A pulse moves exactly one cell per step, so crossing 1000 cells takes 1000 steps, 50 ns.
  4. Why S = 1 is special. In 1D, S = 1 is the magic step where the scheme has no dispersion at all.

Answer Δx = 15 mm and Δt = 50 ps, and a pulse takes 1000 steps (50 ns) to cross.

Check

A 1D grid has 1 mm cells and runs at Courant number 0.9. What time step is that?

Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.

Check

What is the largest stable time step for a 3D grid of 2 mm cubic cells?

Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.

Check

A simulation must resolve 5.8 GHz with 10 cells per wavelength, inside a material with εr = 4. What cell size does that need?

Write units the way you normally would: 1.5 mm, 1500 µm and 0.0015 m are the same answer.

Check

By what percentage are waves slow on a 1D grid with 15 cells per wavelength and Courant number 0.3?

Check

A 3D simulation covers a cube 50 mm on a side with 1 mm cells, storing six field components per cell as 8-byte numbers.

(a)

How many cells?

(b)

How much memory do the fields need?

Check

How many steps does a wave take to cross 100 mm on a 1D grid with 0.5 mm cells at Courant number 0.8?

Check

A 1D FDTD run uses S = 1.2. What happens?

Check

A 3D FDTD grid uses 10 cells per wavelength at 2.4 GHz.

(a)

What cell size is that?

Write units the way you normally would: 1.5 mm, 1500 µm and 0.0015 m are the same answer.

(b)

What is the largest stable time step?

Check

A 3D FDTD grid is 200 cells on a side, with six field components in double precision.

(a)

How much memory do the fields take?

(b)

By what factor does halving the cell size multiply the memory, for the same space?

Explain why

Why must the FDTD time step be short enough that a wave crosses at most one cell per step?

Practice

Keep practicing

11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.