UDFs are defined using DEFINE macros (see
DEFINE Macros) and the definitions for
DEFINE macros are included in udf.h.
Consequently, before you compile your source file, the udf.h header
file must be accessible in your path, or saved locally within your working folder.
The location of the udf.h file is:
path\ANSYS
Inc\v182\fluent\fluent18.2.0\src\udf.h
where path is the folder in which you
have installed ANSYS Fluent (by default, the path is C:\Program
Files).
You should not, under any circumstances, alter the udf.h file.
In general, you should not copy udf.h from the installation area. The compiler is designed to look for this file locally (in your current folder) first. If it is not found in your current folder, the compiler will look in the \src folder automatically. In the event that you upgrade your release area, but do not delete an old copy of udf.h from your working folder, you will not be accessing the most recent version of this file.
There may be instances when you will want to include additional header files in the compilation process. Make sure that all header files needed for UDFs are located in the \src folder.