Skip to main content

Named Variables

Create reusable numbers and expressions that can be applied across your project.

Updated over a week ago

Overview

Named variables let you define parameters once and use them throughout your simulation setup. When you update a variable's value, all references to it update automatically—making it easy to explore design variations and run parametric studies.

Common uses:

  • Define flow conditions (Mach number, angle of attack, temperature) as variables

  • Create expressions that calculate derived values automatically

  • Quickly switch between configurations using different variable sets

  • Parametrize geometry modifications and boundary conditions

Accessing Named Variables

Open the Variables dialog from the geometry toolbar:

  1. Look for the Variables button in the toolbar

  2. If it's not visible, click More Tools to find it

The Variables dialog opens, displaying your variable sets and their values.

Key Concepts: Sets vs Variables

Before diving in, it's important to understand the two-level structure:

Concept

What it is

Example

Variable Set

A named collection that holds multiple variables

cruise_conditions

Variable

A single named value within a set

MACH_NUMBER = 0.85

Think of a variable set as a folder and variables as the files inside it:

cruise_conditions/ ← Variable Set

├── MACH_NUMBER = 0.85 ← Variable

├── ALTITUDE = 35000 ← Variable

└── TEMPERATURE = 218.8 ← Variable

takeoff_conditions/ ← Variable Set

├── MACH_NUMBER = 0.25 ← Variable

├── ALTITUDE = 0 ← Variable

└── TEMPERATURE = 288.15 ← Variable

You can have multiple sets, but only one set is active at a time. Switching sets lets you quickly change all your simulation parameters at once.

Managing Variable Sets

A variable set is a named collection that groups related variables together. Create multiple sets to represent different configurations (e.g., "cruise_conditions" vs "takeoff_conditions").

Creating a New Set

When you create a new set, you must add at least one variable before saving.

  1. Open the Variables dialog

  2. Click the dropdown at the top of the dialog

  3. Select Create New Set

  4. Enter a name for the set (minimum 3 characters)

  5. Click Continue

  6. Enter a name and expression for your first variable

  7. Click Create Set to save both the set and the variable together

Switching Between Sets

  1. Open the Variables dialog

  2. Use the dropdown at the top to select a different set

  3. The table updates to show the variables in the selected set

Copying a Set

To duplicate an existing set as a starting point:

  1. Select the set you want to copy

  2. Click the Copy Set button (duplicate icon)

  3. Enter a name for the new set

  4. Click Copy Set

Renaming a Set

  1. Click the More options menu (three dots)

  2. Select Rename

  3. Enter the new name

  4. Click Save

Deleting a Set

  1. Click the More options menu (three dots)

  2. Select Delete

  3. Confirm the deletion in the dialog

Working with Variables

Variables are the individual named values within a set. You must have a set selected before you can add variables to it.

Adding a Variable to an Existing Set

  1. Select a set from the dropdown (or create one first)

  2. Click Add New Variable at the bottom of the dialog

  3. Enter a Name for the variable

  4. Enter an Expression (a number or formula)

  5. Click Create

  6. Click Save Set to save your changes

Editing a Variable

  1. Find the variable in the table

  2. Click the More options menu on that row

  3. Select Edit

  4. Modify the name or expression

  5. Click Update

Deleting a Variable

  1. Find the variable in the table

  2. Click the More options menu on that row

  3. Select Delete

Note: Variables that are currently used in your geometry cannot be edited or deleted. The menu items will be disabled with an explanation.

Variable Naming Rules

Variable names must follow these requirements:

Requirement

Details

Length

3 to 50 characters

Characters

ASCII characters only (no Unicode)

No whitespace

Spaces, tabs, newlines, and carriage returns are not allowed

Recommendation: Choose descriptive names that clearly indicate the variable's purpose.

Expressions

Variables can hold simple numbers or mathematical expressions that reference other variables.

Simple Values

Enter a number directly: 288.15

Expressions with Variables

Reference other variables by name, for example:

BASE_VELOCITY * 1.5

MACH_NUMBER * sqrt(GAMMA * R_GAS * TEMPERATURE)

Supported Operators

Operator

Description

Example

+

Addition

A + B

-

Subtraction

A - B

*

Multiplication

A * B

/

Division

A / B

-

Negation (unary)

-A

( )

Grouping

(A + B) * C

Note: There is no ^ operator for exponentiation. Use pow(x, y) instead.

Available Math Functions

You can use these functions in expressions:

Function

Description

Example

sqrt(x)

Square root

sqrt(AREA)

cbrt(x)

Cube root

cbrt(VOLUME)

pow(x, y)

Power (x raised to y)

pow(VELOCITY, 2)

abs(x)

Absolute value

abs(DELTA_P)

exp(x)

Exponential (e^x)

exp(RATE)

log(x)

Natural logarithm

log(RATIO)

