Home Examples Screenshots User manual Bluesky logo
OghmaNano Simulate organic/Perovskite Solar Cells, OFETs, and OLEDs DOWNLOAD

Escape from Film (Part A): Ray tracing from a rough surface

The Escape from film example models light emitted inside a rough semiconductor film and calculates how much of that light escapes through the top surface. This is relevant to many systems such as OLEDs, LEDs, and other light-emitting structures where outcoupling is limited by total internal reflection and surface roughness.

Step 1: Create a new ray-tracing simulation

Start OghmaNano and click New simulation. The New simulation window appears, as shown in ??. Double-click the Ray tracing entry, highlighted in ??.

OghmaNano New simulation window with different device categories including ray tracing.
The New simulation window. Select Ray tracing from the list of example categories.
Ray tracing examples list, with Escape from film highlighted.
Inside the Ray tracing category, choose Escape from film. When prompted, save the simulation to a folder you have write access to.

Step 2: Inspect the initial structure

After opening the example, the main OghmaNano window shows the device structure, as in ??. The scene contains:

Use the left mouse button to rotate and the mouse wheel to zoom until you obtain the view shown in ??.

Initial Escape from film simulation window showing semiconductor, oxide and detector grid.
The initial Escape from film scene. A rough semiconductor layer (red) sits on a smooth oxide (grey), with a detector grid (purple) above the structure.
Rotated view of the Escape from film structure.
Rotating the view reveals the full 3D structure and the detector plane above the rough film.

Step 3: Reveal the embedded light sources

By default the semiconductor and oxide are drawn as solid objects. To see where the light sources are located:

  1. Right-click the Semiconductor object.
  2. From the context menu choose View → Show solid and untick it.
  3. Repeat for the Oxide object.

The menu path is illustrated in ??. Once both solids are turned off, you should see a cloud of small arrows inside the film, as in ??. These arrows are the ray-tracing light sources.

Context menu showing View > Show solid option for the semiconductor layer.
Right-click the semiconductor or oxide, then use View → Show solid to toggle the solid shading. Unticking this option makes the objects transparent.
Escape from film structure with solids hidden, exposing the embedded light sources as arrows.
With the solids hidden, the internal ray sources become visible as a set of arrows embedded in the semiconductor film.

Each arrow represents a group of rays emitted from that point. By right-clicking the light source object you can later adjust the number of rays, emission angle, and XY size of the source. We will return to this in Part B.

Step 4: Run the ray-tracing simulation

Click Run simulation (blue play icon) to launch the ray tracer. After a short time, the window fills with rays as shown in ??. The rays scatter inside the rough semiconductor and either escape into the detector or are lost in the substrate.

To examine how ray paths depend on wavelength, switch to the Optical tab. Use the Wavelengths drop-down to select a specific wavelength, as in ??. The 3D view updates to show only rays at the chosen wavelength.

Escape from film simulation after running, showing many coloured rays escaping from the rough film.
After running the simulation the scene is filled with rays emitted from the rough semiconductor and scattered towards or away from the detector.
Optical tab showing the wavelength selector used to filter the displayed rays.
The Optical ribbon contains a Wavelengths selector. Choosing a wavelength filters the displayed rays, making it easier to study wavelength-dependent escape.

Step 5: View the detector output

Once the simulation finishes, open the Output tab to see all files produced by the ray tracer, as shown in ??. The detector plane at the top of the structure is numbered 0, so its results are stored in detector0.

Double-click detector0 to open the detector viewer (??). This plot shows how much light escapes through the detector as a function of angle and, if multiple wavelengths were simulated, as a function of wavelength.

Output tab listing files generated by the Escape from film simulation, including detector0.
The Output tab for the Escape from film simulation. The file detector0 contains the results from the top detector plane.
Detector output plot showing the angular distribution of escaping light.
Example detector output. The colour map shows how much power escapes as a function of angle (and, if applicable, wavelength).

Detector efficiency and rendered images

The detector output shown in ?? is obtained by double-clicking the file detector_efficiency0.csv in the Output tab. This plot shows the fraction of internally generated light that reaches the detector as a function of wavelength – effectively an outcoupling efficiency. In this example, almost no light escapes below about 600 nm, while at longer wavelengths the outcoupling efficiency rises to around 12%.

A value of order 10–15 % is entirely reasonable for a high-index film in air. For a simple estimate, consider a flat semiconductor / air interface with refractive indices \(n_{\text{film}}\) and \(n_{\text{air}}\). The normal-incidence Fresnel reflectance is

\( R = \left(\dfrac{n_{\text{film}} - n_{\text{air}}}{n_{\text{film}} + n_{\text{air}}}\right)^2. \)

Taking a typical semiconductor or oxide index \(n_{\text{film}} \approx 1.8\) and \(n_{\text{air}} = 1.0\), we obtain \( R \approx 0.08 \) (about 8 % reflection at normal incidence), so the transmission is \(1-R \approx 0.92\). However, light generated inside the film can only escape within the escape cone defined by the critical angle \( \theta_c = \arcsin\!\bigl(n_{\text{air}}/n_{\text{film}}\bigr) \approx 34^\circ \). For isotropic emission inside the film, the fraction of power that falls inside this cone is

\( f_{\text{cone}} = 1 - \cos\theta_c \approx 1 - \cos(34^\circ) \approx 0.17. \)

Multiplying the transmission and escape-cone factors gives a crude outcoupling estimate

\( \eta_{\text{out}} \approx (1-R)\,f_{\text{cone}} \approx 0.92 \times 0.17 \approx 0.16 \; (16\%). \)

Once additional losses and scattering are included, an outcoupling efficiency of around 12 % – as seen in detector_efficiency0.csv – is therefore quite reasonable for this type of structure.

If you double-click RAY_image.csv in the same directory, OghmaNano opens a rendered image of what your eye would see when looking at the film, shown in ??. This is calculated using the 1931 CIE colour space: the wavelength-dependent detector signal is converted into CIE XYZ tristimulus values using the standard colour-matching functions, and then mapped to an sRGB image that approximates human visual perception. For more details on this colour model, see for example the CIE 1931 colour space.

Detector efficiency vs wavelength plot, showing outcoupling efficiency rising to about 12 percent above 600 nm.
Detector output obtained from detector_efficiency0.csv. This plot shows the wavelength-dependent outcoupling efficiency – the fraction of internally generated light that reaches the detector.
Rendered RGB image showing the apparent colour and spatial distribution of light escaping from the rough film.
Rendered view of RAY_image.csv. The detector spectrum has been converted into a true-colour image using the 1931 CIE colour space, approximating what the human eye would see when viewing the emitting film.

👉 Next step: Continue to Part B to learn how to change the surface shape, adjust the light source, and import more complex structures into the Escape from film simulation.