The FDTD solver is used to model a one-dimensional multilayer stack cavity. The structure exhibits a resonance with a high quality factor (Q-factor). The example will demonstrate how to accurately extract the resonance frequencies and Q-factors while keeping the simulation time short.

## Overview

Understand the simulation workflow and key results

The cavity is composed of two distributed Bragg reflectors (DBRs) that act as mirrors which trap light between them. The FDTD solver is used to determine the resonance frequency and the corresponding quality factor. Since the system is one-dimensional, a semi-analytic approach can be used to obtain a reference solution as well.

## Run and results

Instructions for running the model and discussion of key results

- Open the simulation file and corresponding script file.
- Run the script. It will run the simulation and do all associated analysis.

### Analytical calculation of reflectivity and transmissivity

The script will first obtain the analytical reference solution. To do so, it uses the script command “stackrt” to analytically calculate the reflectivity and transmissivity of a single Bragg mirror. For this example, we find almost perfect reflection in the wavelength range from 800nm-1200nm. This region is also referred to as the band gap.

The script then calculates and plots the reflectivity and transmissivity of the entire cavity structure with both mirrors. In the corresponding plot, we can identify a sharp line in the middle of the band gap. Calculating the R and T around this line with higher resolution shows a Lorentzian line-shape with a peak wavelength at around \(\lambda_0 = 988.44nm \).

By using the “findpeaks” script command, the center frequency \(f_0 \) can be determined automatically and more accurately. The Q-factor is then calculated via \(Q=\frac{f_0}{f_{FWHM}} \) where \(f_{FWHM} \) is the full width at half maximum of the peak. The resulting values are:

Theory: Resonance Wavelength: 988.443nm; Q: 431587

### Numerical calculation and post-processing

After the analytical calculation, the script automatically generates the geometry of the cavity and configures the FDTD solver. See the Important model settings for more information on configuring the solver for high Q cavity simulations. It then runs the simulation and extracts the resonance frequency and the quality factor by running the “findresonances” command on the recorded time data:

Simulation: Resonance Wavelength: 991.768nm; Q: 418836

The relative deviation from the analytical solution is approximately 0.3% for the resonance wavelength and around 3% for the Q-factor.

## Important model settings

Description of important objects and settings used in this model

### Perfectly Matched Layers (PMLs)

A simple rule of thumb is to keep PML boundaries at least half a wavelength away from the structures. If the PML boundaries are too close to the structures they may absorb radiation that would have otherwise remained in the simulation, and this is an artificial source of loss.

### Source

For this example, a plane wave is used to excite the structure. For best performance and accuracy, it is important to avoid exciting resonances outside of the frequency range of interest. In this case, we only want to excite modes inside the bandgap of the DBRs. The wavelength range of the source is therefore chosen as 950nm-1050nm. When setting up a narrow band source, be sure to disable the 'optimize for short pulse' option.

### Point monitor

To determine the resonance frequency and the Q-factor, a time monitor is used to record the fields inside the cavity over time. The placement of the monitor is in the middle of the cavity between the mirrors since this is where the resonant fields will be strongest. In more complex devices, several time monitors can be used so that the fields from the resonance will be recorded even if some of the monitors happen to be at a node of a specific mode.

### Mesh override regions

If the device has periodicity, it is important for the simulation mesh to match the periodicity of the device. If mesh lines fall at different locations for each period of the structure, each period will be meshed in a slightly different way, breaking the perfect periodicity required in a high Q system. This problem can be avoided by ensuring that there is an integer number of mesh cells in each unit cell.

In addition, relatively small cell sizes are required to obtain accurate results. This is because the FDTD method always introduces a certain phase error. This error is typically negligible, but in extremely phase-sensitive devices such as high Q resonators, those errors can build up. To improve the accuracy, one has to reduce the cell size of both the general mesh and of the mesh refinement regions.

### Analysis script

