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

Class to merge cells (Topology change)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 29, 2019, 18:39
Default Class to merge cells (Topology change)
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,



at the moment I am trying to create an application that checks the mesh while analyzing the cell types. If the cell type is, e.g., a wedge, I want to merge it with the surrounding cells. Up to now, I have all cellID's that has to be merged with the neighbors. Therefore, I also have all cell id's of the neighbors. While using the polyTopoChange class, I am trying to remove/merge the cells. This works actually fine, but here I do not have any idea, if the cell is removed, or if it is merged with the other one. Furthermore, there is still the problem while writing the mesh as the faces have to be updated too. Here is a snipped of the code:
Code:
    //- Get all wedge cells                                                     
    forAll(cellIDTetWedges, cellI)                                              
    {                                                                           
        const label cellID = cellIDTetWedges[cellI];                            
        cell toBeRemoved = mesh.cells()[cellID];                                
                                                                                
        // Get neigbor cells ID                                                 
        const labelList& neigborIDs = mesh.cellCells(cellID);                   
                                                                                
        // Merge cell                                                           
        meshMani.removeCell(cellID, neigborIDs[0]);                             
                                                                                
        Info<< meshMani.cellRemoved(cellID) << endl;                            
        Info<< meshMani.cellRemoved(neigborIDs[0]) << endl;                     
    }                                                                           
                                                                                
    meshMani.changeMesh(test, false);
This results in:
Code:
0
1
0
1
0


--> FOAM FATAL ERROR: 
Face 19868 is active but its owner has been deleted. This is usually due to deleting cells without modifying exposed faces to be boundary faces.

    From function void Foam::polyTopoChange::makeCells(Foam::label, Foam::labelList&, Foam::labelList&) const
    in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 483.
Here we see, that cells are merged/removed and that I have to incoperate the faces. However, my question here is: Did anybody did something like that before? Any hint about the classes that I could use are warmly welcomed. Surely, I will also check snappyHexMesh. Maybe I will find the corresponding code that merges/splits cells.




PS: The intension could also be as follows: Removing the tet-wedge cell + all cells that are surrounding the cell. Then build a new cell.


Thanks in advance,
Tobi
atulkjoy likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 27, 2020, 17:25
Default
  #2
Member
 
Atul Kumar
Join Date: Dec 2015
Location: National Centre for Combustion Research and Development
Posts: 48
Rep Power: 10
atulkjoy is on a distinguished road
Can you upload the case or some information ???
atulkjoy 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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 04:21
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 11:58
Change mesh topology during transient run Alex77 CFX 2 October 31, 2007 03:35


All times are GMT -4. The time now is 04:36.