Ejemplo n.º 1
0
def taw_cnbeta(geometry, conditions, configuration):
    """ CnBeta = SUAVE.Methods.Flight_Dynamics.Static_Stability.Approximations.Tube_Wing.taw_cnbeta(configuration,conditions)
        This method computes the static directional stability derivative for a
        standard Tube-and-Wing aircraft configuration.        
        
        CAUTION: The correlations used in this method do not account for the
        destabilizing moments due to propellers. This can lead to higher-than-
        expected values of CnBeta, particularly for smaller prop-driven aircraft
        
        Inputs:
            geometry - aircraft geometrical features: a data dictionary with the fields:
                wings['Main Wing'] - the aircraft's main wing
                    areas.reference - wing reference area [meters**2]
                    spans.projected - span of the wing [meters]
                    sweep - sweep of the wing leading edge [radians]
                    aspect_ratio - wing aspect ratio [dimensionless]
                    origin - the position of the wing root in the aircraft body frame [meters]
                wings['Vertical Stabilizer']
                    spans.projected - projected span (height for a vertical tail) of
                     the exposed surface [meters]
                    areas.reference - area of the reference vertical tail [meters**2]
                    sweep - leading edge sweep of the aerodynamic surface [radians]
                    chords.root - chord length at the junction between the tail and 
                     the fuselage [meters]
                    chords.tip - chord length at the tip of the aerodynamic surface
                    [meters]
                    symmetric - Is the wing symmetric across the fuselage centerline?
                    origin - the position of the vertical tail root in the aircraft body frame [meters]
                    exposed_root_chord_offset - the displacement from the fuselage
                     centerline to the exposed area's physical root chordline [meters]
    
                fuselages.Fuselage - a data dictionary with the fields:
                    areas.side_projected - fuselage body side area [meters**2]
                    lengths.total - length of the fuselage [meters]
                    heights.maximum - maximum height of the fuselage [meters]
                    width - maximum width of the fuselage [meters]
                    heights.at_quarter_length - fuselage height at 1/4 of the fuselage length [meters]
                    heights.at_three_quarters_length - fuselage height at 3/4 of fuselage 
                     length [meters]
                    heights.at_vertical_root_quarter_chord - fuselage height at the quarter 
                     chord of the vertical tail root [meters]
                vertical - a data dictionary with the fields below:
                NOTE: This vertical tail geometry will be used to define a reference
                 vertical tail that extends to the fuselage centerline.
                    
                    x_ac_LE - the x-coordinate of the vertical tail aerodynamic 
                    center measured relative to the tail root leading edge (root
                    of reference tail area - at fuselage centerline)
                    leading edge, relative to the nose [meters]
                    sweep_le - leading edge sweep of the vertical tail [radians]
                    span - height of the vertical tail [meters]
                    taper - vertical tail taper ratio [dimensionless]
                    aspect_ratio - vertical tail AR: bv/(Sv)^2 [dimensionless]
                    effective_aspect_ratio - effective aspect ratio considering
                    the effects of fuselage and horizontal tail [dimensionless]
                    symmetric - indicates whether the vertical panel is symmetric
                    about the fuselage centerline [Boolean]
                other_bodies - an list of data dictionaries containing bodies 
                such as nacelles if these are large enough to strongly influence
                stability. Each body data dictionary contains the same fields as
                the fuselage data dictionary (described above), except no value 
                is needed for 'height_at_vroot_quarter_chord'. CAN BE EMPTY LIST
                    x_front - This is the only new field needed: the x-coordinate 
                    of the nose of the body relative to the fuselage nose
                    
            conditions - a data dictionary with the fields:
                v_inf - true airspeed [meters/second]
                M - flight Mach number
                rho - air density [kg/meters**3]
                mew - air dynamic dynamic_viscosity [kg/meter/second]
                
            configuration - a data dictionary with the fields:
                mass_properties - a data dictionary with the field:
                    center_of_gravity - A vector in 3-space indicating CG position [meters]
                other - a dictionary of aerodynamic bodies, other than the fuselage,
                whose effect on directional stability is to be included in the analysis
    
        Outputs:
            CnBeta - a single float value: The static directional stability 
            derivative
                
        Assumptions:
            -Assumes a tube-and-wing configuration with a single centered 
            vertical tail
            -Uses vertical tail effective aspect ratio, currently calculated by
            hand, using methods from USAF Stability and Control DATCOM
            -The validity of correlations for KN is questionable for sqrt(h1/h2)
            greater than about 4 or h_max/w_max outside [0.3,2].
            -This method assumes a small angle of attack, so the vertical tail AC
            z-position does not affect the sideslip derivative.
        
        Correlations:
            -Correlations are taken from Roskam's Airplane Design, Part VI.
    """

    try:
        configuration.other
    except AttributeError:
        configuration.other = 0
    CnBeta_other = []

    # Unpack inputs
    S = geometry.wings['main_wing'].areas.reference
    b = geometry.wings['main_wing'].spans.projected
    sweep = geometry.wings['main_wing'].sweeps.quarter_chord
    AR = geometry.wings['main_wing'].aspect_ratio
    z_w = geometry.wings['main_wing'].origin[2]
    S_bs = geometry.fuselages['fuselage'].areas.side_projected
    l_f = geometry.fuselages['fuselage'].lengths.total
    h_max = geometry.fuselages['fuselage'].heights.maximum
    w_max = geometry.fuselages['fuselage'].width
    h1 = geometry.fuselages['fuselage'].heights.at_quarter_length
    h2 = geometry.fuselages['fuselage'].heights.at_three_quarters_length
    d_i = geometry.fuselages['fuselage'].heights.at_wing_root_quarter_chord
    other = configuration.other
    vert = extend_to_ref_area(geometry.wings['vertical_stabilizer'])
    S_v = vert.extended.areas.reference
    x_v = vert.extended.origin[0]
    b_v = vert.extended.spans.projected
    ac_vLE = vert.aerodynamic_center[0]
    x_cg = configuration.mass_properties.center_of_gravity[0]
    v_inf = conditions.freestream.velocity
    mu = conditions.freestream.dynamic_viscosity
    rho = conditions.freestream.density
    M = conditions.freestream.mach_number

    #Compute wing contribution to Cn_beta
    CnBeta_w = 0.0  #The wing contribution is assumed to be zero except at very
    #high angles of attack.

    #Compute fuselage contribution to Cn_beta
    Re_fuse = rho * v_inf * l_f / mu
    x1 = x_cg / l_f
    x2 = l_f * l_f / S_bs
    x3 = np.sqrt(h1 / h2)
    x4 = h_max / w_max
    kN_1 = 3.2413 * x1 - 0.663345 + 6.1086 * np.exp(-0.22 * x2)
    kN_2 = (-0.2023 + 1.3422 * x3 - 0.1454 * x3 * x3) * kN_1
    kN_3 = (0.7870 + 0.1038 * x4 + 0.1834 * x4 * x4 -
            2.811 * np.exp(-4.0 * x4))
    K_N = (-0.47899 + kN_3 * kN_2) * 0.001
    K_Rel = 1.0 + 0.8 * np.log(Re_fuse / 1.0E6) / np.log(50.)
    #K_Rel: Correction for fuselage Reynolds number. Roskam VI, page 400.
    CnBeta_f = -57.3 * K_N * K_Rel * S_bs * l_f / S / b

    #Compute contributions of other bodies on CnBeta
    if other > 0:
        for body in other:
            #Unpack inputs
            S_bs = body.areas.side_projected
            x_le = body.origin[0]
            l_b = body.lengths.total
            h_max = body.heights.maximum
            w_max = body.width
            h1 = body.heights.at_quarter_length
            h2 = body.heights.at_three_quarters_length
            #Compute body contribution to Cn_beta
            x_cg_on_body = (x_cg - x_le) / l_b
            Re_body = rho * v_inf * l_b / mew
            x1 = x_cg_on_body / l_b
            x2 = l_b * l_b / S_bs
            x3 = np.sqrt(h1 / h2)
            x4 = h_max / w_max
            kN_1 = 3.2413 * x1 - 0.663345 + 6.1086 * np.exp(-0.22 * x2)
            kN_2 = (-0.2023 + 1.3422 * x3 - 0.1454 * x3 * x3) * kN_1
            kN_3 = (0.7870 + 0.1038 * x4 + 0.1834 * x4 * x4 -
                    2.811 * np.exp(-4.0 * x4))
            K_N = (-0.47899 + kN_3 * kN_2) * 0.001
            #K_Rel: Correction for fuselage Reynolds number. Roskam VI, page 400.
            K_Rel = 1.0 + 0.8 * np.log(Re_body / 1.0E6) / np.log(50.)
            CnBeta_b = -57.3 * K_N * K_Rel * S_bs * l_b / S / b
            CnBeta_other.append(CnBeta_b)

    #Compute vertical tail contribution
    l_v = x_v + ac_vLE - x_cg

    try:
        iter(M)
    except TypeError:
        M = [M]
    CLa_v = datcom(vert, M)

    #k_v correlated from Roskam Fig. 10.12. NOT SMOOTH.
    bf = b_v / d_i
    if bf < 2.0:
        k_v = 0.76
    elif bf < 3.5:
        k_v = 0.76 + 0.24 * (bf - 2.0) / 1.5
    else:
        k_v = 1.0

    quarter_chord_sweep = convert_sweep(geometry.wings['main_wing'])

    k_sweep = (1.0 + np.cos(quarter_chord_sweep))
    dsdb_e = 0.724 + 3.06 * (
        (S_v / S) / k_sweep) + 0.4 * z_w / h_max + 0.009 * AR
    Cy_bv = -k_v * CLa_v * dsdb_e * (S_v / S)  #ASSUMING SINGLE VERTICAL TAIL

    CnBeta_v = -Cy_bv * l_v / b

    CnBeta = CnBeta_w + CnBeta_f + CnBeta_v + sum(CnBeta_other)

    return CnBeta
