The ANSYS Workbench expression parser supports standard math functions and operators, as well as units for quantities. Dimensional quantities are defined in units that are a combination of one or more separate units.
Negative dimension values can invert the direction vector of SpaceClaim operations with which they are associated. This change is applied to the current and subsequent design point updates. As a result, when a Workbench input parameter is used as a driving dimension for a SpaceClaim geometry, negative dimension values can result in unexpected geometric changes.
When dimensional geometry parameters are imported into Workbench from SpaceClaim or a bi-directional CAD interface, design point updates may fail when dependencies exist between the parameters or when the parametric update in the CAD-system or SpaceClaim cannot be realized with the parameter values specified in Workbench.
ANSYS Workbench expression and mathematical function evaluation is based on the Python 2.6 programming language (www.python.org) and inherits some behavior as described here. All Python numeric and function capabilities can be used. For example, Python provides support for hexadecimal (base 16) numbers. Appending a zero and an x to the front of a number tells Python to treat the number as a hexadecimal numeric literal.
When entering expressions, you must use the list and decimal separators defined in your locale settings. For example, if a comma is defined as a decimal separator and a semicolon defined as a list separator, use these when you type in an expression.
Do not start expression definitions with an = operator. Given existing
parameters P1, P2, and P3 to define a derived parameter P4 such that
P4=P1*P2*P3, type the expression
P1*P2*P3 in the Value field.

When you click away from the field, the expression is solved.

Expressions that involve quantities must be dimensionally consistent. The + and −
operators require that the two operands have compatible units. For example, you
cannot add an Area parameter to a
Length parameter. Both units must be
Length or both units must be Area.
The * and / operators do not have this
limitation. They allow one operand to be a quantity with a unit and the other
operand to be a dimensionless factor. Or, they allow both operands to be quantities
with units where the result is a different quantity type. For example,
Length/Time results in a quantity with a
Velocity unit.
Expressions support the following intrinsic functions, which support both standard numeric values and quantities as arguments. For functions preceded by an asterisk (*), be sure to read the information that follows this list.
| abs(arg) | cosh(arg) | log10(arg) | sin(arg) |
| acos(arg) | exp(arg) | max(arg list) | sinh(arg) |
| asin(arg) | fabs(arg) | min(arg list) | sqrt(arg) |
| atan(arg) | floor(arg) | nint(arg) | tan(arg) |
| *atan2(arg1,arg2) | int(arg) | pow(value, exponent) | tanh(arg) |
| ceil(arg) | log(arg) | round(arg) | PI, pi − constant |
| cos(arg) | loge(arg) | sign(arg) | E, e − constant |
The arguments for trigonometric functions are evaluated as follows:
If the argument is a real number or integer, the argument is evaluated as radians.
If the argument is a quantity (which has a value and units), the argument must be of type
Angle. The evaluation is based on the supplied
units ([deg] or [rad]).
You can include units, assuming that the unit makes sense in context of the expression. For
example, P2+3[mm]*P3 is valid if mm is
a valid unit expression for P2 and P3. For example, mm is a
valid unit expression if P2 is torque and P3 is force, or if P2 is area and P3 is
length.
The project unit system is used to evaluate the expressions. For temperatures, absolute temperature values are used in expression evaluation. All quantity values in an expression are converted to the project unit system.
The general units syntax in ANSYS Workbench is defined as
multiplier|unit|^power, where:
multiplier is a multiplying quantity or its
abbreviation, such as mega (M) or pico (p)
unit is the unit string or abbreviation, such as
gram (g), pound (lb), foot (ft), or meter (m)
power is the power to which the unit is
raised
For examples of multipliers and commonly used units, see Table 3: Unit Multipliers and Table 4: Example Quantities and Units.
When typing units in an expression, you must enclose the units in square braces
[...]. You generally do not see the braces when selecting
units from a list of commonly used units. In general, units declarations must obey
the following rules:
A units string consists of one or more units quantities, each with an optional multiplier and optional power. Each separate units quantity is separated by one or more spaces.
Abbreviations for multipliers and unit names are typically used, but full names are also supported.
Powers are denoted by the ^ (caret) symbol. A power of 1 is assumed if
no power is given. A negative power is typically used for unit division. For
example, [kg m^-3] corresponds to kilograms per cubic
meter.
If you enter units that are inconsistent with the physical quantity being described, then an expression error occurs.
Units do not have to be given in terms of the fundamental units, which are mass, length, time, temperature, angle, and solid angle. For instance, Pa (Pascals) and J (Joules) are both acceptable as parts of unit strings.
Units strings are case sensitive. For example, Kg and
KG are invalid units strings;
kg is correct.
Caution: When the specified project unit system uses the relative temperature units (C or F), the evaluation of expressions involving temperature, temperature differences, or temperature variances is a special case.
For the unit conversion of a specific temperature value, 1 degC = 274.15
K. However, the unit conversion for a temperature interval
(delta T) is 1 degC = 1 K. The expression evaluator takes
any temperature value and treats it as a specific temperature (not a temperature
interval) by converting it to the absolute unit of the project unit system
(either K or R). If the intent is to perform the evaluation in terms of
temperature intervals, you need to start with temperatures in absolute units.
Similarly, any expressions to be evaluated in terms of temperatures or temperature differences are converted to absolute units for calculation. In an expression with a temperature unit raised to a power other than 1 or a unit involving both temperatures and other units (for example a temperature gradient [C/m]), the temperature is assumed to be a temperature difference.
Table 2: Scenarios in which temperature-related units are converted before and during expression evaluation
| Scenario | Example |
|---|---|
| Temperature unit conversion | 10[C] * 2 = 566.3[K] = 293.15[C] |
| Temperatures appearing as part of a mixed unit are converted as temperature intervals | 10[C/m] * 50 [m] = 500[K] |
| Temperatures raised to a power other than 1 are converted as temperature intervals | 10[C^3] * 10[C] = 2831.5[K^4] |
Once the value quantity name (such as Area) is determined from the unit
of the value, it can only be subsequently changed by changing the Quantity
Name property for the parameter. You cannot change the expression
(for example, from area to volume) without changing the Quantity
Name property. Automatic unit conversion is only done when the
quantity name is known. If you want to express a temperature difference, start with
temperature in absolute units.
Note: "Sound Pressure Level" and "A Weighted Sound Pressure Level" are dimensionless quantities with units dB and dBA, respectively.
Math operations between these two units or either of these and a numerical value will result in a value with no unit. For example, 10 db x 10 = 100. (no unit)
Math operations between either of these units and a dimensional unit will result in a value with the dimensional unit. For example, 10 db x 10 m = 100 m.
Table 3: Unit Multipliers
| Multiplier Name | Multiplier Value | Multiplier Abbreviation |
|---|---|---|
| exa | 1018 | E |
| peta | 1015 | P |
| tera | 1012 | T |
| giga | 109 | G |
| mega | 106 | M |
| kilo | 103 | k |
| hecto | 102 | h |
| deca | 101 | da |
| deci | 10-1 | d |
| centi | 10-2 | c |
| milli | 10-3 | m |
| micro | 10-6 | u |
| nano | 10-9 | n |
| pico | 10-12 | p |
| femto | 10-15 | f |
| atto | 10-18 | a |
Table 4: Example Quantities and Units
| Quantity | Dimensionality | Example Units | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acceleration | Length Time^-2 |
| ||||||||||
| Current | Current |
| ||||||||||
| Density | Mass Length^-3 |
| ||||||||||
| Electric Charge | Current Time |
| ||||||||||
| Energy | Mass Length^2 Time^-2 |
| ||||||||||
| Force | Mass Length Time^-2 |
| ||||||||||
| Length | Length |
| ||||||||||
| Pressure | Mass Length^-1 Time^-2 |
| ||||||||||
| Power | Mass Length^2 Time^-3 |
| ||||||||||
| Temperature | Temperature |
| ||||||||||
| Temperature Difference | Temperature |
| ||||||||||
| Temperature Variance | Temperature^2 |
|