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

How to rearrange the solution data along mesh IJK coordinate?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2014, 12:00
Default How to rearrange the solution data along mesh IJK coordinate?
  #1
New Member
 
motorbean
Join Date: Nov 2011
Posts: 17
Rep Power: 14
motorbean is on a distinguished road
Dear All.

I exported the solution data (e.g. velocity magnitude) of a 2D flow over a bump in a channel. In the data file, each line contains the cell number, the cell centroid coordinates (x and y) and the variable (v).

However, the sequence of the cell doesn't follow the mesh IJK direction. Plotted out in matlab, it looks like Fig. 1, the connectivity is a mess.

Therefore, is there any way to re-arrange the data to get it follow the ijk direction? So that the connectivity will be based on the mesh lines?

For example, re-numbering the cell in the x-direction of y=0, then start with y=y+dy, and continue re-numbering the cell in the x-direction, then y=y+2*dy...

I need to do this for post-processing the data and added to another solution with the same mesh. This is a very important for my work. Can anyone help me please? Many Many Thanks!

Regards,
motorbean
Attached Images
File Type: jpg mesh and geometry.jpg (95.8 KB, 14 views)
File Type: jpg Fig_1- cell connectivity.jpg (96.0 KB, 19 views)
motorbean is offline   Reply With Quote

Old   February 22, 2014, 18:13
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Well, for structured grids like yours Gambit already outputs the grid with ordered indices. However you could put your grid coordinates in a Matrix of the form:

xi yi ci i

where the first two columns are the cell center coordinates, ci is the cell index and i is the row. Then you can order submit the Matrix to sortrows in MATLAB et voilą, you're done.
sbaffini is offline   Reply With Quote

Reply


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
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
Solution on hexa mesh vs solution on tetra mesh Chander CFX 2 December 10, 2011 09:35
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
2d irregular grid Remy Main CFD Forum 1 December 22, 2008 04:49
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58


All times are GMT -4. The time now is 05:55.