Ejemplo n.º 2
0
def vehicle_setup():

    vehicle = SUAVE.Vehicle()

    #print vehicle
    vehicle.mass_properties.max_zero_fuel = 238780 * Units.kg
    vehicle.mass_properties.max_takeoff = 785000. * Units.lbs

    # ------------------------------------------------------------------
    #   Main Wing
    # ------------------------------------------------------------------

    wing = SUAVE.Components.Wings.Main_Wing()
    wing.tag = 'main_wing'
    wing.areas.reference = 5500.0 * Units.feet**2
    wing.spans.projected = 196.0 * Units.feet
    wing.chords.mean_aerodynamic = 27.3 * Units.feet
    wing.chords.root = 42.9 * Units.feet  #54.5ft
    wing.chords.tip = 14.7 * Units.feet
    wing.sweeps.quarter_chord = 42.0 * Units.deg  # Leading edge
    wing.sweeps.leading_edge = 42.0 * Units.deg  # Same as the quarter chord sweep (ignore why EMB)
    wing.taper = wing.chords.tip / wing.chords.root

    wing.aspect_ratio = wing.spans.projected**2 / wing.areas.reference
    wing.symmetric = True
    wing.vertical = False
    wing.origin = np.array([58.6, 0, 3.6]) * Units.feet
    wing.aerodynamic_center = np.array([
        112.2 * Units.feet, 0., 0.
    ]) - wing.origin  #16.16 * Units.meters,0.,0,])
    wing.dynamic_pressure_ratio = 1.0
    wing.ep_alpha = 0.0

    span_location_mac = compute_span_location_from_chord_length(
        wing, wing.chords.mean_aerodynamic)
    mac_le_offset = .8 * np.sin(
        wing.sweeps.leading_edge
    ) * span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[
        0] = .3 * wing.chords.mean_aerodynamic + mac_le_offset

    Mach = np.array([0.198])
    conditions = Data()
    conditions.weights = Data()
    conditions.lift_curve_slope = datcom(wing, Mach)
    conditions.weights.total_mass = np.array(
        [[vehicle.mass_properties.max_takeoff]])

    wing.CL_alpha = conditions.lift_curve_slope
    vehicle.reference_area = wing.areas.reference
    vehicle.append_component(wing)

    main_wing_CLa = wing.CL_alpha
    main_wing_ar = wing.aspect_ratio

    # ------------------------------------------------------------------
    #  Horizontal Stabilizer
    # ------------------------------------------------------------------

    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'horizontal_stabilizer'
    wing.areas.reference = 1490.55 * Units.feet**2
    wing.spans.projected = 71.6 * Units.feet
    wing.sweeps.quarter_chord = 44.0 * Units.deg  # leading edge
    wing.sweeps.leading_edge = 44.0 * Units.deg  # Same as the quarter chord sweep (ignore why EMB)
    wing.taper = 7.5 / 32.6
    wing.aspect_ratio = wing.spans.projected**2 / wing.areas.reference
    wing.origin = np.array([187.0, 0, 0]) * Units.feet
    wing.symmetric = True
    wing.vertical = False
    wing.dynamic_pressure_ratio = 0.95
    wing.ep_alpha = 2.0 * main_wing_CLa / np.pi / main_wing_ar
    wing.aerodynamic_center = [trapezoid_ac_x(wing), 0.0, 0.0]
    wing.CL_alpha = datcom(wing, Mach)
    vehicle.append_component(wing)

    # ------------------------------------------------------------------
    #   Vertical Stabilizer
    # ------------------------------------------------------------------

    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'vertical_stabilizer'
    wing.spans.exposed = 32.4 * Units.feet
    wing.chords.root = 38.7 * Units.feet  # vertical.chords.fuselage_intersect
    wing.chords.tip = 13.4 * Units.feet
    wing.sweeps.quarter_chord = 50.0 * Units.deg  # Leading Edge
    wing.x_root_LE1 = 180.0 * Units.feet
    wing.symmetric = False
    wing.exposed_root_chord_offset = 13.3 * Units.feet
    wing = extend_to_ref_area(wing)

    wing.areas.reference = wing.extended.areas.reference
    wing.spans.projected = wing.extended.spans.projected
    wing.chords.root = 14.9612585185
    dx_LE_vert = wing.extended.root_LE_change
    wing.taper = 0.272993077083
    wing.origin = np.array([wing.x_root_LE1 + dx_LE_vert, 0., 0.])
    wing.aspect_ratio = (wing.spans.projected**2) / wing.areas.reference
    wing.effective_aspect_ratio = 2.2
    wing.symmetric = False
    wing.aerodynamic_center = np.array([trapezoid_ac_x(wing), 0.0, 0.0])
    wing.dynamic_pressure_ratio = .95
    Mach = np.array([0.198])
    wing.CL_alpha = 0.
    wing.ep_alpha = 0.
    vehicle.append_component(wing)

    # ------------------------------------------------------------------
    #  Fuselage
    # ------------------------------------------------------------------

    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'

    fuselage.lengths.total = 229.7 * Units.feet
    fuselage.areas.side_projected = 4696.16 * Units.feet**2  #used for cnbeta
    fuselage.heights.maximum = 26.9 * Units.feet  #used for cnbeta
    fuselage.heights.at_quarter_length = 26.0 * Units.feet  #used for cnbeta
    fuselage.heights.at_three_quarters_length = 19.7 * Units.feet  #used for cnbeta
    fuselage.heights.at_wing_root_quarter_chord = 23.8 * Units.feet  #used for cnbeta

    fuselage.x_root_quarter_chord = 77.0 * Units.feet  #used for cmalpha
    fuselage.lengths.total = 229.7 * Units.feet
    fuselage.width = 20.9 * Units.feet

    vehicle.append_component(fuselage)
    vehicle.mass_properties.center_of_gravity = np.array([112.2, 0, 0
                                                          ]) * Units.feet

    #configuration.mass_properties.zero_fuel_center_of_gravity=np.array([76.5,0,0])*Units.feet #just put a number here that got the expected value output; may want to change
    fuel = SUAVE.Components.Physical_Component()
    fuel.origin = wing.origin
    fuel.mass_properties.center_of_gravity = wing.mass_properties.center_of_gravity
    fuel.mass_properties.mass = vehicle.mass_properties.max_takeoff - vehicle.mass_properties.max_zero_fuel

    #find zero_fuel_center_of_gravity
    cg = vehicle.mass_properties.center_of_gravity
    MTOW = vehicle.mass_properties.max_takeoff
    fuel_cg = fuel.origin + fuel.mass_properties.center_of_gravity
    fuel_mass = fuel.mass_properties.mass

    sum_moments_less_fuel = (cg * MTOW - fuel_cg * fuel_mass)
    vehicle.fuel = fuel
    vehicle.mass_properties.zero_fuel_center_of_gravity = sum_moments_less_fuel / vehicle.mass_properties.max_zero_fuel
    return vehicle
