We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Writing UDF

    • Inims
      Subscriber

      I want to write UDF and apply in my simulation. Do I use Notepad or any C Language programme. I already have Codeblocks. However, when I try to compile the UDF, I get the message ''udf.h is not in library and hence the programme will not compile. Please what do I do?

    • Max4
      Subscriber

      Hi,


      What version of ANSYS are you using ?


      In this discussion, there is a screenshot of the compiler compatibility provided in the Ansys Installation Manual for different Ansys release and how to install Visual Studio : /forum/forums/topic/ansys-19-0-visual-studio-intel-parallel-studio-xe-version-required-for-upfs/. I followed this method and it had worked for me.


      For writing your UDF, you can either use Visual Studio directly or write it in the Editor of Windows (txt file-format) and change the format with .c instead of .txt. Then you can compile or interpret the UDF in Fluent.


      Regards,


      Maxime

    • Amine Ben Hadj Ali
      Ansys Employee
      You find your answer. You need a C compiler. Codeblock is not supported.
    • Inims
      Subscriber

      Hi Max4,


      Thanks for your response.


      I use Ansys version 18.1 and 17.0 on another Linux machine.


      From your explanation, does it mean I do not require to install Visual Studio if I decide to use Editor of Window.


      Can I use Notepad and write the UDF then save in .C

    • Max4
      Subscriber

      Hi,


      You must install Visual Studio because it has a C-Compiler that is necessary to compile or interpret UDFs. For the installation, please follow the method described in the link I sent you in order to select the right packages when installing Visual Studio. 


      You can either use the Editor of Windows or Notepad if you can save it in .c. Moreoever, you can write the UDF with Visual Studio too.


       


      Please mark it as solution if your problem is solved.


       


      Regards,


      Maxime


       

Viewing 4 reply threads
  • The topic ‘Writing UDF’ is closed to new replies.