convexengineering / gplibrary

Useful subsystem models
MIT License
10 stars 11 forks source link

initial transfer of vertical tail model from gpjet #31

Closed pgkirsch closed 8 years ago

whoburg commented 8 years ago

might need to turn tolerance down:

In [1]: from aircraft.vtail import VerticalTail

In [2]: vt = VerticalTail()

In [3]: vt.test()
Beginning signomial solve.
Solving took 4 GP solves and 0.376 seconds.

Cost
----
 3770 [N]

Free Variables
--------------
       VerticalTail |
             A_{vt} : 1.255             Vertical tail aspect ratio
        C_{D_{vis}} : 0.005139          Viscous drag coefficient
         C_{L_{vt}} : 0.4316            Vertical tail lift coefficient
            D_{vis} : 1965       [N]    Vertical tail viscous drag, cruise
             D_{wm} : 3112       [N]    Engine out windmill drag
            L_{max} : 1.214e+06  [N]    Maximum load for structural sizing
             L_{vt} : 4.105e+04  [N]    Vertical tail lift in engine out
               Re_c : 3.816e+07         Vertical tail reynolds number, cruise
                  S : 73.51      [m**2] Vertical tail reference area (full span)
             S_{vt} : 36.75      [m**2] Vertical tail ref. area (half span)
         W_{struct} : 7220       [N]    Full span weight
             W_{vt} : 3610       [N]    Vertical tail weight
    \Delta x_{lead} : 12.48      [m]    Distance from CG to vertical tail leading edge
   \Delta x_{trail} : 21         [m]    Distance from CG to vertical tail trailing edge
            \bar{c} : 6.008      [m]    Vertical tail mean aero chord
            \lambda : 0.27              Vertical tail taper ratio
               \tau : 0.15              Vertical tail thickness/chord ratio
                  b : 13.58      [m]    Vertical tail full span
             b_{vt} : 6.791      [m]    Vertical tail half span
           c_{root} : 8.523      [m]    Vertical tail root chord
            c_{tip} : 2.301      [m]    Vertical tail tip chord
             l_{vt} : 15.55      [m]    Vertical tail moment arm
                  p : 1.54              Substituted variable = 1 + 2*taper
                  q : 1.27              Substituted variable = 1 + taper
        z_{\bar{c}} : 1.867      [m]    Vertical location of mean aerodynamic chord

VerticalTailWingBox |
                  A : 2.51              Aspect ratio
            I_{cap} : 1.614e-06         Non-dim spar cap area moment of inertia
            L_{max} : 1.214e+06  [N]    Maximum load for structural sizing
                M_r : 1.954e+05  [N]    Root moment per root chord
                  S : 73.51      [m**2] Reference area
            W_{cap} : 3986       [N]    Weight of spar caps
         W_{struct} : 7220       [N]    Structural weight
            W_{web} : 1170       [N]    Weight of shear web
            \lambda : 0.27              Vertical tail taper ratio
                \nu : 0.8327            Dummy variable = $(t^2 + t + 1)/(t+1)$
               \tau : 0.15              Thickness to chord ratio
                  b : 13.58      [m]    Span
                  p : 1.54              Substituted variable = 1 + 2*taper
                  q : 1.27              Substituted variable = 1 + taper
            t_{cap} : 0.0003408         Non-dim. spar cap thickness
            t_{web} : 0.0004447         Non-dim. shear web thickness

Constants
---------
       VerticalTail |
            A_{eng} : 2.405     [m**2]     Engine reference area
         C_{D_{wm}} : 0.5                  Windmill drag coefficient
       C_{L_{vmax}} : 2.6                  Max lift coefficient
           L_{fuse} : 39        [m]        Length of fuselage
                T_e : 1.29e+05  [N]        Thrust per engine at takeoff
                V_1 : 65        [m/s]      Minimum takeoff velocity
                V_c : 234       [m/s]      Cruise velocity
             V_{ne} : 144       [m/s]      Never exceed velocity
                \mu : 1.4e-05   [N*s/m**2] Dynamic viscosity (35,000ft)
             \rho_c : 0.38      [kg/m**3]  Air density (35,000ft)
          \rho_{TO} : 1.225     [kg/m**3]  Air density (SL))
 \tan(\Lambda_{LE}) : 0.8391               Tangent of leading edge sweep (40 deg)
         c_{l_{vt}} : 0.5                  Sectional lift force coefficient (engine out)
                  e : 0.8                  Span efficiency of vertical tail
                l_e : 4.83      [m]        Engine moment arm
             x_{CG} : 18        [m]        x-location of CG

VerticalTailWingBox |
           N_{lift} : 2                    Wing loading multiplier
         \rho_{cap} : 2700      [kg/m**3]  Density of spar cap material
         \rho_{web} : 2700      [kg/m**3]  Density of shear web material
 \sigma_{max,shear} : 1.67e+08  [Pa]       Allowable shear stress
       \sigma_{max} : 2.5e+08   [Pa]       Allowable tensile stress
          f_{w,add} : 0.4                  Wing added weight fraction
                  g : 9.81      [m/s**2]   Gravitational acceleration
                r_h : 0.75                 Fractional wing thickness at spar web
                  w : 0.5                  Wingbox-width-to-chord ratio

Sensitivities
-------------
  x_{CG} : 1  x-location of CG
L_{fuse} : -1 Length of fuselage

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-3-93b7815a9e8b> in <module>()
----> 1 vt.test()

/Users/whoburg/MIT/dev/modellib/aircraft/vtail.pyc in test(self)
    163         npt.assert_almost_equal((2./3)*(1 + sol('\\lambda')
    164                                 + sol('\\lambda')**2)*sol('c_{root}')/sol('q'),
--> 165                                 sol('\\bar{c}'))
    166
    167 #        with open('vtail.tex', 'w') as outfile:

/Users/whoburg/anaconda/envs/gpkit/lib/python2.7/site-packages/numpy/testing/utils.pyc in assert_almost_equal(actual, desired, decimal, err_msg, verbose)
    488         pass
    489     if round(abs(desired - actual), decimal) != 0 :
--> 490         raise AssertionError(_build_err_msg())
    491
    492

AssertionError:
Arrays are not almost equal to 7 decimals
 ACTUAL: 6.0080016070568361
 DESIRED: 6.008001194016515
pgkirsch commented 8 years ago

Loosened the tolerance to 5 decimal places

whoburg commented 8 years ago

Looking good. I'm going to merge this and further improvements can come in new issues / PR's.