Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF compilation problem in ANSYS Fluent 2020 R2

    • yash54321
      Subscriber

      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:UsersyashrDesktopansystutsansystuts_filesdp0FFFFluentlibudfwin642ddp_node>C:PROGRA~1ANSYS Incv202fluent/../commonfiles/CPython/3_7/winx64/Release/python/scons C:PROGRA~1ANSYS' is not recognized as an internal or external command, operable program or batch file." OR "(chdir "libudf")(chdir "win642ddp_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.

    • Karthik Remella
      Administrator
      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
    • yash54321
      Subscriber
      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.
    • Rob
      Forum Moderator
      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.
    • attiq
      Subscriber
      Facing Same Issue
    • elwinxavier
      Subscriber
      I'm facing the same issue here. Any known solution?
    • Rob
      Forum Moderator
      Have you tried launching outside of Workbench?
    • attiq
      Subscriber
      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.
    • elwinxavier
      Subscriber
      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."
    • attiq
      Subscriber
      Open This link. Try this way

    • elwinxavier
      Subscriber
      Thanks Attiq. I Watched this before. Tried and doesnt help.
    • elwinxavier
      Subscriber
      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_JN
      Subscriber
      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!
      Install Visual Studio 2017 Community Edition with C++ options (ANSYS 2019 doesn't support newer versions of VS such as MSVS 2019)
      Go to Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
      Go to the bottom section named 'System variables' and then double-click to open "Path"
      There, create 4 new entries (mentioned below as steps 5, 6, 7, 8) by clicking on 'New':
      %SystemRoot%\system32
      %SystemRoot%
      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)
      :\\ANSYS Inc\v194\fluent\ntbin\win64 (This is for ANSYS 2019, your version number will change according to the one you have installed)
      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
      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
      Restart system
      Start FLUENT. In the FLUENT Launcher, click on 'Show More Options'
      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!
    • Keyur Kanade
      Ansys Employee
    • elwinxavier
      Subscriber
      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?
    • Rob
      Forum Moderator
      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?
    • Rob
      Forum Moderator
Viewing 16 reply threads
  • The topic ‘UDF compilation problem in ANSYS Fluent 2020 R2’ is closed to new replies.