inductionheating.geo 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. // This mesh file is part of the "Cohomology" example of software "GetDP" (Patrick Dular and Christophe Geuzaine).
  2. // Only minor adaptations were made to include it as a sparselizard example so all the credit for this great
  3. // geometry and mesh go to the above mentioned persons.
  4. lc = 0.02; // Mesh characteristic length
  5. lc2 = lc;
  6. lc3 = 0;
  7. front3d = 0; // Set to 1 if Frontal 3D mesh algorithm is used
  8. nn = (1./lc)/4.; // Mesh subdivisions per turn, used with Frontal 3D
  9. If(front3d == 1)
  10. Mesh.Algorithm3D = 4; // Frontal 3D
  11. EndIf
  12. Mesh.Optimize = 1;
  13. DefineConstant
  14. [
  15. turns = {5, Name "Geometry/Number of coil turns"},
  16. r = {0.11, Name "Geometry/Coil radius"},
  17. rc = {0.01, Name "Geometry/Coil wire radius"},
  18. hc = {0.2, Name "Geometry/Coil height"},
  19. ht = {0.3, Name "Geometry/Tube height"},
  20. rt1 = {0.081, Name "Geometry/Tube internal radius"},
  21. rt2 = {0.092, Name "Geometry/Tube external radius"},
  22. lb = {1, Name "Geometry/Infinite box width"}
  23. left = {1, Choices{0,1}, Name "Geometry/Terminals on the left?"}
  24. ];
  25. // inductor
  26. p = newp;
  27. Point(p)={0, -r, -hc/2, lc};
  28. Point(p+1)={0, -r+rc, -hc/2, lc};
  29. Point(p+2)={0, -r, -hc/2+rc, lc};
  30. Point(p+3)={0, -r-rc, -hc/2, lc};
  31. Point(p+4)={0, -r, -hc/2-rc,lc};
  32. c = newl;
  33. Circle(c) = {p+1,p,p+2};
  34. Circle(c+1) = {p+2,p,p+3};
  35. Circle(c+2) = {p+3,p,p+4};
  36. Circle(c+3) = {p+4,p,p+1};
  37. ll = newll;
  38. Line Loop(ll) = {c,c+1,c+2,c+3};
  39. s = news;
  40. Plane Surface(s) = {ll};
  41. tmp[] = {s};
  42. vol_coil[] = {};
  43. For j In {1:4*turns+(left?2:0)}
  44. If(front3d == 1)
  45. tmp[] = Extrude { {0,0,hc/turns/4}, {0,0,1} , {0,0,0} , Pi/2}
  46. { Surface {tmp[0]}; Layers {nn / 4}; };
  47. EndIf
  48. If(front3d == 0)
  49. tmp[] = Extrude { {0,0,hc/turns/4}, {0,0,1} , {0,0,0} , Pi/2}
  50. { Surface {tmp[0]}; };
  51. EndIf
  52. vol_coil[] += tmp[1];
  53. EndFor
  54. If(front3d == 1)
  55. tmp[] = Extrude {(left?-1:1)*lb/2, 0, 0} { Surface{tmp[0]}; Layers{nn}; };
  56. EndIf
  57. If(front3d == 0)
  58. tmp[] = Extrude {(left?-1:1)*lb/2, 0, 0} { Surface{tmp[0]}; };
  59. EndIf
  60. vol_coil[] += tmp[1];
  61. out = tmp[0];
  62. If(front3d == 1)
  63. tmp[] = Extrude {-lb/2, 0, 0} { Surface{s}; Layers{nn}; };
  64. EndIf
  65. If(front3d == 0)
  66. tmp[] = Extrude {-lb/2, 0, 0} { Surface{s}; };
  67. EndIf
  68. vol_coil[] += tmp[1];
  69. in = tmp[0];
  70. // tube
  71. p = newp;
  72. Point(p) = {0, 0, -ht/2, lc2};
  73. Point(p+1) = {rt1, 0, -ht/2, lc2};
  74. Point(p+2) = {0, rt1, -ht/2, lc2};
  75. Point(p+3) = {-rt1, 0, -ht/2, lc2};
  76. Point(p+4) = {0, -rt1, -ht/2, lc2};
  77. Point(p+5) = {rt2, 0, -ht/2, lc2};
  78. Point(p+6) = {0, rt2, -ht/2, lc2};
  79. Point(p+7) = {-rt2, 0, -ht/2, lc2};
  80. Point(p+8) = {0, -rt2, -ht/2, lc2};
  81. c = newc;
  82. Circle(c) = {p+1, p, p+2};
  83. Circle(c+1) = {p+2, p, p+3};
  84. Circle(c+2) = {p+3, p, p+4};
  85. Circle(c+3) = {p+4, p, p+1};
  86. Circle(c+4) = {p+5, p, p+6};
  87. Circle(c+5) = {p+6, p, p+7};
  88. Circle(c+6) = {p+7, p, p+8};
  89. Circle(c+7) = {p+8, p, p+5};
  90. ll = newll;
  91. Line Loop(ll) = {c+4, c+5, c+6, c+7, -c, -(c+1), -(c+2), -(c+3)};
  92. s = news;
  93. Plane Surface(s) = {ll};
  94. If(front3d == 1)
  95. tmp[] = Extrude {0,0,ht}{ Surface{s}; Layers{nn}; };
  96. EndIf
  97. If(front3d == 0)
  98. tmp[] = Extrude {0,0,ht}{ Surface{s}; };
  99. EndIf
  100. vol_tube = tmp[1];
  101. // box
  102. p = newp;
  103. Point(p) = {-lb/2,-lb/2,-lb/2, lc3};
  104. Point(p+1) = {lb/2,-lb/2,-lb/2, lc3};
  105. Point(p+2) = {lb/2,lb/2,-lb/2, lc3};
  106. Point(p+3) = {-lb/2,lb/2,-lb/2, lc3};
  107. Point(p+4) = {-lb/2,-lb/2,lb/2, lc3};
  108. Point(p+5) = {lb/2,-lb/2,lb/2, lc3};
  109. Point(p+6) = {lb/2,lb/2,lb/2, lc3};
  110. Point(p+7) = {-lb/2,lb/2,lb/2, lc3};
  111. l = newl;
  112. Line(l) = {p,p+1};
  113. Line(l+1) = {p+1,p+2};
  114. Line(l+2) = {p+2,p+3};
  115. Line(l+3) = {p+3,p};
  116. Line(l+4) = {p+4,p+5};
  117. Line(l+5) = {p+5,p+6};
  118. Line(l+6) = {p+6,p+7};
  119. Line(l+7) = {p+7,p+4};
  120. Line(l+8) = {p, p+4};
  121. Line(l+9) = {p+1, p+5};
  122. Line(l+10) = {p+2, p+6};
  123. Line(l+11) = {p+3, p+7};
  124. ll = newll;
  125. Line Loop(ll) = Boundary {Surface{in}; };
  126. Line Loop(ll+1) = {l+8, -(l+7), -(l+11), l+3};
  127. Line Loop(ll+2) = Boundary {Surface{out}; };
  128. Line Loop(ll+3) = {l+9, l+5, -(l+10), -(l+1)};
  129. Line Loop(ll+4) = {l,l+1,l+2,l+3};
  130. Line Loop(ll+5) = {l+4,l+5,l+6,l+7};
  131. Line Loop(ll+6) = {l+2, l+11, -(l+6), -(l+10)};
  132. Line Loop(ll+7) = {l, l+9, -(l+4), -(l+8)};
  133. s = news;
  134. tmp[] = {ll+1, ll};
  135. If(left)
  136. tmp[] += ll+2;
  137. EndIf
  138. Plane Surface(s) = tmp[];
  139. tmp[] = {ll+3};
  140. If(!left)
  141. tmp[] += ll+2;
  142. EndIf
  143. Plane Surface(s+1) = tmp[];
  144. Plane Surface(s+2) = {ll+4};
  145. Plane Surface(s+3) = {ll+5};
  146. Plane Surface(s+4) = {ll+6};
  147. Plane Surface(s+5) = {ll+7};
  148. sl = newsl;
  149. skin_coil[] = CombinedBoundary{ Volume{vol_coil[]}; };
  150. skin_coil[] -= {in, out};
  151. Surface Loop(sl) = {s:s+5,skin_coil[]};
  152. Surface Loop(sl+1) = CombinedBoundary{ Volume{vol_tube[]}; };
  153. v = newv;
  154. Volume(v) = {sl, sl+1};
  155. COIL = 1;
  156. TUBE = 2;
  157. AIR = 3;
  158. SKIN_COIL = 4;
  159. SKIN_TUBE = 5;
  160. IN = 6;
  161. OUT = 7;
  162. INF = 8;
  163. Physical Volume(COIL) = {vol_coil[]};
  164. Physical Volume(TUBE) = {vol_tube[]};
  165. Physical Volume(AIR) = {v};
  166. Physical Surface(SKIN_COIL) = {skin_coil[]};
  167. Physical Surface(SKIN_TUBE) = CombinedBoundary{ Volume{vol_tube[]}; };
  168. Physical Surface(IN) = in;
  169. Physical Surface(OUT) = out;
  170. Physical Surface(INF) = {s:s+5};