Dear Steven and Meep Users,
 
I am new user to Meep, so i was trying to solve a simple problem that
calculate the transmission and reflection from a metal plane. In principle,
the transmission of EM through a metal plane must me 0 and the reflection
must be 1. Herewith my sample code to do that work:
(use-output-directory) 
(define-param sx 16) ; size of cell in X direction
(define-param sy 32) ; size of cell in Y direction
(define-param w 1) ; size of cell
(set! geometry-lattice (make lattice (size sx sy no-size)))

(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
    (if no-mat?
    (list
        (make block 
            (center 0 0)
            (size (- sx 2) (- sy 2) infinity)
            (material air)
        )
    )
        
    (list
        (make block 
            (center 0 0)
            (size w sy infinity)
            (material myAg)
        )
    )
))

(define-param fcen 0.15) ; pulse center frequency
(define-param df 0.1)  ; pulse width (in frequency)
(set! sources (list
           (make source 
         (src (make gaussian-src (frequency fcen) (fwidth df)))
         (component Ez)
         (center (+ 1 (* -0.5 sx)) 0)
         (size 0 w))))
         
(set! pml-layers (list (make pml (thickness 1.0))))
(set-param! resolution 10)
(define-param nfreq 100) ; number of frequencies at which to compute flux


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

(if (not no-mat?) (load-minus-flux "refl-flux" refl))
(run-sources+ 
 (stop-when-fields-decayed 50 Ez
               (if no-mat? 
                   (vector3 (- (/ sx 2) 1.5) -11.5)
                   (vector3 3.5 (- (/ sy 2) 1.5)))
               1e-3)
  (to-appended "ez" (at-every 0.6 output-efield-z))
 (at-beginning output-epsilon))

; for normalization run, save flux fields for refl. plane
(if no-mat? (save-flux "refl-flux" refl))

(display-fluxes trans refl)

Execution:
meep no-mat?=true metal.ctl | tee no.out
meep no-mat?=false metal.ctl | tee metal.out
But the transmission becomes >0, and the Ez field suddenly appears at time
t>200. 
Please help me to figure it out.

Thank you very much,

Nguyen Van Dung

Hanyang University


_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to