|
[Sponsors] |
How to rearrange the solution data along mesh IJK coordinate? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 4, 2014, 13:00 |
How to rearrange the solution data along mesh IJK coordinate?
|
#1 |
New Member
motorbean
Join Date: Nov 2011
Posts: 17
Rep Power: 15 |
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 |
|
February 22, 2014, 19:13 |
|
#2 |
Senior Member
|
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. |
|
|
|
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 11:52 |
Solution on hexa mesh vs solution on tetra mesh | Chander | CFX | 2 | December 10, 2011 10:35 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |
2d irregular grid | Remy | Main CFD Forum | 1 | December 22, 2008 05:49 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |