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

[blockMesh] Inconsistent number of faces between block

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By alexeym
  • 2 Post By alexB
  • 1 Post By hk318i
  • 1 Post By CrisMoreira

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2015, 16:36
Default Inconsistent number of faces between block
  #1
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Hi,
i'm new to all of these kind of things so forgive if my doubt seems trivial
I got these error message while running blockMesh. After some research i found that maybe the problem is in the matching numbers in hex, so i have changed it but the problem wasn't solved.
I don't know if there's something missing in the matchPatchPairs() or mergePatchPairs() because i don't understand which cases is it necessary.
I'm trying to do a mesh to structure that can be divided in 7 blocks and on top of 3 of them is placed a prism.
Can anyone, please help me understand what i'm doing wrong?

Code:
convertToMeters 1;

vertices        
(
   (0.00    0.00    0.00) // 0
   (0.00    1.00    0.00) // 1
   (2.00    1.00    0.00) // 2
   (2.00    0.00    0.00) // 3
   (0.00    0.00    16.5) // 4
   (0.00    1.00    16.5) // 5
   (2.00    1.00    16.5) // 6
   (2.00    0.00    16.5) // 7
   (4.50    1.00    0.00) // 8
   (4.50    0.00    0.00) // 9
   (4.50    1.00    16.5) // 10
   (4.50    0.00    16.5) // 11
   (6.50    1.00    0.00) // 12
   (6.50    0.00    0.00) // 13
   (4.50    0.00    16.5) // 14
   (4.50    1.00    16.5) // 15
   (6.50    1.00    16.5) // 16
   (6.50    0.00    18.5) // 17
   (9.00    1.00    0.00) // 18
   (9.00    0.00    0.00) // 19
   (9.00    1.00    18.5) // 20
   (9.00    0.00    18.5) // 21
   (11.0    1.00    0.00) // 22
   (11.0    0.00    0.00) // 23
   (9.00    0.00    20.5) // 24
   (9.00    1.00    20.5) // 25
   (11.0    1.00    20.5) // 26
   (11.0    0.00    20.5) // 27
   (11.0    1.00    0.00) // 28
   (11.0    0.00    0.00) // 29
   (11.0    1.00    20.5) // 30
   (11.0    0.00    20.5) // 31
   (17.5    1.00    0.00) // 32
   (17.5    0.00    0.00) // 33
   (13.5    0.00    26.0) // 34
   (13.5    1.00    26.0) // 35
   (17.5    1.00    26.0) // 36
   (17.0    0.00    26.0) // 37
   (2.00    0.00    18.5) // 38
   (2.00    1.00    18.5) // 39
   (6.50    0.00    20.5) // 40
   (6.50    1.00    20.5) // 41
   (11.0    0.00    22.5) // 42
   (11.0    1.00    22.5) // 43
);

blocks          
(
    hex (0 1 2 3 4 5 6 7) (300 1 60) simpleGrading (1 1 1) // block 0
    hex (3 2 8 9 7 6 10 11) (300 1 60) simpleGrading (1 1 1)// block 1
    hex (9 8 12 13 14 15 16 17) (300 1 60) simpleGrading (1 1 1) // block 2
    hex (13 12 18 19 17 16 20 21) (300 1 60) simpleGrading (1 1 1) // block 3
    hex (19 18 22 23 24 25 26 27) (300 1 60) simpleGrading (1 1 1) // block 4
    hex (23 22 28 29 27 26 30 31) (300 1 60) simpleGrading (1 1 1) // block 5
    hex (29 28 32 33 34 35 36 37) (300 1 60) simpleGrading (1 1 1) // block 6
    hex (7 38 39 6 4 5 4 5) (300 1 60) simpleGrading (1 1 1) // block 7
    hex (17 40 41 16 14 15 14 15) (300 1 60) simpleGrading (1 1 1) // block 8
    hex (27 42 43 26 24 25 24 25) (300 1 60) simpleGrading (1 1 1) // block 9
);
edges           
(
);
boundary         
(
    inlet
    {
        type patch;
        faces
        (
            (0 1 5 4)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (33 32 36 37)
        );
    }
    bottomWall
    {
    type wall;
    faces
    (
        (0 1 2 3)
        (3 2 8 9)
        (9 8 12 13)
        (13 12 18 19)
        (19 18 22 23)
        (23 22 28 29)
        (29 28 32 33)
    );
    }
    frontAndBack
    {
    type empty;
    faces
    (
        (0 4 7 3)
        (3 7 11 9)
        (9 14 17 13)
        (13 17 21 19)
        (19 24 27 23)
        (23 27 31 29)
        (29 34 37 33)
        (1 5 6 2)
        (2 6 10 8)
        (8 15 16 12)
        (12 16 20 18)
        (18 25 26 22)
        (22 26 30 28)
        (28 35 36 32)
    );
     }
);

