pmsm.geo 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. pi = 3.14159265359;
  2. // Rotor [1] or stator [0] part of the geometry:
  3. isrotor = 1;
  4. // Central shaft radius [m]:
  5. rshaft = 0.025;
  6. // Rotor magnetic material radius [m]:
  7. rrotmagmat = 0.055;
  8. // Rotor permanent magnet radial length [m]:
  9. drpermmag = 0.003;
  10. // Permanent magnet angular coverage [degrees]:
  11. alphapermmag = 33;
  12. // Rotor-stator gap radial length [m]:
  13. drrotstatgap = 0.001;
  14. // Stator radius [m]:
  15. rstat = 0.1;
  16. // Stator winding slots (3 in total, one per phase):
  17. wdopen = 0.004;
  18. wdopendepth = 0.0012;
  19. wddepth = 0.02;
  20. wdwidthsmall = 0.006;
  21. wdwidthlarge = 0.012;
  22. // Curvature radius at the end of the winding slot:
  23. rcurv = 0.003;
  24. // Mesh sizes at shaft, permanent magnet, rotor-stator gap and stator:
  25. msshaft = 0.006;
  26. mspm = 0.0015;
  27. msrsg = 0.0008;
  28. msstat = 0.006;
  29. // R is the current drawing radius:
  30. R = 0;
  31. Point(1) = {0, 0, 0, msshaft};
  32. R = rshaft;
  33. Point(2) = {R, 0, 0, msshaft};
  34. Point(3) = {R*Cos(pi/4), R*Sin(pi/4), 0, msshaft};
  35. R = rrotmagmat;
  36. Point(6) = {R, 0, 0, mspm};
  37. Point(7) = {R*Cos(pi/4), R*Sin(pi/4), 0, mspm};
  38. Point(8) = {R*Cos( (pi/4+alphapermmag*pi/180)/2 ), R*Sin( (pi/4+alphapermmag*pi/180)/2 ), 0, mspm};
  39. Point(9) = {R*Cos( (pi/4-alphapermmag*pi/180)/2 ), R*Sin( (pi/4-alphapermmag*pi/180)/2 ), 0, mspm};
  40. R = rrotmagmat+drpermmag;
  41. Point(10) = {R, 0, 0, msrsg};
  42. Point(11) = {R*Cos(pi/4), R*Sin(pi/4), 0, msrsg};
  43. Point(12) = {R*Cos( (pi/4+alphapermmag*pi/180)/2 ), R*Sin( (pi/4+alphapermmag*pi/180)/2 ), 0, msrsg};
  44. Point(13) = {R*Cos( (pi/4-alphapermmag*pi/180)/2 ), R*Sin( (pi/4-alphapermmag*pi/180)/2 ), 0, msrsg};
  45. R = rrotmagmat+drpermmag+drrotstatgap/2;
  46. Point(14) = {R, 0, 0, msrsg};
  47. Point(15) = {R*Cos(pi/4), R*Sin(pi/4), 0, msrsg};
  48. R = rrotmagmat+drpermmag+drrotstatgap;
  49. Point(16) = {R, 0, 0, msrsg};
  50. Point(17) = {R*Cos(pi/4), R*Sin(pi/4), 0, msrsg};
  51. R = rstat;
  52. Point(18) = {R, 0, 0, msstat};
  53. Point(19) = {R*Cos(pi/4), R*Sin(pi/4), 0, msstat};
  54. // Stator winding slots (3 in total, one per phase):
  55. For i In {0:2}
  56. alpharot = pi/4 / 3 /2 + i * pi/4 / 3;
  57. // Slot open:
  58. R = rrotmagmat+drpermmag+drrotstatgap;
  59. alpha1 = Atan(0.5*wdopen / R) + alpharot;
  60. alpha2 = -Atan(0.5*wdopen / R) + alpharot;
  61. Point(20+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msrsg};
  62. Point(21+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msrsg};
  63. R = rrotmagmat+drpermmag+drrotstatgap+wdopendepth;
  64. Point(22+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msrsg};
  65. Point(23+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msrsg};
  66. // Winding open:
  67. R = rrotmagmat+drpermmag+drrotstatgap+wdopendepth+0.5*wdopendepth;
  68. alpha1 = Atan(0.5*wdwidthsmall / R) + alpharot;
  69. alpha2 = -Atan(0.5*wdwidthsmall / R) + alpharot;
  70. Point(24+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msrsg};
  71. Point(25+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msrsg};
  72. R = rrotmagmat+drpermmag+drrotstatgap+wdopendepth+wddepth;
  73. alpha1 = Atan(0.5*wdwidthlarge / R) + alpharot;
  74. alpha2 = -Atan(0.5*wdwidthlarge / R) + alpharot;
  75. Point(26+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msstat};
  76. Point(27+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msstat};
  77. R = rrotmagmat+drpermmag+drrotstatgap+wdopendepth+wddepth;
  78. alpha1 = Atan((0.5*wdwidthlarge-rcurv) / R) + alpharot;
  79. alpha2 = -Atan((0.5*wdwidthlarge-rcurv) / R) + alpharot;
  80. Point(28+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msstat};
  81. Point(29+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msstat};
  82. R = rrotmagmat+drpermmag+drrotstatgap+wdopendepth+wddepth+rcurv;
  83. alpha1 = Atan((0.5*wdwidthlarge-rcurv) / R) + alpharot;
  84. alpha2 = -Atan((0.5*wdwidthlarge-rcurv) / R) + alpharot;
  85. Point(30+12*i) = {R*Cos(alpha1),R*Sin(alpha1),0, msstat};
  86. Point(31+12*i) = {R*Cos(alpha2),R*Sin(alpha2),0, msstat};
  87. EndFor
  88. Circle(1) = {2, 1, 3};
  89. Circle(2) = {6, 1, 9};
  90. Circle(3) = {9, 1, 8};
  91. Circle(4) = {8, 1, 7};
  92. Circle(5) = {10, 1, 13};
  93. Circle(6) = {13, 1, 12};
  94. Circle(7) = {12, 1, 11};
  95. Circle(8) = {14, 1, 15};
  96. Circle(9) = {16, 1, 21};
  97. Circle(10) = {21, 1, 20};
  98. Circle(11) = {20, 1, 33};
  99. Circle(12) = {33, 1, 32};
  100. Circle(13) = {32, 1, 45};
  101. Circle(14) = {45, 1, 44};
  102. Circle(15) = {44, 1, 17};
  103. Circle(16) = {18, 1, 19};
  104. Line(17) = {2, 6};
  105. Line(18) = {6, 10};
  106. Line(19) = {10, 14};
  107. Line(20) = {14, 16};
  108. Line(21) = {16, 18};
  109. Line(22) = {3, 7};
  110. Line(23) = {7, 11};
  111. Line(24) = {11, 15};
  112. Line(25) = {15, 17};
  113. Line(26) = {17, 19};
  114. Line(27) = {9, 13};
  115. Line(28) = {8, 12};
  116. Line(29) = {21, 23};
  117. Line(30) = {23, 25};
  118. Line(31) = {25, 27};
  119. Line(32) = {31, 30};
  120. Line(33) = {26, 24};
  121. Line(34) = {24, 22};
  122. Line(35) = {22, 20};
  123. Line(36) = {33, 35};
  124. Line(37) = {35, 37};
  125. Line(38) = {37, 39};
  126. Line(39) = {43, 42};
  127. Line(40) = {38, 36};
  128. Line(41) = {36, 34};
  129. Line(42) = {34, 32};
  130. Line(43) = {45, 47};
  131. Line(44) = {47, 49};
  132. Line(45) = {49, 51};
  133. Line(46) = {55, 54};
  134. Line(47) = {50, 48};
  135. Line(48) = {48, 46};
  136. Line(49) = {46, 44};
  137. Line(50) = {23, 22};
  138. Line(51) = {35, 34};
  139. Line(52) = {47, 46};
  140. Circle(53) = {27, 29, 31};
  141. Circle(54) = {30, 28, 26};
  142. Circle(55) = {39, 41, 43};
  143. Circle(56) = {42, 40, 38};
  144. Circle(57) = {51, 53, 55};
  145. Circle(58) = {54, 52, 50};
  146. Line Loop(1) = {1, 22, -4, -3, -2, -17};
  147. Plane Surface(1) = {1};
  148. Line Loop(2) = {2, 27, -5, -18};
  149. Plane Surface(2) = {2};
  150. Line Loop(3) = {3, 28, -6, -27};
  151. Plane Surface(3) = {3};
  152. Line Loop(4) = {4, 23, -7, -28};
  153. Plane Surface(4) = {4};
  154. Line Loop(5) = {5, 6, 7, 24, -8, -19};
  155. Plane Surface(5) = {5};
  156. Line Loop(6) = {8, 25, -15, -14, -13, -12, -11, -10, -9, -20};
  157. Plane Surface(6) = {6};
  158. Line Loop(7) = {10, -35, -50, -29};
  159. Plane Surface(7) = {7};
  160. Line Loop(8) = {12, -42, -51, -36};
  161. Plane Surface(8) = {8};
  162. Line Loop(9) = {14, -49, -52, -43};
  163. Plane Surface(9) = {9};
  164. Line Loop(10) = {50, -34, -33, -54, -32, -53, -31, -30};
  165. Plane Surface(10) = {10};
  166. Line Loop(11) = {51, -41, -40, -56, -39, -55, -38, -37};
  167. Plane Surface(11) = {11};
  168. Line Loop(12) = {52, -48, -47, -58, -46, -57, -45, -44};
  169. Plane Surface(12) = {12};
  170. Line Loop(13) = {21, 16, -26, -15, -49, -48, -47, -58, -46, -57, -45, -44, -43, -13, -42, -41, -40, -56, -39, -55, -38, -37, -36, -11, -35, -34, -33, -54, -32, -53, -31, -30, -29, -9};
  171. Plane Surface(13) = {13};
  172. // Physical region tags:
  173. rotmagmat = 1; magnet = 2; magnetgap = 3; gaprot = 4; gapstat = 5; statmagmat = 6; windslot = 7; winda = 8; windb = 9; windc = 10;
  174. gammarot = 11; gammastat = 12; gamma1rot = 13; gamma2rot = 14; gamma1stat = 15; gamma2stat = 16; inarc = 17; outarc = 18;
  175. If (isrotor == 1)
  176. Physical Surface(1) = {1};
  177. Physical Surface(2) = {3};
  178. Physical Surface(3) = {2,4};
  179. Physical Surface(4) = {5};
  180. Physical Line(11) = {8};
  181. Physical Line(13) = {17,18,19};
  182. Physical Line(14) = {22,23,24};
  183. Physical Line(17) = {1};
  184. Else
  185. Physical Surface(5) = {6};
  186. Physical Surface(6) = {13};
  187. Physical Surface(7) = {7,8,9};
  188. Physical Surface(8) = {10};
  189. Physical Surface(9) = {11};
  190. Physical Surface(10) = {12};
  191. Physical Line(12) = {8};
  192. Physical Line(15) = {20,21};
  193. Physical Line(16) = {25,26};
  194. Physical Line(18) = {16};
  195. EndIf