Ray tracing

Ray Tracer for solar reflectors and absorbers

A ray tracer is useful for optical analysis of 3D reflection and absorption systems. As we could not identify existing free software which would suit our purposes, we programmed a ray tracer ourselves, which we over the years extended according to our needs.

Implementation

The first system was programmed in Matlab. We then moved to C++ and Qt (version named TraceIt), with OpenGL for rendering the 3D objects and rays. The two versions are somewhat different algorithms. The Matlab version loops over all rays for each reflector element whereas TraceIt trace one ray through all reflections to the end (recursive implementation). The Matlab option with vector operations was also implemented in C++ as a trial for parallelization on GPUs. This showed great efficiencies for cases with very large number of rays and reflectors, but as we normally use modest numbers, we did not pursue parallelization further. We do not use Monte Carlo methods, but rather specify uniform ray densities for the sun - the sun is a matrix of initial rays.This also makes it quicker to compare cases, without needing to wait for convergence of Monte Carlo methods.

The solutions for the intersection points between rays and surfaces are analytical, except for the case of 3D CPC (Compound Parabolic Concentrator) where we had to solve it numerically (bi-sect iteration).

We have not made TraceIt to commercial standards, and we do not take responsibility for third party use of TraceIt. It has mainly been used in our own work, but the implementation is quite general.

Functionality

We have extended the functionality as needed, e.g. new types of reflectors, sensitivity scans on solar angles and absorber properties (position, rotation and size).  The reflectors can either be discretized in flat mirror tiles or be mathematical continuous surfaces. A color function is included (although this is computationally very inefficient).  Plots of results is currently not implemented, and made with other software outside (Matlab or Python). Case definitions can be saved and read as text files.
Current elements are: Flat plate, Flat dish, Through, Parabolic Dish, Scheffler Reflector, 2D CPC, 3D CPC, Cylinder, Cone, Bend/Torus (for light guide), Sphere (or parts of it), Lens, Lens arrays.
A test implementation was also made with the sun rays not being parallel due to the finite size of the sun (Monte Carlo implemented). We have not used this, as it is at a level of accuracy we do not aim at in the solar heat systems we have worked with.

Procedure
A typical sequence for a case would be:
   CPC-color1    CPC-col2
   Example of 3D CPC with absorber cylinder
Example of screen shot, tilted dish and cylindrical absorber
TraceIt

Video example on ray tracing with a Light Guide