Contour plot of fluent-ansys results

Hi Everyone,
There is a program called fluent, which is a CFD (Computational Fluid Dynamics) program. It provides predictions of various fluid dynamics simulations. The fluent results can be saved in various formats, the only one that I can find to read into matlab is ASCII. The problem with the format for exporting fluent data is that is provide one giant vector for the x coordinates, one giant vector for the y coordinate and giant vectors for each solution variable (density, velocity, viscosity, pressure, etc.).
My question is this: Has anyone out there found a way to export data from fluent and import it into Matlab so you can make contour plots? If not, can someone help me figure out how to do it? Is there a way I can attach an exported ASCII file to this question? That way you can see how the data is exported from fluent.
Thanks, Casey

5 Comments

Ok, here is a link to the exported ASCII data from matlab. The last column is the volume fraction of one of the phases.
I accidentally had it export the x and y coordinates twice. As you can see there is some adaption to the mesh in certain regions, which makes this problem a little harder.
Here is a link to an image of the mesh: http://dl.dropbox.com/u/56831415/ADAPT2JohnsJackRSM-mesh.tif
I can also export the data as CGNS, but I don't think there is a way to read CGNS data with matlab...
Sven
Sven on 7 Jul 2012
Edited: Sven on 7 Jul 2012
Hi Casey,
If you're looking to "visualise the results superimposed on the mesh", then I'm afraid you've only exported part of what is needed.
FE (or CFD) meshes are in the form of nodes and elements. The nodes sit in XYZ (or XY) space, and the elements tell us which nodes need to be joined to form a triangle (or square, or whatever mesh type you have). This is analogous to MATLAB's faces/vertices (as sent to the patch() function), so if you can export this information then I think it can be visualised.
It looks to me like you loaded the (real) results file into a Fluent visualisation program, then just exported the node "locations and volume fractions" at some particular timestep. (You'll note that the text file you linked to has no information about the timestep itself.)
I have a feeling that if Fluent is anything like LS-Dyna, it will use a binary format to store this somewhat heavy data describing node locations, element node indices, and "results" for each node (such as pressure, volume, etc). To visualise results superimposed on the mesh in MATLAB, you may need to write (or find) a file reader for Fluent's output data. This is no small task, but once you get your hands on the specification of the file from the Fluent documents, things become a little clearer.
The element node indices shouldn't change in each timestep (unless mesh adaptation occurs at each timestep), but the node locations and "results" should all be time-dependent, thus there should be data of these results per timestep.
[Note that some FE codes expect the output file(s) to be read in conjunction with the input file (with the node indices defining the mesh), therefore they will choose not to duplicate this information in the output file... I don't think Fluent does this however.]
Unfortunatly this is an issue with fluent. You can't export the data in the format you are requesting.
how can be import geometry obtained in matlab to cfd

Sign in to comment.

 Accepted Answer

More Answers (0)

Categories

Find more on Computational Fluid Dynamics (CFD) in Help Center and File Exchange

Asked:

on 5 Jul 2012

Commented:

on 16 Nov 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!