It’s important to make sure that the correct vertical slab mode is selected in the Effective
index tab of the solver region prior to selecting the source mode.
The slab mode is required to determine the effective material properties at each point
in the simulation.
Sources in varFDTD need to know the effective material properties to function properly.
For example, the mode source in varFDTD calculates the supported waveguide modes based on the
effective 2D material properties, not the original 3D structure.
The supported waveguide modes from the source is a function of the vertical slab mode that
has been selected.
This is less important if you are injecting the fundamental mode of the mode source in
which case the mode will automatically update based on the selected vertical slab mode.
However, if you are injecting a higher order mode using the “user select” option, you
will need to update the mode selection whenever the slab mode is changed.
If using the “user select” method of selecting the mode to inject from the mode source, you
should also make sure that the selected mode has the same polarization as the selected
slab mode, either TE or TM.
By default, the boundary conditions in the z direction are set to metal.
This works well since the fields in the device are confined within a slab in the XY plane
and do not radiate out in the vertical direction, so as long as the z span of the solver region
is large enough that the full field profile of the slab mode can be included without truncating
the fields at the z min and z max boundaries, then metal boundaries can be used.
You can test whether the z span is large enough by increasing the z span of the solver region
and making sure that the calculated slab mode profile does not change.
If it does change, then a larger z span is needed.