Troubleshooting FDTD Simulations

It is common to set up and run an FDTD simulation and obtain unexpected results that you suspect are inaccurate. These unexpected results may be physically impossible (such as transmission results greater than one), or different from results from another source (such as a paper or another simulation). This may indicate that there is a mistake in the setup of the simulation.

This topic will address the subject of how to identify and fix these issues with your simulation setup. If you suspect that there is an error with your simulation setup but don’t know what it is, this topic is a good place to start.

In the first post of this topic, I will describe some general tips and strategies for troubleshooting FDTD simulations. Following posts will be added over time that discuss troubleshooting specific simulation issues in more detail. I will also provide links below to existing topics that address troubleshooting issues.

Posts in this topic:
General FDTD troubleshooting tips and strategies
Transmission results greater than one

Other troubleshooting topics:
Diverging simulations
Replicating published results

General FDTD Troubleshooting Tips and Strategies

There could be many possible issues causing inaccurate results, and these issues do not necessarily produce the same type of results every time they occur. This means it is difficult to be general when discussing troubleshooting simulations. However, in this post I will list some tips and strategies that we find are often useful when trying to determine the causes of inaccurate results or errors in FDTD simulations.

If you encounter issues with your FDTD simulation, the following steps may be helpful in determining the cause of error:

  1. Check important settings: Check that your simulation settings are correct as described in the Key FDTD settings topic. This topic discusses some of the most important settings for FDTD simulations, for example the mesh, simulation time, and simulation region span, which are the cause of many FDTD simulation errors.

  2. Search online resources: There are various online resources that could help you troubleshoot your simulation. For example, the FDTD category in the Knowledge Exchange (KX) has many customer support cases which commonly deal with troubleshooting issues. It is very likely that another user has encountered similar issues to yours, so searching the KX for similar issues is a good place to start if you are having problems with your simulation.

    The Application Gallery also has many example simulations and pages that discuss approaches to various types of simulation. These examples often include tips on how to properly set up specific types of simulations.

  3. Simplify your simulation: When developing FDTD simulations it is a good idea to start with a very simple structure along with your sources and monitors. Once the results for this simple simulation are accurate, you can gradually increase the complexity of your simulation, making sure the settings are correct at each step.

    For example, you can:

    • Start by approximating your structure with a 2D simulation before extending to a full 3D FDTD simulation. A 2D simulation is much faster to run, decreasing the time required to develop the simulation.
    • Start with a single wavelength simulation with non-dispersive materials before moving to a broadband simulation.
    • If measuring transmission/reflection from a patterned substrate, start with a simulation of an unpatterned substrate, and compare your FDTD results with results using the stackrt command.

    A similar approach can be useful for troubleshooting. If your full simulation is generating inaccurate results, reducing the complexity of your simulation step-by-step can help determine which aspect of the simulation or the geometry is causing the error.

  4. View fields with monitors: Movie or DFT monitors can be used to view the fields in simulations, which can be helpful in determining where an error occurs. For example, these monitors can be used to determine where the fields are diverging in a diverging simulation, or if sources are injecting the input pulses properly.

  5. Reduce the bandwidth: While FDTD simulations can be used to obtain broadband results, some aspects of an FDTD simulation do not work as well with a large bandwidth. For example, it can be more difficult to find a good material fit, the PML boundaries may not absorb properly at all wavelengths, and sources may not inject light properly (the last point can be improved using multifrequency injection).

    For this reason, the bandwidth should only include wavelengths over which the results are being calculated. If using a large bandwidth (larger than a few hundred nm for optical simulations), it can be helpful to break up the bandwidth over multiple simulations.

  6. Check field profiles of sources: It is common for source fields to be improperly calculated or truncated by the edges of the source object. For example, the span of this mode source is too small to contain the entire modal field:

    image

    It is a good idea to double-check the field profiles of sources before running an FDTD simulation. Make sure the span of the sources is large enough such that the amplitudes of the modal fields reach close to zero (around 10^{-3}) at the edges of the source. It is also often a good idea to check the individual components of the source E field profile to ensure that the polarization is correct.

  7. Convergence testing: If you believe your settings are close to correct, convergence testing should be used to finalize your simulation settings and make sure your results are accurate. This is an especially important step if you would like to compare your results to data from another source, such as a published paper or another simulation.

Transmission Results Greater Than One

Occasionally the results of an FDTD simulation will show normalized transmission values greater than one, which is, in general, incorrect for linear simulations. In this post I will discuss a few of the more common causes of this issue and how they can be fixed.

Note that while this post specifically addresses transmission values greater than one, the issues discussed here can also be sources of inaccurate transmission results in general. If you suspect that your transmission results are inaccurate, you should consider if these issues are relevant for your simulation.

