Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-08-15 Thread Ardavan Oskooi
Note that due to the Fourier Uncertainty Principle, the runtime should 
be at least ~1/frequency resolution. In practice, the runtime may even 
have to be twice as large as demonstrated in 
https://meep.readthedocs.io/en/latest/Python_Tutorials/Custom_Source/#stochastic-dipole-emission-in-light-emitting-diodes. 
Try switching to the meep.Simulation(run=run_time) run function and 
repeatedly double run_time.


On 8/15/2020 8:11, J. Philip Haupt wrote:
I've tried increasing PML thickness (went up to 8 micron) and 
resolution (went up to 150). As for run time, I am using the decay 
factor, and have manually been terminating it when the reflectances 
exceed unity. I think the maximum time I've run for is around 3000 units.




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

Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-08-15 Thread J. Philip Haupt
I've tried increasing PML thickness (went up to 8 micron) and resolution 
(went up to 150). As for run time, I am using the decay factor, and have 
manually been terminating it when the reflectances exceed unity. I think 
the maximum time I've run for is around 3000 units.


On 2020-08-14 9:11 a.m., Ardavan Oskooi wrote:


For additional details regarding PMLs in Meep, see: 
https://meep.readthedocs.io/en/latest/Perfectly_Matched_Layer/.


As described in 
https://meep.readthedocs.io/en/latest/FAQ/#checking-convergence, you 
need to check the convergence by increasing the resolution, PML 
thickness, and run time (for Fourier spectra). Have you also tried 
doubling the run time?


On 8/13/20 17:06, J. Philip Haupt wrote:
I still haven't gotten this to work. It seems to work in the 
wavelength range 300-1000 nm (which is with different fits), but not 
1000-1200 nm (with fit shown in the previous email).


For what it's worth, my colleague got a converged result using 
Lumerical FDTD Solutions, specifically a "stretched coordinate" PML 
(SCPML). I have been trying to map the parameters in MEEP's PML class 
to the parameters used by Lumerical, but without much luck. Is there 
any documentation for how to change more "standard" PML parameters 
(what Lumerical calls layers (=thickness?), kappa, sigma, polynomial 
(which I assume = degree of pml_profile))? This would help me 
benchmark his results with MEEP.


Also, what does the mean_stretch parameter in meep.PML do? It is 
listed in the documentation 
 
but not explained.




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

Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-08-14 Thread Ardavan Oskooi
For additional details regarding PMLs in Meep, see: 
https://meep.readthedocs.io/en/latest/Perfectly_Matched_Layer/.


As described in 
https://meep.readthedocs.io/en/latest/FAQ/#checking-convergence, you 
need to check the convergence by increasing the resolution, PML 
thickness, and run time (for Fourier spectra). Have you also tried 
doubling the run time?


On 8/13/20 17:06, J. Philip Haupt wrote:
I still haven't gotten this to work. It seems to work in the 
wavelength range 300-1000 nm (which is with different fits), but not 
1000-1200 nm (with fit shown in the previous email).


For what it's worth, my colleague got a converged result using 
Lumerical FDTD Solutions, specifically a "stretched coordinate" PML 
(SCPML). I have been trying to map the parameters in MEEP's PML class 
to the parameters used by Lumerical, but without much luck. Is there 
any documentation for how to change more "standard" PML parameters 
(what Lumerical calls layers (=thickness?), kappa, sigma, polynomial 
(which I assume = degree of pml_profile))? This would help me 
benchmark his results with MEEP.


Also, what does the mean_stretch parameter in meep.PML do? It is 
listed in the documentation 
 but 
not explained.


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

Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-07-31 Thread J. Philip Haupt
Thanks, but it seems like this doesn't change much. I turned off 
subpixel averaging, increased the resolution to 100, and also increased 
the PML thickness to 1.2 (=max wavelength). I have run so far for 1800 
time units. At 25 time units, the field decay was 0.0090 whereas at 1725 
time units the field decay is 0.0433 (and some absorption values are 
negative). I get the same problem if I replace the sidewall-angle-Prism 
pyramid with a set of Block objects to approximate a pyramid.


