Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial example on breakdown of glancing-angle mode launcher? #1130

Closed
stevengj opened this issue Feb 18, 2020 · 5 comments · Fixed by #1133
Closed

tutorial example on breakdown of glancing-angle mode launcher? #1130

stevengj opened this issue Feb 18, 2020 · 5 comments · Fixed by #1133

Comments

@stevengj
Copy link
Collaborator

Although we support eigenmode sources (and mode coefficients) for oblique waveguides (see #698 and #940), of course problems will arise as the waveguide approaches glancing incidence to the source plane:

  1. The intersection of the waveguide with the source plane becomes larger and larger, necessitating a bigger computational cell.

  2. Modal dispersion becomes a problem: the sensitivity of the field pattern (in the source plane) to frequency becomes larger and larger, so an eigenmode source will become narrower bandwidth. Probably discretization errors become worse as well.

It might be nice to have a tutorial example illustrating this, to give a rough rule of thumb of the maximum angle where this is practical.

(Of course, for angles greater than 45° you will always be better off rotating the source plane, but in some circumstances this might be inconvenient, e.g. if you are continuously optimizing the waveguide angle.)

@oskooi
Copy link
Collaborator

oskooi commented Feb 18, 2020

As shown in the field profiles below for waveguide rotation angles of 0°, 20°, 40°, 60°, 80°, and 100°, there does not seem to be any noticeable distortion in the mode as the waveguide approaches glancing incidence to the source plane. (Note that the field profiles of the single-mode waveguide were obtained using a CW source.) Additionally, the total power in the waveguide mode (as measured by a flux monitor using a pulse source) varies less than 5% at 80° relative to 0°.

oblique_waveguide_source_rotation

As long as the line source/monitor fully intersects the waveguide, it seems that the mode can be properly launched/decomposed. In this example, the maximum waveguide rotation is ~83°.

oblique_rotangle83

oblique_rotangle84

The script used to generate these results is based on Tutorials/Eigenmode Source/Index-Guided Modes of a Ridge Waveguide:

import meep as mp
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt

resolution = 50 # pixels/μm                                                                                                                                                                   

cell_size = mp.Vector3(14,14)

pml_layers = [mp.PML(thickness=2)]

# rotation angle (in degrees) of waveguide, counter clockwise (CCW) around z-axis                                                                                                             
rot_angle = np.radians(80)

w = 1.0 # width of waveguide                                                                                                                                                                  

geometry = [mp.Block(center=mp.Vector3(),
                     size=mp.Vector3(mp.inf,w,mp.inf),
                     e1=mp.Vector3(1).rotate(mp.Vector3(z=1), rot_angle),
                     e2=mp.Vector3(y=1).rotate(mp.Vector3(z=1), rot_angle),
                     material=mp.Medium(epsilon=12))]

fsrc = 0.15 # frequency of eigenmode or constant-amplitude source                                                                                                                             
kx = 0.4    # initial guess for wavevector in x-direction of eigenmode                                                                                                                        
bnum = 1    # band number of eigenmode                                                                                                                                                        

kpoint = mp.Vector3(kx).rotate(mp.Vector3(z=1), rot_angle)

compute_flux = False # compute flux (True) or plot the field profile (False)                                                                                                                   

sources = [mp.EigenModeSource(src=mp.GaussianSource(fsrc,fwidth=0.2*fsrc) if compute_flux else mp.ContinuousSource(fsrc),
                              center=mp.Vector3(0),
                              size=mp.Vector3(y=14),
                              direction=mp.NO_DIRECTION,
                              eig_kpoint=kpoint,
                              eig_band=bnum,
                              eig_match_freq=True)]

sim = mp.Simulation(cell_size=cell_size,
                    resolution=resolution,
                    boundary_layers=pml_layers,
                    sources=sources,
                    geometry=geometry)

if compute_flux:
    tran = sim.add_flux(fsrc, 0, 1, mp.FluxRegion(center=mp.Vector3(x=5), size=mp.Vector3(y=10)) if rot_angle < np.pi/4 else mp.FluxRegion(center=mp.Vector3(y=5), size=mp.Vector3(10)))
    sim.run(until_after_sources=50)
    res = sim.get_eigenmode_coefficients(tran,
                                         [1],
                                         direction=mp.NO_DIRECTION,
                                         kpoint_func=lambda f,n: kpoint)
    print("flux:, {:.6f}, {:.6f}".format(mp.get_fluxes(tran)[0],abs(res.alpha[0,0,0])**2))
else:
    sim.run(until=100)
    sim.plot2D(output_plane=mp.Volume(center=mp.Vector3(), size=mp.Vector3(10,10)),
               fields=mp.Ez,
               field_parameters={'alpha':0.9})
    plt.title("rotation angle = {}°".format(int(np.ceil(np.degrees(rot_angle)))))
    plt.savefig("oblique_rotangle{}.png".format(int(np.ceil(np.degrees(rot_angle)))))

@stevengj
Copy link
Collaborator Author

I'm guessing that if you look at the flux at several frequencies, I'm guessing that it is more distorted at other frequencies as you go towards glancing incidence.

But it is nice to see that it is working so well! I was worried that you would start to see discretization effects by these angles.

@stevengj
Copy link
Collaborator Author

(At some point you will see discretization problems even if you have a large enough cell.)

@stevengj
Copy link
Collaborator Author

Note that only the eig_kpoint direction affects MPB (it changes one of the lattice vectors). MPB does not look at the block orientation directly (it only cares about the materials in the source plane, regardless of how they are created).

@oskooi
Copy link
Collaborator

oskooi commented Feb 24, 2020

There does not seem to be much difference in the relative error in the Poynting flux vs. rotation angle of the waveguide at different frequencies using a broadband source. The error (relative to 0°) increases with rotation angle as expected but the increase is independent of the frequency.

rot_err_res25_angle45

These results were generated using a y-directed line monitor which is why the maximum angle is 45° (above 45° and the waveguide no longer fully intersects the vertical line monitor). Note also the semilog scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants