]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for issue 1463 (YASim underestimates off-axis aerodynamic forces on fuselages)
authorColin Douglas Howell <colin.d.howell@gmail.com>
Tue, 13 May 2014 02:07:10 +0000 (19:07 -0700)
committerColin Douglas Howell <colin.d.howell@gmail.com>
Tue, 13 May 2014 02:07:10 +0000 (19:07 -0700)
Change the drag coefficient for fuselages along the Y and Z axes
(i.e. perpendicular to the fuselage's main axis) to use a fixed
value of 0.5. (The value can still be adjusted using the fuselage's
"cy" and "cz" XML attributes.)

For the Y-axis and Z-axis drag on fuselages, YASim originally used
a drag coefficient equal to:

(solver drag factor) * (fuselage length/width ratio)

This value turns out to be way too small for well-streamlined
aircraft, even those with long, narrow fuselages, and especially
so for those with short, stubby fuselages. Such fuselages are
streamlined in the X direction, but not along Y or Z.

0.5 is only a ballpark estimate, but it's reasonably close for the
common case of a fairly long fuselage with a round cross section. For
flat-sided fuselages, a larger value should be used, up to a maximum
of 2 for a slab-sided block. For short fuselages, the value should be
reduced to account for end effects. The fuselage's "cy" and "cz" XML
attributes can be modified to make such adjustments.

This fix won't affect straight flight much, but it should have a strong
impact on some maneuvers. For example, it will make slips more
effective and may make knife-edge flight easier on aerobatic aircraft
which should be capable of it.

Only aircraft which specify version="YASIM_VERSION_32" or newer are
affected.

src/FDM/YASim/Airplane.cpp
src/FDM/YASim/Surface.cpp
src/FDM/YASim/Surface.hpp

index 3371fa7dc6c214438636cb3d51427b881928a5ec..2665eb1f917ade8b5489c1bd738493e6249b1d3c 100644 (file)
@@ -553,7 +553,31 @@ float Airplane::compileFuselage(Fuselage* f)
         // Make a Surface too
         Surface* s = new Surface(this);
         s->setPosition(pos);
+
+       // The following is the original YASim value for sideDrag.
+       // Originally YASim calculated the fuselage's lateral drag
+       // coefficient as (solver drag factor) * (len/wid).
+       // However, this greatly underestimates a fuselage's lateral drag.
        float sideDrag = len/wid;
+
+       if ( isVersionOrNewer( YASIM_VERSION_32 ) ) {
+           // New YASim assumes a fixed lateral drag coefficient of 0.5.
+           // This will not be multiplied by the solver drag factor, because
+           // that factor is tuned to match the drag in the direction of
+           // flight, which is completely independent of lateral drag.
+           // The value of 0.5 is only a ballpark estimate, roughly matching
+           // the side-on drag for a long cylinder at the higher Reynolds
+           // numbers typical for an aircraft's lateral drag.
+           // This fits if the fuselage is long and has a round cross section.
+           // For flat-sided fuselages, the value should be increased, up to
+           // a limit of around 2 for a long rectangular prism.
+           // For very short fuselages, in which the end effects are strong,
+           // the value should be reduced.
+           // Such adjustments can be made using the fuselage's "cy" and "cz"
+           // XML parameters: "cy" for the sides, "cz" for top and bottom.
+           sideDrag = 0.5;
+       }
+
        if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
                s->setXDrag(f->_cx);
        }
@@ -920,7 +944,21 @@ void Airplane::applyDragFactor(float factor)
        int j;
        for(j=0; j<f->surfs.size(); j++) {
            Surface* s = (Surface*)f->surfs.get(j);
-           s->setTotalDrag(s->getTotalDrag() * applied);
+           if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
+               // For new YASim, the solver drag factor is only applied to
+               // the X axis for Fuselage Surfaces.
+               // The solver is tuning the coefficient for longitudinal drag,
+               // along the direction of flight. A fuselage's lateral drag
+               // is completely independent and is normally much higher;
+               // it won't be affected by the streamlining done to reduce
+               // longitudinal drag. So the solver should only adjust the
+               // fuselage's longitudinal (X axis) drag coefficient.
+               s->setXDrag(s->getXDrag() * applied);
+           } else {
+               // Originally YASim applied the drag factor to all axes
+               // for Fuselage Surfaces.
+               s->setTotalDrag(s->getTotalDrag() * applied);
+           }
        }
     }
     for(i=0; i<_weights.size(); i++) {
index df5fcf24719b24b87bdbadd33810c62240f523cc..88e4a07a8b3244e6985a6933ea4d2c45b9f15bdd 100644 (file)
@@ -74,6 +74,11 @@ void Surface::setZDrag(float cz)
     _cz = cz;
 }
 
+float Surface::getXDrag()
+{
+    return _cx;
+}
+
 void Surface::setBaseZDrag(float cz0)
 {
     _cz0 = cz0;
index 4f128f3742b2ddb744a9927a53b0e295c5cb4771..3679ab4ce5b3b7aac8c50fa812c13b0bb309673a 100644 (file)
@@ -57,6 +57,7 @@ public:
     void setXDrag(float cx);
     void setYDrag(float cy);
     void setZDrag(float cz);
+    float getXDrag();
 
     // zero-alpha Z drag ("camber") specified as a fraction of cz
     void setBaseZDrag(float cz0);