On 2020-07-30 9:46 p.m., Ardavan Oskooi wrote:
Try turning off subpixel averaging since it sometimes causes 
instabilities with the prism sidewall angle feature. This means that 
you will also need to increase the resolution.


On 7/29/20 16:38, J. Philip Haupt wrote:

I get that the fields diverge (albeit very slowly), at least so it 
seems. Boundary conditions are k_point=Vector3(0,0,0) with PML in the 
Z direction. My guess has been that the pyramid reflects light such 
that it hits the PML at a glancing angle and this gives reflective 
artefacts. I've hence played with PML parameters (thickness, profile, 
R_asymptotic) and the distance between sources, monitors and 
structure, but so far haven't gotten anything to work. Is perhaps the 
absorption too small for MEEP to handle (i.e. leading to significant 
roundoff errors)? Is there a workaround? What are some typical values 
to try if the defaults do not work?



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

Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-07-30 Thread Ardavan Oskooi
Try turning off subpixel averaging since it sometimes causes 
instabilities with the prism sidewall angle feature. This means that you 
will also need to increase the resolution.


On 7/29/20 16:38, J. Philip Haupt wrote:

I get that the fields diverge (albeit very slowly), at least so it 
seems. Boundary conditions are k_point=Vector3(0,0,0) with PML in the 
Z direction. My guess has been that the pyramid reflects light such 
that it hits the PML at a glancing angle and this gives reflective 
artefacts. I've hence played with PML parameters (thickness, profile, 
R_asymptotic) and the distance between sources, monitors and 
structure, but so far haven't gotten anything to work. Is perhaps the 
absorption too small for MEEP to handle (i.e. leading to significant 
roundoff errors)? Is there a workaround? What are some typical values 
to try if the defaults do not work?


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

[Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-07-29 Thread J. Philip Haupt

Hi,

I am trying to check some optical plots in the following paper: 
https://www.nature.com/articles/s41598-020-68704-w


Here is a smaller/quicker-to-simulate version of the problem. I am 
interested in silicon at long wavelength (up to 1.2 μm), and have fit 
Lorentzians to Schinke et al data to get the following:


   eps01=1.757e+00

   cSi_sig1=1.742452232381217e+00
   cSi_frq1=2.268393842625499e-03
   cSi_gam1=1.000e-06

   cSi_sig2=4.413478307846660e+00
   cSi_frq2=5.563486517688901e-03
   cSi_gam2=1.039533704134854e-05

   cSi_sig3=4.346562778556655e-04
   cSi_frq3=1.015803616840379e-03
   cSi_gam3=4.436686697711304e-05

   cSi_sig4=2.667407380976183e+00
   cSi_frq4=3.019419346733225e-03
   cSi_gam4=7.381034557205803e-06

   cSi_sig5=1.874745406362289e+00
   cSi_frq5=2.999546106465388e-03
   cSi_gam5=2.153817716389790e-06

   cSi_sig6=-4.082635925775152e-02
   cSi_frq6=2.261035517057193e-03
   cSi_gam6=5.061060071803692e-04

   cSi_susc = [mp.LorentzianSusceptibility(frequency=cSi_frq1*1000,
   gamma=cSi_gam1*2000, sigma=cSi_sig1),
   mp.LorentzianSusceptibility(frequency=cSi_frq2*1000,
   gamma=cSi_gam2*2000, sigma=cSi_sig2),
   mp.LorentzianSusceptibility(frequency=cSi_frq3*1000,
   gamma=cSi_gam3*2000, sigma=cSi_sig3),
   mp.LorentzianSusceptibility(frequency=cSi_frq4*1000,
   gamma=cSi_gam4*2000, sigma=cSi_sig4),
   mp.LorentzianSusceptibility(frequency=cSi_frq5*1000,
   gamma=cSi_gam5*2000, sigma=cSi_sig5),
   mp.LorentzianSusceptibility(frequency=cSi_frq6*1000,
   gamma=cSi_gam6*2000, sigma=cSi_sig6)]

   cSi = mp.Medium(epsilon=eps01, E_susceptibilities=cSi_susc,
   valid_freq_range=cSi_range)


I am interested in the absorption of an inverted pyramid photonic 
crystal structure in the 1-1.2 μm wavelength range. If I start with just 
a silicon slab:


   zSi = dpml+2*monpad+dsi/2
   siFilm = mp.Block(size=mp.Vector3(sx,sy,dsi),
    center=mp.Vector3(0,0,zSi),
    material=cSi)
   geometry = [siFilm]

I get that my code converges and the absorption looks basically how I 
expect it to. If I add a pyramid of air using the sidewall_angle argument:

    zPyrAir = zSi + dsi/2
    vertices = [mp.Vector3(sx*0.5,sy*0.5,zPyrAir),
mp.Vector3(sx*0.5,sy*-0.5,zPyrAir),
mp.Vector3(sx*-0.5,sy*-0.5,zPyrAir),
mp.Vector3(sx*-0.5,sy*0.5,zPyrAir)]
    pyr_air = mp.Prism(vertices,
    # remove small number so that vertices at top 
don't overlap (otherwise crashes)

    height=pyr_height_h-1e-10,
    axis=mp.Vector3(0,0,-1),
sidewall_angle=-t_angle*pi/180,
material=mp.Medium(epsilon=1))

    geometry = [siFilm, pyr_air]

I get that the fields diverge (albeit very slowly), at least so it 
seems. Boundary conditions are k_point=Vector3(0,0,0) with PML in the Z 
direction. My guess has been that the pyramid reflects light such that 
it hits the PML at a glancing angle and this gives reflective artefacts. 
I've hence played with PML parameters (thickness, profile, R_asymptotic) 
and the distance between sources, monitors and structure, but so far 
haven't gotten anything to work. Is perhaps the absorption too small for 
MEEP to handle (i.e. leading to significant roundoff errors)? Is there a 
workaround? What are some typical values to try if the defaults do not work?


I've attached code as well which contains all the details.

For what it's worth, I also find that with this structure I can only add 
one symmetry (as discussed earlier on this mailing list), although my 
results are slightly different (<1%) and the run time improvement is not 
substantial.


Philip
"""
..moduleauthor:: jph
..date:: 2020-07-28

One minimal example to test MEEP long wavelength absorption and symmetry:
1 micron silicon slab. I am mostly checking for convergence, not necessarily 
correctness

Sent version
"""

import sys
import meep as mp
from math import pi, tan, sin
import numpy as np 
from matplotlib import pyplot as plt 

cSi_range = mp.FreqRange(min=1/1.2, max=1/1.)

eps01=1.757e+00
 
cSi_sig1=1.742452232381217e+00
cSi_frq1=2.268393842625499e-03
cSi_gam1=1.000e-06

cSi_sig2=4.413478307846660e+00
cSi_frq2=5.563486517688901e-03
cSi_gam2=1.039533704134854e-05

cSi_sig3=4.346562778556655e-04
cSi_frq3=1.015803616840379e-03
cSi_gam3=4.436686697711304e-05

cSi_sig4=2.667407380976183e+00
cSi_frq4=3.019419346733225e-03
cSi_gam4=7.381034557205803e-06

cSi_sig5=1.874745406362289e+00
cSi_frq5=2.999546106465388e-03
cSi_gam5=2.153817716389790e-06

cSi_sig6=-4.082635925775152e-02
cSi_frq6=2.261035517057193e-03
cSi_gam6=5.061060071803692e-04

cSi_susc = [mp.LorentzianSusceptibility(frequency=cSi_frq1*1000, gamma=cSi_gam1*2000, sigma=cSi_sig1),
mp.LorentzianSusceptibility(frequency=cSi_frq2*1000, gamma=cSi_gam2*2000, sigma=cSi_sig2),
mp.LorentzianSusceptibility(frequency=cSi_frq3*1000, gamma=cSi_gam3*2000, sigma=cSi_sig3),