How can I troubleshoot a diverged FDTD simulation?#
Date |
Category |
|---|---|
2023-12-04 22:43:53 |
Simulation Troubleshoot |
Tidy3D uses the Finite-Difference Time-Domain (FDTD) method, which is a popular technique for rigorously solving Maxwell’s equations. However, like all numerical methods, it can sometimes diverge if not properly set up. An FDTD simulation can diverge due to various reasons. In this article, we discuss common FDTD setting issues that could potentially lead to simulation divergence. If your simulation diverged, please follow this article and perform thorough troubleshooting, which will likely resolve the issue and ensure that your next FDTD run is stable.
Structures Inserted into PML at an Angle
Perfectly matched layer (PML) is the most commonly used boundary condition in FDTD simulations to truncate a simulation domain and absorb outgoing radiation. However, many divergence issues are associated with the use of PML. One of themost common causes of a diverged simulation is structures inserted into PML at an angle. This is particularly common in simulations with photonic waveguides, where PML intersects a waveguide bend or a waveguide taper. To ensure numerical stability, you need to make sure that structures are translationally invariant into the PML.
It is not always practically possible to have structures translationally invariant into PML. For example, in a waveguide-to-ring coupling simulation, part of the ring will have to intersect PML. In this case, using Tidy3D's adiabatic absorber boundary condition instead of PML is a good remedy. The absorber functions similarly to PML such that it absorbs the outgoing radiation to mimic the infinite space. However, the absorber has a slightly higher reflection and requires a bit more computation than PML but it is numerically much more stable. For the demonstration, please refer to the waveguide-to-ring coupling tutorial. In principle, you can manually extend the bent waveguide or ring into PML in a translational invariant way. This could be effective in preventing divergence but the artificial kink will inevitably lead to undesired reflection. In general, we recommend using the absorber boundary rather than this approach. Dispersive Material into PML
Incorporating a dispersive material into PML can also cause simulation divergence in certain scenarios. If your simulation lacks any structures inserted into PML at an angle but includes dispersive material in PML, it is advisable to substitute nondispersive material for the dispersive material. Alternatively, if dispersion is necessary, switchingPML to absorber can effectively address the issue.Evanescent Field Leaks into PML
PML can effectively absorb outgoing radiation with minimum reflection as if the radiation just propagates into the free space. However, it's important to keep in mind that PML only absorbs propagating fields. For evanescent fields, PML can act as an amplification medium and cause a simulation to diverge. In Tidy3D, a warning will appear if the distance between a structure is smaller than half of a wavelength to prevent evanescent fields from leaking into PML. In most cases, the evanescent field will naturally die off within half a wavelength, but in some instances, a larger distance may be required. One example is when using periodic or Bloch boundary conditions in two dimensions and PML in the last dimension only. In such simulations, there could be quasi-guided modes in the periodic directions which have very long evanescent tails in the PML direction. If a simulation diverges and you suspect that evanescent fields may be leaking into PML, simply increase the simulation domain size to avoid this issue.
Additionally, sources like PointDipole, UniformCurrentSource, or CustomFieldSource` can inject evanescent fields, so it's important to leave enough space between them and PML.