[ANSYS, Inc. Logo] return to home search
next up previous contents index

1.4.1 Including the udf.h Header File in Your Source File

The udf.h header file contains definitions for DEFINE macros as well as #include compiler directives for C library function header files. It also includes header files (e.g., mem.h) for other ANSYS FLUENT-supplied macros and functions. You must, therefore, include the udf.h file at the beginning of every UDF source code file using the #include compiler directive:

#include "udf.h"

For example, when udf.h is included in the source file containing the DEFINE statement from the previous section,

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, index)

upon compilation, the macro will expand to

void inlet_x_velocity(Thread *thread, int index)

figure   

You do not need to put a copy of udf.h in your local folder when you compile your UDF. The ANSYS FLUENT solver automatically reads the udf.h file from the following folder after your UDF is compiled:

path $\backslash$ ANSYS Inc $\backslash$ v120 $\backslash$ fluent $\backslash$ fluent12.0. $\stackrel{\Downarrow}{x} \backslash$ src $\backslash$

where path is the folder in which you have installed ANSYS FLUENT (by default, the path is C: $\backslash$ Program Files), and $x$ is replaced by the appropriate number for the release (e.g., 9 for fluent12.0.9).


next up previous contents index Previous: 1.4 Defining Your UDF
Up: 1.4 Defining Your UDF
Next: 1.5 Interpreting and Compiling
Release 12.0 © ANSYS, Inc. 2009-01-14