![](https://csdnimg.cn/release/download_crawler_static/13099789/bg11.jpg)
3.8.2. FLUID_THREAD_P() .................................................................................................. 325
3.8.3. Get_Report_Definition_Values ....................................................................... 326
3.8.4. M_PI ............................................................................................................................ 328
3.8.5. NULLP & NNULLP ...................................................................................................... 328
3.8.6. N_UDM .......................................................................................................................... 328
3.8.7. N_UDS .......................................................................................................................... 328
3.8.8. SQR(k) ........................................................................................................................ 328
3.8.9. UNIVERSAL_GAS_CONSTANT ..................................................................................... 329
4. Interpreting UDFs .......................................................................................................................... 331
4.1. Introduction ........................................................................................................................... 331
4.1.1. Location of the udf.h File ............................................................................................. 331
4.1.2. Limitations ..................................................................................................................... 332
4.2. Interpreting a UDF Source File Using the Interpreted UDFs Dialog Box ..................................... 332
4.3. Common Errors Made While Interpreting A Source File ............................................................ 335
5. Compiling UDFs ............................................................................................................................. 337
5.1. Introduction ........................................................................................................................... 338
5.1.1. Location of the udf.h File ............................................................................................. 338
5.1.2. Compilers ...................................................................................................................... 339
5.2. Compiling a UDF Using the GUI ............................................................................................... 341
5.3. Compile a UDF Using the TUI ................................................................................................... 346
5.3.1. Set Up the Directory Structure ........................................................................................ 346
5.3.1.1. Windows Systems .................................................................................................. 346
5.3.1.2. Linux Systems ........................................................................................................ 347
5.3.2. Build the UDF Library ..................................................................................................... 348
5.3.2.1. Windows Systems .................................................................................................. 348
5.3.2.2. Linux Systems ........................................................................................................ 350
5.3.3. Load the UDF Library ...................................................................................................... 351
5.4. Link Precompiled Object Files From Non-ANSYS Fluent Sources ............................................... 351
5.4.1.Windows Systems ........................................................................................................... 352
5.4.2. Linux Systems ................................................................................................................ 352
5.4.3. Example: Link Precompiled Objects to ANSYS Fluent ....................................................... 353
5.5. Load and Unload Libraries Using the UDF Library Manager Dialog Box ..................................... 356
5.5.1. Load the UDF Library ...................................................................................................... 356
5.5.2. Unload the UDF Library .................................................................................................. 357
5.6. Common Errors When Building and Loading a UDF Library ...................................................... 357
5.6.1. Windows Distributed Parallel .......................................................................................... 358
5.7. Special Considerations for Parallel ANSYS Fluent ...................................................................... 359
6. Hooking UDFs to ANSYS Fluent .................................................................................................... 361
6.1. Hooking General Purpose UDFs ............................................................................................... 361
6.1.1. Hooking DEFINE_ADJUST UDFs ................................................................................... 361
6.1.2. Hooking DEFINE_DELTAT UDFs ................................................................................... 363
6.1.3. Hooking DEFINE_EXECUTE_AT_END UDFs ................................................................. 364
6.1.4. Hooking DEFINE_EXECUTE_AT_EXIT UDFs ............................................................... 365
6.1.5. Hooking DEFINE_INIT UDFs ....................................................................................... 367
6.1.6. Hooking DEFINE_ON_DEMAND UDFs ............................................................................ 368
6.1.7. Hooking DEFINE_RW_FILE and DEFINE_RW_HDF_FILE UDFs ................................. 369
6.1.8. User-Defined Memory Storage ....................................................................................... 370
6.2. Hooking Model-Specific UDFs ................................................................................................. 371
6.2.1. Hooking DEFINE_ANISOTROPIC_CONDUCTIVITY UDFs ........................................... 372
6.2.2. Hooking DEFINE_CHEM_STEP UDFs ............................................................................ 374
6.2.3. Hooking DEFINE_CPHI UDFs ....................................................................................... 375
6.2.4. Hooking DEFINE_DIFFUSIVITY UDFs ........................................................................ 376
xvii
Release 19.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Customization Manual