CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

meshing a cylinder

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2011, 11:17
Default meshing a cylinder
  #1
New Member
 
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 5
Nico A. is on a distinguished road
Hello at all,

my problem is the following: i want to simulate the flow around a cylinder. therefore i used the blockMeshDict of an openfoam tutorial ( /basic/potentialFoam/cylinder). i tried to create a full cylinder out of the existing mesh. this is what i tried for my blockMeshDict:

Code:
vertices        
(
    (0.5 0 -0.5)		//0
    (1 0 -0.5)			//1
    (2 0 -0.5)			//2
    (2 0.707107 -0.5)		//3
    (0.707107 0.707107 -0.5)	//4
    (0.353553 0.353553 -0.5)	//5
    (2 2 -0.5)			//6
    (0.707107 2 -0.5)		//7
    (0 2 -0.5)			//8
    (0 1 -0.5)			//9
    (0 0.5 -0.5)		//10
    (-0.5 0 -0.5)		//11
    (-1 0 -0.5)			//12
    (-2 0 -0.5)			//13
    (-2 0.707107 -0.5)		//14
    (-0.707107 0.707107 -0.5)	//15
    (-0.353553 0.353553 -0.5)	//16
    (-2 2 -0.5)			//17
    (-0.707107 2 -0.5)		//18
    (0.5 0 0.5)			//19
    (1 0 0.5)			//20
    (2 0 0.5)			//21
    (2 0.707107 0.5)		//22
    (0.707107 0.707107 0.5)	//23
    (0.353553 0.353553 0.5)	//24
    (2 2 0.5)			//25
    (0.707107 2 0.5)		//26
    (0 2 0.5)			//27
    (0 1 0.5)			//28
    (0 0.5 0.5)			//29
    (-0.5 0 0.5)		//30
    (-1 0 0.5)			//31
    (-2 0 0.5)			//32
    (-2 0.707107 0.5)		//33
    (-0.707107 0.707107 0.5)	//34
    (-0.353553 0.353553 0.5)	//35
    (-2 2 0.5)			//36
    (-0.707107 2 0.5)		//37
    (2 -0.707107 -0.5)		//38
    (0.707107 -0.707107 -0.5)	//39
    (0.353553 -0.353553 -0.5)	//40
    (2 -2 -0.5)			//41
    (0.707107 -2 -0.5)		//42
    (0 -2 -0.5)			//43
    (0 -1 -0.5)			//44
    (0 -0.5 -0.5)		//45	
    (-2 -0.707107 -0.5)		//46
    (-0.707107 -0.707107 -0.5)	//47
    (-0.353553 -0.353553 -0.5)	//48
    (-2 -2 -0.5)		//49
    (-0.707107 -2 -0.5)		//50	
    (2 -0.707107 0.5)		//51
    (0.707107 -0.707107 0.5)	//52
    (0.353553 -0.353553 0.5)	//53	
    (2 -2 0.5)			//54
    (0.707107 -2 0.5)		//55
    (0 -2 0.5)			//56
    (0 -1 0.5)			//57
    (0 -0.5 0.5)		//58
    (-2 -0.707107 0.5)		//59
    (-0.707107 -0.707107 0.5)	//60
    (-0.353553 -0.353553 0.5)	//61
    (-2 -2 0.5)			//62
    (-0.707107 -2 0.5)  	//63
);

blocks          
(
    hex (5 4 9 10 24 23 28 29) (10 10 1) simpleGrading (1 1 1)
    hex (0 1 4 5 19 20 23 24) (10 10 1) simpleGrading (1 1 1)
    hex (1 2 3 4 20 21 22 23) (20 10 1) simpleGrading (1 1 1)
    hex (4 3 6 7 23 22 25 26) (20 20 1) simpleGrading (1 1 1)
    hex (9 4 7 8 28 23 26 27) (10 20 1) simpleGrading (1 1 1)
    hex (15 16 10 9 34 35 29 28) (10 10 1) simpleGrading (1 1 1)
    hex (12 11 16 15 31 30 35 34) (10 10 1) simpleGrading (1 1 1)
    hex (13 12 15 14 32 31 34 33) (20 10 1) simpleGrading (1 1 1)
    hex (14 15 18 17 33 34 37 36) (20 20 1) simpleGrading (1 1 1)
    hex (15 9 8 18 34 28 27 37) (10 20 1) simpleGrading (1 1 1)
    hex (40 39 44 45 53 52 57 58) (10 10 1) simpleGrading (1 1 1)
    hex (0 1 39 40 19 20 52 53) (10 10 1) simpleGrading (1 1 1)
    hex (1 2 38 39 20 21 51 52) (20 10 1) simpleGrading (1 1 1)
    hex (39 38 41 42 52 51 54 55) (20 20 1) simpleGrading (1 1 1)
    hex (44 39 42 43 57 52 55 56) (10 20 1) simpleGrading (1 1 1)
    hex (47 48 45 44 60 61 58 57) (10 10 1) simpleGrading (1 1 1)
    hex (12 11 48 47 31 30 61 60) (10 10 1) simpleGrading (1 1 1)
    hex (13 12 47 46 32 31 60 59) (20 10 1) simpleGrading (1 1 1)
    hex (46 47 50 49 59 60 63 62) (20 20 1) simpleGrading (1 1 1)
    hex (47 44 43 50 60 57 56 63) (10 20 1) simpleGrading (1 1 1)
);

