Global Variable¶
Introduction¶
Text.
Property Grid¶
General
¶
Initial Value
- Data Source
Definition
None
- Fluid
Definition
- Reduction
Definition
Minimum
Maximum
Sum
Mean
StdDev
RelStdDev (10%)
- Interval Option
Definition
Every Time Step
Custom Interval
- Global Variable UDF
depends on UDF expression | This UDF defines the custom field variable to be calculated as part of the global variable reduction. One output must be defined within the UDF: a floating-point variable named
value
. The values calculated by this UDF are fed into the reduction operation. This can be either a voxel-based or a particle-based local UDF, depending on the data source.
- Particles
Definition
- Data Source Particle Name
TBA
Massless Tracers
Inertial Particles
- Reduction
TBA
Minimum
Maximum
Sum
Mean
StdDev
RelStdDev (10%)
- Interval Option
TBA
Every Time Step
Custom Interval
- Global Variable UDF
depends on UDF expression | This UDF defines the custom field variable to be calculated as part of the global variable reduction. One output must be defined within the UDF: a floating-point variable named
value
. The values calculated by this UDF are fed into the reduction operation. This can be either a voxel-based or a particle-based local UDF, depending on the data source.
- Probe
TBA
Data Source Probe Name
- Interval Option
TBA
Every Time Step
Custom Interval
- Global Variable UDF
depends on UDF expression | This UDF defines the custom field variable to be calculated as part of the global variable reduction. One output must be defined within the UDF: a floating-point variable named
value
. The values calculated by this UDF are fed into the reduction operation. This can be either a voxel-based or a particle-based local UDF, depending on the data source.
- Interfaces
TBA
- Reduction
TBA
Minimum
Maximum
Sum
Mean
StdDev
RelStdDev (10%)
- Interval Option
TBA
Every Time Step
Custom Interval
- Global Variable UDF
depends on UDF expression | This UDF defines the custom field variable to be calculated as part of the global variable reduction. One output must be defined within the UDF: a floating-point variable named
value
. The values calculated by this UDF are fed into the reduction operation. This can be either a voxel-based or a particle-based local UDF, depending on the data source.
- Time
TBA
- Global Variable Time UDF
user-defined units | This UDF defines how the global variable changes over time. This option is relevant when the Data Source is set to Time. This is a System UDF.
Download Sample File:
Global Variable Time
- Stats Value
TBA
Stats Selection
- Static Body
TBA
- Data Source Static Body Name
Static Body
- Reduction
TBA
Minimum
Maximum
Sum
Mean
StdDev
RelStdDev (10%)
- Interval Option
TBA
Every Time Step
Custom Interval
- Global Variable UDF
depends on UDF expression | This UDF defines the custom field variable to be calculated as part of the global variable reduction. One output must be defined within the UDF: a floating-point variable named
value
. The values calculated by this UDF are fed into the reduction operation. This can be either a voxel-based or a particle-based local UDF, depending on the data source.
- Property Link
TBA
Property Link
Property Value
Signal
¶- Signal Enabled
Signals will write the global variable at the specified interval.
Off
- On
Text.
- Signal Start Time
s | Text.
- Signal End Time Option
Options.
End of Simulation
- Specified
Text.
- Signal End Time
s | Text.
- Signal Sampling Interval
s | Text.
Display Name, Unit
¶Display Name Override
Display Unit Override
Legacy Text:
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
StatsSelection – Select a value from the statistics to use the statistics at runtime
Reductions¶
A reduction is an operation that takes in many values and computes a single value. These are the available reductions:
Minimum
Maximum
Mean
Sum
Standard Deviation
Relative Standard Deviation
Evaluation Region¶
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.
Examples¶
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;