Ray Optics Module Updates

For users of the Ray Optics Module, COMSOL Multiphysics® version 5.6 brings faster and more accurate ray rendering, new dedicated features to scatter rays in dilute particle-laden media and on rough surfaces, and a new Ideal Lens feature for quick setup of paraxial lens systems without the need for a detailed geometry. Read more about these and other Ray Optics features below.

Faster and More Accurate Ray Rendering

When rendering a Ray Trajectories plot, a new setting can be used to accurately render all intersection points of rays with surfaces in the geometry, even if they do not correspond to output time steps in the solution data. To perfectly render every intersection point of every ray with a surface, the old implementations scaled quadratically with the number of rays, whereas the new behavior scales linearly with the number of rays, potentially giving a massive speedup when the number of rays is very large. This also applies to the calculation of intersection points between rays and a sphere, hemisphere, or plane. You can see this new feature in the following models:

A closeup view of the COMSOL Multiphysics version 5.6 UI showing the Ray Trajectories settings with the Data and Extra Time Steps sections expanded and an échelle spectrograph model in the Graphics window.
The new "All" option in the Ray Trajectories plot settings gives faster and more accurate ray visualization.

Partial Transparency in Plots

While partial transparency in plots can now be used across a wide range of application areas, its usage in ray optics is notable because many plots will have multiple layers, such as ray trajectories together with surfaces in the surrounding geometry. Partial transparency allows the rays to be shown more clearly even as they propagate through the barrel of a camera. You can see the new transparency feature in the following models:

A partially transparent model of a compact camera module showing the ray trajectories inside in a rainbow color table.
Rays are drawn as opaque lines in a transparent lens system.

Optical Scattering in Domains

You can now model ray attenuation in a domain containing water droplets, dust, smoke, bubbles, or other small particles with the Scattering Domain node. This new feature computes the extinction, scattering, and absorption cross sections of the scattering particles. It supports Rayleigh theory, Mie theory, and some asymptotic models for optically large scattering particles. The functions that compute the extinction and scattering cross sections from the Mie theory are now available as general functions, and can be used anywhere in the COMSOL® software. The extinction of rays can be random or, if the ray intensity is solved for, each ray's intensity can be attenuated continuously.

Reflection and Refraction at Rough Surfaces

A Scattering Boundary feature has been introduced to allow for more flexibility in how rays are scattered from surfaces. You can now choose to scatter rays in reflection and transmission.

A model of a semitransparent gray square representing a surface and lines representing rays scattering off the surface in either direction.
Rays can be scattered in both directions with the Scattering Surface boundary condition.

A Scattering Surface boundary condition can be used to show the effect of changing surface slope error on spot diagrams.

Ideal Lens Boundary Condition

An Ideal Lens feature can be used to model a paraxial surface with a known focal length. You can also use thin and thick lens formulations to specify the equivalent paraxial lens.

A lens model made up of gray circles and red, yellow, and green lines to represent the rays.
The Ideal Lens feature can be used to model a "perfect" lens.

New Cone-Based Ray Release: Flat Cone in 3D

In 3D models, when you release a cone of rays, you can now choose to define a ray fan or a flat cone. You can orient the flattened cone of rays so that it lies in any plane. Additionally, some other conical ray release features offer more flexibility in choosing the transverse direction, meaning that you now have more control over the exact placement of rays in the conical distribution.

A gray double Gauss lens system model with rays visualized as red, orange, yellow, and green lines with arrows pointing toward the lens.
Rays are released in a flat cone in the xy-plane and propagate toward a double Gauss lens system.

Random Sampling of Vacuum Wavelength, Frequency, and Other Variables

When you initialize auxiliary dependent variables on particles, you can sample their initial values deterministically or, new with version 5.6, randomly. When using the random option, you can sample from built-in normal, lognormal, or uniform distributions. You can also sample deterministically or randomly from a wavelength or frequency distribution if the rays are polychromatic.

Reset Ray Frequency or Vacuum Wavelength

When rays are reflected at a boundary, you can now choose to reinitialize their vacuum wavelength or frequency. You can specify a new value directly or sample it from a distribution.

Easier Sampling from Uniform Distributions

When you initialize auxiliary dependent variables on particles, if the initial values are sampled from a uniform distribution, you now specify the maximum and minimum value in the distribution. Previously, it was necessary to specify a mean and standard deviation. This also applies to initial values of the ray frequency or vacuum wavelength when releasing polychromatic light. You can see this new setting in the Czerny-Turner Monochromator model.

Absorbing Thin Dielectric Films

You can now compute the deposited ray power in absorbing thin dielectric films on boundaries by adding the Deposited Ray Power subnode to a Material Discontinuity node. If the reflecting and refracting surface has a thin coating with a complex-valued refractive index, then some energy will be deposited onto the surface. Additionally, the sign conventions for handling complex-valued refractive indices in thin dielectric films have been updated to be more consistent with the treatment of complex-valued refractive indices in domains.

New Geometry Parts

In COMSOL Multiphysics® version 5.6, the Part Library for the Ray Optics Module offers a new Spherical Polygonal Lens part.

A model of a blue microlens array resembling a honeycomb pattern with rays going through the array in a white to dark blue color gradient.
Microlens array using the new Spherical Polygonal Lens part.

New Tutorial Models and Applications

COMSOL Multiphysics® version 5.6 brings two new tutorial models to the Ray Optics Module.

Double Gauss Lens Image Simulation

A double Gauss lens system with rays depicted in red and yellow and the object plane containing the COMSOL logo, text reading Ray Optics Module, and a photo of a dog.
Rays are released from the object plane (left) based on an imported bitmap and are collected on the image plane (right) after passing through the lens system.

Application Library Title:

double_gauss_lens_image_simulation

Download from the Application Gallery

Petzval Lens Geometric Modulation Transfer Function

A 1D plot of the geometric modulation transfer function for a Petzval lens with different lines for Release from Grid 1 x, 1 y, 2 x, 2 y, 3 x, and 3 y.
The geometric modulation transfer function for a Petzval lens, computed using methods written in the Application Builder.

Application Library Title:

petzval_lens_geometric_modulation_transfer_function

Download from the Application Gallery