sin(x), cos(x), tan(x)

Trigonometric functions

sin(ANGLE)

asin(x), acos(x), atan(x)

Inverse trigonometric

atan(SLOPE)

atan2(y, x)

Two-argument arctangent

atan2(Y, X)

min(a, b), max(a, b)

Minimum/maximum

max(TEMP1, TEMP2)

hypot(a, b)

Hypotenuse

hypot(DX, DY)

Math Constants

  • PI or pi — the value of pi (3.14159...)

Using Variables in Your Simulation

Once you've defined variables, you can reference them in numeric input fields that support expressions. Look for the + button next to a field—this indicates the field accepts variables.

Where You Can Use Variables

Variables can be used in these areas:

Geometry

  • Farfield creation — Radius, center coordinates, and dimensions for farfield spheres and cylinders

  • Transform operations — Translation distances, rotation angles, and scale factors

  • Pattern operations — Direction and spacing values

  • Primitive shapes — Dimensions for boxes, spheres, cylinders (radius, center, height, etc.)

Simulation Setup

  • Boundary conditions — Pressure, temperature, velocity, and other boundary values

  • Materials — Density, viscosity, thermal conductivity, and other material properties

  • Physics — Turbulence constants and model-specific parameters

  • Solver parameters — CFL number, linear solver tolerance, and other solver controls

  • Reference values — Reference pressure, temperature, velocity, and length

  • Output expressions — Custom output calculations

Inserting a Variable

In supported input fields, you'll see a + button:

  1. Click the + button next to an input field

  2. A menu appears showing available variables

  3. Click a variable name to insert it

Alternatively, type the variable name directly—autocomplete suggestions will appear as you type.

Visual Appearance

Variables appear as highlighted badges in the input field, making them easy to distinguish from regular numbers. The evaluated result is shown alongside the expression.

Managing Variables from Input Fields

When inserting variables from simulation input fields, click Manage at the bottom of the menu to open the Variables dialog directly.

Saving Your Changes

Changes to variables are not saved automatically. The dialog uses a working copy that you can modify freely.

  • Save Set — Commits your changes to the project

  • Cancel — Discards any unsaved changes

If you try to close the dialog or switch sets with unsaved changes, you'll see a warning asking whether to save first.

Troubleshooting

"Name must be between 3-50 characters..."

Your variable name doesn't meet the requirements. Check that it:

  • Has at least 3 characters

  • Contains only ASCII characters (no Unicode)

  • Has no whitespace (spaces, tabs, newlines)

"Set name must be at least 3 characters long"

Enter a longer name for your variable set.

Expression shows an error

Common causes:

  • Unknown variable: You referenced a variable that doesn't exist in the current set

  • Circular reference: Variable A references B, and B references A

  • Syntax error: Check your math operators and function names

Cannot edit or delete a variable

The variable is being used in your geometry. You must remove the geometry reference before modifying the variable.

"Cannot save a set with no variables"

Add at least one variable to the set before saving.

Example: Parametric Geometry

This example demonstrates how to create a variable set for parameterizing geometry dimensions. By defining a base dimension like chord length, all related geometry parameters update automatically when you change it.

Variable Set: parametric_geometry

Variable

Expression

Evaluated Value

CHORD_LENGTH

1

1

FARFIELD_RADIUS

CHORD_LENGTH * 50

50

PATTERN_SPACING

CHORD_LENGTH * 2

2

SPAN

CHORD_LENGTH * 5

5

This example shows:

  • Base parameter: CHORD_LENGTH is the reference dimension that controls other values

  • Derived values: SPAN, FARFIELD_RADIUS, and PATTERN_SPACING are calculated from CHORD_LENGTH

  • Automatic updates: When you change CHORD_LENGTH, all dependent variables update automatically

  • Practical application: Use FARFIELD_RADIUS when creating a farfield, SPAN for transforms, and PATTERN_SPACING for linear patterns

Tips and Best Practices

Use a Base Parameter for Scaling

Define one base parameter and calculate related dimensions from it:

CHORD_LENGTH = 1.0

SPAN = CHORD_LENGTH * 5

FARFIELD_RADIUS = CHORD_LENGTH * 50

PATTERN_SPACING = CHORD_LENGTH * 2

When you change CHORD_LENGTH, all dependent values update automatically.

Group Related Parameters

Keep related parameters together in the same set:

INLET_PRESSURE = 101325

INLET_TEMPERATURE = 288.15

INLET_VELOCITY = 50

Create Sets for Different Configurations

Maintain separate sets for different analysis scenarios:

  • parametric_geometry — Variables for geometry dimensions and farfield sizing

  • fine_mesh — Variables tuned for finer mesh resolution

  • coarse_mesh — Variables tuned for faster preliminary runs

Switch between sets to quickly reconfigure your simulation.

Did this answer your question?