This section presents the steps for interpreting a source file in Ansys Fluent. After it has been interpreted, the names of UDFs contained within the source file will appear in drop-down lists in Ansys Fluent.
The general procedure for interpreting a source file is as follows:
Make sure that the UDF source file is in the same folder that contains your case and data files.
Important: If you are running the parallel version of Ansys Fluent on a network of Windows machines, you must "share" the working folder that contains your UDF source, case, and data files so that all of the compute nodes in the cluster can see it. To share the working folder:
Open Windows Explorer and browse to the folder.
Right-click the working folder and select Sharing and Security from the menu.
Click .
Click .
The next step depends on your computer's operating system:
For Linux, start Ansys Fluent from the directory that contains your case, data, and UDF source files.
For Windows, start Ansys Fluent using Fluent Launcher, being sure to specify the folder that contains your case, data, and UDF source files in the Working Directory field in the General Options tab.
Read (or set up) your case file.
Interpret the UDF using the Interpreted UDFs dialog box (Figure 4.1: The Interpreted UDFs Dialog Box).
Parameters & Customization → User Defined Functions
Interpreted...
Indicate the UDF source file you want to interpret by clicking . This opens the Select File dialog box (Figure 4.2: The Select File Dialog Box).
In the Select File dialog box, select the desired file (for example, udfexample.c) and click . The Select File dialog box closes and the complete path to the file you selected appears in the Source File Name text box in the Interpreted UDFs dialog box (Figure 4.1: The Interpreted UDFs Dialog Box).
In the Interpreted UDFs dialog box, specify the C preprocessor to be used in the CPP Command Name field. You can keep the default
cppor you can enable the Use Contributed CPP option to use the preprocessor supplied by Ansys Fluent.Keep the default Stack Size setting of
10000, unless the number of local variables in your function will cause the stack to overflow. In this case, set the Stack Size to a number that is greater than the number of local variables used.If you want a listing of assembly language code to appear in the console when the function interprets, enable the Display Assembly Listing option. This option will be saved in your case file, so that when you read the case in a subsequent Ansys Fluent session, the assembly code will be automatically displayed.
Click Interpret to interpret your UDF:
If the compilation is successful and you have enabled Display Assembly Listing, then the assembler code is displayed in the console.
If you chose not to display the listing and the compilation is successful, then the CPP Command Name that was executed is displayed the console.
If the compilation is unsuccessful, then Ansys Fluent reports an error and you will need to debug your program. See Common Errors Made While Interpreting A Source File. You can also view the compilation history in the log file that is saved in your working folder.
Close the Interpreted UDFs dialog box when the interpreter has finished.
Write the case file. The interpreted function(s) are saved with the case file and are automatically interpreted when the case file is subsequently read.

