![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
A common compiler error occurs when you forget to put an #include "udf.h" statement at the beginning of your source file. You'll get a long list of compiler error messages that include illegal declarations of variables. Similarly, if your function requires an auxiliary header file (e.g., sg_pdf.h) and you forgot to include it, you'll get a similar compiler error message.
Another common error occurs when the argument list for a DEFINE statement is placed on multiple lines. (All DEFINE macro arguments must be listed on the same line in a C file.) The compiler will typically not report any error message but it will report a single warning message in the log file to indicate that this occurred:
warning: no newline at end of file |
If your compiled UDF library loads successfully then each function contained within the library will be reported to the console (and log file). For example, if you built a shared library named libudf containing two user-defined functions superfluid_density and speed_sound, a successful library load (on a Linux machine) will result in the following message reported to the console (and log file) for a Linux machine:
Opening library "libudf"... Library "libudf/lnx86/3d/libudf.so" opened superfluid_density speed_sound Done. |
If, instead, no function names are listed, then it is likely that your source file did not successfully compile. In this case, you'll need to consult the log to view the compilation history, and debug your function(s). Note that you'll need to unload the UDF library using the UDF Library Manager dialog box before you reload the debugged version of your library.
Another common error occurs when you try to read a case file that was saved with a shared library, and that shared library has subsequently been moved to another location. In this case, the following error will be reported to the console (and log file) on a Linux machine:
Opening library "libudf"... Error: open_udf_library: couldn't open library: libudf/ln86/2d/libudf.so |
Similarly, you will get an error message when you try to load a shared library before it has been built.
Opening library "libudf"... Error: open_udf_library: No such file or directory |
Windows Parallel
If you are trying to load a compiled UDF while running ANSYS FLUENT in network parallel, you may receive this error:
Error: open_udf_library: The system cannot find the path specified |
This error occurs because the other computer(s) on the cluster cannot "see'' the UDF through the network. To remedy this, you will need to 1) modify the environment variables on the computer where the compiled UDF, case, and data files reside; and 2) share the folder where the files reside. See Section 5.2 for details on file sharing or contact ANSYS FLUENT installation support for additional assistance.
There are instances when ANSYS FLUENT can hang when trying to read a compiled UDF using network parallel as a result of a network communicator problem. Contact ANSYS FLUENT installation support for details.
You may receive an error message when you invoke the command nmake if you have the wrong compiler installed or if you have not launched the Visual Studio Command Prompt prior to building the UDF. See Section 5.1.2 and Section 5.2 for details or contact ANSYS FLUENT installation support for further assistance.