mergePatchPairs
(
);
CrisMoreira is offline   Reply With Quote

Old   April 22, 2015, 11:23
Default
  #2
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
Hi Chris

A sketch of your geometry would be very helpful.

But I think I know the problem and can show a good workaround.

I think your mesh contains at least two neighbouring blocks with inconsistent grids... see picture .

If you want to avoid mergepatchpairs you have to insert additional blocks... see picture


Its the same workaround like in the tutorial cavitatingFoam/throttle .

I hope this rather short answer solved your prob.

regards
Alex
alexB is offline   Reply With Quote

Old   April 24, 2015, 10:53
Default
  #3
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Hello Alex, i'm sorry for the delay.
Thank you for your reply, iwas trying to understand what you explained but still i couldn't resolve the problem.
Here is the images of what i'm trying to do: to do the blocks hex (0 1 2 3 4 5 6 7) and to the the prism on top of that block hex (7 38 39 6 4 5 4 5)
Attached Images
File Type: jpg 20150424_143359.jpg (13.5 KB, 85 views)
File Type: jpg 20150424_143403.jpg (20.7 KB, 49 views)
CrisMoreira is offline   Reply With Quote

Old   April 24, 2015, 11:23
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I would suggest to divide your mesh like on the attached figure (i.e. using only hexagons). Prismatic blocks are in general PITA (or they just do not like me).
Attached Images
File Type: png mesh-subdivisions.png (2.5 KB, 75 views)
CrisMoreira likes this.
alexeym is offline   Reply With Quote

Old   April 24, 2015, 18:27
Default
  #5
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
Ohhh yeah, I see your problem.

Not only that I can confirm alexey's opinion with prismatic blocks... but also you have messed up the grading for your blocks.

See User Guide http://cfd.direct/openfoam/user-guid...#x25-1420005.3
Quote:
Each block has a local coordinate system that must be right-handed. A right-handed set of axes is defined such that to an observer looking down the axis, with nearest them, the arc from a point on the axis to a point on the axis is in a clockwise sense.
Quote:
5.3.1.3 The blocks
The block definitions are contained in a list named blocks. Each block definition is a compound entry consisting of a list of vertex labels whose order is described in section 5.3, a vector giving the number of cells required in each direction, the type and list of cell expansion ratio in each direction.
In short:
You have to look at every block which direction is your x1,x2,x3 . And then decide the grading in this direction.

Perhaps you can blockMesh your grid for a first raw version if you change the grading for all not prismatic blocks from (300 1 60) to (1 60 300)

If it works you will see where to change the grading for a better solution and I hope you see the problem with prismatic blocks like predicted by alexey. (in one corner the mesh becomes ultrafine... gives problem with the Courant number in most cases)

regards
Alex
CrisMoreira and Mr.HotRod like this.

Last edited by alexB; April 25, 2015 at 05:17.
alexB is offline   Reply With Quote

Old   April 25, 2015, 08:05
Default
  #6
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18
hk318i is on a distinguished road
The problem isn't only the grading for each block. Also the local coordinates isn't following the right-hand rule. You will get a warning for negative or zero volumes when you fix the grading problem. The mesh will look fine in paraview but the solver will not run.
Bw,
Hassan
CrisMoreira likes this.
hk318i is offline   Reply With Quote

Old   April 28, 2015, 16:12
Default
  #7
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Thank you so much for all your help.
Using your suggestions and rewriting blockMeshDict using only hexagons and the right-hand rule, the problem was solved.
But then i used checkMesh and got 2 failed mesh checks.
So i applied this suggestion:
Quote:
Perhaps you can blockMesh your grid for a first raw version if you change the grading for all not prismatic blocks from (300 1 60) to (1 60 300)
And only 1 mesh failed mesh check. I don't know if the nš of cells has a part in this or if it was only coincidence but i played with it but couldn't solve the problem.
Could you please give any tip in how to solve this?
CrisMoreira is offline   Reply With Quote

Old   April 28, 2015, 17:28
Default
  #8
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
Hi Chris,

could you attach a sketch of your full grid, and the logs of blockMesh and checkMesh?

Perhaps the prob gets clearer for me then.

regards
Alex
alexB is offline   Reply With Quote

