ADRpy – Aircraft Design Recipes in Python

ADRpy_splash

We have released ADRpy, a free library of aircraft design and performance analysis tools suitable for rapid sizing calculations. The models implemented in ADRpy are largely analytical, enabling fast explorations of large design spaces. Most of the methods can already be used in the earliest phases of the design process, even before a geometry model is built. In fact, ADRpy can serve as the basis of sensitivity analyses and uncertainty quantification (UQ) exercises as part of the analysis of the feasibility of the design requirements.

The code can be installed via pip or by cloning its GitHub repository – see full installation instructions on the documentation pages.

In addition to the usage examples contained in the documentation, we maintain a library of Jupyter notebooks illustrating use cases of ADRpy, including an ADRpy-based implementation of the constraint analysis study we presented in Small Unmanned Fixed-wing Aircraft Design: A Practical Approach.

ADRpy is open source software and it can be used under the terms of a GPLv3 copyleft license.

Any questions, get in touch via the comments facility below or by raising an issue on the ADRpy GitHub page.

southwest

Advertisement

Small Unmanned Fixed-Wing Aircraft Design

This is the title of our new Wiley-Blackwell book, published in October 2017. It is a practical guide to designing, building and flight testing small unmanned aircraft.

Screenshot 2017-07-10 18.39.21

It comes with some GNU-licensed software tools, which you are welcome to use!

In an earlier post we talked about constraint analysis using Jupyter notebooks — we believe these to be very useful for constraint analysis for the types of platforms discussed in this book too. There are two notebooks, one written in Python 2, another in Python 3. The notebooks are self-contained, save for one package: Kevin Horton’s Aero-Calc. This needs to be installed first before the notebooks can be run (a version translated into Python 3 can be found here). pip can be used to install the Python 2 version of the package (type pip install aerocalc in a terminal window); the Python 3 version can simply be copied to a folder where your Python installation looks for packages.

UPDATE: The constraint analysis example described in the book now has a new home and it is based on the new ADRpy aircraft design library. More details in this post.

It also includes an AirCONICS-based parametric geometry script, which will build the Decode 1 model described in the book. This is essentially the script from the Appendix of the book – you can download it from here (make sure you edit the setup file, adding your own path to wherever you downloaded the code to, as well as to the Selig coordinate database you will have downloaded with AirCONICS).

[NOTE: AirCONICS is a library of Python 2.7 aircraft geometry generation tools, to be run under Rhinoceros 3D].

Errata – a few errors we only caught after the book went to print.

Wing sizing via constraint analysis

Screenshot 2019-03-02 20.37.03

Let us consider a key step in the conceptual design of any fixed wing aircraft: the initial sizing of the wing. This follows the construction of a parametric geometry model, which establishes the shape of the wing – here we look at how to give it its initial scale.

A commonly used technique involves plotting the performance constraints contained in the design brief onto a single chart in the thrust to weight ratio (or power to weight ratio) versus wing wing loading space of the design (an example of such a chart is shown above).

In the book we discuss the construction of this type of chart in great detail and the interested reader may also wish to consult Snorri Gudmundsson’s rather excellent text on general aviation aircraft design.

This type of constraint analysis can be readily implemented in Excel, Matlab or just about any other programming language with a plotting library. The most convenient constraint analysis environment we have found, however, is a Jupyter notebook. These are parametric documents, which can contain text, diagrams and, most importantly, snipets of computer code (we use Python). The beauty of using a Jupyter notebook is that what results at the end of the constraint analysis process is a document capturing all the calculations and their results – this can be integrated into a report or used as a standalone components of the design audit trail.

Using Gudmundsson’s equations, we have captured the constraint analysis in a Jupyter notebook – or rather, two notebooks, one written in Python 2, another in Python 3. The notebooks are self-contained, save for one package: Kevin Horton’s Aero-Calc. This needs to be installed first before the notebooks can be run (a version translated into Python 3 can be found here). pip can be used to install the Python 2 version of the package (type pip install aerocalc in a terminal window); the Python 3 version can simply be copied to a folder where your Python installation looks for packages.

UPDATE: We have released a new aircraft design library in Python – see this post for more details and instructions on how to run the constraint analysis example notebook described in the book.

Standalone AirCONICS for Python

coverHere on aircraftgeometry.codes we advocate the use of computer code as a parameterized ‘recipe’ for constructing air vehicle preliminary designs. By defining the ‘bottom-up’ construction of the geometry in this way, a high level of flexibility and reproducibility can be achieved, both of which are desirable traits in the context of design optimisation. To this end we have developed the AirCONICS plugin for Rhinoceros, containing generic and highly customizable recipes for creating aircraft components as Python/Rhino objects.

This post is about a new development around AirCONICS: its aircraft geometry routines are now also available as a Python standalone package through through a code called occ_airconics. Instead of using the OpenNURBS framework through Rhinoceros, the package is powered by Open CASCADE, an open source NURBS CAD kernel, and PythonOCC.

“So what makes this interesting?”

occ_airconics has no proprietary dependencies, thereby providing an immediately available and free platform for aircraft concept design with a similar API to AirCONICS. As it runs on a standard Python installation, occ_airconics is portable and available on all of the common platforms.

Current AirCONICS users working with Multidisciplinary Design Optimisation (MDO) may also benefit from occ_airconics due to the ease of integration with external scientific libraries such as numpy and scipy for mathematical operations, scikit-learn for machine-learning or mpi4py for parallel programming. These libraries are less readily integrated with Rhino due to its .NET Python kernel. It should be noted however that due to an absence of core functions previously used in Rhino, occ_airconics may produce different and potentially lower quality geometries than the Rhino version.

