Showing posts with label fdtd. Show all posts
Showing posts with label fdtd. Show all posts

Thursday, March 15, 2012

Task 5: Sim for Parallel Plates

Now I'm just going to see if I can capture near-field enhancement between two plates. I'm going to set up simulations where I vary the distance between the two plates and get the flux between them. I'm just looking for trends here; I don't know how to work out the units yet.
Results:
I implemented SiC plates. One plate has the noisy polarizations. The other doesn't. In 1D there is no enhancement. There is a ~10x enhancement in 2D as can be seen in the figure. 1 unit on the abscissa is 1 micron.
BUT, after careful examination, this result comes from the flux captured from the gaussian pulse that I had put in (The random current function didn't start with exactly zero initial fields). Also, I'm getting some reflections which can be seen from the negative parts of spectrum. Now when thinking about heat transfer, the other side should be 0K and be totally absorbing. The reflections can be explained as follows in heat transfer terms: the other side is gaining energy and re-emitting back to the source.
I'm going to reduce the amplitude of the noise to see if the reflections are reduced relative to the flux of the source.

Tuesday, February 28, 2012

Task 4: Understanding the Noisy Lorentzian in MEEP

I need to understand the details of the mathematics involved in the noisy lorentzian susceptibility. My top question is how to define a temperature since the inputs to the command is some amplitude, an omega, a gamma, and a sigma.

I haven't understood this yet but I'm going ahead with the next task.

Tuesday, February 21, 2012

Task 3: Implement random currents in MEEP

To simulate the effect of temperature on charges, I need to define a random current source in MEEP. I've found the development version of MEEP has this feature. It is given as a noisy lorentzian susceptibility. The math is described in the reference below.

D. Chan, M. Soljačić, and J. Joannopoulos, “Direct calculation of thermal emission for three-dimensionally periodic photonic crystal slabs,” Physical Review E, vol. 74, no. 3, pp. 1-9, Sep. 2006.

Monday, February 20, 2012

Task 2: Surface Plasmon Dispersion

Dispersion curves are useful to understand transport. I set up a MEEP simulation of two surfaces of Ag separated by a 100e-9m gap. You can see 3 modes: surface plasmons, gap propagation, and bulk plasmons. ~0.7 is omega_p the plasma frequency.

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

(define myAg (make dielectric (epsilon 1)
(polarizations
(make polarizability
(omega 1e-20) (gamma 0.0038715) (sigma 4.4625e+39))
; (make polarizability
; (omega 0.065815) (gamma 0.31343) (sigma 7.9247))
; (make polarizability
; (omega 0.36142) (gamma 0.036456) (sigma 0.50133))
; (make polarizability
; (omega 0.66017) (gamma 0.0052426) (sigma 0.013329))
; (make polarizability
; (omega 0.73259) (gamma 0.07388) (sigma 0.82655))
; (make polarizability
; (omega 1.6365) (gamma 0.19511) (sigma 1.1133))
)))

(set! geometry (list
                (make block (center -3 0 0 0.0) (size 5 infinity infinity)
                      (material myAg ))
    (make block (center 3 0 0 0.0) (size 5 infinity infinity)
                      (material myAg ))
      ))

(set! sources (list
               (make source
                 (src (make gaussian-src (frequency 2.5) (fwidth 5)))
                 (component Ex)
                 (center 0 0 0))
    (make source
                 (src (make gaussian-src (frequency 2.5) (fwidth 5)))
                 (component Ex)
                 (center -.5 0 0))
    (make source
                 (src (make gaussian-src (frequency 2.5) (fwidth 5)))
                 (component Ex)
                 (center .5 0 0)) 
     ))

(define-param kmin 0.0)
(define-param kmax 4.0)
(define-param k-interp 50)
(define kpts (interpolate k-interp (list (vector3 0 kmin 0) (vector3 0 kmax 0))))
(define all-freqs (run-k-points 200 kpts)) ; a list of lists of frequencies  

And here's a python snippet that gives a list of k-vectors their frequencies by giving it the MEEP output as a file object
def getfreqs(meepoutfileobj):
    fd=[]
    for aline in meepoutfileobj:
        if 'freqs:' in aline:
            ld=aline.split(',')
            kpt=ld[2:5];freqs=ld[5:]
            pts=[( [float(an) for an in kpt]  ,float(afreq)) for afreq in freqs]
            fd.extend(pts)
    if fd==[]:return None
    return fd

Tuesday, January 17, 2012

Python MEEP

Python-MEEP is a python wrapper around MEEP's C++ core. I found it difficult to use because
- there weren't many high level functions
- of poor documentation
- I found it awkward using object-oriented programming to 'script' a simulation. I felt like i was writing more code than necessary because I have to create and initialize objects /then/ preform an action with them. Of course, with procedural programming it's just one step.

I found it helpful to read MEEP's C++ help pages since there is a direct correlation to Python-MEEP. However, MEEP's C++ documentation is lacking also.

So why use Python-MEEP? My reason for using Python-MEEP is because I have moved much of my work into the Python environment. Also, I might need to customize MEEP and I think that will be easier using Python.

--
2/7
after some experimentation, it looks like python-meep is going to slow me down towards reaching my goal. i'm no longer enthusiastic about it.