|
re
这样做应该可以,你可以改一下试一试:
#include "udf.h"
DEFINE_ADJUST(collect,domain)
{
Thread *t;
cell_t c;
real x[ND_ND];
/*---------------------------*/
int sign=0;
FILE *out;
/*---------------------------*/
out=fopen("C:\\fluent\\01.txt","a+");
/*---------------------------*/
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
fprintf(out,"%f,%f,%f,%f\n",(float)x[0],(float)x[1],(float)x[0],(float)C_P(c,t));
}
end_c_loop(c,t)
}
/*---------------------------*/
sign++;
printf("b=%d\n",sign);
fprintf(out,"b=%d\n",sign);
fclose(out);
} |
|