/*************************************************************************
 *          plaque3d.geo:  3d plaque flow model                          *
 *************************************************************************/

// variables which determine geometry of the plaque (scale = mm)

width = 250;
length = 250;
height = 24;
runnersize = 8;
shearheight = 31.75;
draftangle = 2;
shearwidth = 1.5;
marginwidth = 10;

gatesplinesegs = 9;
ventsplinesegs = 29;

// variables for conversions, etc.

mm = 1e-03;
lcplaque = 0.01;

// various calculations

l1 = length/2*mm;
w1 = width/2*mm;
m1 = marginwidth*mm;
dft = draftangle * Pi/180;
del1 = height*Sin(dft)*mm;
h1 = height * mm;
sw = shearwidth * mm;
sh = shearheight * mm;

// points

Point(1) = {w1,-l1,0.0,lcplaque};
Point(2) = {w1,l1,0.0,lcplaque};
Point(3) = {-w1,l1,0.0,lcplaque};
Point(4) = {-w1,-l1,0.0,lcplaque};
Point(5) = {w1,-l1+m1,0.0,lcplaque};
Point(6) = {-w1,-l1+m1,0.0,lcplaque};

Point(7) = {w1,-l1,h1,lcplaque};
Point(8) = {w1,l1,h1,lcplaque};
Point(9) = {-w1,l1,h1,lcplaque};
Point(10) = {-w1,-l1,h1,lcplaque};
Point(11) = {w1,-l1+m1,h1,lcplaque};
Point(12) = {-w1,-l1+m1,h1,lcplaque};

Point(13) = {w1-sw,-l1,h1,lcplaque};
Point(14) = {w1-sw,-l1+m1,h1,lcplaque};
Point(15) = {w1-sw,l1,h1,lcplaque};

Point(16) = {w1,-l1,h1+sh,lcplaque};
Point(17) = {w1,l1,h1+sh,lcplaque};
Point(18) = {w1-sw,l1,h1+sh,lcplaque};
Point(19) = {w1-sw,-l1,h1+sh,lcplaque};

// lines

Line(1) = {1,5};
Line(2) = {5,2};
Line(3) = {2,3};
Line(4) = {3,6};
Line(5) = {6,4};
Line(6) = {4,1};
Line(7) = {7,11};
Line(8) = {11,8};
Line(9) = {8,15};
Line(10) = {15,9};
Line(11) = {9,12};
Line(12) = {12,10};
Line(13) = {10,13};
Line(14) = {13,7};
Line(15) = {1,7};
Line(16) = {5,11};
Line(17) = {2,8};
Line(18) = {3,9};
Line(19) = {6,12};
Line(20) = {4,10};
Line(21) = {12,14};
Line(22) = {14,11};
Line(23) = {5,6};
Line(24) = {16,19};
Line(25) = {16,17};
Line(26) = {17,18};
Line(27) = {18,19};
Line(28) = {19,13};
Line(29) = {16,7};
Line(30) = {13,14};
Line(31) = {14,15};
Line(32) = {8,17};
Line(33) = {18,15};

// partvol

// Surface Loop(68) = {51,55,45,43,41,35};
// Volume(69) = {68};

// marginvol

// Surface Loop(70) = {51,53,49,39,37,47};
// Volume(71) = {70};

// gatevol

// Surface Loop(72) = {65,57,59,67,61,63};
// Volume(73) = {72};

// gate surf, then vent surf

// Physical Surface(74) = {67};
// Physical Surface(75) = {45};


Line Loop(34) = {-23,2,3,4};
Plane Surface(35) = {34};
Line Loop(36) = {6,1,23,5};
Plane Surface(37) = {36};
Line Loop(38) = {10,11,21,31};
Plane Surface(39) = {38};
Line Loop(40) = {-31,22,8,9};
Plane Surface(41) = {40};
Line Loop(42) = {7,-22,-30,14};
Plane Surface(43) = {42};
Line Loop(44) = {13,30,-21,12};
Plane Surface(45) = {44};
Line Loop(46) = {27,-24,25,26};
Plane Surface(47) = {46};
Line Loop(48) = {13,14,-15,-6,20};
Plane Surface(49) = {48};
Line Loop(50) = {-22,-21,-19,-23,16};
Plane Surface(51) = {50};
Line Loop(52) = {18,-10,-9,-17,3};
Plane Surface(53) = {52};
Line Loop(54) = {28,14,-29,24};
Plane Surface(55) = {54};
Line Loop(56) = {-9,32,26,33};
Plane Surface(57) = {56};
Line Loop(58) = {16,-7,-15,1};
Plane Surface(59) = {58};
Line Loop(60) = {-8,-16,2,17};
Plane Surface(61) = {60};
Line Loop(62) = {19,-11,-18,4};
Plane Surface(63) = {62};
Line Loop(64) = {-20,-5,19,12};
Plane Surface(65) = {64};
Line Loop(66) = {-25,29,7,8,32};
Plane Surface(67) = {66};
Line Loop(68) = {30,31,-33,27,28};
Plane Surface(69) = {68};

// partvol

Surface Loop(70) = {41,39,53,63,51,35,61};
Volume(71) = {70};

// marginvol

Surface Loop(72) = {43,59,51,45,49,37,65};
Volume(73) = {72};

// gatevol

Surface Loop(74) = {57,41,69,43,67,47,55};
Volume(75) = {74};

// gate then vent surfaces

Physical Surface(76) = {47};
Physical Surface(77) = {63,65};

// physical volumes for LCMFLOT part, margin, gate

Physical Volume(78) = {71};
Physical Volume(79) = {73};
Physical Volume(80) = {75};
