15.5.27. 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, or injection region. For an injection region, an average value is calculated at each position, and then these are summed over all positions.

15.5.27.1. Tools > Command Editor Example

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

15.5.27.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