Each global variable is a single value that is globally available in all user defined functions. The value may be computed by the following methods:
No Calculator – The value is set by one of the UDFs
Fluid – The value is computed from a reduction on the Fluid cells
Particles – The value is computed from a reduction on the particles set
Probe – The value is set by a probe value
Interfaces – Like the Fluid, but the reduction is limited to those cells that contain the free surface
A reduction is an operation that takes in many values and computes a single value. These are the available reductions:
Relative Standard Deviation
By default, global variables are reduced over the entire domain. By appending children geometry objects, you can limit the region of evaluation. So for example, if you add a Box geometry as a child to the global variable, the global variable will only operate on the internal cells within the box.
Set value to maximum fluid velocity. At runtime this UDF is evaluated over the fluid cells. The value is set to the fluid velocity magnitude. The maximum is then taken of all the values, returning the maximum velocity magnitude into the global variable value. This global variable can then be used by any other UDF.
Set the Data Source = Fluid
Set the Reduction = Maximum
Set the code expression to:
value = v;