33.5.1. Creating a Custom Field Function

To create your own field function, you will use the Custom Field Function Calculator Dialog Box (Figure 33.3: The Custom Field Function Calculator Dialog Box). This dialog box allows you to define field functions based on existing functions, using simple calculator operators. Any functions that you define will be added to the list of default flow variables and other field functions provided by the solver.

 Parameters & Customization → Custom Field Functions  New...


Important:  Recall that you must enter all constants in the function definition in SI units.


Figure 33.3:  The Custom Field Function Calculator Dialog Box

The Custom Field Function Calculator Dialog Box

The steps for creating a custom field function are as follows:

  1. Use the calculator buttons and the Field Functions list and Select button to specify the function definition, as described below. (As you select each item from the Field Functions list or click a button in the calculator keypad, its symbol will appear in the Definition text entry box. You cannot edit the contents of this box directly; if you want to delete part of a function, use the DEL button on the keypad.)


    Important:  The range of integers and real numbers that can be stored is as follows:

    Note that using a number less than 1e-39 may produce inaccurate results, while values less than 1e-45 will produce a result of zero.


  2. Specify the name of the function in the New Function Name field.


    Important:  Be sure that you do not specify a name that is already used for a standard field function (for example, velocity-magnitude); you can see a complete list of the predefined field functions in ANSYS Fluent by selecting the display/contours text command and viewing the available choices for contours of.


  3. Click the Define button.

When you click Define, the solver will create the function and add it to the list of Custom Field Functions within the drop-down list of available field functions. The Define push button is grayed out after you create a new function or if the Definition text entry box is empty.

Should you decide to rename or delete the function after you have completed the definition, you can do so in the Field Function Definitions Dialog Box, which you can open by clicking on the Manage... push button. See Manipulating, Saving, and Loading Custom Field Functions for details.

33.5.1.1. Using the Calculator Buttons

Your function definition can include many basic calculator operations (for example, addition, subtraction, multiplication, square root). When you select a calculator button (by clicking on it), the appropriate symbol will appear in the Definition text entry box. The meaning of the buttons is straightforward; they are similar to the buttons you would find on any standard calculator. You should, however, note the following:

  • The CE/C button will clear the entire Definition and the New Function Name, if you have entered one. The DEL button will delete only the last entry in the Definition text entry box. You can use DEL to delete characters one at a time, starting with the last one entered.

  • To obtain the inverse trigonometric functions arcsin, arccos, and arctan, click the INV button before selecting sin, cos, or tan.

  • The ABS button yields the absolute value of the number that follows it. Likewise, the ln button yields the natural logarithm of the number that follows it, and the log10 button yields the base 10 logarithm function of the number that follows it.


    Important:   log10 and ln will be calculated for values greater than 0. For values less than or equal to 0, the resultant value will be zero.


  • The PI button represents and the e button represents the base of the natural logarithm system (which is approximately equal to ).

33.5.1.2. Using the Field Functions List

Your function definition can include any of the field functions defined by the solver (and listed in Alphabetical Listing of Field Variables and Their Definitions) or by you. You can also use any report definitions that you have created (see Monitoring and Reporting Solution Data for additional information). To include one of these variables/functions in your function definition, select it in the Field Functions drop-down list and then click the Select button below the list. The symbol for the selected item will appear in the Definition text entry box (for example, p will appear if you select Static Pressure).


Note:  If a custom field function definition uses a report definition, then it cannot be exported to a file.



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