6.2.24. Hooking DEFINE_PROPERTY UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your material property UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in ANSYS Fluent.

There are various dialog boxes in which you can activate a DEFINE_PROPERTY UDF (for example, Phase Interaction dialog box, Secondary Phase dialog box), and so the method for hooking it will depend on the property being defined. The following is an example of hooking a UDF that defines viscosity.

First, open the Materials task page.

 Setup →   Materials

Select the appropriate material from the Material selection list and click the Create/Edit... button to open the Create/Edit Materials dialog box (Figure 6.43: The Create/ Edit Materials Dialog Box).

Figure 6.43:  The Create/ Edit Materials Dialog Box

The Create/ Edit Materials Dialog Box

Next, open the User-Defined Functions dialog box (Figure 6.44: The User-Defined Functions Dialog Box) by choosing user-defined in the drop-down list for the appropriate property (for example, Viscosity) in the Create/Edit Materials dialog box. Then select the function name (for example, cell_viscosity::libudf) from the list of UDFs displayed in the User-Defined Functions dialog box and click OK. The name of the function will subsequently be displayed under the selected property in the Create/Edit Materials dialog box.

Figure 6.44:  The User-Defined Functions Dialog Box

The User-Defined Functions Dialog Box


Important:  If you plan to define density using a UDF, note that the solution convergence will become poor as the density variation becomes large. Specifying a compressible law (density as a function of pressure) or multiphase behavior (spatially varying density) may lead to divergence. It is recommended that you restrict the use of UDFs for density to weakly compressible flows with mild density variations.


See DEFINE_PROPERTY UDFs for details about DEFINE_PROPERTY functions.


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