### 14.3.3. Examples: Using Expressions in CFD-Post

The first example is a single-valued expression that calculates the pressure drop through a pipe. The names of inlet and outlet boundaries are “`inlet`” and “`outlet`”.

Create a new expression named “`dp`”:

    dp = massFlowAve(Pressure)@inlet – massFlowAve(Pressure)@outlet

When you click Apply, the value is shown below the editor.

Tip: Alternatively, type the expression in a table cell and prefix with ‘=’ sign. The cell displays the result when you click outside of the cell.

The second example is a variable expression that plots the pressure coefficient variation on a surface or a line:

1. Click the Expressions tab, then right-click in the Expressions area and select New.

2. Create these three expressions:

       RefPressure = 100000 [Pa]
       dynHead = 0.5 * areaAve(Density)@inlet * areaAve(Velocity)@inlet^2
       cpExp = (Pressure - RefPressure)/dynHead

3. Click the Variables tab, then right-click and select New.

4. Create a user variable defined by `cpExp`.

5. Select Insert > Location > Line and use the details view to position the line in the simulation.

   From the details view Color tab, plot the user variable on a surface or a line (just as you would with any other variable).

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