6 // FIXME: need a "chord" member for calculating moments. Generic
7 // forces act at the center, but "pre-stall" lift acts towards the
8 // front, and flaps act (in both lift and drag) toward the back.
14 // Position of this surface in local coords
15 void setPosition(float* p);
16 void getPosition(float* out);
18 // Distance scale along the X axis
19 void setChord(float chord);
21 // Slats act to move the stall peak by the specified angle, and
22 // increase drag by the multiplier specified.
23 void setSlatParams(float stallDelta, float dragPenalty);
25 // Flaps add to lift coefficient, and multiply drag.
26 void setFlapParams(float liftAdd, float dragPenalty);
28 // Spoilers reduce the pre-stall lift, and multiply drag.
29 void setSpoilerParams(float liftPenalty, float dragPenalty);
31 // Positions for the controls, in the range [0:1]. [-1:1] for
32 // flaps, with positive meaning "force goes towards positive Z"
33 void setFlap(float pos);
34 void setSlat(float pos);
35 void setSpoiler(float pos);
37 // local -> Surface coords
38 void setOrientation(float* o);
40 // For variable-incidence control surfaces. The angle is a
41 // negative rotation about the surface's Y axis, in radians, so
42 // positive is "up" (i.e. "positive AoA")
43 void setIncidence(float angle);
45 // The offset from base incidence for this surface.
46 void setTwist(float angle);
48 void setTotalDrag(float c0);
51 void setXDrag(float cx);
52 void setYDrag(float cy);
53 void setZDrag(float cz);
55 // zero-alpha Z drag ("camber") specified as a fraction of cz
56 void setBaseZDrag(float cz0);
58 // i: 0 == forward, 1 == backwards
59 void setStallPeak(int i, float peak);
61 // i: 0 == fwd/+z, 1 == fwd/-z, 2 == rev/+z, 3 == rev/-z
62 void setStall(int i, float alpha);
63 void setStallWidth(int i, float width);
65 // Induced drag multiplier
66 void setInducedDrag(float mul) { _inducedDrag = mul; }
68 void calcForce(float* v, float rho, float* forceOut, float* torqueOut);
71 float stallFunc(float* v);
72 float flapLift(float alpha);
73 float controlDrag(float lift, float drag);
75 float _chord; // X-axis size
76 float _c0; // total force coefficient
77 float _cx; // X-axis force coefficient
78 float _cy; // Y-axis force coefficient
79 float _cz; // Z-axis force coefficient
80 float _cz0; // Z-axis force offset
81 float _peaks[2]; // Stall peak coefficients (fwd, back)
82 float _stalls[4]; // Stall angles (fwd/back, pos/neg)
83 float _widths[4]; // Stall widths " "
84 float _pos[3]; // position in local coords
85 float _orient[9]; // local->surface orthonormal matrix
102 }; // namespace yasim
103 #endif // _SURFACE_HPP