|
[Sponsors] |
why results different for Compile and Interpret? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 5, 2004, 01:38 |
why results different for Compile and Interpret?
|
#1 |
Guest
Posts: n/a
|
Now, I'm trying to learn how to compose UDF file. I encounter this strange problem. Please help me to solve it. I use the UDF file from the HELP file, and I just add two lines to print out the Re and Cd in the console window. If I interpret this UDF, everything is OK, a lot of Re and Cd numbers are shown in the console window. But when I compile this UDF, UDF can be used and particle can be tracked, but numbers for Re and Cd don't print now. Why this happen? and how to solve this problem? Please help me, thanks a lot!! The UDF is shown below:
/************************************************** ********************* UDF for computing particle drag coefficient (18 Cd Re/24) curve as suggested by R. Clift, J. R. Grace and M.E. Weber "Bubbles, Drops, and Particles" (1978) ************************************************** **********************/ #include "udf.h" DEFINE_DPM_DRAG(particle_drag_force, Re, p) { real w, drag_force; printf ("Re is %6.3f\n", Re); if (Re < 0.01) { drag_force=18.0; printf("Cd is %6.3f\n", drag_force); return (drag_force); } else if (Re < 20.0) { w = log10(Re); drag_force = 18.0 + 2.367*pow(Re,0.82-0.05*w) ; printf("Cd is %6.3f\n", drag_force); return (drag_force); } else /* Note: suggested valid range 20 < Re < 260 */ { drag_force = 18.0 + 3.483*pow(Re,0.6305) ; printf("Cd is %6.3f\n", drag_force); return (drag_force); } } |
|
April 5, 2004, 15:12 |
Re: why results different for Compile and Interpre
|
#2 |
Guest
Posts: n/a
|
Try to use Message instad of printf. See the UDF manual under Additional macros.
Also, when you print a "real" data, use "%g" instead of "%f". Hi ap |
|
April 5, 2004, 22:26 |
Re: why results different for Compile and Interpre
|
#3 |
Guest
Posts: n/a
|
Thanks very much. Now I get it.
|
|
April 6, 2004, 18:19 |
Re: why results different for Compile and Interpre
|
#4 |
Guest
Posts: n/a
|
You're welcome
ap |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interpret or compile | wlt_1985 | FLUENT | 0 | April 19, 2011 18:08 |
A basic doubt on reading the iteration results | hariya03 | OpenFOAM Post-Processing | 0 | July 16, 2008 09:28 |
interpret works fine but compile doesn't | Jan Balemans | FLUENT | 0 | March 14, 2008 10:41 |
Not able to interpret UDF | Prasad | FLUENT | 1 | August 15, 2007 09:44 |
Interpretation of Results | Danial | Main CFD Forum | 3 | October 19, 2001 14:38 |