cl1=1;
cl2=0.1;
cl3=0.01;
cl4=0.001;
cl5=0.001;

//gravityRotRads = 30*(Pi/180)-3/16;

//External Domain1

Point(1) = {4, 4, 0, cl1};
Point(2) = {-4, 4, 0, cl1};
Point(3) = {-4, -4, 0, cl1};
Point(4) = {4, -4, 0, cl1};

//External Domain2

Point(5) = {1, 1, 0, cl2};
Point(6) = {-1, 1, 0, cl2};
Point(7) = {-1, -1, 0, cl2};
Point(8) = {1, -1, 0, cl2};

//Cavity Vertices

Point(9) = {0, 0, 0, cl4};
Point(10) = {0, 0.035, 0, cl5};
Point(11) = {0, -0.035, 0, cl4};
Point(12) = {-0.150, -0.035, 0, cl4};
Point(13) = {-0.150, 0.035, 0, cl4};

//Insulation

Point(14) = {0, 0.145, 0, cl4};
Point(15) = {0, -0.145, 0, cl4};
Point(16) = {-0.320, -0.145, 0, cl4};
Point(17) = {-0.320, 0.145, 0, cl3};

//Jet Vertices

Point(18) = {0.005, 0.035, 0, cl5};
Point(19) = {0.005, 0.037, 0, cl5};
Point(20) = {0, 0.037, 0, cl5};

//Cavity Front

Point(21) = {0.320, 0.145, 0, cl3};
Point(22) = {0.320, -0.145, 0, cl3};

//External Domain Line1

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

Line(5) = {8, 7};
Line(6) = {7, 6};
Line(7) = {6, 5};
Line(8) = {5, 8};

Line(9) = {15, 16};
Line(10) = {16, 17};
Line(11) = {17, 14};
Line(12) = {14, 21};
Line(13) = {21, 22};
Line(14) = {22, 15};
Line(15) = {11, 12};
Line(16) = {12, 13};
Line(17) = {13, 10};
Line(18) = {10, 9};
Line(19) = {9, 11};
Line(20) = {10, 18};
Line(21) = {18, 19};
Line(22) = {19, 20};
Line(23) = {20, 14};
Line(24) = {11, 15};

Curve Loop(1) = {3, 4, 1, 2};
Curve Loop(2) = {7, 8, 5, 6};
Plane Surface(1) = {1, 2};
Curve Loop(3) = {11, 12, 13, 14, 9, 10};
Plane Surface(2) = {2, 3};
Curve Loop(4) = {17, 18, 19, 15, 16};
Plane Surface(3) = {4};
Curve Loop(5) = {12, 13, 14, -24, -19, -18, 20, 21, 22, 23};
Plane Surface(4) = {5};

//Cavity Plume

Point(23) = {0, 0.465, 0, cl5};
Point(24) = {0, 0.365, 0, cl5};
Point(25) = {0, 0.265, 0, cl5};
Point{23,24,25} In Surface {2};

//Rotate {{0,0,1}, {0,0.145,0},gravityRotRads} { Point{23,24,25}; }

Extrude {0, 0, 0.3} {
  Surface{1}; Surface{2}; Surface{4}; Surface{3}; Layers{1}; Recombine;
}

Physical Surface("outlet") = {49, 37, 41, 45};
Physical Surface("adiabaticWall") = {101, 97, 117, 145, 169, 165, 161};
Physical Surface("cavityWall") = {192, 196, 180};
Physical Surface("jet") = {157};
Physical Volume("Fluid") = {3, 1, 4};
