Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

UDFs output

    • ehkh
      Subscriber

      Hi,


      I would like to know if there is a method to check the output of my UDFs before compiling and loading it into in Fluent. which editor or compiler should I use?


      I have tried to compile my UDFs in Visual Studio but it was unable to define some variables such as 'real', the reason is that Fluent uses a C programming based Language, but not exactly c language, The way to define functions and variables is different.


      I appreciate if you advice me how can I check the output of my UDF so I can modify it based on the results that I am looking at.


       


      Thanks,


      Esra'a

    • Rob
      Ansys Employee

      Compilers are covered in the Installation section, and we're using VS 2017 at the moment. You can edit in there or (as I do) use Notepad++ as it's easy to see what's commented, nested etc. 


      Not sure why you can't define something as real, it's a standard C command? 

    • ehkh
      Subscriber

      Hi,


       


      Thanks for your reply.


      I can edit mu UDF in VS2017 or Notepad, but unable to see its output on VS.


      I followed up the following procedure described in the following link to compile it, but its not successful !!


      https://www.quora.com/How-do-I-do-Pure-C-programming-with-Visual-Studio-2017-I-want-to-relearn-C/answer/Sergey-Zubkov-1


      Could you please advice me if there are different method tho check the output of UDF.


      Thanks

    • DrAmine
      Ansys Employee
      What do you mean with output? If Fluent dependent the UDF should be executed at least once in Fluent.
    • ehkh
      Subscriber

      I am using a UDF to apply random heat flux at the bottom boundary in a natural convection problem, the results should look like rolls or plumes emitted from the bottom layer as in figure 6 in this paper attached here:


      https://www.sciencedirect.com/science/article/pii/S0017931015003269


      BUT I didn't get any change in temp, that could mean, my UDF is either returning a value of zero or constant heat flux.


      What I need to know is how to check the values of heat flux that my UDF return before compiling and running it into fluent.


       


      Thanks

    • ehkh
      Subscriber

      Hi,


      I found out how to do check the values returned by my UDF. I am posting here for other student who are facing the same issue.


      I did that by post-processing the results after one iteration and using a xy plot of bottom boundary coordinated vs. heat flux! This shows me the values returned by my UDF is correct.


       

    • DrAmine
      Ansys Employee
      Nice. Always store in an UDM for visualization too.
Viewing 6 reply threads
  • You must be logged in to reply to this topic.