; Calculates the refelction from a thin metal film. Structure is periodic is y direction and PML in x direction.
;a=100e-9m or 100nm; what this means is that all the dimensions should be multipled by a to get the real dimensions. The frequency can be converted to real wavelength: longer_lamda_in_nm=a_in_nm/fmin and shorter_lamda_in_nm=a_in_nm/fmax, where fmin=fcen-df/2 and fmax=fcen+df/2
(define-param dpml 1) ; PML thickness (X direction only!)
(define-param sx 5) ; size of x
(define-param sy 1) ; size of y
(define-param sX (+ (* 2 dpml) sx))
(define-param thick_fac 5)
(define-param metal_thickness (/ sx thick_fac))
(define-param res 20) ; resolution
(set! k-point (vector3 0 0 0)) ;kvector of zero is used to keep same phase in all the units cells.
(set! ensure-periodicity true)
(set! eps-averaging? false)
(define-param structure? false) ; default should be false
; This part of the metal definition is generated by material_polarization_generator.m for the required a.
(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-lattice (make lattice (size sX sy no-size)))
(set! geometry (if structure?
(list (make block (center 0 0 0) (size metal_thickness sy infinity)
(material myAg))); Use a thicker metal film for a good match with analytical results for simillar resolution
(list (make block (center (* sx 0.25) 0 0) (size (* sx 0.5) sy infinity)
(material (make dielectric (epsilon 1)))))
))
(set! pml-layers (list (make pml (direction X) (thickness dpml))))
(define-param fcen 0.3)
(define-param df 0.6)
(define-param amp 1)
(set! resolution res)
(define-param nfreq 100) ; number of frequencies atll which to compute flux
;Source definition
(set! sources (list
(make source
(src (make gaussian-src (frequency fcen) (fwidth df)))
(component Ez)
(center (* sx -0.125) 0 0) (size 0 sy))))
;Reflected flux monitor
(define refl ; reflected flux
(add-flux fcen df nfreq
(make flux-region
(center (* sx -0.25) 0)(size 0 sy))))
;Transmitted flux monitor
(define trans ; reflected flux
(add-flux fcen df nfreq
(make flux-region
(center (* sx 0.25) 0 0)(size 0 sy 0) (direction X))))
(if structure? (load-minus-flux "refl-flux" refl))
(run-sources+ (stop-when-fields-decayed 50 Ex
(vector3 (* sx 0.25) 0 0)
1e-3))
(if (not structure?)
(save-flux "refl-flux" refl))
(display-fluxes refl trans)
评论0