### 15.5.15. massFlow

Computes the mass flow through the specified 2D location.

    [<Phase>.]massFlow()@<Location>

where:

- `[<Phase>.]` is an optional prefix that is not required for single-phase flows. For details, see CEL Functions with Multiphase Flow.

- `<Location>` is any fluid surfaces (such as Inlets, Outlets, Openings and fluid-fluid interfaces).

`Air at STP.massFlow()@DegassingOutlet` calculates the mass flow of `Air at STP` through the selected location.

For boundary locators:

- The mass flow is calculated using mass flow data from the results file, if it is available[5]. Otherwise, an approximate mass flow is calculated.

- For multiphase cases, the mass flow through a boundary on a GGI interface evaluated in CFD-Post is an approximation to the 'exact' mass flow evaluated by the solver. This approximation vanishes as the mesh is refined or as the volume fraction on the interface becomes uniform.

For non-boundary locators (that is, internal locators):

- If the locator is an edge based locator (such as a slice plane or isosurface), the domain mass flow data from the results file will be used.

- In all other cases, an approximate mass flow is calculated.

- The `massFlow` function (and related functions `massFlowAve` and `massFlowAveAbs`) in CFD-Post can be inaccurate when evaluated on a physical locator (cut plane, isosurface, etc.) that cuts through a GGI interface, due to inaccuracies in evaluating the conserved mass flow (from integration point data) along the intersection of the physical locator and the GGI interface. In this situation, calculating the approximate mass flow would be more accurate. The approximate mass flow can be calculated with an expression of the form: `sum(Approximated Mass Flow)@[locator]`. For example, `sum(Approximated Mass Flow)@Plane 1`. Alternatively, the approximate mass flow can be calculated using an expression of the form: `areaInt_x(Velocity u * Density)@myLoc + areaInt_y(Velocity v * Density)@myLoc + areaInt_z(Velocity w * Density)@myLoc`.

The `massFlow` function enables you to select the fluids to use when performing your calculation. The result returned is the mass flow of the selected fluids through the locator.

If a user specifies a boundary mass source, this mass source is not included in the massFlow calculator. This will affect all massFlow related calculations, such as massFlowInt().

#### 15.5.15.1. Mass Flow Sign Convention

The mass flow through a surface is defined by where is the velocity vector and is the surface normal vector. By convention, the surface normal at a domain boundary is directed out of the domain. Therefore, the mass flow is positive at an inlet boundary with the velocity directed into the domain. For planes and surfaces that cut through a domain, the normal of the plane or surface is determined by from the right-hand rule and the manner in which the plane or surface is constructed. For example, the surface normal for a Z-X plane has the same sense and direction as the Y axis.

#### 15.5.15.2. Tools > Command Editor Example

    >calculate massFlow, <Location>, [<Phase>]

#### 15.5.15.3. Tools > Function Calculator Example

This calculates the mass flow for all fluids in the domains through the location outlet2:

Function: `massFlow`, Location: `outlet2`, Phase: `All Fluids`.

[5] The availability depends on the setting for Output Boundary Flows for the file (see Output Boundary Flows Check Box in the CFX-Pre User's Guide for details).

In addition to this, mass flow information written to a backup file at time zero is not accurate. To calculate accurate mass flow from a backup file, use information from the backup file written after the first timestep/iteration of the run.

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