[ANSYS, Inc. Logo] return to home search
next up previous contents

Step 15: Create a Custom Variable and Animate the Display

In this section you will generate an expression using the CFX Expression Language (CEL), which you can then use in CFD-Post in place of a numeric value. You will then associate the expression with a variable, which you will also create. Finally, you will create a plane that displays the new variable, then move the plane to see how the values for the variable change.

1.   Define a custom expression for the dynamic head formula $(rho\vert V\vert^ 2)/2$ as follows:

(a)   On the tab bar at the top of the workspace area, select Expressions. Right-click in the Expressions area and select New.

(b)   In the New Expression dialog box, type: DynamicHeadExp

(c)   Click OK.

(d)   In the Definition area, type in this definition:

Density * abs(Velocity)^2 / 2

where:

  • Density is a variable

  • abs is a CEL function ( abs is unnecessary in this example, it simply illustrates the use of a CEL function)

  • Velocity is a variable

   You can learn which predefined functions, variables, expression, locations, and constants are available by right-clicking in the Definition area.

(e)   Click Apply.

2.   Associate the expression with a variable (as the plane you define in the next step can display only variables):

(a)   On the tab bar at the top of the workspace area, select Variables. Right-click in the Variables area and select New.

(b)   In the New Variable dialog box, type: DynamicHeadVar

(c)   Click OK.

(d)   In the Details view for DynamicHeadVar, click the drop-down arrow beside Expression and choose DynamicHeadExp. Click Apply.

3.   Create a plane and animate it:

(a)   Click on the 3D Viewer tab.

(b)   Right-click on the wireframe and select Insert / YZ Plane.

(c)   If you see a dialog box that asks in which direction you want the normal to point, choose the direction appropriate for your purposes.

A plane that maps the distribution of the default variable (Pressure) appears.

(d)   On the Color tab, set Variable to "DynamicHeadVar''. On the Render tab, clear Lighting. Click Apply.

The plane now maps the dynamic head distribution.

(e)   In the 3D Viewer in with the mouse cursor in select mode, click on the plane and drag it to various places in the object to see how the location changes the DynamicHeadVar values displayed.

(f)   Right-click on the plane and select Animate. The Animation dialog box appears and the plane moves through the entire domain, displaying changes to the DynamicHeadVar values as it moves.

(g)   On the Animation dialog box, click the Stop icon figure , then click Close.

   You can define multiple planes and animate them concurrently. First, stop any animations currently running, then create a new plane. To animate both planes, hold down Ctrl to select multiple planes on the Animation dialog box and press the Play icon figure .

4.   In the upper-left corner of the 3D Viewer, click the down arrow beside Figure 1 and change it to View 1.

5.   In the Outline view, right-click beside User Locations and Plots and select Hide All, then select Wireframe and Default Legend View 1 to make them visible.


next up previous contents Previous: Step 14: Review and
Up: Introduction to Using CFD-Post:
Next: Step 16: Loading and
Release 12.0 © ANSYS, Inc. 2009-03-30