CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Time-consuming UDF "ADJUST"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2001, 11:26
Default Time-consuming UDF "ADJUST"
  #1
Dmitriy Makarov
Guest
 
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,

Dmitriy
  Reply With Quote

Old   January 11, 2001, 17:00
Default Re: Time-consuming UDF "ADJUST"
  #2
Greg Perkins
Guest
 
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, 04:11
Default Re: Time-consuming UDF "ADJUST"
  #3
Dmitriy Makarov
Guest
 
Posts: n/a
Greg,

Thank you! You give me a hope again.

Dmitriy
  Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 06:55
Accessing wall clock time from Scheme or UDF Angelo Sozzi FLUENT 2 February 23, 2018 05:03
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 09:28.