Git Product home page Git Product logo

koodlyakshay / xfoil-optimization-toolbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from the-fonz/xfoil-optimization-toolbox

1.0 1.0 0.0 1.29 MB

The Python XFOIL optimization toolbox can be used to optimize airfoils for a specific operating range, and might be useful to you for its XFOIL communication module, airfoil parametrizations, and optimization algorithms, i.e. all you need to do funky stuff with 2D airfoils.

License: The Unlicense

Python 100.00%

xfoil-optimization-toolbox's Introduction

The Python XFOIL optimization toolbox can be used to optimize airfoils for a specific operating range. I initially made it to be able to optimize the shape of a strut.

NOTE: Windows and Mac XFOIL binaries are included, see xfoil folder. You might have to rename them. It would be nice if the correct binary is automatically detected, should be quite easy to implement using sys.platform. Feel free to implement this if you want a small programming challenge :)

Useful because...

of its three different toolsets:

  • /xfoil module: Communicates with XFOIL, makes it possible to retrieve polar data with just one function call.
  • /airfoil_generators: Contains parametric airfoil generators which convert a list of numbers into an airfoil shape. Currently implemented:
    • NACA 4-series (for testing and fun)
    • PARSEC (is limited in the shapes it can produce but produces reasonable airfoil shapes, play around with it here)
  • /optimization_algorithms: An optimization algorithm tries to find a point in a multidimensional space with the lowest score (e.g. point (x,y) within 1<x<5 and 4<y<6, scored by calculating drag of NACAxy15 at alpha=0 and Re=1M). Currently implemented:
    • Particle Swarm Optimization: robust, easy-to-use, gradient-free optimization algorithm that often outperforms more complex algorithms.

Airfoil generation and XFOIL communication

Being able to easily generate airfoils and communicate with XFOIL is very powerful. With not too much effort, you can make a plot like this: Go to code

Particle Swarm Optimization

PSO is an optimization technique inspired by a flock of birds searching for food. It is relatively simple, doesn't concern itself with gradients, and often outperforms more complex techniques like genetic algorithms. See it working on the Rastrigin function in this code example.

It can easily be applied to airfoils, simply by translating the list of constrained numbers into an airfoil, then scoring the airfoil using the xfoil module to get lift, drag, moment or anything else at a specified Re and alpha or Cl. An attempt at optimizing a PARSEC airfoil shape for lowest drag at an angle of attack of 0 and a Reynolds number of 1 million, produces the following: Go to code

NURBS Airfoil Generation

http://eprints.soton.ac.uk/50031/1/Sobe07.pdf Follows the method implemented in this paper. It reduces the number of paramters from 12(required in PARSEC) to 6, helping in reducing the computational resource need for the optimization process. The only drawback being, it doesn't work too well with transonic airfoils, as reducing the number of paramters also means giving up some control over the airfoil spline. The figure below shows NURBS working with PSO particle optimizer.

Additional development ideas

  • NURBS airfoils: A great idea would be to add NURBS airfoils to the airfoil generators, as NURBS can define very smooth airfoils using very few parameters, so it's a good fit for optimization purposes. Ideally, its shape can be initialized by fitting it to some existing shape, to start off with a reasonable airfoil.
  • Simulated Annealing optimization technique: Would be interesting to compare this technique with PSO.

xfoil-optimization-toolbox's People

Contributors

the-fonz avatar jasonhamilton avatar karanchawla avatar

Stargazers

Huseyin Ozdemir avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.