Ejemplo n.º 3
0
def vehicle_setup():

    vehicle = SUAVE.Vehicle()

    #print vehicle
    vehicle.mass_properties.max_zero_fuel   = 238780*Units.kg
    vehicle.mass_properties.max_takeoff     = 833000.*Units.lbs

    vehicle.design_mach_number              = 0.92
    vehicle.design_range                    = 6560 * Units.miles
    vehicle.design_cruise_alt               = 35000.0 * Units.ft
    vehicle.envelope.limit_load             = 2.5
    vehicle.envelope.ultimate_load          = 3.75

    vehicle.systems.control                 = "fully powered"
    vehicle.systems.accessories             = "longe range"

    # ------------------------------------------------------------------
    #   Main Wing
    # ------------------------------------------------------------------
    wing = SUAVE.Components.Wings.Main_Wing()
    wing.tag                                  = 'main_wing'
    wing.areas.reference                      = 5500.0 * Units.feet**2
    wing.spans.projected                      = 196.0  * Units.feet
    wing.chords.mean_aerodynamic              = 27.3   * Units.feet
    wing.chords.root                          = 42.9   * Units.feet  #54.5ft
    wing.chords.tip                           = 14.7   * Units.feet
    wing.sweeps.quarter_chord                 = 42.0   * Units.deg  # Leading edge
    wing.sweeps.leading_edge                  = 42.0   * Units.deg  # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                                = wing.chords.tip / wing.chords.root
    wing.aspect_ratio                         = wing.spans.projected**2/wing.areas.reference
    wing.symmetric                            = True
    wing.vertical                             = False
    wing.origin                               = [[58.6* Units.feet ,0,3.6* Units.feet ]]
    wing.aerodynamic_center                   = np.array([112.2*Units.feet,0.,0.])-wing.origin[0]#16.16 * Units.meters,0.,0,])
    wing.dynamic_pressure_ratio               = 1.0
    wing.ep_alpha                             = 0.0
    span_location_mac                         = compute_span_location_from_chord_length(wing, wing.chords.mean_aerodynamic)
    mac_le_offset                             = .8*np.sin(wing.sweeps.leading_edge)*span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[0] = .3*wing.chords.mean_aerodynamic+mac_le_offset
    wing.thickness_to_chord                   = 0.14


    Mach                                  = np.array([0.198])
    conditions                            = Data()
    conditions.weights                    = Data()
    conditions.lift_curve_slope           = datcom(wing,Mach)
    conditions.weights.total_mass         = np.array([[vehicle.mass_properties.max_takeoff]])
    wing.CL_alpha                         = conditions.lift_curve_slope
    vehicle.reference_area                = wing.areas.reference

    # control surfaces -------------------------------------------
    flap                       = SUAVE.Components.Wings.Control_Surfaces.Flap()
    flap.tag                   = 'flap'
    flap.span_fraction_start   = 0.15
    flap.span_fraction_end     = 0.324
    flap.deflection            = 1.0 * Units.deg
    flap.chord_fraction        = 0.19
    wing.append_control_surface(flap)

    slat                       = SUAVE.Components.Wings.Control_Surfaces.Slat()
    slat.tag                   = 'slat'
    slat.span_fraction_start   = 0.324
    slat.span_fraction_end     = 0.963
    slat.deflection            = 1.0 * Units.deg
    slat.chord_fraction        = 0.1
    wing.append_control_surface(slat)

    vehicle.append_component(wing)

    main_wing_CLa = wing.CL_alpha
    main_wing_ar  = wing.aspect_ratio

    # ------------------------------------------------------------------
    #  Horizontal Stabilizer
    # ------------------------------------------------------------------
    wing                        = SUAVE.Components.Wings.Horizontal_Tail()
    wing.tag                    = 'horizontal_stabilizer'
    wing.areas.reference        = 1490.55* Units.feet**2
    wing.areas.wetted           = 1490.55 * Units.feet ** 2
    wing.areas.exposed          = 1490.55 * Units.feet ** 2
    wing.spans.projected        = 71.6   * Units.feet
    wing.sweeps.quarter_chord   = 44.0   * Units.deg # leading edge
    wing.sweeps.leading_edge    = 44.0   * Units.deg # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                  = 7.5/32.6
    wing.aspect_ratio           = wing.spans.projected**2/wing.areas.reference
    wing.origin                 = [[187.0* Units.feet,0,0]]
    wing.symmetric              = True
    wing.vertical               = False
    wing.dynamic_pressure_ratio = 0.95
    wing.ep_alpha               = 2.0*main_wing_CLa/np.pi/main_wing_ar
    wing.aerodynamic_center     = [trapezoid_ac_x(wing), 0.0, 0.0]
    wing.CL_alpha               = datcom(wing,Mach)
    wing.thickness_to_chord     = 0.1
    vehicle.append_component(wing)

    # ------------------------------------------------------------------
    #   Vertical Stabilizer
    # ------------------------------------------------------------------
    wing = SUAVE.Components.Wings.Vertical_Tail()
    wing.tag                       = 'vertical_stabilizer'
    wing.spans.exposed             = 32.4  * Units.feet
    wing.chords.root               = 38.7  * Units.feet      # vertical.chords.fuselage_intersect
    wing.chords.tip                = 13.4  * Units.feet
    wing.sweeps.quarter_chord      = 50.0  * Units.deg # Leading Edge
    wing.x_root_LE1                = 180.0 * Units.feet
    wing.symmetric                 = False
    wing.exposed_root_chord_offset = 13.3   * Units.feet
    wing                           = extend_to_ref_area(wing)
    wing.areas.reference           = wing.extended.areas.reference
    wing.areas.wetted              = wing.areas.reference
    wing.areas.exposed             = wing.areas.reference
    wing.spans.projected           = wing.extended.spans.projected
    wing.chords.root               = 14.9612585185
    dx_LE_vert                     = wing.extended.root_LE_change
    wing.taper                     = 0.272993077083
    wing.origin                    = [[wing.x_root_LE1 + dx_LE_vert,0.,0.]]
    wing.aspect_ratio              = (wing.spans.projected**2)/wing.areas.reference
    wing.effective_aspect_ratio    = 2.2
    wing.symmetric                 = False
    wing.aerodynamic_center        = np.array([trapezoid_ac_x(wing),0.0,0.0])
    wing.dynamic_pressure_ratio    = .95
    Mach                           = np.array([0.198])
    wing.CL_alpha                  = 0.
    wing.ep_alpha                  = 0.
    wing.thickness_to_chord        = 0.1
    vehicle.append_component(wing)


    # ------------------------------------------------------------------
    #  Fuselage
    # ------------------------------------------------------------------

    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag                                = 'fuselage'
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.areas.side_projected               = 4696.16 * Units.feet**2 #used for cnbeta
    fuselage.heights.maximum                    = 26.9    * Units.feet    #used for cnbeta
    fuselage.heights.at_quarter_length          = 26.0    * Units.feet    #used for cnbeta
    fuselage.heights.at_three_quarters_length   = 19.7    * Units.feet    #used for cnbeta
    fuselage.heights.at_wing_root_quarter_chord = 23.8    * Units.feet    #used for cnbeta
    fuselage.x_root_quarter_chord               = 77.0    * Units.feet    #used for cmalpha
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.width                              = 20.9    * Units.feet
    fuselage.areas.wetted = 688.64 * Units.feet**2
    fuselage.differential_pressure = 5.0e4 * Units.pascal
    vehicle.append_component(fuselage)
    vehicle.mass_properties.center_of_gravity=np.array([[112.2,0,0]]) * Units.feet

    # ------------------------------------------------------------------
    #   Turbofan Network
    # ------------------------------------------------------------------

    # instantiate the gas turbine network
    turbofan = SUAVE.Components.Energy.Networks.Turbofan()
    turbofan.tag = 'turbofan'

    # setup
    turbofan.number_of_engines  = 4.0
    turbofan.bypass_ratio       = 4.8
    turbofan.engine_length      = 3.934
    turbofan.nacelle_diameter   = 2.428
    turbofan.origin = [[36.56, 22, -1.9], [27, 12, -1.9],[36.56, -22, -1.9], [27, -12, -1.9]]

    # compute engine areas
    Awet = 1.1 * np.pi * turbofan.nacelle_diameter * turbofan.engine_length

    # Assign engine areas
    turbofan.areas.wetted = Awet

    # working fluid
    turbofan.working_fluid = SUAVE.Attributes.Gases.Air()

    # ------------------------------------------------------------------
    #   Component 1 - Ram

    # to convert freestream static to stagnation quantities

    # instantiate
    ram = SUAVE.Components.Energy.Converters.Ram()
    ram.tag = 'ram'

    # add to the network
    turbofan.append(ram)

    # ------------------------------------------------------------------
    #  Component 2 - Inlet Nozzle

    # instantiate
    inlet_nozzle = SUAVE.Components.Energy.Converters.Compression_Nozzle()
    inlet_nozzle.tag = 'inlet_nozzle'

    # setup
    inlet_nozzle.polytropic_efficiency = 0.98
    inlet_nozzle.pressure_ratio = 0.98

    # add to network
    turbofan.append(inlet_nozzle)

    # ------------------------------------------------------------------
    #  Component 3 - Low Pressure Compressor

    # instantiate
    compressor = SUAVE.Components.Energy.Converters.Compressor()
    compressor.tag = 'low_pressure_compressor'

    # setup
    compressor.polytropic_efficiency = 0.91
    compressor.pressure_ratio = 1.14

    # add to network
    turbofan.append(compressor)

    # ------------------------------------------------------------------
    #  Component 4 - High Pressure Compressor

    # instantiate
    compressor = SUAVE.Components.Energy.Converters.Compressor()
    compressor.tag = 'high_pressure_compressor'

    # setup
    compressor.polytropic_efficiency = 0.91
    compressor.pressure_ratio = 13.415

    # add to network
    turbofan.append(compressor)

    # ------------------------------------------------------------------
    #  Component 5 - Low Pressure Turbine

    # instantiate
    turbine = SUAVE.Components.Energy.Converters.Turbine()
    turbine.tag = 'low_pressure_turbine'

    # setup
    turbine.mechanical_efficiency = 0.99
    turbine.polytropic_efficiency = 0.93

    # add to network
    turbofan.append(turbine)

    # ------------------------------------------------------------------
    #  Component 6 - High Pressure Turbine

    # instantiate
    turbine = SUAVE.Components.Energy.Converters.Turbine()
    turbine.tag = 'high_pressure_turbine'

    # setup
    turbine.mechanical_efficiency = 0.99
    turbine.polytropic_efficiency = 0.93

    # add to network
    turbofan.append(turbine)

    # ------------------------------------------------------------------
    #  Component 7 - Combustor

    # instantiate
    combustor = SUAVE.Components.Energy.Converters.Combustor()
    combustor.tag = 'combustor'

    # setup
    combustor.efficiency                = 0.99
    combustor.alphac                    = 1.0
    combustor.turbine_inlet_temperature = 1450
    combustor.pressure_ratio            = 0.95
    combustor.fuel_data                 = SUAVE.Attributes.Propellants.Jet_A()

    # add to network
    turbofan.append(combustor)

    # ------------------------------------------------------------------
    #  Component 8 - Core Nozzle

    # instantiate
    nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
    nozzle.tag = 'core_nozzle'

    # setup
    nozzle.polytropic_efficiency = 0.95
    nozzle.pressure_ratio = 0.99

    # add to network
    turbofan.append(nozzle)

    # ------------------------------------------------------------------
    #  Component 9 - Fan Nozzle

    # instantiate
    nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
    nozzle.tag = 'fan_nozzle'

    # setup
    nozzle.polytropic_efficiency = 0.95
    nozzle.pressure_ratio = 0.99

    # add to network
    turbofan.append(nozzle)

    # ------------------------------------------------------------------
    #  Component 10 - Fan

    # instantiate
    fan = SUAVE.Components.Energy.Converters.Fan()
    fan.tag = 'fan'

    # setup
    fan.polytropic_efficiency = 0.93
    fan.pressure_ratio = 1.7

    # add to network
    turbofan.append(fan)

    # ------------------------------------------------------------------
    # Component 10 : thrust (to compute the thrust)
    thrust = SUAVE.Components.Energy.Processes.Thrust()
    thrust.tag = 'compute_thrust'

    # total design thrust (includes all the engines)
    # picked lower range of 747-400 at https://en.wikipedia.org/wiki/Boeing_747
    thrust.total_design = 4 * 276000. * Units.N  # Newtons

    # design sizing conditions
    altitude = 35000.0 * Units.ft
    mach_number = 0.92
    isa_deviation = 0.

    # Engine setup for noise module

    # add to network
    turbofan.thrust = thrust

    # size the turbofan
    turbofan_sizing(turbofan, mach_number, altitude)

    # add  gas turbine network turbofan to the vehicle
    vehicle.append_component(turbofan)

    #configuration.mass_properties.zero_fuel_center_of_gravity=np.array([76.5,0,0])*Units.feet #just put a number here that got the expected value output; may want to change
    fuel                                                     =SUAVE.Components.Physical_Component()
    fuel.origin                                              =wing.origin
    fuel.mass_properties.center_of_gravity                   =wing.mass_properties.center_of_gravity
    fuel.mass_properties.mass                                =vehicle.mass_properties.max_takeoff-vehicle.mass_properties.max_zero_fuel

    #find zero_fuel_center_of_gravity
    cg                   =vehicle.mass_properties.center_of_gravity
    MTOW                 =vehicle.mass_properties.max_takeoff
    fuel_cg              =fuel.origin+fuel.mass_properties.center_of_gravity
    fuel_mass            =fuel.mass_properties.mass

    sum_moments_less_fuel=(cg*MTOW-fuel_cg*fuel_mass)
    vehicle.fuel = fuel
    vehicle.mass_properties.zero_fuel_center_of_gravity = sum_moments_less_fuel/vehicle.mass_properties.max_zero_fuel
    
    return vehicle
