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

fluent msh file to tecplot by fortran

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

Like Tree2Likes
  • 2 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2013, 22:27
Default fluent msh file to tecplot by fortran
  #1
New Member
 
Ernest Sun
Join Date: Dec 2011
Posts: 5
Rep Power: 14
Ernest Sun is on a distinguished road
Hi,

I read a fluent 'msh' file with fortran to my own cfd solver. It is easy to get cells' node list, but the sequence of node in cells' node list is wild. So it is need same methods the rank the node list in order to make use of tecplot to do post.

Is there someone had a similar experience? Hope this can be discussed.

Thanks!

Ernest
Ernest Sun is offline   Reply With Quote

Old   May 2, 2013, 04:38
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear Ernest,

in my spare time i work on a MATLAB tool to play with unstructured meshes and related techniques. It is in a very early stage development phase but the following is present:

- reading of gambit .msh or fluent .cas (ascii) files

- output to .vtk legacy files (ascii) in unstructured_grid format (working both in 2D/3D)

I don't know exactly the Tecplot format, but if you check this:

http://www.vtk.org/VTK/img/file-formats.pdf

and you think there is some chance for my contribution to be useful i can surely share it.

Regards
Far and Ernest Sun like this.
sbaffini is offline   Reply With Quote

Old   May 2, 2013, 12:13
Default
  #3
New Member
 
Ernest Sun
Join Date: Dec 2011
Posts: 5
Rep Power: 14
Ernest Sun is on a distinguished road
thank you for your reply, Paolo. i think your code will help me a lot. i read the vtk file format. i found the node list in cell is mostly same to tecplot.

my email: ernest.sun@qq.com

Regards

Ernest
Ernest Sun is offline   Reply With Quote

Old   May 3, 2013, 11:46
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear Ernest,

you can find the tool at the following link:

http://rapidshare.com/files/1564297057/UFVMOM.rar

Now, for several reasons, i put in the link the whole tool. So, in order for you to fruitfully use the part you need, some explanations are needed.

GENERAL DESCRIPTION

The tool is actually a collection of functions, grouped by tasks under several folders plus a main test.m file which contains some useful examples.

The following folders are present (in logical order):

input: it is the folder for the mesh files input. It includes a subfolder "files" with actual example .msh files and a simple single-block structured grid generator (the three routines inside the folder).

grid: it contains the main routine (readmsh.m) for reading .msh grids and .cas fluent case files (both in ascii format) and routine trasformation.m to apply a simple manipulation to the grid nodes.

NOTE: In order to understand how the writing to the .vtk file is done, you need to clearly understand how the data in the .msh file is stored internally after reading it.

fvgeom: this folder contains several pre-processing tools which are useful within the code. They are all important for several reasons, but for your task it is probably fvgeom.m which needs a better look.

fieldfunctions: basic routines to define a scalar or vectorial test field or its derivative.

fvcomp: it contains a gradient and a filtering routine.

kdtree: routines and data structures for a k-search algorithm. Fully taken from MATLAB Exchange without any modification.

rbf: simple routines to perform basic Radial Basis Function Interpolation and derivative computation.

plot: a collection of plotting functions.

vtk: the routine used to export to .vtk, with the resulting file (both in 2D/3D) being readily available for plotting in Paraview. This is the main routine you are interested in (after you understand how data is stored internally). Note that, at the moment, there is no support for general polyhedral cells (i was unable to find a reference) but only for hexa/quad, tetra/tri, wedge, pyramids.


This is more or less a description of the several tools available. In the test.m file there are several examples on the different tools and all the subroutines are, in my opinion, heavily commented so you should be able (after a while) to understand how things work.

As you can see, all the material is at a very rough development stage yet so, it goes without saying, EVERYTHING COMES WITHOUT ANY FORM OF WARRANTY. Besides this, you can use it as you want.


CRITICAL PARTS

I want to collect here the critical points/routines or parts where a full testing is still needed:

- general: boundary conditions are read from the .msh file but, NOWHERE IN THE TOOL they are considered (e.g., in the gradient computation).

- input\writemsh.m: it actually works and i've been using it for a while now without any problem. Nonetheless, sometimes Fluent launches a warning in reading the meshes written by this file... still, it can work it out without problems.

- fvcomp\fvfilter.m: i never used the routine or even tested it; might also be totally wrong (ok, maybe not that bad...).

- kdtree\...: the whole tool was not developed by me and i know nothing about it.

- vtk\vtkwrite.m: i already said this but i repeat it, there is a lack of support for polyhedral cells. I don't know if polygonal cells (2D) are supported because i didn't have any tool to create them.
sbaffini is offline   Reply With Quote

Old   May 3, 2013, 12:04
Default
  #5
New Member
 
Ernest Sun
Join Date: Dec 2011
Posts: 5
Rep Power: 14
Ernest Sun is on a distinguished road
Dear Paolo,

Thank you very much for your selfless giving! I will do my best to understand it.

Regards

Ernest
Ernest Sun 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
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 11:03
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 19:24.