001/* 002* NACA65Series -- An arbitrary NACA 65 series airfoil. 003* 004* Copyright (C) 2010-2012 by Joseph A. Huwaldt 005* All rights reserved. 006* 007* This library is free software; you can redistribute it and/or 008* modify it under the terms of the GNU Lesser General Public 009* License as published by the Free Software Foundation; either 010* version 2.1 of the License, or (at your option) any later version. 011* 012* This library is distributed in the hope that it will be useful, 013* but WITHOUT ANY WARRANTY; without even the implied warranty of 014* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015* Lesser General Public License for more details. 016* 017* You should have received a copy of the GNU Lesser General Public License 018* along with this program; if not, write to the Free Software 019* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 020* Or visit: http://www.gnu.org/licenses/lgpl.html 021**/ 022package jahuwaldt.aero.airfoils; 023 024import java.util.List; 025import java.awt.geom.Point2D; 026import java.text.DecimalFormat; 027import java.text.NumberFormat; 028 029 030/** 031* <p> This class represents an arbitrary NACA 65 series 032* airfoil section such as a NACA 65-020 airfoil. 033* </p> 034* 035* <p> Ported from FORTRAN "NACA6.FOR" to Java by: 036* Joseph A. Huwaldt, June 4, 2010 </p> 037* 038* <p> Original FORTRAN "NACA4" code had the following note: </p> 039* 040* <pre> 041* AUTHORS - Charles L.Ladson and Cuyler W. Brooks, NASA Langley 042* Liam Hardy, NASA Ames 043* Ralph Carmichael, Public Domain Aeronautical Software 044* Last FORTRAN version: 23Nov96 2.0 RLC 045* 046* NOTES - This program has also been known as LADSON and SIXSERIES and 047* as SIXSERIE on systems with a 8-letter name limit. 048* REFERENCES- NASA Technical Memorandum TM X-3069 (September, 1974), 049* by Charles L. Ladson and Cuyler W. Brooks, Jr., NASA Langley Research Center. 050* 051* "Theory of Wing Sections", by Ira Abbott and Albert Von Doenhoff. 052* </pre> 053* 054* <p> Modified by: Joseph A. Huwaldt </p> 055* 056* @author Joseph A. Huwaldt Date: June 5, 2010 057* @version September 15, 2012 058**/ 059public class NACA65Series extends NACA6Series { 060 061 //----------------------------------------------------------------------------------- 062 063 /** 064 * Create a NACA 65 series airfoil with the specified parameters. 065 * 066 * @param CLi Design lift coefficient (e.g.: 65-206 has CLi = 0.2). 067 * @param thickness The thickness to chord ratio (e.g.: 0.20 ==> 20% t/c). 068 * @param length The chord length. 069 **/ 070 public NACA65Series(double CLi, double thickness, double length) { 071 super(CLi, thickness, length); 072 } 073 074 /** 075 * Returns a String that represents the profile type of this airfoil. 076 **/ 077 @Override 078 public String getProfile() { 079 return "65"; 080 } 081 082 // Phi & eps vectors for 65 series airfoil. 083 private static final double[] philde = { 084 0.,.01484,.02967, 085 .04451,.05935,.0742,.08904,.10389, 086 .11875,.13361,.14848,.15175, 087 .15503,.1583,.16157,.16485,.16812, 088 .1714,.17468,.17795,.18123, 089 .18623,.19123,.19623,.20123,.20623, 090 .21124,.21624,.22124,.22625, 091 .23125,.24072,.25018,.25964,.2691, 092 .27856,.28802,.29748,.30694, 093 .3164,.32586,.33918,.3525,.36582, 094 .37915,.39247,.4058,.41912, 095 .43245,.44577,.4591,.46962,.48015, 096 .49068,.5012,.51173,.52226, 097 .53278,.54331,.55384,.56436,.57344, 098 .58252,.5916,.60068,.60976, 099 .61884,.62792,.637,.64607,.65515, 100 .67086,.68656,.70226,.71797, 101 .73367,.74937,.76508,.78078,.79648, 102 .81218,.8259,.83962,.85333, 103 .86705,.88077,.89448,.9082,.92192, 104 .93563,.94934,.96192,.97449, 105 .98706,.99964,1.01221,1.02478,1.03735, 106 1.04992,1.06249,1.07506,1.08689, 107 1.09872,1.11055,1.12238,1.13421, 108 1.14603,1.15786,1.16969,1.18151, 109 1.19334,1.20469,1.21605,1.2274, 110 1.23876,1.25011,1.26146,1.27281, 111 1.28416,1.29551,1.30686,1.31793,1.329, 112 1.34007,1.35114,1.36221,1.37328, 113 1.38434,1.39541,1.40648,1.41754, 114 1.42845,1.43935,1.45025,1.46116, 115 1.47206,1.48296,1.49387,1.50477, 116 1.51567,1.52657,1.53737,1.54816, 117 1.55896,1.56975,1.58055,1.59134, 118 1.60214,1.61293,1.62373,1.63452, 119 1.64525,1.65598,1.66671,1.67744, 120 1.68817,1.6989,1.70963,1.72036, 121 1.73109,1.74182,1.75254,1.76325, 122 1.77396,1.78468,1.79539,1.80611, 123 1.81683,1.82754,1.83826,1.84898, 124 1.85972,1.87046,1.8812,1.89194, 125 1.90268,1.91343,1.92417,1.93491, 126 1.94566,1.9564,1.96732,1.97823, 127 1.98915,2.00006,2.01098,2.0219, 128 2.03282,2.04373,2.05465,2.06557, 129 2.07682,2.08806,2.09931,2.11056, 130 2.1218,2.13305,2.14429,2.15554, 131 2.16679,2.17803,2.18979,2.20155, 132 2.2133,2.22506,2.23681,2.24856, 133 2.26032,2.27207,2.28382,2.29557, 134 2.30822,2.32088,2.33353,2.34618, 135 2.35883,2.37148,2.38412,2.39677, 136 2.40942,2.42206,2.43618,2.45029, 137 2.4644,2.47851,2.4926,2.50669,2.52077, 138 2.53483,2.54888,2.56292,2.57978, 139 2.59661,2.61343,2.63024,2.64704, 140 2.66383,2.68062,2.6974,2.7142,2.731, 141 2.77185,2.81276,2.85373,2.89475, 142 2.93582,2.97693,3.01807,3.05923, 143 3.10041,3.14159 }; 144 145 private static final double[] epslde = { 146 0.,.00156,.00312, 147 .00466,.00618,.00767,.00913,.01054, 148 .01191,.01322,.01446,.01473, 149 .01499,.01524,.01549,.01572,.01595, 150 .01616,.01636,.01655,.01671, 151 .01693,.01712,.01727,.0174,.0175, 152 .01759,.01766,.01773,.0178, 153 .01788,.01804,.01822,.01842,.01863, 154 .01884,.01903,.0192,.01934, 155 .01945,.0195,.01949,.01938,.01919, 156 .01895,.01866,.01836,.01805, 157 .01775,.01749,.01728,.01716,.01708, 158 .01703,.01702,.01704,.01708, 159 .01714,.01722,.01731,.01741,.01751, 160 .0176,.01771,.01782,.01794, 161 .01806,.0182,.01834,.0185,.01867, 162 .01898,.01933,.01971,.02012, 163 .02055,.021,.02147,.02196,.02246, 164 .02298,.02343,.0239,.02437, 165 .02485,.02534,.02584,.02636,.02689, 166 .02744,.028,.02853,.02907, 167 .02963,.0302,.03078,.03137,.03198, 168 .03259,.03321,.03385,.03445, 169 .03506,.03568,.03631,.03694,.03759, 170 .03824,.0389,.03957,.04025, 171 .04091,.04158,.04225,.04294,.04363, 172 .04434,.04505,.04577,.0465, 173 .04724,.04798,.04872,.04947,.05023, 174 .05099,.05177,.05255,.05334, 175 .05414,.05495,.05575,.05655,.05737, 176 .05819,.05901,.05984,.06067, 177 .0615,.06233,.06316,.06399,.06481, 178 .06563,.06645,.06727,.06808, 179 .06889,.06969,.07049,.07127,.07205, 180 .07282,.07358,.07433,.07507, 181 .0758,.07651,.07722,.07792,.07861, 182 .07928,.07994,.08058,.08121, 183 .08182,.08242,.08299,.08355,.08408, 184 .08459,.08508,.08555,.08599, 185 .08641,.0868,.08718,.08754,.08787, 186 .08819,.08848,.08876,.08903, 187 .08927,.08949,.08969,.08988,.09004, 188 .09019,.09031,.09041,.0905, 189 .09056,.09061,.09062,.09061,.09058, 190 .09052,.09043,.09032,.09017, 191 .08999,.08977,.08953,.08925,.08894, 192 .08861,.08824,.08785,.08743, 193 .08698,.08647,.08593,.08536,.08477, 194 .08414,.08348,.08279,.08208, 195 .08134,.08056,.07967,.07872,.07772, 196 .07666,.07552,.07429,.07297, 197 .07155,.07,.06833,.06615,.0638, 198 .06132,.05873,.05606,.05334,.0506, 199 .04788,.04519,.04258,.03664, 200 .03122,.02628,.02176,.01759,.01371, 201 .01008,.00662,.00328,0. }; 202 203 /** 204 * Fill in phi, eps vectors for 65 series airfoil. 205 * 206 * @param phi An existing array with 201 elements to be filled in 207 * by this method. 208 * @param eps An existing array with 201 elements to be filled in 209 * by this method. 210 **/ 211 @Override 212 protected final void phep(double[] phi, double[] eps) { 213 double[] bb = new double[251]; 214 double[] cc = new double[251]; 215 double[] dd = new double[251]; 216 217 spline(251, philde, epslde, bb, cc, dd); 218 for (int i=0; i < 201; ++i) { 219 phi[i] = i*Math.PI/200.; 220 eps[i] = seval(251, phi[i], philde, epslde, bb, cc, dd); 221 } 222 223 } 224 225 226 // Phi & eps vectors for 65 series airfoil. 227 private static final double[] philds = { 228 0.,.01486,.02972, 229 .04458,.05944,.07429,.08914,.10398, 230 .11882,.13365,.14848,.15176, 231 .15503,.15831,.16159,.16486,.16814, 232 .17141,.17469,.17796,.18123, 233 .18624,.19124,.19624,.20124,.20624, 234 .21124,.21625,.22125,.22625, 235 .23125,.2407,.25015,.2596,.26906, 236 .27852,.28798,.29744,.30691, 237 .31638,.32586,.33917,.35249,.36581, 238 .37913,.39246,.40578,.41911, 239 .43244,.44577,.4591,.46962,.48015, 240 .49068,.50121,.51173,.52226, 241 .53279,.54331,.55384,.56436,.57344, 242 .58252,.5916,.60068,.60976, 243 .61884,.62791,.63699,.64607,.65515, 244 .67085,.68656,.70226,.71796, 245 .73366,.74937,.76507,.78077,.79648, 246 .81218,.8259,.83961,.85333, 247 .86704,.88076,.89448,.90819,.92191, 248 .93563,.94934,.96192,.97449, 249 .98706,.99963,1.0122,1.02477,1.03734, 250 1.04992,1.06249,1.07506,1.08689, 251 1.09872,1.11054,1.12237,1.1342, 252 1.14603,1.15786,1.16968,1.18151, 253 1.19334,1.20469,1.21604,1.2274, 254 1.23875,1.2501,1.26145,1.27281, 255 1.28416,1.29551,1.30686,1.31793,1.329, 256 1.34007,1.35114,1.36221,1.37327, 257 1.38434,1.39541,1.40647,1.41754, 258 1.42845,1.43935,1.45026,1.46116, 259 1.47207,1.48297,1.49387,1.50477, 260 1.51567,1.52657,1.53737,1.54817, 261 1.55897,1.56977,1.58057,1.59136, 262 1.60215,1.61295,1.62374,1.63452, 263 1.64526,1.656,1.66673,1.67746,1.6882, 264 1.69892,1.70965,1.72038,1.7311, 265 1.74182,1.75255,1.76327,1.77399, 266 1.78471,1.79542,1.80614,1.81685, 267 1.82756,1.83828,1.84898,1.85973, 268 1.87048,1.88122,1.89197,1.90271, 269 1.91345,1.92419,1.93493,1.94567, 270 1.9564,1.96732,1.97824,1.98916, 271 2.00008,2.011,2.02191,2.03283,2.04374, 272 2.05466,2.06557,2.07682,2.08807, 273 2.09932,2.11056,2.12181,2.13305, 274 2.1443,2.15554,2.16679,2.17803, 275 2.18979,2.20154,2.2133,2.22505,2.2368, 276 2.24856,2.26031,2.27206,2.28382, 277 2.29557,2.30822,2.32086,2.33351, 278 2.34616,2.35881,2.37146,2.38411, 279 2.39676,2.40941,2.42206,2.43614, 280 2.45023,2.46431,2.47839,2.49248, 281 2.50656,2.52065,2.53474,2.54883, 282 2.56292,2.57971,2.59651,2.6133,2.6301, 283 2.64691,2.66372,2.68053,2.69735, 284 2.71417,2.731,2.77194,2.81292, 285 2.85393,2.89497,2.93604,2.97712, 286 3.01823,3.05934,3.10046,3.14159 }; 287 288 private static final double[] psilds = { 289 .17464,.17457,.17437, 290 .17404,.1736,.17303,.17236, 291 .17159,.17073,.16977,.16872,.16848, 292 .16824,.16799,.16773,.16747, 293 .16721,.16694,.16666,.16638,.16609, 294 .16563,.16516,.16468,.1642, 295 .16371,.16321,.16272,.16223,.16175, 296 .16127,.16041,.15959,.15881, 297 .15808,.1574,.15676,.15616,.15562, 298 .15512,.15468,.15413,.15368, 299 .15331,.15301,.15278,.15261,.15249, 300 .15241,.15237,.15235,.15235, 301 .15236,.15238,.15241,.15245,.15251, 302 .15257,.15264,.15272,.15281, 303 .15289,.15298,.15308,.15318,.15328, 304 .15339,.1535,.15361,.15372, 305 .15383,.15402,.15422,.1544,.15459, 306 .15477,.15496,.15513,.15531, 307 .15548,.15564,.15578,.15592,.15605, 308 .15618,.1563,.15642,.15653, 309 .15663,.15673,.15682,.1569,.15697, 310 .15704,.15709,.15714,.15719, 311 .15723,.15726,.15728,.1573,.15731, 312 .15731,.1573,.15729,.15727, 313 .15724,.15721,.15716,.15711,.15704, 314 .15697,.15689,.1568,.15671, 315 .1566,.15648,.15636,.15623,.15609, 316 .15594,.15578,.15562,.15544, 317 .15526,.15506,.15484,.15462,.15437, 318 .15411,.15383,.15354,.15322, 319 .15289,.15254,.15216,.15177,.15135, 320 .15091,.15046,.14998,.14948, 321 .14896,.14842,.14785,.14726,.14665, 322 .14602,.14536,.14467,.14396, 323 .14323,.14247,.14169,.14088,.14005, 324 .1392,.13833,.13744,.13652, 325 .13559,.13464,.13367,.13268,.13167, 326 .13065,.12961,.12856,.12749, 327 .12641,.12531,.1242,.12307,.12194, 328 .12079,.11962,.11845,.11726, 329 .11606,.11485,.11363,.11237,.11111, 330 .10983,.10854,.10725,.10594, 331 .10463,.10332,.10199,.10066,.09929, 332 .09791,.09652,.09513,.09374, 333 .09234,.09094,.08953,.08811,.08669, 334 .0852,.0837,.0822,.0807,.07919, 335 .07768,.07617,.07465,.07314, 336 .07163,.07,.06838,.06675,.06514, 337 .06352,.06191,.0603,.0587,.0571, 338 .05551,.05374,.05199,.05024, 339 .0485,.04677,.04504,.04333,.04162, 340 .03992,.03824,.03624,.03426, 341 .0323,.03037,.02848,.02662,.02481, 342 .02305,.02134,.0197,.01597, 343 .01263,.00968,.00712,.00495,.00317, 344 .00178,7.9e-4,2e-4,0. }; 345 346 /** 347 * Fill in the psi vector for a 65 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 359 spline(251, philds, psilds, bb, cc, dd); 360 for (int i=0; i < 201; ++i) { 361 psi[i] = seval(251, phi[i], philds, psilds, bb, cc, dd); 362 } 363 } 364 365 /** 366 * Simple method to test this class. 367 **/ 368 public static void main(String[] args) { 369 370 DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(); 371 nf.setMaximumFractionDigits(5); 372 nf.setMinimumFractionDigits(5); 373 374 System.out.println("Start NACA65Series..."); 375 376 System.out.println("Creating a NACA 65-212 airfoil..."); 377 Airfoil af = new NACA65Series(0.2, 0.12, 1); 378 379 System.out.println("Airfoil = " + af.toString()); 380 381 // Output the upper surface of the airfoil. 382 List<Point2D> upper = af.getUpper(); 383 List<Double> ypArr = af.getUpperYp(); 384 System.out.println("upper.size() = " + upper.size() + ", ypArr.size() = " + ypArr.size()); 385 386 System.out.println(" X \t Y \t dy/dx"); 387 int length = upper.size(); 388 for (int i=0; i < length; ++i) { 389 Point2D o = upper.get(i); 390 System.out.println(" " + nf.format(o.getX()) + "\t" + nf.format(o.getY()) + 391 "\t" + nf.format(ypArr.get(i))); 392 } 393 394 System.out.println("# ordinates = " + length); 395 System.out.println("Done!"); 396 } 397} 398 399