airfoil2D.geo 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. /*************************************************
  2. DEFINITION OF C-MESH FOR NACA 4-DIGIT AIRFOIL (courtesy of Adrien Crovato)
  3. **************************************************/
  4. //// Physical Groups numbering
  5. IntField = 1;
  6. Airfoil = 2;
  7. Downstream = 3;
  8. Upstream = 4;
  9. Wake = 5;
  10. // Numerical method
  11. maxIter = 15;
  12. relTol = 1.e-5;
  13. absTol = 1.e-5;
  14. //// Freestream
  15. M_infty = 0.7;
  16. alpha = 0*Pi/180;
  17. /* PARAMETERS DEFINED BY USER
  18. *****************************/
  19. // GEOMETRY PARAMETERS
  20. //prop = 8/10;
  21. verticalBorder = 5;
  22. angleLeading = 60*Pi/180;
  23. trailingLength = 5;
  24. // MESHING PARAMETERS
  25. nbElementsLeading = 25;
  26. nbElementsChord = 75;
  27. nbElementsBorder = 30;
  28. nbElementsHorizontalTrailing = 30;
  29. progressionLeading = 1.08;
  30. progressionChord = 1.0;
  31. progressionBorder = 1.15;
  32. progressionHorizontalTrailing = 1.15;
  33. /* GRID DEFINITION
  34. ******************/
  35. // GENERATION OF AIRFOIL
  36. N = 201; //number of points defining NACA (must be odd)
  37. Point(1) = {1.000000,0.000000,0};
  38. Point(2) = {0.999753,-0.000035,0};
  39. Point(3) = {0.999013,-0.000141,0};
  40. Point(4) = {0.997781,-0.000317,0};
  41. Point(5) = {0.996057,-0.000562,0};
  42. Point(6) = {0.993844,-0.000876,0};
  43. Point(7) = {0.991144,-0.001258,0};
  44. Point(8) = {0.987958,-0.001707,0};
  45. Point(9) = {0.984292,-0.002222,0};
  46. Point(10) = {0.980147,-0.002801,0};
  47. Point(11) = {0.975528,-0.003443,0};
  48. Point(12) = {0.970440,-0.004147,0};
  49. Point(13) = {0.964888,-0.004909,0};
  50. Point(14) = {0.958877,-0.005729,0};
  51. Point(15) = {0.952414,-0.006603,0};
  52. Point(16) = {0.945503,-0.007531,0};
  53. Point(17) = {0.938153,-0.008510,0};
  54. Point(18) = {0.930371,-0.009537,0};
  55. Point(19) = {0.922164,-0.010610,0};
  56. Point(20) = {0.913540,-0.011726,0};
  57. Point(21) = {0.904508,-0.012883,0};
  58. Point(22) = {0.895078,-0.014079,0};
  59. Point(23) = {0.885257,-0.015310,0};
  60. Point(24) = {0.875056,-0.016574,0};
  61. Point(25) = {0.864484,-0.017868,0};
  62. Point(26) = {0.853553,-0.019189,0};
  63. Point(27) = {0.842274,-0.020535,0};
  64. Point(28) = {0.830656,-0.021904,0};
  65. Point(29) = {0.818712,-0.023291,0};
  66. Point(30) = {0.806454,-0.024694,0};
  67. Point(31) = {0.793893,-0.026111,0};
  68. Point(32) = {0.781042,-0.027539,0};
  69. Point(33) = {0.767913,-0.028974,0};
  70. Point(34) = {0.754521,-0.030414,0};
  71. Point(35) = {0.740877,-0.031856,0};
  72. Point(36) = {0.726995,-0.033296,0};
  73. Point(37) = {0.712890,-0.034733,0};
  74. Point(38) = {0.698574,-0.036163,0};
  75. Point(39) = {0.684062,-0.037582,0};
  76. Point(40) = {0.669369,-0.038988,0};
  77. Point(41) = {0.654508,-0.040378,0};
  78. Point(42) = {0.639496,-0.041747,0};
  79. Point(43) = {0.624345,-0.043094,0};
  80. Point(44) = {0.609072,-0.044414,0};
  81. Point(45) = {0.593691,-0.045705,0};
  82. Point(46) = {0.578217,-0.046962,0};
  83. Point(47) = {0.562667,-0.048182,0};
  84. Point(48) = {0.547054,-0.049362,0};
  85. Point(49) = {0.531395,-0.050499,0};
  86. Point(50) = {0.515705,-0.051587,0};
  87. Point(51) = {0.500000,-0.052625,0};
  88. Point(52) = {0.484295,-0.053608,0};
  89. Point(53) = {0.468605,-0.054534,0};
  90. Point(54) = {0.452946,-0.055397,0};
  91. Point(55) = {0.437333,-0.056195,0};
  92. Point(56) = {0.421783,-0.056924,0};
  93. Point(57) = {0.406309,-0.057581,0};
  94. Point(58) = {0.390928,-0.058163,0};
  95. Point(59) = {0.375655,-0.058666,0};
  96. Point(60) = {0.360504,-0.059087,0};
  97. Point(61) = {0.345492,-0.059424,0};
  98. Point(62) = {0.330631,-0.059674,0};
  99. Point(63) = {0.315938,-0.059834,0};
  100. Point(64) = {0.301426,-0.059902,0};
  101. Point(65) = {0.287110,-0.059876,0};
  102. Point(66) = {0.273005,-0.059754,0};
  103. Point(67) = {0.259123,-0.059535,0};
  104. Point(68) = {0.245479,-0.059217,0};
  105. Point(69) = {0.232087,-0.058799,0};
  106. Point(70) = {0.218958,-0.058280,0};
  107. Point(71) = {0.206107,-0.057661,0};
  108. Point(72) = {0.193546,-0.056940,0};
  109. Point(73) = {0.181288,-0.056119,0};
  110. Point(74) = {0.169344,-0.055197,0};
  111. Point(75) = {0.157726,-0.054176,0};
  112. Point(76) = {0.146447,-0.053056,0};
  113. Point(77) = {0.135516,-0.051839,0};
  114. Point(78) = {0.124944,-0.050527,0};
  115. Point(79) = {0.114743,-0.049121,0};
  116. Point(80) = {0.104922,-0.047624,0};
  117. Point(81) = {0.095492,-0.046037,0};
  118. Point(82) = {0.086460,-0.044364,0};
  119. Point(83) = {0.077836,-0.042608,0};
  120. Point(84) = {0.069629,-0.040770,0};
  121. Point(85) = {0.061847,-0.038854,0};
  122. Point(86) = {0.054497,-0.036863,0};
  123. Point(87) = {0.047586,-0.034800,0};
  124. Point(88) = {0.041123,-0.032668,0};
  125. Point(89) = {0.035112,-0.030471,0};
  126. Point(90) = {0.029560,-0.028212,0};
  127. Point(91) = {0.024472,-0.025893,0};
  128. Point(92) = {0.019853,-0.023517,0};
  129. Point(93) = {0.015708,-0.021088,0};
  130. Point(94) = {0.012042,-0.018607,0};
  131. Point(95) = {0.008856,-0.016078,0};
  132. Point(96) = {0.006156,-0.013503,0};
  133. Point(97) = {0.003943,-0.010884,0};
  134. Point(98) = {0.002219,-0.008223,0};
  135. Point(99) = {0.000987,-0.005521,0};
  136. Point(100) = {0.000247,-0.002779,0};
  137. Point(101) = {0.000000,0.000000,0};
  138. Point(102) = {0.000247,0.002779,0};
  139. Point(103) = {0.000987,0.005521,0};
  140. Point(104) = {0.002219,0.008223,0};
  141. Point(105) = {0.003943,0.010884,0};
  142. Point(106) = {0.006156,0.013503,0};
  143. Point(107) = {0.008856,0.016078,0};
  144. Point(108) = {0.012042,0.018607,0};
  145. Point(109) = {0.015708,0.021088,0};
  146. Point(110) = {0.019853,0.023517,0};
  147. Point(111) = {0.024472,0.025893,0};
  148. Point(112) = {0.029560,0.028212,0};
  149. Point(113) = {0.035112,0.030471,0};
  150. Point(114) = {0.041123,0.032668,0};
  151. Point(115) = {0.047586,0.034800,0};
  152. Point(116) = {0.054497,0.036863,0};
  153. Point(117) = {0.061847,0.038854,0};
  154. Point(118) = {0.069629,0.040770,0};
  155. Point(119) = {0.077836,0.042608,0};
  156. Point(120) = {0.086460,0.044364,0};
  157. Point(121) = {0.095492,0.046037,0};
  158. Point(122) = {0.104922,0.047624,0};
  159. Point(123) = {0.114743,0.049121,0};
  160. Point(124) = {0.124944,0.050527,0};
  161. Point(125) = {0.135516,0.051839,0};
  162. Point(126) = {0.146447,0.053056,0};
  163. Point(127) = {0.157726,0.054176,0};
  164. Point(128) = {0.169344,0.055197,0};
  165. Point(129) = {0.181288,0.056119,0};
  166. Point(130) = {0.193546,0.056940,0};
  167. Point(131) = {0.206107,0.057661,0};
  168. Point(132) = {0.218958,0.058280,0};
  169. Point(133) = {0.232087,0.058799,0};
  170. Point(134) = {0.245479,0.059217,0};
  171. Point(135) = {0.259123,0.059535,0};
  172. Point(136) = {0.273005,0.059754,0};
  173. Point(137) = {0.287110,0.059876,0};
  174. Point(138) = {0.301426,0.059902,0};
  175. Point(139) = {0.315938,0.059834,0};
  176. Point(140) = {0.330631,0.059674,0};
  177. Point(141) = {0.345492,0.059424,0};
  178. Point(142) = {0.360504,0.059087,0};
  179. Point(143) = {0.375655,0.058666,0};
  180. Point(144) = {0.390928,0.058163,0};
  181. Point(145) = {0.406309,0.057581,0};
  182. Point(146) = {0.421783,0.056924,0};
  183. Point(147) = {0.437333,0.056195,0};
  184. Point(148) = {0.452946,0.055397,0};
  185. Point(149) = {0.468605,0.054534,0};
  186. Point(150) = {0.484295,0.053608,0};
  187. Point(151) = {0.500000,0.052625,0};
  188. Point(152) = {0.515705,0.051587,0};
  189. Point(153) = {0.531395,0.050499,0};
  190. Point(154) = {0.547054,0.049362,0};
  191. Point(155) = {0.562667,0.048182,0};
  192. Point(156) = {0.578217,0.046962,0};
  193. Point(157) = {0.593691,0.045705,0};
  194. Point(158) = {0.609072,0.044414,0};
  195. Point(159) = {0.624345,0.043094,0};
  196. Point(160) = {0.639496,0.041747,0};
  197. Point(161) = {0.654508,0.040378,0};
  198. Point(162) = {0.669369,0.038988,0};
  199. Point(163) = {0.684062,0.037582,0};
  200. Point(164) = {0.698574,0.036163,0};
  201. Point(165) = {0.712890,0.034733,0};
  202. Point(166) = {0.726995,0.033296,0};
  203. Point(167) = {0.740877,0.031856,0};
  204. Point(168) = {0.754521,0.030414,0};
  205. Point(169) = {0.767913,0.028974,0};
  206. Point(170) = {0.781042,0.027539,0};
  207. Point(171) = {0.793893,0.026111,0};
  208. Point(172) = {0.806454,0.024694,0};
  209. Point(173) = {0.818712,0.023291,0};
  210. Point(174) = {0.830656,0.021904,0};
  211. Point(175) = {0.842274,0.020535,0};
  212. Point(176) = {0.853553,0.019189,0};
  213. Point(177) = {0.864484,0.017868,0};
  214. Point(178) = {0.875056,0.016574,0};
  215. Point(179) = {0.885257,0.015310,0};
  216. Point(180) = {0.895078,0.014079,0};
  217. Point(181) = {0.904508,0.012883,0};
  218. Point(182) = {0.913540,0.011726,0};
  219. Point(183) = {0.922164,0.010610,0};
  220. Point(184) = {0.930371,0.009537,0};
  221. Point(185) = {0.938153,0.008510,0};
  222. Point(186) = {0.945503,0.007531,0};
  223. Point(187) = {0.952414,0.006603,0};
  224. Point(188) = {0.958877,0.005729,0};
  225. Point(189) = {0.964888,0.004909,0};
  226. Point(190) = {0.970440,0.004147,0};
  227. Point(191) = {0.975528,0.003443,0};
  228. Point(192) = {0.980147,0.002801,0};
  229. Point(193) = {0.984292,0.002222,0};
  230. Point(194) = {0.987958,0.001707,0};
  231. Point(195) = {0.991144,0.001258,0};
  232. Point(196) = {0.993844,0.000876,0};
  233. Point(197) = {0.996057,0.000562,0};
  234. Point(198) = {0.997781,0.000317,0};
  235. Point(199) = {0.999013,0.000141,0};
  236. Point(200) = {0.999753,0.000035,0};
  237. //Points numerotation:
  238. numberLeadingEgde = 101 ;
  239. numberLowerSurface = 81 ;
  240. numberUpperSurface = 121 ;
  241. //Distances:
  242. distanceTrailingLowerPoint = 0.908262 ;
  243. distanceLowerUpperPoint = 0.222905 ;
  244. distanceUpperTrailingPoint = 0.908262 ;
  245. Line(1) = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81};
  246. Line(2) = {81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101};
  247. Line(3) = {101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121};
  248. Line(4) = {121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,1};
  249. Line Loop(1) = {1,2,3,4};
  250. Plane Surface(1) = {1};
  251. /**********************************
  252. ELLIPTICAL ARCS
  253. **********************************/
  254. semiVerticalAxes = verticalBorder;
  255. semiHorizontalAxes = verticalBorder;
  256. Point(10001) = {1, -semiVerticalAxes, 0} ;
  257. Point(10002) = {-semiHorizontalAxes*Cos(angleLeading)+1,
  258. -semiVerticalAxes*Sin(angleLeading), 0} ;
  259. Point(10003) = {-semiVerticalAxes+1,0,0};
  260. Point(10004) = {-semiHorizontalAxes*Cos(angleLeading)+1,
  261. semiVerticalAxes*Sin(angleLeading), 0} ;
  262. Point(10005) = {1, semiVerticalAxes, 0} ;
  263. Circle(10001) = {10001, 1, 10002};
  264. Circle(10002) = {10002, 1, 10003};
  265. Circle(10003) = {10003, 1, 10004};
  266. Circle(10004) = {10004, 1, 10005};
  267. Line(10005) = {1, 10001};
  268. Line(10006) = {numberLowerSurface,10002};
  269. Line(10007) = {numberLeadingEgde,10003};
  270. Line(10008) = {numberUpperSurface,10004};
  271. Line(10009) = {1, 10005};
  272. Line Loop(10001) = {1, 10006, -10001, -10005};
  273. Line Loop(10002) = {2, 10007, -10002,-10006};
  274. Line Loop(10003) = {3, 10008, -10003, -10007};
  275. Line Loop(10004) = {4, 10009, -10004, -10008};
  276. Plane Surface(10001) = {10001};
  277. Plane Surface(10002) = {10002};
  278. Plane Surface(10003) = {10003};
  279. Plane Surface(10004) = {10004};
  280. /*******************************
  281. TRAILING PART
  282. *******************************/
  283. Point(20001) = {trailingLength+1, verticalBorder, 0} ;
  284. Point(20002) = {trailingLength+1, 0, 0} ;
  285. Point(20003) = {trailingLength+1,-verticalBorder, 0} ;
  286. Line(20001) = {10005, 20001};
  287. Line(20002) = {20002, 20001};
  288. Line(20003) = {20002, 20003};
  289. Line(20004) = {10001, 20003};
  290. Line(20005) = {1, 20002};
  291. Line Loop(20001) = {20005, 20002, -20001, -10009};
  292. Line Loop(20002) = {10005, 20004, -20003, -20005};
  293. Plane Surface(20001) = {20001};
  294. Plane Surface(20002) = {20002};
  295. /*************************
  296. MESHING
  297. *************************/
  298. nbNodesBorder = nbElementsBorder + 1;
  299. nbNodesChord = nbElementsChord + 1;
  300. nbNodesLeading = nbElementsLeading + 1;
  301. nbNodesHorizontalTrailing = nbElementsHorizontalTrailing +1;
  302. Delete {Surface{1};} // no grid on airfoil
  303. Transfinite Line {1} = nbNodesChord Using Progression 1/progressionChord;
  304. Transfinite Line {10001} = nbNodesChord Using Progression 1;
  305. Transfinite Line {10005,10006} = nbNodesBorder Using Progression progressionBorder;
  306. Transfinite Surface{10001} = {1, 10001, 10002, numberLowerSurface};
  307. Recombine Surface {10001};
  308. Transfinite Line {10006,10007} = nbNodesBorder Using Progression progressionBorder;
  309. Transfinite Line {2,10002} = nbNodesLeading Using Progression 1/progressionLeading;
  310. Transfinite Surface{10002} = {numberLowerSurface, 10002, 10003, numberLeadingEgde};
  311. Recombine Surface {10002};
  312. Transfinite Line {10007,10008} = nbNodesBorder Using Progression progressionBorder;
  313. Transfinite Line {3,10003} = nbNodesLeading Using Progression progressionLeading;
  314. Transfinite Surface{10003} = {numberLeadingEgde, 10003, 10004, numberUpperSurface};
  315. Recombine Surface {10003};
  316. Transfinite Line {4} = nbNodesChord Using Progression progressionChord;
  317. Transfinite Line {10004} = nbNodesChord Using Progression 1;
  318. Transfinite Line {10008,10009} = nbNodesBorder Using Progression progressionBorder;
  319. Transfinite Surface{10004} = {1, numberUpperSurface, 10004, 10005};
  320. Recombine Surface {10004};
  321. Transfinite Line {10009,20002} = nbNodesBorder Using Progression progressionBorder;
  322. Transfinite Line {20001,20005} = nbNodesHorizontalTrailing Using Progression progressionHorizontalTrailing;
  323. Transfinite Surface{20001} = {1, 20002, 20001, 10005};
  324. Recombine Surface {20001};
  325. Transfinite Line {10005,20003} = nbNodesBorder Using Progression progressionBorder;
  326. Transfinite Line {20004,20005} = nbNodesHorizontalTrailing Using Progression progressionHorizontalTrailing;
  327. Transfinite Surface{20002} = {1, 20002, 20003, 10001};
  328. Recombine Surface {20002};
  329. Physical Line(Upstream) = {10001, 10002, 10003, 10004};
  330. Physical Line(Downstream) = {20001, 20002, 20003, 20004};
  331. Physical Line(Wake) = {2005};
  332. Physical Line(Airfoil) = {1, 2, 3, 4};
  333. Physical Surface(IntField) = {10001, 10002, 10003, 10004, 20001, 20002};