Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

How to script DEFINE_ADJUST UDF to execute for every nth fluent iteration?

    • yk2359
      Subscriber

      Hello,


      Example FSI case:



      • Flow time (End time) 1 sec

      • Time step size 0.1 sec

      • System coupling iterations 10

      • Fluent iterations 5


      I am looking extract variables at the end of every 1 system coupling iteration (at the end of every 5 fluent iterations) using DEFINE_ADJUST UDF. Now I understand that adjust macro runs for every 1 fluent iteration, but is there any way to execute it only at every 5th? Or any other way? Please suggest.


       


      Thank you,


      YK

    • Amine Ben Hadj Ali
      Ansys Employee

      Yes you can think about executing the content of the DEFINE_ADJUST whenever N_ITER%5 ==0 

    • yk2359
      Subscriber

      Thanks for the response. As N_ITER is a solver macro I believe I need not define it again.


      But while writing a parallel UDF, does if N_ITER%5 ==0{code} condition come under RP_NODE? !RP_HOST?

    • Amine Ben Hadj Ali
      Ansys Employee

      I guess it will be available everywhere and passed to the node (so I generally put everything on nodes as host does not contain any mesh data) so make your UDF parallel as you have learned to do.

    • seeta gunti
      Ansys Employee

      You can hook the UDF for every 5 iterations and unhook the UDF after 1 iteration through calculation activities using TUI commands.



      Not sure if it works or not. Just an idea!


      Regards,


      Seeta

Viewing 4 reply threads
  • The topic ‘How to script DEFINE_ADJUST UDF to execute for every nth fluent iteration?’ is closed to new replies.
[bingo_chatbox]