Old   April 28, 2015, 19:00
Default
  #9
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Attachment 39118Hi Alex,
Here is the logs:
Code:
cristina@cristina-HP-Pavilion-g6-Notebook-PC:~/OpenFOAM/cristina-2.2.2/run/test/1$ blockMesh
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.2.2-9240f8b967db
Exec   : blockMesh
Date   : Apr 28 2015
Time   : 22:41:02
Host   : "cristina-HP-Pavilion-g6-Notebook-PC"
PID    : 18354
Case   : /home/cristina/OpenFOAM/cristina-2.2.2/run/test/1
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "/home/cristina/OpenFOAM/cristina-2.2.2/run/test/1/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology
--> FOAM Warning : 
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 901
    Found 13 undefined faces in mesh; adding to default patch.

Check topology

    Basic statistics
        Number of internal faces : 10
        Number of boundary faces : 46
        Number of defined boundary faces : 46
        Number of undefined boundary faces : 0
    Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1

Writing polyMesh
----------------
Mesh Information
----------------
  boundingBox: (0 0 0) (17.5 1 26)
  nPoints: 293288
  nCells: 198000
  nFaces: 687720
  nInternalFaces: 500280
----------------
Patches
----------------
  patch 0 (start: 500280 size: 36000) name: inlet
  patch 1 (start: 536280 size: 36000) name: outlet
  patch 2 (start: 572280 size: 420) name: bottomWall
  patch 3 (start: 572700 size: 6600) name: frontAndBack
  patch 4 (start: 579300 size: 108420) name: defaultFaces

End

cristina@cristina-HP-Pavilion-g6-Notebook-PC:~/OpenFOAM/cristina-2.2.2/run/test/1$ checkMesh
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.2.2-9240f8b967db
Exec   : checkMesh
Date   : Apr 28 2015
Time   : 22:45:18
Host   : "cristina-HP-Pavilion-g6-Notebook-PC"
PID    : 18371
Case   : /home/cristina/OpenFOAM/cristina-2.2.2/run/test/1
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           293288
    faces:            687720
    internal faces:   500280
    cells:            198000
    faces per cell:   6
    boundary patches: 5
    point zones:      0
    face zones:       0
    cell zones:       0

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

Checking topology...
    Boundary definition OK.
 ***Total number of faces on empty patches is not divisible by the number of cells in the mesh. Hence this mesh is not 1D or 2D.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    inlet               36000    36661    ok (non-closed singly connected)  
    outlet              36000    36661    ok (non-closed singly connected)  
    bottomWall          420      488      ok (non-closed singly connected)  
    frontAndBack        6600     9616     ok (non-closed singly connected)  
    defaultFaces        108420   110288   ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (0 0 0) (17.5 1 26)
    Mesh (non-empty, non-wedge) directions (0 0 0)
    Mesh (non-empty) directions (0 0 0)
 ***Number of edges not aligned with or perpendicular to non-empty directions: 109800
  <<Writing 219600 points on non-aligned edges to set nonAlignedEdges
    Boundary openness (6.27077e-15 -2.59811e-15 7.98285e-17) OK.
    Max cell openness = 2.12958e-16 OK.
    Max aspect ratio = -1 OK.
    Minimum face area = 0.000111111. Maximum face area = 0.273333.  Face area magnitudes OK.
    Min volume = 0.000222222. Max volume = 0.00455556.  Total volume = 359.75.  Cell volumes OK.
    Mesh non-orthogonality Max: 45 average: 18.1399
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 2.5 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End
Greetings

Last edited by CrisMoreira; April 28, 2015 at 21:30.
CrisMoreira is offline   Reply With Quote

Old   April 28, 2015, 19:13
Default
  #10
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18
hk318i is on a distinguished road
This error about the definition of the empty patches. You have many empty patches, the correct one which is frontAndBack only. blockMesh defines the defaultFaces as empty. You have to specify different boundary type for the defaultFaces.

Bw,
Hassan
hk318i is offline   Reply With Quote

Old   April 28, 2015, 20:06
Default
  #11
New Member
 
Cristina Moreira
Join Date: Jan 2015
Location: Portugal
Posts: 28
Rep Power: 11
CrisMoreira is on a distinguished road
Thank you. Problem solved.

Using the 13 remaining faces as patch on defaultFaces solved the problem.

Best Regards

Cris

Edit: Actually it has to be a wall while running setFields a log message appear saying that it has to be a wall.
hk318i likes this.

Last edited by CrisMoreira; April 28, 2015 at 22:32.
CrisMoreira 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
[Other] Equal decomposition of cylindrical fluid domain Sean95 OpenFOAM Meshing & Mesh Conversion 3 February 12, 2019 04:34
[snappyHexMesh] SHM Layer Addition Phase dickcruz OpenFOAM Meshing & Mesh Conversion 4 November 1, 2018 08:05
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 2 June 24, 2017 06:29
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
SigFpe when running ANY application in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 23, 2015 15:53


All times are GMT -4. The time now is 22:42.