Advertisement

Airfoil simulation

Started by March 21, 2016 03:30 PM
9 comments, last by BoredEngineer 8 years, 10 months ago

In continuation to over 2 years old topic:

http://www.gamedev.net/topic/661025-simulation-of-drag-in-flightsims/

I've got back to working on airfoil simulation. The focus of the project now is not a flight simulation specifically but variety of different machines, some of them, happen to utilize airfoils. I've got something working over the last week and tried to teach one of the existing machines to fly.

First "successful" take-off:

Second attempt with better balanced wings and control surfaces:

Since then I've improved controls (control surfaces where stalling) and added some rudimentary GUI. If you want to give it a try, compiled version is here: https://www.dropbox.com/s/55dazkm8q4s0axn/MMT_Content.zip?dl=0

The chassis of the vehicle has rather high drag and not really build as an airplane. So doing some fancy maneuvers is rather difficult, for example, I can't do a loop on it as it looses velocity super fast as soon as you start to pitch up. I have suspicion that total drag is too high (could be because of the chassis itself) and with zero throttle terminal velocity is around 65 km/h. Anyway, for proper test I'll add something like a Junkers J1 as I already have a low poly model of it.

--------------------- End of introduction -----------------------

There are couple of issues I can see with current model. Calculation of airfoil drag is done using this formula: Cd = Cd0 + Cl^2 / ( pi * Ar * e)

where Ar is aspect ratio (span/chord) and "e" is efficiency factor. Cl was calculated for the symmetrical airfoil and so I'm ignoring pitching moment, curve of Cl looks like this:

https://www.dropbox.com/s/hdw58m4hel64cfh/NACA_0012_Cl_smooth.PNG?dl=0

For a proper airplane I'm planning on cutting wings into multiple pieces, which means that Cd approximation won't work anymore as using aspect ratio for segment of the wing (rather than full wing) will drastically lower drag coefficient. I have a separate curve for Cd: https://www.dropbox.com/s/yu1ww6p8m6cp7ne/NACA_0012_Cd_smooth.PNG?dl=0 which I can apply directly, but it doesn't take into account the shape of the wing as a whole. So I'm baffled of how to properly describe end sections of the wings which might not be straight but have more of an ellipsoid form. For the full wing this is suppose to be taken into account by efficiency factor.

Another point that I want to improve is to model control surfaces as a part of the wing and not as a separate airfoil as it is done right now (very inaccurate). The question is, can I simply sum up Cl and Cd coefficients of wing section and aileron section, taking into account their respective angles of attack, or I have to get new curves with different states of control surfaces and blend between them?

The other important part I'm missing is ground effect, at least this seams to be more significant than proper simulation of the engine in respect to gliding behavior of the aircraft.

IFor a proper airplane I'm planning on cutting wings into multiple pieces, which means that Cd approximation won't work anymore as using aspect ratio for segment of the wing (rather than full wing) will drastically lower drag coefficient.


Just use the aspect ratio for the wing on each segment.

The question is, can I simply sum up Cl and Cd coefficients of wing section and aileron section...


No. However, you don't really need to get curves for the flap up/down and interpolate either - you can get a very good approximation by:

1. Adding a constant (depending on the flap deflection) to the CL curve.

2. Shifting the CL vs alpha curve left/right (depending on the flap deflection).

The way you do this depends significantly on the fraction of the wing chord that the flap occupies. Obviously if it's 100% (i.e. it's a fully moving surface) then the CL shift is zero, and the angle shift is just the flap angle deflection.

For more "normal" flaps you can estimate the CL offset, and you can practically calculate the alpha shift geometrically (calculate the change in angle between the original wing, and the new wing leading and trailing edges).

You might find two papers here useful:

http://m-selig.ae.illinois.edu/pubs/

Selig-2010-AIAA-2010-7635-FullEnvelopeAeroSim.pdf
Selig-2014-JofAC-FlightSim-FINAL.pdf

Hope this helps - Danny
Advertisement

IFor a proper airplane I'm planning on cutting wings into multiple pieces, which means that Cd approximation won't work anymore as using aspect ratio for segment of the wing (rather than full wing) will drastically lower drag coefficient.


Just use the aspect ratio for the wing on each segment.

The question is, can I simply sum up Cl and Cd coefficients of wing section and aileron section...


No. However, you don't really need to get curves for the flap up/down and interpolate either - you can get a very good approximation by:

1. Adding a constant (depending on the flap deflection) to the CL curve.

2. Shifting the CL vs alpha curve left/right (depending on the flap deflection).

The way you do this depends significantly on the fraction of the wing chord that the flap occupies. Obviously if it's 100% (i.e. it's a fully moving surface) then the CL shift is zero, and the angle shift is just the flap angle deflection.

For more "normal" flaps you can estimate the CL offset, and you can practically calculate the alpha shift geometrically (calculate the change in angle between the original wing, and the new wing leading and trailing edges).

