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

Ray-tracing Tutorial (Part C): Changing the surface

In Part A you loaded the Reflection from film ray-tracing demo, and in Part B you edited and moved the light sources. In this final part you will change the surface itself. The original demo uses a rough surface derived from an AFM image, but OghmaNano allows you to replace it with other shapes from the database and to change the optical material of the object. This is useful for exploring how different textures and refractive indices affect reflection and scattering.

Step 1: Open the surface object editor

Start from the simulation you configured in Parts A and B. Zoom and rotate the view so that the red AFM surface is clearly visible. Right-click on the surface and choose Edit object from the context menu, as shown in ??. This opens the Object Editor window for the selected surface object (??).

Right-click menu opened on the AFM surface object with Edit object highlighted.
Right-click the AFM surface object and choose Edit object to open its Object Editor.
Object Editor window showing the properties of the AFM-image surface.
The Object Editor for the AFM surface. This window shows the object type, position, rotation, optical material and the current object shape entry.

The Object Editor lists the general parameters of the surface:

For this tutorial we will keep the position and rotation fixed and instead modify the object shape and optical material.

Step 2: Open the Mesh Editor and choose a new shape

To change the surface geometry, click the three dots to the right of the Object shape field in the Object Editor. This opens the Mesh Editor (??), which controls how the geometry of the object is generated.

Mesh Editor set to take its shape from the shape database entry afm_image.
The Mesh Editor with the AFM surface loaded from the shape database. Here you can change both the database entry and the physical size (dx, dy, dz) of the object.
Shape database window listing shapes such as afm_image, saw_wave and others.
The Shape database. Double-click an entry, such as saw_wave, to use it as the new geometry for the surface object.

In the Mesh Editor make sure the Shape Database tab is selected. The current shape is the AFM image (shown in the text field). You can also adjust the xyz size values to scale the object if required, but for this tutorial we will keep the default dimensions.

Click the three dots button next to the shape field. The shape database window opens (??), listing all available shapes. Double-click saw_wave (or saw_wave) to select it. The Mesh Editor will now reference the saw-wave profile instead of the AFM image.

Close the Mesh Editor and return to the main Optical Workbench window. The surface in the 3D view should now appear as a saw-wave structure rather than the original AFM-derived roughness, as shown in ??.

Main simulation window showing the surface replaced by a saw-wave shape.
The simulation after replacing the AFM surface with the saw_wave shape from the database. The incident rays now interact with a periodic saw-tooth structure.

Step 3: Re-run the simulation and inspect the output

Click Run simulation (or press F9) to ray trace the new surface. Once the simulation has finished, open the Output tab as in Part A and navigate to the detector output. Double-click the detector_efficiency0.csv file to view the detector efficiency as a function of wavelength.

Compare this spectrum with the one you obtained for the original AFM surface. You should see that the detailed shape of the efficiency curve changes because the scattering and escape probabilities now depend on the saw-wave geometry instead of the AFM roughness.

Step 4: Change the optical material (Si → ITO)

The same object can also be assigned different optical materials. This allows you to separate the effects of geometry from those of refractive index and absorption.

  1. Re-open the Object Editor for the surface (right-click the surface and select Edit object).
  2. Locate the Optical material field. In the current example it is set to a silicon entry (for example inorganic/si).
  3. Click the three dots next to the optical material field to open the optical materials database.
  4. Select an appropriate ITO entry (for example inorganic/ito) and confirm your choice.
  5. Close the database window and ensure the new ITO material is shown in the Object Editor, then close the editor.
  6. Run the simulation again and inspect detector_efficiency0.csv as before.

By comparing the detector efficiency for (i) the AFM surface with silicon, (ii) the saw-wave surface with silicon, and (iii) the saw-wave surface with ITO, you can begin to disentangle how both surface morphology and refractive index influence the collected light.

👉 Where next? You can now combine everything from Parts A–C to build your own custom ray-tracing scenes: import new shapes into the database, define appropriate optical materials, tune the light sources, and analyse the detector outputs for different wavelengths and configurations.