Special Variables
The Granular Flow interface defines a number of special variables, some of which can only be used during results processing. These variables can be found in the Grain statistics section of variables when you click Insert Expression or Replace Expression during results processing.
All of the variables described in this section are preceded by the physics interface identifier, typically gran. If multiple instances of the physics interface exist, the additional instances are followed by a number, for example, gran and gran2.
The following variables are defined:
Grain index, pidx: Each grain is assigned a unique index starting from 1 up to the total number of grains. This expression can be passed into a function, which can create, for example, random forces that are unique for each grain. Suppose a random function has already been defined with name rn1, which takes 2 input arguments. Then a random force can be constructed with the expression rn1(pidx,t).
Grain release feature, grf: If there are multiple release features in a model, it is useful to be able to visualize how the grains mix together based on their initial release position. The Grain release feature variable takes a numeric value, starting at 1, which is unique to each release feature.
See Mixing Grains in a Ribbon Mixer: Application Library path Granular_Flow_Module/Mixing_and_Separation/ribbon_mixer.
Release time, rti: Since grains can be released at arbitrary points in time, it is often useful to visualize at what time a specific grain was released.
Stop time, st: The time at which a grain disappears at a boundary.
Final status, fs: The final status of the grain. This indicates the status of a grain at a given point in time. When used during results processing, the value always indicates the status of the grain at the last time step. The value is an integer, which has one of the following values:
-
-
-
Number of grains in contact, Ng: The number of grains each grain is in contact with.
Number of wall elements in contact, Nw: The number of wall elements each grain is in contact with. Contact is defined as any interaction that can induce a normal force on the grain and can therefore include interactions where the grain is not in physical contact with another grain or a wall element.
The status of the grain: particlestatus (with no scope). This indicates the current status of each grain. The value is an integer with the same meaning as the final status of the grain. The variable particlestatus exists while computing grain trajectories, so it can be used in weak expressions defined on the grains but cannot be used during results processing.
The following variables are global and can therefore be evaluated using the Global Evaluation node under Derived Values. They do not have unique values for each grain.
The following variables are found in the Grain statistics section of variables when you click Insert Expression or Replace Expression during results processing:
Total number of grains released by feature, <tag>.Ntf, where <tag> is the tag of a grain release feature, such as the Release, Inlet, Release from Grid, or Release from Data File feature. This global variable is uniquely defined for each release feature, and gives the total number of grains that are successfully released by that feature.