KR72: My FLUENT User Defined Function (UDF) won't interpret or compile - what is wrong?


The answer depends upon what exactly has happened.

If FLUENT complains about not being able to find a compiler, then check to make sure that the compiler is properly installed.

On Windows machines, it is possible to install the Visual C++ compiler without fully setting up the command line compiler (which FLUENT needs to be able to find). During the installation process, you need to select the "register environment variables" option. Failing to do so will likely lead to complaints about things being "not recognized as an internal or external command, operable program or batch file" or missing DLL's.

It is theoretically possible to fix this issue by setting the appropriate environment variables, but keep in mind that even when `nmake` can be found there still may be DLL issues.

The easy path is probably reinstallation of Visual Studio (taking special care to make sure that the command line interface is set up properly), but the reinstallation path is always perilous. If you have long-term experience using Windows you should probably know the risks, and if you don't you should consult an expert.

If you are interpreting, keep in mind that not everything that is supported for compiled UDFs is supported for interpreted UDFs. This is true both for the UDF interface and the C language. If you are doing something pretty involved and it fails inexplicably, try compiling to see if that makes a difference.

There is also the possibility of coding errors. Keep in mind that your source code gets run through the C preprocessor (to change the FLUENT macros into C code), so unintended interactions are very possible.





Show Form
No comments yet. Be the first to add a comment!