6.2.32. Hooking DEFINE_SOURCE UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_SOURCE UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in a source term dialog box (for example, the Mass sources dialog box) in ANSYS Fluent.

To hook the UDF to ANSYS Fluent, you will first need to open the Cell Zone Conditions task page.

 Setup →   Cell Zone Conditions

Select the appropriate zone in the Zone selection list of the Cell Zone Conditions task page and click the Edit... button to open the cell zone condition dialog box (for example, the Fluid dialog box, as shown in Figure 6.54: The Fluid Dialog Box).

Figure 6.54:  The Fluid Dialog Box

The Fluid Dialog Box

Next, enable the Source Terms option in the cell zone condition dialog box and click the Source Terms tab. This will display the source term parameters (mass, momentum, and so on) in the scrollable window. Click the Edit... button next to the source term (for example, Mass) you want to customize, in order to open the appropriate source term dialog box (for example, the Mass sources dialog box, as shown in Figure 6.55: The Mass sources Dialog Box).

Figure 6.55:  The Mass sources Dialog Box

The Mass sources Dialog Box

Specify the number of terms you want to model by setting the Number of Mass Sources text-entry box (for example, 2) and then select the function name (for example, usr_mass_src1::libudf and usr_mass_src2::libudf) from the appropriate drop-down list.

(Note that the UDF name that is displayed in the drop-down lists is preceded by the word udf.) Click OK in the Mass sources dialog box to accept the new boundary condition. The source term field in the cell zone condition dialog box will display the number of sources (for example, 2 sources). Click OK to close the cell zone condition dialog box and fix the new mass source terms for the solution calculation.

Repeat this step for all of the source terms you want to customize using a UDF.

See DEFINE_SOURCE for details about DEFINE_SOURCE functions.


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