### 15.5.26. sum

The `sum` function calculates the sum of a variable or expression on the specified location.

Note: CFD-Post and CFX-Solver compute the sum in different ways:

- CFD-Post computes the sum of the vertex values for the location.

- CFX-Solver computes the sum of the vertex values for a 3D location.

- CFX-Solver computes the sum of the face values for a 2D location. The value for a particular face is computed by arithmetically averaging the vertex values of the face.

    sum(<Variable|Expression>)@<Location>

where:

- `<Variable|Expression>` is a variable or expression.

- `<Location>` is, in the context of CFX-Solver, a 2D region or 3D region (such as a domain or subdomain) or, in the context of CFD-Post, a Point object or a 1D, 2D, or 3D locator.

#### 15.5.26.1. Tools > Command Editor Example

    >calculate sum, <Variable|Expression>, <Location>

#### 15.5.26.2. Tools > Function Calculator Example

This example returns the sum of the finite volumes assigned to each node in the location `SubDomain1`. In this case, this sums to the volume of the subdomain:

Function: `sum`, Location: `SubDomain1`, Variable: `Volume of Finite Volume`

Release 18.2 - © ANSYS, Inc. All rights reserved.