edges           
(
    arc 0 5 (0.469846 0.17101 -0.5)
    arc 5 10 (0.17101 0.469846 -0.5)
    arc 1 4 (0.939693 0.34202 -0.5)
    arc 4 9 (0.34202 0.939693 -0.5)
    arc 19 24 (0.469846 0.17101 0.5)
    arc 24 29 (0.17101 0.469846 0.5)
    arc 20 23 (0.939693 0.34202 0.5)
    arc 23 28 (0.34202 0.939693 0.5)
    arc 11 16 (-0.469846 0.17101 -0.5)
    arc 16 10 (-0.17101 0.469846 -0.5)
    arc 12 15 (-0.939693 0.34202 -0.5)
    arc 15 9 (-0.34202 0.939693 -0.5)
    arc 30 35 (-0.469846 0.17101 0.5)
    arc 35 29 (-0.17101 0.469846 0.5)
    arc 31 34 (-0.939693 0.34202 0.5)
    arc 34 28 (-0.34202 0.939693 0.5)
    arc 0 40 (0.469846 -0.17101 -0.5)
    arc 40 45 (0.17101 -0.469846 -0.5)
    arc 1 39 (0.939693 -0.34202 -0.5)
    arc 39 44 (0.34202 -0.939693 -0.5)
    arc 19 53 (0.469846 -0.17101 0.5)
    arc 53 58 (0.17101 -0.469846 0.5)
    arc 20 52 (0.939693 -0.34202 0.5)
    arc 52 57 (0.34202 -0.939693 0.5)
    arc 11 48 (-0.469846 -0.17101 -0.5)
    arc 48 45 (-0.17101 -0.469846 -0.5)
    arc 12 47 (-0.939693 -0.34202 -0.5)
    arc 47 44 (-0.34202 -0.939693 -0.5)
    arc 30 61 (-0.469846 -0.17101 0.5)
    arc 61 58 (-0.17101 -0.469846 0.5)
    arc 31 60 (-0.939693 -0.34202 0.5)
    arc 60 57 (-0.34202 -0.939693 0.5)
);

patches         
(
    symmetryPlane down 
    (
        (42 43 56 55)
        (41 42 55 54)
        (43 50 63 56)
        (50 49 62 63)
    )
    patch right 
    (
        (2 3 22 21)
        (3 6 25 22)
        (2 38 51 21)
        (38 41 54 51)
    )
    symmetryPlane up 
    (
        (7 8 27 26)
        (6 7 26 25)
        (8 18 37 27)
        (18 17 36 37)
    )
    patch left 
    (
        (14 13 32 33)
        (17 14 33 36)
        (46 13 32 59)
        (49 46 59 62)
    )
    symmetryPlane cylinder 
    (
        (10 5 24 29)
        (5 0 19 24)
        (16 10 29 35)
        (11 16 35 30)
        (45 40 53 58)
        (40 0 19 53)
        (48 45 58 61)
        (11 48 61 30)
    )
);

mergePatchPairs
(
);

// ************************************************************************* //
when creating the block mesh topology, i get multiple warnings like:
Code:
zero or negative pyramid volume: -0.0441942 for face 3
and
Code:
From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 10, probably defined inside-out
I dont know what it means and how to solve that problem.

with kind regards!
Nico A. is offline   Reply With Quote

Old   April 7, 2011, 13:39
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 10
MartinB is on a distinguished road
Hi Nico,

there are some problems with the numbers order in block 12 up to 19.

