Fluent & matlab
Hi all' i would like to export some data of my simulation to matlab, i've choosen the ascii format is that correct? Thanks in advance.
|
Hi,
that's the right choice but in that way you have no control on the format. You could consider the following UDF: /************************************************** ******************** UDF for output ************************************************** ********************/ #include "udf.h" DEFINE_ON_DEMAND(output) { Domain *d; real x[ND_ND]; real x0, y0, z0, u, v, w; real p; FILE *fp; Thread *t; cell_t c; d = Get_Domain(1); fp = fopen("data.txt","w"); thread_loop_c(t,d) { begin_c_loop(c,t) { C_CENTROID(x,c,t); ND_SET(x0, y0, z0, x[0], x[1], x[2]); ND_SET(u, v, w, C_U(c, t), C_V(c, t), C_W(c, t)); p = C_P(c,t); fprintf(fp, "%14.12f %14.12f %14.12f ", x0, y0, z0); fprintf(fp, "%18.16f %18.16f %18.16f %18.16f\n", u, v, w, p); } end_c_loop(c,t) } fclose(fp); } however, not all the variables available through the "export" gui command are available in a UDF so the export in ASCII could be your only choice. Regards |
|
Hi, which is the easyest wat to read an ASCII file which contains a text header. I need them to do a plot 2D or 3D i haven't decided yet. At the moment i'm using MATLAB, any other way?
Thanks in advance. |
you can use the software Origin. it has an option to import ASCII files and a GUI for plotting all kind of graphs
|
Hi, after a bit of time i'm done with calculating the integral in MATALAB. Now i got a 2830x6 matrix, where columns 2 to 4 are the coordinates of the nodes on the control surface mesh, column 6 is the integrated quantity. I would like to make a contour plot, by assigning the proper value to each node, but i'm not able to get back the original circular shape of the surface that i got in FLUENT when i have solved the case. Do you got any advice to postprocess my result in the correct way?
If something is not clear i will try to explain better. P.S. The problem is that in MATLAB i'm non able to take the coordinates couple by couple and assign the proper value to the node represented by them, more simply get the positions of the nodes in the proper way under MATLAB. |
All times are GMT -4. The time now is 00:11. |