Summary About Udfs: .C Myudf.C Udf.H #Include "Udf.H" Define
Summary About Udfs: .C Myudf.C Udf.H #Include "Udf.H" Define
1) A UDF can be used to define our own boundary conditions, material properties, and source
terms for our flow regime, as well as specify customized model parameters (e.g., DPM, multiphase
models), initialize a solution, or enhance post-processing.
2) UDFs are written in the C programming language using any text editor and the source code
file is saved with a .c extension (e.g., myudf.c).
3) Every UDF must contain the udf.h file inclusion directive ( #include "udf.h") at the
beginning of the source code file, which allows definitions of DEFINE macros and other Fluent-
provided macros and functions to be included during the compilation process.
4) Source files containing UDFs can be either interpreted or compiled in FLUENT. For
interpreted UDFs, source files are interpreted and loaded directly at runtime, in a single-step
process. For compiled UDFs, the process involves two separate steps. A shared object code library is
first built and then it is loaded into FLUENT.
5) Once interpreted or compiled, UDFs will become visible and selectable in FLUENT graphics
panels, and can be hooked to a solver by choosing the function name in the appropriate panel.
DEFINE Macros
1)