SetFactory("OpenCASCADE");
x=3;
y=2;
z=0.6;
outer_scale=0.12;
refine_1 = 0.08;
refine_2 = 0.04;
refine_3 =0.01;
Point(1)= {0,0,0,outer_scale};
Point(2)= {0,y,0,outer_scale};
Point(3)= {0,0,z,outer_scale};
Point(4)= {0,y,z,outer_scale};
Point(5)= {x,0,0,outer_scale};
Point(6)= {x,y,0,outer_scale};
Point(7)= {x,0,z,outer_scale};
Point(8)= {x,y,z,outer_scale};
Line(1)={1,3};
Line(2)={1,2};
Line(3)={1,5};
Line(4)={2,4};
Line(5)={3,4};
Line(6)={3,7};
Line(7)={5,7};
Line(8)={5,6};
Line(9)={7,8};
Line(10)={4,8};
Line(11)={2,6};
Line(12)={6,8};//+
Curve Loop(1) = {6, -7, -3, 1};
Plane Surface(1) = {1};
//+
Curve Loop(2) = {2, 4, -5, -1};
Plane Surface(2) = {2};
//+
Curve Loop(3) = {10, -12, -11, 4};
Plane Surface(3) = {3};
//+
Curve Loop(4) = {11, -8, -3, 2};
Plane Surface(4) = {4};
//+
Curve Loop(5) = {5, 10, -9, -6};
Plane Surface(5) = {5};
//+
Curve Loop(6) = {8, 12, -9, -7};
Plane Surface(6) = {6};
//+
Surface Loop(1) = {6, 4, 3, 5, 2, 1};
//+
Volume(1) = {1};


vol() = ShapeFromFile("concaveTower.stp");
Translate { 1,1,0}{
  Dilate {{0, 0, 0}, {0.001, 0.001, 0.001}} {
  Volume{vol()}; 
  }
  }
Physical Surface("concaveTower")=Boundary{Volume{vol()};};
BooleanDifference{Volume{1};Delete;}{Volume{vol()};Delete;}

//+
Field[1] = Cylinder;
Field[1].Radius = 0.6;
Field[1].VIn = refine_1;
Field[1].VOut = outer_scale;
Field[1].XCenter = 1;
Field[1].YCenter = 1;
Field[1].ZAxis = 0.8;

Field[2] = Box;
Field[2].VIn = refine_1;
Field[2].VOut = outer_scale;
Field[2].XMax = 2.5;
Field[2].XMin = 1;
Field[2].YMax = 1.6;
Field[2].YMin = 0.4;
Field[2].ZMax = 0.8;

Field[3] = Cylinder;
Field[3].Radius = 0.25;
Field[3].VIn = refine_2;
Field[3].VOut = outer_scale;
Field[3].XCenter = 1;
Field[3].YCenter = 1;
Field[3].ZAxis = 0.8;

Field[4] = Box;
Field[4].VIn = refine_2;
Field[4].VOut = outer_scale;
Field[4].XMax = 1.8;
Field[4].XMin = 1;
Field[4].YMax = 1.25;
Field[4].YMin = 0.75;
Field[4].ZMax = 0.8;
/*
Field[5] = Cylinder;
Field[5].Radius = 0.075;
Field[5].VIn = refine_3;
Field[5].VOut = outer_scale;
Field[5].XCenter = 1;
Field[5].YCenter = 1;
Field[5].ZAxis = 0.8;
*/
Field[6] = Min;
Field[6].FieldsList={1,2,3,4};
Background Field = 6;
//+

//Periodic Surface{5} = {3} ;
//Periodic Curve | Surface { EXPRESSION-LIST } = { EXPRESSION-LIST } Affine | Translate { EXPRESSION-LIST } ;
Periodic Line{5} = {21} ;
Periodic Line{1} = {3} ;
Periodic Line{7} = {24} ;
Periodic Line{6} = {23} ;
Periodic Surface {5}= {6};


Characteristic Length {25,26,28,29,31,32,22,23,34,13,14,17,16,11,10,7,8,19}=refine_3;
Physical Volume("fluid") = {1};
Physical Surface("east")={1};
Physical Surface("west")={6};
Physical Surface("top")={2};
Physical Surface("bottom")={4};
Physical Surface("north")={5};
Physical Surface("south")={3};
//+

