
/*   	File "MoteurULg.geo  "						 25/01/2008
     	 Geometric Model for a segment of permanent magnet linear motor
*/

Include "MoteurULg.don";

s0 = 0.002;
s1 = 0.002;
s2 = 0.004;
s3 = 0.010;

// Description of armature

x1 = Pase/2.;
x2 = (Pase-Lenc)/2.;	
y1 = LFer/2.-hcb-Hcu;
y2 = LFer/2.-hcb;

Point(1) = {0, 0, 0, s3};
Point(2) = {x2, 0, 0, s3};
Point(3) = {x1, 0, 0, s3};
Point(4) = {x2, y1, 0, s2};
Point(5) = {x2+Lcu, y1, 0, s2};
Point(6) = {x2, y2, 0, s2};
Point(7) = {x2+Lcu, y2, 0, s2};
Point(8) = {0, LFer/2., 0, s2};
Point(9) = {x2, LFer/2., 0, s1};
Point(10) = {x1, LFer/2., 0, s2};

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

Line Loop(1) = {1, 2, 3, 4, 5, 6};		Plane Surface(1) = {1};
Line(7) = {4,5};
Line(8) = {5,7};
Line(9) = {7,6};

Line Loop(2) = {7,8,9,-3};			Plane Surface(2) = {2};

Line(10) = {2,3};
Line(11) = {3,10};
Line(12) = {10,9};

Line Loop(3) = {10,11,12,-4,-9,-8,-7,-2};	Plane Surface(3) = {3};

//Description of inductor

y = LFer/2.+Entf;
Point(21) = {0, y, 0, s1};
Point(22) = {LMag/2., y, 0, s1};
Point(23) = {Pasp-LMag/2., y, 0, s1};
Point(24) = {Pasp, y, 0, s1};
Point(25) = {0, y+EpAp, 0, s2};
Point(26) = {LMag/2., y+EpAp, 0, s2};
Point(27) = {Pasp-LMag/2., y+EpAp, 0, s2};
Point(28) = {Pasp, y+EpAp, 0, s2};
Point(29) = {0, y+EpAp+EpCR, 0, s3};
Point(30) = {Pasp, y+EpAp+EpCR, 0, s3}; 

Line(21) = {21,22};
Line(22) = {22,26};
Line(23) = {26,25};
Line(24) = {25,21};

Line Loop(5) = {21,22,23,24};			Plane Surface(5) = {5};

Line(25) = {23,24};
Line(26) = {24,28};
Line(27) = {28,27};
Line(28) = {27,23};

Line Loop(6) = {25,26,27,28};			Plane Surface(6) = {6};

Line(29) = {26,27};
Line(30) = {28,30};
Line(31) = {30,29};
Line(32) = {29,25};

Line Loop(7) = {-23,29,-27,30,31,32};	Plane Surface(7) = {7};

Line(33) = {22,23};

Line Loop(8) = {33,-28,-29,-22};		Plane Surface(8) = {8};

// Axes verticaux début et fin

nLh1 = newl;Line(nLh1) = {8,21};
tf[] = Translate {nbe*Pase,0,0} {Duplicata{Line{6,nLh1,24,32};}};
nLh2 = tf[1];

// Symmetry axis  x = Pase/2.

tp1[] = Symmetry {1,0,0,-Pase/2.} {Duplicata{ Point{1,2,3,4,5,6,7,8,9,10}; }};
tc1[] = Symmetry {1,0,0,-Pase/2.} {Duplicata{ Line{5,12}; }};
ts1[] = Symmetry {1,0,0,-Pase/2.} {Duplicata{ Surface{1,2,3}; }};

// Translations

ts5[] = Translate {Pase,0,0} {Duplicata{Surface{1,2,3,ts1[]};}};
ts6[] = Translate {Pasp,0,0} {Duplicata{Surface{5,6,7,8};}};

// Surface "Airgap"

nLL1 = newll;
Line Loop(nLL1) = {-5,-12,40,39,-60,-70,91,81,nLh2,-98,-110,-93,-25,-33,-21,-nLh1};
nS1  = news;Plane Surface(nS1) = {nLL1};

// Physical lines

Physical Line(500) = {-31,-107};
Physical Line(501) = { -6,34,-24,-32};
Physical Line(502) = {-35,36,-37,-38};

// Physical surfaces

Physical Surface(400) = {7,102};		// Culasses
Physical Surface(401) = {5,97};		// Aimants Hc < 0
Physical Surface(402) = {6,92};		// Aimants Hc > 0 
Physical Surface(403) = {nS1,8,109};	// Entrefers
Physical Surface(404) = {1,41,55,76};	// Dents
Physical Surface(405) = {2,48,62,83};	// Bobines
Physical Surface(406) = {3,53,67,88};	// Encoches hors Cu
