Electromagnetic Field Simulation of Cavity Resonators

Category: Electromagnetic Field Analysis | Revised 2026-09-30
Electromagnetic field distribution inside a rectangular cavity resonator showing TE and TM mode patterns
Electromagnetic field mode distribution inside a rectangular cavity resonator (TE₁₀₁ mode)

Theory: standing waves in a metal box

Overview

🙋

Microwave filters and particle accelerators use cavity resonators. Why does a plain metal box resonate?

🎓

Metal walls reflect waves almost perfectly, so waves bounce back and forth and only those satisfying zero tangential electric field at the walls survive. Like a vibrating string, it resonates strongly only at discrete frequencies (modes) set by the dimensions. Because wall losses are tiny, Q values of thousands to tens of thousands are possible — far sharper than coil-and-capacitor circuits.

Resonant frequencies of a rectangular cavity

$$ f_{mnp} = \frac{c}{2\sqrt{\varepsilon_r\mu_r}}\sqrt{\left(\frac{m}{a}\right)^2 + \left(\frac{n}{b}\right)^2 + \left(\frac{p}{d}\right)^2} $$

$a$, $b$ and $d$ are the internal dimensions and $m$, $n$, $p$ the numbers of half-wavelengths in each direction. TE and TM modes allow different index combinations; with $b < a < d$ the lowest mode is TE101.

Q factor

$$ \frac{1}{Q} = \frac{1}{Q_c} + \frac{1}{Q_d} + \frac{1}{Q_{ext}}, \qquad Q_d = \frac{1}{\tan\delta}, \qquad R_s = \sqrt{\frac{\omega\mu_0}{2\sigma}} $$

$Q_c$ is from conductor loss in the walls, $Q_d$ from any dielectric filling ($\tan\delta$ is the loss tangent), and $Q_{ext}$ from coupling to external circuits; the smallest dominates the total. $R_s$ is the surface resistance, representing loss from current flowing within the skin depth.

Coffee Break Trivia

The cavity behind radar and the microwave oven

In 1940 Randall and Boot in Britain built the cavity magnetron — a copper block bored with a ring of cavities — producing microwaves of unprecedented power and transforming wartime radar. The well-known story goes that after the war an engineer working with magnetrons noticed a chocolate bar melting in his pocket, which led to the microwave oven. The oven's cooking chamber is itself a large cavity resonator, and uneven heating of food can be explained by its standing-wave modes.

Worked example: a closed WR-90 cavity

Mode ordering

Close both ends of WR-90 waveguide (internal 22.86 × 10.16 mm) to form a cavity of length $d = 30$ mm; the lowest modes (air-filled) are:

ModeResonant frequency
TE1018.24 GHz
TE10211.95 GHz
TE20114.03 GHz
TE01115.58 GHz
TM11016.15 GHz

Filling with PTFE (permittivity 2.1) scales every mode by $1/\sqrt{2.1}$, lowering TE101 to about 5.69 GHz — which is why dielectric filling is used to shrink cavities.

Q from copper walls

With copper walls (conductivity $5.8\times10^{7}$ S/m), the TE101 surface resistance is about 0.024 Ω and the wall-loss Q about 7,700. The resonance bandwidth $f/Q$ is only about 1.1 MHz at 8 GHz.

🙋

With a 1 MHz bandwidth, a tiny dimensional error must throw the frequency off.

🎓

Exactly. Changing $d$ by just 10 µm shifts TE101 by about 1 MHz — about the bandwidth. That's why real filters have tuning screws to trim frequency after assembly. Thermal expansion of the metal also moves the frequency, so precision applications use low-expansion materials or temperature-compensating designs.

Mesh convergence of the eigenvalue solution

TE10p modes have a field uniform along $b$, so they can be solved as a 2D finite-difference eigenvalue problem on the $a \times d$ rectangle. TE101 results for different divisions $n_x$ along $a$:

DivisionsTE101 frequencyError
48.062 GHz−2.21 %
88.198 GHz−0.56 %
168.233 GHz−0.14 %
328.241 GHz−0.034 %
648.243 GHz−0.008 %

Each doubling cuts the error to about a quarter — second-order convergence. For a resonator with Q in the thousands, even 0.1% frequency error is several bandwidths, so resonator analysis needs much tighter convergence checks than typical structural work.

Analysis with FEM

Setup

$$ \nabla\times\left(\frac{1}{\mu_r}\nabla\times\mathbf{E}\right) - k_0^2\,\varepsilon_r\,\mathbf{E} = 0 $$
  • Use edge elements: nodal representations of E admit spurious solutions with non-zero divergence. Nédélec (edge) elements are standard for electromagnetic eigenproblems.
  • Including loss: either solve with perfectly conducting walls and compute Q afterwards from surface resistance, or apply an impedance boundary to the walls and read Q directly from complex eigenvalues.
  • Set a search target: give the eigensolver a frequency to search near. Degenerate or closely spaced modes are easy to confuse, so confirm each mode from its field plot.
  • Coupling apertures and probes: including external coupling lowers the resonant frequency slightly and reduces Q. For filters, confirm S-parameters with a frequency-domain analysis including the coupling.
Coffee Break Trivia

“Simulated Q is twice the measured” is common

It is not unusual for simulated Q to be nearly twice the measured value. Common causes are surface roughness (at high frequency the skin depth is shallow and roughness lengthens the current path), plating with lower conductivity than pure copper, and poor current flow across seams. Analyses often correct with an effective conductivity lowered to match measurement. Recording how much it was lowered sharpens estimates for the next design.

Common mistakes

Mistakes and fixes

MistakeEffectFix
Nodal elements for the eigenproblemSpurious modes appearUse edge elements
Judging frequency on a coarse meshOff by several bandwidthsCheck convergence and extrapolate
Using pure-copper conductivity for QQ overestimatedCorrect with an effective conductivity
Identifying modes by index onlyDegenerate modes confusedConfirm with field plots
Ignoring thermal dimension changesFrequency drifts in serviceAssess sensitivity including thermal expansion
🙋

I'd like to change dimensions and watch the modes change.

🎓

Use the waveguide modes simulator for dimensions versus modes, the skin depth calculator for skin depth, and the microwave filter simulator for resonator-based filters. The theory continues in the articles on waveguide modes, dielectric resonators and high-frequency FEM.

Related Simulators

Experience the theory firsthand with the interactive simulator for this field

All Simulators

Related fields

Coupled AnalysisStructural AnalysisThermal Analysis
Rate this article
Thank you for your feedback!
Helpful
More details
Report error
Helpful
0
More details
0
Report error
0