Simulation Ends Before Autoshutoff Minimum Reached

One of the more common causes of this issue is the simulation ending before the light leaves the simulation region. This is generally the most common cause of transmission results greater than one, and is particularly relevant for resonator structures.

In most cases, we would like the simulation to end when it reaches the “autoshutoff minimum”, which is a measure of the energy left in the simulation region. However, the simulation can also end when the “simulation time” is reached, while there is still a significant amount of energy left in the simulation. This causes artifacts in the transmission spectra which appear as “oscillations” or “ripples” that can increase the transmission to values greater than one. For example, here are the transmission results for a varFDTD ring resonator simulation with different simulation times:

image

You can see how your simulation is ending by looking at the “Simulation status” result of the FDTD solver object after the simulation is run. A result of 1 indicates the simulation ran for the full simulation time and 2 indicates that the simulation ended by reaching the autoshutoff minimum. The FDTD solver object also provides an “autoshutoff level” result, which plots the autoshutoff level vs. computation time, that you can use to view the autoshutoff level. You can also see how the simulation ended by looking at the log file.

If your simulation is ending because the simulation time is being reached, increase the simulation time until the simulation is able to reach the autoshutoff level. If the autoshutoff level is reached and the problem persists, you may have to decrease the autoshutoff level as well. Both the simulation time and the autoshutoff levels are properties of the FDTD Solver object.

Purcell Enhancement of Dipole Sources

The source power used to normalize transmission results when dipole sources are used is the power emitted by the dipole in a homogeneous environment. Due to Purcell enhancement, the power emitted by the dipole may change if it is placed inside a more complex environment. Note that this is not an error, because the actual power emitted by the dipole is changing.

You can renormalize your results using the “dipolepower” script command, which will return the actual power emitted by the dipole:

transmission("monitor")*sourcepower(f)/dipolepower(f)

Here the “sourcepower” command returns the power emitted by the dipole in a homogeneous medium (which is used to normalize the transmission results by default) and “f” is a vector of frequencies. Note that in dispersive materials with a non-zero imaginary part of the permittivity or with a very high mesh density, the “dipolepower” command will return incorrect results, and a box of monitors around the dipole must be used to obtain the power emitted by the dipole.

More Information:

Dipoles in non-homogeneous materials

dipolepower script command

Improper Source Injection

Various errors can occur when sources inject the input pulses into the simulation domain. Scattering can occur at the injection plane, in particular for mode sources, broadband sources or sources at an angle. This can also happen when using an imported source with an electric field profile that does not propagate properly.

This scattering can throw off the power normalization used for the transmission measurements, leading to inaccurate results. Similar to the Purcell enhancement of dipole sources, if fields are reflected back into the source plane they can interfere with the injection of the source pulse, affecting the transmission result normalization.

You can often fix source injection errors by moving the source away from any reflecting surfaces , adding a monitor in front of the source to measure the actual power emitted by the source and renormalizing your results, or increasing the span of your source objects to avoid truncating the source fields.

More Information:

Source injection errors

Imported source errors

Reflections from PML Boundaries

Ideally PML boundaries will absorb all of the light incident upon them. However, this may not always be the case, for various reasons. Light reflected from PML boundaries can cause transmission values greater than one. This can also happen if you are using stabilized PML boundaries, which are less efficient than the standard PML BCs.

If you suspect that the PML boundaries are not properly absorbing the light in your simulation, increase the number of layers in the PML boundaries . If your simulation is periodic or you are using a source with a high angle of injection, use the steep angle PML profile for your boundaries.

More Information:

Choosing the PML profile

Materials With Gain

If the materials in your simulation have gain the total power in the simulation can increase beyond what was added by the source. This can cause the power transmitted through the monitors to be greater than one. If you don’t intend to have materials with gain, check the material fits in the Material Explorer to make sure that the imaginary part of the permittivity of your materials is not negative.

More information:

Modifying material fits

TFSF Source Normalization

The TFSF source normalization works differently than the other sources, which can result in transmission results greater than one. Note that this is not necessarily an error, however typically cross-section results are used with TFSF sources rather than results normalized to the source power.

More information:

Understanding source normalization for the TFSF source

Tips and best practices for using the TFSF source

Divergence

If your simulation is diverging, typically it will diverge beyond the autoshutoff max and the simulation will end, with an error notification. However, it is possible that your simulation is diverging without passing the autoshutoff max, which will not be automatically detected by the software. To check to see if this is happening, you can chech the FDTD solver’s “autoshutoff level” result to see the amount of energy in the simulation as a function of time. If it is increasing, this could be caused by a diverging simulation.

More information:

Fixing diverging simulations.

2 Likes