// Gmsh project created on Wed Dec 23 09:38:58 2009
lc = 0.003;

Pipe_OD = 273.05;
Pipe_Wall_thickness = 9.271;

Tracer_Tube_OD = 26.67;
Tracer_tube_Wall_thickness = 2.87;

Connection_dist = 5.0;
tube_distance = 1;

Tracer_angle_1 = 75.0/180*Pi;
Tracer_angle_2 = 105.0/180*Pi;

Sensor_Tube_OD = 26.67;
Sensor_tube_Wall_thickness = 2.87;

Sensor_angle = 90/180*Pi;

Insulation_1_thickness = 50.0;
Insulation_2_thickness = 50.0;

R1 = (Pipe_OD/2 - Pipe_Wall_thickness)/1000;
R2 = (Pipe_OD/2)/1000;

Point(1) = {0, 0, 0, lc};	//center point

Point(2) = {0, R1 , 0, lc};	//inner wall pipe ref point

Point(3) = {R2, 0 , 0, lc};	//outer wall pipe ref point

A1 = Tracer_angle_1 + Connection_dist/(Pipe_OD);
A2 = Tracer_angle_1 - Connection_dist/(Pipe_OD);

Point(4) = {R2*Cos(A1) , R2*Sin(A1) , 0 , lc};
Point(5) = {R2*Cos(A2) , R2*Sin(A2) , 0 , lc};

A1 = Tracer_angle_2 + Connection_dist/(Pipe_OD);
A2 = Tracer_angle_2 - Connection_dist/(Pipe_OD);

Point(6) = {R2*Cos(A1) , R2*Sin(A1) , 0 , lc};
Point(7) = {R2*Cos(A2) , R2*Sin(A2) , 0 , lc};

A1 = Sensor_angle + Connection_dist/(Pipe_OD);
A2 = Sensor_angle - Connection_dist/(Pipe_OD);

Point(8) = {R2*Cos(A1) , R2*Sin(A1) , 0 , lc};
Point(9) = {R2*Cos(A2) , R2*Sin(A2) , 0 , lc};

Point(10) = {-R2, 0 , 0, lc};
Point(11) = { 0 , -R2 , 0, lc};

Circle(1) = {2, 1, 2};

Circle(2) = {3, 1, 5};
Circle(4) = {4, 1, 9};
Circle(5) = {8, 1, 7};
Circle(6) = {6, 1, 10};
Circle(7) = {10, 1, 11};
Circle(8) = {11, 1, 3};

Point(12) = {((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1)/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)/1000) , 0 , lc};
Point(13) = {(Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2)/1000 , (Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)/1000 , 0 , lc};
Point(14) = {(Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle)/1000 , (Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)/1000 , 0 , lc};

Point(15) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)-Tracer_Tube_OD/2+Tracer_tube_Wall_thickness)/1000) , 0 , lc/2};
Circle(9) = {15,12,15};

Point(16) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)-Tracer_Tube_OD/2+Tracer_tube_Wall_thickness)/1000) , 0 , lc/2};
Circle(10) = {16,13,16};

Point(17) = {((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle))/1000 , (Pipe_OD/2+Sensor_Tube_OD/2+tube_distance - Sensor_Tube_OD/2 + Sensor_tube_Wall_thickness)*Sin(Sensor_angle)/1000 , 0 , lc};
Circle(11) = {17,14,17};
Circle(12) = {5,1,4};
Circle(13) = {9,1,8};
Circle(14) = {7,1,6};

Point(18) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1)+Tracer_Tube_OD/2)/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)/1000) , 0 , lc};
Point(19) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)+Tracer_Tube_OD/2)/1000) , 0 , lc};
Point(20) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1)-Tracer_Tube_OD/2)/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)/1000) , 0 , lc};
Point(21) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)-Tracer_Tube_OD/2)/1000) , 0 , lc};

Point(22) = {((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1)/1000+Tracer_Tube_OD/2*Cos(Pi+Tracer_angle_1+Connection_dist/(Tracer_Tube_OD))/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)/1000+Tracer_Tube_OD/2*Sin(Pi+Tracer_angle_1+Connection_dist/(Tracer_Tube_OD))/1000) , 0 , lc};
Point(23) = {((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_1)/1000+Tracer_Tube_OD/2*Cos(Pi+Tracer_angle_1-Connection_dist/(Tracer_Tube_OD))/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_1)/1000+Tracer_Tube_OD/2*Sin(Pi+Tracer_angle_1-Connection_dist/(Tracer_Tube_OD))/1000) , 0 , lc};