You might find two papers here useful:

http://m-selig.ae.illinois.edu/pubs/

Selig-2010-AIAA-2010-7635-FullEnvelopeAeroSim.pdf
Selig-2014-JofAC-FlightSim-FINAL.pdf

Hope this helps - Danny

Thank you, for your continuous help, Danny!

I've checked articles and from what I see you are right - scaling and moving Cl/Cd/Cm curve is a way to go.

From these charts:

https://www.dropbox.com/s/tuodx3duuyylhze/Airfoilf_performance_with_control_surfaces.JPG?dl=0

But as I see it, scaling is non linear in respect to pre 45l and aft 45 degrees AoA coefficients. For example, at positive angles of control surface deflection, Cl generally shifts to the left, while staying the same at 45 degrees AoA. At the same time pre 45 degrees values are scaling up non linearly while post 45 are scaling down in more linear fashion.

In case with Cm it might look a bit simpler, but actually Cm at 0 AoA is changing rather rapidly.

Btw, they are using symmetrical airfoil but still have figures for Cm. Aren't Cm is suppose to be zero for non-chambered airfoils?

Regarding calculating angle of attack, do you mean something like this?:

https://www.dropbox.com/s/sh5ktsojemukya7/AoA_with_control_surface.JPG?dl=0

But as I see it, scaling is non linear in respect to pre 45l and aft 45 degrees AoA coefficients. For example, at positive angles of control surface deflection, Cl generally shifts to the left, while staying the same at 45 degrees AoA. At the same time pre 45 degrees values are scaling up non linearly while post 45 are scaling down in more linear fashion.


Not quite sure what you're getting at... I'd say the graph of CL vs alpha show two things:

1. +ve flap deflection shifts the graph left by pretty much the same amount at all angles of attack

2. +ve flap deflection shifts the graph up, but only in the non-stalled regions. Also, it has a greater effect in the normal flow region than for reverse flow.

If you mentally do the "horizontal" shift first, then you'll see there isn't much/any "vertical" shift left in the stalled regions.

In case with Cm it might look a bit simpler, but actually Cm at 0 AoA is changing rather rapidly.


It's true there's some slope introduced, but mostly it just shifts up/down in the non-stalled region.

Cm curve is a bit weird as it's around the 1/4 chord point - which is obviously the wrong place for reverse flow!

Btw, they are using symmetrical airfoil but still have figures for Cm. Aren't Cm is suppose to be zero for non-chambered airfoils?


It will be zero at alpha=0 and flap=0, and will be close to zero for the non-stalled region.

Regarding calculating angle of attack, do you mean something like this?:
https://www.dropbox.com/s/sh5ktsojemukya7/AoA_with_control_surface.JPG?dl=0


Yes - exactly that. I use that geometry to estimate the change in effective angle of attack (the horizontal shift), plus some heuristic for the vertical shift.

My apologies, this "In case with Cm it might look a bit simpler, but actually Cm at 0 AoA is changing rather rapidly" was suppose to be about Cd coefficient, not Cm!

What you say about graphs does make sense, I'll try to incorporate it into calculations. I'm still using pre-calculated curves of coefficients and perhaps this is a good time to switch to parametrized curves.

Meanwhile I found another issue - I have a mix of calculations, lift is calculated using 2D flow but drag is following more of the 3D approach. This need to be fixed too. To summarize what should be implemented:

https://www.dropbox.com/s/pej5oj10jy33chk/Wing_lift_and_drag.JPG?dl=0

this should take care of loosing lift and getting more drag from downwash along the span of the wings.

I imagine that cutting wings into segments could be done like this:

https://www.dropbox.com/s/zbj8vi5pyujkdjf/Wing_segmentation.svg?dl=0

Velocity is calculated individually in each point Pn, a complete calculation of L and D is done at each point. Meaning that CL and CD are calculated using formulas above for each segment individually, what is shared between them is AR (aspect ratio of the wing). Not too sure about this as it looks like I'm using a collection of small wings and each of them has a correction for span downwash... this doesn't sound right.

Well, mixed it up again... Re-read articles mentioned in 2nd post and looked at how full wing CL and CD are calculated. They are using strip theory with a lot of look up tables for each segment of the wing. 2D coefficients of Cl/Cd/Cm are corrected for beyond stall and around 90 degrees AoA, to account for 3D shape of the wing.

I don't see any correction being done for the "normal" pre-stall coefficients, unless induced angle of attack is somehow involved in this process. Which to me looks weird as 2D coefficients of infinite wing would produce much more lift in a "normal" flight.

