Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Include Page

...

titleUndergoing revisions

FLUENT Google Analytics
FLUENT Google Analytics

How to Compile UDFs

...

Compiled method adopts more features of C than the interpreted method , such as does, e.g. implementation of multidimensional array data.

NOTE: Do not include any SPACE in the name of the source file!

  1. Put both the C source file and header files (if used) into the same folder as the case and data files.

    1. If you're running from WorkBench, put these files into dp0\FFF\Fluent.
       

  2. Open FLUENT.
     

  3. Unload previously compiled UDFs first to avoid potential errors. (This step can be skipped if the compiled method in the case did not use a UDF.)

    1. Define > Define UDF > Manager, unload previous compiled UDF library.
       

  4. 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.

     

  5. Build a UDF library: .

    1. Define-> Define UDF -> Compiled. Select the C source and header files, click “Build”. 

    2. Fluent will then

    will
    1. start compiling

    , errors are
    1. . Errors will be reported if there are any. Warnings can be ignored.
       

  6. Then click “Load”, then all Click “Load”. All the variables that are returned, executionexecuted, initializationinitialized, or etc. should be shown that they are to be successfully loaded.
     

  7. The rest is similar to interpreted method:

  8. NOTE:
  9. remaining steps are identical to compiling functions from an interpreted method:

    1. Choose the conditions you want to use the UDF. Select the right functions.

    2. Go to Define > Define UDF > Function Hooks. Choose and hook the functions properly.
       

  10. The remaining steps are identical to compiling functions from an interpreted method.

Note that functions from compiled UDF are

...

distinguished by

...

the appendage ::libudf. Functions from interpreted

...

methods do not have that.

We would like to credit Shengzhi He for writing this guide.