



Discussion
Airfoil Optimization with XFOIL
I had to do a group project for an engineering optimization class this semester. We were allowed to choose our own, so I chose airfoil optimization. It was a group project, but I pretty much did the whole thing. But that's beside the point. I thought the results would be of interest to this forum.
We ended up using the NACA 4digit series parameters (max camber, max thickness, max camber location) and modified them to also include trailing edge slope. So we had four design variables. Upper and lower bounds on the parameters were used as constraints, as well as a constraint on pitching moment for one of the cases. I programmed a gradientbased optimization scheme in Matlab, which called XFoil for all function evaluations. The optimization scheme adjusts design variables to optimize the objective function. For this project, we chose to maximize the average of CL/CD at three different angles of attack. Using the average of three different points helps to achieve good performance over a range of angles of attack. The angles of attack considered in the objective function were 1.5, 4, and 7 degrees. The results are posted below, as well as the paper we wrote. There were six trials run, either with no Cm constraint or with it constrained > or equal to zero, each for Re of 80,000, 200,000, and 300,000. Unsurprisingly, the unconstrained case achieved better performance. The constrained pitching moment airfoils, also unsurprisingly, all end up with a reflexed trailing edge. The next step is to increase the number of design variables. I would like to include leading edge radius and max thickness location as design variables for greater control over the shape. It is also possible to change the objective function and constraints for different design goals. Stay tuned. EDIT: By the way, each of the six cases took about 11.5 hours to reach a solution on my laptop. I don't count the XFoil function evaluations but I'd guess it's around 10002000 each time. I also ran into difficulties with XFoil not converging in some cases, so it's no simple task. I imagine adding 2 more design variables will increase the computational time to over 2 hours. ImagesView all Images in thread


Last edited by Montag DP; May 19, 2010 at 02:30 PM.




As it turns out, it wasn't too hard at all to add leading edge radius and max thickness location as design variables. I spent about 30 minutes modifying my Matlab code to include that, and decided to do a study on an airfoil I might actually use for an aerial photography plane I'm designing. The Reynolds number was 200,000 (it will be a fairly large plane).
For this optimization, I set a constraint on the pitching moment to be greater than or equal to 0.1 for the three angles of attack considered. I also placed side constraints on the parameters, most notably that max camber < 0.04 and max thickness > 0.075. It took almost two hours to run the optimization (as I expected). Here are the results, compared to the Clark Y and DAE51. Notice that the lift/drag for the optimized airfoil outperforms the Clark Y and DAE51 at lower angles of attack, but suffers after 7 degrees. This is acceptable for an AP plane that will be mostly cruising around taking pictures. Also notice that the pitching moment is better than the DAE51's but worse than the Clark Y's, as set by the constraint. Please chime in if you have any ideas for practical airfoil optimization. Dan 

Last edited by Montag DP; May 21, 2010 at 06:12 PM.




Final Design
The last airfoil posted ended up around 8% thickness. I decided that I wanted it a little thicker for my application, so I set the lower constraint to 9% and ran the optimizer again, once again with Cm constrained to be greater than or equal to 0.1.
I did add a function evaluation counter to my code, and to reach this airfoil XFoil was run over 2,000 times by the optimizer. The AP plane I'm working on which will use this airfoil is pictured as well. I can post the final .DAT file for the airfoil if anyone is interested. ImagesView all Images in thread






Very cool! I once tinkered a little bit with something similar, but I also had the problem that XFOIL too often failed to converge. How did you handle that situation?
Jesper 





Quote:
For nonconverged cases, I have it automatically adjusting the parameters slightly and trying again. I give it three chances to converge like this before just calling L/D 0 at that point. If the shape is really off, XFoil might not create the output file with the results in it. This is a problem because Matlab looks for this file to read in the results. To prevent this from happening (most of the time), I had to make the penalty terms on the constraints high enough so that the optimizer stays away from those shapes. Now that I think about it, I could probably put in a check to see if the file exists before trying to read it, but most of the time it would be unnecessary. There are still times where it crashes, but for the most part it doesn't have a problem. 


Last edited by Montag DP; May 22, 2010 at 01:24 PM.





OK, thanks!






Montag,
Thanks for this, it is very interesting and I'll carefully study your report and learn all I can from it. In another thread, we were discussing what an airfoil might look like if it was designed to produce maximum Cl at an Re of 35000, and if you really didn't care about Cd at all. Would it be easy to to run an optimisation and see what it comes out with? The best we've seen so far is a Cl of 1.8 (or course the drag was terrible, but it's not important for this question). Many thanks Hugo 





Quote:
Another difficulty is that max Cl occurs right before stall, which is not always at the same angle of attack. It should be possible to do it, though, with a little bit of tweaking. Dan 






Quote:
I would certainly remove the max camber constraint. Remember, the purpose is simply to achieve the maximum lift, at the expense of everything else. Although I think there should be a fixed chord and Re (my personal preference being 20cm and 35000, but could be anything). Hugo 






Quote:
It was run for awhile, but I had to do stop and restart a lot because XFoil convergence issues at those extreme conditions (and the extreme shapes generated) made the optimization problematic. However, I did get a Cl over 1.8 (precisely, 1.8224) without too much trouble, though the airfoil would be pretty much unusable for an actual model as the performance everywhere else is very poor. What I found was that the optimum camber was around 7.3%, but the angle at the trailing edge kept increasing to get higher lift. It probably would have increased more if I kept increasing the upper allowable limit. I stopped it at 35 degrees, which means the trailing edge is basically acting like a flap. Anyway, here are the results. Dan 






Quote:
Yes, XFoil doesn't really do anything past stall. The optimizer is good for finding useful airfoils in "normal" model regimes. Finding the max Cl, neglecting everything else, does not result in a useful airfoil, and the optimization struggles (mostly because of XFoil convergence issues). However, I'm hoping that the airfoil developed for my AP plane does as well as predicted. Dan 






Quote:
Do you realize that with a 20cm chord and only 35K for a Reynolds number that you're only talking about 9 kph or 5.6 mph for a flight speed? A far more realistic speed for any sort of real world model airplane with a 20 cm chord would be more like 70,000 to 80,000 at a minimum. To fly at only 35K it would need to be a super light demo test hack of some sort since you're talking about flying at a moderate jogging pace. 






Kevin, mounting the camera in that manner will produce a huge amount of glare off the "canopy" internal surfaces. Not to mention that the seams are in the direct line of vision. If I were to have a go at designing a camera model I long ago figured that I would want to use a camera "ball" that is gimbaled to swivel and aim wherever I want it to. Maybe not actually in flight at first mind you. But either way going with an opaque container other than the optical port would allow me to use a good quality coated UV filter as the cameral port. And as long as it's aimed sort of downward all the time I wouldn't need to deal with much glare. And a 70mm'ish filter would provide as much of a port for the camera lens as I could possibly see a model camera requiring.
And I also long ago figured that any such model I design would be called "Skyball"... 





Quote:
I was planning on removing the canopy when using the camera. 


