|
[Sponsors] |
January 11, 2001, 11:26 |
Time-consuming UDF "ADJUST"
|
#1 |
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 |
|
January 11, 2001, 17:00 |
Re: Time-consuming UDF "ADJUST"
|
#2 |
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 |
|
January 12, 2001, 04:11 |
Re: Time-consuming UDF "ADJUST"
|
#3 |
Guest
Posts: n/a
|
Greg,
Thank you! You give me a hope again. Dmitriy |
|
|
|
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 |