Jump to content
  • Advertisement
Sign in to follow this  
Viik

Simulation of drag in flightsims

This topic is 1396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

 

I'm building a simple flight simulator. As a basis I'm using a simple model for calculating lift and drag on wings and control elements:

Lift = 0.5 * air_density * relative_airspeed^2 * wing_area * Cl
Drag = 0.5 * air_density * relative_airspeed^2 * wing_area * Cd

Cd = Cd0 + Cl^2 / ( pi * Aspect_ratio * efficiency_factor)

 

So total drag coefficient Cd includes lift induced drag.

 

Pretty much it's working as expected, the part which doesn't seam to work well is the vertical drag on the wings.

What I mean is that during roll, intuitively one would expect some portion of the drag on a wing pushing perpendicularly to the top/bottom surface of the wing, making roll a bit more difficult. Right now this part of the drag is covered only by Cd0 (I use 0.045 as default), which seams to be more relevant only for the wing traveling in parallel to aiflow, not perpindicularly. At the end I need ailerons with very small surface area and low angle of attack (-5;+5) to put airlpane into roll really fast.

 

Probably I'm not getting correct local velocity right now, in a sense that roll of the airplane doesn't effect the local direction of airflow at wing element, so only velocity relative to the plane is taken into account.

 

Anyway, maybe someone have thoughts on this. Just trying to get a better understanding of how typical setup looks like. I'm still missing some important parts of the total drag, such as due fuselage, canopy, landing gears and etc.

Share this post


Link to post
Share on other sites
Advertisement

I would think the drag against the wing surface in the normal (perpendicular) direction during a roll would be proportional to the wing area times the angular velocity (squared?), not the airspeed. It would be applicable to the aileron also. [ EDIT: and elevators, landing gear, etc. Anything "protruding" from the fuselage. ] Similar to the drag induced by the air against the aircraft's frontal area normal to the velocity (which you mention you haven't modeled yet.)

 

EDIT: With regard to roll rate, I wouldn't expect the perpendicular force on the control surfaces (proportional to angular velocity) to contribute any noticeable change. Resistance to roll would be affected for the most part by the [edit: longitudinal] moment of inertia (MOI) of the plane. The roll rate (change in angular velocity) would be proportional to the torque induced by normal forces on the control surfaces, and inversely proportional to the MOI. You'll have to keep track of the angular velocities (perhaps along 3 axes) and 3 MOI's. The three torque axes (and MOIs) would affect climb [pitch] rate (a little because the change in angular velocity needed is small), yaw rate and roll rate.

 

Apply yaw rate carefully as the that's the most sensitive as the aileron is the only surface that affects it (with any significance). That's why flat spins are the worst.

Edited by Buckeye

Share this post


Link to post
Share on other sites

Thank you, Buckeye! Yeah, this makes more sense. Proper calculation of local airspeed I should do anyway, but it will effect only the lift force and inflow direction drag.

So additional drag force would be something like:

Drag_secondary_roll = 0.5 * air_density * relative_angular_roll_peed^2 * wing_area * Cflat

where Cflat is going to be someting a bit smaller than a flat plate drag coefficient (1.28), or better approximation can be calculated using JavaFoil.

 

On a second thought, maybe I should simply extend my Cl and Cd lookup tables and include angles of attack up to -90; 90 degrees.

Share this post


Link to post
Share on other sites

maybe I should simply extend my Cl and Cd lookup tables and include angles of attack up to -90; 90 degrees.

 

Hmm. Might work, but probably better to keep the simulation of tangential and normal forces separate, in that lift is also affected by airfoil shape and surface area, in addition to the profile area. Rolling tangential flow and normal flow affects into one coefficient for various angles of attack could result in effects that will be difficult to debug. You'll probably be calculating normal (profile) drag for other surfaces (fuselage, etc.), in any case, and it may be easier to simulate the normal drag using a single profile calc for the aircraft which includes the control surfaces.

 

EDIT: you may want to consider this data.

Edited by Buckeye

Share this post


Link to post
Share on other sites

Yes, you are right, I should take into account other surfaces as well, like drag from the fuselage and other parts by the crosswind and etc. I'll give it a try.

Thank you, Buckeye, for the guidance!

 

EDIT: Thank you for the link. Now I see that I'm just neglecting Lift and Drag coefficients at high angles of attack.

Edited by Viik

Share this post


Link to post
Share on other sites

 

Probably I'm not getting correct local velocity right now, in a sense that roll of the airplane doesn't effect the local direction of airflow at wing element, so only velocity relative to the plane is taken into account.

 

 

This is absolutely essential - without calculating the local flow, then if you start to roll, return the ailerons to neutral, there will be nothing to stop the roll continuing. The roll stops (and starts) not due to drag, but due to the lift.

 

Another thing you want to consider is that control surface deflection does two things - or at least, it can be approximated in two ways:

 

