Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

how to write a UDF in ansys Fluent

    • swathi
      Subscriber

      I wanted to increase the rotation of my cylinder as a function of time. how can I write a UDF for the same. 

    • Rob
      Forum Moderator

      If it's a boundary setting (moving wall) or cell zone (rotating fluid) then use a DEFINE_PROFILE.  There are a few examples on here, and quite a good on in the manual. 

    • swathi
      Subscriber

      Thank you, Sir.


      I wrote one UDF as you said but I failed to hook it for rotation velocity(cell zone condition). some kind of error is popping up like." cortex received a fatal signal (unrecognized signal)". I am attaching the UDF that I have used. Please suggest me if there is any error in this code.


       

    • Rob
      Forum Moderator

      You've set vo & rampr as REAL and given them an integer value - this can cause problems. Otherwise you'll need to check the model works without the UDF and then work from there. 

    • swathi
      Subscriber

      when I am running a steady simulation by hooking the same above mentioned code by not considering rampr*flow_time term in the expression, i am getting the solution. but when coming to the unsteady simulation. the code is not working properly. some kind of cortex error is coming.

    • swathi
      Subscriber

      I think there is some problem with getting flow time or in the expression written. Can you please give me some suggestions. 

    • Rob
      Forum Moderator

      Try changing the flow_time  variable to t    That's what I use in my UDFs: shouldn't make a difference but there are some characters that don't work well with the compilers. 

    • swathi
      Subscriber

      Thank you, sir. But still, it's not working and I am not compiling UDF rather I am interpreting it. will that make a difference?

    • Rob
      Forum Moderator

      Shouldn't do for a DEFINE_PROFILE macro. 


      Remember that flow time is measured in seconds: depending on your timestep the rotation speed could get very high very quickly. 

Viewing 8 reply threads
  • The topic ‘how to write a UDF in ansys Fluent’ is closed to new replies.