The Expression Editor dialog box contains:
A tree view for viewing and managing expressions (The tree view has a shortcut menu with commands for creating/deleting/modifying expressions, as described below.)
A details view for creating/editing/displaying the definition of the new/selected expression
(You can find a list of valid CEL expressions and constants in Ansys CFX Expression Language in the TurboGrid Reference Guide.)
A Value box to show the value of the selected expression when the expression does not contain variables and evaluates to a single value.
You can right-click an existing expression or a blank area in the tree view portion of the Expression Editor dialog box in order to access a shortcut menu with the following commands:
Table 8.1: Expression Editor Shortcut Menu Commands
|
Command |
Description |
|---|---|
|
Edit |
Displays the definition of the selected Expression in the details view portion of the Expression Editor dialog box, and gives it the keyboard focus. An alternative way to do the same is to double-click an expression in the tree view. |
|
Insert > Expression |
Opens the New Expression dialog box where you can enter a name for a new expression. After you enter a name, you must provide and apply a definition in order to finish creating the new expression. When selecting an expression name:
|
|
Edit in Command Editor |
Invokes the Command Editor dialog box populated with the selected expression. |
|
Delete |
Deletes the selected expression. |
|
Duplicate |
Creates a duplicate of the selected expression after obtaining the name of the new expression from the New Expression dialog box. |
|
Use as Workbench Input Parameter [a] |
Makes the selected expression a Workbench input parameter so that it is available in, and controllable by, Ansys Workbench. The Workbench input parameter is initialized by the expression definition specified in Ansys TurboGrid. The definition must be a function of only constants; units are permitted. It is not possible to edit the value of an expression in Ansys TurboGrid while the expression is a Workbench input parameter. |
|
Makes the selected expression a Workbench output parameter, causing it to be output from Ansys TurboGrid for use in Ansys Workbench. | |
|
Removes the Ansys Workbench parameter status from the selected expression. |
[a] You can enable/disable the use of a Workbench input parameter directly for many settings in the object editor. For details, see Object Editor.
[b] For details on Workbench parameters, see Working with Parameters and Design Points in the Workbench User's Guide
When defining an expression:
You cannot use a user variable.
Constants require units inside square brackets.
You can right-click in the details view to access a shortcut menu for inserting variables, locators, expressions, and functions into your equation.
To define an expression for distance from the X axis:
Select Tools > Expressions from the main menu to open the Expression Editor dialog box.
When the New Expression dialog box appears, enter the name
radialand click .In the details view portion of the Expression Editor dialog box, enter the following expression definition:
sqrt(Y^2+Z^2)Click Apply to create the expression.
Note that the Value box does not show a value for the expression because the expression does not evaluate to a single value.
The expression created in this example (radial) is used
in the Variable Editor Example.