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

why results different for Compile and Interpret?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 5, 2004, 00:38
Default why results different for Compile and Interpret?
  #1
Joey
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);

} }
  Reply With Quote

Old   April 5, 2004, 14:12
Default Re: why results different for Compile and Interpre
  #2
ap
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
  Reply With Quote

Old   April 5, 2004, 21:26
Default Re: why results different for Compile and Interpre
  #3
Joey
Guest
 
Posts: n/a
Thanks very much. Now I get it.
  Reply With Quote

Old   April 6, 2004, 17:19
Default Re: why results different for Compile and Interpre
  #4
ap
Guest
 
Posts: n/a
You're welcome

ap
  Reply With Quote

Reply

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
interpret or compile wlt_1985 FLUENT 0 April 19, 2011 17:08
A basic doubt on reading the iteration results hariya03 OpenFOAM Post-Processing 0 July 16, 2008 08: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 08:44
Interpretation of Results Danial Main CFD Forum 3 October 19, 2001 13:38


All times are GMT -4. The time now is 01:46.