A password will be e-mailed to you.

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: [1] 2
Author Topic: Drag calculation
johnor999
New User
Posts: 13
Send Message
Post Drag calculation
on: April 17, 2012, 11:15

Hello!

If I've understood things correctly, LM took over the source code for FSX. Now this would mean that the developers of Prepar3D should know how FSX calculates drag.

Since the FSX dev team never mentioned exactly how drag is calculated by the sim engine, I would like know if the Prepar3D devs could tell us how FSX calculates drag once and for all. (The equation)

I know this might be off topic as it deals with FSX, however, I didn't know where else to ask since the FSX devs seem to be unreachable.

Thank you in advance!

Johan Nordqvist

jimcooper1
Professional
Posts: 345
Send Message
jimcooper1
Post Re: Drag calculation
on: April 17, 2012, 14:06

Have you looked at the FSX SDK (or the P3D SDK)?
AIR files are used to provide flight dynamics data, in the form of coefficients and data tables, that determine the flying qualities of an aircraft. A number of samples are provided that can be used as the basis for new flight models.
Fine tuning of flight dynamics can be achieved by editting the Aircraft.cfg file

Jim

johnor999
New User
Posts: 13
Send Message
Post Re: Drag calculation
on: April 17, 2012, 17:03

Well, that's time consuming and besides, I'm something of a math-nerd. This problem has bugged me for years, which is why I'm so curious of how the calculation is made by FS.

I know that D = CD * q * S, and that CD = CDp + CDi. However, the most common equations for CDi return some deviations.

Johan Nordqvist

MikeSchroe-
ter
Lockheed Martin
Posts: 96
Send Message
Post Re: Drag calculation
on: April 18, 2012, 13:54

It's fairly basic. CDi = CL^2 / (PI*AR*e), where e is oswald_efficiency_factor defined in the sim.cfg/aircraft.cfg. The other contributing coefficients, as Jim stated, are in the .air file.

johnor999
New User
Posts: 13
Send Message
Post Re: Drag calculation
on: April 18, 2012, 14:16

Now that's strange, because that equation has never returned correct CDi values. I've made tests where I measured CDi in FSX by using this equation:

(Net_thrust * cos(a) / (q * S)) - (CD0 + CDm)

Here are some of the values that I measured compared to the ones calculated:

FL	Calculated	Measured
410	0.010449079	0.006011202
390	0.008643899	0.005061775
370	0.007145576	0.0042756
350	0.005908498	0.003620052
330	0.00490519	0.003093597
310	0.004081785	0.002657644
290	0.003406548	0.0023033
270	0.002851715	0.002007237
250	0.002395201	0.001768188

As you can see, something appears to be missing

MikeSchroe-
ter
Lockheed Martin
Posts: 96
Send Message
Post Re: Drag calculation
on: April 18, 2012, 15:02

Well, I think there may be a handful of small factors. First, those differences at first glance don't necessarily look significant relative to the overall drag. i.e. do they represenct significant differences in net speed speed? Other factors that could contribute error is difference in lift calculation and slip angles affecting speed.

Mike

jimcooper1
Professional
Posts: 345
Send Message
jimcooper1
Post Re: Drag calculation
on: April 18, 2012, 17:04

Johan,

If you need 'Level-D' performance and handling you're probably better off using ExternalSim to create your flight model and as you're a self-confessed Math-Nerd that would probably be the easier option!

Jim

johnor999
New User
Posts: 13
Send Message
Post Re: Drag calculation
on: April 18, 2012, 17:24

Here's the thing, I have very stable data for FL410 to FL100. In fact we're talking about 950 rows of text. I've read about how FS calculates CD, and no one can make it work with the available equations. The bigger the plane gets, the greater the error gets. And I'm not the only one to have problems with this matter. In fact, if I retrieve the CL from Net thrust, and try to calculate lift with that value. However, the result is always WAY wrong, which means that either A: FS uses two different CL values or B: FS uses another equation than what has been published.

I'm not the kind of guy who would settle for approximations (which is why I haven't givven up after all these years), I'm interested in knowing EXACTLY how FS calculates drag. In other words, I want to know what the complete equation for drag is.

