Direct Optical Surface Roughness Modeling
Optical devices are generally simulated using ideal structures. These ideal geometries are critical in finding major features of the optical response. Unfortunately, fabrication of such devices rarely results in structures that are ideal. In particular, surface roughness is rarely considered in simulations of optical devices even though it may have a significant impact on their optical performance. One of the reasons for the rarity is the difficulty of applying surface roughness to non-planar surfaces. 
In this work. we programmatically model roughness via Python mesh manipulation libraries. The generated roughened structures are then imported into COMSOL® and the optical effects of surface roughness are explored as electromagnetic scattering problems with the COMSOL® Wave Optics module. We handle the import the generated structures via the COMSOL® LiveLink™ for MATLAB®. Scripting of the structure generation is done via MATLAB’S interface to Python. The figure below demonstrates the full simulation pipeline. The process begins an initial geometry created with any 3D CAD software or engine. At the next stage, the 3D geometry is roughened via mesh manipulation, using Python to exhibit given roughness statistics.
Finally, the LiveLink™ for MATLAB® is used to import the structure into COMSOL® where full wave electromagnetic simulations are carried out. In particular, due to the automated generation of roughness many realizations of roughness features with the same or diverse statistics may be easily realized. By allowing for rapid simulation of a variety of roughness scenarios, numerical studies of these effects may be carried out. Such synthetic experiments are key for data driven optimization techniques such as machine learning.