CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   No data is written into UDM (

ivanbuz August 13, 2009 18:37

No data is written into UDM
I am doing unsteady flow around a 3D airfoil, and use the following UDF to obtain time-averaged pressure coefficient on the airfoil surface. the coefficient is stored in user defined memory (UDM) 1.

the UDF is successful interpreted into fluent.

after several time steps, I plot--xy plot the UDM 1, and they are all zero. it seems that no data is written into the UDM. Anyone point out where I do wrong? Thanks a lot!

/************************************************** **************************/
/* UDF to compute time-averaged pressure coefficient */
/************************************************** **************************/
/* be sure to allocate at least two UDM*/

#include "udf.h"

int n=0; /* number of time-step */
int zone_ID=5; /* zone ID of airfoil surface */


Domain *domain = Get_Domain(1);
Thread *t = Lookup_Thread(domain, zone_ID);
real p_ref=0, den_ref=1.225, u_ref=21.911; /* reference pressue, reference density and reference velocity */
real q_ref=1/2*den_ref*u_ref*u_ref; /* reference dynamic pressure */
face_t f;


begin_f_loop(f, t)
F_UDMI(f,t,0) += F_P(f,t);
F_UDMI(f,t,1) = (F_UDMI(f,t,0)/n - p_ref)/q_ref;
end_f_loop(f, t)

ivanbuz August 13, 2009 18:49

I just found out that I forgot to hook the UDF. I did it and make sure I have allocated two UDM, and I resumed the computation and I got this error right after a time was completed.

Error: Chip: internal error: invalid builtin -1: pc=46
Error Object: #f

What does it mean? This is my first UDF, oh.. I am so frustrated ....

All times are GMT -4. The time now is 03:45.