|
[Sponsors] |
May 4, 2009, 05:23 |
Fluent & matlab
|
#1 |
Member
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
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.
|
|
May 4, 2009, 06:15 |
|
#2 |
Senior Member
|
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 |
|
May 4, 2009, 12:13 |
|
#3 |
Member
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
||
July 24, 2009, 05:38 |
|
#4 |
Member
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
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. |
|
July 24, 2009, 07:42 |
|
#5 |
New Member
divyam
Join Date: Jun 2009
Posts: 7
Rep Power: 17 |
you can use the software Origin. it has an option to import ASCII files and a GUI for plotting all kind of graphs
|
|
August 24, 2009, 14:16 |
|
#6 |
Member
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
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. Last edited by Fabio; August 25, 2009 at 06:19. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Stopping a Fluent batch job AND saving the data! Possible? | Volker Pawlik | FLUENT | 13 | December 28, 2020 05:16 |
linking matlab and fluent | Nair | FLUENT | 23 | January 12, 2020 19:55 |
Two questions on Fluent UDF | Steven | Fluent UDF and Scheme Programming | 7 | March 23, 2018 04:22 |
Comparing Fluent Time dependent result with Patran | venigall | FLUENT | 0 | January 13, 2007 20:30 |
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model | Jonas Larsson | FLUENT | 5 | March 13, 2000 04:27 |