{"id":21867842,"url":"https://github.com/karanchawla/airfoil-optimization","last_synced_at":"2025-04-14T22:26:54.442Z","repository":{"id":95015955,"uuid":"72456526","full_name":"karanchawla/Airfoil-Optimization","owner":"karanchawla","description":"This repository contains code development for the 4th credit project for AE416. The aim of the project is to compare different optimization algorithms in the context of airfoil optimization.","archived":false,"fork":false,"pushed_at":"2017-03-18T17:58:29.000Z","size":4523,"stargazers_count":23,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T10:47:32.506Z","etag":null,"topics":["airfoil","airfoil-generation","drag","optimization-algorithms","parsec","particle-swarm-optimization","xfoil"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karanchawla.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-31T16:38:56.000Z","updated_at":"2025-02-28T09:37:56.000Z","dependencies_parsed_at":"2023-06-11T15:15:47.479Z","dependency_job_id":null,"html_url":"https://github.com/karanchawla/Airfoil-Optimization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karanchawla%2FAirfoil-Optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karanchawla%2FAirfoil-Optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karanchawla%2FAirfoil-Optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karanchawla%2FAirfoil-Optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karanchawla","download_url":"https://codeload.github.com/karanchawla/Airfoil-Optimization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248970690,"owners_count":21191472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airfoil","airfoil-generation","drag","optimization-algorithms","parsec","particle-swarm-optimization","xfoil"],"created_at":"2024-11-28T05:10:47.819Z","updated_at":"2025-04-14T22:26:54.417Z","avatar_url":"https://github.com/karanchawla.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"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.\n\nNOTE: Windows and Mac XFOIL binaries are included, see `xfoil` folder.\n\n## Useful because...\nof its three different toolsets:\n- `/xfoil` module: Communicates with XFOIL, makes it possible to retrieve polar data with just one function call.\n- `/airfoil_generators`: Contains parametric airfoil generators which convert a list of numbers into an airfoil shape. Currently implemented:\n  - NACA 4-series (for testing and fun)\n  - PARSEC (is limited in the shapes it can produce but produces reasonable airfoil shapes, play around with it [here](http://www.as.dlr.de/hs/d.PARSEC/Parsec.html))\n- `/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\u003cx\u003c5 and 4\u003cy\u003c6, scored by calculating drag of NACAxy15 at alpha=0 and Re=1M). Currently implemented:\n  - Particle Swarm Optimization: robust, easy-to-use, gradient-free optimization algorithm that often outperforms more complex algorithms.\n\n## Airfoil generation and XFOIL communication\nBeing able to easily generate airfoils and communicate with XFOIL is very powerful. With not too much effort, you can make a plot like this:\n![](example_figures/naca4series-rangeplot.png)\n[Go to code](example_naca4_drag.py)\n\n## Particle Swarm Optimization\nPSO 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](example_pso_rastrigin_test).\n\nIt 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:\n![](example_figures/pso-parsec-dragalpha0-Re1M.png)\n[Go to code](example_pso_drag_highRe.py)\n\n## NURBS Airfoil Generation \nhttp://eprints.soton.ac.uk/50031/1/Sobe07.pdf\nFollows 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\nmeans giving up some control over the airfoil spline. The figure below shows NURBS working with PSO particle optimizer. \n![](example_figures/nurbs_PSO_highRe_drag.png)  \n\n## Additional development ideas\n- Simulated Annealing optimization technique: Would be interesting to compare this technique with PSO.\n\n## References\nBased on the work by theFonz. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaranchawla%2Fairfoil-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaranchawla%2Fairfoil-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaranchawla%2Fairfoil-optimization/lists"}