CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Technical] [solved] Neighbour cellId as "-1"

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By deepsterblue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2019, 08:39
Default [solved] Neighbour cellId as "-1"
  #1
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
Hello,

I am trying to convert an OpenFOAM mesh from binary to ascii. The binary mesh was previously generated from StarCCM.

However, on conversion to ascii, the neighbour cellIds are shown as "-1" for most of the end part.

Here is the neighbour file:
Code:
461199
(
1
2
3
4
56786
4
5
7
56788
57202
.....

-1
-1
-1
-1
-1
-1
-1
-1
-1
)
I have never encountered such an issue, nor am I able to find such a thing anywhere on the forum.

Any suggestions are welcome.

Thanks.

PS: I did checkMesh, it didn't throw any error related to this.
ashishmagar600 is offline   Reply With Quote

Old   May 5, 2019, 10:12
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by ashishmagar600 View Post
I am trying to convert an OpenFOAM mesh from binary to ascii. The binary mesh was previously generated from StarCCM.
Quick request: Please elaborate on how exactly you converted the Star-CCM+ mesh to OpenFOAM mesh, because this looks like a problem with the conversion.
__________________
wyldckat is offline   Reply With Quote

Old   May 6, 2019, 01:45
Default
  #3
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
I don't know exactly how the mesh was converted, I was only given the OF mesh. (There is another team working on it, I will see and ask them how they converted to OF).

However, I noted that when I write the neighbors from the code
Code:
        labelList  m_nei( mesh.neighbour() );        

        for( label i=0; i < m_nei.size(); i++)
        {
                OS1 << m_nei[i] << nl;
        }
and then write it to a file, it entirely skips the "-1" values.

Exmaple:
neighbour file from polyMesh/
Code:
1184680
(
1
2
87465
5
7
6
7
...
357970
357971
357971
357972
357972
-1
-1
...
-1
)
And neighbour printed from code:
Code:
992701
(
1
2
87465
5
7
...
357970
357971
357971
357972
357972
)

Surprisingly, it has skipped all the "-1" values.
ashishmagar600 is offline   Reply With Quote

Old   May 6, 2019, 19:26
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Then the -1 values might be a bug from the mesh export tool that the other team used.

And if OpenFOAM was able to ignore the -1 values, I guess it shouldn't be a problem. But this is meant to be a fairly rare problem, because I don't remember ever seeing this before.

I can only guess that the -1 values appeared because the mesh exporter was being literal about an interface, for example, a baffle where the faces that were once shared between cells, where split into two sides and the cells were uncoupled, leaving behind a loose -1 indication of the neighbour cell that used to have.
wyldckat is offline   Reply With Quote

Old   May 7, 2019, 00:21
Default
  #5
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
OpenFOAM meshes place boundary faces at the end of the face list (after all interior faces), and since boundary faces do not possess a neighbor cell, the neighbor value was automatically assigned a value of -1, to keep the owner / neighbor list lengths equal. I believe this practice was abandoned sometime circa OF-1.4, presumably due to storage considerations. But for backwards compatibility, such meshes are still supported in current versions. The polyMesh code simply truncates the list to the number of interior faces.
wyldckat likes this.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   May 7, 2019, 03:54
Default
  #6
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
Thank you @deepsterblue and @wyldcat, for helping out.

@wyldcat, please mark this thread as solved.

Thanks a lot.
ashishmagar600 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
area does not match neighbour by ... % -- possible face ordering problem St.Pacholak OpenFOAM 10 February 7, 2024 21:50
problem "face 0 area does not match neighbour by xxx%" in parallel run Aleigus OpenFOAM 0 July 2, 2017 12:10
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21
access the information of the neighbour cell across a processor boundary? sophie_l OpenFOAM Programming & Development 4 August 9, 2016 14:05
pimpleDyMFoam,parallel,area does not match neighbour KangX1 OpenFOAM Running, Solving & CFD 1 May 31, 2016 03:04


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