RayFlare: flexible optical modelling of solar cells

Optical modelling is a key part of the design of solar cells, as the number of absorbed photons in the photovoltaic layer(s) fundamentally limits the current which can be generated by the cell. Some types of cell design, such as multi-junction cells (where multiple semiconductors with different bandgaps are stacked in a single structure to each absorb a different part of the solar spectrum) or ultra-thin solar cells (Hirst, 2019), require even more careful optical design. In the first case, it is generally desirable to match the current generated in each layer, requiring tuning of e.g. the bandgaps and layer thicknesses, while in the second case light-trapping structures such as gratings or surface textures are required to maintain high absorption and thus current while reducing the semiconductor thickness.


Summary
Optical modelling is a key part of the design of solar cells, as the number of absorbed photons in the photovoltaic layer(s) fundamentally limits the current which can be generated by the cell. Some types of cell design, such as multi-junction cells (where multiple semiconductors with different bandgaps are stacked in a single structure to each absorb a different part of the solar spectrum) or ultra-thin solar cells (Hirst, 2019), require even more careful optical design. In the first case, it is generally desirable to match the current generated in each layer, requiring tuning of e.g. the bandgaps and layer thicknesses, while in the second case light-trapping structures such as gratings or surface textures are required to maintain high absorption and thus current while reducing the semiconductor thickness.
Light-trapping structures range from the relatively simple (e.g. dielectric layers used as antireflection coatings on the front surface of all commercial solar cells) to highly engineered structures for very specific purposes (e.g. diffraction gratings for ultra-thin gallium arsenide (GaAs) solar cells for space applications). As such, many different simulation methods exist which are appropriate for modelling the effect of different light-trapping structures. These include: • Simple Beer-Lambert law calculations: assumes the intensity of light in the material varies as I(z) = I 0 e −αz , where z is the depth in the material and α is the absorption coefficient. This neglects any effects due to reflection at interfaces, interference, diffraction etc. • Ideal/theoretical reference cases: such as a perfect mirror or perfect Lambertian scatterer. These are often used for comparison purposes to benchmark the performance of realistic structures. • Ray-tracing (RT): a geometric optics method suitable for calculating reflection and refraction due to large-scale (compared to the wavelength) textures, such as the pyramidal texturing commonly using for silicon solar cells. • Transfer-matrix method (TMM): a wave-optical method suitable for calculating interference effects in thin films (transparent or absorbing). This is useful for e.g. calculating the effect of an anti-reflection coating on the front surface of a cell, or a distributed Bragg reflector (DBR) designed to reflect specific wavelengths of light. • Full Maxwell solvers: including rigorous coupled-wave analysis (RCWA), also referred to as the Fourier modal method (FMM), finite element modelling (FEM) or finitedifference time-domain (FDTD) methods. Since these are more general solutions for solving Maxwell's equations in (periodically) textured layers, these have many uses, but are often used in solar cell optics research to calculate the effect of gratings or arrays of nanoparticles on absorption in the cell.

Ray-tracing: Geometric optics for large-scale textures without diffraction effects
Transfer-matrix method: Wave optics for planar layers (coherent and incoherent) Rigorous coupled-wave analysis: Wave optics for planar or periodic structures e.g. gratings, photonic crystals

