001/* 002* NACA65ASeries -- An arbitrary NACA 65A series airfoil. 003* 004* Copyright (C) 2010-2025, by Joseph A. Huwaldt. All rights reserved. 005* 006* This library is free software; you can redistribute it and/or 007* modify it under the terms of the GNU Lesser General Public 008* License as published by the Free Software Foundation; either 009* version 2.1 of the License, or (at your option) any later version. 010* 011* This library is distributed in the hope that it will be useful, 012* but WITHOUT ANY WARRANTY; without even the implied warranty of 013* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014* Lesser General Public License for more details. 015* 016* You should have received a copy of the GNU Lesser General Public License 017* along with this program; if not, write to the Free Software 018* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 019* Or visit: http://www.gnu.org/licenses/lgpl.html 020*/ 021package jahuwaldt.aero.airfoils; 022 023import java.util.List; 024import java.awt.geom.Point2D; 025import java.text.DecimalFormat; 026import java.text.NumberFormat; 027 028 029/** 030* <p> This class represents an arbitrary NACA 65A series 031* airfoil section such as a NACA 65A020 airfoil. 032* </p> 033* 034* <p> Ported from FORTRAN "NACA6.FOR" to Java by: 035* Joseph A. Huwaldt, June 4, 2010 </p> 036* 037* <p> Original FORTRAN "NACA4" code had the following note: </p> 038* 039* <pre> 040* AUTHORS - Charles L.Ladson and Cuyler W. Brooks, NASA Langley 041* Liam Hardy, NASA Ames 042* Ralph Carmichael, Public Domain Aeronautical Software 043* Last FORTRAN version: 23Nov96 2.0 RLC 044* 045* NOTES - This program has also been known as LADSON and SIXSERIES and 046* as SIXSERIE on systems with a 8-letter name limit. 047* REFERENCES- NASA Technical Memorandum TM X-3069 (September, 1974), 048* by Charles L. Ladson and Cuyler W. Brooks, Jr., NASA Langley Research Center. 049* 050* "Theory of Wing Sections", by Ira Abbott and Albert Von Doenhoff. 051* </pre> 052* 053* <p> Modified by: Joseph A. Huwaldt </p> 054* 055* @author Joseph A. Huwaldt Date: June 6, 2010 056* @version February 22, 2025 057*/ 058public class NACA65ASeries extends NACA6ASeries { 059 060 //----------------------------------------------------------------------------------- 061 062 /** 063 * Create a NACA 65A series airfoil with the specified parameters. 064 * 065 * @param CLi Design lift coefficient (e.g.: 65A206 has CLi = 0.2). 066 * @param thickness The thickness to chord ratio (e.g.: 0.20 == 20% t/c). 067 * @param length The chord length. 068 */ 069 public NACA65ASeries(double CLi, double thickness, double length) { 070 super(CLi, thickness, length); 071 } 072 073 /** 074 * Returns a String that represents the profile type of this airfoil. 075 */ 076 @Override 077 public String getProfile() { 078 return "65A"; 079 } 080 081 // Phi & eps vectors for 65A series airfoil. 082 private static final double[] philde = { 083 0.,.01453,.02907, 084 .0436,.05814,.07267,.08721,.10175, 085 .1163,.13084,.14539,.14877, 086 .15214,.15552,.15889,.16227,.16564, 087 .16902,.1724,.17578,.17916, 088 .18436,.18956,.19477,.19997,.20518, 089 .21039,.21559,.2208,.22601, 090 .23122,.24077,.25032,.25987,.26941, 091 .27896,.28851,.29805,.3076, 092 .31714,.32669,.33996,.35322,.36649, 093 .37976,.39302,.40629,.41956, 094 .43283,.4461,.45937,.46976,.48015, 095 .49054,.50093,.51132,.52171, 096 .5321,.54249,.55288,.56327,.57223, 097 .58118,.59014,.59909,.60805, 098 .617,.62596,.63491,.64387,.65282, 099 .66829,.68376,.69923,.7147, 100 .73017,.74564,.7611,.77657,.79204, 101 .8075,.82106,.83461,.84816, 102 .86172,.87527,.88882,.90237,.91593, 103 .92948,.94303,.95538,.96772, 104 .98007,.99242,1.00476,1.01711,1.02945, 105 1.0418,1.05415,1.06649,1.0781, 106 1.08971,1.10132,1.11293,1.12454, 107 1.13615,1.14776,1.15937,1.17098, 108 1.18259,1.19373,1.20486,1.216,1.22713, 109 1.23827,1.2494,1.26054,1.27167, 110 1.28281,1.29394,1.30473,1.31552, 111 1.32631,1.33711,1.3479,1.35869, 112 1.36948,1.38027,1.39106,1.40185, 113 1.41248,1.42312,1.43375,1.44438, 114 1.45501,1.46564,1.47628,1.48691, 115 1.49754,1.50817,1.51872,1.52927, 116 1.53983,1.55038,1.56093,1.57148, 117 1.58203,1.59258,1.60314,1.61369, 118 1.62418,1.63467,1.64516,1.65565, 119 1.66614,1.67663,1.68712,1.69762, 120 1.70811,1.7186,1.72914,1.73967,1.7502, 121 1.76074,1.77127,1.78181,1.79234, 122 1.80288,1.81341,1.82395,1.8346, 123 1.84526,1.85591,1.86657,1.87722, 124 1.88788,1.89853,1.90919,1.91985, 125 1.9305,1.94138,1.95225,1.96313, 126 1.97401,1.98488,1.99576,2.00664, 127 2.01751,2.02839,2.03927,2.04786, 128 2.05645,2.06504,2.07363,2.08222, 129 2.09081,2.0994,2.10799,2.11658, 130 2.12517,2.13979,2.15441,2.16903, 131 2.18365,2.19826,2.21288,2.2275, 132 2.24211,2.25673,2.27134,2.28424, 133 2.29714,2.31003,2.32292,2.33582, 134 2.34871,2.3616,2.37449,2.38739, 135 2.40028,2.4149,2.42952,2.44413, 136 2.45875,2.47336,2.48798,2.50259, 137 2.51719,2.5318,2.5464,2.56435,2.58229, 138 2.60023,2.61816,2.6361,2.65402, 139 2.67195,2.68987,2.70779,2.72571, 140 2.76731,2.80891,2.8505,2.89209, 141 2.93368,2.97526,3.01684,3.05843, 142 3.10001,3.14159 }; 143 144 private static final double[] epslde = { 145 0.,.00137,.00274, 146 .0041,.00545,.00679,.00811,.00941, 147 .0107,.01195,.01318,.01346, 148 .01374,.01401,.01427,.01453,.01477, 149 .015,.01521,.01541,.01559, 150 .01583,.01602,.01618,.0163,.0164, 151 .01648,.01654,.0166,.01665, 152 .01671,.01683,.01698,.01715,.01732, 153 .01749,.01766,.01782,.01796, 154 .01807,.01814,.01819,.01816,.01807, 155 .01793,.01775,.01755,.01732, 156 .01708,.01684,.01661,.01644,.01628, 157 .01614,.01601,.01589,.01578, 158 .01569,.01561,.01554,.01549,.01546, 159 .01543,.01541,.01541,.01541, 160 .01542,.01544,.01547,.01551,.01555, 161 .01565,.01577,.0159,.01607, 162 .01625,.01645,.01668,.01693,.0172, 163 .0175,.01778,.01807,.01837, 164 .01869,.01902,.01936,.0197,.02005, 165 .0204,.02076,.02108,.02141, 166 .02174,.02207,.0224,.02274,.02309, 167 .02344,.02381,.02418,.02454, 168 .02491,.02528,.02567,.02607,.02647, 169 .02689,.02731,.02775,.02819, 170 .02863,.02907,.02952,.02998,.03044, 171 .03091,.03138,.03185,.03232, 172 .0328,.03326,.03371,.03417,.03463, 173 .0351,.03557,.03604,.03652, 174 .03701,.0375,.038,.03851,.03902, 175 .03954,.04007,.0406,.04114, 176 .04169,.04224,.04279,.04335,.04391, 177 .04447,.04502,.04558,.04614, 178 .04669,.04723,.04777,.0483,.04882, 179 .04933,.04984,.05033,.05082, 180 .0513,.05177,.05224,.0527,.05316, 181 .05361,.05406,.05449,.05493, 182 .05535,.05577,.05618,.05657,.05696, 183 .05734,.05771,.05807,.05842, 184 .05876,.05908,.05939,.05969,.05997, 185 .06023,.06049,.06073,.06095, 186 .06116,.06135,.06153,.0617,.06185, 187 .06199,.06212,.06224,.06232, 188 .0624,.06247,.06254,.06259,.06264, 189 .06268,.06272,.06274,.06276, 190 .06277,.06275,.06271,.06264,.06255, 191 .06242,.06226,.06207,.06185, 192 .06159,.06134,.06106,.06075,.06042, 193 .06007,.0597,.05932,.05891, 194 .0585,.05807,.05756,.05704,.0565, 195 .05592,.05531,.05466,.05397, 196 .05323,.05244,.05159,.05046,.04925, 197 .04795,.04659,.04517,.0437, 198 .0422,.04065,.03909,.03751,.03383, 199 .03013,.0264,.02266,.01891, 200 .01514,.01136,.00758,.00379,0. }; 201 202 /** 203 * Fill in phi, eps vectors for 65A series airfoil. 204 * 205 * @param phi An existing array with 201 elements to be filled in 206 * by this method. 207 * @param eps An existing array with 201 elements to be filled in 208 * by this method. 209 */ 210 @Override 211 protected final void phep(double[] phi, double[] eps) { 212 double[] bb = new double[251]; 213 double[] cc = new double[251]; 214 double[] dd = new double[251]; 215 216 spline(251,philde,epslde,bb,cc,dd); 217 for (int i=0; i < 201; ++i) { 218 phi[i] = i*Math.PI/200.; 219 eps[i] = seval(251,phi[i],philde,epslde,bb,cc,dd); 220 } 221 } 222 223 224 // Phi & eps vectors for 65A series airfoil. 225 private static final double[] philds = { 226 0.,.01455,.0291, 227 .04364,.05819,.07273,.08727,.10181, 228 .11634,.13087,.14539,.14877, 229 .15214,.15552,.1589,.16227,.16565, 230 .16903,.1724,.17578,.17916, 231 .18436,.18956,.19477,.19997,.20518, 232 .21039,.2156,.2208,.22601, 233 .23122,.24077,.25032,.25986,.26941, 234 .27896,.2885,.29805,.3076, 235 .31714,.32669,.33995,.35322,.36648, 236 .37974,.39301,.40628,.41955, 237 .43282,.44609,.45937,.46975,.48014, 238 .49053,.50092,.51131,.5217, 239 .5321,.54249,.55288,.56327,.57223, 240 .58118,.59014,.59909,.60805, 241 .617,.62596,.63491,.64387,.65282, 242 .66829,.68376,.69923,.7147, 243 .73016,.74563,.7611,.77657,.79204, 244 .8075,.82106,.83461,.84816, 245 .86171,.87527,.88882,.90237,.91592, 246 .92948,.94303,.95538,.96772, 247 .98007,.99241,1.00476,1.01711,1.02945, 248 1.0418,1.05414,1.06649,1.0781, 249 1.08971,1.10132,1.11293,1.12454, 250 1.13615,1.14776,1.15937,1.17098, 251 1.18259,1.19372,1.20486,1.21599, 252 1.22713,1.23827,1.2494,1.26054, 253 1.27167,1.28281,1.29394,1.30473, 254 1.31552,1.32631,1.3371,1.3479,1.35869, 255 1.36948,1.38027,1.39106,1.40185, 256 1.41248,1.42311,1.43375,1.44438, 257 1.45501,1.46564,1.47628,1.48691, 258 1.49754,1.50817,1.51872,1.52928, 259 1.53983,1.55038,1.56094,1.57149, 260 1.58204,1.59259,1.60314,1.61369, 261 1.62418,1.63468,1.64517,1.65566, 262 1.66616,1.67665,1.68714,1.69763, 263 1.70811,1.7186,1.72914,1.73968, 264 1.75021,1.76075,1.77128,1.78182, 265 1.79235,1.80289,1.81342,1.82395, 266 1.83461,1.84527,1.85592,1.86658, 267 1.87723,1.88789,1.89854,1.9092, 268 1.91985,1.9305,1.94138,1.95226, 269 1.96314,1.97402,1.98489,1.99577, 270 2.00664,2.01752,2.02839,2.03927, 271 2.05056,2.06185,2.07314,2.08444, 272 2.09573,2.10702,2.11831,2.1296, 273 2.14089,2.15217,2.16409,2.17601, 274 2.18793,2.19985,2.21176,2.22368, 275 2.2356,2.24751,2.25943,2.27134, 276 2.28424,2.29713,2.31002,2.32292, 277 2.33581,2.3487,2.36159,2.37449, 278 2.38738,2.40028,2.41489,2.4295, 279 2.44411,2.45872,2.47334,2.48795, 280 2.50256,2.51717,2.53178,2.5464, 281 2.56432,2.58225,2.60018,2.6181, 282 2.63603,2.65396,2.67189,2.68983, 283 2.70777,2.72571,2.76723,2.80877, 284 2.85033,2.8919,2.9335,2.9751,3.01671, 285 3.05834,3.09996,3.14159 }; 286 287 private static final double[] psilds = { 288 .14761,.14748,.14709, 289 .14649,.1457,.14476,.14369, 290 .14253,.14131,.14007,.13882,.13854, 291 .13826,.13798,.1377,.13743, 292 .13716,.1369,.13665,.1364,.13616, 293 .13581,.13547,.13515,.13484, 294 .13455,.13426,.13398,.13371,.13345, 295 .13318,.1327,.13221,.13172, 296 .13124,.13075,.13026,.12976,.12926, 297 .12876,.12825,.12753,.12681, 298 .1261,.12541,.12475,.12415,.12359, 299 .12311,.1227,.12239,.12221, 300 .12209,.12202,.12199,.12199,.12203, 301 .12209,.12216,.12224,.12233, 302 .1224,.12246,.12253,.12259,.12265, 303 .12271,.12277,.12283,.12289, 304 .12295,.12305,.12316,.12326,.12337, 305 .12348,.12359,.1237,.12381, 306 .12391,.12401,.1241,.12418,.12426, 307 .12434,.12441,.12448,.12455, 308 .12461,.12467,.12472,.12477,.12482, 309 .12486,.12489,.12492,.12495, 310 .12498,.125,.12501,.12502,.12503, 311 .12503,.12502,.12501,.125, 312 .12498,.12495,.12492,.12489,.12485, 313 .12481,.12476,.12471,.12465, 314 .12459,.12452,.12445,.12437,.12428, 315 .12419,.12409,.12398,.12387, 316 .12375,.12362,.12349,.12334,.12319, 317 .12303,.12286,.12268,.12249, 318 .12229,.12208,.12186,.12163,.12138, 319 .12113,.12085,.12057,.12027, 320 .11996,.11964,.1193,.11894,.11857, 321 .11818,.11778,.11736,.11693, 322 .11648,.11602,.11554,.11504,.11453, 323 .114,.11346,.11291,.11234, 324 .11175,.11115,.11054,.10991,.10928, 325 .10863,.10797,.1073,.10662, 326 .10594,.10524,.10453,.10381,.10308, 327 .10235,.10161,.10086,.1001, 328 .09933,.09856,.09778,.09698,.09617, 329 .09535,.09452,.09369,.09285, 330 .09201,.09116,.0903,.08943,.08853, 331 .08763,.08671,.08579,.08487, 332 .08394,.08301,.08207,.08113,.08019, 333 .07919,.07818,.07717,.07616, 334 .07515,.07413,.07311,.07209,.07106, 335 .07004,.06892,.06781,.0667, 336 .06559,.06448,.06338,.06229,.06119, 337 .06011,.05904,.05783,.05664, 338 .05545,.05427,.05309,.05191,.05072, 339 .04953,.04834,.04713,.04564, 340 .04413,.04263,.04114,.03967,.03823, 341 .03683,.03549,.03421,.033, 342 .03052,.02844,.02675,.02539,.02434, 343 .02355,.02301,.02266,.02248, 344 .02242 }; 345 346 /** 347 * Fill in the psi vector for a 65A series airfoil. 348 * 349 * @param phi An array filled in by phep(). 350 * @param psi An existing array with 201 elements to be filled in 351 * by this method. 352 */ 353 @Override 354 protected final void phps(double[] phi, double[] psi) { 355 double[] bb = new double[251]; 356 double[] cc = new double[251]; 357 double[] dd = new double[251]; 358 spline(251, philds, psilds, bb, cc, dd); 359 for (int i=0; i < 201; ++i) { 360 psi[i] = seval(251, phi[i], philds, psilds, bb, cc, dd); 361 } 362 } 363 364 /** 365 * Simple method to test this class. 366 * 367 * @param args the command-line arguments 368 */ 369 public static void main(String[] args) { 370 371 DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(); 372 nf.setMaximumFractionDigits(5); 373 nf.setMinimumFractionDigits(5); 374 375 System.out.println("Start NACA65ASeries..."); 376 377 System.out.println("Creating a NACA 65A206 airfoil..."); 378 Airfoil af = new NACA65ASeries(0.2, 0.06, 1); 379 380 System.out.println("Airfoil = " + af.toString()); 381 382 // Output the upper surface of the airfoil. 383 List<Point2D> upper = af.getUpper(); 384 List<Double> ypArr = af.getUpperYp(); 385 System.out.println("upper.size() = " + upper.size() + ", ypArr.size() = " + ypArr.size()); 386 387 System.out.println(" X \t Y \t dy/dx"); 388 int length = upper.size(); 389 for (int i=0; i < length; ++i) { 390 Point2D o = upper.get(i); 391 System.out.println(" " + nf.format(o.getX()) + "\t" + nf.format(o.getY()) + 392 "\t" + nf.format(ypArr.get(i))); 393 } 394 395 System.out.println("# ordinates = " + length); 396 System.out.println("Done!"); 397 } 398} 399 400