Johan

MikeSchroe-
ter
Lockheed Martin
Posts: 96
Send Message
Post Re: Drag calculation
on: April 18, 2012, 20:01

Another source of your error is that your equation may be assming that CDi = 0 at alpha = 0. It's actually 0 at CL = 0, which is normally less than 0. It's also based on the basic CL vs. alpha table rather than total lift. That's an approximation that is generally acceptable.

johnor999
New User
Posts: 13
Send Message
Post Re: Drag calculation
on: April 19, 2012, 09:23

Okay, but what equation do FS use for the CL in the CDi equation? I've tried CDi = K(CLa * a + CL0 * a_i)^2, where a_i is the angle where CL = 0. I've also tried the angle of which CDi = 0, available in the airfile of my test plane. The problem is that it won't give the right answer.

MikeSchroe-
ter
Lockheed Martin
Posts: 96
Send Message
Post Re: Drag calculation
on: April 20, 2012, 15:39

CL = CLa * a, where a is the AOA relative from where CL = 0 (normall a negative AOA). The "0 lift AOA" is derived from the lift curve in the .air file. CLa is the average slope of the lift curve in the .air file within the "normal" flight range.

WarpD
Advanced
Posts: 81
Send Message
Post Re: Drag calculation
on: April 20, 2012, 16:25

Wow... I was removed from this discussion??

MikeSchroe-
ter
Lockheed Martin
Posts: 96
Send Message
Post Re: Drag calculation
on: April 20, 2012, 18:06

I think there was a server glitch earlier. I know of at least one recent post of mine that's missing, but I think all is well now.

http://www.prepar3d.com/forum-5/?mingleforumaction=viewtopic&t=1014.0

johnor999
New User
Posts: 13
Send Message
Post Re: Drag calculation
on: April 23, 2012, 06:08

So the CL in CDi is CL = CLa * (AoA + AoA_0). (Where AoA_0 is the AoA @ CL=0)
Have I understood you correctly?

This equation also returns differences between the real FSX CDi and the calculated CDi. When the difference in CDi vs altitude is plotted on a chart, the chart gives a regular curve that is almost linear. This leads me to assume that something besides parasite drag and induced drag is causing this difference. With jets such as the B738, the difference between calculated Net drag and measured net drag isn't significant. However, with planes such as the B744, the difference is rather noticable.

Note that the tests were carried out in ISA conditions and with unlimited fuel, where the fuel level is 0. I measured the values after the plane had been completely stabilized in terms of N1, FF and Net thrust. Also, the calculated air file table values were correctly linearly interpolated.

Note that I've tried the following:
CL = CLa * AoA
CL = CLa * (AoA - AoA_0)
CL = CLa * (AoA + AoA_0)
CL = CLa@CL=0 * (AoA)
CL = CLa@CL=0 * (AoA + AoA_0)
CL = CLa@CL=0 * (AoA - AoA_0)

Since there is one exact way that FSX make planes behave, the presence of variations either means that the equation isn't complete/correct or that something has been miscalculated along the way. I've spent a great deal of time making sure that there are no mathematical errors, which means that the equations that I use aren't complete or correct.

Johan

WarpD
Advanced
Posts: 81
Send Message
Post Re: Drag calculation
on: April 23, 2012, 12:27

Lift = weight * gravitational acceleration. (I promise, it's accurate)
CL = L/(S*1.426*p*V^2) where S = wing area, p = ambient density and V^2 is velocity in knots, squared

For CDi:

W = totalWeight*acceleration
p = ambientDensity
V = TAS in feet per second
a = AoA in radians
AR = aspect ratio ( wing_span^2/wing_area)
Cid = 1/(PI*AR*e) where e = oswald efficiency
CDi = ((a*0.99*CL_alpha)^2)*Cid where CL_alpha is the lift slope.

Ed Wilson

Pages: [1] 2
Mingle Forum by cartpauj
Version: 1.0.31 ; Page loaded in: 0.117 seconds.