void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*22.5;
static const double istep = 1.0/step;
static const int nabsc = 17;
static const double CL[nabsc] = {0, 0.1, 0.2, 0.1, 0, 0.1, 0.2, 0.1, 0, -0.1, -0.2, -0.1, 0, -0.1, -0.2, -0.1, 0};
aoa += PI;
int idx = max (0, min (15, (int)(aoa*istep)));
double d = aoa*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = 0.0;
*cd = 2.5 + oapiGetInducedDrag (*cl, 0.16, 0.2);
*cl = 0;
}
// 2. horizontal lift component (vertical stabiliser and body)
void HLiftCoeff (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*22.5;
static const double istep = 1.0/step;
static const int nabsc = 17;
static const double CL[nabsc] = {0, 0.1, 0.2, 0.1, 0, 0.1, 0.2, 0.1, 0, -0.1, -0.2, -0.1, 0, -0.1, -0.2, -0.1, 0};
beta += PI;
int idx = max (0, min (15, (int)(beta*istep)));
double d = beta*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = 0.0;
*cd = 2.5 + oapiGetInducedDrag (*cl, 0.16, 0.2);
*cl = 0;
}
void VLiftCoeffNeg (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*22.5;
static const double istep = 1.0/step;
static const int nabsc = 17;
static const double CL[nabsc] = {0, -0.1, -0.2, -0.1, 0, -0.1, -0.2, -0.1, 0, 0.1, 0.2, 0.1, 0, 0.1, 0.2, 0.1, 0};
aoa += PI;
int idx = max (0, min (15, (int)(aoa*istep)));
double d = aoa*istep - idx;
///*cl = 3.5*(CL[idx] + (CL[idx+1]-CL[idx])*d);
*cl = 18*(CL[idx] + (CL[idx+1]-CL[idx])*d);
*cm = 0;
*cd = 0.00001; //0.4*(0.11 + oapiGetInducedDrag (*cl, 0.16, 0.2));
}
// 2. horizontal lift component (vertical stabiliser and body)
void HLiftCoeffNeg (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*22.5;
static const double istep = 1.0/step;
static const int nabsc = 17;
static const double CL[nabsc] = {0, -0.1, -0.2, -0.1, 0, -0.1, -0.2, -0.1, 0, 0.1, 0.2, 0.1, 0, 0.1, 0.2, 0.1, 0};
beta += PI;
int idx = max (0, min (15, (int)(beta*istep)));
double d = beta*istep - idx;
///*cl = 3.5*(CL[idx] + (CL[idx+1]-CL[idx])*d);
*cl = 18*(CL[idx] + (CL[idx+1]-CL[idx])*d);
*cm = 0;
*cd = 0.00001; //0.4*(0.11 + oapiGetInducedDrag (*cl, 0.16, 0.2));
}