Variable Editor
Variable Edit is a modern feature in Flow Simulator Graphical User Interface. It is mainly used to create/modify user defined variable, the value of which may be fixed or dependant on other variable, 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 which makes it very useful.
Quick Guide for Creating Variable
Click PreProcessing in top menu-bar, browse towards Model Parameter → Variable Editor to access Variable Edit Tree in right side of the GUI. The Variable Edit Tree window will list down already created Variables.
Right Click inside the Graphic Window of Variable Edit Tree to create/add new variable. A variable edit pop-up window will be appeared in the screen. Enter the new variable name. Make sure the entered variable name is not conflicting with already existing variable names otherwise it will pop-up a warning message informing that “Variable already exist make sure variable name is valid”. After successful creation of new variable, it will be populated in the Variable Name List.
There are 5 major operations can be performed on a variable by simply selecting the variable via right click and then left click to populate the list of operations. Then user can choose specific operation he wants to perform by right click.
- Rename Variable: Renaming the variable name if user wants to change it.
- Set Expression: Most important and widely used option. It will open a separate GUI to define the expression based on available result variable or already existed variable. More information is available in following section.
- Show Current Value: This option will evaluate and display current value based on defined expression.
- Print Depending Variable: This option will display dependant variables for checking purposes.
- Remove Variable: Remove/Delete existing variable. Expression associated with the Variable will be removed as well.
Working with Expression
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.