|
[Sponsors] |
August 15, 2007, 04:13 |
Not able to interpret UDF
|
#1 |
Guest
Posts: n/a
|
I am not able to Interpret the following UDF in Fluent6.2.16 on Unix. Error seems to be in FILE *fp. And it gives a message that line 14: syntax error (ie FILE *fp) and line 15: undeclared fp (ie fp = fopen...). Can some one let me know how I should modify this. Thanks in advance. (This UDF is intended to print out the data for the boundary at the end of run for steady state. In future I want to modify it to do the same for every time step for transient case)
#include "udf.h" DEFINE_EXECUTE_AT_END(acoustic) { face_t f; cell_t c0; Thread *t0; Domain *d; real u, v, w, psta, ke, epsi; real x[3]; Thread *t_boundary; d = Get_Domain(1); t_boundary = Lookup_Thread(d, 1); /* Change this number to the ZONE-ID of the BC for which data is needed*/ FILE *fp; fp = fopen("acoustic.out", "w"); fprintf(fp, "x y z u v w psta Turb-KE Epsilon \n"); begin_f_loop(f, t_boundary) { F_CENTROID(x, f, t_boundary); c0 = F_C0(f, t_boundary); t0 = THREAD_T0(t_boundary); u = C_U(c0, t0); v = C_V(c0, t0); w = C_W(c0, t0); psta = C_P(c0, t0); ke = C_K(c0, t0); epsi = C_D(c0, t0); fprintf(fp, "%8.3d %8.3d %8.3d %8.3d %8.3d %8.3d %8.3d %8.3d %8.3d\n", x[1], x[2], x[3], u, v, w, psta, ke, epsi); } end_f_loop(f, t_boundary) fclose(fp); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF interpret error with "C_CENTROID" | Jinfeng | Fluent UDF and Scheme Programming | 6 | November 6, 2020 15:38 |
interpret several UDF | eddiegolpesar | FLUENT | 0 | November 1, 2010 08:23 |
interpret or compile an UDF (emergency) | Lotfi | FLUENT | 1 | August 26, 2007 12:58 |
Interpret three UDF for property | Atsu | FLUENT | 4 | April 22, 2006 15:04 |
UDF Interpret - Syntax Error | Leonard | FLUENT | 1 | October 22, 2005 10:06 |