3.3.1. Function Calculation

>calculate [<function name>, <arguments>]

A number of useful quantitative functions have been defined within Ansys TurboGrid. These functions are specified in the table below. You can follow the links in the Function Name column to see the syntax used for each function when using them from the Command Editor dialog box. A detailed description of the calculation performed by each function is not provided here. For details, see Function in the TurboGrid User's Guide. When using quantitative functions as part of a CEL expression, a different syntax is required. For details, see CEL Standard Functions.

These functions may be accessed from the Command Editor dialog box using the >calculate command, or via function calls within Power Syntax. Reference documentation on the Power Syntax functions is provided in Power Syntax.

When a function is evaluated, a singleton CALCULATOR object is created that shows the parameters and results for the most recent calculation. If the >calculate command is supplied without <function name> or <arguments>, then the calculation is performed with the settings from the CALCULATOR object (which may be modified like any other object in the Command Editor dialog box). An error is raised if the CALCULATOR object does not exist.

When evaluated as part of a Power Syntax function, the results of the calculation can be stored in a Power Syntax variable for further processing. See Examples of Power Syntax for examples of using calculations within Power Syntax.

Function Name

Operation

Arguments

<required> [<optional>]

area

Area projected to axis (no axis specification returns total area)

<Location>, [<Axis>]

areaAve

Area-weighted average

<Expression>, <Location>, [<Axis>]

areaInt

Area-weighted integral

<Expression>, <Location>, [<Axis>]

ave

Arithmetic average

<Expression>, <Location>

count

Number of calculation points

<Location>

length

Length of a curve

<Location>

lengthAve

Length-weighted average

<Expression>, <Location>

lengthInt

Length-weighted integration

<Expression>, <Location>

maxVal

Maximum Value

<Expression>, <Location>

minVal

Minimum Value

<Expression>, <Location>

probe

Value at a point

<Expression>, <Location>

sum

Sum over the calculation points

<Expression>, <Location>

volume

Volume of a 3D location

<Location>

volumeAve

Volume-weighted average

<Expression>, <Location>

volumeInt

Volume-weighted integral

<Expression>, <Location>


Note:  The following functions are not available in Ansys TurboGrid: force, forceNorm, massFlow, massFlowAve, massFlowInt and torque.


3.3.1.1. Expression Specification

Any variable or valid expression can be used as the <Expression> argument. For example, areaAve Minimum Face Angle, myPlane is allowed. For a list of variables and valid expressions, see CEL Functions, Constants and System Variables.

3.3.1.2. Axis Specification

Some functions take an axis specification as an argument. The general format for an axis specification is:

				<X|Y|Z>

3.3.1.3. Quantitative Function List

3.3.1.3.1. area
				>calculate area, <Location>, [<Axis>]

The specification of an axis is optional. If one is not specified, the value held in the CALCULATOR object is used. To calculate the total area of the location, the axis specification should be left blank (you should type a comma after the location specification). See area in the TurboGrid User's Guide for a detailed function description.

Example: >calculate area, myplane calculates the area of the locator myplane projected onto a plane normal to the axis specification in the CALCULATOR object.

Example: >calculate area, myplane, calculates the area of the locator myplane. Note that adding the comma after myplane removes the axis specification.

3.3.1.3.2. areaAve
				>calculate areaAve, <Expression>, <Location>, <Axis>

See areaAve in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.3. areaInt
				>calculate areaInt, <Expression>, <Location>, [<Axis>]

Axis is optional. If it is not specified the value held in the CALCULATOR object is used. To perform the integration over the total face area, the axis specification should be blank (you should type a comma after the location name). See areaInt in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.4. ave
				>calculate ave, <Expression>, <Location>

See ave in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.5. count
				>calculate count, <Location>

See count in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.6. length
				>calculate length, <Location>

Note:  When using this function in Power Syntax the leading character should be capitalized to avoid confusion with the Perl internal command "length". See length in the TurboGrid User's Guide for a function description.


3.3.1.3.7. lengthAve
				>calculate lengthAve, <Expression>, <Location>

See lengthAve in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.8. lengthInt
				>calculate lengthInt, <Expression>, <Location>.

See lengthInt in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.9. maxVal
				>calculate maxVal, <Expression>, <Location>

See maxVal in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.10. minVal
				>calculate minVal, <Expression>, <Location>

See minVal in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.11. probe
				>calculate probe, <Expression>, <Location>

See probe in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.12. sum
				>calculate sum, <Expression>, <Location>

See sum in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.13. volume
				>calculate volume, <Location>

See volume in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.14. volumeAve
				>calculate volumeAve, <Expression>, <Location>

See volumeAve in the TurboGrid User's Guide for a detailed function description.

3.3.1.3.15. volumeInt
				>calculate volumeInt, <Expression>, <Location>

See volumeInt in the TurboGrid User's Guide for a detailed function description.