|
[Sponsors] |
February 8, 2004, 02:20 |
how to run this UDF ?
|
#1 |
Guest
Posts: n/a
|
This UDF file is from help file,it is used to get the cell's centroids coordinates on the specified boundary face.and it passed the compilation. But the the result file "faces.out" was not generated after the computatoin completed. what's the problem? how to run this UDF correctly and get the result file?
# include "udf.h" FILE *fout; Print_Thread_Face_Centroids(Domain *domain, int id) { real x[ND_ND]; face_t f; Thread *t=Lookup_Thread(domain, id); fprintf(fout,"thread id%d\n",id); begin_f_loop(f,t) { F_CENTROID(x,f,t); fprintf(fout,"f%d %g %g\n",f,x[0],x[1]); } end_f_loop(f,t) fprintf(fout,"\n"); } DEFINE_ON_DEMAND(get_coords) { Domain *domain; domain = Get_Domain(1); fout = fopen("H:\Getpressure\faces.out","w"); Print_Thread_Face_Centroids(domain,5); Print_Thread_Face_Centroids(domain,3); fclose(fout); } |
|
February 8, 2004, 02:27 |
Re: how to run this UDF ?
|
#2 |
Guest
Posts: n/a
|
# include "udf.h"
FILE *fout; Print_Thread_Face_Centroids(Domain *domain, int id) { real x[ND_ND]; face_t f; Thread *t=Lookup_Thread(domain, id); fprintf(fout,"thread id%d\n",id); begin_f_loop(f,t) { F_CENTROID(x,f,t); fprintf(fout,"f%d %g %g\n",f,x[0],x[1]); } end_f_loop(f,t) fprintf(fout,"\n"); } DEFINE_ON_DEMAND(get_coords) { Domain *domain; domain = Get_Domain(1); fout = fopen("H:\Getpressure\faces.out","w+"); Print_Thread_Face_Centroids(domain,5); Print_Thread_Face_Centroids(domain,3); fclose(fout); } |
|
February 8, 2004, 03:09 |
Re: how to run this UDF ?
|
#3 |
Guest
Posts: n/a
|
sorry,it should change this sentence, fout = fopen("H:\Getpressure\faces.out","w+"); into: fout = fopen("faces.out","w+");
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
multi-core processor about parallelizing udf | dasah | Fluent UDF and Scheme Programming | 0 | June 23, 2011 10:50 |
Help Parallelizing UDF | AndresC | FLUENT | 0 | February 25, 2010 15:50 |
UDF hook problem in command line mode. | Benlong | FLUENT | 1 | November 12, 2007 14:45 |
I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 11:29 |
Please help me run UDF code for source | Suga | FLUENT | 1 | February 3, 2006 03:40 |