UDF to extract the velocity
Hello Guys,
I need to define a plane in the middle of the geometry (3D) and then extract the velocity of each node in that plane.The Id of that plane is 6, so I wrote the following UDF abut it is not working. Which part do you think is not correct? #include "udf.h" #include "mem.h" #define thread_ID 6 DEFINE_ON_DEMAND(INIT) { Domain *domain; Thread *t; cell_t c; FILE *Fileoutput; int n,Iter; domain = Get_Domain(1); t = Lookup_Thread(domain, thread_ID); Fileoutput=fopen("VEL.txt","a+"); begin_c_loop(c, t) { fprintf(Fileoutput,"\n %f %f %f", C_U(c,t), C_V(c,t), C_W(c,t)); } end_c_loop(c, t) fclose(Fileoutput); } |
Are you receiving any compiler errors, is the text file being opened and is any text being written to this file?
Try printing the velocities to the screen (using the Message() function inside your cell loop) to help debug your problem. |
Quote:
Do you have problems with compiling? Interpreting? Loading? Running? Getting results? Showing results? |
All times are GMT -4. The time now is 01:41. |