Ejemplo n.º 4
0
def main():
    #Parameters Required
        #Using values for a Boeing 747-200
    vehicle = SUAVE.Vehicle()
    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'main_wing'
    wing.areas.reference = 5500.0 * Units.feet**2
    wing.spans.projected = 196.0  * Units.feet
    wing.sweep           = 42.0   * Units.deg # Leading edge
    wing.chords.root     = 42.9   * Units.feet #54.5
    wing.chords.tip      = 14.7   * Units.feet
    wing.chords.mean_aerodynamic = 27.3 * Units.feet
    wing.taper           = wing.chords.tip / wing.chords.root
    wing.aspect_ratio    = wing.spans.projected**2/wing.areas.reference
    wing.symmetric       = True
    wing.origin          = np.array([58.6,0.,3.6]) * Units.feet  
    
    reference = SUAVE.Core.Container()
    vehicle.reference_area = wing.areas.reference
    vehicle.append_component(wing)

    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'vertical_stabilizer'
    vertical = SUAVE.Components.Wings.Wing()
    vertical.spans.exposed = 32.4   * Units.feet
    vertical.chords.root   = 38.7 * Units.feet      # vertical.chords.fuselage_intersect
    vertical.chords.tip    = 13.4   * Units.feet
    vertical.sweep         = 50.0   * Units.deg # Leading Edge
    vertical.x_root_LE1    = 180.0  * Units.feet
    vertical.symmetric     = False
    vertical.exposed_root_chord_offset = 13.3   * Units.feet
    ref_vertical           = extend_to_ref_area(vertical)
    wing.areas.reference   = ref_vertical.areas.reference
    wing.spans.projected   = ref_vertical.spans.projected
    wing.chords.root       = ref_vertical.chords.root
    dx_LE_vert             = ref_vertical.root_LE_change
    wing.chords.tip        = vertical.chords.tip
    wing.aspect_ratio      = ref_vertical.aspect_ratio
    wing.sweep             = vertical.sweep
    wing.taper             = wing.chords.tip/wing.chords.root
    wing.origin            = np.array([vertical.x_root_LE1 + dx_LE_vert,0.,0.])
    wing.effective_aspect_ratio = 2.2
    wing.symmetric              = False
    wing.aerodynamic_center     = np.array([trapezoid_ac_x(wing),0.0,0.0])
    Mach                        = np.array([0.198])
    wing.CL_alpha = datcom(wing,Mach)
    vehicle.append_component(wing)

    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'
    fuselage.areas.side_projected               = 4696.16 * Units.feet**2
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.heights.maximum                    = 26.9    * Units.feet
    fuselage.width                              = 20.9    * Units.feet
    fuselage.heights.at_quarter_length          = 26.0    * Units.feet
    fuselage.heights.at_three_quarters_length   = 19.7    * Units.feet
    fuselage.heights.at_wing_root_quarter_chord = 23.8    * Units.feet
    vehicle.append_component(fuselage)

    configuration = Data()
    configuration.mass_properties = Data()
    configuration.mass_properties.center_of_gravity = Data()
    configuration.mass_properties.center_of_gravity = np.array([112.2,0,6.8]) * Units.feet

    #segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment            = SUAVE.Analyses.Mission.Segments.Segment()
    segment.freestream = Data()
    segment.freestream.mach_number = Mach[0]
    segment.atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    
    conditions = segment.atmosphere.compute_values(altitude / Units.km)
    segment.a          = conditions.speed_of_sound
    segment.freestream.density   = conditions.density
    segment.freestream.dynamic_viscosity = conditions.dynamic_viscosity
    segment.freestream.velocity  = segment.freestream.mach_number * segment.a

    #Method Test
    cn_b = taw_cnbeta(vehicle,segment,configuration)
    expected = 0.10045 # Should be 0.184
    error = Data()
    error.cn_b_747 = (cn_b-expected)/expected

    #Parameters Required
    #Using values for a Beechcraft Model 99
    #MODEL DOES NOT ACCOUNT FOR DESTABILIZING EFFECTS OF PROPELLERS!
    """wing               = SUAVE.Components.Wings.Wing()
    wing.area          = 280.0 * Units.feet**2
    wing.span          = 46.0  * Units.feet
    wing.sweep_le      = 3.0   * Units.deg
    wing.z_position    = 2.2   * Units.feet
    wing.taper         = 0.46
    wing.aspect_ratio  = wing.span**2/wing.area
    wing.symmetric     = True

    fuselage           = SUAVE.Components.Fuselages.Fuselage()
    fuselage.side_area = 185.36 * Units.feet**2
    fuselage.length    = 44.0   * Units.feet
    fuselage.h_max     = 6.0    * Units.feet
    fuselage.w_max     = 5.4    * Units.feet
    fuselage.height_at_vroot_quarter_chord   = 2.9 * Units.feet
    fuselage.height_at_quarter_length        = 4.8 * Units.feet
    fuselage.height_at_three_quarters_length = 4.3 * Units.feet

    nacelle           = SUAVE.Components.Fuselages.Fuselage()
    nacelle.side_area = 34.45 * Units.feet**2
    nacelle.x_front   = 7.33  * Units.feet
    nacelle.length    = 14.13 * Units.feet
    nacelle.h_max     = 3.68  * Units.feet
    nacelle.w_max     = 2.39  * Units.feet
    nacelle.height_at_quarter_length        = 3.08 * Units.feet
    nacelle.height_at_three_quarters_length = 2.12 * Units.feet

    other_bodies      = [nacelle,nacelle]

    vertical              = SUAVE.Components.Wings.Wing()
    vertical.span         = 6.6  * Units.feet
    vertical.root_chord   = 8.2  * Units.feet
    vertical.tip_chord    = 3.6  * Units.feet
    vertical.sweep_le     = 47.0 * Units.deg
    vertical.x_root_LE1   = 34.8 * Units.feet
    vertical.symmetric    = False
    dz_centerline         = 2.0  * Units.feet
    ref_vertical          = extend_to_ref_area(vertical,dz_centerline)
    vertical.span         = ref_vertical.ref_span
    vertical.area         = ref_vertical.ref_area
    vertical.aspect_ratio = ref_vertical.ref_aspect_ratio
    vertical.x_root_LE    = vertical.x_root_LE1 + ref_vertical.root_LE_change
    vertical.taper        = vertical.tip_chord/ref_vertical.ref_root_chord
    vertical.effective_aspect_ratio = 1.57
    vertical.x_ac_LE      = trapezoid_ac_x(vertical)

    aircraft              = SUAVE.Vehicle()
    aircraft.wing         = wing
    aircraft.fuselage     = fuselage
    aircraft.other_bodies = other_bodies
    aircraft.vertical     = vertical
    aircraft.Mass_Props.pos_cg[0] = 17.2 * Units.feet

    segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment.M          = 0.152
    segment.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    segment.a          = segment.atmosphere.compute_values(altitude / Units.km, type="a")
    segment.rho        = segment.atmosphere.compute_values(altitude / Units.km, type="rho")
    segment.mew        = segment.atmosphere.compute_values(altitude / Units.km, type="mew")
    segment.v_inf      = segment.M * segment.a

    #Method Test
    expected = 0.12
    print 'Beech 99 at M = {0} and h = {1} meters'.format(segment.M, altitude)
    cn_b = taw_cnbeta(aircraft,segment)

    print 'Cn_beta        = {0:.4f}'.format(cn_b)
    print 'Expected value = {}'.format(expected)
    print 'Percent Error  = {0:.2f}%'.format(100.0*(cn_b-expected)/expected)
    print ' '


    #Parameters Required
    #Using values for an SIAI Marchetti S-211
    wing               = SUAVE.Components.Wings.Wing()
    wing.area          = 136.0 * Units.feet**2
    wing.span          = 26.3  * Units.feet
    wing.sweep_le      = 19.5  * Units.deg
    wing.z_position    = -1.1  * Units.feet
    wing.taper         = 3.1/7.03
    wing.aspect_ratio  = wing.span**2/wing.area

    fuselage           = SUAVE.Components.Fuselages.Fuselage()
    fuselage.side_area = 116.009 * Units.feet**2
    fuselage.length    = 30.9    * Units.feet
    fuselage.h_max     = 5.1     * Units.feet
    fuselage.w_max     = 5.9     * Units.feet
    fuselage.height_at_vroot_quarter_chord   = 4.1 * Units.feet
    fuselage.height_at_quarter_length        = 4.5 * Units.feet
    fuselage.height_at_three_quarters_length = 4.3 * Units.feet

    other_bodies       = []

    vertical              = SUAVE.Components.Wings.Wing()
    vertical.span         = 5.8   * Units.feet
    vertical.root_chord   = 5.7   * Units.feet
    vertical.tip_chord    = 2.0   * Units.feet
    vertical.sweep_le     = 40.2  * Units.deg
    vertical.x_root_LE1   = 22.62 * Units.feet
    vertical.symmetric    = False
    dz_centerline         = 2.9   * Units.feet
    ref_vertical          = extend_to_ref_area(vertical,dz_centerline)
    vertical.span         = ref_vertical.ref_span
    vertical.area         = ref_vertical.ref_area
    vertical.aspect_ratio = ref_vertical.ref_aspect_ratio
    vertical.x_root_LE    = vertical.x_root_LE1 + ref_vertical.root_LE_change
    vertical.taper        = vertical.tip_chord/ref_vertical.ref_root_chord
    vertical.effective_aspect_ratio = 2.65
    vertical.x_ac_LE      = trapezoid_ac_x(vertical)

    aircraft              = SUAVE.Vehicle()
    aircraft.wing         = wing
    aircraft.fuselage     = fuselage
    aircraft.other_bodies = other_bodies
    aircraft.vertical     = vertical
    aircraft.Mass_Props.pos_cg[0] = 16.6 * Units.feet

    segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment.M          = 0.111
    segment.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    segment.a          = segment.atmosphere.compute_values(altitude / Units.km, type="a")
    segment.rho        = segment.atmosphere.compute_values(altitude / Units.km, type="rho")
    segment.mew        = segment.atmosphere.compute_values(altitude / Units.km, type="mew")
    segment.v_inf      = segment.M * segment.a

    #Method Test
    print 'SIAI Marchetti S-211 at M = {0} and h = {1} meters'.format(segment.M, altitude)

    cn_b = taw_cnbeta(aircraft,segment)

    expected = 0.160
    print 'Cn_beta        = {0:.4f}'.format(cn_b)
    print 'Expected value = {}'.format(expected)
    print 'Percent Error  = {0:.2f}%'.format(100.0*(cn_b-expected)/expected)
    print ' '"""

    for k,v in error.items():
        assert(np.abs(v)<0.1)

    return
