CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Time-consuming UDF "ADJUST"

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   January 11, 2001, 12:26
Default Time-consuming UDF "ADJUST"
Dmitriy Makarov
Posts: n/a
Hi all,

My UDF (DEFINE_ADJUST) is very time consuming. If someone has this experience: (1) is it possible to execute DEFINE_ADJUST once per several iterations? (2) or if it is possible to re-define UDS's inside of body of any other UDF (like POFILE UDF, which can be executed once per several iterations)? I found that initialization of DOMAIN variable (if it is not passed to UDF from FLUENT) leads to fatal error in my case.

Thanks in advance,

  Reply With Quote

Old   January 11, 2001, 18:00
Default Re: Time-consuming UDF "ADJUST"
Greg Perkins
Posts: n/a
See my post 6th March 2000 repeated here:

current_iter gets the current iteration number from Fluent which you can use to decide whether to compute or not.

int current_iter = (nres == 0) ? (0) : ((int) count2[nres - 1]);

This works fine. For your transient case you'll probably need to check something else with the timestep, flowtime etc.

To check whether you're UDF is called again at the same iteration or at a new iteration use a static variable. Here is some code I'm using to do something every 25 iterations (current_iter as defined above):-

static int disp = FALSE;

if ((current_iter % 25) == 0)


if (disp == FALSE)


/* --- do what ever you like */

disp = TRUE;



else disp = FALSE;

You can change the number 25 to whatever you like...

Hope it helps!

Regards Greg
  Reply With Quote

Old   January 12, 2001, 05:11
Default Re: Time-consuming UDF "ADJUST"
Dmitriy Makarov
Posts: n/a

Thank you! You give me a hope again.

  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 30 September 19, 2017 12:38
Accessing wall clock time from Scheme or UDF Angelo Sozzi FLUENT 1 February 26, 2017 18:31
directMapped problem panda60 OpenFOAM Bugs 4 July 8, 2010 10:23
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29

All times are GMT -4. The time now is 04:05.