Hello, MEEP users,
I conducted a simulation to check the conservation of energy by using
flux-region, and somehow had a strange result. The simulation scheme is
the following. Step1) Run the simulation with a square shaped object and
a point source located at the center and accumulate the flux by
"flux-region" which surrounds the simulation space. Step2) For the
comparison purpose, run a simulation again without the object. I
expected that the resulting energy flux of the former and latter ones
was same, but they didn't.
Could someone tell me what is wrong with my script below? This code is
almost the same as the one in the tutorial of Near to Far Field Spectra.
The major change is "add-near2far" -> "add-flux", "near2far-region" ->
"flux region", and adding a square-shaped object. (and some parameters)
Of course, I checked that the resolution was fine enough and simulation
run-time was long enough.
The result was
when obj?=1: flux1:, 1.0, 2.2468183387481
when obj?=0: flux1:, 1.0, 2.45724366698102.
;----------------------------------------------------------------------
;----------------------------------------------------------------------
(define-param obj? 1)
(set-param! resolution 40)
(define-param sxy 8)
(define-param dpml 1)
(set! geometry-lattice (make lattice (size (+ sxy (* 2 dpml)) (+ sxy (*
2 dpml)) no-size)))
(set! pml-layers (list (make pml (thickness dpml))))
(if (= obj? 1)
(set! geometry (list
(make block (center 1 1) (size 1 1)
(material (make dielectric (epsilon 3)))))))
(define-param fcen 1.0)
(define-param df 0.4)
(define-param src-cmpt Ez)
(set! sources (list (make source (src (make gaussian-src (frequency
fcen) (fwidth df))) (center 0) (component src-cmpt))))
(define trans
(add-flux fcen df 1
(make flux-region (center 0 (* 0.5 sxy)) (size sxy 0))
(make flux-region (center 0 (* -0.5 sxy)) (size sxy 0)
(weight -1.0))
(make flux-region (center (* 0.5 sxy) 0) (size 0 sxy))
(make flux-region (center (* -0.5 sxy) 0) (size 0 sxy)
(weight -1.0))))
(run-until 200
(at-beginning output-epsilon)
(at-every 5 output-efield-z))
(display-fluxes trans)
;----------------------------------------------------------------------
;----------------------------------------------------------------------
Finally, I want to express my appreciation to MEEP developers.
Best,
Hirokazu Ishida.
_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss