Parameters

The Parameter Workspace in ANSYS Workbench stores and coordinates all of the parameters and design points that are produced or consumed by components of the current project.

A parameter is an entity that is linked to a data model property within an application. You can have input and output parameters. Parameter values can be numeric or non-numeric (string or Boolean). Non-numeric parameters are ignored for charting purposes. An input parameter can be modified at the project level and drives a change within the data model. The value of an output parameter is set by the application, based on the current results or state.

Input parameters are those parameters that define the geometry or inputs to the analysis for the system under investigation. Input parameters have predefined values or ranges that may be changed. These include (and are not limited to) CAD parameters, analysis parameters, and DesignModeler parameters. CAD and DesignModeler input parameters might include length, radius, etc.; analysis input parameters might include pressure, material properties, sheet thickness, etc.

Output parameters are those parameters that result from the geometry or are the response outputs from the analysis. These include (and are not limited to) volume, mass, frequency, stress, velocities, pressures, forces, heat flux, and so forth.

You can also create a Custom Parameter, which can be either an input or an output parameter, defined by an expression.

All parameters have a type, preferably a quantity with a quantity name. The quantity name is used to define preferred and available units for the quantity. If the value is not a quantity or does not have a quantity name set, it will be displayed as unitless throughout the GUI.

Parameters can be added to or deleted from the current project, but doing so may set the existing design points and design exploration systems to an out-of-date state and could result in several hours of recalculation time, depending on the project. Be aware that deleting a parameter while it is referenced in the expression of another parameter will invalidate the driven data model, resulting in an error.

Custom Parameters

At the project level, you can create custom parameters that are not directly associated to a data model property. They can be custom input or custom output parameters that can be defined by a constant value (e.g., "12.5 [cm]" or "sin(pi/2)"), or they can be derived parameters, defined by an expression of other parameters (e.g., "P2+3*P3").

To create a derived parameter, enter the expression statement in the Expression field of the Properties of Outline view or in the Value field of the Outline of Parameters view. Both derived parameters and constant values can be added in the Outline of Parameters view, but once added, derived parameters become read-only in the Outline view. You must use the Properties of Outline view to edit them. Constant values, however, can be edited in the Outline of Parameters view.

If the expression defining the custom parameter results in a quantity, it will infer its quantity name from the value produced by the expression evaluation. As a consequence, if the expression is a sum of multiple terms, every term needs to be made of the same quantity. For example, if the resulting quantity is 3.4[m^2], the new custom parameter will take on the quantity name “Area.” In some cases, more than one quantity name may be valid for the expression. In these cases, the parameter quantity name will not be set, but can be selected from a list in the parameter Properties view. Once the value quantity name (e.g., Area) is determined from the unit of the value, it can only be subsequently changed by changing the parameter's "value quantity name" property setting. You cannot change the expression (e.g., from area to volume) without changing the value quantity name.

The expression defined for a custom boolean parameter can be the Python values True or False, or a Python logical expression, such as “P1 > P2” or “P1 == 10 and P2 == 10”. For a parameterized boolean parameter, you can select True/False from the dropdown in the Value column.

The expression defined for a custom string parameter must be quoted with single or double quotes, i.e., ‘string value’ or “string value”.

Output to Input Chaining of Parameters

You can chain output to input parameters to allow an input to be driven directly from the current value of an output, provided that the chaining does not create a circular dependency. To chain parameters, change the input parameter definition to an expression involving other parameters. To create a derived variable, first insert an expression and then edit the Expression field in the Properties of Outline view.

Expressions, Quantities, and Units

The ANSYS Workbench expression parser supports standard math functions and operators, as well as units for quantities. Dimensional quantities are defined in units which are a combination of one or more separate units.

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 octal (base 8) and hexadecimal (base 16) numbers. To tell Python that a number should be treated as an octal numeric literal, simply append a zero to the front. Appending a zero and an x to the front of a number tells Python to treat the number as a hexadecimal numeric literal.

Do not start expressions with an “=” operator. To define a derived parameter P5 such that P5=P2+3*P3, set the expression to P2+3*P3, given that P2 and P3 are existing parameters.

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 a number of intrinsic functions, outlined below. These functions support both standard numeric values and quantities as arguments.

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 number (i.e., real or integer), then the argument is evaluated as radians.

  • If the argument is a quantity (i.e., has value and units), then the argument must be of type 'Angle', and evaluation is based on the supplied units (i.e., [deg] or [rad]).

You can include units, assuming 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 (e.g., 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 (e.g., mega (M), pico (p), etc.), unit is the unit string or abbreviation (e.g., gram (g), pound (lb) foot (ft), meter (m), etc.), and power is the power to which the unit is raised. See Table 1: Unit Multipliers and Table 2: Example Quantities and Units for examples of multipliers and commonly used units.

When typing units in an expression, the units must be enclosed by square braces [...]. You will usually 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 (i.e., [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 will result.

  • Units do not have to be given in terms of the fundamental units (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 both invalid parts of units strings; kg is correct.


Caution:

English US expression evaluations that involve temperatures are 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 will take any temperature value and treat 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.

Once the value quantity name (e.g., Area) is determined from the unit of the value, it can only be subsequently changed by changing the parameter's "value quantity name" property setting. You cannot change the expression (e.g., from area to volume) without changing the value quantity name. Automatic unit conversion is only done when the quantity name is known.

Table 1  Unit Multipliers

Multiplier NameMultiplier ValueMultiplier 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-1d
centi  10-2 c
milli  10-3 m
micro  10-6 u
nano  10-9 n
pico  10-12 p
femto  10-15 f
atto10-18a

Table 2  Example Quantities and Units

QuantityDimensionalityExample Units
Acceleration Length Time^-2
m s^-2
ft s^-2
in s^-2
um ms^-2
Current Current
A
mA
pA
Density Mass Length^-3
kg m^-3
g cm^-3
lb ft^-3
slug in^-3
slinch in^-3
Electric Charge Current Time
A s
coulomb
pA s
Energy Mass Length^2 Time^-2
J
BTU
erg
lbf ft
slug in^2 s^-2
Force Mass Length Time^-2
dyne
N
pdl
lbf
slug in s^-2
Length Length
m
cm
foot
in
mm
micron
ft
um
yard
Pressure Mass Length^-1 Time^-2
Pa
MPa
N m^-2
bar
torr
mm Hg
psi
psf
atm
dyne cm^-2
Power Mass Length^2 Time^-3
W
BTU s^-1
HP
erg s^-1
lbf ft s^-1
TemperatureTemperature
K
C
R
F

Release 14.0 - © 2011 SAS IP, Inc. All rights reserved.