The model is based on the finite-element technique, implemented using the “COMSOL Multiphysics (V5.1)” software package.45 First, the Electromagnetic Waves, Frequency Domain (here and hereafter, terms in block capitals are COMSOL Multiphysics terms) module is used to calculate the EHP generation. Periodic ports with both s-polarized and p-polarized excitation are included, with added Diffraction Order ports for diffraction orders . Adding higher order diffraction ports does not significantly affect the resulting generation profile. Indeed, for normal incidence, diffraction maximums only occur for , where is the minimum wavelength reaching the grating, and is the refractive index of the partnering dielectric material. In the case of amorphous silicon solar cells, the majority of the shorter wavelength incident light is absorbed toward the surface of the device, far from the grating. Thus, we have and , which suggests that is sufficient. Parenthetically, light that has undergone higher order diffraction is more likely to subsequently undergo total internal reflection at the top surfaces of the device, and so does not reach the port. The boundaries running parallel to the axis are Floquet Periodic with the wavevector provided by the periodic ports. The back port behind the metal was assumed to be a perfect conductor. In these simulations, the back reflector is sufficiently thick that this approximation is acceptable (however, if thinner metallic layers were to be used, a perfectly matched layer would be necessary.) The mesh size is set to Fine.