001/* 002* NACA65Series -- An arbitrary NACA 65 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 65 series 031* airfoil section such as a NACA 65-020 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 5, 2010 056* @version February 22, 2025 057*/ 058public class NACA65Series extends NACA6Series { 059 060 //----------------------------------------------------------------------------------- 061 062 /** 063 * Create a NACA 65 series airfoil with the specified parameters. 064 * 065 * @param CLi Design lift coefficient (e.g.: 65-206 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 NACA65Series(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 "65"; 079 } 080 081 // Phi & eps vectors for 65 series airfoil. 082 private static final double[] philde = { 083 0.,.01484,.02967, 084 .04451,.05935,.0742,.08904,.10389, 085 .11875,.13361,.14848,.15175, 086 .15503,.1583,.16157,.16485,.16812, 087 .1714,.17468,.17795,.18123, 088 .18623,.19123,.19623,.20123,.20623, 089 .21124,.21624,.22124,.22625, 090 .23125,.24072,.25018,.25964,.2691, 091 .27856,.28802,.29748,.30694, 092 .3164,.32586,.33918,.3525,.36582, 093 .37915,.39247,.4058,.41912, 094 .43245,.44577,.4591,.46962,.48015, 095 .49068,.5012,.51173,.52226, 096 .53278,.54331,.55384,.56436,.57344, 097 .58252,.5916,.60068,.60976, 098 .61884,.62792,.637,.64607,.65515, 099 .67086,.68656,.70226,.71797, 100 .73367,.74937,.76508,.78078,.79648, 101 .81218,.8259,.83962,.85333, 102 .86705,.88077,.89448,.9082,.92192, 103 .93563,.94934,.96192,.97449, 104 .98706,.99964,1.01221,1.02478,1.03735, 105 1.04992,1.06249,1.07506,1.08689, 106 1.09872,1.11055,1.12238,1.13421, 107 1.14603,1.15786,1.16969,1.18151, 108 1.19334,1.20469,1.21605,1.2274, 109 1.23876,1.25011,1.26146,1.27281, 110 1.28416,1.29551,1.30686,1.31793,1.329, 111 1.34007,1.35114,1.36221,1.37328, 112 1.38434,1.39541,1.40648,1.41754, 113 1.42845,1.43935,1.45025,1.46116, 114 1.47206,1.48296,1.49387,1.50477, 115 1.51567,1.52657,1.53737,1.54816, 116 1.55896,1.56975,1.58055,1.59134, 117 1.60214,1.61293,1.62373,1.63452, 118 1.64525,1.65598,1.66671,1.67744, 119 1.68817,1.6989,1.70963,1.72036, 120 1.73109,1.74182,1.75254,1.76325, 121 1.77396,1.78468,1.79539,1.80611, 122 1.81683,1.82754,1.83826,1.84898, 123 1.85972,1.87046,1.8812,1.89194, 124 1.90268,1.91343,1.92417,1.93491, 125 1.94566,1.9564,1.96732,1.97823, 126 1.98915,2.00006,2.01098,2.0219, 127 2.03282,2.04373,2.05465,2.06557, 128 2.07682,2.08806,2.09931,2.11056, 129 2.1218,2.13305,2.14429,2.15554, 130 2.16679,2.17803,2.18979,2.20155, 131 2.2133,2.22506,2.23681,2.24856, 132 2.26032,2.27207,2.28382,2.29557, 133 2.30822,2.32088,2.33353,2.34618, 134 2.35883,2.37148,2.38412,2.39677, 135 2.40942,2.42206,2.43618,2.45029, 136 2.4644,2.47851,2.4926,2.50669,2.52077, 137 2.53483,2.54888,2.56292,2.57978, 138 2.59661,2.61343,2.63024,2.64704, 139 2.66383,2.68062,2.6974,2.7142,2.731, 140 2.77185,2.81276,2.85373,2.89475, 141 2.93582,2.97693,3.01807,3.05923, 142 3.10041,3.14159 }; 143 144 private static final double[] epslde = { 145 0.,.00156,.00312, 146 .00466,.00618,.00767,.00913,.01054, 147 .01191,.01322,.01446,.01473, 148 .01499,.01524,.01549,.01572,.01595, 149 .01616,.01636,.01655,.01671, 150 .01693,.01712,.01727,.0174,.0175, 151 .01759,.01766,.01773,.0178, 152 .01788,.01804,.01822,.01842,.01863, 153 .01884,.01903,.0192,.01934, 154 .01945,.0195,.01949,.01938,.01919, 155 .01895,.01866,.01836,.01805, 156 .01775,.01749,.01728,.01716,.01708, 157 .01703,.01702,.01704,.01708, 158 .01714,.01722,.01731,.01741,.01751, 159 .0176,.01771,.01782,.01794, 160 .01806,.0182,.01834,.0185,.01867, 161 .01898,.01933,.01971,.02012, 162 .02055,.021,.02147,.02196,.02246, 163 .02298,.02343,.0239,.02437, 164 .02485,.02534,.02584,.02636,.02689, 165 .02744,.028,.02853,.02907, 166 .02963,.0302,.03078,.03137,.03198, 167 .03259,.03321,.03385,.03445, 168 .03506,.03568,.03631,.03694,.03759, 169 .03824,.0389,.03957,.04025, 170 .04091,.04158,.04225,.04294,.04363, 171 .04434,.04505,.04577,.0465, 172 .04724,.04798,.04872,.04947,.05023, 173 .05099,.05177,.05255,.05334, 174 .05414,.05495,.05575,.05655,.05737, 175 .05819,.05901,.05984,.06067, 176 .0615,.06233,.06316,.06399,.06481, 177 .06563,.06645,.06727,.06808, 178 .06889,.06969,.07049,.07127,.07205, 179 .07282,.07358,.07433,.07507, 180 .0758,.07651,.07722,.07792,.07861, 181 .07928,.07994,.08058,.08121, 182 .08182,.08242,.08299,.08355,.08408, 183 .08459,.08508,.08555,.08599, 184 .08641,.0868,.08718,.08754,.08787, 185 .08819,.08848,.08876,.08903, 186 .08927,.08949,.08969,.08988,.09004, 187 .09019,.09031,.09041,.0905, 188 .09056,.09061,.09062,.09061,.09058, 189 .09052,.09043,.09032,.09017, 190 .08999,.08977,.08953,.08925,.08894, 191 .08861,.08824,.08785,.08743, 192 .08698,.08647,.08593,.08536,.08477, 193 .08414,.08348,.08279,.08208, 194 .08134,.08056,.07967,.07872,.07772, 195 .07666,.07552,.07429,.07297, 196 .07155,.07,.06833,.06615,.0638, 197 .06132,.05873,.05606,.05334,.0506, 198 .04788,.04519,.04258,.03664, 199 .03122,.02628,.02176,.01759,.01371, 200 .01008,.00662,.00328,0. }; 201 202 /** 203 * Fill in phi, eps vectors for 65 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 225 // Phi & eps vectors for 65 series airfoil. 226 private static final double[] philds = { 227 0.,.01486,.02972, 228 .04458,.05944,.07429,.08914,.10398, 229 .11882,.13365,.14848,.15176, 230 .15503,.15831,.16159,.16486,.16814, 231 .17141,.17469,.17796,.18123, 232 .18624,.19124,.19624,.20124,.20624, 233 .21124,.21625,.22125,.22625, 234 .23125,.2407,.25015,.2596,.26906, 235 .27852,.28798,.29744,.30691, 236 .31638,.32586,.33917,.35249,.36581, 237 .37913,.39246,.40578,.41911, 238 .43244,.44577,.4591,.46962,.48015, 239 .49068,.50121,.51173,.52226, 240 .53279,.54331,.55384,.56436,.57344, 241 .58252,.5916,.60068,.60976, 242 .61884,.62791,.63699,.64607,.65515, 243 .67085,.68656,.70226,.71796, 244 .73366,.74937,.76507,.78077,.79648, 245 .81218,.8259,.83961,.85333, 246 .86704,.88076,.89448,.90819,.92191, 247 .93563,.94934,.96192,.97449, 248 .98706,.99963,1.0122,1.02477,1.03734, 249 1.04992,1.06249,1.07506,1.08689, 250 1.09872,1.11054,1.12237,1.1342, 251 1.14603,1.15786,1.16968,1.18151, 252 1.19334,1.20469,1.21604,1.2274, 253 1.23875,1.2501,1.26145,1.27281, 254 1.28416,1.29551,1.30686,1.31793,1.329, 255 1.34007,1.35114,1.36221,1.37327, 256 1.38434,1.39541,1.40647,1.41754, 257 1.42845,1.43935,1.45026,1.46116, 258 1.47207,1.48297,1.49387,1.50477, 259 1.51567,1.52657,1.53737,1.54817, 260 1.55897,1.56977,1.58057,1.59136, 261 1.60215,1.61295,1.62374,1.63452, 262 1.64526,1.656,1.66673,1.67746,1.6882, 263 1.69892,1.70965,1.72038,1.7311, 264 1.74182,1.75255,1.76327,1.77399, 265 1.78471,1.79542,1.80614,1.81685, 266 1.82756,1.83828,1.84898,1.85973, 267 1.87048,1.88122,1.89197,1.90271, 268 1.91345,1.92419,1.93493,1.94567, 269 1.9564,1.96732,1.97824,1.98916, 270 2.00008,2.011,2.02191,2.03283,2.04374, 271 2.05466,2.06557,2.07682,2.08807, 272 2.09932,2.11056,2.12181,2.13305, 273 2.1443,2.15554,2.16679,2.17803, 274 2.18979,2.20154,2.2133,2.22505,2.2368, 275 2.24856,2.26031,2.27206,2.28382, 276 2.29557,2.30822,2.32086,2.33351, 277 2.34616,2.35881,2.37146,2.38411, 278 2.39676,2.40941,2.42206,2.43614, 279 2.45023,2.46431,2.47839,2.49248, 280 2.50656,2.52065,2.53474,2.54883, 281 2.56292,2.57971,2.59651,2.6133,2.6301, 282 2.64691,2.66372,2.68053,2.69735, 283 2.71417,2.731,2.77194,2.81292, 284 2.85393,2.89497,2.93604,2.97712, 285 3.01823,3.05934,3.10046,3.14159 }; 286 287 private static final double[] psilds = { 288 .17464,.17457,.17437, 289 .17404,.1736,.17303,.17236, 290 .17159,.17073,.16977,.16872,.16848, 291 .16824,.16799,.16773,.16747, 292 .16721,.16694,.16666,.16638,.16609, 293 .16563,.16516,.16468,.1642, 294 .16371,.16321,.16272,.16223,.16175, 295 .16127,.16041,.15959,.15881, 296 .15808,.1574,.15676,.15616,.15562, 297 .15512,.15468,.15413,.15368, 298 .15331,.15301,.15278,.15261,.15249, 299 .15241,.15237,.15235,.15235, 300 .15236,.15238,.15241,.15245,.15251, 301 .15257,.15264,.15272,.15281, 302 .15289,.15298,.15308,.15318,.15328, 303 .15339,.1535,.15361,.15372, 304 .15383,.15402,.15422,.1544,.15459, 305 .15477,.15496,.15513,.15531, 306 .15548,.15564,.15578,.15592,.15605, 307 .15618,.1563,.15642,.15653, 308 .15663,.15673,.15682,.1569,.15697, 309 .15704,.15709,.15714,.15719, 310 .15723,.15726,.15728,.1573,.15731, 311 .15731,.1573,.15729,.15727, 312 .15724,.15721,.15716,.15711,.15704, 313 .15697,.15689,.1568,.15671, 314 .1566,.15648,.15636,.15623,.15609, 315 .15594,.15578,.15562,.15544, 316 .15526,.15506,.15484,.15462,.15437, 317 .15411,.15383,.15354,.15322, 318 .15289,.15254,.15216,.15177,.15135, 319 .15091,.15046,.14998,.14948, 320 .14896,.14842,.14785,.14726,.14665, 321 .14602,.14536,.14467,.14396, 322 .14323,.14247,.14169,.14088,.14005, 323 .1392,.13833,.13744,.13652, 324 .13559,.13464,.13367,.13268,.13167, 325 .13065,.12961,.12856,.12749, 326 .12641,.12531,.1242,.12307,.12194, 327 .12079,.11962,.11845,.11726, 328 .11606,.11485,.11363,.11237,.11111, 329 .10983,.10854,.10725,.10594, 330 .10463,.10332,.10199,.10066,.09929, 331 .09791,.09652,.09513,.09374, 332 .09234,.09094,.08953,.08811,.08669, 333 .0852,.0837,.0822,.0807,.07919, 334 .07768,.07617,.07465,.07314, 335 .07163,.07,.06838,.06675,.06514, 336 .06352,.06191,.0603,.0587,.0571, 337 .05551,.05374,.05199,.05024, 338 .0485,.04677,.04504,.04333,.04162, 339 .03992,.03824,.03624,.03426, 340 .0323,.03037,.02848,.02662,.02481, 341 .02305,.02134,.0197,.01597, 342 .01263,.00968,.00712,.00495,.00317, 343 .00178,7.9e-4,2e-4,0. }; 344 345 /** 346 * Fill in the psi vector for a 65 series airfoil. 347 * 348 * @param phi An array filled in by phep(). 349 * @param psi An existing array with 201 elements to be filled in 350 * by this method. 351 */ 352 @Override 353 protected final void phps(double[] phi, double[] psi) { 354 double[] bb = new double[251]; 355 double[] cc = new double[251]; 356 double[] dd = new double[251]; 357 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 NACA65Series..."); 376 377 System.out.println("Creating a NACA 65-212 airfoil..."); 378 Airfoil af = new NACA65Series(0.2, 0.12, 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