Undergoing revisions. |
Compiled method adopts more features of C than the interpreted method, such as multidimensional array data.
NOTE: Do not include any SPACE in the name of the source file!
Define->Define UDF-> User Defined scaler, User Defined memory. Give Fluent the correct number of UDS and UDMI if used. Just like what is done in interpreted method.
Build a UDF library: Define-> Define UDF -> Compiled. Select the C source and header files, click “Build”. Fluent then will start compiling, errors are reported if any. Warnings can be ignored.
Then click “Load”, then all the variables that are returned, execution, initialization, or etc. should be shown that they are successfully loaded.
The rest is similar to interpreted method:
Go to whatever conditions you want to use your UDF, select the right functions.
Go to Define-> Define UDF ->Function hooks. Choose and hook the functions properly.
NOTE: functions from compiled UDF are differed by ending with ::libudf. Functions from interpreted method does not have that.
We would like to credit Shengzhi He for writing this guide.