/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: http://www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

dnl changecom(//)
changequote([,])
define(LPAREN,[(])dnl
define(RPAREN,[)])dnl
dnl
define(calc, [esyscmd(perl -e 'printf ($1)')])dnl
dnl
define(pip180, 0.017453)
define(cos45, 0.70711)
dnl *********USER***********
dnl === POINTS ===
define(zLength, 1)dnl
define(coreWidth, 8)dnl
define(diameter, 30)dnl
define(rectangleWidth, 50)dnl
define(cornerStretch, 0.77)dnl
define(arcStretch, 1.07)dnl
dnl === CELL COUNT ===
define(coreCount, 10)dnl
define(rectangleCount, 20)dnl
define(zCount, 1)dnl
dnl ===BOUNDING RECTANGLE?===
define(boundRect, 1)dnl
dnl =========================

dnl *******CALCULATED********
define(radius, calc(0.5*diameter))dnl
define(halfCoreWidth, calc(0.5*coreWidth))dnl
define(halfRectangleWidth, calc(0.5*rectangleWidth))dnl
define(negHalfCoreWidth, calc(-1*halfCoreWidth))dnl
define(halfCoreCorner, calc(cornerStretch*halfCoreWidth*2))dnl
define(negHalfCoreCorner, calc(-1*halfCoreCorner))dnl
define(negRadius, calc(-1*radius))dnl
define(cornerRadius, calc(sqrt(2)*radius/2))dnl
define(negCornerRadius, calc(-1*cornerRadius))dnl
define(negHalfRectangleWidth, calc(-1*halfRectangleWidth))dnl
dnl =========================
dnl === ARC POINTS ===
dnl define(coreArchLong, calc(0.67*halfCoreWidth))dnl
define(coreArchLong, calc(1.001*arcStretch*(halfCoreWidth+halfCoreCorner*0.5-halfCoreWidth*0.5)))dnl
define(negCoreArchLong, calc(-1*coreArchLong))dnl
define(coreArchShort, calc(halfCoreWidth/2))dnl
define(negCoreArchShort, calc(-1*coreArchShort))dnl
define(radiusArchLong, calc(cos(22.5*pip180)*radius))dnl
define(negRadiusArchLong, calc(-1*radiusArchLong))dnl
define(radiusArchShort, calc(sin(22.5*pip180)*radius))dnl
define(negRadiusArchShort, calc(-1*radiusArchShort))dnl
dnl =========================
dnl
define(zCount, 1)dnl

vertices
(
( 0 0 0 ) //0
( 0 0 zLength ) //1
( halfCoreCorner 0 0 ) //2
( halfCoreCorner 0 zLength ) //3
( 0 halfCoreCorner 0 ) //4
( 0 halfCoreCorner zLength ) //5
( negHalfCoreCorner 0 0 ) //6
( negHalfCoreCorner 0 zLength ) //7
( 0 negHalfCoreCorner 0 ) //8
( 0 negHalfCoreCorner zLength ) //9
( halfCoreWidth halfCoreWidth 0 ) //10
( halfCoreWidth halfCoreWidth zLength ) //11
( negHalfCoreWidth halfCoreWidth 0 ) //12
( negHalfCoreWidth halfCoreWidth zLength ) //13
( negHalfCoreWidth negHalfCoreWidth 0 ) //14
( negHalfCoreWidth negHalfCoreWidth zLength ) //15
( halfCoreWidth negHalfCoreWidth 0 ) //16
( halfCoreWidth negHalfCoreWidth zLength ) //17
( radius 0 0 ) //18
( radius 0 zLength ) //19
( 0 radius 0 ) //20
( 0 radius zLength ) //21
( negRadius 0 0 ) //22
( negRadius 0 zLength ) //23
( 0 negRadius 0 ) //24
( 0 negRadius zLength ) //25
( cornerRadius cornerRadius 0 ) //26
( cornerRadius cornerRadius zLength ) //27
( negCornerRadius cornerRadius 0 ) //28
( negCornerRadius cornerRadius zLength ) //29
( negCornerRadius negCornerRadius 0 ) //30
( negCornerRadius negCornerRadius zLength ) //31
( cornerRadius negCornerRadius 0 ) //32
( cornerRadius negCornerRadius zLength ) //33
( halfRectangleWidth 0 0 ) //34
( halfRectangleWidth 0 zLength ) //35
( 0 halfRectangleWidth 0 ) //36
( 0 halfRectangleWidth zLength ) //37
( negHalfRectangleWidth 0 0 ) //38
( negHalfRectangleWidth 0 zLength ) //39
( 0 negHalfRectangleWidth 0 ) //40
( 0 negHalfRectangleWidth zLength ) //41
( halfRectangleWidth halfRectangleWidth 0 ) //42
( halfRectangleWidth halfRectangleWidth zLength ) //43
( negHalfRectangleWidth halfRectangleWidth 0 ) //44
( negHalfRectangleWidth halfRectangleWidth zLength ) //45
( negHalfRectangleWidth negHalfRectangleWidth 0 ) //46
( negHalfRectangleWidth negHalfRectangleWidth zLength ) //47
( halfRectangleWidth negHalfRectangleWidth 0 ) //48
( halfRectangleWidth negHalfRectangleWidth zLength ) //49
);

blocks
LPAREN
hex (2 10 0 16 3 11 1 17) (coreCount coreCount zCount) simpleGrading (1 1 1) //1
hex (10 4 12 0 11 5 13 1) (coreCount coreCount zCount) simpleGrading (1 1 1) //2
hex (12 6 14 0 13 7 15 1) (coreCount coreCount zCount) simpleGrading (1 1 1) //3
hex (14 8 16 0 15 9 17 1) (coreCount coreCount zCount) simpleGrading (1 1 1) //4
hex (18 26 10 2 19 27 11 3) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //5
hex (26 20 4 10 27 21 5 11) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //6
hex (20 28 12 4 21 29 13 5) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //7
hex (28 22 6 12 29 23 7 13) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //8
hex (22 30 14 6 23 31 15 7) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //9
hex (30 24 8 14 31 25 9 15) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //10
hex (24 32 16 8 25 33 17 9) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //11
hex (32 18 2 16 33 19 3 17) (coreCount rectangleCount zCount) simpleGrading (1 1 1) //12
dnl ===bounding rectangles===
define(bRect13,[ ]hex LPAREN 34 42 26 18 35 43 27 19 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //13)dnl
ifelse(boundRect,1,bRect13,)
define(bRect14,[ ]hex LPAREN 42 36 20 26 43 37 21 27 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //14 )dnl
ifelse(boundRect,1,bRect14,)
define(bRect15,[ ]hex LPAREN 36 44 28 20 37 45 29 21 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //15 )dnl
ifelse(boundRect,1,bRect15,)
define(bRect16,[ ]hex LPAREN 44 38 22 28 45 39 23 29 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //16 )dnl
ifelse(boundRect,1,bRect16,)
define(bRect17,[ ]hex LPAREN 38 46 30 22 39 47 31 23 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //17 )dnl
ifelse(boundRect,1,bRect17,)
define(bRect18,[ ]hex LPAREN 46 40 24 30 47 41 25 31 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //18 )dnl
ifelse(boundRect,1,bRect18,)
define(bRect19,[ ]hex LPAREN 40 48 32 24 41 49 33 25 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //19 )dnl
ifelse(boundRect,1,bRect19,)
define(bRect20,[ ]hex LPAREN 48 34 18 32 49 35 19 33 RPAREN LPAREN coreCount rectangleCount zCount RPAREN simpleGrading LPAREN 1 1 1 RPAREN //20 )dnl
ifelse(boundRect,1,bRect20,)

RPAREN;

edges
(
arc 2 10 ( coreArchLong coreArchShort 0)
arc 3 11 ( coreArchLong coreArchShort zLength)
arc 16 2 ( coreArchLong negCoreArchShort 0)
arc 17 3 ( coreArchLong negCoreArchShort zLength)
arc 10 4 ( coreArchShort coreArchLong 0)
arc 11 5 ( coreArchShort coreArchLong zLength)
arc 4 12 ( negCoreArchShort coreArchLong 0)
arc 5 13 ( negCoreArchShort coreArchLong zLength)
arc 12 6 (negCoreArchLong coreArchShort 0)
arc 13 7 (negCoreArchLong coreArchShort zLength)
arc 6 14 (negCoreArchLong negCoreArchShort 0)
arc 7 15 (negCoreArchLong negCoreArchShort zLength)
arc 14 8 ( negCoreArchShort negCoreArchLong 0)
arc 15 9 ( negCoreArchShort negCoreArchLong zLength)
arc 8 16 ( coreArchShort negCoreArchLong 0)
arc 9 17 ( coreArchShort negCoreArchLong zLength)
arc 18 26 ( radiusArchLong radiusArchShort 0)
arc 19 27 ( radiusArchLong radiusArchShort zLength)
arc 26 20 ( radiusArchShort radiusArchLong 0)
arc 27 21 ( radiusArchShort radiusArchLong zLength)
arc 20 28 (negRadiusArchShort radiusArchLong 0)
arc 21 29 (negRadiusArchShort radiusArchLong zLength)
arc 28 22 (negRadiusArchLong radiusArchShort 0)
arc 29 23 (negRadiusArchLong radiusArchShort zLength)
arc 22 30 (negRadiusArchLong -radiusArchShort 0)
arc 23 31 (negRadiusArchLong -radiusArchShort zLength)
arc 30 24 (negRadiusArchShort negRadiusArchLong 0)
arc 31 25 (negRadiusArchShort negRadiusArchLong zLength)
arc 24 32 ( radiusArchShort negRadiusArchLong 0)
arc 25 33 ( radiusArchShort negRadiusArchLong zLength)
arc 32 18 ( radiusArchLong negRadiusArchShort 0)
arc 33 19 ( radiusArchLong negRadiusArchShort zLength)
);
boundary
LPAREN
in
{
type patch;
faces
(
(2 10 0 16)
(10 4 12 0)
(12 6 14 0)
(14 8 16 0)
(18 26 10 2)
(10 26 20 4)
(4 20 28 12)
(12 28 22 6)
(6 22 30 14)
(14 30 24 8)
(8 24 32 16)
(16 32 18 2)
define(in13,[ ]LPAREN 18 34 42 26 RPAREN)dnl
ifelse(boundRect,1,in13,)
define(in14,[ ]LPAREN 26 42 36 20 RPAREN)dnl
ifelse(boundRect,1,in14,)
define(in15,[ ]LPAREN 20 36 44 28 RPAREN)dnl
ifelse(boundRect,1,in15,)
define(in16,[ ]LPAREN 28 44 38 22 RPAREN)dnl
ifelse(boundRect,1,in16,)
define(in17,[ ]LPAREN 22 38 46 30 RPAREN)dnl
ifelse(boundRect,1,in17,)
define(in18,[ ]LPAREN 30 46 40 24 RPAREN)dnl
ifelse(boundRect,1,in18,)
define(in19,[ ]LPAREN 24 40 48 32 RPAREN)dnl
ifelse(boundRect,1,in19,)
define(in20,[ ]LPAREN 32 48 34 18 RPAREN)dnl
ifelse(boundRect,1,in20,)
);
}
out
{
type patch;
faces
(
(3 11 1 17)
(11 5 13 1)
(13 7 15 1)
(15 9 17 1)
(3 19 27 11)
(11 27 21 5)
(5 21 29 13)
(13 29 23 7)
(7 23 31 15)
(15 31 25 9)
(9 25 33 17)
(17 33 19 3)
define(out13,[ ]LPAREN 19 35 43 27 RPAREN)dnl
ifelse(boundRect,1,out13,)
define(out14,[ ]LPAREN 27 43 37 21 RPAREN)dnl
ifelse(boundRect,1,out14,)
define(out15,[ ]LPAREN 21 37 45 29 RPAREN)dnl
ifelse(boundRect,1,out15,)
define(out16,[ ]LPAREN 29 45 39 23 RPAREN)dnl
ifelse(boundRect,1,out16,)
define(out17,[ ]LPAREN 23 39 47 31 RPAREN)dnl
ifelse(boundRect,1,out17,)
define(out18,[ ]LPAREN 31 47 41 25 RPAREN)dnl
ifelse(boundRect,1,out18,)
define(out19,[ ]LPAREN 25 41 49 33 RPAREN)dnl
ifelse(boundRect,1,out19,)
define(out20,[ ]LPAREN 33 49 35 19 RPAREN)dnl
ifelse(boundRect,1,out20,)
);
}
walls
{
type wall;
faces
LPAREN
define(wallPipe,[ ](18 19 27 26)
[ ](26 27 21 20)
[ ](20 21 29 28)
[ ](28 29 23 22)
[ ](22 23 31 30)
[ ](30 31 25 24)
[ ](24 25 33 32)
[ ](32 33 19 18))dnl
define(wallRect,[ ](34 35 43 42)
[ ](42 43 37 36)
[ ](36 37 45 44)
[ ](44 45 39 38)
[ ](38 39 47 46)
[ ](46 47 41 40)
[ ](40 41 49 48)
[ ](48 49 35 34))dnl
ifelse(boundRect,1,wallRect,wallPipe)
RPAREN;
}
RPAREN;

mergePatchPairs
(
);

// ************************************************************************* //