Here is the correction:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices        
(
    (0.5 0 -0.5)		//0
    (1 0 -0.5)			//1
    (2 0 -0.5)			//2
    (2 0.707107 -0.5)		//3
    (0.707107 0.707107 -0.5)	//4
    (0.353553 0.353553 -0.5)	//5
    (2 2 -0.5)			//6
    (0.707107 2 -0.5)		//7
    (0 2 -0.5)			//8
    (0 1 -0.5)			//9
    (0 0.5 -0.5)		//10
    (-0.5 0 -0.5)		//11
    (-1 0 -0.5)			//12
    (-2 0 -0.5)			//13
    (-2 0.707107 -0.5)		//14
    (-0.707107 0.707107 -0.5)	//15
    (-0.353553 0.353553 -0.5)	//16
    (-2 2 -0.5)			//17
    (-0.707107 2 -0.5)		//18
    (0.5 0 0.5)			//19
    (1 0 0.5)			//20
    (2 0 0.5)			//21
    (2 0.707107 0.5)		//22
    (0.707107 0.707107 0.5)	//23
    (0.353553 0.353553 0.5)	//24
    (2 2 0.5)			//25
    (0.707107 2 0.5)		//26
    (0 2 0.5)			//27
    (0 1 0.5)			//28
    (0 0.5 0.5)			//29
    (-0.5 0 0.5)		//30
    (-1 0 0.5)			//31
    (-2 0 0.5)			//32
    (-2 0.707107 0.5)		//33
    (-0.707107 0.707107 0.5)	//34
    (-0.353553 0.353553 0.5)	//35
    (-2 2 0.5)			//36
    (-0.707107 2 0.5)		//37
    (2 -0.707107 -0.5)		//38
    (0.707107 -0.707107 -0.5)	//39
    (0.353553 -0.353553 -0.5)	//40
    (2 -2 -0.5)			//41
    (0.707107 -2 -0.5)		//42
    (0 -2 -0.5)			//43
    (0 -1 -0.5)			//44
    (0 -0.5 -0.5)		//45	
    (-2 -0.707107 -0.5)		//46
    (-0.707107 -0.707107 -0.5)	//47
    (-0.353553 -0.353553 -0.5)	//48
    (-2 -2 -0.5)		//49
    (-0.707107 -2 -0.5)		//50	
    (2 -0.707107 0.5)		//51
    (0.707107 -0.707107 0.5)	//52
    (0.353553 -0.353553 0.5)	//53	
    (2 -2 0.5)			//54
    (0.707107 -2 0.5)		//55
    (0 -2 0.5)			//56
    (0 -1 0.5)			//57
    (0 -0.5 0.5)		//58
    (-2 -0.707107 0.5)		//59
    (-0.707107 -0.707107 0.5)	//60
    (-0.353553 -0.353553 0.5)	//61
    (-2 -2 0.5)			//62
    (-0.707107 -2 0.5)  	//63
);

blocks          
(
    hex (5 4 9 10 24 23 28 29) (10 10 1) simpleGrading (1 1 1) // 0
    hex (0 1 4 5 19 20 23 24) (10 10 1) simpleGrading (1 1 1)
    hex (1 2 3 4 20 21 22 23) (20 10 1) simpleGrading (1 1 1) // 2
    hex (4 3 6 7 23 22 25 26) (20 20 1) simpleGrading (1 1 1)
    hex (9 4 7 8 28 23 26 27) (10 20 1) simpleGrading (1 1 1)
    hex (15 16 10 9 34 35 29 28) (10 10 1) simpleGrading (1 1 1)
    hex (12 11 16 15 31 30 35 34) (10 10 1) simpleGrading (1 1 1)
    hex (13 12 15 14 32 31 34 33) (20 10 1) simpleGrading (1 1 1)
    hex (14 15 18 17 33 34 37 36) (20 20 1) simpleGrading (1 1 1)
    hex (15 9 8 18 34 28 27 37) (10 20 1) simpleGrading (1 1 1)
    hex (44 39 40 45 57 52 53 58) (10 10 1) simpleGrading (1 1 1)
    hex (39 1 0 40 52 20 19 53) (10 10 1) simpleGrading (1 1 1)
    hex (38 2 1 39 51 21 20 52) (10 20 1) simpleGrading (1 1 1) // 12
    hex (42 41 38 39 55 54 51 52) (20 20 1) simpleGrading (1 1 1)
    hex (43 42 39 44 56 55 52 57) (10 20 1) simpleGrading (1 1 1)
    hex (47 44 45 48 60 57 58 61) (10 10 1) simpleGrading (1 1 1)
    hex (12 47 48 11 31 60 61 30) (10 10 1) simpleGrading (1 1 1)
    hex (13 46 47 12 32 59 60 31) (10 20 1) simpleGrading (1 1 1) // 17
    hex (49 50 47 46 62 63 60 59) (20 20 1) simpleGrading (1 1 1)
    hex (50 43 44 47 63 56 57 60) (10 20 1) simpleGrading (1 1 1)
);

