07302018 01:38 AM


Lift Calculation Error?
There appears to be a potential error in lift calculation.
I was working on an MFD, and was examining the lift force vector for the delta glider.
From DeltaGlider.cpp:
Code:
void VLiftCoeff (VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
int i;
const int nabsc = 9;
static const double AOA[nabsc] = {180*RAD,60*RAD,30*RAD, 2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
static const double CL[nabsc] = { 0, 0, 0.4, 0, 0.7, 1, 0.8, 0, 0};
static const double CM[nabsc] = { 0, 0, 0.014, 0.0039, 0.006,0.008,0.010, 0, 0};
for (i = 0; i < nabsc1 && AOA[i+1] < aoa; i++);
double f = (aoaAOA[i]) / (AOA[i+1]AOA[i]);
*cl = CL[i] + (CL[i+1]CL[i]) * f; // aoadependent lift coefficient
....
}
If I'm reading this correctly, lift should be zero at 2 degrees angle of attack. See pictures below for correct behavior in Orbiter 2010:
However, the calculation Orbiter 2016 appears to be incorrect, see below. Note that as the slope (angle of velocity vector relative to the horizon) approaches zero, the problem goes away. It appears to be worse the larger the slope angle, and is actually close to correct in the third picture:
I compiled the DeltaGlider and traced through the code. The problem appears to be that the double aoa being fed into the function VLiftCoeff is not correct. To test, I made a dummy variable within VLiftCoeff:
Code:
void VLiftCoeff (VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
int i;
const int nabsc = 9;
static const double AOA[nabsc] = {180*RAD,60*RAD,30*RAD, 2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
static const double CL[nabsc] = { 0, 0, 0.4, 0, 0.7, 1, 0.8, 0, 0};
static const double CM[nabsc] = { 0, 0, 0.014, 0.0039, 0.006,0.008,0.010, 0, 0};
for (i = 0; i < nabsc1 && AOA[i+1] < aoa; i++);
double f = (aoaAOA[i]) / (AOA[i+1]AOA[i]);
*cl = CL[i] + (CL[i+1]CL[i]) * f; // aoadependent lift coefficient
VESSEL* pV = oapiGetFocusInterface();
double aoaTest = pV>GetAOA();
......
}
The variables aoaTest and aoa do not match when tracing through line by line. I have not traced through the drag calculation, but since AoA goes into induced drag, I would imagine this would be affected as well.
This was reproduced on a clean install of 160828.


Issue Details

Status Awaiting Feedback
Priority 5  Medium
Affected Version Revision denoted in description
Fixed Version (none)
Users able to reproduce bug
0
Users unable to reproduce bug
0
Assigned Users
(none)
Tags
(none)