Ejemplo n.º 5
0
def main():
    #Parameters Required
    #Using values for a Boeing 747-200
    vehicle = SUAVE.Vehicle()
    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'main_wing'
    wing.areas.reference = 5500.0 * Units.feet**2
    wing.spans.projected = 196.0 * Units.feet
    wing.sweep = 42.0 * Units.deg  # Leading edge
    wing.chords.root = 42.9 * Units.feet  #54.5
    wing.chords.tip = 14.7 * Units.feet
    wing.chords.mean_aerodynamic = 27.3 * Units.feet
    wing.taper = wing.chords.tip / wing.chords.root
    wing.aspect_ratio = wing.spans.projected**2 / wing.areas.reference
    wing.symmetric = True
    wing.origin = np.array([58.6, 0., 3.6]) * Units.feet

    reference = SUAVE.Core.Container()
    vehicle.reference_area = wing.areas.reference
    vehicle.append_component(wing)

    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'vertical_stabilizer'
    vertical = SUAVE.Components.Wings.Wing()
    vertical.spans.exposed = 32.4 * Units.feet
    vertical.chords.root = 38.7 * Units.feet  # vertical.chords.fuselage_intersect
    vertical.chords.tip = 13.4 * Units.feet
    vertical.sweep = 50.0 * Units.deg  # Leading Edge
    vertical.x_root_LE1 = 180.0 * Units.feet
    vertical.symmetric = False
    vertical.exposed_root_chord_offset = 13.3 * Units.feet
    ref_vertical = extend_to_ref_area(vertical)
    wing.areas.reference = ref_vertical.areas.reference
    wing.spans.projected = ref_vertical.spans.projected
    wing.chords.root = ref_vertical.chords.root
    dx_LE_vert = ref_vertical.root_LE_change
    wing.chords.tip = vertical.chords.tip
    wing.aspect_ratio = ref_vertical.aspect_ratio
    wing.sweep = vertical.sweep
    wing.taper = wing.chords.tip / wing.chords.root
    wing.origin = np.array([vertical.x_root_LE1 + dx_LE_vert, 0., 0.])
    wing.effective_aspect_ratio = 2.2
    wing.symmetric = False
    wing.aerodynamic_center = np.array([trapezoid_ac_x(wing), 0.0, 0.0])
    Mach = np.array([0.198])
    wing.CL_alpha = datcom(wing, Mach)
    vehicle.append_component(wing)

    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'
    fuselage.areas.side_projected = 4696.16 * Units.feet**2
    fuselage.lengths.total = 229.7 * Units.feet
    fuselage.heights.maximum = 26.9 * Units.feet
    fuselage.width = 20.9 * Units.feet
    fuselage.heights.at_quarter_length = 26.0 * Units.feet
    fuselage.heights.at_three_quarters_length = 19.7 * Units.feet
    fuselage.heights.at_wing_root_quarter_chord = 23.8 * Units.feet
    vehicle.append_component(fuselage)

    configuration = Data()
    configuration.mass_properties = Data()
    configuration.mass_properties.center_of_gravity = Data()
    configuration.mass_properties.center_of_gravity = np.array([112.2, 0, 6.8
                                                                ]) * Units.feet

    #segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment = SUAVE.Analyses.Mission.Segments.Segment()
    segment.freestream = Data()
    segment.freestream.mach_number = Mach
    segment.atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    altitude = 0.0 * Units.feet

    conditions = segment.atmosphere.compute_values(altitude / Units.km)
    segment.a = conditions.speed_of_sound
    segment.freestream.density = conditions.density
    segment.freestream.dynamic_viscosity = conditions.dynamic_viscosity
    segment.freestream.velocity = segment.freestream.mach_number * segment.a

    #Method Test
    cn_b = taw_cnbeta(vehicle, segment, configuration)
    expected = 0.08122837  # Should be 0.184
    error = Data()
    error.cn_b_747 = (cn_b - expected) / expected

    #Parameters Required
    #Using values for a Beechcraft Model 99
    #MODEL DOES NOT ACCOUNT FOR DESTABILIZING EFFECTS OF PROPELLERS!
    """wing               = SUAVE.Components.Wings.Wing()
    wing.area          = 280.0 * Units.feet**2
    wing.span          = 46.0  * Units.feet
    wing.sweep_le      = 3.0   * Units.deg
    wing.z_position    = 2.2   * Units.feet
    wing.taper         = 0.46
    wing.aspect_ratio  = wing.span**2/wing.area
    wing.symmetric     = True

    fuselage           = SUAVE.Components.Fuselages.Fuselage()
    fuselage.side_area = 185.36 * Units.feet**2
    fuselage.length    = 44.0   * Units.feet
    fuselage.h_max     = 6.0    * Units.feet
    fuselage.w_max     = 5.4    * Units.feet
    fuselage.height_at_vroot_quarter_chord   = 2.9 * Units.feet
    fuselage.height_at_quarter_length        = 4.8 * Units.feet
    fuselage.height_at_three_quarters_length = 4.3 * Units.feet

    nacelle           = SUAVE.Components.Fuselages.Fuselage()
    nacelle.side_area = 34.45 * Units.feet**2
    nacelle.x_front   = 7.33  * Units.feet
    nacelle.length    = 14.13 * Units.feet
    nacelle.h_max     = 3.68  * Units.feet
    nacelle.w_max     = 2.39  * Units.feet
    nacelle.height_at_quarter_length        = 3.08 * Units.feet
    nacelle.height_at_three_quarters_length = 2.12 * Units.feet

    other_bodies      = [nacelle,nacelle]

    vertical              = SUAVE.Components.Wings.Wing()
    vertical.span         = 6.6  * Units.feet
    vertical.root_chord   = 8.2  * Units.feet
    vertical.tip_chord    = 3.6  * Units.feet
    vertical.sweep_le     = 47.0 * Units.deg
    vertical.x_root_LE1   = 34.8 * Units.feet
    vertical.symmetric    = False
    dz_centerline         = 2.0  * Units.feet
    ref_vertical          = extend_to_ref_area(vertical,dz_centerline)
    vertical.span         = ref_vertical.ref_span
    vertical.area         = ref_vertical.ref_area
    vertical.aspect_ratio = ref_vertical.ref_aspect_ratio
    vertical.x_root_LE    = vertical.x_root_LE1 + ref_vertical.root_LE_change
    vertical.taper        = vertical.tip_chord/ref_vertical.ref_root_chord
    vertical.effective_aspect_ratio = 1.57
    vertical.x_ac_LE      = trapezoid_ac_x(vertical)

    aircraft              = SUAVE.Vehicle()
    aircraft.wing         = wing
    aircraft.fuselage     = fuselage
    aircraft.other_bodies = other_bodies
    aircraft.vertical     = vertical
    aircraft.Mass_Props.pos_cg[0] = 17.2 * Units.feet

    segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment.M          = 0.152
    segment.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    segment.a          = segment.atmosphere.compute_values(altitude / Units.km, type="a")
    segment.rho        = segment.atmosphere.compute_values(altitude / Units.km, type="rho")
    segment.mew        = segment.atmosphere.compute_values(altitude / Units.km, type="mew")
    segment.v_inf      = segment.M * segment.a

    #Method Test
    expected = 0.12
    print 'Beech 99 at M = {0} and h = {1} meters'.format(segment.M, altitude)
    cn_b = taw_cnbeta(aircraft,segment)

    print 'Cn_beta        = {0:.4f}'.format(cn_b)
    print 'Expected value = {}'.format(expected)
    print 'Percent Error  = {0:.2f}%'.format(100.0*(cn_b-expected)/expected)
    print ' '


    #Parameters Required
    #Using values for an SIAI Marchetti S-211
    wing               = SUAVE.Components.Wings.Wing()
    wing.area          = 136.0 * Units.feet**2
    wing.span          = 26.3  * Units.feet
    wing.sweep_le      = 19.5  * Units.deg
    wing.z_position    = -1.1  * Units.feet
    wing.taper         = 3.1/7.03
    wing.aspect_ratio  = wing.span**2/wing.area

    fuselage           = SUAVE.Components.Fuselages.Fuselage()
    fuselage.side_area = 116.009 * Units.feet**2
    fuselage.length    = 30.9    * Units.feet
    fuselage.h_max     = 5.1     * Units.feet
    fuselage.w_max     = 5.9     * Units.feet
    fuselage.height_at_vroot_quarter_chord   = 4.1 * Units.feet
    fuselage.height_at_quarter_length        = 4.5 * Units.feet
    fuselage.height_at_three_quarters_length = 4.3 * Units.feet

    other_bodies       = []

    vertical              = SUAVE.Components.Wings.Wing()
    vertical.span         = 5.8   * Units.feet
    vertical.root_chord   = 5.7   * Units.feet
    vertical.tip_chord    = 2.0   * Units.feet
    vertical.sweep_le     = 40.2  * Units.deg
    vertical.x_root_LE1   = 22.62 * Units.feet
    vertical.symmetric    = False
    dz_centerline         = 2.9   * Units.feet
    ref_vertical          = extend_to_ref_area(vertical,dz_centerline)
    vertical.span         = ref_vertical.ref_span
    vertical.area         = ref_vertical.ref_area
    vertical.aspect_ratio = ref_vertical.ref_aspect_ratio
    vertical.x_root_LE    = vertical.x_root_LE1 + ref_vertical.root_LE_change
    vertical.taper        = vertical.tip_chord/ref_vertical.ref_root_chord
    vertical.effective_aspect_ratio = 2.65
    vertical.x_ac_LE      = trapezoid_ac_x(vertical)

    aircraft              = SUAVE.Vehicle()
    aircraft.wing         = wing
    aircraft.fuselage     = fuselage
    aircraft.other_bodies = other_bodies
    aircraft.vertical     = vertical
    aircraft.Mass_Props.pos_cg[0] = 16.6 * Units.feet

    segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment.M          = 0.111
    segment.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    segment.a          = segment.atmosphere.compute_values(altitude / Units.km, type="a")
    segment.rho        = segment.atmosphere.compute_values(altitude / Units.km, type="rho")
    segment.mew        = segment.atmosphere.compute_values(altitude / Units.km, type="mew")
    segment.v_inf      = segment.M * segment.a

    #Method Test
    print 'SIAI Marchetti S-211 at M = {0} and h = {1} meters'.format(segment.M, altitude)

    cn_b = taw_cnbeta(aircraft,segment)

    expected = 0.160
    print 'Cn_beta        = {0:.4f}'.format(cn_b)
    print 'Expected value = {}'.format(expected)
    print 'Percent Error  = {0:.2f}%'.format(100.0*(cn_b-expected)/expected)
    print ' '"""

    for k, v in error.items():
        assert (np.abs(v) < 0.1)

    return
