CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Export/Import data contour plots with Matlab

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 3 Post By Bodo1993

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2012, 15:59
Default Export/Import data contour plots with Matlab
  #1
Member
 
Casey
Join Date: Jun 2009
Posts: 98
Rep Power: 16
meangreen is on a distinguished road
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
meangreen is offline   Reply With Quote

Old   August 16, 2012, 19:15
Default
  #2
Member
 
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 14
nenazarian is on a distinguished road
Hi

I have the same problem as yours. Do you remember how you solved this?
any help is appreciated.

Cheers
Negin
nenazarian is offline   Reply With Quote

Old   August 20, 2012, 08:51
Default
  #3
Member
 
Casey
Join Date: Jun 2009
Posts: 98
Rep Power: 16
meangreen is on a distinguished road
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.
meangreen is offline   Reply With Quote

Old   August 21, 2012, 01:28
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
You could use interp/interp2/interp3 functions provided by MATLAB to interpolate your result to structured grids. TECPLOT is a better choice than MATLAB for data visualization.
blackmask is offline   Reply With Quote

Old   July 27, 2017, 06:56
Default
  #5
Member
 
ehsan
Join Date: Sep 2014
Posts: 38
Rep Power: 11
e_cfd is on a distinguished road
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
e_cfd is offline   Reply With Quote

Old   September 6, 2017, 07:46
Default
  #6
New Member
 
Bauta Steen
Join Date: Aug 2017
Posts: 2
Rep Power: 0
bsteen is on a distinguished road
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.
bsteen is offline   Reply With Quote

Old   June 23, 2020, 11:44
Default 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: 382
Rep Power: 9
hitzhwan is on a distinguished road
Quote:
Originally Posted by bsteen View Post
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.
could you send me the code for me to understand it,I have uploaded the data,I want to put all the data in one data.xlsx, please help me do it. Thank you.
Attached Files
File Type: zip data.zip (32.2 KB, 11 views)
hitzhwan is offline   Reply With Quote

Old   October 26, 2020, 13:48
Default
  #8
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 6
Bodo1993 is on a distinguished road
Quote:
Originally Posted by hitzhwan View Post
could you send me the code for me to understand it,I have uploaded the data,I want to put all the data in one data.xlsx, please help me do it. Thank you.
Hi, I am wondering if you got any clue on how to do the surface plot in MATLAB accurately. Thanks.
Bodo1993 is offline   Reply With Quote

Old   October 27, 2020, 10:54
Default 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: 382
Rep Power: 9
hitzhwan is on a distinguished road
Quote:
Originally Posted by Bodo1993 View Post
Hi, I am wondering if you got any clue on how to do the surface plot in MATLAB accurately. Thanks.
Do you have other methods except for the matab,I have not used the surface plot before?
hitzhwan is offline   Reply With Quote

Old   October 27, 2020, 10:57
Default
  #10
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 6
Bodo1993 is on a distinguished road
Quote:
Originally Posted by hitzhwan View Post
Do you have other methods except for the matab,I have not used the surface plot before?
Hi, I actually do the postprocessing with MATLAB. An alternative would be python, but I do not use it.
Bodo1993 is offline   Reply With Quote

Old   October 28, 2020, 09:27
Default Could you send me one code example for me ,thank you.
  #11
Senior Member
 
Join Date: Dec 2017
Posts: 382
Rep Power: 9
hitzhwan is on a distinguished road
Quote:
Originally Posted by Bodo1993 View Post
Hi, I actually do the postprocessing with MATLAB. An alternative would be python, but I do not use it.
Could you send me one code example for me ,thank you.
hitzhwan is offline   Reply With Quote

Old   October 28, 2020, 10:06
Default
  #12
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 6
Bodo1993 is on a distinguished road
Quote:
Originally Posted by hitzhwan View Post
Could you send me one code example for me ,thank you.
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
Hope it helps.
Bodo1993 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matlab contour plots Chris CFX 17 October 29, 2020 04:32
Any way to extract data from contour plots using paraView? Angela Wang OpenFOAM 10 December 3, 2017 20:37
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27
drawing of contour plots chinthakindi Main CFD Forum 1 April 27, 2004 04:33


All times are GMT -4. The time now is 07:29.