I'm looking at other methods which are focused on simulation of the whole wing. Found an explanation how surface area of wing with control surface relative to the surface area of the full wing can be used to determine "shift" of AoA. But this modifies behavior of the full wing, not sure how one would go about handling both flaps and ailerons at the same time. One could calculate their individual "shift" of AoA to find the result but this formulation, somehow assumes the same shape of airfoil used for whole wing. How would I handle cutting it into pieces to capture aerodynamic twist or having different section made using different airfoils? Strip theory sounds like an answer here, but issue above ^^^

Advertisement

Re-read article and found that induced angle of attack is not used directly but for each section of the wing they estimate downwash using Biot-Savart law and correct Cl coefficients of this specific section. I'll get back to this at some points later.

Right now I'll focus on a complete wing estimation. According to "Introduction to aeronautics: a design perspective" and "Aircraft Design: A Conceptual Approach", induced angle of attack is not used directly but incorporate into multiple equations. To summarize my finding, this is an algorithm I'm planning to implement as a next step:

1) Get current AoA a and al=0 (AoA of airfoil where lift coefficient is zero)
2) Get Cl at current a from curve (taking into account control surfaces)
3) Estimate change in lift coefficient as:
Cla = Cl / (a - al=0)
[this is valid only for pre-stall angles of attack as Cl is linear at that portion]
4) Get planform area as:
S = b * c
b - span and c -chord
5) Get aspect ratio as:
AR = b2 / S
6) Calculate finite wing curve slope as:
CLa = Cla / ( 1 + (57.3 * Cla)/( Pi * e * AR))
7) Calculate lift coefficient as:
CL = CLa * (a - aL=0)
8) Get Cd value from curve for current a (taking into account control surfaces)
9) Calculate drag coefficient as:
CD = Cd + (CL2 / Pi * e * AR)
10) Calculate dynamic pressure as:
q = 1/2 * p * V2
(optionally) to capture effect of side slip of the wing calculate dynamic pressure as:
q = 1/2 * p * V2 * cos2 ?
where ? is a horizontal angle between airfoil chord direction and incoming airflow
11) Finally calculate lift and drag as:
L = CL * q * S
D = CD * q * S
12) Calculate pitching moment as:
M = Cm * q * S * c [one books didn't covered this subject, so it's added as extra] I don't have equation for pitching moment coefficient of the full wing, so 2d airfoil coefficient is used.
All this assumes that we are looking at a full wing - meaning both left and right side from the fuselage. So AR and S should be calculated accordingly.
To apply forces individually at different segments of the wing, to capture varying Cl and Cd coefficients due to presents of control surfaces or aerodynamic twist. We need to calculate:
dL = CL * q * dS
dD = CD * q * dS

In this case AR and S correspond to a full wing, but AoA and Cl and Cd are picked up locally for each segment.

Does this makes sense?

Does this makes sense?

You need to be careful that you handle the varying air flow speed and angle of attack over the wing. For example, if the plane is rolling, then this doesn't change the angle of attack much at the root, but it does (increasingly) towards the tip. This is what makes the plane stop rolling almost as soon as you centralise the ailerons. It sounds like you're in danger of losing this (which would affect every other characteristic too) - or did I misunderstand?!

Does this makes sense?

You need to be careful that you handle the varying air flow speed and angle of attack over the wing. For example, if the plane is rolling, then this doesn't change the angle of attack much at the root, but it does (increasingly) towards the tip. This is what makes the plane stop rolling almost as soon as you centralise the ailerons. It sounds like you're in danger of losing this (which would affect every other characteristic too) - or did I misunderstand?!

Yes, this is why I want to apply this in the form of delta L and delta D for different sections of the wing. So section at the tip of the wing would have a different alpha and beta angles of attack and potentially different airflow if some torque is involved.

What worries me is that these downwash corrections for calculating CL and CD won't work correctly for separate sections of the wing as they are designed for a uniform airfoil. I've looked at later chapters where control surfaces discussed and formulation is done for change of Cl and Cd of the whole wing, not a section. Maybe this approach is not suitable and I should go with a strip theory.

Strip theory articles that you've linked are more or less clear on many points but important one regarding downwash is a bit beyond my knowledge:

https://www.dropbox.com/s/8hh2wb0t51hbl0k/Downwash.JPG?dl=0

I understand general idea of what they are doing but checking wikipedia for Biot–Savart law, tells me that I have zero clue how to implement it practically :D

Do you happen to know some resource on strip theory? I just don't see "classical" methods being able to solve this issue with downwash when forces have to be calculated at multiple segments.

Alternatively, something like this could be done:

https://www.dropbox.com/s/7npe8lsnudnbfbk/Downwash_approximation.JPG?dl=0

But this form is for elliptical wings and lift distribution is effected by their shape, the downwash itself can be constant for such wing. What I could do is use wings efficiency factor together with aspect ratio to "bend" downwash curve. Like higher aspect ration and efficiency factor would make washdown velocity more as a flat line.

Unfortunately I don't have any idea of magnitude of these values and how some even basic points can be estimated.

This topic is closed to new replies.

Advertisement