The Ray Tracing Algorithm
The Geometrical Optics interface solves for the position and wave vector of individual rays. It also allows them to interact with boundaries that intersect their paths.
Ray tracing is usually a reasonable approach to model electromagnetic wave propagation if the wavelength of the radiation is small compared to the smallest geometric detail in the surroundings, since diffraction is ignored. As long as this criterion is met, ray tracing can be used for nearly any part of the electromagnetic spectrum, including radio waves, microwaves, visible light, and UV radiation. Note that x-ray modeling may require the consideration of diffraction effects because x-rays can interact with matter on an atomic level.
If the geometry is on the wavelength scale, you might also consider a multiscale approach by first solving for the electric field in the frequency domain using the finite element method (FEM), and using the FEM solution to define a ray release.
While propagating through a homogeneous medium (one in which the refractive index is spatially uniform), a ray simply goes in a straight line at speed c/n, where c = 299,792,458 m/s is the speed of light in a vacuum and n (dimensionless) is the absolute refractive index of the medium. In a graded-index medium, the ray can follow a curved path, which is determined by integrating coupled first-order ordinary differential equations over time.
The Geometrical Optics interface is compatible with the Ray Tracing and Time Dependent study steps. These study types are very similar, except that the Ray Tracing study step allows you to specify either a list of optical path length intervals or a list of time steps. (Internally, the optical path lengths are converted to the corresponding times, so this is just a matter of convenience.)
For simple ray tracing models, only the first and last path lengths or time steps might be needed. Then the behavior of rays at any intermediate time can be accurately interpolated. If rays interact with boundaries in-between the stored time steps, then the exact time and position of each ray-boundary interaction is also stored and readily available.
Finer stepping in time or path length may be needed when modeling ray propagation in graded-index media, when rays pass through attenuating media and generate heat in their surroundings, or when using specialized postprocessing features.
Every time the intersection of a ray with a surface is detected, a wide variety of ray-boundary interactions may apply. These include specular reflection, diffuse reflection, refraction, and several different types of absorption.
Along each ray, it is possible to evaluate expressions that involve variables defined on the ray itself (such as optical path length, intensity, and wavelength) and variables defined at the ray’s position in the modeling domain (such as temperature and refractive index). For example, to determine the refractive index in an optically dispersive medium, on each ray an expression is evaluated that combines the ray’s wavelength or frequency with a function queried from the domain the ray occupies. Similarly, when a ray hits a boundary, the new direction of the ray can depend on a combination of ray variables (like wavelength) and surface variables (like surface normal direction and Gaussian curvature).