Ejemplo n.º 6
0
 fuselage.side_area  = 4696.16 * Units.feet**2
 fuselage.length     = 229.7   * Units.feet
 fuselage.h_max      = 26.9    * Units.feet
 fuselage.w_max      = 20.9    * Units.feet
 fuselage.height_at_vroot_quarter_chord   = 15.8 * Units.feet
 fuselage.height_at_quarter_length        = 26   * Units.feet
 fuselage.height_at_three_quarters_length = 19.7 * Units.feet
 
 vertical              = SUAVE.Components.Wings.Wing()
 vertical.span         = 32.4   * Units.feet
 vertical.root_chord   = 38.7   * Units.feet
 vertical.tip_chord    = 13.4   * Units.feet
 vertical.sweep_le     = 50.0   * Units.deg
 vertical.x_root_LE1   = 181.0  * Units.feet
 dz_centerline         = 13.5   * Units.feet
 ref_vertical          = extend_to_ref_area(vertical,dz_centerline)
 vertical.span         = ref_vertical.ref_span
 vertical.area         = ref_vertical.ref_area
 vertical.aspect_ratio = ref_vertical.ref_aspect_ratio
 vertical.x_root_LE    = vertical.x_root_LE1 + ref_vertical.root_LE_change
 vertical.taper        = vertical.tip_chord/ref_vertical.ref_root_chord
 vertical.effective_aspect_ratio = 2.25
 vertical_symm         = copy.deepcopy(vertical)
 vertical_symm.span    = 2.0*vertical.span
 vertical_symm.area    = 2.0*vertical.area
 vertical.x_ac_LE      = trapezoid_ac_x(vertical_symm)
 
 aircraft            = SUAVE.Vehicle()
 aircraft.wing       = wing
 aircraft.fuselage   = fuselage
 aircraft.vertical   = vertical
