Solar Energy 155 (2017) 1188–1196
Contents lists available at ScienceDirect
Solar Energy journal homepage: www.elsevier.com/locate/solener
Scientrace: An open source, programmable 3D ray tracer J. Bos-Coenraad ⇑, L.A.A. Bunthof, J.J. Schermer Radboud University, Institute for Molecules and Materials, Applied Materials Science, Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands
a r t i c l e
i n f o
Article history: Received 7 April 2017 Received in revised form 22 June 2017 Accepted 3 July 2017
Keywords: Ray tracing Optics Solar concentrator simulations Wulff construction Open source
a b s t r a c t Available ray tracers for optical studies are very limited in terms of platform independence and source availability. To meet those and additional demands, Scientrace has been developed. In order to study multiple parameters of light at once, it is desired to program large batches wherein several properties may be varied independently. Using constants, complex formulae and loop constructions, simulation environments are designed and setup to be easily maintained. The output offers both insightful images of many kinds and powerful quantitative data. By applying operators to basic functionality, vectors can be modified and the properties of light can be tuned in great detail. Besides the scientific demand for source verifiability and the freedom to use dito operating systems, these functions make Scientrace a very powerful scientific tool. Ó 2017 Elsevier Ltd. All rights reserved.
1. Introduction
1.2. The programmable Scientrace Suite design
1.1. Ray tracing
In this document, a free, platform independent, open source ray tracing application for scientific purposes is introduced: Scientrace. As will be shown, Scientrace is a versatile and powerful tool in the design, developement, and research of photovoltaic applications. The Scientrace core library (scientrace-lib) is supplemented with two complementary, easily programmable XML interpreters in the whole package called the Scientrace Suite. The structure of the Scientrace Suite is illustrated in Fig. 1. The programming of Scientrace simulation batches does not demand significant software engineering experience. Photon interaction with the surface occurs mainly based on the Fresnel equations and the photon polarisation properties. Effects of scattering and absorbtion can be added manually by using the surface properties. The interaction with dielectrics is handled by a material class that can be set by the user.3 The Scientrace XML interpreter (scientrace-xml) can read Scientrace XML source files (named .scx files), containing all the information for a simulation, e.g. light sources, optics such as lenses, reflectors, dielectric volumes, screens, etc, but also instructions concerning data output. The Scientrace Batch Creator (scientracebatch-creator) is a separate interpreter, that parses Batch Creator source files (named .bcx files). .bcx files describe how to modify . scx files, and can create large batches of .scx files.The Batch Creator reads both a batch instruction file (.bcx, Batch Creator XML) and a Scientrace XML template file (.scx) to produce large series of
Ray tracing is the simulation of the path of light through matter in a 2D or 3D environment. There are two main applications for ray tracing. (1) The real time creation of visual 3D frames by 3D engines, or 3D media processors such as Blender1 and POV-Ray (Buck and Collins, 2004). (2) The quantitative analysis of optics, such as lenses and reflectors, in optical systems like headlights, microscopes and solar concentrators. Common applications to study optical system quantitatively are ASAP, LightTools, TracePro and ZEMAX (Opto and Laser Europe, 2003). The Scientrace ray tracer is designed for the second purpose and is freely available via www.scientrace.org. In contrast to most available quantitative ray tracers, Scientrace is open source and platform independent. This allows for the inspection and modification of the source code, as well as availability to a large variety of operating systems, including GNU/Linux. Scientrace is developed in C# using Monodevelop and the Open Toolkit library.2 Monodevelop is a cross platform development environment. The Open Toolkit is an external library for math operations.
⇑ Corresponding author. E-mail address:
[email protected] (J. Bos-Coenraad). www.blender.org. http://www.mono-project.com/docs/about-mono/languages/csharp/, http:// www.monodevelop.com/, www.opentk.com. 1 2
http://dx.doi.org/10.1016/j.solener.2017.07.003 0038-092X/Ó 2017 Elsevier Ltd. All rights reserved.
3 https://github.com/JoepBC/scientrace/blob/master/source/scientrace-lib/DielectricSurfaceInteraction.cs, which contains a detailed description of all used variables and external references for used formulae.
J. Bos-Coenraad et al. / Solar Energy 155 (2017) 1188–1196
1189
the elements
,