Statement of need
The aim of RayFlare is to provide a single integrated environment with a consistent approach to defining structures which incorporates all the methods listed above (currently using RCWA as the Maxwell solver), as shown in Figure 1. The implementation allows users to simulate a whole structure using a single method, or to combine different methods and simulate the surfaces of the cell separately, if appropriate. RayFlare is a further development of the optical modelling capabilities developed for Solcore, an integrated solar cell modelling package (Alonso-Álvarez et al., 2018).
Existing packages already implement one or more of these methods; for instance, the Python package tmm (Byrnes, 2016) performs TMM calculations, while S 4 (Liu & Fan, 2012), written in C++ but including a Python interface, implements RCWA. Many ray-tracing packages are available such as SunSolve (PV Lighthouse, 2021) which is widely used in solar cell research.
There are also existing methods which combine multiple methods, such as CROWM (Lipovšek et al., 2011) (ray-tracing with TMM for textured surfaces with thin-film layers), GenPro4 (Santbergen et al., 2017) and OPTOS Tucher et al., 2015). The latter two use an angular redistribution matrix method, which allows the angle-dependent reflection and transmission properties of the front and back surface of the cell to be calculated separately (further information on this framework is given below). GenPro4 is a proprietary software which handles matrix calculation for the surfaces using TMM, ray-tracing, or combinations thereof, in addition to the subsequent matrix multiplication, while OPTOS is an open-source code which implements only the matrix multiplication, but not the generation of the matrices describing the surfaces. Thus, by including TMM, ray-tracing and RCWA methods as well as the angular redistribution matrix method, RayFlare provides a powerful modelling environment for a very wide range of structures. In addition, the ability to calculate not just total absorption per layer in the cell but also depth-dependent absorption profiles through the angular redistribution matrix framework is novel.

RayFlare
The RT, TMM or RCWA methods can be used independently to simulate a whole structure. In this case, the relevant materials and thicknesses of the layers (all methods), surface textures (RT) or grating shapes (RCWA) are defined by the user and the reflection, transmission, absorption per layer and (if specified) absorption profile in the structure are calculated by RayFlare. However, these methods can also be used in combination with each other by using the angular redistribution matrix formalism . In this framework, the front and rear surface of the structure are decoupled from one another, and suitable methods are used for each surface to calculate the redistribution matrices. These matrices described how light striking the surface from different directions is scattered into other directions (which can be in transmission or reflection) or absorbed by any surface layers. The front and back surface are coupled by some bulk medium, in which simple Beer-Lambert absorption is assumed. This reduces the problem down to a matrix multiplication process to calculate total reflection, transmission, and absorption in the surface layers and bulk medium. Note that for the Beer-Lambert absorption approximation to be valid, the bulk medium must be thick enough that interference effects in it can be neglected, i.e. significantly thicker than the maximum wavelength being considered.
While this matrix multiplication framework has been previously established, as discussed above, the novelty of RayFlare is that it will automatically calculate the necessary redistribution matrices for the user-defined structure at the required wavelengths as well as performing the matrix multiplication, including tracking absorption in any surface layers on the front and rear surface. It can also calculate absorption profiles in the surface and bulk layers, something which has not previously been demonstrated in combination with the redistribution matrix approach.
The methods currently available to generate redistribution matrices are: • Ray-tracing with the Fresnel equations: suitable for interfaces with some large-scale texture and no surface layers. The ray-tracer was written specifically for RayFlare. • TMM: suitable for planar surfaces with multiple layers. The TMM method implemented in RayFlare is a modified and vectorized version of the tmm package (Byrnes, 2016). • Integrated ray-tracing and transfer-matrix method: the probability of reflection/transmission (or absorption in interface layers) are calculated using TMM rather than through the Fresnel equations. This is suitable for large-scale textures with one or more thin (compared to the size of the texture features) surface layers. • RCWA: suitable for gratings or other periodic wavelength-scale structures, which can be made of multiple layers including planar layers. RayFlare uses a modified version of S 4 (Liu & Fan, 2012) which is compatible with Python3 to perform RCWA calculations. • Ideal/theoretical reference cases: currently, a perfect mirror or a perfect Lambertian scatterer are implemented.
As each of these methods are implemented independently, additional methods which can be used to calculate redistribution matrices can be added.
The results of RayFlare's ray-tracer have been compared with those of PVLighthouse's wafer ray tracer tool (PV Lighthouse, 2020), while the results of the matrix framework using planar surfaces (TMM), a grating (RCWA) or pyramids (ray-tracing) have been compared to results generated using OPTOS , showing excellent agreement in both cases. RayFlare, or code which was integrated into RayFlare, has been used to simulate the emissivity/absorptivity of silicon heterojunction solar cells (Alonso-Álvarez et al., 2019), design and simulate ultra-thin GaAs solar cells (Pearce et al., 2020), and to simulate a perovskite on silicon tandem cell