Key features of occ_airconics:

  • Provides much of the same functionality as AirCONICS
  • Totally open source and cross platform
  • Native access to CPython packages, e.g. numpy, scipy, scikit-learn
  • Easy to install via the conda package
  • Readily Integrated with IPython, providing object introspection and PythonOCC’s Notebook rendering 

Future development directions for occ_airconics are towards a topologically flexible aircraft concept parameterisation, and subsequent optimisation using machine learning algorithms. This will include integration with aerodynamic analysis.

occ_airconics is available now, to get started simply visit the installation instructions.

Design Optimization tools – some completely biased suggestions

Screenshot 2015-01-27 20.49.05These pages are all about parametric geometry. The ultimate goal of geometry parameterization is, however,  usually some type of systematic design search process guided by an objective function computed through a (most often numerical) analysis/simulation process. So, here are some suggestions for building blocks to create such a design search system.

We have a sister site called optimization.codes, following a format similar to this site’s. It is the home page of a book on engineering design via surrogate modeling, a technique that facilitates design search when the analysis code used to measure the performance of a design (a geometry) is expensive to compute. The site is also home to an extensive toolset, comprising Matlab code for generating sampling plans (design of experiments) and for building surrogate models based on these. It also includes code for surrogate-assisted optimization (expected improvement and error-based update schemes). Like over here, all that code is free to download.

If you’d prefer to do your surrogate modeling in Python, some of the same technology is implemented on pyKriging.com. As the name suggests, this is a Python implementation of the surrogate modeling technique called Kriging. The code also allows you to iteratively improve the accuracy of your surrogates via error-based updating – an expected improvement updates code is in the pipeline.

Screenshot 2015-01-27 21.19.44

And finally, a suggestion if you are looking for a CFD capability to assist aircraft performance prediction. Chris Paulson has a free wrapper for OpenFOAM specially designed for the analysis of small to medium scale airframes – you can download it from DroneCFD.com.

AirCONICS v0.2.0 now available

a380

The next major update to AirCONICS is now live and can be downloaded as described here. Here is a summary of what is new in this release:

– a major new addition is a parametric airliner geometry – run transonic_airliner.py to see it, uncomment the appropriate lines at the end of the file to get it to generate geometries approximating a few existing aircraft types (B787-8, -9, A380 – shown above).

– another new parametric model is the one adding a pylon and a turbofan engine
(external surface model) to a given wing surface – see engine.py

AirCONICStools.py now includes the function AddTEtoOpenAirfoil, which adds a trailing edge closure to an open airfoil curve with a finite trailing edge.

– Another new addition to AirCONICStools.py is a simple routine for assigining
basic material properties to an object (AssignMaterial). This will have an effect
on renderings.

– The liftingsurface object now has an additional attribute, the variable
TipRequired. When set to False, the wing is not closed off with a tip surface
(see, for example, the script nacelle_as_wrapped_around_wing_example.py – here there is no such thing as a wing tip – it would be inside the nacelle, so it is
best not to generate it at all).

– the wing_example_transonic_airliner.py example script now features more realistic airfoils and twist distribution, loosely based on the CRM (Common Research Model)

– a tailfin/tailplane example has been added (airlinertail.py)

– A bug has been fixed in the liftingsurface class, which caused an error in the
calculation of the leading edge shape with certain highly non-linear sweep angle
variations

– Other improvements throughout the code improving performance, functionality
and stability

AirCONICS (Aircraft CONfiguration through Integrated Cross-disciplinary Scripting)

Screenshot 2014-10-03 20.34.09 AirCONICS is a free collection of parametric geometries defined as Rhinoceros/Python objects and scripts. They use the OpenNURBS framework through Rhinoceros and they can be run (using the RunPythonScript command) in Rhinoceros. The MacOS X version of Rhinoceros is available for free, while a trial version is available for free under Windows (the latter also features a neat IDE for developing Python code). The fundamental principle behind AirCONICS is that conceptual and preliminary design geometries can be defined (and stored) as scripts. This allows for:

  • easy parameterization of the geometry – all the variables of the code (including function handles) can be considered as potential parameters of the geometry
  • portability
  • the integration of complex design algorithms into the geometry – these can simply be part of the parametric ‘recipe’ that builds the geometry

You can get started with AirCONICS by downloading it here.

Aircraft geometry – tools, articles, and a forum for discussions

url_side1b Edgar Schmued, the man responsible for the aerodynamic design of the P-51 Mustang, extolled the virtues of shapes “the air likes to touch”. Whether you like your air similarly anthropomorphic or not, the cornerstone of modern aircraft design is the parametric description of their shape. At the heart of every aircraft design process lies a geometry.

These pages are dedicated to the type of parametric aircraft geometry that exposes a design to optimization processes.

Ostensibly, this is a repository of the codes that accompany the book shown on the left and the Rhino/Python & Matlab code related to each chapter of the book can be found by clicking on the corresponding links on the left. We aim, however, to provide more than that: regular updates, applications and further free resources, as well as a forum for discussion on parametric aircraft geometry.

This site is also home to AirCONICS, a Rhino/Python aircraft parametric geometry code built upon the principles described in the book. Scroll down for updates on AirCONICS or click here to download it (it is free).