CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

how to run this UDF ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 8, 2004, 02:20
Default how to run this UDF ?
  #1
David
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); }

  Reply With Quote

Old   February 8, 2004, 02:27
Default Re: how to run this UDF ?
  #2
David
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);

}
  Reply With Quote

Old   February 8, 2004, 03:09
Default Re: how to run this UDF ?
  #3
David
Guest
 
Posts: n/a
sorry,it should change this sentence, fout = fopen("H:\Getpressure\faces.out","w+"); into: fout = fopen("faces.out","w+");
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 10:37.