|
[Sponsors] |
July 5, 2012, 16:59 |
Export/Import data contour plots with Matlab
|
#1 |
Member
Casey
Join Date: Jun 2009
Posts: 98
Rep Power: 17 |
Hi Everyone,
I would like to make contour plots using matlab from my Fluent data, but I can't figure out how to sort the data so that matlab can plot it. (I am working in 2D and axisymmetric) Fluent provides one long list of x coordinates, one long list of y coordinates and on long list of variables. But this isn't how matlab wants to plot things. Has anyone written a function in matlab to rearrange the fluent output so they can plot the contour plots in matlab? My mesh uses adaption, which makes things complicated. Casey |
|
August 16, 2012, 20:15 |
|
#2 |
Member
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 14 |
Hi
I have the same problem as yours. Do you remember how you solved this? any help is appreciated. Cheers Negin |
|
August 20, 2012, 09:51 |
|
#3 |
Member
Casey
Join Date: Jun 2009
Posts: 98
Rep Power: 17 |
Still haven't been able to solve it. Let me know if you make any progress. I have been using paraview, but it doesn't provide the same amount of control as I would like.
|
|
July 27, 2017, 07:56 |
|
#5 |
Member
ehsan
Join Date: Sep 2014
Posts: 38
Rep Power: 12 |
you can export any contours from FLUENT to MATLAB following these steps:
1- Export what you want from File\export\solution data. (file type : ASCII and delimiter should be space). 2- use uiopen ('file address',1) in MATLAB. 3- delete characters in the first line of opened script. 4- save it on the previous file (just Ctrl+s) 5- c=dlmread('file address') Done ! c usually is a N*4 matrix, (node number, x-coor, y-coor, contour parameter) Regards Ehsan |
|
September 6, 2017, 08:46 |
|
#6 |
New Member
Bauta Steen
Join Date: Aug 2017
Posts: 2
Rep Power: 0 |
If you have exported your Fluent grid and data in Ascii format you can use the FEATool Matlab FEM Toolbox functions to plot contours on general unstructured grids (as well as perform further postprocessing). A few examples of possible plots and explanation of the syntax is given in this postprocessing tutorial.
|
|
June 23, 2020, 12:44 |
could you send me the code for me to understand it,I have uploaded the data, please h
|
#7 | |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 10 |
Quote:
|
||
October 26, 2020, 14:48 |
|
#8 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
||
October 27, 2020, 11:54 |
Do you have other methods except for the matab,I have not used the surface plot befor
|
#9 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 10 |
||
October 27, 2020, 11:57 |
|
#10 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
||
October 28, 2020, 10:27 |
Could you send me one code example for me ,thank you.
|
#11 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 10 |
||
October 28, 2020, 11:06 |
|
#12 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
Hi, I use the few lines of code below.
Code:
del_x = ... %element size in the x direction del_y = ... %element size in the y direction m=dlmread('filename.txt'); %reading the data from text file x = m(:, 1); %x-coordinates y = m(:, 2); %y-coordinates z = m(:, 3); %variable [X,Y]=meshgrid(min(x):del_x:max(x),min(y):del_y:max(y)); %matlab mesh Z=griddata(x,y,z,X,Y); %interpolation contourf(X, Y, Z); %contour plot |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Matlab contour plots | Chris | CFX | 17 | October 29, 2020 05:32 |
Any way to extract data from contour plots using paraView? | Angela Wang | OpenFOAM | 10 | December 3, 2017 21:37 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |
drawing of contour plots | chinthakindi | Main CFD Forum | 1 | April 27, 2004 05:33 |