Using the Flow Simulator Variable Editor

User: "JimBruns"
Altair Employee
Updated by AltairLiz

The variable editor in Flow Simulator (FS) is an easy yet powerful way to change many inputs quickly. If many model inputs use the same number (a hole diameter for example), consider using a variable to parameterize the input. Variables can be simple numeric input or an equation that can calculate an input based on other variables.

Variable Creation

There are 2 ways to create a new variable:

  1. Type the variable name in the property editor using square brackets, […]. If this variable does not exist, it will be created.
    image.png
  2. Use the “Add Variable” option directly in the Variable Editor window.
    image.png

The Unit Type must match the unit type expected by the input that uses the variable. For instance, a tube element length input must use a variable that has the “Length" unit type. If unsure of the Unit Type, use option 1 to create the variable since this will set the Unit Type automatically.

image.png

To use an existing variable, type its name in the property editor window surrounded by square brackets, […].

Setting Variable Values

Once a variable is created, its value must be set using a constant or an equation. The simplest way to do this is to type the constant into the Expression Text column. Set Expression can also be used to enter a constant in the equation editor.

image-87de024710192-3086.png

Equations use JavaScript mathematical expressions. Equations can use other variables using the square brackets just like the property editor […]. Click “Execute” after entering the expression to get the result. The result will automatically be added to variable editor and used in the property editor.

image.png

Results can also be used in a variable expression to do some simple postprocessing (ex: sum flows from multiple elements).

image.png

Variables in Multicase Analysis

Variables can be used for multicase studies also. Pick the variable in the multicase creator and enter the value for each case to run. This can reduce the number of objects needed in the multicase creator. For instance, if 10 elements use the same diameter, a variable can reduce the number of entries in the multicase from 10 to 1.

image-2b784f447c368-7ae5.png

Caveats

Most inputs in the property editor can use a variable, but some can’t.

The “Collection” in the variable editor is meant to be used with tables, but it has some problems that will be fixed in a future release. Do not use variables with tables.

The GUI processes the inputs from the variable editor. So, the GUI must be used when modifying a variable. If the FS solver is run separately from the GUI, any manual edit that changes a variable in the .flo file will not be processed.

Another limitation is that a variable cannot be used in controllers.

Find more posts tagged with

Comments

No comments on this post.