edges           
(
    arc 0 5 (0.469846 0.17101 -0.5)
    arc 5 10 (0.17101 0.469846 -0.5)
    arc 1 4 (0.939693 0.34202 -0.5)
    arc 4 9 (0.34202 0.939693 -0.5)
    arc 19 24 (0.469846 0.17101 0.5)
    arc 24 29 (0.17101 0.469846 0.5)
    arc 20 23 (0.939693 0.34202 0.5)
    arc 23 28 (0.34202 0.939693 0.5)
    arc 11 16 (-0.469846 0.17101 -0.5)
    arc 16 10 (-0.17101 0.469846 -0.5)
    arc 12 15 (-0.939693 0.34202 -0.5)
    arc 15 9 (-0.34202 0.939693 -0.5)
    arc 30 35 (-0.469846 0.17101 0.5)
    arc 35 29 (-0.17101 0.469846 0.5)
    arc 31 34 (-0.939693 0.34202 0.5)
    arc 34 28 (-0.34202 0.939693 0.5)
    arc 0 40 (0.469846 -0.17101 -0.5)
    arc 40 45 (0.17101 -0.469846 -0.5)
    arc 1 39 (0.939693 -0.34202 -0.5)
    arc 39 44 (0.34202 -0.939693 -0.5)
    arc 19 53 (0.469846 -0.17101 0.5)
    arc 53 58 (0.17101 -0.469846 0.5)
    arc 20 52 (0.939693 -0.34202 0.5)
    arc 52 57 (0.34202 -0.939693 0.5)
    arc 11 48 (-0.469846 -0.17101 -0.5)
    arc 48 45 (-0.17101 -0.469846 -0.5)
    arc 12 47 (-0.939693 -0.34202 -0.5)
    arc 47 44 (-0.34202 -0.939693 -0.5)
    arc 30 61 (-0.469846 -0.17101 0.5)
    arc 61 58 (-0.17101 -0.469846 0.5)
    arc 31 60 (-0.939693 -0.34202 0.5)
    arc 60 57 (-0.34202 -0.939693 0.5)
);

patches         
(
    symmetryPlane down 
    (
        (42 43 56 55)
        (41 42 55 54)
        (43 50 63 56)
        (50 49 62 63)
    )
    patch right 
    (
        (2 3 22 21)
        (3 6 25 22)
        (2 38 51 21)
        (38 41 54 51)
    )
    symmetryPlane up 
    (
        (7 8 27 26)
        (6 7 26 25)
        (8 18 37 27)
        (18 17 36 37)
    )
    patch left 
    (
        (14 13 32 33)
        (17 14 33 36)
        (46 13 32 59)
        (49 46 59 62)
    )
    symmetryPlane cylinder 
    (
        (10 5 24 29)
        (5 0 19 24)
        (16 10 29 35)
        (11 16 35 30)
        (45 40 53 58)
        (40 0 19 53)
        (48 45 58 61)
        (11 48 61 30)
    )
);

mergePatchPairs
(
);

// ************************************************************************* //
Have fun

Martin
MartinB is offline   Reply With Quote

Old   April 8, 2011, 04:26
Default
  #3
New Member
 
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 5
Nico A. is on a distinguished road
Hi Martin,

thanks for your quick reply. Everything works now ( of course :-) )
I am just getting used to OpenFoam.

Greets Nico
Nico A. is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2D planar cylinder meshing problem saisanthoshm88 ANSYS Meshing & Geometry 15 December 27, 2010 11:14
[ICEM] (ICEM CFD) meshing over a cylinder vmlxb6 ANSYS Meshing & Geometry 6 August 11, 2010 14:37
Meshing a circle (cylinder) bunni OpenFOAM 11 May 31, 2010 10:11
Meshing inside a cylinder so that the edges contain more cells than the center Bertrand OpenFOAM Native Meshers: blockMesh 1 April 13, 2010 04:46
Best Meshing scheme for Cylinder Nutrex Main CFD Forum 4 July 29, 2008 11:03


All times are GMT -4. The time now is 04:08.