// grid for a channel


channelLength = 5;
channelHeight = 1;

numberOfElementsLenghtChannel = 100;
numberOfElementsHeightChannel = 2*25;
progressionHeightChannel = 1.1;
progressionLengthChannel = 1.03;




// definition of geometry

Point(1) = {0,0,0};
Point(2) = {0,channelHeight/2,0};
Point(3) = {0,channelHeight,0};
Point(4) = {channelLength,channelHeight,0};
Point(5) = {channelLength,channelHeight/2,0};
Point(6) = {channelLength,0,0};

Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(6) = {6,1};
Line(11) = {2,5};

Line Loop(1) = {1,11,5,6};
Plane Surface(1) = {1};
Line Loop(2) = {2,3,4,-11};
Plane Surface(2) = {2};

// definition of meshing

Transfinite Line {1} = numberOfElementsHeightChannel/2+1 Using Progression progressionHeightChannel;
Transfinite Line {2} = numberOfElementsHeightChannel/2+1 Using Progression 1/progressionHeightChannel;
Transfinite Line {4} = numberOfElementsHeightChannel/2+1 Using Progression progressionHeightChannel;
Transfinite Line {5} = numberOfElementsHeightChannel/2+1 Using Progression 1/progressionHeightChannel;

Transfinite Line {3} = numberOfElementsLenghtChannel+1 Using Progression progressionLengthChannel;
Transfinite Line {6} = numberOfElementsLenghtChannel+1 Using Progression 1/progressionLengthChannel;
Transfinite Line {11} = numberOfElementsLenghtChannel+1 Using Progression progressionLengthChannel;

Transfinite Surface{1} = {};
Recombine Surface {1};
Transfinite Surface{2} = {};
Recombine Surface {2};


Extrude {0, 0, -1} {Surface{1, 2};Layers{1};Recombine;}

Physical Surface("frontAndBack") = {1, 2, 33, 55};
Physical Surface("walls") = {32, 46};
Physical Surface("inlet") = {20, 42};
Physical Surface("outlet") = {28, 50};

Physical Volume("channel") = {1,2};

