Special Variables
The Geometrical Optics interface defines a number of special variables, some of which can only be used during results processing. These variables can be found in the Ray statistics section in the Add/Replace Expression menus. All of the variables described in this section are preceded by the physics interface Name; see The Geometrical Optics Interface for more information.
The following variables are defined:
Ray index, pidx. Each ray is assigned a unique index starting from 1 up to the total number of rays. This expression can be passed into a function, which can create random values that are unique for each ray. This is used, for example, to ensure that each ray’s probability of being specularly reflected at a mixed diffuse-specular surface is determined independently of other rays. Suppose a random function has already been defined with name rn1, which takes 2 input arguments. Then a random boundary interaction can be constructed with the expression rn1(pidx,t).
Ray release feature, prf. If there are multiple release features in a model, it is useful to be able to visualize which rays correspond to each release feature. The Ray release feature variable takes a numeric value, starting at 1, which is unique to each release feature. This variable can also be used to filter ray trajectories in postprocessing so that only the rays released by a specific feature are shown.
Ray release time, prt. The Ray release time is the time at which the primary rays are released, which is usually zero for all rays. To allow other release times to be specified, select the Allow multiple release times check box in the physics interface Advanced Settings section.
If the Store ray status data check box is selected in the physics interface Additional Variables section, then the following additional variables are created:
The release time of a given ray (variable name rti). This works for secondary rays and thus allows for extraction of the time at which a secondary ray was released. This includes reflected rays at material discontinuities and higher diffraction orders at gratings.
The final status of the ray (variable name fs). This indicates the status of a ray at a given point in time. When used during postprocessing, the value always indicates the status of the ray at the last time step. The value is an integer which has one of the following values:
-
-
-
-
-
The following variables are only defined during results processing and can only be evaluated using the Global Evaluation node under Derived Values. They cannot be plotted as the Color Expression in a Ray Trajectories plot, or used in the equation system.
Total number of rays, Nt. This total includes both primary and secondary rays, and includes rays that have disappeared or have not been released.
Total number of rays in selection, Nsel. If a selection has been applied to the Ray data set, the number of rays in that selection can be evaluated.
Transmission probability, alpha. The probability of rays reaching a specified domain or boundary selection can be of interest in some Monte Carlo ray tracing calculations. The Transmission probability variable is the ratio of the number of rays in a selection to the total number of rays.
The following variables are found in the Release statistics plot group during results processing.
Total number of rays released by feature, <tag>.Ntf, where <tag> is the tag of a ray release feature, such as the Inlet or Release from Grid feature. This global variable is uniquely defined for each release feature, and gives the total number of rays that are released by that feature. This includes rays that have disappeared or have otherwise stopped propagating due to interaction with the surrounding boundaries. It does not include any secondary rays.