Variable Editor
Variable Edit is a modern feature in the Flow Simulator graphical user interface. It is used to create/modify user-defined variables, the value of which may be fixed or dependent on other variables, during design iterations and validation stages of the product for quick pre-processing and post-processing purposes. The defined variable can also be associated with imported geometry.
Quick Guide for Creating Variable
From the menu bar, select PreProcessing > Model Parameter > Variable Editor to access the Variable Edit Tree on the right side of the GUI. The Variable Edit Tree window lists the created variables.
Variable already exist make sure variable name is valid.
You can perform the following operations on a variable by right-clicking on the selected variable, and then left-click to populate the list of operations.
- Rename Variable: Rename the variable name if necessary.
- Set Expression: Widely-used option. It opens a separate GUI to define the expression based on the available result variable or the pre-existing variable. More information is available in the following section.
- Show Current Value: Evaluate and display the current value based on the defined expression.
- Print Depending Variable: Display dependent variables for checking purposes.
- Remove Variable: Remove/delete existing variables. Expressions associated with the variable are removed as well.
Working with Expressions
This section will provide more details on how to define expression. User can populate “Variable Edit” secondary window by selecting a variable inside “Variable Edit Tree” and right click and choose “Set Expression”. User can define the math expression based on JavaScript syntax. In the below example “Var2” is defined as a function of “Var1” (Var2 = 2 * Var1). After defining the expression inside the box, it is mandatory to click “Execute” button to be set it properly, otherwise the defined expression will not be evaluated. Result variable can also be used to define Variable by clicking “Insert Result Variable” button after completion of run for effective post-processing purposes. This option will be demonstrated in the Example Section.
Once a variable is successfully created, it can be used as a value for a specific property (i.e. Area, Length etc) of an element/chamber as shown below.
Refer Tutorial Exercise 18 : “Simple Tube + Orifice Element with Variable Definition” to understand the application of variable details.