Introduction
In this example, we use Ansys Lumerical FDTD and Ansys Lumerical RCWA to export Bidirectional Scattering Distribution Function (BSDF) data of a 1D grating to Zemax OpticStudio’s Tabular BSDF data file format (Zemax Tabular BSDF data file format – Ansys Optics). The results will be compared to far field projection from a unit cell simulation using the "Assume structure is periodic" option (Understanding the Assume Periodic option in far field projections – Ansys Optics). Although the workflow was demonstrated by exporting a BSDF for a simple grating, it is designed to be general and applicable to the description of scattering from more complex surfaces, such as rough or irregular materials.
The dimensions and the refractive indices of the simulated 1D grating used as an example in this article are presented below:
To export the BSDF data we need to calculate the power in each supported grating order for the following parameters:
- Direction: forward (from bottom to top) and backward (from top to bottom) propagation
- Angle of incidence (theta) and anisotropy (phi)
- Polarization (S and P)
- Wavelength (optional)
| Note: Although only single wavelength is supported by Zemax OpticStudio BSDF, we can run the simulation for multiple wavelengths and choose one of them for exporting the results. |
BSDF export from RCWA
- Open and run [[bsdf_RCWA.fsp]].
- Open and run [[bsdf_RCWA_Zemax_workflow.lsf]] script file.
The bsdf_RCWA_Zemax_workflow.lsf processes the grating simulation results by extracting angular transmission and reflection data, identifying the individual diffraction orders, and applying a Gaussian envelope to each order. This procedure introduces angular broadening and ensures that the optical energy is distributed over a finite angular range rather than being concentrated at discrete angular points. Finally, it exports the results to a Zemax OpticStudio Tabular BSDF data file.
| Note: The script might require several minutes to run depending on the number of wavelengths and incident angles. |
To export the BSDF we use the following excitation settings:
| Note: The incident polar angles (theta) must be in the range of (-90,0] and the azimuthal angles (phi) in the range of [0, 360). Also, in the “incident angle” option, “range” must be selected. |
| Note: To avoid ambiguity between source and surface rotations, the BSDF should be exported for azimuthal angles (phi) covering the full 0–360° range. |
To export the BSDF data, we need to enable the “report grating orders” result and disable the “return theta and phi as separate parameters when possible” before running the simulation.
BSDF export from FDTD
- Open [[bsdf_FDTD.fsp]] and run the sweep.
- Open and run [[bsdf_FDTD_Zemax_workflow.lsf]] script file.
The script will load the bsdf_FDTD_Zemax.fsp file and will load the results from the nested parameter sweep. To run the sweep, set the “run_sweep” parameter of the script to “true”.
Set the “target_lambda” parameter to the desired wavelength for exporting the monochromatic BSDF data at the selected wavelength. Please note that if the “target_lambda” is not one of the wavelengths available in the simulation results, then the available wavelength that is the closest to “target_lambda” will be chosen for the export. The wavelength will be included in the exported BSDF file names.
| Note: The incident polar angles in the sweep (theta_in_sweep) must be in the range of (-90,0] and the azimuthal angles (phi) in the range of [0, 360), both in order of increasing magnitude. |
| Note: To avoid ambiguity between source and surface rotations, the BSDF should be exported for azimuthal angles (phi) covering the full 0–360° range. |
Using the BSDF scatter model in Zemax OpticStudio
To visualize the results in Zemax OpticStudio, we use the exported BSDF file to define the scattering distribution on a Rectangle object in non-sequential mode (How to use tabular BSDF data to define the surface scattering distribution – Ansys Optics):
Since the upper and lower refractive indices used in FDTD and RCWA are 1.2 and 1.3 respectively, we define two Rectangular Volume objects with these indices and set up the scattering media at their common touching surface.
The reflection and transmission results for θ=-20° and φ=45° incident angle from RCWA and FDTD are visualized below on Detector Polar objects in OpticStudio:
The equivalent results from RCWA and FDTD are presented below:
| Note: The flipped transmission results shown above arise because the Zemax half‑polar detector (hemisphere) is rotated rather than mirrored, preserving the coordinate system handedness, and this difference in axis orientation compared to Lumerical (which effectively uses mirroring) leads to the observed differences in the plots. |
Important model settings
Description of important objects and settings used in this model
Beam width option
To prevent all the power from concentrating at discrete points corresponding to the grating orders, we apply a Gaussian envelope to each order to achieve broadening.
Assuming propagation in the z direction, the electric field of a Gaussian beam is given by:
$$E(r,z)= E_0\frac{w_0}{w(z)} \cdot exp(-\frac{r^2}{w(z)^2}) \cdot exp(iφ)$$
with \(exp(iφ)\) being the phase term and \(w_0\) the waist radius. The term \(w(z)\) can be expressed in terms of \(w_0\) and Rayleigh length \(z_R\): $$w(z)=w_0\sqrt{1+(\frac{z}{z_R})^2}=w_0\sqrt{z^2(\frac{1}{z^2}+\frac{1}{z_R^2})}=w_0 \cdot z\sqrt{(\frac{1}{z^2}+\frac{1}{z_R^2})}$$ where \(z_R=\frac{kw_0^2}{2}\)
For \(z≫z_R\):
$$w(z)≈w_0\frac{z}{z_R}$$ $$tanθ=\frac{r}{z} ⇒ r=z \,tanθ$$
Combining the equations above, ignoring the phase term and using \(tan^2 θ≈θ^2\):
$$E(θ)=E_0\frac{w_0}{w_z} \cdot exp(-\frac{θ^2}{(\frac{w_0^2}{z_R^2})})=E_0\frac{w_0}{w_z} \cdot exp(-\frac{θ^2}{(\frac{λ}{πw_0})^2})$$
with \(θ\) in rad. The beam width is: $$beam\,width \,(rad) = \frac{λ}{πw_0}$$ The beam width used for the BSDF export is in degrees, hence it is equal to: $$beam\, width \,(deg) = \frac{180}{π}\frac{λ}{πw_0}$$
For the specific grating example, the period is \(2µm\) and the wavelength is \(λ=0.55µm\). If we assume that the grating is illuminated by a Gaussian beam covering six periods, this corresponds to a beam waist \(w_0\) of:
$$w_0=\frac{No.\, of\,periods \cdot period}{2}=\frac{6 \cdot 2μm}{2}=6μm$$
This, in turn, corresponds to a beam width of:
$$beam\, width \,(deg) = \frac{180}{π}\frac{0.55μm}{π \cdot 6μm}≈1.67$$
Below, we compare the BSDF export assuming a beam width of 1.67 with the far‑field projection obtained from a monitor under periodic illumination, where the number of illuminated periods is set to six. The resulting angular broadening is the same in both cases, as expected.
| Note: A slight tilt is observed between the far-field projection and the BSDF export results at non-zero direction cosines. Although a standard textbook correction factor could be applied to align them, this is outside the scope of the present analysis. The purpose of this section is mainly to help users understand the meaning of the beam width and its physical interpretation. |
Additional Resources
Additional documentation, examples and training material