1. adding a constant, related to (e.g. proportional) the control surface deflection, to the Cl for a given angle of attack

 

2. Modifying the angle of attack .

 

So - if your control surface is 50% of your wing chord (a bit extreme), then for small deflections down, Cl will increase and the angle of attack will increase. Both contribute to the change in lift/drag on the wing.

 

In addition, for some planes, or when the control surfaces deflect significantly (e.g. flaps, or elevons), then the pitching moment needs to be adjusted too.

 

I've written a R/C flight simulator that's pretty accurate, certainly for the planes I fly in real life. If you run it, then you can cycle through the wing components (keys '0' and '9') and it will plot the Cl/Cd etc curves, including adjusting them as you change the control inputs: PicaSim

 

For handling the full +/- 180 degrees, I parameterise the laminar flow range (including for "backwards" flow across the aerofoil), and also the stalled range, and then blend between them. Another useful link is this. However, during normal flight (including a roll), none of the flight surfaces will be stalled, so you might not want to worry about this aspect yet.

Edited by MrRowl

Share this post


Link to post
Share on other sites

For handling the full +/- 180 degrees, I parameterise the laminar flow range (including for "backwards" flow across the aerofoil), and also the stalled range, and then blend between them. Another useful link is this. However, during normal flight (including a roll), none of the flight surfaces will be stalled, so you might not want to worry about this aspect yet.

Hmmm, I had impression that stall is simulated simply by getting a "downhill going" Cl, which starts at critical AoA and higher degrees. So that only one Cl coefficient lookup table is used and if it's generated for 180 degrees then we kind of cover all cases. With the article you linked it's between 15 to 20 degrees. But if I understand correctly what you are saying is that I need to have a second table for Cl and Cd which describes a behaviour during stall, right?

EDIT: Ohh I see now, beyond stall angles different airfoils will behave very similar to flat plate. Now I understand what you mean by blending between different sets.

So in principal, a more generic approach is to have a complete +-180 degrees lookup table for each type of airfoil or have a set of 0-20 lookup tables and one for 20-180 for stall.

Regarding deflection of control surface, thank you for suggestion. Right now I have ailerons just attached at the back of the wings as separate surface. They are not a part of the wing geometry yet, so calculation there goes independent. In case if they are part of the wing, I could "cut-out" proportional part of the area and Cl coefficient from wing. I'll check it in javafoil, there were a way to simulate control surfaces, I think.

Share this post


Link to post
Share on other sites

 


For handling the full +/- 180 degrees, I parameterise the laminar flow range (including for "backwards" flow across the aerofoil), and also the stalled range, and then blend between them. Another useful link is this. However, during normal flight (including a roll), none of the flight surfaces will be stalled, so you might not want to worry about this aspect yet.

Hmmm, I had impression that stall is simulated simply by getting a "downhill going" Cl, which starts at critical AoA and higher degrees. So that only one Cl coefficient lookup table is used and if it's generated for 180 degrees then we kind of cover all cases. With the article you linked it's between 15 to 20 degrees. But if I understand correctly what you are saying is that I need to have a second table for Cl and Cd which describes a behaviour during stall, right?

 

 

There's lots of ways of doing things! I don't use a table at all (now, I used to) - I parameterise the different regimes - e.g. Cl at 0 AoA, Cl vs AoA slope, angle at which the stall starts, angle at which it stops etc. I found that in practice this is a lot easier than a single table, since you can modify the parameters at runtime (e.g. depending on Renoylds number, control surface deflection etc), and it's just easier to adjust in order to get the behaviour you want. The "stalled flat-plate" section is essentially the same for all aerofoils, defined by sin^2 curves etc..

 

The effect of the stall depends on the aerofoil. Some will have a significant drop in CL as AoA increases, with others the CL will just flatten (but CD will increase). 

Edited by MrRowl

Share this post


Link to post
Share on other sites

 

Regarding deflection of control surface, thank you for suggestion. Right now I have ailerons just attached at the back of the wings as separate surface. They are not a part of the wing geometry yet, so calculation there goes independent. In case if they are part of the wing, I could "cut-out" proportional part of the area and Cl coefficient from wing. I'll check it in javafoil, there were a way to simulate control surfaces, I think.

 

 

That is probably a problem. Control surfaces won't just generate lift/drag in addition to the main wing surface - they alter the air flow across the whole wing. You can find tables of Cl/Cd/Cm curves at different flap deflections. As I mentioned, you can get a reasonable approximation by figuring out sensible ways to procedurally modify the curve - so adding offsets to Cl0, or changing the effective AoA.

Edited by MrRowl

Share this post


Link to post
Share on other sites

Ohh, ok, I thought they are simulated as separate surface. But now it makes sense why in some homebuilding articles they modeled them as a single but shape chnaging surface.

CM - is it a point of application of Lift force?

 

Thank you for your feedback, MrRowl! I'll put this suggestions into plan. It's a bit more clear now of how it suppose to work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!