For an instance of the Geometrical Optics interface with the default name gop, the variable for refractive index defined on rays is
gop.nref, while the variable for refractive index in the domain is called
gop.nref_local. As the rays propagate through domains in the geometry, the value of
gop.nref is determined by evaluating
gop.nref_local at a geometry point corresponding to each ray’s current location.
Similarly, when a ray is refracted at the boundary between two different media, the implementation of Snell’s law requires the variable gop.nref_local to be evaluated in the media on the side of the incident ray and the refracted ray, at the point where the incident ray intersects the boundary.
During postprocessing, a ray variable such as gop.nref can only be evaluated on rays, not at arbitrary points in the geometry where a ray might not be present. For example, trying to use
gop.nref in a
Slice plot will usually result in an error message such as:
A better choice for the Slice plot would be the variable
gop.nref_local, which is a domain variable and therefore exists at every point in the domain, regardless of whether a ray is present there or not.
However, a Slice plot of
gop.nref_local will not always work. The plot will appear correctly if the refractive index is entered as a constant value in each domain; that is, if dispersion is neglected. If the model uses optical dispersion relations that define the refractive index as a function of the wavelength of the rays, you may get an error message such as:
Most of the optical glass material data in the Optical Material Libraries use a dispersion formula to define the refractive index. (See Material Libraries for a more comprehensive list of the available materials.) For example, if the Sellmeier dispersion formula is used, then the variable
gop.nref_local is defined as
where the variables gop.ODsma<1,2,3,4,5,6> are the Sellmeier dispersion coefficients.
The variable gop.lambda0norm is the vacuum wavelength of the ray expressed in micrometers,
The special operator noenv() allows a two-way exchange of information between the ray and the domain it is in, for the purpose of evaluating variables. It allows a ray variable (such as the wavelength) to be used in the definition of a domain variable, which in turn can be evaluated at the ray’s location. However, this construction only works if the domain variable is evaluated at the location of a ray, not at any arbitrary location in the geometry, which is why a
Slice plot of
gop.nref_local fails for dispersive media.
The Medium Properties node automatically defines domain variables for the refractive index at several spectral lines:
The Abbe number gop.Vd is also available as a built-in postprocessing variable. Its definition is
For displaying the refractive index in Slice or
Volume plots, these variables for refractive index at specific wavelength values can be used more reliably than
gop.nref_local.
Alternatively, you can evaluate the refractive index of a dispersive medium at any other wavelength value using the subst() operator, which can replace the ray wavelength in the dispersion formula with a fixed value. For example, another way to plot the d-line refractive index (rather than the built-in variable
gop.nrefd) is using the expression
where the third argument to the subst() operator could be replaced with any other numeric value.
The built-in postprocessing variables gop.nrefd,
gop.nrefF, and
gop.nrefC can be used to plot the refractive indices of all materials at fixed wavelengths of 587.56
μm, 486.13
μm, and 656.28
μm, respectively. The built-in variable
gop.Vd is the Abbe number in terms of the refractive indices at these three wavelengths. You can also plot the refractive indices of domains at any other fixed value of the wavelength using an expression of the form
where <wavelength> should be replaced with a numeric value.