Fluids

Fluids

Problem in compiling UDF in parallel mode

    • Osman
      Subscriber

       I am trying to compile a simple UDF to calculate the specific heat of PCM material however, when I am trying to compile the UDF I got this error :"The UDF library that you are trying to load (libudf) is not compiled for parallel use on the current platform (win 64).


      the system cannot find the file specified. "


      I am using Fluent 16.1 on a parallel network of 2 compute nodes 


      this is the UDF That I am trying to compile 


      #include "udf.h" 


      DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi) 



      #if !RP_HOST


      real cp = 1800.; 


      if (T <= 341.)


        cp = 1700.*exp(0.0606*(T-Tref));


      else if (T >= 345.)


        {


         cp = 4200.;


        }


      *h = cp*(T-Tref); 


      return cp; 


      }


      #endif 


      }

    • Osman
      Subscriber

      Can anyone help me to solve this problem  ? 

    • Rob
      Ansys Employee

      The error means the code is not compiled. This could mean you don't have a compiler or that there is an error in the code.  If you compile the code (Build in the UDF panel) what do you see in Fluent's text window?


      As an aside, R16 is 4-5 years old. Please update to 2019R2. 

    • Osman
      Subscriber

      I have Microsoft visual studio 2019 on my computer and I used Fluent 18 and tried to compile The following UDF and got this error  


      #include "udf.h" 


      DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi) 



      real cp = 1800.; 


      if (T <= 341.)


        cp = (0.333*(T-Tref));


      else if (T >= 345.)


        {


         cp = 4200.;


        }


      *h = 189000.; 


      return cp; 


      }


       


    • Rob
      Ansys Employee

      That means you don't have a compiled library. What happens when you try and compile the code in Fluent? Read the messages in the TUI: specifically look for "error" and "nmake". 


      As an aside, we're using MS 2017 at the moment, and it may not be compatible with R18 as that may need MS 2015 compiler. 

Viewing 4 reply threads
  • You must be logged in to reply to this topic.