udf problem.. output data comes out to "zero"
Hi Guys~
I am trying to output to a point w-velocity. but, All values are output "0". ---------------------------------------------------------------------- #include "udf.h" #define ID1 5 /*ID of the point*/ DEFINE_EXECUTE_AT_END(monkeymagic) { FILE *fp; Domain *d; real x[ND_ND]; Thread *t; cell_t c; real w=0, time=0; fp = fopen("velocity.txt","w"); d = Get_Domain(4); t = Lookup_Thread (d, ID1); begin_c_loop(c, t) { C_CENTROID(x,c,t); w= (C_W(c,t)); } end_c_loop(c, t) time=CURRENT_TIME; fprintf (fp, "%f\n",time); fprintf (fp, "%f\n",w); fclose(fp); } ---------------------------------------------------------------------- If I fix this problem, Base on this udf source, I will generate 200 points and output velocity.(x, y, z velocity) Plz anyone help me What`s the problem of the source code? |
Is this a multiphase problem? Why use "4" in the "Get_Domain"? Usually it should be d = Get_Domain(1) for a single-phase case.
d = Get_Domain(4); Quote:
|
Hi, gearboy
Thanks for your answer! Changed the get domain value 4-> 1 But same results comes out. What is the problem? |
If I guess correctly, after
t = Lookup_Thread (d, ID1); t is NULL The following thread should help you with your task. http://www.cfd-online.com/Forums/flu...r-xy-plot.html |
All times are GMT -4. The time now is 18:44. |