# ProblemCalculating drag in Orbiter / CreateAirfoil flaw

#### RisingFury

##### OBSP developer
I've been working with Orbiter's aerodynamics and noticed what I think to be a flaw in the CreateAirfoil function.

The function CreateAirfoil asks you to supply a pointer to a function calculating the lift, drag and moment coefficients, as well as the wing area. The same goes for CreateAirfoil2 and CreateAirfoil3.

The problem is that Orbiter seems to use the wing area when calculating drag, instead of the frontal area! That means the coefficient of drag needs to take into account the chance in frontal area, not just the change in geometry around which the air flows.

Assuming a yaw of 0, the cross section facing the free stream equals = frontal area * cos(AOA) + wing area * sin(AOA). That means that for every airfoil you wish to create, you must call the CreateAirfoil function twice - first time you pass on the wing area and you create a function for lift and drag coefficients of the wing. The second time you call CreateAirfoil, you need to pass it the frontal area, together with a different function for calculating drag coefficient.

To me this seems to be a trap for developers because it probably goes by unnoticed. It's also less efficient then just handling one airfoil in place of two and it is easier to create a function of lift and drag as a function of angle of attack because there's more reference material on the subject...

I would suggest that a developer would need to pass at least the wing area, frontal area and possibly even area from the side (along all three principle axis) for every airfoil he creates.

Now that I've explained what I think the problem is, is there a good reason for why airfoils are set up the way they currently are? Am I missing something?

#### Hielor

##### Defender of Truth
Donator
Beta Tester
Now that I've explained what I think the problem is, is there a good reason for why airfoils are set up the way they currently are? Am I missing something?
I would think because the drag created by an airfoil is largely induced drag, drag produced by the creation of lift, it's more dependent on wing area than frontal area (because wing area has more to do with lift than frontal area).

A large component of the parasitic drag will also be skin-friction drag, which is also dependent on the surface area over which the air flows, not the frontal area...

#### RisingFury

##### OBSP developer
I would think because the drag created by an airfoil is largely induced drag, drag produced by the creation of lift, it's more dependent on wing area than frontal area (because wing area has more to do with lift than frontal area).

A large component of the parasitic drag will also be skin-friction drag, which is also dependent on the surface area over which the air flows, not the frontal area...

The problem is that if the frontal area of the wing is 1 m^2 and the wing area is 100 m^2, then 100 m^2 is going to be used in the calculation for parasitic drag.

You also have to consider that not every shape is an airfoil - the body of an airplane for example still produces some lift and most of it's drag doesn't come from induced drag...

#### Hielor

##### Defender of Truth
Donator
Beta Tester
The problem is that if the frontal area of the wing is 1 m^2 and the wing area is 100 m^2, then 100 m^2 is going to be used in the calculation for parasitic drag.
Skin-friction drag?