1
0
Fork 0

Added a "twist" attribute for wings to allow for washout (or washin,

if desired) in the stall.  This allows for fairly docile stalls when
desired, as on trainers (you also need to limit the elevator lift).
This commit is contained in:
david 2003-02-18 16:50:07 +00:00
parent 0ecc199b09
commit 7228024ed5
5 changed files with 26 additions and 2 deletions

View file

@ -415,6 +415,7 @@ Wing* FGFDM::parseWing(XMLAttributes* a, const char* type)
w->setDihedral(attrf(a, "dihedral", defDihed) * DEG2RAD);
w->setCamber(attrf(a, "camber", 0));
w->setIncidence(attrf(a, "incidence", 0) * DEG2RAD);
w->setTwist(attrf(a, "twist", 0) * DEG2RAD);
// The 70% is a magic number that sorta kinda seems to match known
// throttle settings to approach speed.

View file

@ -20,6 +20,7 @@ Surface::Surface()
_chord = 0;
_incidence = 0;
_twist = 0;
_slatPos = _spoilerPos = _flapPos = 0;
_slatDrag = _spoilerDrag = _flapDrag = 1;
@ -103,6 +104,11 @@ void Surface::setIncidence(float angle)
_incidence = angle;
}
void Surface::setTwist(float angle)
{
_twist = angle;
}
void Surface::setSlatParams(float stallDelta, float dragPenalty)
{
_slatAlpha = stallDelta;
@ -160,7 +166,8 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
// "Rotate" by the incidence angle. Assume small angles, so we
// need to diddle only the Z component, X is relatively unchanged
// by small rotations.
out[2] += _incidence * out[0]; // z' = z + incidence * x
float incidence = _incidence + _twist;
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.
@ -201,7 +208,7 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
// Reverse the incidence rotation to get back to surface
// coordinates.
out[2] -= _incidence * out[0];
out[2] -= incidence * out[0];
// Convert back to external coordinates
Math::tmul33(_orient, out, out);

View file

@ -42,6 +42,9 @@ public:
// positive is "up" (i.e. "positive AoA")
void setIncidence(float angle);
// The offset from base incidence for this surface.
void setTwist(float angle);
void setTotalDrag(float c0);
float getTotalDrag();
@ -92,6 +95,7 @@ private:
float _flapPos;
float _spoilerPos;
float _incidence;
float _twist;
float _inducedDrag;
};

View file

@ -15,6 +15,7 @@ Wing::Wing()
_stall = 0;
_stallWidth = 0;
_stallPeak = 0;
_twist = 0;
_camber = 0;
_incidence = 0;
_inducedDrag = 1;
@ -114,6 +115,11 @@ void Wing::setStallPeak(float fraction)
_stallPeak = fraction;
}
void Wing::setTwist(float angle)
{
_twist = angle;
}
void Wing::setCamber(float camber)
{
_camber = camber;
@ -324,6 +330,8 @@ void Wing::compile()
// and flap1 are set. Right now flap1 overrides.
int nSegs = (int)Math::ceil((end-start)/segLen);
if (_twist != 0 && nSegs < 16) // more segments if twisted
nSegs = 16;
float segWid = _length * (end - start)/nSegs;
int j;
@ -341,6 +349,7 @@ void Wing::compile()
sr->surface = s;
sr->weight = chord * segWid;
s->setTotalDrag(sr->weight);
s->setTwist(_twist * Math::sqrt(1-frac));
_surfs.add(sr);
if(_mirror) {
@ -351,6 +360,7 @@ void Wing::compile()
sr->surface = s;
sr->weight = chord * segWid;
s->setTotalDrag(sr->weight);
s->setTwist(_twist * Math::sqrt(frac));
_surfs.add(sr);
}
}

View file

@ -27,6 +27,7 @@ public:
void setStall(float aoa);
void setStallWidth(float angle);
void setStallPeak(float fraction);
void setTwist(float angle);
void setCamber(float camber);
void setIncidence(float incidence);
void setInducedDrag(float drag) { _inducedDrag = drag; }
@ -92,6 +93,7 @@ private:
float _stall;
float _stallWidth;
float _stallPeak;
float _twist;
float _camber;
float _incidence;
float _inducedDrag;