To obtain stable and accurate results from the “findresonances” script command, it is important to remove the initial part of the time signal where the source is still active. In this example, the first 200fs of the signal are discarded and only the remaining 800fs are analyzed.

## Updating the model with your parameters

Instructions for updating the model based on your device parameters

### Modifying the structure

The geometry of the high Q cavity is automatically generated by the script for each run. By changing parameters such as the refractive indices, the number of layers per DBR, or the width of the cavity, the geometry can be modified easily.

## Taking the model further

Information and tips for users that want to further customize the model

Mode profiles: Once the resonance frequency of a mode is known, the profile can be computed by adding a frequency domain power or profile monitor at the determined frequency. Because of the slow decay od the fields, it will be necessary to enable apodization in order to obtain accurate results.

Purcell factor: Once the mode profile is known, the Purcell factor can also be computed. The Purcell factor is a measure of the enhancement of the rate of spontaneous emission of a source compared to the rate in a homogeneous environment and it can be calculated using the expression

$$ F_p=\frac{3}{4\pi^2}\left(\frac{\lambda_0}{n}\right)\frac{Q}{V_{eff}} $$

where \(\lambda_0\) is the resonance wavelength, \(Q\) is the quality factor, and \(V_{eff}\) is the effective mode volume. The definition of \(V_{eff}\) is not unique, but for modes with very high Q factors the definition

$$ V_{eff}= \int\frac{\varepsilon |E|^2 dV}{max(\varepsilon |E|^2)} $$

works well in practice.

## Additional resources

Additional documentation, examples and training material

### See also

- Waveguide-based Bragg microcavity example
- Whispering gallery modes example
- Plasmonic resonator example
- Modal volume
- Purcell factor

### Related Ansys Innovation Courses

## Appendix

Additional background information and theory

### Calculating quality factors

There are two classes of cavities for Q factor calculations, low Q cavities and high Q cavities. Each class of cavity requires a different approach to calculate the quality factor.

** Low Q cavities **

For this discussion, a low Q cavity is when the electromagnetic fields decay completely from the simulation volume in a time that can be simulated reasonably by FDTD. In this case, the quality factor can be determined from the Fourier transform of the field by finding the resonance frequencies of the signal and measuring the full width half maximum (FWHM) of the resonant peaks. We can then use \(Q=f_R/\nabla f\) where \(f_R\) is the resonant frequency and \(\nabla f\) is the FWHM.

The first figure below show the time domain fields within a cavity. Notice that they decay to zero by the end of the simulation. Also notice that the plot does not start from t=0. The initial portion of the time signal is neglected since it is important to ignore any transients due to the initial source pulse. The second figure shows the spectrum of the same signal, from which \(f_R\) and \(\nabla f\) can be measured. This method is implemented in the Low Q analysis object.

** High Q cavities **

A cavity is considered to be a high Q cavity when the electromagnetic fields cannot completely decay from the simulation in a time that can be simulated reasonably by FDTD. In this case, we cannot determine Q from the frequency spectrum because the FWHM of each resonance in the spectrum is limited by the time of simulation, \(T_{sim}\), by \(FWHM \sim 1/T_{sim}\). Instead, we use the findresonances script command to extract the Q from a portion of the time signal. This method is implemented in the Q analysis object.

Similar to Low Q cavities, it is necessary to disregard the initial portion of the time signal due to transients from the initial source pulse. The required time is problem dependent, but typically 1-2 times the source pulse is sufficient.

The following figures show the time signal from a high Q cavity. Line 1 (blue) is the complete time signal and Line 2 (green) shows the portion of the time signal that will be used in the analysis. Notice that the fields do not decay significantly by the end of the simulation. It is also interesting to note the shape of the envelope in the second figure is simply from the sample rate of the monitor, not actual decay of the fields.

The following figure shows an fft of the above time signal (green). As explained above, the quality factor cannot be obtained from the FWHM of the resonance for time signals such as this that have not decayed.