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

blockMesh cube inside a cube

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2014, 06:13
Default blockMesh cube inside a cube
  #1
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 11
Wien3 is on a distinguished road
Good Morning!
I am having problems when I create the mesh so I need some help.
My model consists in a cube inside another cube. From the inlet of the big one (5x2x2m) it will enter an incompressible flow which will go out through outlet. The second and smaller cube (0,4x0,4x0,4m) will receive the fluid while the fluid is passing by the big cube.

With this purpose I created a blockMeshDict. I think the big cube should be divided in 27 parts in order to make the mesh, as you can see in the draw (sorry for the horrible painting, I'm working with another computer).
So when I created the 64 needed vertex, and assigned everything I receive this message:

PHP Code:
--> FOAM FATAL ERROR
Trying to specify a boundary face 4(25 26 22 21on the face on cell 4 which is either an internal face or already belongs to some other patch.  This is face 0 of patch 6 named Cube.

    
From function polyMesh::setTopology
(
    const 
cellShapeListcellsAsShapes,
    const 
faceListListboundaryFaces,
    const 
wordListboundaryPatchNames,
    
labelListpatchSizes,
    
labelListpatchStarts,
    
labeldefaultPatchStart,
    
labelnFaces,
    
cellListcells
)
    
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 360.

FOAM aborting 
I attach also my blockMeshDict file. I have checked it 3 times and I don't see where the failure could be.
Anyway do you know if it exists another way to do this?

Thank you really much!
Attached Images
File Type: jpg draw.jpg (31.6 KB, 51 views)
Attached Files
File Type: zip blockMeshDict.zip (1.6 KB, 31 views)
Wien3 is offline   Reply With Quote

Old   November 21, 2014, 08:20
Default
  #2
Member
 
davide basso
Join Date: Jan 2012
Posts: 48
Rep Power: 14
rolloblues is on a distinguished road
Hi Wien,

maybe I didn't understand correctly your case but if the inner cube is just an obstacle to the flow you don't need to mesh it since it isn't part of the fluid domain.

In this case, I think, the blocks should be 26 instead of 27
rolloblues is offline   Reply With Quote

Old   November 21, 2014, 08:37
Default
  #3
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 11
Wien3 is on a distinguished road
Hello,
To be honest I don't know if I have to mesh it, because I want to analyse the influence of the fluid in the litte cube.
But, in any case, I deleted the corresponding hexaedron (hex (21 25 26 22 37 41 42 38) (4 4 4) simpleGrading (1 1 1)) but it appeared another error message:
PHP Code:
face 3 in patch 6 does not have neighbour cell face4(25 26 42 41)

    
From function polyMesh::facePatchFaceCells(const faceListpatchFaces,const labelListListpointCells,const faceListListcellsFaceShapes,const label patchID)
    
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 127.

FOAM aborting 
So I don't think that's the solution...
Any other ideas will be thanked!
Wien3 is offline   Reply With Quote

Old   November 21, 2014, 09:50
Default
  #4
Member
 
Pratik Nanavati
Join Date: May 2014
Location: Munich, Germany
Posts: 40
Rep Power: 11
nanavati is on a distinguished road
It looks like you are trying to investigate a flow in a channel/pipe with an obstacle in it.

is it the case ?

If Yes, then you should mesh the whole Domain leaving the internal Obstacle cube void.
nanavati is offline   Reply With Quote

Old   November 21, 2014, 10:27
Default
  #5
Member
 
davide basso
Join Date: Jan 2012
Posts: 48
Rep Power: 14
rolloblues is on a distinguished road
I couldn't find the error in your dict but I managed to mesh a similar case from scratch.

Attached you'll find the dictionary, hope this helps!
Attached Files
File Type: c blockMeshDict.c (5.7 KB, 67 views)

Last edited by rolloblues; November 25, 2014 at 07:55.
rolloblues is offline   Reply With Quote

Old   November 24, 2014, 03:23
Default
  #6
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 11
Wien3 is on a distinguished road
Hi nanavati,

Yes you are right, my problem is quite similar to fluid flowing along a pipe with an obstacle.

PHP Code:
If Yesthen you should mesh the whole Domain leaving the internal Obstacle cube void
What do you mean with void? The only way I know to do this is erasing the corresponding hexaedron (as I commented before), but it gave the problem I told about. I have been reading in other posts things about obstacles in models, but I don't really know how to adapt it in my case.
Would sb be so kind to detail a little bit more?

Thank you very much
Wien3 is offline   Reply With Quote

Old   November 24, 2014, 04:10
Default
  #7
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 11
Wien3 is on a distinguished road
Hi,
I erased that hexaedron and write the same x, y, z divisions for each hexaedron, in order to not have problems with common faces between two of them. After this changes it doesn't appear in the terminal any error when I write blockMesh, but when I do it with checkMesh this error appears:

PHP Code:
Create time

Create polyMesh 
for time 0

Time 
0

Mesh stats
    points
:           29062
    faces
:            81000
    internal faces
:   75000
    cells
:            26000
    faces per cell
:   6
    boundary patches
7
    point zones
:      0
    face zones
:       0
    cell zones
:       0

Overall number of cells of each type
:
    
hexahedra:     26000
    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(OK).

Checking patch topology for multiply connected surfaces...
    
Patch               Faces    Points   Surface topology                  
    Bottom              900      961      ok 
(non-closed singly connected)  
    
Top                 900      961      ok (non-closed singly connected)  
    
Back                900      961      ok (non-closed singly connected)  
    
Front               900      961      ok (non-closed singly connected)  
    
Inlet               900      961      ok (non-closed singly connected)  
    
Outlet              900      961      ok (non-closed singly connected)  
    
Cube                600      602      ok (closed singly connected)      

Checking geometry...
    
Overall domain bounding box (0 0 0) (5 2 2)
    
Mesh (non-empty, non-wedgedirections (1 1 1)
    
Mesh (non-empty) directions (1 1 1)
    
Boundary openness (1.50096e-17 -2.11924e-16 7.60625e-17OK.
 ***
High aspect ratio cells foundMax aspect ratio1.44e+198number of cells 26000
  
<<Writing 26000 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area 
0.0016Maximum face area 0.0184.  Face area magnitudes OK.
 ***
Zero or negative cell volume detected.  Minimum negative volume: -0.001472Number of negative volume cells26000
  
<<Writing 26000 zero volume cells to set zeroVolumeCells
    Mesh non
-orthogonality Max180 average180
 
***Number of non-orthogonality errors75000.
  
<<Writing 75000 non-orthogonal faces to set nonOrthoFaces
 
***Error in face pyramids156000 faces are incorrectly oriented.
  <<
Writing 81000 faces with incorrect orientation to set wrongOrientedFaces
    Max skewness 
1.95325e-11 OK.
    
Coupled point location match (average 0OK.

Failed 4 mesh checks.

End 
I guess it doesn't work because of those 4 failed mesh checks.
Any idea about where the failure could be now?
PHP Code:
convertToMeters 1;

vertices
(
    (
0 0 0//0
    
(2.3 0 0//1
    
(2.7 0 0//2
    
(5 0 0//3
    
(0 0.8 0//4
    
(2.3 0.8 0//5
    
(2.7 0.8 0//6
    
(5 0.8 0//7
    
(0 1.2 0//8
    
(2.3 1.2 0//9
    
(2.7 1.2 0//10
    
(5 1.2 0//11
    
(0 2 0//12
    
(2.3 2 0//13
    
(2.7 2 0//14
    
(5 2 0//15

    
(0 0 0.8//16
    
(2.3 0 0.8//17
    
(2.7 0 0.8//18
    
(5 0 0.8//19
    
(0 0.8 0.8//20
    
(2.3 0.8 0.8//21
    
(2.7 0.8 0.8//22
    
(5 0.8 0.8//23
    
(0 1.2 0.8//24
    
(2.3 1.2 0.8//25
    
(2.7 1.2 0.8//26
    
(5 1.2 0.8)//27
    
(0 2 0.8//28
    
(2.3 2 0.8//29
    
(2.7 2 0.8//30
    
(5 2 0.8//31
    
(0 0 1.2//32
    
(2.3 0 1.2//33
    
(2.7 0 1.2//34
    
(5 0 1.2//35
    
(0 0.8 1.2//36
    
(2.3 0.8 1.2//37
    
(2.7 0.8 1.2//38
    
(5 0.8 1.2//39
    
(0 1.2 1.2//40
    
(2.3 1.2 1.2//41
    
(2.7 1.2 1.2//42
    
(5 1.2 1.2//43
    
(0 2 1.2//44
    
(2.3 2 1.2//45
    
(2.7 2 1.2//46
    
(5 2 1.2//47

    
(0 0 2//48
    
(2.3 0 2//49
    
(2.7 0 2//50
    
(5 0 2//51
    
(0 0.8 2//52
    
(2.3 0.8 2//53
    
(2.7 0.8 2//54
    
(5 0.8 2//55
    
(0 1.2 2//56
    
(2.3 1.2 2//57
    
(2.7 1.2 2//58
    
(5 1.2 2//59
    
(0 2 2//60
    
(2.3 2 2//61
    
(2.7 2 2//62
    
(5 2 2//63
);

blocks
(
// 0 Floor
    
hex (0 4 5 1 16 20 21 17) (10 10 10simpleGrading (1 1 1)
    
hex (1 5 6 2 17 21 22 18) (10 10 10simpleGrading (1 1 1)
    
hex (2 6 7 3 18 22 23 19) (10 10 10simpleGrading (1 1 1)

    
hex (4 8 9 5 20 24 25 21) (10 10 10simpleGrading (1 1 1)
    
hex (5 9 10 6 21 25 26 22) (10 10 10simpleGrading (1 1 1)
    
hex (6 10 11 7 22 26 27 23) (10 10 10simpleGrading (1 1 1)

    
hex (8 12 13 9 24 28 29 25) (10 10 10simpleGrading (1 1 1)
    
hex (9 13 14 10 25 29 30 26) (10 10 10simpleGrading (1 1 1)
    
hex (10 14 15 11 26 30 31 27) (10 10 10simpleGrading (1 1 1)

// First Floor
    
hex (16 20 21 17 32 36 37 33) (10 10 10simpleGrading (1 1 1)
    
hex (17 21 22 18 33 37 38 34) (10 10 10simpleGrading (1 1 1)
    
hex (18 22 23 19 34 38 39 35) (10 10 10simpleGrading (1 1 1)

    
hex (20 24 25 21 36 40 41 37) (10 10 10simpleGrading (1 1 1)

    
hex (22 26 27 23 38 42 43 39) (10 10 10simpleGrading (1 1 1)

    
hex (24 28 29 25 40 44 45 41) (10 10 10simpleGrading (1 1 1)
    
hex (25 29 30 26 41 45 46 42) (10 10 10simpleGrading (1 1 1)
    
hex (26 30 31 27 42 46 47 43) (10 10 10simpleGrading (1 1 1)

// Second Floor
    
hex (32 36 37 33 48 52 53 49) (10 10 10simpleGrading (1 1 1)
    
hex (33 37 38 34 49 53 54 50) (10 10 10simpleGrading (1 1 1)
    
hex (34 38 39 35 50 54 55 51) (10 10 10simpleGrading (1 1 1)

    
hex (36 40 41 37 52 56 57 53) (10 10 10simpleGrading (1 1 1)
    
hex (37 41 42 38 53 57 58 54) (10 10 10simpleGrading (1 1 1)
    
hex (38 42 43 39 54 58 59 55) (10 10 10simpleGrading (1 1 1)

    
hex (40 44 45 41 56 60 61 57) (10 10 10simpleGrading (1 1 1)
    
hex (41 45 46 42 57 61 62 58) (10 10 10simpleGrading (1 1 1)
    
hex (42 46 47 43 58 62 63 59) (10 10 10simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    
Bottom
    
{
        
type wall;
        
faces
        
(
            (
4 5 1 0)
        (
5 6 2 1)
            (
6 7 3 2)
            (
8 9 5 4)
            (
9 10 6 5)
            (
10 11 7 6)
            (
12 13 9 8)
            (
13 14 10 9)
            (
14 15 11 10)
      );
    }
    
Top
    
{
        
type wall;
        
faces
        
(
            (
52 53 49 48)
            (
53 54 50 49)
            (
54 55 51 50)
            (
56 57 53 52)
            (
57 58 54 53)
            (
58 59 55 54)
            (
60 61 57 56)
            (
61 62 58 57)
            (
62 63 59 58)
      );
    }

   
Back
    
{
        
type wall;
        
faces
        
(
            (
32 33 49 48)
            (
33 34 50 49)
            (
34 35 51 50)
            (
16 17 33 32)
            (
17 18 34 33)
            (
18 19 35 34)
            (
0 1 17 16)
            (
1 2 18 17)
            (
2 3 19 18)
        );
    }

    
Front
    
{
        
type wall;
        
faces
        
(
            (
44 45 61 60)
        (
45 46 62 61)
            (
46 47 63 62)
            (
28 29 45 44)
            (
29 30 46 45)
            (
30 31 47 46)
            (
12 13 29 28)
            (
13 14 30 29)
            (
14 15 31 30)
        );
    }

    
Inlet
    
{
        
type patch;
        
faces
        
(
            (
0 4 20 16)
        (
4 8 24 20)
            (
8 12 28 24)
            (
16 20 36 32)
            (
20 24 40 36)
            (
24 28 44 40)
            (
32 36 52 48)
            (
36 40 56 52)
            (
40 44 60 56)
        );
    }

    
Outlet
    
{
        
type patch;
        
faces
        
(
            (
3 7 23 19)
        (
7 11 27 23)
            (
11 15 31 27)
            (
19 23 39 35)
            (
23 27 43 39)
            (
27 31 47 43)
            (
35 39 55 51)
            (
39 43 59 55)
            (
43 47 63 59)
        );
    }

    
Cube
    
{
        
type wall;
        
faces
        
(
            (
25 26 22 21)
            (
41 42 38 37)
            (
21 22 38 37)
            (
25 26 42 41)
            (
21 25 41 37)
            (
22 26 42 38)
        );
    }

);

mergePatchPairs
(
); 
Thanks in advance!
Wien3 is offline   Reply With Quote

Old   November 25, 2014, 05:42
Default
  #8
Member
 
Join Date: Oct 2014
Posts: 42
Rep Power: 11
Wien3 is on a distinguished road
Hi!
At the end I achieved it! Th solution was to change the orientation of every single face: I had input them as anti-clockwise and after writing as clockwise it worked fine!

Thank you anyway
Wien3 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
Explosion inside a cube - blockMesh shangzung OpenFOAM 3 March 6, 2013 03:59
Gambit help: Cube inside cube Jack Martinez FLUENT 13 August 11, 2010 06:29
Cube rotating inside a tank Shubhu Main CFD Forum 1 April 30, 2010 23:16
Setting up: Cube, 2 holes, high pressure inside shangzung OpenFOAM 0 October 30, 2009 11:27
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 06:24.