// Nielsen Room Geometry

// Geometry
xLength=9.0;
xLengthInlet=1.0;
xLengthOutlet=2.0+xLength;
yHeight=3.0;
zWidth=3.0;
yHeightInlet=0.168;
yHeightOutlet=0.48;
yHeight2=yHeight-yHeightInlet;
yHeight1=yHeightOutlet;


// Mesh distribution
dist=0.2; 

xRaumNrBump =20;
zRaumNrBump =20;

xRaumBump=0.1;
zRaumBump=0.1;
xInletNr =20;
xInletProg=1.02;
xOutletNr=20;
xOutletProg=1.02;


Point(1) = {0, yHeight1, 0, dist};
Point(2) = {xLength, yHeight1, 0, dist};
Point(3) = {xLength, yHeight2, 0, dist};
Point(4) = {0, yHeight2, 0, dist};
Point(5) = {0, yHeight2, zWidth, dist};
Point(6) = {xLength, yHeight2, zWidth, dist};
Point(7) = {0, yHeight1, zWidth, dist};
Point(8) = {xLength, yHeight1, zWidth, dist};

Point(10) = {0, 0, 0, dist};
Point(11) = {xLength, 0, 0, dist};
Point(12) = {0, 0, zWidth, dist};
Point(13) = {xLength, 0, zWidth, dist};

Point(14) = {xLength, yHeight, 0, dist};
Point(16) = {0, yHeight, 0, dist};
Point(17) = {0, yHeight, zWidth, dist};
Point(18) = {xLength, yHeight, zWidth, dist};

Point(19) = {-xLengthInlet, yHeight2, zWidth, dist};
Point(20) = {-xLengthInlet, yHeight2, 0, dist};
Point(21) = {-xLengthInlet, yHeight, 0, dist};
Point(22) = {-xLengthInlet, yHeight, zWidth, dist};

Point(23) = {xLengthOutlet, yHeight1, zWidth, dist};
Point(24) = {xLengthOutlet, yHeight1, 0, dist};
Point(25) = {xLengthOutlet, 0, 0, dist};
Point(26) = {xLengthOutlet, 0, zWidth, dist};
Line(1) = {21, 22};
Line(2) = {20, 19};
Line(3) = {16, 17};
Line(4) = {4, 5};
Line(5) = {14, 18};
Line(6) = {3, 6};
Line(7) = {2, 8};
Line(8) = {11, 13};
Line(9) = {24, 23};
Line(10) = {25, 26};
Line(11) = {1, 7};
Line(12) = {10, 12};
Line(13) = {12, 7};
Line(14) = {10, 1};
Line(15) = {7, 5};
Line(16) = {5, 17};
Line(17) = {1, 4};
Line(18) = {4, 16};
Line(19) = {19, 22};
Line(20) = {20, 21};
Line(21) = {13, 8};
Line(22) = {11, 2};
Line(23) = {26, 23};
Line(24) = {25, 24};
Line(25) = {2, 3};
Line(26) = {3, 14};
Line(27) = {8, 6};
Line(28) = {6, 18};
Line(29) = {19, 5};
Line(30) = {22, 17};
Line(31) = {20, 4};
Line(32) = {21, 16};
Line(33) = {16, 14};
Line(34) = {4, 3};
Line(35) = {17, 18};
Line(36) = {5, 6};
Line(37) = {7, 8};
Line(38) = {12, 13};
Line(39) = {1, 2};
Line(40) = {10, 11};
Line(41) = {2, 24};
Line(42) = {8, 23};
Line(43) = {13, 26};
Line(44) = {11, 25};
Line Loop(45) = {38, 21, -37, -13};
Plane Surface(46) = {45};
Line Loop(47) = {21, 42, -23, -43};
Plane Surface(48) = {47};
Line Loop(49) = {12, 13, -11, -14};
Plane Surface(50) = {49};
Line Loop(51) = {40, 22, -39, -14};
Plane Surface(52) = {51};
Line Loop(53) = {38, -8, -40, 12};
Plane Surface(54) = {53};
Line Loop(55) = {8, 21, -7, -22};
Plane Surface(56) = {55};
Line Loop(57) = {43, -10, -44, 8};
Plane Surface(58) = {57};
Line Loop(59) = {10, 23, -9, -24};
Plane Surface(60) = {59};
Line Loop(61) = {44, 24, -41, -22};
Plane Surface(62) = {61};
Line Loop(63) = {7, 42, -9, -41};
Plane Surface(64) = {63};
Line Loop(65) = {11, 15, -4, -17};
Plane Surface(66) = {65};
Line Loop(67) = {37, 27, -36, -15};
Plane Surface(68) = {67};
Line Loop(69) = {7, 27, -6, -25};
Plane Surface(70) = {69};
Line Loop(71) = {6, 28, -5, -26};
Plane Surface(72) = {71};
Line Loop(73) = {36, 28, -35, -16};
Plane Surface(74) = {73};
Line Loop(75) = {2, 19, -1, -20};
Plane Surface(76) = {75};
Line Loop(77) = {29, -4, -31, 2};
Plane Surface(78) = {77};
Line Loop(79) = {4, 16, -3, -18};
Plane Surface(80) = {79};
Line Loop(81) = {30, -3, -32, 1};
Plane Surface(82) = {81};
Line Loop(83) = {31, 18, -32, -20};
Plane Surface(84) = {83};
Line Loop(85) = {34, 26, -33, -18};
Plane Surface(86) = {85};
Line Loop(87) = {39, 25, -34, -17};
Plane Surface(88) = {87};
Line Loop(89) = {11, 37, -7, -39};
Plane Surface(90) = {89};
Line Loop(91) = {36, -6, -34, 4};
Plane Surface(92) = {91};
Line Loop(93) = {3, 35, -5, -33};
Plane Surface(94) = {93};
Line Loop(95) = {29, 16, -30, -19};
Plane Surface(96) = {95};


Transfinite Line {35, 36, 37, 38, 33, 34, 39, 40} = xRaumNrBump Using Bump xRaumBump;
Transfinite Line {1, 2, 3, 4, 11, 12, 5, 6, 7, 8, 9, 10} = zRaumNrBump Using Bump zRaumBump;
Transfinite Line {30, 29, 32, 31} = xInletNr Using Progression xInletProg;
Transfinite Line {42, 43, 41, 44} = xOutletNr Using Progression xOutletProg;
Transfinite Line {20, 18, 19, 16, 26, 28} = 2;

Transfinite Surface "*";
Recombine Surface "*";

Surface Loop(97) = {84, 76, 78, 80, 82, 96}; Volume(98) = {97};
Surface Loop(99) = {86, 72, 74, 94, 92, 80}; Volume(100) = {99};
Surface Loop(101) = {88, 70, 68, 66, 92, 90}; Volume(102) = {101};
Surface Loop(103) = {52, 54, 46, 50, 90, 56}; Volume(104) = {103};
Surface Loop(105) = {62, 58, 48, 64, 60, 56}; Volume(106) = {105};

Transfinite Volume{98} = {20, 4, 16, 21, 19, 5, 17, 22};
Transfinite Volume{100} = {4, 3, 14, 16, 5, 6, 18, 17};
Transfinite Volume{102} = {1, 2, 3, 4, 7, 8, 6, 5};
Transfinite Volume{104} = {10, 11, 2, 1, 12, 13, 8, 7};
Transfinite Volume{106} = {11, 25, 24, 2, 13, 26, 23, 8};


