Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Laterally Varying Energy Prandtl Number UDF Tool

    • nick1998
      Subscriber

      Hi, 


      I am trying to create a UDF tool to change the Energy Prandtl number laterally for k-e Realizable turbulence model. The number needs to follow a 2nd order polynomial equation (only between a certain Z coordinate/ constant(d)) which I created:


      Pr_t=Energy Prandtl Number


      z= z coordinate [0 -102] mm


      d=constant (190mm)


      Pr_t(Z/d) = -5(z/d)^2-e-10(z/d)+0.85  for Z/d between  -0.3<=(z/d)<=0


      I want to create the Pr_t to be valid for  2 statements: 


      If  -0.3<=(z/d)<=0 then Pr_t(Z/d) = -5(Z/d)^2-e-10(z/d)+0.85; 


      Else  Pr_t= 0.4 



      I tried to write a UDF tool for it using notepad++


       UDF screenshot


      I get a parse error in line 5 and undeclared variable in line 7. 


      I just started using UDF and I am not really sure how to write them. I have used the Ansys Fluent manual which gives a few examples and they work fine but I couldn't find anything specific to my problem. 


      Thank you for your help. 


      Nick 

    • DrAmine
      Ansys Employee
      Ha0ve a look into the documentation and online C courses.

      We do not debug routines. Your line 7 is bad better to introduce d then build whatever you want with z and. Z to be retrieved from Fluent check define profile as example.
Viewing 1 reply thread
  • The topic ‘Laterally Varying Energy Prandtl Number UDF Tool’ is closed to new replies.