I am studying a square RF cavity of side lengths L = 1 with a small aperture of radius a = 0.1 using the 2D Helmholtz equation:
I model the RF cavity walls as perfectly reflective, so I have Dirichlet boundaries E(x, y)\big|_{\partial \Omega_W} = E_0 = 1, where \Omega_W represents the semi-enclosed region inside the cavity. However, since I am interested in EM radiation propogating out of the aperture, I also use a first-order approximation to the Sommerfield radiation condition \left(\frac{\partial E}{\partial r} - ikE\right)_{\partial \Omega_C} = 0, where \Omega_C represents the circular enclosing region.
I use the following code for my simulation:
/* Written for FreeFEM++ v4.15 */
// This solves the Helmholtz equation
// for a rectangular RF cavity with a small
// aperture
int top = 1;
int right = 2;
int bottom = 3;
int left = 4;
int edge = 5;
int all = 6;
real a = 0.1; // aperture diameter
real b = (1 - a) / 2;
real R = 10.0; // This should be a "large" number to simulate infinite domain
// use (n, m)-th mode
int n = 1;
int m = 0;
real k = sqrt(n^2 + m^2) * pi;
border boxtop(t=1, 0){ x=t; y=1; label=top; } // top
border boxrightup(t=0, b){ x=1; y=t; label=right; } // upper right
border boxrightdown(t=0, b){ x=1; y=(1 - t); label=right; } // lower right
border boxbottom(t=0, 1){ x=t; y=0; label=bottom; } // bottom
border boxleft(t=1, 0){ x=0; y=t; label=left; } // left
border circle(t=0,2*pi){x=(R*cos(t) + 0.5); y=(R*sin(t) + 0.5); label=edge; } // circular boundary to fake a boundary at infinity
int nSides = 50;
int nOpening = 25;
int nCircle = 200;
mesh Th = buildmesh(
boxtop(nSides) + boxrightup(nOpening)
+ boxrightdown(nOpening) + boxbottom(nSides)
+ boxleft(nSides) + circle(nCircle)
);
plot(Th, value=1, wait=1);
fespace Vh(Th, P1);
Vh<complex> TestPhi, Emag;
macro grad(u) [dx(u), dy(u)] //
solve Helmholtz(Emag, TestPhi)
= int2d(Th)(
grad(Emag)' * grad(TestPhi)
)
- int2d(Th) (
k^2 * Emag * TestPhi
)
// radiative BC at "infinite" edge
- int1d(Th, edge)(
1i * k * Emag * TestPhi
)
// reflective BC
+ on(top, right, bottom, left, Emag=1);
Vh Ereal = real(Emag);
Vh Eimag = imag(Emag);
Vh Eabs = abs(Emag);
// plot real & imaginary parts of the field
plot(Ereal, value=true, fill=true, dim=2, cmm="Real Part of E-field (k=" + k + ")", wait=1);
plot(Eimag, value=true, fill=true, dim=2, cmm="Imaginary Part of E-field (k=" + k + ")", wait=1);
plot(Eabs, value=true, fill=true, dim=2, cmm="Magnitude of E-field (k=" + k + ")", wait=1);
The result for the n = 1 mode is shown below:
I, however, am somewhat confused about the fact the solution shows symmetric propagating waves when the aperture is towards the right side. I would expect to see an anistrophic pattern. Is this solution correct? If not, why is it different from the physical solution?