Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Compile and load a UDF when running Fluent via a journal file

    • nselvara
      Ansys Employee

      How can I compile and load a UDF when running Fluent via a journal file?

    • Arun
      Ansys Employee

      There are two commands needed. The first to compile the UDF: /define/user-defined/compiled-functions compile libudf yes sourcename.c "" And the second to load the library that was compiled in the previous step: /define/user-defined/compiled-funcitons load libudf Note that 'sourcename.c' is the name of your UDF file and the "" are two quotation marks in sequence (needed to terminate the string array input to Fluent).

    • yfeng4
      Subscriber

      If I want to compile multiple c codes, can I write /define/user-defined/compiled-functions compile libudf yes sourcename1.c  sourcename2.c sourcename3.c"" ? Or what should be the correct format? 

      Thank you. 

    • TONY ARHUR
      Subscriber

      i am getting this error "

      rotating_screws.c(2,10): fatal error: 'motion.h' file not found

      #include "motion.h"

      ^~~~~~~~~~

      1 warning and 1 error generated.

      scons: *** [rotating_screws.obj] Error 1

      please i need help

    • Gentle Prose Techie
      Subscriber

       

      Maybe you can check this video out:

      It shows the process of recording the compilation and loading steps in a journal and running the journal. If you just want the code, you can see it at 55 seconds into the video. Hope this helps!

       

Viewing 4 reply threads
  • The topic ‘Compile and load a UDF when running Fluent via a journal file’ is closed to new replies.