Ejemplo n.º 7
0
def taw_cnbeta(geometry,conditions,configuration):
    """ CnBeta = SUAVE.Methods.Flight_Dynamics.Static_Stability.Approximations.Tube_Wing.taw_cnbeta(configuration,conditions)
        This method computes the static directional stability derivative for a
        standard Tube-and-Wing aircraft configuration.        
        
        CAUTION: The correlations used in this method do not account for the
        destabilizing moments due to propellers. This can lead to higher-than-
        expected values of CnBeta, particularly for smaller prop-driven aircraft
        
        Inputs:
            geometry - aircraft geometrical features: a data dictionary with the fields:
                wings['Main Wing'] - the aircraft's main wing
                    areas.reference - wing reference area [meters**2]
                    spans.projected - span of the wing [meters]
                    sweep - sweep of the wing leading edge [radians]
                    aspect_ratio - wing aspect ratio [dimensionless]
                    origin - the position of the wing root in the aircraft body frame [meters]
                wings['Vertical Stabilizer']
                    spans.projected - projected span (height for a vertical tail) of
                     the exposed surface [meters]
                    areas.reference - area of the reference vertical tail [meters**2]
                    sweep - leading edge sweep of the aerodynamic surface [radians]
                    chords.root - chord length at the junction between the tail and 
                     the fuselage [meters]
                    chords.tip - chord length at the tip of the aerodynamic surface
                    [meters]
                    symmetric - Is the wing symmetric across the fuselage centerline?
                    origin - the position of the vertical tail root in the aircraft body frame [meters]
                    exposed_root_chord_offset - the displacement from the fuselage
                     centerline to the exposed area's physical root chordline [meters]
                     
                     

    x_v    = vert.origin[0]
    b_v    = vert.spans.projected
    ac_vLE = vert.aerodynamic_center[0]
    
                fuselages.Fuselage - a data dictionary with the fields:
                    areas.side_projected - fuselage body side area [meters**2]
                    lengths.total - length of the fuselage [meters]
                    heights.maximum - maximum height of the fuselage [meters]
                    width - maximum width of the fuselage [meters]
                    heights.at_quarter_length - fuselage height at 1/4 of the fuselage length [meters]
                    heights.at_three_quarters_length - fuselage height at 3/4 of fuselage 
                     length [meters]
                    heights.at_vertical_root_quarter_chord - fuselage height at the quarter 
                     chord of the vertical tail root [meters]
                vertical - a data dictionary with the fields below:
                NOTE: This vertical tail geometry will be used to define a reference
                 vertical tail that extends to the fuselage centerline.
                    
                    x_ac_LE - the x-coordinate of the vertical tail aerodynamic 
                    center measured relative to the tail root leading edge (root
                    of reference tail area - at fuselage centerline)
                    leading edge, relative to the nose [meters]
                    sweep_le - leading edge sweep of the vertical tail [radians]
                    span - height of the vertical tail [meters]
                    taper - vertical tail taper ratio [dimensionless]
                    aspect_ratio - vertical tail AR: bv/(Sv)^2 [dimensionless]
                    effective_aspect_ratio - effective aspect ratio considering
                    the effects of fuselage and horizontal tail [dimensionless]
                    symmetric - indicates whether the vertical panel is symmetric
                    about the fuselage centerline [Boolean]
                other_bodies - an list of data dictionaries containing bodies 
                such as nacelles if these are large enough to strongly influence
                stability. Each body data dictionary contains the same fields as
                the fuselage data dictionary (described above), except no value 
                is needed for 'height_at_vroot_quarter_chord'. CAN BE EMPTY LIST
                    x_front - This is the only new field needed: the x-coordinate 
                    of the nose of the body relative to the fuselage nose
                    
            conditions - a data dictionary with the fields:
                v_inf - true airspeed [meters/second]
                M - flight Mach number
                rho - air density [kg/meters**3]
                mew - air dynamic viscosity [kg/meter/second]
                
            configuration - a data dictionary with the fields:
                mass_properties - a data dictionary with the field:
                    center_of_gravity - A vector in 3-space indicating CG position [meters]
                other - a dictionary of aerodynamic bodies, other than the fuselage,
                whose effect on directional stability is to be included in the analysis
    
        Outputs:
            CnBeta - a single float value: The static directional stability 
            derivative
                
        Assumptions:
            -Assumes a tube-and-wing configuration with a single centered 
            vertical tail
            -Uses vertical tail effective aspect ratio, currently calculated by
            hand, using methods from USAF Stability and Control DATCOM
            -The validity of correlations for KN is questionable for sqrt(h1/h2)
            greater than about 4 or h_max/w_max outside [0.3,2].
            -This method assumes a small angle of attack, so the vertical tail AC
            z-position does not affect the sideslip derivative.
        
        Correlations:
            -Correlations are taken from Roskam's Airplane Design, Part VI.
    """         

    try:
        configuration.other
    except AttributeError:
        configuration.other = 0
    CnBeta_other = []

    # Unpack inputs
    S      = geometry.wings['Main Wing'].areas.reference
    b      = geometry.wings['Main Wing'].spans.projected
    sweep  = geometry.wings['Main Wing'].sweep
    AR     = geometry.wings['Main Wing'].aspect_ratio
    z_w    = geometry.wings['Main Wing'].origin[2]
    S_bs   = geometry.fuselages.Fuselage.areas.side_projected
    l_f    = geometry.fuselages.Fuselage.lengths.total
    h_max  = geometry.fuselages.Fuselage.heights.maximum
    w_max  = geometry.fuselages.Fuselage.width
    h1     = geometry.fuselages.Fuselage.heights.at_quarter_length
    h2     = geometry.fuselages.Fuselage.heights.at_three_quarters_length
    d_i    = geometry.fuselages.Fuselage.heights.at_vertical_root_quarter_chord
    other  = configuration.other
    vert   = extend_to_ref_area(geometry.wings['Vertical Stabilizer'])
    S_v    = vert.areas.reference
    x_v    = vert.origin[0]
    b_v    = vert.spans.projected
    ac_vLE = vert.aerodynamic_center[0]
    x_cg   = configuration.mass_properties.center_of_gravity[0]
    v_inf  = conditions.freestream.velocity
    mu     = conditions.freestream.viscosity
    rho    = conditions.freestream.density
    M      = conditions.freestream.mach_number
    
    #Compute wing contribution to Cn_beta
    CnBeta_w = 0.0    #The wing contribution is assumed to be zero except at very
                      #high angles of attack. 
    
    #Compute fuselage contribution to Cn_beta
    Re_fuse  = rho*v_inf*l_f/mu
    x1       = x_cg/l_f
    x2       = l_f**2.0/S_bs
    x3       = np.sqrt(h1/h2)
    x4       = h_max/w_max
    kN_1     = 3.2413*x1 - 0.663345 + 6.1086*np.exp(-0.22*x2)
    kN_2     = (-0.2023 + 1.3422*x3 - 0.1454*x3**2)*kN_1
    kN_3     = (0.7870 + 0.1038*x4 + 0.1834*x4**2 - 2.811*np.exp(-4.0*x4))
    K_N      = (-0.47899 + kN_3*kN_2)*0.001
    K_Rel    = 1.0+0.8*np.log(Re_fuse/1.0E6)/np.log(50.)  
        #K_Rel: Correction for fuselage Reynolds number. Roskam VI, page 400.
    CnBeta_f = -57.3*K_N*K_Rel*S_bs*l_f/S/b
    
    #Compute contributions of other bodies on CnBeta
    if other > 0:
        for body in other:
            #Unpack inputs
            S_bs   = body.areas.side_projected
            x_le   = body.origin[0]
            l_b    = body.lengths.total
            h_max  = body.heights.maximum
            w_max  = body.width
            h1     = body.heights.at_quarter_length
            h2     = body.heights.at_three_quarters_length 
            #Compute body contribution to Cn_beta
            x_cg_on_body = (x_cg-x_le)/l_b
            Re_body  = rho*v_inf*l_b/mew
            x1       = x_cg_on_body/l_b
            x2       = l_b**2.0/S_bs
            x3       = np.sqrt(h1/h2)
            x4       = h_max/w_max
            kN_1     = 3.2413*x1 - 0.663345 + 6.1086*np.exp(-0.22*x2)
            kN_2     = (-0.2023 + 1.3422*x3 - 0.1454*x3**2)*kN_1
            kN_3     = (0.7870 + 0.1038*x4 + 0.1834*x4**2 - 2.811*np.exp(-4.0*x4))
            K_N      = (-0.47899 + kN_3*kN_2)*0.001
            #K_Rel: Correction for fuselage Reynolds number. Roskam VI, page 400.
            K_Rel    = 1.0+0.8*np.log(Re_body/1.0E6)/np.log(50.)
            CnBeta_b = -57.3*K_N*K_Rel*S_bs*l_b/S/b
            CnBeta_other.append(CnBeta_b)
    
    #Compute vertical tail contribution
    l_v    = x_v + ac_vLE - x_cg
    #try:
    #    CLa_v  = geometry.wings['Vertical Stabilizer'].CL_alpha
    #except AttributeError:
    #    CLa_v  = datcom(geometry.wings['Vertical Stabilizer'], [M])
    try:
        iter(M)
    except TypeError:
        M = [M]
    CLa_v = datcom(vert,M)
    #k_v correlated from Roskam Fig. 10.12. NOT SMOOTH.
    bf     = b_v/d_i
    if bf < 2.0:
        k_v = 0.76
    elif bf < 3.5:
        k_v = 0.76 + 0.24*(bf-2.0)/1.5
    else:
        k_v = 1.0
    quarter_chord_sweep = convert_sweep(geometry.wings['Main Wing'])
    k_sweep  = (1.0+np.cos(quarter_chord_sweep))
    dsdb_e   = 0.724 + 3.06*((S_v/S)/k_sweep) + 0.4*z_w/h_max + 0.009*AR
    Cy_bv    = -k_v*CLa_v*dsdb_e*(S_v/S)  #ASSUMING SINGLE VERTICAL TAIL
    
    CnBeta_v = -Cy_bv*l_v/b
    
    CnBeta   = CnBeta_w + CnBeta_f + CnBeta_v + sum(CnBeta_other)
    
    ##print "Wing: {}  Fuse: {}   Vert: {}   Othr: {}".format(CnBeta_w,CnBeta_f,CnBeta_v,sum(CnBeta_other))
    
    return CnBeta
