CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   square cylinder obstacle (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/102241-square-cylinder-obstacle.html)

 fferroni May 25, 2012 19:01

square cylinder obstacle

Hello

I am trying to make a blockMeshDict file for a 2D square cylinder obstacle (viewed from above), to show vortex shedding. I need it without centerline symmetry. Perhaps someone already has one, and would kindly share?

I have tried making it but I've just started openFOAM so I still don't have the hang of blockMesh. I get:

Check topology

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

Creating block offsets
Creating merge list

--> FOAM FATAL ERROR:
Inconsistent number of faces between block pair 0 and 4

From function blockMesh::calcMergeInfo()
in file blockMesh/blockMeshMerge.C at line 221.

FOAM exiting

In my drawing, blocks 0 and 4 share 1 face, but I never specified in the boundaries since it was an internal face.

My square is a 1x1, with 2L on either side, 2L in front and 12L behind.

Can anyone shed some light please? It's Friday night and I'm stuck here trying to figure what I'm doing wrong :confused:

-------------
convertToMeters 0.001;

vertices
(
(0 0 -0.5)
(2 0 -0.5)
(3 0 -0.5)
(15 0 -0.5)
(15 2 -0.5)
(15 3 -0.5)
(15 5 -0.5)
(3 5 -0.5)
(2 5 -0.5)
(0 5 -0.5)
(0 3 -0.5)
(0 2 -0.5)
(2 2 -0.5)
(3 2 -0.5)
(3 3 -0.5)
(2 3 -0.5)

(0 0 0.5)
(2 0 0.5)
(3 0 0.5)
(15 0 0.5)
(15 2 0.5)
(15 3 0.5)
(15 5 0.5)
(3 5 0.5)
(2 5 0.5)
(0 5 0.5)
(0 3 0.5)
(0 2 0.5)
(2 2 0.5)
(3 2 0.5)
(3 3 0.5)
(2 3 0.5)
);

blocks
(
hex (0 1 12 11 16 17 28 27) (10 10 1) simpleGrading (1 1 1)
hex (11 12 15 10 27 28 31 26) (10 10 1) simpleGrading (1 1 1)
hex (10 15 8 9 26 31 24 25) (20 15 1) simpleGrading (1 1 1)
hex (15 14 7 8 31 30 23 24) (20 15 1) simpleGrading (1 1 1)
hex (1 2 13 12 17 18 29 28) (20 15 1) simpleGrading (1 1 1)
hex (14 5 6 7 30 21 22 23) (20 15 1) simpleGrading (1 1 1)
hex (13 4 5 14 29 20 21 30) (20 15 1) simpleGrading (1 1 1)
hex (2 3 4 13 18 19 20 29) (20 15 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
pressure-outlet
{
type patch;
faces
(
(3 4 20 19)
(4 5 21 20)
(5 6 22 21)
);
}

velocity-inlet
{
type patch;
faces
(
(11 0 16 27)
(10 11 27 26)
(9 10 26 25)
);
}

wall-upper
{
type wall;
faces
(
(6 7 23 22)
(7 8 24 23)
(8 9 25 24)
);
}

wall-lower
{
type wall;
faces
(
(0 1 17 16)
(1 2 18 17)
(2 3 19 18)

);
}

obstacle-front
{
type wall;
faces
(
(15 12 28 31)
(14 15 31 30)
(12 13 29 28)
(13 14 30 29)
);
}

);

mergePatchPairs
(
);

 lovecraft22 May 26, 2012 04:26

Hi;
the error is quite clear: you defined two adjacent blocks with different number of cells on their common face.

In you case the face is that one between block #0 and block #4 which are:

hex (0 1 12 11 16 17 28 27) (10 10 1) simpleGrading (1 1 1)
hex (15 14 7 8 31 30 23 24) (20 15 1) simpleGrading (1 1 1)

they share a face parallel to the Y axis, if you see though they have a different number of cells along that direction: 10 for block 0 and 15 for block 4.
Since also block 7 has 15 division along the Y direction, changing block 1 to this may solve your problem:

Code:

`hex (0 1 12 11 16 17 28 27) (10 15 1) simpleGrading (1 1 1)`

 fferroni May 26, 2012 04:48

Aaaah... ok! :D

I now understand what the error means. I didn't know you had to match the block divisions at interfaces (although it's logical you would need to...)

There were other ones that were not matched, but I got it working

Thank you!!!

Fran

 All times are GMT -4. The time now is 11:00.