![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
After you have interpreted (Chapter 4) or compiled (Chapter 5) 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 (e.g., 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.
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 (e.g., the Fluid dialog box, as shown in Figure 6.2.26).
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, etc.) in the scrollable window. Click the Edit... button next to the source term (e.g., Mass) you wish to customize, in order to open the appropriate source term dialog box (e.g., the Mass sources dialog box, as shown in Figure 6.2.27).
Specify the number of terms you wish to model by setting the Number of Mass Sources text-entry box (e.g., 2) and then select the function name (e.g., 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 text box in the cell zone condition dialog box will display the number of sources (e.g., 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 wish to customize using a UDF.
See Section 2.3.19 for details about DEFINE_SOURCE functions.