Ejemplo n.º 8
0
def vehicle_setup():

    vehicle = SUAVE.Vehicle()
    
    #print vehicle
    vehicle.mass_properties.max_zero_fuel=238780*Units.kg
    vehicle.mass_properties.max_takeoff  =785000.*Units.lbs
    
    # ------------------------------------------------------------------        
    #   Main Wing
    # ------------------------------------------------------------------        

    wing = SUAVE.Components.Wings.Main_Wing()
    wing.tag = 'main_wing'
    wing.areas.reference           = 5500.0 * Units.feet**2
    wing.spans.projected           = 196.0  * Units.feet
    wing.chords.mean_aerodynamic   = 27.3   * Units.feet
    wing.chords.root               = 42.9   * Units.feet  #54.5ft
    wing.chords.tip                = 14.7   * Units.feet
    wing.sweeps.quarter_chord      = 42.0   * Units.deg  # Leading edge
    wing.sweeps.leading_edge       = 42.0   * Units.deg  # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                     = wing.chords.tip / wing.chords.root
    
    wing.aspect_ratio              = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.vertical       = False
    wing.origin         = np.array([58.6,0,3.6]) * Units.feet  
    wing.aerodynamic_center     = np.array([112.2*Units.feet,0.,0.])-wing.origin#16.16 * Units.meters,0.,0,])
    wing.dynamic_pressure_ratio = 1.0
    wing.ep_alpha               = 0.0
    
    span_location_mac                         = compute_span_location_from_chord_length(wing, wing.chords.mean_aerodynamic)
    mac_le_offset                             = .8*np.sin(wing.sweeps.leading_edge)*span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[0] = .3*wing.chords.mean_aerodynamic+mac_le_offset
    
    
    Mach                         = np.array([0.198])
    conditions                   = Data()
    conditions.weights           = Data()
    conditions.lift_curve_slope  = datcom(wing,Mach)
    conditions.weights.total_mass=np.array([[vehicle.mass_properties.max_takeoff]]) 
   
    wing.CL_alpha                = conditions.lift_curve_slope
    vehicle.reference_area       = wing.areas.reference
    vehicle.append_component(wing)
    
    main_wing_CLa = wing.CL_alpha
    main_wing_ar  = wing.aspect_ratio
    
    # ------------------------------------------------------------------        
    #  Horizontal Stabilizer
    # ------------------------------------------------------------------        
    
    
    wing                        = SUAVE.Components.Wings.Wing()
    wing.tag                    = 'horizontal_stabilizer'
    wing.areas.reference        = 1490.55* Units.feet**2
    wing.spans.projected        = 71.6   * Units.feet
    wing.sweeps.quarter_chord   = 44.0   * Units.deg # leading edge
    wing.sweeps.leading_edge    = 44.0   * Units.deg # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                  = 7.5/32.6
    wing.aspect_ratio           = wing.spans.projected**2/wing.areas.reference
    wing.origin                 = np.array([187.0,0,0])  * Units.feet
    wing.symmetric              = True
    wing.vertical               = False
    wing.dynamic_pressure_ratio = 0.95
    wing.ep_alpha               = 2.0*main_wing_CLa/np.pi/main_wing_ar    
    wing.aerodynamic_center     = [trapezoid_ac_x(wing), 0.0, 0.0]
    wing.CL_alpha               = datcom(wing,Mach)
    vehicle.append_component(wing)
    
    # ------------------------------------------------------------------
    #   Vertical Stabilizer
    # ------------------------------------------------------------------
    
    wing = SUAVE.Components.Wings.Wing()
    wing.tag                  = 'vertical_stabilizer'
    wing.spans.exposed        = 32.4  * Units.feet
    wing.chords.root          = 38.7  * Units.feet      # vertical.chords.fuselage_intersect
    wing.chords.tip           = 13.4  * Units.feet
    wing.sweeps.quarter_chord = 50.0  * Units.deg # Leading Edge
    wing.x_root_LE1           = 180.0 * Units.feet
    wing.symmetric            = False
    wing.exposed_root_chord_offset = 13.3   * Units.feet
    wing                      = extend_to_ref_area(wing)
 
    wing.areas.reference        = wing.extended.areas.reference
    wing.spans.projected        = wing.extended.spans.projected
    wing.chords.root            = 14.9612585185
    dx_LE_vert                  = wing.extended.root_LE_change
    wing.taper                  = 0.272993077083
    wing.origin                 = np.array([wing.x_root_LE1 + dx_LE_vert,0.,0.])
    wing.aspect_ratio           = (wing.spans.projected**2)/wing.areas.reference
    wing.effective_aspect_ratio = 2.2
    wing.symmetric              = False
    wing.aerodynamic_center     = np.array([trapezoid_ac_x(wing),0.0,0.0])
    wing.dynamic_pressure_ratio = .95
    Mach                        = np.array([0.198])
    wing.CL_alpha               = 0.
    wing.ep_alpha               = 0.
    vehicle.append_component(wing)
    
    
    # ------------------------------------------------------------------
    #  Fuselage
    # ------------------------------------------------------------------
    
    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'
    
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.areas.side_projected               = 4696.16 * Units.feet**2 #used for cnbeta
    fuselage.heights.maximum                    = 26.9    * Units.feet    #used for cnbeta
    fuselage.heights.at_quarter_length          = 26.0    * Units.feet    #used for cnbeta
    fuselage.heights.at_three_quarters_length   = 19.7    * Units.feet    #used for cnbeta
    fuselage.heights.at_wing_root_quarter_chord = 23.8    * Units.feet    #used for cnbeta
    
    fuselage.x_root_quarter_chord               = 77.0    * Units.feet    #used for cmalpha
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.width                              = 20.9    * Units.feet 
    
     
    
    vehicle.append_component(fuselage)
    vehicle.mass_properties.center_of_gravity=np.array([112.2,0,0]) * Units.feet  
    
    
    
 
    #configuration.mass_properties.zero_fuel_center_of_gravity=np.array([76.5,0,0])*Units.feet #just put a number here that got the expected value output; may want to change
    fuel                                                     =SUAVE.Components.Physical_Component()
    fuel.origin                                              =wing.origin
    fuel.mass_properties.center_of_gravity                   =wing.mass_properties.center_of_gravity
    fuel.mass_properties.mass                                =vehicle.mass_properties.max_takeoff-vehicle.mass_properties.max_zero_fuel
   
    
    #find zero_fuel_center_of_gravity
    cg                   =vehicle.mass_properties.center_of_gravity
    MTOW                 =vehicle.mass_properties.max_takeoff
    fuel_cg              =fuel.origin+fuel.mass_properties.center_of_gravity
    fuel_mass            =fuel.mass_properties.mass
    
    
    sum_moments_less_fuel=(cg*MTOW-fuel_cg*fuel_mass)
    vehicle.fuel = fuel
    vehicle.mass_properties.zero_fuel_center_of_gravity = sum_moments_less_fuel/vehicle.mass_properties.max_zero_fuel
    return vehicle