UDF compilation problem in ANSYS Fluent 2020 R2

yash54321yash54321 Member Posts: 2

Hi,

Please find attached images for error messages. Here, I tried to compile the customizable UDF from ANSYS fluent manual.

I used "in-built compiler" and "MS Visual studio19 compiler (trying all available answers)".

The errors are either "'C:\Users\yashr\Desktop\ansystuts\ansystuts_files\dp0\FFF\Fluent\libudf\win64\2ddp_node>C:\PROGRA~1\ANSYS Inc\v202\fluent/../commonfiles/CPython/3_7/winx64/Release/python/scons C:\PROGRA~1\ANSYS' is not recognized as an internal or external command, operable program or batch file." OR "(chdir "libudf")(chdir "win64\2ddp_node")'nmake' is not recognized as an internal or external command, operable program or batch file."

Also, I didn't find option to start fluent 2020R2 in serial mode. Resulting in "The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64)." error.


Answers

  • KremellaKremella Admin Posts: 2,326

    Try launching Fluent using the -t0 flag. Change total number of processors to 0 and see if this alleviates the issue you are seeing.

    It is also possible that the MS visual studio is not installed correctly on your computer. Please double check if this is done correctly.

    You could also try to 'Use the In-Built Compiler' option in Fluent 2020R2.

    Thanks.

    Karthik

  • yash54321yash54321 Member Posts: 2

    The fluent does not let me start using 0 processors. Also, I used 'in-built compiler' but doesn't work (as mentioned in the question). Thanks for your suggestions.

  • RobRob UKForum Coordinator Posts: 8,371

    nmake means there isn't an external compiler (typically Microsoft). I'm not sure why the built in compiler is failing though, does it run when you launch Fluent outside of Workbench. The lack of parallelisation of the code may mean the result isn't correct but doesn't normally stop the compiler from working.

  • attiqattiq Member Posts: 4

    Facing Same Issue

  • elwinxavierelwinxavier Member Posts: 12

    I'm facing the same issue here. Any known solution?

  • RobRob UKForum Coordinator Posts: 8,371

    Have you tried launching outside of Workbench?

  • attiqattiq Member Posts: 4

    I tried changing the version of MS Visual Studio and Tried running or opening fluent through RUN PROMPT. But every time I open I had to do it through VS Run Prompt. The problem is partially solved. Even through VS run prompt, sometimes fluent fails to load UDF. But sometimes it works fine.

    Experts advice is still needed.

    Thank You.

  • elwinxavierelwinxavier Member Posts: 12
    edited January 6

    Ya, even outside workbench I failed too. I used Built-in Compiler btw.

    This is the error when i press "build"

    "'C:\PROGRA~1\ANSYS' is not recognized as an internal or external command,

    operable program or batch file."

  • elwinxavierelwinxavier Member Posts: 12

    Thanks Attiq. I Watched this before. Tried and doesnt help.

  • elwinxavierelwinxavier Member Posts: 12
    edited January 6

    @Rob I used Build-In Compiler and also tried both inside Workbench and outside workbench.


    I'm getting error "'C:\PROGRA~1\ANSYS' is not recognized as an internal or external command, operable program or batch file."

    Where is this directory of "C:\PROGRA~1\ANSYS" tho?


    I'm not sure warning should be ignore? but if I continue to Load it, it will become

    "Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the file specified."

  • JD_JNJD_JN Member Posts: 56

    Hello,

    As I had commented on an earlier similar post, I had the same issue and this is how I fixed it. Following these steps, you don't have to launch fluent from command prompt!

    1. Install Visual Studio 2017 Community Edition with C++ options (ANSYS 2019 doesn't support newer versions of VS such as MSVS 2019)
    2. Go to Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
    3. Go to the bottom section named 'System variables' and then double-click to open "Path"
    4. There, create 4 new entries (mentioned below as steps 5, 6, 7, 8) by clicking on 'New':
    5. %SystemRoot%\system32
    6. %SystemRoot%
    7. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64 (This is the location for "nmake" in MSVS 2017 Community Edition)
    8. <Drive letter>:\<ANSYS Installed Folder Name>\ANSYS Inc\v194\fluent\ntbin\win64 (This is for ANSYS 2019, your version number will change according to the one you have installed)
    9. Make sure that the entries in steps 5 - 8 are at the top most rows of the path variables, i.e., entry 5 should be in row 1, entry 6 should be in row 2, entry 7 should be in row 3, and entry 8 should be in row 4. You can change their row positions using "Move Up" option in the system variables dialog box
    10. Click OK and exit out of the Path variables dialog box, as well as exit out of the Environment variables dialog box and System properties dialog box
    11. Restart system
    12. Start FLUENT. In the FLUENT Launcher, click on 'Show More Options'
    13. Make sure that the working directory location is the location of your folder containing your UDF and then click OK to launch FLUENT

    Now you will be able to build and load your UDFs.

    Hope this will also help in your issue.

    Cheers!

  • elwinxavierelwinxavier Member Posts: 12

    @JD_JN appreciate the kind help. Unfortunately these doesn't help.

    My problem aren't really nmake. I'm using 2020 R2, I have the feature to enable "Built-In Compilers"

    So the problem Statement is, when in Compiled UDFs

    Built will result following Error

    "'C:\PROGRA~1\ANSYS' is not recognized as an internal or external command, operable program or batch file."

    LOAD will result following Error

    "Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the file specified."



    Do ANSYS staff knows, with Build-In Compiler, is the problem still lies within Visual Studio? Because if it doesn't we can certainly skip the MS Visual Studio and look other way.

    Or the problem is more to the Build-in Compilers itself. Is there anyway to check on Build-In Compilers? DO we have any patch and installer to re-install on ANSYS Patch?

  • RobRob UKForum Coordinator Posts: 8,371

    The built in compiler should install with the rest of the code and is CLANG based so nothing linked to Microsoft VS. What is the full path of the installation and working folder?

This discussion has been closed.