CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Different Cell ID in ParaView (https://www.cfd-online.com/Forums/openfoam-programming-development/169779-different-cell-id-paraview.html)

mheinz April 17, 2016 09:51

Different Cell ID in ParaView
 
Hello.

As the heading suggests, I have a problem when accessing specific Cell IDs in ParaView. I noticed the problem when i wanted to visualize some operations on single cells.

What I do to get the data is simply:

Code:

if (iCell == 14154)
{
    // write data
}

The data is stored in a volScalarField in order to visualize it with paraView. That works, but when I look for the Cell ID where the expected data is plotted, the actual cell with ID "14154" is nowhere near the plotted data. Instead I see the Cell ID "14514". The similarity of the Cell IDs is reproducable when I change the specified Cell ID in the code.

Any ideas?

Kind regards,
Michael

wyldckat April 17, 2016 09:58

Quick questions:
  1. What are the exact steps you take before and after you run your solver?
    For example, are you running any of the following applications:
    1. renumberMesh
    2. decomposerPar
    3. reconstructPar
    4. any dynamic mesh solvers
  2. Are you running your solver or custom application in parallel or in serial?
  3. Are you using foamToVTK or paraFoam to retrieve the cell IDs?
  4. What options are you using when you either use foamToVTK or paraFoam?

mheinz April 17, 2016 10:10

Thanks for your quick reply.

  1. blockMesh, a custom utility to calculate initial conditions and a modified version of setfields in order to access different regions (modsetFields -region xxx)
  2. I am running a customized multiregion solver in serial.
  3. paraFoam
  4. paraFoam -region xxx
Something I did not mention before: The strange thing is that I access a group of specific cells via a labelList. The cell of interest is included. When I write those Cell IDs in a file, I do not find the ID that is shown in ParaFoam although it is at the expected location.

wyldckat April 17, 2016 10:17

Quick answer: Mmm... then I guess that you didn't turn off cell decomposition or turn on the "VTK polyhedral" option in ParaView.
For more details on what I mean exactly, see this FAQ: http://openfoamwiki.net/index.php/FA...is_in_ParaView

mheinz April 17, 2016 10:55

1 Attachment(s)
Hm, I looked into that but the results where the same.

I will look a little bit more around if there is a mistake in my code, but I really do not think so. However, I made a picture of my paraFoam visualization. Maybe it helps for further ideas.

What I did in the code is:

Code:

label oneCell = 14514;
if (iCell == oneCell)
{
    intCell[iCell] = iCell;
    // additionally some values are written
}

In paraFoam I then see the written values and at the expected cell the value of iCell for the parameter intCell. But as can be seen in the picture, the actual Cell ID in paraFoam is different.

wyldckat April 17, 2016 14:44

Quick note:
Quote:

Cell type "Quad"
that's a face on the surface mesh, not a cell. A cell would be of type Hexahedron or Tetrahedron or something like that.

Looks to me like you loaded the surface mesh as well (the patches) ;)

mheinz April 17, 2016 15:47

That 's it... Sometimes i have to doubt myself. :D

I was blindly following my standad procedure when calling paraFoam that I did not recognize that I only activated the visualization of one patch. Of course, then the Cell IDs do not match. ^^

Thank you for your help!


All times are GMT -4. The time now is 16:58.