Meep Tutorial/Third harmonic generation

From AbInitio

Revision as of 01:54, 10 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

In this example, we consider wave propagation through a simple one-dimensional nonlinear medium with a non-zero Kerr susceptibility χ(3). We send in a narrow band pulse at a frequency ω, and because of the nonlinearity we also get a signal at a frequency . See also the 3rd-harm-1d.ctl example file included with Meep.

Since this is a one-dimensional calculation, we could implement it via a cell of (size S no-size no-size), specifying periodic boundary conditions in the y direction. However, this is slightly inefficient since the y periodic boundaries are implemented internally via extra "ghost pixels" in the y direction. Instead, Meep has special support for 1d simulations in the z direction. To use this, we must explicitly set dimensions to one, and in that case we can only use Ex (and Dx) and Hy field components (this involves no loss of generality because of the symmetry of the problem).

First, as usual, we'll define some parameters of our simulation:

(define-param sz 100) ; size of cell in z direction
(define-param fcen (/ 1 3)) ; center frequency of source
(define-param df (/ fcen 20)) ; frequency width of source
(define-param amp 1.0) ; amplitude of source
(define-param k 1e-2) ; Kerr susceptibility
(define-param dpml 1.0) ; PML layer thickness                                   

Now, to define our cell, we'll do:

(set-param! dimensions 1)
(set! geometry-lattice (make lattice (size no-size no-size sz)))
(set! pml-layers (list (make pml (thickness dpml))))
(set-param! resolution 20)

Note that this will only put PML layers at the \pm z boundaries.

In this case, we're going to fill the entire computational cell with the nonlinear medium, so we don't need to use any objects; we can just use the special default_material (which is ordinarily vacuum):

(set! default-material (make dielectric (index 1) (chi3 k)))

Now, our source will be a Gaussian pulse of Jx just by the z PML layer. Since this is a nonlinear calculation, we may want to play with the amplitude of the current/field, so we set the amplitude property explicitly to our parameter amp, above.

(set! sources (list
               (make source
                 (src (make gaussian-src (frequency fcen) (fwidth df)))
                 (component Ex)
                 (center 0 0 (+ (* -0.5 sz) dpml))
                 (amplitude amp))))

We'll want the frequency spectrum at the + z end of the computational cell. In a linear problem, we normally look at the spectrum over the same frequency range as our source, because other frequencies are zero. In this case, however, we will look from fcen/2 to 4*fcen, to be sure that we can see the third-harmonic frequency.

; frequency range for flux calculation                                          
(define-param nfreq 400)
(define-param fmin (/ fcen 2))
(define-param fmax (* fcen 4))

(define trans ; transmitted flux                                                
  (add-flux (* 0.5 (+ fmin fmax)) (- fmax fmin) nfreq
            (make flux-region (center 0 0 (- (* 0.5 sz) dpml 0.5)))))


Finally, we'll run the sources, plus additional time for the field to decay at the flux plane, and output the flux spectrum:

(run-sources+
 (stop-when-fields-decayed 50 Ex
                           (vector3 0 0 (- (* 0.5 sz) dpml 0.5))
                           1e-6))
(display-fluxes trans)

In a linear calculation, we normalize the transmission against some reference spectrum, but in this case there is no obvious normalization so we will just plot the raw data for several values of k (i.e. of χ(3)):

Transmitted flux for nonlinear media.

For small values of χ(3), we see a peak from our source at ω=1/3 and another peak precisely around the third-harmonic frequency 3ω=1. As the χ(3) gets larger, frequency-mixing within the peaks causes them to broaden, and finally for χ(3) = 1 we start to see a noisy, broad-spectrum transmission due to the phenomenon of modulation instability.

Personal tools