Hello Prof. Steven and fellow Meep Users,

I am simulating a Bragg grating using Meep. My grating is formulated as a
sinusoidal grating. To avoid scattering of the grarting, I even have
extended the perturbation into the cladding, therefore I get a nicely
balanced reflection profile. But the Bragg wavelength is shifted by about 5
nms and the reason for this shift is a puzzle to me. I have tried to figure
out what is causing this shift and have not been able to find an answer. I
have some questions in this regard and if one you guys has some advice for
me, how to fix this, that would be great, and I would really appreciate
that.

1. Has the number of pixels in a geometry to be a whole number? Does it have
to be even or odd, does it matter?
2. Should the unit length be chosen such, that the width of a pixel is a
whole number?
3. The unit length selection in my code below, is that OK ? I did that to
match the Bragg period.
4. sub pixel average, although set to to false, still does take place, how
to avoid this?


Thank you very much
Geeth

This is the code I use:

(reset-meep)


(define a 531.544)                              ; in nm


(define blank 20)                               ; waveguide section between pml 
and grating
(define dpml 1)
(define pi 3.14159265)

(define wlen (/ 1550 a))                        ; wavelength in nm      
(define freq (/ 1 wlen))                        ; frequency of the source
(define fcen (/ 1 wlen))                        ; center frequency for the 
gaussian source
(define df 0.5)                         ; bandwidth of the gaussian source

;(define runtime (/ 100 freq))  ; define the simulation time in meep
units for 100 periods
(define wlen_wg (/ wlen 1.4645))
;(define res (/ 8 wlen_wg))
(define runtime 150)                    ; simumation time
(define res 20)                         ; geometry discretization set as 
resolution     
(define nfreq 500)                              ; number of frequencies for 
flux calculation

;# waveguide sructure parameters
;----------------------------------------------------------------------------------

(define core_thick (/ 3000 a))  ; thickness of the core in waveguide is
3 microns = 3000nm

(define core_eps  2.144760)             ; wg region index 1.4645
(define grt_1_eps 2.179214)             ; Core1 index 1.476216 (+0.8%), 
epsilon=2.179213
(define grt_2_eps 2.110581)             ; Core2 index 1.452784 (-0.8%), 
epsilon=2.110581
(define clad_eps 2.1025)                        ; Cladding index 1.45
(define clad_1_eps 2.136274)            ; cladding grating index-1= 1.4616 
(+0.8%)      
(define clad_2_eps 2.068994)            ; cladding grating index-2= 1.4384 
(-0.8%)

(set! default-material
        (make dielectric (epsilon clad_eps)))

(set! eps-averaging? false)

;# Bragg grating period calculated
(define bragg_period (/ 532 a))

;# sinusoidal variation of grating index in core
;# f(p) = amp x Sin (bxp-c) + d
;# period=2pi/b, amplitude=a, phase shift=c/b
(define amp_core (- grt_1_eps core_eps))        ; difference of max index to 
core index
(define b (/ (* 2 pi) bragg_period))            ; one grating element as half 
period
(define (func_eps_core p) (+ core_eps (* amp_core (sin (* b (vector3-x p))))))

;# index variation in the cladding grating
(define amp_clad (- clad_1_eps clad_eps))
(define (func_eps_clad p) (+ clad_eps (* amp_clad (sin (* b (vector3-x p))))))


(define N 50)                                   ; number of period in the 
grating
(define grt_length (* bragg_period N))


;# Lattice size settings
;-----------------------------------------------------------------------------------

;# lattice length= 2xdpml + 2xblank + (grt_length)      
(define lx (+ (* 2 (+ dpml blank)) grt_length))
(define ly (* core_thick 10))


;# Cordinate settings for Src, Flux, Grating
;----------------------------------------------------------------------------------

;# location of the source inside the blank
;# -lx/2 + dpml + 0.05*blank - new locaton
(define src_x (+ (/ lx -2) dpml (* blank 0.05)))

;# flux plane for transmission
;# lx/2 - dpml - blank/2
(define trans_x (- (* (- lx blank) 0.5) dpml))

;# flux plane for reflection
;# -lx/2 + dpml + (blank x 0.75)
(define refl_x (+ (* lx -0.5) dpml (* blank 0.75)))

;# cladding grating positions
; clad_y= ly/2 - (ly-core_thick)/4
(define clad_y (- (/ ly 2) (/ (- ly core_thick) 4))) ;for positive y
(define clad_x1 0)


;-----------------------------------------------------------------------------------

(define foldername
"bragg_wg_dWg3000_srcEz1550_newx_sinegrt_df0.5_a1064_res20_grtN50")
;("code_testing4")

;-------------------------------------------------------------------------------------

(set! geometry-lattice (make lattice (size lx ly no-size)))

(define-param grating? true)            ;set grating default to true


;# defining the waveguide structure with the grating section
;----------------------------------------------------------------------------------------
(set! geometry

        (if grating?

                 (list
                        
                        (make block (center 0 0) (size infinity core_thick 
infinity)
                        (material (make dielectric (epsilon core_eps))))

                        (make block (center 0 0) (size grt_length core_thick 
infinity)
                        (material (make material-function (epsilon-func 
func_eps_core))))       



;# Cladding grating setting top half
;------------------------------------------------------------------------------------
                
                        (make block (center 0 clad_y) (size grt_length (/ (- ly 
core_thick)
2) infinity)
                        (material (make material-function (epsilon-func 
func_eps_clad))))
                        




;# Cladding grating setting bottom half
;------------------------------------------------------------------------------------
        
                        (make block (center 0 (* clad_y -1)) (size grt_length 
(/ (- ly
core_thick) 2) infinity)
                        (material (make material-function (epsilon-func 
func_eps_clad)))))



;# Waveguide without grating for reference
;--------------------------------------------------------------------------------------


                (list
                        (make block (center 0 0) (size infinity core_thick 
infinity)
                        (material (make dielectric (epsilon core_eps)))))))



;# setting source parameters %%
;-----------------------------------------------------------------------------------------
(set! sources (list
                (make source
                        (src (make gaussian-src (frequency fcen) (fwidth df) ))
;                       (src (make continuous-src (frequency freq) (width 5) ))
                        (component Ez)
                        (center src_x 0))))



;# setting boundary conditions & resolution for simulation %%
;----------------------------------------------------------------------------------------
(set! pml-layers (list (make pml (thickness dpml))))

(set! resolution res)
(use-output-directory foldername)


;# setting the regions for flux collection to look at reflection
;# and transmission of the grating waveguide
;-------------------------------------------------------------------------------------------

(define trans ; transmitted flux
        (add-flux fcen df nfreq
                (make flux-region
                        (center trans_x 0) (size 0 (* core_thick 2)))))

(define refl ; reflected flux
        (add-flux fcen df nfreq
                (make flux-region
                        (center refl_x 0) (size 0 (* core_thick 2)))))          


;# setting the field extracting point, collects field at a set point
;------------------------------------------------------------
(define (my-field-point)
                (print "meep-time" "\t" (meep-time)  "\t"
                        (get-field-point Ez (vector3 trans_x 0)) "\n"))



;# setting simulation time and output files %%
;----------------------------------------------------------------------------------------------

(if grating? (load-minus-flux "refl-flux" refl))

(run-sources+ 300
;(run-until runtime
                (at-beginning output-epsilon)
                ;(at-every 0.1 my-field-point)
                (to-appended "ez" (at-every 1 output-efield-z)))



(if (not grating?) (save-flux "refl-flux" refl))

;(display-fluxes trans)
(display-fluxes trans refl)             ;print out the flux spectrum
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to