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

[blockMesh] Managing the cellToRegion function in blockMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2016, 10:15
Default Managing the cellToRegion function in blockMesh
  #1
JFM
Member
 
JFM's Avatar
 
John Anonymous
Join Date: Jan 2011
Location: Melbourne Australia
Posts: 37
Rep Power: 15
JFM is on a distinguished road
Send a message via Skype™ to JFM
Hi All

I am seeking some guidance to resolve an issue with the automatic creation of the cellToRegion file. My workflow utilises swiftBlock to generate the blockMeshDict and then generation of the mesh using blockMesh (OF3.0.x) I inspected the checkMesh file and noted that blockMesh is automatically generating multiple regions (sets). The output from checkMesh is ->

Code:
...
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           1025745
    faces:            2948374
    internal faces:   2823326
    cells:            961950
    faces per cell:   6
    boundary patches: 6
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     961950
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
   *Number of regions: 7
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 174702 cells to cellSet region0
  <<Writing region 1 with 234960 cells to cellSet region1
  <<Writing region 2 with 13464 cells to cellSet region2
  <<Writing region 3 with 2640 cells to cellSet region3
  <<Writing region 4 with 217536 cells to cellSet region4
  <<Writing region 5 with 1056 cells to cellSet region5
  <<Writing region 6 with 317592 cells to cellSet region6

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    atmos               41173    43023    ok (non-closed singly connected)  
    outlet              3432     3551     ok (non-closed singly connected)  
    inletAir            1551     1632     ok (non-closed singly connected)  
    inletWater          1551     1632     ok (non-closed singly connected)  
    walls               53317    55163    ok (non-closed singly connected)  
    baffles             24024    25324    ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (9.536743e-07 0 81.85) (12.19889 2.000001 85)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-1.502107e-15 -3.173354e-17 -2.08685e-14) OK.
    Max cell openness = 3.237439e-16 OK.
    Max aspect ratio = 3.035141 OK.
    Minimum face area = 0.00050178. Maximum face area = 0.002842247.  Face area magnitudes OK.
    Min volume = 2.040085e-05. Max volume = 9.278779e-05.  Total volume = 61.56817.  Cell volumes OK.
    Mesh non-orthogonality Max: 44.72319 average: 4.462879
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 1.719252 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
When generating the model in blender I ensured that all double vertices were removed and all near vertices (tolerance less than 1mm) were removed prior to generating the blockMeshDict file (model scale is approximately 12[L] x 2[W] x 4[H] meters) - so I expect that this is not the result of poor vertex definition.

For this model I need guicance on how to either:
  • combine all the sets into a single mesh;
  • modify the relevant control files to run the models with the sets in place; or,
  • generate a single mesh using blockMesh.
Having searched through the forum and web I have been unable to find anything that confirms this is an automatic operation, why it is implemented without specification and how to resolve it so I can run my model. Any assistance/direction will be greatly appreciated on why this happening and how to overcome it.


Regards
JFM

[fyi, my intention is create a youtube video on the use of swiftBlock and will cover this topic and other issues I have encountered as I image other users will have a similar issue]

Last edited by JFM; March 5, 2016 at 10:19. Reason: Removed a double negative
JFM is offline   Reply With Quote

Old   October 22, 2018, 08:36
Default
  #2
us7
New Member
 
Umer
Join Date: Aug 2016
Posts: 29
Rep Power: 10
us7 is on a distinguished road
Quote:
Originally Posted by JFM View Post
Hi All

I am seeking some guidance to resolve an issue with the automatic creation of the cellToRegion file. My workflow utilises swiftBlock to generate the blockMeshDict and then generation of the mesh using blockMesh (OF3.0.x) I inspected the checkMesh file and noted that blockMesh is automatically generating multiple regions (sets). The output from checkMesh is ->

Code:
...
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           1025745
    faces:            2948374
    internal faces:   2823326
    cells:            961950
    faces per cell:   6
    boundary patches: 6
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     961950
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
   *Number of regions: 7
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 174702 cells to cellSet region0
  <<Writing region 1 with 234960 cells to cellSet region1
  <<Writing region 2 with 13464 cells to cellSet region2
  <<Writing region 3 with 2640 cells to cellSet region3
  <<Writing region 4 with 217536 cells to cellSet region4
  <<Writing region 5 with 1056 cells to cellSet region5
  <<Writing region 6 with 317592 cells to cellSet region6

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    atmos               41173    43023    ok (non-closed singly connected)  
    outlet              3432     3551     ok (non-closed singly connected)  
    inletAir            1551     1632     ok (non-closed singly connected)  
    inletWater          1551     1632     ok (non-closed singly connected)  
    walls               53317    55163    ok (non-closed singly connected)  
    baffles             24024    25324    ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (9.536743e-07 0 81.85) (12.19889 2.000001 85)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-1.502107e-15 -3.173354e-17 -2.08685e-14) OK.
    Max cell openness = 3.237439e-16 OK.
    Max aspect ratio = 3.035141 OK.
    Minimum face area = 0.00050178. Maximum face area = 0.002842247.  Face area magnitudes OK.
    Min volume = 2.040085e-05. Max volume = 9.278779e-05.  Total volume = 61.56817.  Cell volumes OK.
    Mesh non-orthogonality Max: 44.72319 average: 4.462879
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 1.719252 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
When generating the model in blender I ensured that all double vertices were removed and all near vertices (tolerance less than 1mm) were removed prior to generating the blockMeshDict file (model scale is approximately 12[L] x 2[W] x 4[H] meters) - so I expect that this is not the result of poor vertex definition.

For this model I need guicance on how to either:
  • combine all the sets into a single mesh;
  • modify the relevant control files to run the models with the sets in place; or,
  • generate a single mesh using blockMesh.
Having searched through the forum and web I have been unable to find anything that confirms this is an automatic operation, why it is implemented without specification and how to resolve it so I can run my model. Any assistance/direction will be greatly appreciated on why this happening and how to overcome it.


Regards
JFM

[fyi, my intention is create a youtube video on the use of swiftBlock and will cover this topic and other issues I have encountered as I image other users will have a similar issue]
Hello JFM,
I know this is very old post but it can really help me if you have found solution for this problem because i am having the same problem. I generated mesh using CAD model but when i do checkMesh i found cellToRegion new file in 0 folder. Can you please comment on this?
us7 is offline   Reply With Quote

Old   February 2, 2024, 03:07
Default
  #3
Senior Member
 
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 102
Rep Power: 14
ufocfd is on a distinguished road
I had this issue before caused by few disconnected cells. It often happens in regions which are small/narrow compared to the local mesh cells size. You can see where the problem cells are by using this command for each of the small regions (change "region1" to whichever region names have been created):

foamToVTK -cellSet region1

which then creates tiny VTK files for the problem cells. You then load these into Paraview with your geometry to see where they are. You can then fix the issue by modifying the geometry or add some extra refinement in that area. The other method is to extract the largest mesh zone, leaving the problem cells behind. This can be done with this command:

splitMeshRegions -largestOnly -overwrite
ufocfd is offline   Reply With Quote

Reply

Tags
blockmesh, cellset, celltoregion, multiple region


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
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 12:32
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


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