CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF debugging (

david August 10, 2005 12:47

UDF debugging
Hi all, attached below is the UDF I use to prescribe a 2d inlet velocity as a function of time. Although it compiles fine, I would like to see printed the value of the variable t (see below) using the printf function. I've place such command at 2 place in the code without getting the output on my screen. Am I doing something wrong? I used to be able to do it with version 6.1 but since I changed for v.6.2 am having difficulty. Any clues would be helpful.

Best Regards


DEFINE_PROFILE(un_vel2, thread, position)

{ real x[ND_ND];

float t, velocity,w,y,z;

face_t f;

t = RP_Get_Real("flow-time");

w=floor (t);


printf ("Time is: %6.2f\n",t);

if (z<0.4)

velocity = 1-(cos(5*z*3.14159));



begin_f_loop(f, thread) {

printf ("Time is: %6.2f \n",z);


y = x[1];

F_PROFILE(f, thread, position) = velocity - y*y/(.0065*.0065)*velocity;

} end_f_loop(f, thread)


david August 11, 2005 12:43

Re: UDF debugging
Hi, FYI: 'printf' function does not work for compiled UDF in Version 6.2. Replace 'printf' by 'Message' for compiled UDF.

All times are GMT -4. The time now is 18:00.