1
0
Fork 0

Added a tunable "induced drag" number to aircraft. One of the things that

isn't well-constrained by the solution process is the drag-vs-aoa curve.
The default value that YASim picked was very steep, and resulted in most
of the jets flying their approaches *way* behind the power curve.  This
changes the default to be more forgiving, and adds an "idrag" tunable
to the configuration file for tweakers.

Also, change the default gear springiness to be less stiff.
This commit is contained in:
andy 2002-11-30 02:24:16 +00:00
parent 95109cec57
commit fe4e83a10b
6 changed files with 27 additions and 3 deletions

View file

@ -618,9 +618,9 @@ void Airplane::solveGear()
((GearRec*)_gears.get(i))->wgt /= total;
// The force at max compression should be sufficient to stop a
// plane moving downwards at 3x the approach descent rate. Assume
// plane moving downwards at 2x the approach descent rate. Assume
// a 3 degree approach.
float descentRate = 3.0f*_approachSpeed/19.1f;
float descentRate = 2.0f*_approachSpeed/19.1f;
// Spread the kinetic energy according to the gear weights. This
// will results in an equal compression fraction (not distance) of

View file

@ -401,6 +401,10 @@ Wing* FGFDM::parseWing(XMLAttributes* a, const char* type)
w->setCamber(attrf(a, "camber", 0));
w->setIncidence(attrf(a, "incidence", 0) * DEG2RAD);
// The 70% is a magic number that sorta kinda seems to match known
// throttle settings to approach speed.
w->setInducedDrag(0.7*attrf(a, "idrag", 1));
float effect = attrf(a, "effectiveness", 1);
w->setDragScale(w->getDragScale()*effect);

View file

@ -26,6 +26,7 @@ Surface::Surface()
_flapLift = 0;
_slatAlpha = 0;
_spoilerLift = 1;
_inducedDrag = 1;
}
void Surface::setPosition(float* p)
@ -161,6 +162,11 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
// by small rotations.
out[2] += _incidence * out[0]; // z' = z + incidence * x
// Hold onto the local wind vector so we can multiply the induced
// drag at the end.
float lwind[3];
Math::set3(out, lwind);
// Diddle the Z force according to our configuration
float stallMul = stallFunc(out);
stallMul *= 1 + _spoilerPos * (_spoilerLift - 1);
@ -188,6 +194,11 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
// Add in any specific Y (side force) coefficient.
out[1] *= _cy;
// Diddle the induced drag
float IDMUL = 0.5;
Math::mul3(-1*_inducedDrag*out[2]*lwind[2], lwind, lwind);
Math::add3(lwind, out, out);
// Reverse the incidence rotation to get back to surface
// coordinates.
out[2] -= _incidence * out[0];

View file

@ -59,6 +59,9 @@ public:
void setStall(int i, float alpha);
void setStallWidth(int i, float width);
// Induced drag multiplier
void setInducedDrag(float mul) { _inducedDrag = mul; }
void calcForce(float* v, float rho, float* forceOut, float* torqueOut);
private:
@ -89,6 +92,7 @@ private:
float _flapPos;
float _spoilerPos;
float _incidence;
float _inducedDrag;
};
}; // namespace yasim

View file

@ -17,6 +17,7 @@ Wing::Wing()
_stallPeak = 0;
_camber = 0;
_incidence = 0;
_inducedDrag = 1;
_dragScale = 1;
_liftRatio = 1;
_flap0Start = 0;
@ -435,6 +436,8 @@ Surface* Wing::newSurface(float* pos, float* orient, float chord,
if(slat) _slatSurfs.add(s);
if(spoiler) _spoilerSurfs.add(s);
s->setInducedDrag(_inducedDrag);
return s;
}

View file

@ -29,6 +29,7 @@ public:
void setStallPeak(float fraction);
void setCamber(float camber);
void setIncidence(float incidence);
void setInducedDrag(float drag) { _inducedDrag = drag; }
void setFlap0(float start, float end, float lift, float drag);
void setFlap1(float start, float end, float lift, float drag);
@ -93,6 +94,7 @@ private:
float _stallPeak;
float _camber;
float _incidence;
float _inducedDrag;
float _dragScale;
float _liftRatio;