### 15.5.7. force

This function returns the force exerted by the fluid on the specified 2D locator in the specified direction.

    [<Phase>.]force[_<Axis>[_<Coord Frame>] ]()@<Location>

where:

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

- `<Axis>` is x, y, or z

- `<Coord Frame>` is the coordinate frame

- `<Location>` is any 2D region (such as a boundary or interface).

Force calculations on boundaries require additional momentum flow data.

`Water at RTP.force_x()@wall1` returns the total force in the X direction acting on `wall1` due to the fluid `Water at RTP`.

The force on a boundary is calculated using momentum flow data from the results file, if it is available. The result can be positive or negative, indicating the direction of the force. For non-boundary locators, an approximate force is always calculated.

CFD-Post calculates the approximate force as follows:

- If the locator is a wall boundary, the force is equal to the pressure force.

- For all other locators, the force is equal to the pressure force plus the mass flow force (due to the advection of momentum).

- In all cases, if wall shear data exists in the results file, the viscous force is added to the calculated force.

The `force` function enables you to select the fluids to use when performing your calculation. The result returned is the force on the locator due to that fluid/those fluids. Because the pressure force is the same at each node irrespective of the choice of fluids, the only difference is in the viscous forces (on wall boundaries) or the mass flow forces.

It is important to note that forces arising as a result of the reference pressure are not included in the force calculation. You can include reference pressure effects in the force calculation in the CFX-Solver by setting the expert parameter `include pref in forces = t`.

When performing transient simulations with rotating reference frames, forces may be reported in either the stationary frame or the rotating frame. The forces reported by the CFX-Solver out file are always given in the rotating frame. The forces reported by CFD-Post are reported in the stationary frame if the ‘Angular shift for Transient Rotating Domains’ option is active, as discussed in Angular Shift for Transient Rotating Locations in the CFD-Post User's Guide.

#### 15.5.7.1. Tools > Command Editor Example

    >calculate force, <Location>, <Axis>, [<Phase>]

#### 15.5.7.2. Tools > Function Calculator Examples

- This calculates the total force on the default wall boundaries in the X direction. Pressure and viscous forces are included.

  Function: `force`, Location: `Default`, Direction: `Global X`, Phase: `All Fluids`.

- This calculates the forces on inlet1 due to pressure and the advection of momentum.

  Function: force, Location: inlet1, Direction: `Global X`, Phase: `Water at RTP`.

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