peterdsharpe / AeroSandbox

Aircraft design optimization made fast through modern automatic differentiation. Composable analysis tools for aerodynamics, propulsion, structures, trajectory design, and much more.
https://peterdsharpe.github.io/AeroSandbox/
MIT License
687 stars 111 forks source link

Use multivariate regression analysis to obtain "Application Laws" for Airfoil Polar Data #57

Closed Dirk07 closed 2 years ago

Dirk07 commented 3 years ago

Background / Motivation

XFLR5 required to perform an excessive number of airfoil polar calculations in order to interpolate from this data, when applied to the 3D wing for estimating drag for instance. Slight changes on the airfoil along the wing span (i.e. a change of max. thickness, nose radius size or TE-angle - just to name a few) most often required to ammend the polar data representing these changes again for a set of different Re-Numbers, flap angles, perhaps flap ratios. The more complex the wing became in these terms the much more airfoil polar data was required. Beside that, existing problems like "C.l out of envelope" or "cannot interpolate at Re=..." and similar errormessages should be handled in an automated fashion. Outliers in the different curves should automatically be identified and further on ignored. Range parameters, like alpha(cLmax), alpha(cLmin), cLmax, cLmin, as well as further characteristic measures like the relevant derivatives as dcL/dalpha, dalpha/ddelta etc. should be automatically identified - for convenience, to allow plausibility checks and first and foremost to speed up the entire process.

Description of Proposed Feature

Consider all airfoil polar results as unknown functions of following Parameters:

Above List of parameters can be reduced or extended, pending on the complexity of the 3D Wing, to be analyzed. Pending on the wing´s complexity and its coarsely foreseen range in airspeed for most of these parameters lower and upper boundaries and the number of intermediate steps in between should be specified by the user. For all combinations of defined parameter values the polar data shall be obtained, using xfoil. This concludes in n operation points, where n is the product of the different numbers of values, each parameter is investigated for, i.e.:

7 different Re-Numbers 5 different flap deflections 20 different AoA´s 2 different Airfoils (varying along the wing in a single or multiple measures, such as nose_radius, maximum thickness etc) 3 different flap ratios * ... whatever parameter is still to be addressed ... =~ 5200+ operation points :-/

Thus, n is always quite a huge number to be handled manually (without automation), although multivariate regression allows to condense this number. Symmetries in the data (i.e. the point-symmetric cL vs alpha curve of an symmetric airfoil) may further be used to condense this data). However, once the dataset is complete, a multivariate regression can be performed for each of the application laws on:

cL(alpha, delta, Re, flap ratio, ...), cD(...), cM(...), cHM(...), cHF(...) where these functions are approximated by (sometimes quite) high order polynomials:

c[0] + c[1]alpha + c[2]delta + ... + c[4]flap_ratio + ... + c[i]alpha^2 + c[i+1]alphadelta + c[i+2]delta^2 + ... + c[j]alpha^15 + ...

It must be noted that by far not every term in these polynomials will be really needed to approximate the data sufficiently. Some terms have higher influence, others have less, a lot are insignifcant. The regression statistics will figure out, which terms should be kept and which can be droppped, allowing again to condense the polynomial automatically.

The final result is a more or less handy polynomial function, which is always steady and multiple times derivable in the specified ranges, where the coefficient c[1] is nothing else than first derivate by alpha, i.e. dcL/dalpha or dcM/dalpha etc. Hence, cutting these polynomials after the first order terms, provides the "linearized" airfoil polar data very accurately.

Alternatives I Have Considered

None. As mentioned before, unaddressing this, like in XFLR5, will leave the user to a considerable workload, in particular, when intermediate flap deflections shall be investigated, or when the flap ratio varies along the span.

Additional Context

If needed I can provide a full example.

Please excuse my English.

peterdsharpe commented 2 years ago

Hi @Dirk07, apologies for the late reply, but this feature is now included in the latest AeroSandbox v3.2.10 using Airfoil.generate_polars(). Demo here: https://github.com/peterdsharpe/AeroSandbox/blob/master/aerosandbox/geometry/airfoil/test_airfoil/test_airfoil_polar_generation.py