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

  • 367 Views
  • Last Post 21 November 2018
yk2359 posted this 20 November 2018

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

Order By: Standard | Newest | Votes
abenhadj posted this 20 November 2018

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

Best regards,

Amine

yk2359 posted this 20 November 2018

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?

abenhadj posted this 20 November 2018

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.

Best regards,

Amine

seeta gunti posted this 21 November 2018

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

Close