Minor adjustments and fixing ranges

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5604 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ffcc9d87922cde9be2a16fdede962c6f18bbf6d7
Former-commit-id: 6b89d52c70870505df0233a149fda4383a10d321
This commit is contained in:
wdbee 2013-07-17 05:56:26 +00:00
parent d2b180b627
commit 025fd6b5d6
2 changed files with 42 additions and 42 deletions

View file

@ -2259,7 +2259,7 @@ tdble F(tWing* wing)
tdble CliftFromAoA(tWing* wing)
{
tdble angle = (tdble) (wing->angle * 180/PI);
fprintf(stderr,"wing->angle: %g rad = angle: %g deg\n",wing->angle,angle);
//fprintf(stderr,"wing->angle: %g rad = angle: %g deg\n",wing->angle,angle);
wing->Kz_org = 4.0f * wing->Kx;
@ -2268,15 +2268,15 @@ tdble CliftFromAoA(tWing* wing)
if (angle <= wing->AoAatMax)
{
wing->a = wing->f * (angle + wing->AoAOffset);
fprintf(stderr,"a: %g\n",wing->a);
//fprintf(stderr,"a: %g\n",wing->a);
s = sin(wing->a/180.0*PI);
fprintf(stderr,"s: %g\n",s);
//fprintf(stderr,"s: %g\n",s);
return (tdble)(s * s * (wing->CliftMax + wing->d) - wing->d);
}
else
{
wing->a = (angle - wing->AoAatMax - 90.0f);
fprintf(stderr,"a: %g F(a): %g\n",wing->a,F(wing));
//fprintf(stderr,"a: %g F(a): %g\n",wing->a,F(wing));
return (tdble)(wing->CliftMax - F(wing) * (wing->CliftMax - wing->CliftAsymp));
}
}
@ -2387,63 +2387,63 @@ void TDriver::InitCa()
{
wing->angle = RearWingAngle;
}
fprintf(stderr,"wing->angle: %g\n",wing->angle*180/PI);
//fprintf(stderr,"wing->angle: %g\n",wing->angle*180/PI);
fprintf(stderr,"index: %d\n",index);
fprintf(stderr,"WingType: %d\n",wing->WingType);
//fprintf(stderr,"index: %d\n",index);
//fprintf(stderr,"WingType: %d\n",wing->WingType);
/* [deg] Angle of Attack at the maximum of coefficient of lift */
wing->AoAatMax = GfParmGetNum(oCarHandle, WingSect[index], PRM_AOAATMAX, (char*) "deg", 90);
fprintf(stderr,"AoAatMax: %g\n",wing->AoAatMax);
//fprintf(stderr,"AoAatMax: %g\n",wing->AoAatMax);
/* [deg] Angle of Attack at coefficient of lift = 0 (-30 < AoAatZero < 0) */
wing->AoAatZero = GfParmGetNum(oCarHandle, WingSect[index], PRM_AOAATZERO, (char*) "deg", 0);
fprintf(stderr,"AoAatZero: %g\n",wing->AoAatZero);
//fprintf(stderr,"AoAatZero: %g\n",wing->AoAatZero);
wing->AoAatZRad = (tdble) (wing->AoAatZero/180*PI);
/* [deg] Offset for Angle of Attack */
wing->AoAOffset = GfParmGetNum(oCarHandle, WingSect[index], PRM_AOAOFFSET, (char*) "deg", 0);
fprintf(stderr,"AoAOffset: %g\n",wing->AoAOffset);
//fprintf(stderr,"AoAOffset: %g\n",wing->AoAOffset);
/* Maximum of coefficient of lift (0 < CliftMax < 4) */
wing->CliftMax = GfParmGetNum(oCarHandle, WingSect[index], PRM_CLMAX, (char*)NULL, 4);
fprintf(stderr,"CliftMax: %g\n",wing->CliftMax);
//fprintf(stderr,"CliftMax: %g\n",wing->CliftMax);
/* Coefficient of lift at Angle of Attack = 0 */
wing->CliftZero = GfParmGetNum(oCarHandle, WingSect[index], PRM_CLATZERO, (char*)NULL, 0);
fprintf(stderr,"CliftZero: %g\n",wing->CliftZero);
//fprintf(stderr,"CliftZero: %g\n",wing->CliftZero);
/* Asymptotic coefficient of lift at large Angle of Attack */
wing->CliftAsymp = GfParmGetNum(oCarHandle, WingSect[index], PRM_CLASYMP, (char*)NULL, wing->CliftMax);
fprintf(stderr,"CliftAsymp: %g\n",wing->CliftAsymp);
//fprintf(stderr,"CliftAsymp: %g\n",wing->CliftAsymp);
/* Delay of decreasing */
wing->b = GfParmGetNum(oCarHandle, WingSect[index], PRM_DELAYDECREASE, (char*)NULL, 20);
fprintf(stderr,"b: %g\n",wing->b);
//fprintf(stderr,"b: %g\n",wing->b);
/* Curvature of start of decreasing */
wing->c = GfParmGetNum(oCarHandle, WingSect[index], PRM_CURVEDECREASE, (char*)NULL, 2);
fprintf(stderr,"c: %g\n",wing->c);
//fprintf(stderr,"c: %g\n",wing->c);
/* Scale factor for angle */
wing->f = (tdble) (90.0 / (wing->AoAatMax + wing->AoAOffset));
fprintf(stderr,"f: %g\n",wing->f);
//fprintf(stderr,"f: %g\n",wing->f);
phi = wing->f * (wing->AoAOffset);
fprintf(stderr,"phi: %g deg\n",phi);
//fprintf(stderr,"phi: %g deg\n",phi);
phi *= PI / 180;
fprintf(stderr,"phi: %g rad\n",phi);
//fprintf(stderr,"phi: %g rad\n",phi);
sinphi = sin(phi);
fprintf(stderr,"sinphi: %g\n",sinphi);
//fprintf(stderr,"sinphi: %g\n",sinphi);
sinphi2 = sinphi * sinphi;
/* Scale at AoA = 0 */
wing->d = (tdble) (1.8f * (sinphi2 * wing->CliftMax - wing->CliftZero));
fprintf(stderr,"d: %g\n",wing->d);
//fprintf(stderr,"d: %g\n",wing->d);
if (index == 0)
{
CliftFrnt = CliftFromAoA(wing);
fprintf(stderr,"CliftFrnt: %g\n",CliftFrnt);
//fprintf(stderr,"CliftFrnt: %g\n",CliftFrnt);
FrontWingAreaCd = FrontWingArea * sin(FrontWingAngle - wing->AoAatZRad);
Param.Fix.oCaFrontWing = CliftFrnt * 1.23 * FrontWingAreaCd;
MeanCliftFromAoA = CliftFrnt;
@ -2451,7 +2451,7 @@ void TDriver::InitCa()
else
{
CliftRear = CliftFromAoA(wing);
fprintf(stderr,"CliftFrnt: %g\n",CliftRear);
//fprintf(stderr,"CliftFrnt: %g\n",CliftRear);
RearWingAreaCd = RearWingArea * sin(RearWingAngle - wing->AoAatZRad);
Param.Fix.oCaRearWing = CliftRear * 1.23 * RearWingAreaCd;
if (CliftFrnt > 0)

View file

@ -160,56 +160,56 @@ SimWingConfig(tCar *car, int index)
if (wing->WingType = 1)
{
fprintf(stderr,"index: %d\n",index);
fprintf(stderr,"WingType: %d\n",wing->WingType);
//fprintf(stderr,"index: %d\n",index);
//fprintf(stderr,"WingType: %d\n",wing->WingType);
/* [deg] Angle of Attack at the maximum of coefficient of lift */
wing->AoAatMax = GfParmGetNum(hdle, WingSect[index], PRM_AOAATMAX, (char*) "deg", 90);
fprintf(stderr,"AoAatMax: %g\n",wing->AoAatMax);
//fprintf(stderr,"AoAatMax: %g\n",wing->AoAatMax);
/* [deg] Angle of Attack at coefficient of lift = 0 (-30 < AoAatZero < 0) */
wing->AoAatZero = GfParmGetNum(hdle, WingSect[index], PRM_AOAATZERO, (char*) "deg", 0);
fprintf(stderr,"AoAatZero: %g\n",wing->AoAatZero);
//fprintf(stderr,"AoAatZero: %g\n",wing->AoAatZero);
wing->AoAatZRad = (tdble) (wing->AoAatZero/180*PI);
/* [deg] Offset for Angle of Attack */
wing->AoAOffset = GfParmGetNum(hdle, WingSect[index], PRM_AOAOFFSET, (char*) "deg", 0);
fprintf(stderr,"AoAOffset: %g\n",wing->AoAOffset);
//fprintf(stderr,"AoAOffset: %g\n",wing->AoAOffset);
/* Maximum of coefficient of lift (0 < CliftMax < 4) */
wing->CliftMax = GfParmGetNum(hdle, WingSect[index], PRM_CLMAX, (char*)NULL, 4);
fprintf(stderr,"CliftMax: %g\n",wing->CliftMax);
//fprintf(stderr,"CliftMax: %g\n",wing->CliftMax);
/* Coefficient of lift at Angle of Attack = 0 */
wing->CliftZero = GfParmGetNum(hdle, WingSect[index], PRM_CLATZERO, (char*)NULL, 0);
fprintf(stderr,"CliftZero: %g\n",wing->CliftZero);
//fprintf(stderr,"CliftZero: %g\n",wing->CliftZero);
/* Asymptotic coefficient of lift at large Angle of Attack */
wing->CliftAsymp = GfParmGetNum(hdle, WingSect[index], PRM_CLASYMP, (char*)NULL, wing->CliftMax);
fprintf(stderr,"CliftAsymp: %g\n",wing->CliftAsymp);
//fprintf(stderr,"CliftAsymp: %g\n",wing->CliftAsymp);
/* Delay of decreasing */
wing->b = GfParmGetNum(hdle, WingSect[index], PRM_DELAYDECREASE, (char*)NULL, 20);
fprintf(stderr,"b: %g\n",wing->b);
//fprintf(stderr,"b: %g\n",wing->b);
/* Curvature of start of decreasing */
wing->c = GfParmGetNum(hdle, WingSect[index], PRM_CURVEDECREASE, (char*)NULL, 2);
fprintf(stderr,"c: %g\n",wing->c);
//fprintf(stderr,"c: %g\n",wing->c);
/* Scale factor for angle */
wing->f = (tdble) (90.0 / (wing->AoAatMax + wing->AoAOffset));
fprintf(stderr,"f: %g\n",wing->f);
//fprintf(stderr,"f: %g\n",wing->f);
double phi = wing->f * (wing->AoAOffset);
fprintf(stderr,"phi: %g deg\n",phi);
//fprintf(stderr,"phi: %g deg\n",phi);
phi *= PI / 180;
fprintf(stderr,"phi: %g rad\n",phi);
//fprintf(stderr,"phi: %g rad\n",phi);
double sinphi = sin(phi);
fprintf(stderr,"sinphi: %g\n",sinphi);
//fprintf(stderr,"sinphi: %g\n",sinphi);
double sinphi2 = sinphi * sinphi;
/* Scale at AoA = 0 */
wing->d = (tdble) (1.8f * (sinphi2 * wing->CliftMax - wing->CliftZero));
fprintf(stderr,"d: %g\n",wing->d);
//fprintf(stderr,"d: %g\n",wing->d);
}
else if (wing->WingType = 2)
{
@ -224,24 +224,24 @@ SimWingConfig(tCar *car, int index)
if (index == 1)
{
car->aero.Cd = car->aero.CdBody - wing->Kx*sin(wing->angle);
fprintf(stderr,"Kz: %g Kx: %g\n",wing->Kz,wing->Kx);
fprintf(stderr,"car->aero.Cd: %g angle: %g\n",car->aero.Cd,wing->angle*180/PI);
//fprintf(stderr,"Kz: %g Kx: %g\n",wing->Kz,wing->Kx);
//fprintf(stderr,"car->aero.Cd: %g angle: %g\n",car->aero.Cd,wing->angle*180/PI);
}
}
else if (wing->WingType == 1)
{
wing->Kz = CliftFromAoA(wing) * wing->Kx;
fprintf(stderr,"Kz: %g Kx: %g\n",wing->Kz,wing->Kx);
//fprintf(stderr,"Kz: %g Kx: %g\n",wing->Kz,wing->Kx);
if (index == 0)
{
car->aero.Cd = (tdble)(car->aero.CdBody - wing->Kx*sin(wing->angle - wing->AoAatZRad));
fprintf(stderr,"car->aero.Cd: %g wing->Kx: %g angle: %g wing->AoAatZero: %g\n",car->aero.Cd,wing->Kx,wing->angle*180/PI,wing->AoAatZero);
//fprintf(stderr,"car->aero.Cd: %g wing->Kx: %g angle: %g wing->AoAatZero: %g\n",car->aero.Cd,wing->Kx,wing->angle*180/PI,wing->AoAatZero);
}
else
{
car->aero.Cd -= (tdble)(wing->Kx*sin(wing->angle - wing->AoAatZRad));
fprintf(stderr,"car->aero.Cd: %g wing->Kx: %g wing->angle: %g wing->AoAatZero: %g\n",car->aero.Cd,wing->Kx,wing->angle*180/PI,wing->AoAatZero);
//fprintf(stderr,"car->aero.Cd: %g wing->Kx: %g wing->angle: %g wing->AoAatZero: %g\n",car->aero.Cd,wing->Kx,wing->angle*180/PI,wing->AoAatZero);
}
}
else /* if (wing->WingType == 2) */