flexcompute / tidy3d

Fast electromagnetic solver (FDTD) at scale.
https://docs.flexcompute.com/projects/tidy3d/en/latest/
GNU Lesser General Public License v2.1
186 stars 41 forks source link

Bent Waveguide Modes Effective Index #1750

Closed smgitrep closed 5 months ago

smgitrep commented 5 months ago

I noticed the ModeSolver always finds real effective indices for bent waveguide modes. I expected the effective indices to be complex to account for radiation loss. Can the ModeSolver compute complex effective indices?

momchil-flex commented 5 months ago

By default the mode solver uses PEC boundaries, so there is no loss in the simulation. To capture radiative loss, you need to add PML instead by setting e.g. num_pml = (12, 12) in the ModeSpec. There are a few things to note:

smgitrep commented 4 months ago

Thank you for the detailed response. Could you clarify if the boundary_spec parameter in td.Simulation is used by the ModeSolver?

momchil-flex commented 4 months ago

No, Simulation.boundary_spec does not affect the mode solver, it is only for FDTD simulations. In principle, the mode solver boundary (as defined by the mode plane) can be (and often is) much smaller than the enclosing simulation domain boundary. We need to truncate the mode solve differently than the FDTD simulation. For lossless fields that decay by the mode plane boundaries, using the default PEC works very well and avoids some of the PML complications. However, if you want to capture the losses, then you have to set the num_pml in the mode_spec of the mode solver.