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.
((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
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);
_flapLift = 0;
_slatAlpha = 0;
_spoilerLift = 1;
+ _inducedDrag = 1;
}
void Surface::setPosition(float* p)
// Handle the blowup condition. Zero velocity means zero force by
// definition.
if(vel == 0) {
- int i;
+ int i;
for(i=0; i<3; i++) out[i] = torque[i] = 0;
return;
}
// 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);
// 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];
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:
float _flapPos;
float _spoilerPos;
float _incidence;
+ float _inducedDrag;
};
}; // namespace yasim
_stallPeak = 0;
_camber = 0;
_incidence = 0;
+ _inducedDrag = 1;
_dragScale = 1;
_liftRatio = 1;
_flap0Start = 0;
if(slat) _slatSurfs.add(s);
if(spoiler) _spoilerSurfs.add(s);
+ s->setInducedDrag(_inducedDrag);
+
return s;
}
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);
float _stallPeak;
float _camber;
float _incidence;
+ float _inducedDrag;
float _dragScale;
float _liftRatio;