Meep Tutorial/Band diagram, resonant modes, and transmission in a holey waveguide

From AbInitio

Revision as of 23:03, 5 November 2005; Stevenj (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search
Meep
Download
Release notes
FAQ
Meep manual
Introduction
Installation
Tutorial
Reference
C++ Tutorial
C++ Reference
Acknowledgements
License and Copyright
Computational cell for computing transmission and resonant modes for a cavity in a waveguide perforated by periodic holes.

In this example, we will consider the two-dimensional structure shown above, which is based on a system considered in:

  • S. Fan, J. N. Winn, A. Devenyi, J. C. Chen, R. D. Meade, and J. D. Joannopoulos, "Guided and defect modes in periodic dielectric waveguides," J. Opt. Soc. Am. B. 12 (7), 1267-1272 (1995).

In particular, there are three basic ideas behind this structure, which we briefly summarize here.

First, by taking a dielectric wavgeuide and perforating it with a periodic sequence of holes, we form a kind of photonic crystal: there are still index-guided modes propagating losslessly down the periodic waveguide, but there is also a (partial) photonic band gap: a range of frequencies in which no guided modes exist.

Second, by making a defect in the periodic sequence, in this case by separating one pair of holes by a greater amount, we can trap a resonant cavity mode: it is localized along the waveguide direction by the band gap, and (partially) in the transverse direction by index-guiding. Because there is no complete gap, however, the mode has some intrinsic radiative losses: even with infinitely many holes/periods, it leaks away slowly into the surrounding air.

Third, by making a sequence of: ordinary (no holes) waveguide, periodic structure, defect, periodic structure, waveguide, we can make a filter. In particular, because there is now a finite number of holes, the resonant mode can now leak into the waveguide as well as to the surrounding air. Then, input light from the waveguide at the resonance frequency undergoes resonant coupling, and is transmitted to the other side with a Lorentzian transmission spectrum. In the limit where the resonant mode couples much more strongly with the waveguide than the air (i.e. if there are not too many holes and the radiative leakage is slow), then in a symmetric structure we should get 100% transmission on resonance, forming a narrow-band filter.

In the following, we will analyze the structure in exactly the opposite order of what we really should do. Really, we should analyze the periodic system first to understand the band gap, then analyze the resonant mode, and then finally analyze the transmission spectrum. Since all of those calculations have already been done in the above paper, however, we can jump straight to the transmission spectrum (which is conceptually the easiest computation to understand) and work backwards.

See also the holey-wvg-cavity.ctl and holey-wvg.ctl files included with Meep, which contain the commands below.

Transmission spectrum

To calculate the transmission spectrum, much as in the bend example in the Meep tutorial, we'll measure the flux spectrum at one end of the waveguide from a source at the other end, normalized by the flux from a case with no holes in the waveguide. First, we'll define some parametes defining our structure, as in the figure above; note that we'll choose units so that our periodicity is 1 (a typical choice for photonic crystals).

; Some parameters to describe the geometry:                                     
(define-param eps 13) ; dielectric constant of waveguide                        
(define-param w 1.2) ; width of waveguide                                       
(define-param r 0.36) ; radius of holes                                         
(define-param d 1.4) ; defect spacing (ordinary spacing = 1)                    
(define-param N 3) ; number of holes on either side of defect                   

; The cell dimensions                                                           
(define-param sy 6) ; size of cell in y direction (perpendicular to wvg.)       
(define-param pad 2) ; padding between last hole and PML edge                   
(define-param dpml 1) ; PML thickness   

Given these parameters, the size of the cell in the x direction, which we'll denote sx, is given by sx = 2*(pad+dpml+N) + d - 1, which in Scheme is expressed as:

(define sx (+ (* 2 (+ pad dpml N)) d -1)) ; size of cell in x direction

Now, the computational cell is:

(set! geometry-lattice (make lattice (size sx sy no-size)))

Our geometry will consist of a single block for the waveguide, and 2N cylindrical holes. To make the holes, we could use some kind of loop (see also how to write a loop in Scheme), but in this case it is even easier to to use the predefined function geometric-object-duplicates, which replicates a given object by shifting by a given vector a given number of times (see the Meep reference):

(set! geometry
      (append ; combine lists of objects:                                       
       (list (make block (center 0 0) (size infinity w infinity)
                   (material (make dielectric (epsilon eps)))))
       (geometric-object-duplicates (vector3 1 0) 0 (- N 1)
        (make cylinder (center (/ d 2) 0) (radius r) (height infinity)
              (material air)))
       (geometric-object-duplicates (vector3 -1 0) 0 (- N 1)
        (make cylinder (center (/ d -2) 0) (radius r) (height infinity)
              (material air)))))

Note that we call geometric-object-duplicates twice, for the holes before and after the defect, and that we combine the resulting lists with the standard Scheme append function. As usual, later objects in geometry take precedence over earlier objects, so the cylinder objects will punch holes through the block.

The absorbing boundaries are:

(set! pml-layers (list (make pml (thickness dpml))))
(set-param! resolution 20)

Now, we'll define a couple of parameters to determine the frequency range to look at. We already know from the 1995 paper (or our calculation below) that this structure has a TE band gap for frequencies from about 0.2 to 0.3, so we'll want to cover this range.

(define-param fcen 0.25) ; pulse center frequency
(define-param df 0.2)  ; pulse width (in frequency)

(define-param nfreq 500) ; number of frequencies at which to compute flux

The source will now be the usual Gaussian pulse centered at fcen, located at one edge of the cell just outside the PML, at x = dpml - 0.5*sx. Ideally, we would excite exactly the fundamental mode of the waveguide, but it is good enough to just excite it with a line source. Moreover, since we are interested in the TE polarization (electric field in the plane), we will excite it with a Jy current source (transverse to the propagation direction), which is specified as Ey:

(set! sources (list
               (make source
                 (src (make gaussian-src (frequency fcen) (fwidth df)))
                 (component Ey)
                 (center (+ dpml (* -0.5 sx)) 0)
                 (size 0 w))))

The structure has mirror symmetry planes through the x and y axes. The source breaks the mirror symmetry through the y axis, but we still have odd mirror symmetry through the x axis:

(set! symmetries (list (make mirror-sym (direction Y) (phase -1))))

Note that we specify the plane by its normal, the y direction. See also: Exploiting symmetry in Meep.

Finally, we need to tell Meep to compute the flux spectrum at the other end of the computational cell, after the holes but before the PML:

(define trans ; transmitted flux                                          
        (add-flux fcen df nfreq
                  (make flux-region
                    (center (- (* 0.5 sx) dpml 0.5) 0) (size 0 (* w 2)))))

Now, we can run the simulation, using run-sources+ to run until the sources have finished, plus some additional time to allow the fields to propagate through the structure. As in the Meep tutorial, we'll use stop-when-fields-decayed to increment the time in steps of 50 time units (about 13 periods) until | Ey | 2 has decayed by at least 1/1000 at the transmission-flux plane.

(run-sources+ (stop-when-fields-decayed
               50 Ey
               (vector3 (- (* 0.5 sx) dpml 0.5) 0)
               1e-3)
              (at-beginning output-epsilon)
              (during-sources
               (in-volume (volume (center 0 0) (size sx 0))
                (to-appended "hz-slice" (at-every 0.4 output-hfield-z)))))

(display-fluxes) ; print out the flux spectrum

Note that we've outputted ε at the beginning—this is always a good idea, to make sure the structure is what you think it is! We have also outputted the Hz field in a y = 0 slice, every 0.4 time units (about ten times per period) while the source is on, to a single file with time as the second dimension, just as in the Meep tutorial. Now, after we run the simulation:

unix% meep holey-wvg-cavity.ctl | tee holey-wvg-cavity.out

(which takes some time because we need to wait for the cavity mode to decay away) we can plot the dielectric function and Hz field pattern via h5topng:

unix% h5topng holey-wvg-cavity-eps-000000.00.h5
unix% h5topng -Zc dkbluered holey-wvg-cavity-hz-slice.h5
ε of N=3 holes

Resonant modes

Band diagram

Personal tools