Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF loading error

TAGGED: ,

    • Fakhreddine Madi
      Subscriber

      UDF suddenly stopped loading. It compiles fine, but when I load it I get 

      Error at Node 5: Error code: 5

      Error at Node 6: Error code: 5

      Error at Node 7: Error code: 5

      etc...

      I have tried other UDF that I know worked before but still get the same error.

      I also run Fluent as Admin and use in-built to compile.

      I couldn't find any refrence to Error code: 5 on Nodes; is there any more info about this error

       

      ===============Message from the Cortex Process================================

       

      Compute processes interrupted. Processing can be resumed.

       

      ==============================================================================

      Error at Node 5: Error code: 5

      Error at Node 3: Error code: 5

      Error at Node 4: Error code: 5

      Error at Node 2: Error code: 5

      Error at Node 1: Error code: 5

      [PCNAME]: Opening library "C:\Users\Desktop\testt_files\dp0\FFF\Fluent\libudf"...

      Error at Node 0: Error code: 5

       

       

       

       

    • Rob
      Forum Moderator

      Can you open a Fluent session & try to compile the code. Don't load a case file. It also looks like you're running in Workbench, try Fluent in standalone mode. 

    • Fakhreddine Madi
      Subscriber

      I have now tried launching the fluent 2023R1 (as admin with no case file loaded) and still getting the same error message.

      it compiles the code fine, the issue is when I press load I still get this error.

      what is error code 5 linked too?


      [PC-NAME]: Opening library "C:\Users\username\Desktop\libudf"...
      Error at Node 5: Error code: 5


      Error at Node 1: Error code: 5


      Error at Node 4: Error code: 5


      Error at Node 2: Error code: 5


      Error at Node 3: Error code: 5


      [PC-NAME]: Opening library "C:\Users\username\Desktop\libudf"...
      Error at Node 0: Error code: 5

       

    • Rob
      Forum Moderator

      Can you try putting the files in C:/something and avoid the Windows folders? Shouldn't be a problem but I've seen OS problems where certain things are locked down by IT.  Also, does "username" mean username or your ID? If the latter are there any nonEnglish characters in it? 

       

    • Fakhreddine Madi
      Subscriber

      I have created a folder in C drive and tried it, still same issue. "username" is my ID (personal name with "-" inbetween)

       

      Have copied all the log from the console here if it helps (i only have removed my pc name and Connected License Server List for security purpose):


      Opening input/output transcript to file "C:\Test\fluent-20240716-160452-15116.trn".
      Auto-Transcript Start Time:  16:04:52, 16 Jul 2024 GMT Summer Time 

                    Welcome to ANSYS Fluent 2023 R1

                    Copyright 1987-2023 ANSYS, Inc. All Rights Reserved.
                    Unauthorized use, distribution or duplication is prohibited.
                    This product is subject to U.S. laws governing export and re-export.
                    For full Legal Notice, see documentation.

      Build Time: Nov 28 2022 09:52:41 EST  Build Id: 10208  
       
      Connected License Server List:    ****ansys-licence**** 

           --------------------------------------------------------------
           This is an academic version of ANSYS FLUENT. Usage of this product
           license is limited to the terms and conditions specified in your ANSYS
           license form, additional terms section.
           --------------------------------------------------------------
      Host spawning Node 0 on machine "PC-NAME" (win64).

      -----------------------------------------------------------------------------------
      ID    Hostname        Core  O.S.         PID    Vendor                            
      -----------------------------------------------------------------------------------
      n5    ****  6/32  Windows-x64  6496   Intel(R) Xeon(R) Silver 4215R     
      n4    ****  5/32  Windows-x64  20344  Intel(R) Xeon(R) Silver 4215R     
      n3    **** 4/32  Windows-x64  17440  Intel(R) Xeon(R) Silver 4215R     
      n2    ****  3/32  Windows-x64  856    Intel(R) Xeon(R) Silver 4215R     
      n1    ****  2/32  Windows-x64  13768  Intel(R) Xeon(R) Silver 4215R     
      n0*   ****  1/32  Windows-x64  25480  Intel(R) Xeon(R) Silver 4215R     
      host  ****        Windows-x64  16916  Intel(R) Xeon(R) Silver 4215R     

      MPI Option Selected: intel
      Selected system interconnect: default
      -----------------------------------------------------------------------------------

      Cleanup script file is C:\Test\cleanup-fluent-****-16916.bat

      > Copy "2D_WANG_sent.c" to "C:\Test\libudf\src"

      Copyright 1987-2023 ANSYS, Inc. All Rights Reserved.
      Compiler and linker: Clang (builtin)
      Compiler path: "C:\PROGRA~1\ANSYSI~1\v231\fluent"\ntbin\clang\bin\clang-cl
      Linker   path: "C:\PROGRA~1\ANSYSI~1\v231\fluent"\ntbin\clang\bin\lld-link
      C sources: ['2D_WANG_sent.c']

      Copyright 1987-2023 ANSYS, Inc. All Rights Reserved.
      Compiler and linker: Clang (builtin)
      Compiler path: "C:\PROGRA~1\ANSYSI~1\v231\fluent"\ntbin\clang\bin\clang-cl
      Linker   path: "C:\PROGRA~1\ANSYSI~1\v231\fluent"\ntbin\clang\bin\lld-link
      C sources: ['2D_WANG_sent.c']

      Done.

      PC-NAME: Opening library "C:\Test\libudf"...
      Error at Node 1: Error code: 5


      Error at Node 5: Error code: 5


      Error at Node 3: Error code: 5


      Error at Node 4: Error code: 5


      PC-NAME: Opening library "C:\Test\libudf"...
      Error at Node 0: Error code: 5


      Error at Node 2: Error code: 5

       

    • Rob
      Forum Moderator

      And the computer name has no odd characters?

    • Fakhreddine Madi
      Subscriber

      No just "-" inbetween departement name and pc name. I have also now tried uninstalling Ansys, and re-installing it and still getting this error.

    • Rob
      Forum Moderator

       

      Can you post the code? I’m assuming it’s 2d and you launched the solver in 2d? Note, I won't be debugging in any detail but may spot something. 

       

    • Fakhreddine Madi
      Subscriber

      Yes its a 2D case and I am lunching fluent in 2d. I have tried two code I know used to work (3 weeks ago) here is one of them taken from GitHub: 

       

      #include "udf.h"

      #define T_max   4                           /*Flow time in s when the morphing stops*/
      #define W_te    0.001*0.2286         /*Maximum flap deflection*/
      #define x_s     0.75*0.2286         /*location where the morphing starts*/
      #define Thick   0.12                /*Airfoil thickness 12/100 in NACA 0012*/
      #define freq    100                 /*Morphing frequency*/
      #define FTT     0.004                /*Time in s when the moprhing starts*/
      #define chord   0.2286              /*Airfoil chord*/

      DEFINE_GRID_MOTION(morphing_upper, domain, dt, time, dtime)
      {
        Thread *tf = DT_THREAD(dt);
        face_t f;
        Node *node_p;
        real x, y, thickness, camber, theta, yupper, dy_c, slope, xupper;
        int n;

        /* Set/activate the deforming flag on adjacent cell zone, which */
        /* means that the cells adjacent to the deforming wall will also be */
        /* deformed, in order to avoid skewness. */
        SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

        /* Loop over the deforming boundary zone's faces; */
        /* inner loop loops over all nodes of a given face; */
        /* Thus, since one node can belong to several faces, one must guard */
        /* against operating on a given node more than once: */

        begin_f_loop(f, tf)
        {
          f_node_loop(f, tf, n)
          {
            node_p = F_NODE(f, tf, n);

            /* Update the current node only if it has not been */
            /* previously visited: */
            if (NODE_POS_NEED_UPDATE(node_p))
            {
              /* Set flag to indicate that the current node's */
              /* position has been updated, so that it will not be */
              /* updated during a future pass through the loop: */
              NODE_POS_UPDATED(node_p);

              x = NODE_X(node_p);
              thickness = (chord * Thick / 0.2) * (0.2969 * sqrt(x / chord) - 0.1260 * x / chord - 0.3516 * pow((x / chord), 2) + 0.2843 * pow((x / chord), 3) - 0.1036 * pow((x / chord), 4));

              if (CURRENT_TIME > FTT)
              {
                if (x >= x_s)
                {
                  camber = -(W_te * sin(2 * M_PI * (CURRENT_TIME - FTT) * freq) * pow((x - x_s), 3)) / (pow((chord - x_s), 3));
                  dy_c = (-3 * W_te * sin(2 * M_PI * (CURRENT_TIME - FTT) * freq) * pow((x - x_s), 2)) / (pow((chord - x_s), 3));
                  theta = atan((-3 * W_te * sin(2 * M_PI * (CURRENT_TIME - FTT) * freq)) * pow((x - x_s), 2) / (pow((chord - x_s), 3)));
                  xupper = x - thickness * sin(theta);
                  yupper = camber + thickness * cos(theta);
                  NODE_Y(node_p) = yupper;
                }
              }
            }
          }
        }
        end_f_loop(f, tf);
      }
      DEFINE_GRID_MOTION(morphing_lower, domain, dt, time, dtime)
      {
          Thread* tf = DT_THREAD(dt);
          face_t f;
          Node* node_p;
          real  x, y, thickness, camber, theta, lower, dy_c, xlower, slope;
          int n;

          /* Set/activate the deforming flag on adjacent cell zone, which      */
          /* means that the cells adjacent to the deforming wall will also be  */
          /* deformed, in order to avoid skewness.                             */
          SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

          /* Compute the angles:                                               */
          /* Loop over the deforming boundary zone's faces;                    */
          /* inner loop loops over all nodes of a given face;                  */
          /* Thus, since one node can belong to several faces, one must guard  */
          /* against operating on a given node more than once:                 */

          begin_f_loop(f, tf)
          {
              f_node_loop(f, tf, n)
              {
                  node_p = F_NODE(f, tf, n);

                  /* Update the current node only if it has not been         */
                  /* previously visited:                                     */
                  if (NODE_POS_NEED_UPDATE(node_p))
                  {
                      /* Set flag to indicate that the current node's        */
                      /* position has been updated, so that it will not be   */
                      /* updated during a future pass through the loop:      */
                      NODE_POS_UPDATED(node_p);

                      x = NODE_X(node_p);
                      thickness = (chord * Thick / 0.2) * (0.2969 * sqrt(x / chord) - 0.1260 * x / chord - 0.3516 * pow((x / chord), 2) + 0.2843 * pow((x / chord), 3) - 0.1036 * pow((x / chord), 4));

                      if (CURRENT_TIME > FTT) {
                          if (x >= x_s) {
                              camber = -(W_te * sin(2 * M_PI * ((CURRENT_TIME - FTT) * freq)) * pow((x - x_s), 3)) / (pow((chord - x_s), 3));
                              dy_c = (-3 * W_te * sin(2 * M_PI * (CURRENT_TIME - FTT) * freq)) * pow((x - x_s), 2) / (pow((chord - x_s), 3));
                              theta = atan((-3 * W_te * sin(2 * M_PI * (CURRENT_TIME - FTT) * freq)) * pow((x - x_s), 2) / (pow((chord - x_s), 3)));
                              slope = sin(theta);
                              xlower = x + thickness * slope;
                              lower = camber - thickness * cos(theta);
                              NODE_Y(node_p) = lower;
                          }
                      }
                  }
              }
          }
          end_f_loop(f, tf);
      }

    • Rob
      Forum Moderator

      Used to work and now doesn't? That's odd. Can you double check you're working with the same .c file, and are working with the one you think you are? Have you switched from Windows to Linux?

    • Fakhreddine Madi
      Subscriber

      yea i my thoughts as well. I have double checked its the same one i have used for my prevouse runs. No I haven't switched OS. I am trying to reinstall ansys 2023R1 again today and will try again. could it be an issue with the licences? my universty usualy goes through upgrading ansys verison over the summer period. The odd thing is that is compiles fine too, I have also tried another UDF that I have used before and also gave me the same error

    • Rob
      Forum Moderator

      So all UDFs are compiling but then failing to load? A licence issue would normally stop the solver from loading, so that's unlikely. Try renaming the %appdata% folder(s) for Fluent. 

    • Fakhreddine Madi
      Subscriber

      where would I find that folder?

      my fluent Root Path is: C:\PROGRA~1\ANSYSI~1\v231\fluent

      and Environment for UDF is: C:\PROGRA~1\ANSYSI~1\v231\fluent\ntbin\win64\udf.bat

       

       

    • Rob
      Forum Moderator

      C:\Users\user-id\AppData

    • Fakhreddine Madi
      Subscriber

      I just tried changing and renaming the AppData for fluent, but still no luck :(

    • Fakhreddine Madi
      Subscriber

      I have just tried my other pc that has 2022R1 and a old UDF that I have used many times and still getting this error: 


      [PC-NAME]: Opening library "C:\test\test_files\dp0\FLU\Fluent\libudf"...
      Error at host: Error code: 5


      ===============Message from the Cortex Process================================

      Compute processes interrupted. Processing can be resumed.

      ==============================================================================

      Error: Error code: 5\n
      Error Object: #f

    • Fakhreddine Madi
      Subscriber

      I just managed to solve the loading error. I had to open Fluent using "x64_x86 Cross Tool Command Prompt for VS 2022," and I compiled the code without using the built-in compilers. Then it seems to have loaded normally now. I will still need to check the code functions correctly. What do you think might have suddenly caused this?

    • George Karnos
      Ansys Employee

      Hello Fakhreddine,

      Has anything changed on this system from when it use to work, until now?
      Updates?
      Installed new software?
      If you open a DOS Command Prompt and type in the following, what is reurned?

      set PATH

    • Fakhreddine Madi
      Subscriber

      I am not sure if there was an update; my organisation is in control of my Windows updating. I did not install any new software when this happened, seems abit weird. I have checked fluent and the code seems to be working now when I lunch it through MS VS 2022 envorment and not use the build-in compiler.

      C:\>set PATH
      Path=C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc_mt\;C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\ia32\vc_mt\;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\ia32_win\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files\Tecplot\Tecplot Chorus 2022 R1\bin;C:\Program Files\Tecplot\Tecplot 360 EX 2022 R1\bin;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Common Files\Autodesk Shared\Advance\;C:\Program Files (x86)\Common Files\Autodesk Shared\Advance\;C:\Program Files\MATLAB\R2023b\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\f-madi-admin\AppData\Local\Microsoft\WindowsApps;C:\Users\f-madi-admin\.dotnet\tools
      PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW

Viewing 18 reply threads
  • The topic ‘UDF loading error’ is closed to new replies.