Point(24) = {((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2)/1000+Tracer_Tube_OD/2*Cos(Pi+Tracer_angle_2+Connection_dist/(Tracer_Tube_OD))/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)/1000+Tracer_Tube_OD/2*Sin(Pi+Tracer_angle_2+Connection_dist/(Tracer_Tube_OD))/1000) , 0 , lc};
Point(25) = {((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2)/1000+Tracer_Tube_OD/2*Cos(Pi+Tracer_angle_2-Connection_dist/(Tracer_Tube_OD))/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)/1000+Tracer_Tube_OD/2*Sin(Pi+Tracer_angle_2-Connection_dist/(Tracer_Tube_OD))/1000) , 0 , lc};

Point(26) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2)+Tracer_Tube_OD/2)/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)/1000) , 0 , lc};
Point(27) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)+Tracer_Tube_OD/2)/1000) , 0 , lc};
Point(28) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2)-Tracer_Tube_OD/2)/1000) , ((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)/1000) , 0 , lc};
Point(29) = {(((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Cos(Tracer_angle_2))/1000) , (((Pipe_OD/2+Tracer_Tube_OD/2+tube_distance)*Sin(Tracer_angle_2)-Tracer_Tube_OD/2)/1000) , 0 , lc};

Point(30) = {((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle)/1000+Sensor_Tube_OD/2*Cos(Pi+Sensor_angle+Connection_dist/(Sensor_Tube_OD))/1000) , ((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)/1000+Sensor_Tube_OD/2*Sin(Pi+Sensor_angle+Connection_dist/(Sensor_Tube_OD))/1000) , 0 , lc};
Point(31) = {((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle)/1000+Sensor_Tube_OD/2*Cos(Pi+Sensor_angle-Connection_dist/(Sensor_Tube_OD))/1000) , ((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)/1000+Sensor_Tube_OD/2*Sin(Pi+Sensor_angle-Connection_dist/(Sensor_Tube_OD))/1000) , 0 , lc};
Point(32) = {(((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle)+Sensor_Tube_OD/2)/1000) , ((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)/1000) , 0 , lc};
Point(33) = {(((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle))/1000) , (((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)+Sensor_Tube_OD/2)/1000) , 0 , lc};
Point(34) = {(((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Cos(Sensor_angle)-Sensor_Tube_OD/2)/1000) , ((Pipe_OD/2+Sensor_Tube_OD/2+tube_distance)*Sin(Sensor_angle)/1000) , 0 , lc};

Circle(15) = {21,12,18};
Circle(16) = {18,12,19};
Circle(17) = {19,12,20};
Circle(18) = {20,12,23};
Circle(19) = {23,12,22};
Circle(20) = {22,12,21};

Line(21) = {5,22};
Line(22) = {4,23};

Circle(23) = {30,14,32};
Circle(24) = {32,14,33};
Circle(25) = {33,14,34};
Circle(26) = {34,14,31};
Circle(27) = {31,14,30};

Line(29) = {9,30};
Line(30) = {8,31};

Circle(31) = {24,13,26};
Circle(32) = {26,13,27};
Circle(34) = {27,13,28};
Circle(35) = {28,13,29};
Circle(36) = {29,13,25};
Circle(37) = {25,13,24};

Line(38) = {7,24};
Line(39) = {6,25};

Point(35) = {(Pipe_OD/2 + Insulation_1_thickness)/1000 , 0 , 0, lc};
Point(36) = {(Pipe_OD/2 + Insulation_1_thickness + Insulation_2_thickness)/1000 , 0 , 0, lc};

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

Physical Surface(201) = {43};
Physical Surface(202) = {45};
Physical Surface(203) = {51, 48};
Physical Surface(204) = {54};
Physical Surface(205) = {56, 58, 60};
Physical Surface(206) = {63};
Physical Surface(207) = {65};

Physical Point(208) = {1};
Physical Point(209) = {17};

Physical Line(101) = {9,10};
Physical Line(102) = {41};
