View Issue Details

IDProjectCategoryView StatusLast Update
0001809OpenFOAMBugpublic2015-08-28 20:24
Reporteruser1203Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Summary0001809: BlockMesh multi-grading erroneous behaviour
DescriptionBlockMesh fails sometimes if the multi-grading is specified on an edge which has opposite directions between two blocks. I attached two examples: first one runs without problems but the second one gives an error "Inconsistent point locations between block pair 0 and 1." Only the amount of cells in k-direction is changed (i.e. values 20,23,24 are OK and 21,22 are not).

This one runs without problems:

vertices
(
    (-0.5 0.5 0.0)
    (0.5 -0.5 0.0)
    (0.5 0.5 0.0)
    (1.0 1.0 0.0)
    (1.0 -1.0 0.0)
    (-1.0 1.0 0.0)
    (-0.5 0.5 2.0)
    (0.5 0.5 2.0)
    (0.5 -0.5 2.0)
    (-1.0 1.0 2.0)
    (1.0 -1.0 2.0)
    (1.0 1.0 2.0)
    (-0.5 -0.5 0.0)
    (-0.5 -0.5 2.0)
);

blocks
(
    hex (5 3 11 9 0 2 7 6) (40 40 20) simpleGrading (
1 1
(
 (0.3 0.4 4) (0.5 0.3 1) (0.2 0.3 0.25)
)
)
    hex (1 2 7 8 4 3 11 10) (20 40 20) simpleGrading (
1 1
(
 (0.2 0.3 4) (0.50 0.3 1) (0.30 0.4 0.25)
)
)
);

This one gives an error:

vertices
(
    (-0.5 0.5 0.0)
    (0.5 -0.5 0.0)
    (0.5 0.5 0.0)
    (1.0 1.0 0.0)
    (1.0 -1.0 0.0)
    (-1.0 1.0 0.0)
    (-0.5 0.5 2.0)
    (0.5 0.5 2.0)
    (0.5 -0.5 2.0)
    (-1.0 1.0 2.0)
    (1.0 -1.0 2.0)
    (1.0 1.0 2.0)
    (-0.5 -0.5 0.0)
    (-0.5 -0.5 2.0)
);

blocks
(
    hex (5 3 11 9 0 2 7 6) (40 40 21) simpleGrading (
1 1
(
 (0.3 0.4 4) (0.5 0.3 1) (0.2 0.3 0.25)
)
)
    hex (1 2 7 8 4 3 11 10) (20 40 21) simpleGrading (
1 1
(
 (0.2 0.3 4) (0.50 0.3 1) (0.30 0.4 0.25)
)
)
);
TagsNo tags attached.

Activities

henry

2015-08-02 09:33

manager   ~0005162

This may just be an issue with the tolerance used in the proximity test. Try using the "fastMerge" option in OpenFOAM-dev which uses a topological rather than geometric merge algorithm.

user1203

2015-08-02 19:31

  ~0005163

Last edited: 2015-08-02 19:37

Thank you for the suggestion. I tried the fastMerge option but unfortunately it did not help. The new error message is
"Point merge failure between face 1 of block 0 and face 1 of block 1
    This may be due to inconsistent grading.

    From function blockMesh::calcMergeInfoFast()
    in file blockMesh/blockMeshMergeFast.C at line 452."

I also tried to increase the sqrMergeTol in blockMeshMerge.C. I had to increase it 1000 times higher to run the blockMesh without errors. I attached two pictures. First one shows the mesh after increasing the tolerance with 21 cells in k-direction and the second one is without increasing the tolerance with 20 cells in k-direction. Maybe they will help to find the bug.

user1203

2015-08-02 19:31

 

multi-grading1.png (14,524 bytes)   
multi-grading1.png (14,524 bytes)   

user1203

2015-08-02 19:32

 

multi-grading2.png (12,442 bytes)   
multi-grading2.png (12,442 bytes)   

henry

2015-08-02 19:53

manager   ~0005164

In order to be able to reproduce the problem it would be useful to have the complete blockMeshDict file.

user1203

2015-08-02 20:07

 

blockMeshDict (1,426 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

fastMerge yes;

convertToMeters 1.0;

vertices
(
    (-0.5 0.5 0.0)
    (0.5 -0.5 0.0)
    (0.5 0.5 0.0)
    (1.0 1.0 0.0)
    (1.0 -1.0 0.0)
    (-1.0 1.0 0.0)
    (-0.5 0.5 2.0)
    (0.5 0.5 2.0)
    (0.5 -0.5 2.0)
    (-1.0 1.0 2.0)
    (1.0 -1.0 2.0)
    (1.0 1.0 2.0)
    (-0.5 -0.5 0.0)
    (-0.5 -0.5 2.0)
);

blocks
(
    hex (5 3 11 9 0 2 7 6)  (40 40 21) simpleGrading (
1 1
(
 (0.3 0.4 4) (0.5 0.3 1) (0.2 0.3 0.25)
)
)
    hex (1 2 7 8 4 3 11 10)  (20 40 21) simpleGrading (
1 1
(
 (0.2 0.3 4) (0.50 0.3 1)  (0.30 0.4 0.25)
)
)
);
patches
(
);
edges
(
);

mergePatchPairs
(
);
// ************************************************************************* //
blockMeshDict (1,426 bytes)   

user1203

2015-08-02 20:07

  ~0005165

I attached a complete dictionary.

henry

2015-08-02 22:16

manager   ~0005167

Resolved by commit 18ac24b2caf7aff3c43b1dae8b52f74da2705ed3 in OpenFOAM-dev

Could you test this update and if it resolves the issues you are having I will push the same change into OpenFOAM-2.4.x.

user1203

2015-08-03 19:38

  ~0005178

I made a few tests and it seems to work perfectly, thanks!

henry

2015-08-03 19:49

manager   ~0005179

There is still a potential issue if there is more than 1 section with the same largest division fraction, then the divions could still be ambiguous. A work-around is to always specify the sections such that there is only 1 with the largest division fraction. Alternatively I could change the code so that the total number of divisions could be automatically reduced by 1 to avoid the ambiguity. Currently I prefer the first option.

user1203

2015-08-04 10:08

  ~0005186

Seems like there is a similar bug when a polyline is defined to the multi-grading edge. I attached an example dictionary which gives the similar error:

Inconsistent point locations between block pair 0 and 1
    probably due to inconsistent grading.

If the polyLine is commented out, the blockMesh runs without errors.

user1203

2015-08-04 10:08

 

blockMeshDict_polyline (1,488 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1.0;

vertices
(
    (-1.0 -1.0 0.0)
    (1.0 -1.0 0.0)
    (-1.0 1.0 0.0)
    (1.0 1.0 0.0)
    (-0.5 0.5 0.0)
    (-0.5 -0.5 0.0)
    (0.5 -0.5 0.0)
    (0.5 0.5 0.0)
    (-0.5 -0.5 1)
    (-0.5 0.5 1)
    (-1.0 1.0 1)
    (-1.0 -1.0 1)
    (0.5 -0.5 1)
    (1.0 -1.0 1)
    (0.5 0.5 1)
    (1.0 1.0 1)
);
blocks
(
    hex (1 3 7 6 13 15 14 12)  (10 7 20) simpleGrading (
1 1
(
 (0.4 0.5 3.33333) (0.3 0.2 1) (0.3 0.3 0.3) 
)
)
    hex (10 15 14 9 2 3 7 4)  (10 7 20) simpleGrading (
1 1
(
 (0.3 0.3 3.33333) (0.3 0.2 1) (0.4 0.5 0.3) 
)
)
);

patches
(
);

edges
(
polyLine 3 15 ((1.0 1.0 0.0)(1.0 1.0 1))
);

mergePatchPairs
(
);

// ************************************************************************* //
blockMeshDict_polyline (1,488 bytes)   

henry

2015-08-04 10:18

manager   ~0005187

With polyLine and multi-grading do you see an issue irrespective of the section divisions or only with certain numbers?

user1203

2015-08-04 10:36

  ~0005188

That's right it's irrespective of the section divisions. Error occurs still only if the edge is defined in the opposite directions between the blocks.

henry

2015-08-04 10:41

manager   ~0005189

Could you also provide the blockMeshDict with the blocks defined with edges defined such that it works with polyLine and multi-grading? Thanks

user1203

2015-08-04 12:17

  ~0005190

I attached a blockMeshDict in which the polyLines does not crash the blockMesh. However, I just noticed that the polyLines somehow reverse the grading. I'm not sure if this is expected behaviour. I added two figures with and without the polylines.

user1203

2015-08-04 12:17

 

blockMeshDict_polyline2 (1,992 bytes)   
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant/polyMesh";
    object      meshMetaDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1.0;

vertices
(
    (-1.0 -1.0 0.0)
    (1.0 -1.0 0.0)
    (-1.0 1.0 0.0)
    (1.0 1.0 0.0)
    (-0.5 0.5 0.0)
    (0.5 -0.5 0.0)
    (0.5 0.5 0.0)
    (-0.5 -0.5 0.0)
    (-0.5 -0.5 1.0)
    (0.5 -0.5 1.0)
    (0.5 0.5 1.0)
    (-0.5 0.5 1.0)
    (-1.0 1.0 1.0)
    (-1.0 -1.0 1.0)
    (1.0 -1.0 1.0)
    (1.0 1.0 1.0)
);
blocks
(
    hex (13 12 11 8 0 2 4 7)  (10 7 20) simpleGrading (
1 1
(
 (0.7 0.7 3) (0 0 1) (0.3 0.3 0.33333) 
)
)
    hex (0 1 5 7 13 14 9 8)  (10 7 20) simpleGrading (
1 1
(
 (0.3 0.3 3) (0 0 1) (0.7 0.7 0.33333) 
)
)
    hex (1 3 6 5 14 15 10 9)  (10 7 20) simpleGrading (
1 1
(
 (0.3 0.3 3) (0 0 1) (0.7 0.7 0.33333) 
)
)
    hex (12 15 10 11 2 3 6 4)  (10 7 20) simpleGrading (
1 1
(
 (0.7 0.7 3) (0 0 1) (0.3 0.3 0.33333) 
)
)
    hex (11 10 9 8 4 6 5 7)  (10 10 20) simpleGrading (
1 1
(
 (0.7 0.7 3) (0 0 1) (0.3 0.3 0.33333) 
)
)
);

patches
(
);

edges
(
/*polyLine 0 13 ((-1.0 -1.0 0.0)(-1.0 -1.0 1.0))*/
/*polyLine 3 15 ((1.0 1.0 0.0)(1.0 1.0 1.0))*/
polyLine 1 14 ((1.0 -1.0 0.0)(1.0 -1.0 1.0))
polyLine 2 12 ((-1.0 1.0 0.0)(-1.0 1.0 1.0))
);

mergePatchPairs
(
);

// ************************************************************************* //
blockMeshDict_polyline2 (1,992 bytes)   

user1203

2015-08-04 12:17

 

withPolyline.png (4,354 bytes)   
withPolyline.png (4,354 bytes)   

user1203

2015-08-04 12:18

 

withoutPolyline.png (1,597 bytes)   
withoutPolyline.png (1,597 bytes)   

henry

2015-08-04 15:49

manager   ~0005193

If you use

edges
(
    polyLine 1 14 ((1.0 -1.0 0.0)(1.0 -1.0 1.0))
    polyLine 12 12 ((-1.0 1.0 1.0)(-1.0 1.0 0.0))
);

in system/blockMeshDict_polyline2 then the grading is as expected

user1203

2015-08-04 18:10

  ~0005194

Ok, thanks. So this is probably the reason why the multi-grading doesn't work on the edge which is defined in the opposite directions between the blocks, right? The direction is ambiguous and therefore one grading is as expected and the another is inverse.

henry

2015-08-04 19:36

manager   ~0005195

I have just pushed another update into OpenFOAM-dev:

commit 091a78d3167303bfb208f0effc81d85c2e11f083
Author: Henry Weller <http://cfd.direct>
Date: Tue Aug 4 19:34:24 2015 +0100

    blockMesh: Correct multi-grading support for polyLine

let me know if this resolves the remaining issue with polyLine and multi-grading.

user1203

2015-08-06 07:37

  ~0005200

I have now tested the multi-grading with polyLines and I have not encountered any errors with the latest update. Thank you!

henry

2015-08-06 09:49

manager   ~0005201

Thanks for the bug-report and useful test-cases. This is now resolved in OpenFOAM-dev and OpenFOAM-2.4.x:
commit dfcf5d948ebd8398a2097a0d75a2558c21677991

user1203

2015-08-27 23:27

  ~0005307

Unfortunately, the problem with multi-grading and "Inconsistent point locations between block pair" seems to exists still in some cases. I attached a sample blockMeshDict. With 32 cells in k direction the error occurs and with 64 it does not. The error is similar with blockMesh 2.4.x and dev with and without fastMerge option.

user1203

2015-08-27 23:28

 

blockMeshDict_inconsistent (772 bytes)   
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

convertToMeters 1.0;

vertices
(
(0.7414211  -0.35857844  2.)
(0.89948881 -0.79948878  2.)
(0.30051112 -0.20051119  2.)
(0.89948881 -0.20051119  2.)
(0.45857865 -0.35857856  3.)
(0.7414211  -0.35857844  3.)
(0.30051112 -0.20051119  3.)
(0.89948881 -0.20051119  3.)
(0.89948881 -0.79948878  3.)
(0.7414214  -0.64142132  3.)
(0.74142146 -0.64142138  2.)
(0.45857856 -0.35857856  2.)
);
blocks
(
hex (5 7 8 9 0 3 1 10)  (4 3 32) simpleGrading (
1 1
(
 (0.27 0.36 5) (0.46 0.28 1) (0.27 0.36 0.2) 
)
)
hex (0 3 2 11 5 7 6 4)  (4 3 32) simpleGrading (
1 1
(
 (0.27 0.36 5) (0.46 0.28 1) (0.27 0.36 0.2) 
)
)
);

patches
(
);

edges
(
);

mergePatchPairs
(
);

blockMeshDict_inconsistent (772 bytes)   

henry

2015-08-28 20:23

manager   ~0005311

You have hit the problem I mentioned earier:

There is still a potential issue if there is more than 1 section with the same largest division fraction, then the divions could still be ambiguous. A work-around is to always specify the sections such that there is only 1 with the largest division fraction. Alternatively I could change the code so that the total number of divisions could be automatically reduced by 1 to avoid the ambiguity. Currently I prefer the first option.

So this works:

hex (5 7 8 9 0 3 1 10) (1 1 10) simpleGrading (
1 1
(
    (0.27 0.36 5) (0.46 0.28 1) (0.27 0.37 0.2)
)
)
hex (0 3 2 11 5 7 6 4) (1 1 10) simpleGrading (
1 1
(
    (0.27 0.37 5) (0.46 0.28 1) (0.27 0.36 0.2)
)

Issue History

Date Modified Username Field Change
2015-08-02 08:15 user1203 New Issue
2015-08-02 09:33 henry Note Added: 0005162
2015-08-02 19:31 user1203 Note Added: 0005163
2015-08-02 19:31 user1203 File Added: multi-grading1.png
2015-08-02 19:32 user1203 File Added: multi-grading2.png
2015-08-02 19:36 user1203 Note Edited: 0005163
2015-08-02 19:37 user1203 Note Edited: 0005163
2015-08-02 19:53 henry Note Added: 0005164
2015-08-02 20:07 user1203 File Added: blockMeshDict
2015-08-02 20:07 user1203 Note Added: 0005165
2015-08-02 22:16 henry Note Added: 0005167
2015-08-03 19:38 user1203 Note Added: 0005178
2015-08-03 19:49 henry Note Added: 0005179
2015-08-04 10:08 user1203 Note Added: 0005186
2015-08-04 10:08 user1203 File Added: blockMeshDict_polyline
2015-08-04 10:18 henry Note Added: 0005187
2015-08-04 10:36 user1203 Note Added: 0005188
2015-08-04 10:41 henry Note Added: 0005189
2015-08-04 12:17 user1203 Note Added: 0005190
2015-08-04 12:17 user1203 File Added: blockMeshDict_polyline2
2015-08-04 12:17 user1203 File Added: withPolyline.png
2015-08-04 12:18 user1203 File Added: withoutPolyline.png
2015-08-04 15:49 henry Note Added: 0005193
2015-08-04 18:10 user1203 Note Added: 0005194
2015-08-04 19:36 henry Note Added: 0005195
2015-08-06 07:37 user1203 Note Added: 0005200
2015-08-06 09:49 henry Note Added: 0005201
2015-08-06 09:49 henry Status new => resolved
2015-08-06 09:49 henry Resolution open => fixed
2015-08-06 09:49 henry Assigned To => henry
2015-08-27 23:27 user1203 Note Added: 0005307
2015-08-27 23:27 user1203 Status resolved => feedback
2015-08-27 23:27 user1203 Resolution fixed => reopened
2015-08-27 23:28 user1203 File Added: blockMeshDict_inconsistent
2015-08-28 20:23 henry Note Added: 0005311
2015-08-28 20:24 henry Status feedback => resolved
2015-08-28 20:24 henry Resolution reopened => fixed