コード例 #1
0
def main():

    # ----------------------------------------------------------------------
    #   Main
    # ----------------------------------------------------------------------

    # --- Vehicle definition ---
    vehicle = define_vehicle()

    # --- Landing Configuration ---
    landing_config = vehicle.configs.takeoff
    landing_config.wings['Main Wing'].flaps_angle = 30. * Units.deg
    landing_config.wings['Main Wing'].slats_angle = 25. * Units.deg
    # Vref_V2_ratio may be informed by user. If not, use default value (1.23)
    landing_config.Vref_VS_ratio = 1.23
    # CLmax for a given configuration may be informed by user
    # landing_config.maximum_lift_coefficient = 2.XX

    # --- Airport definition ---
    airport = SUAVE.Attributes.Airports.Airport()
    airport.tag = 'airport'
    airport.altitude = 0.0 * Units.ft
    airport.delta_isa = 0.0
    airport.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()

    # =====================================
    # Landing field length evaluation
    # =====================================
    w_vec = np.linspace(20000., 44000., 10)
    landing_field_length = np.zeros_like(w_vec)
    for id_w, weight in enumerate(w_vec):
        landing_config.mass_properties.landing = weight
        landing_field_length[id_w] = estimate_landing_field_length(
            vehicle, landing_config, airport)

    truth_LFL = np.array([
        705.78061286, 766.55136124, 827.32210962, 888.092858, 948.86360638,
        1009.63435476, 1070.40510314, 1131.17585152, 1191.9465999,
        1252.71734828
    ])

    LFL_error = np.max(np.abs(landing_field_length - truth_LFL))

    print 'Maximum Landing Field Length Error= %.4e' % LFL_error

    title = "LFL vs W"
    plt.figure(1)
    plt.hold
    plt.plot(w_vec, landing_field_length, 'k-', label='Landing Field Length')

    plt.title(title)
    plt.grid(True)
    legend = plt.legend(loc='lower right', shadow='true')
    plt.xlabel('Weight (kg)')
    plt.ylabel('Landing Field Length (m)')

    assert (LFL_error < 1e-5)

    return
コード例 #2
0
def main():

    # ----------------------------------------------------------------------
    #   Main
    # ----------------------------------------------------------------------

    # --- Vehicle definition ---
    vehicle = vehicle_setup()
    configs=configs_setup(vehicle)
    # --- Landing Configuration ---
    landing_config = configs.landing
    landing_config.wings['main_wing'].flaps.angle =  30. * Units.deg
    landing_config.wings['main_wing'].slats.angle = 25. * Units.deg
    landing_config.wings['main_wing'].high_lift  = True
    # Vref_V2_ratio may be informed by user. If not, use default value (1.23)
    landing_config.Vref_VS_ratio = 1.23
    # CLmax for a given configuration may be informed by user
    # landing_config.maximum_lift_coefficient = 2.XX
    # Used defined ajust factor for maximum lift coefficient
    landing_config.max_lift_coefficient_factor = 0.90

    # --- Airport definition ---
    airport = SUAVE.Attributes.Airports.Airport()
    airport.tag = 'airport'
    airport.altitude   =  0.0  * Units.ft
    airport.delta_isa  =  0.0
    airport.atmosphere =  SUAVE.Analyses.Atmospheric.US_Standard_1976()

    # =====================================
    # Landing field length evaluation
    # =====================================
    w_vec = np.linspace(20000.,44000.,10)
    landing_field_length = np.zeros_like(w_vec)
    for id_w,weight in enumerate(w_vec):
        landing_config.mass_properties.landing = weight
        landing_field_length[id_w] = estimate_landing_field_length(landing_config,landing_config,airport)

    truth_LFL = np.array( [  723.67022689 ,  786.82625714 ,  849.98228739  , 913.13831764  , 976.29434789 , 1039.45037815 , 1102.6064084 ,  1165.76243865 , 1228.9184689 ,  1292.07449915])
    LFL_error = np.max(np.abs(landing_field_length-truth_LFL))
    
    print('Maximum Landing Field Length Error= %.4e' % LFL_error)
    
    title = "LFL vs W"
    plt.figure(1); 
    plt.plot(w_vec,landing_field_length, 'k-', label = 'Landing Field Length')

    plt.title(title); plt.grid(True)

    plt.figure(1); plt.plot(w_vec,truth_LFL, label = 'Landing Field Length (true)')
    legend = plt.legend(loc='lower right', shadow = 'true')
    plt.xlabel('Weight (kg)')
    plt.ylabel('Landing Field Length (m)')
    
    #assert( LFL_error   < 1e-5 )

    return 
コード例 #3
0
def main():

    # ----------------------------------------------------------------------
    #   Main
    # ----------------------------------------------------------------------

    # --- Vehicle definition ---
    vehicle = vehicle_setup()
    configs=configs_setup(vehicle)
    # --- Landing Configuration ---
    landing_config = configs.landing
    landing_config.wings['main_wing'].flaps.angle =  30. * Units.deg
    landing_config.wings['main_wing'].slats.angle = 25. * Units.deg
    landing_config.wings['main_wing'].high_lift  = True
    # Vref_V2_ratio may be informed by user. If not, use default value (1.23)
    landing_config.Vref_VS_ratio = 1.23
    # CLmax for a given configuration may be informed by user
    # landing_config.maximum_lift_coefficient = 2.XX
    # Used defined ajust factor for maximum lift coefficient
    landing_config.max_lift_coefficient_factor = 0.90

    # --- Airport definition ---
    airport = SUAVE.Attributes.Airports.Airport()
    airport.tag = 'airport'
    airport.altitude   =  0.0  * Units.ft
    airport.delta_isa  =  0.0
    airport.atmosphere =  SUAVE.Analyses.Atmospheric.US_Standard_1976()

    # =====================================
    # Landing field length evaluation
    # =====================================
    w_vec = np.linspace(20000.,44000.,10)
    landing_field_length = np.zeros_like(w_vec)
    for id_w,weight in enumerate(w_vec):
        landing_config.mass_properties.landing = weight
        landing_field_length[id_w] = estimate_landing_field_length(landing_config,landing_config,airport)

    truth_LFL = np.array( [  723.67022689 ,  786.82625714 ,  849.98228739  , 913.13831764  , 976.29434789 , 1039.45037815 , 1102.6064084 ,  1165.76243865 , 1228.9184689 ,  1292.07449915])
    LFL_error = np.max(np.abs(landing_field_length-truth_LFL))
    
    print 'Maximum Landing Field Length Error= %.4e' % LFL_error
    
    title = "LFL vs W"
    plt.figure(1); plt.hold
    plt.plot(w_vec,landing_field_length, 'k-', label = 'Landing Field Length')

    plt.title(title); plt.grid(True)

    plt.figure(1); plt.plot(w_vec,truth_LFL, label = 'Landing Field Length (true)')
    legend = plt.legend(loc='lower right', shadow = 'true')
    plt.xlabel('Weight (kg)')
    plt.ylabel('Landing Field Length (m)')
    
    #assert( LFL_error   < 1e-5 )

    return 
コード例 #4
0
def main():

    # ----------------------------------------------------------------------
    #   Main
    # ----------------------------------------------------------------------

    # --- Vehicle definition ---
    vehicle = vehicle_setup()
    configs=configs_setup(vehicle)
    # --- Landing Configuration ---
    landing_config = configs.landing
    landing_config.wings['main_wing'].flaps.angle =  30. * Units.deg
    landing_config.wings['main_wing'].slats.angle = 25. * Units.deg
    landing_config.wings['main_wing'].high_lift  = True
    # Vref_V2_ratio may be informed by user. If not, use default value (1.23)
    landing_config.Vref_VS_ratio = 1.23
    # CLmax for a given configuration may be informed by user
    # landing_config.maximum_lift_coefficient = 2.XX

    # --- Airport definition ---
    airport = SUAVE.Attributes.Airports.Airport()
    airport.tag = 'airport'
    airport.altitude   =  0.0  * Units.ft
    airport.delta_isa  =  0.0
    airport.atmosphere =  SUAVE.Analyses.Atmospheric.US_Standard_1976()

    # =====================================
    # Landing field length evaluation
    # =====================================
    w_vec = np.linspace(20000.,44000.,10)
    landing_field_length = np.zeros_like(w_vec)
    for id_w,weight in enumerate(w_vec):
        landing_config.mass_properties.landing = weight
        landing_field_length[id_w] = estimate_landing_field_length(landing_config,landing_config,airport)

    truth_LFL = np.array([705.78061286, 766.55136124, 827.32210962, 888.092858, 948.86360638, 
                          1009.63435476, 1070.40510314, 1131.17585152, 1191.9465999, 1252.71734828])
    
    LFL_error = np.max(np.abs(landing_field_length-truth_LFL))
    
    print 'Maximum Landing Field Length Error= %.4e' % LFL_error
    
    title = "LFL vs W"
    plt.figure(1); plt.hold
    plt.plot(w_vec,landing_field_length, 'k-', label = 'Landing Field Length')

    plt.title(title); plt.grid(True)
    legend = plt.legend(loc='lower right', shadow = 'true')
    plt.xlabel('Weight (kg)')
    plt.ylabel('Landing Field Length (m)')
    
    plt.figure(2); plt.plot(w_vec,truth_LFL)
    #assert( LFL_error   < 1e-5 )

    return 
コード例 #5
0
def main():

    # ----------------------------------------------------------------------
    #   Main
    # ----------------------------------------------------------------------

    # --- Vehicle definition ---
    vehicle = vehicle_setup()
    configs = configs_setup(vehicle)
    # --- Landing Configuration ---
    landing_config = configs.landing
    landing_config.wings[
        'main_wing'].control_surfaces.flap.deflection = 30. * Units.deg
    landing_config.wings[
        'main_wing'].control_surfaces.slat.deflection = 25. * Units.deg
    landing_config.wings['main_wing'].high_lift = True
    # Vref_V2_ratio may be informed by user. If not, use default value (1.23)
    landing_config.Vref_VS_ratio = 1.23

    # CLmax for a given configuration may be informed by user
    # Used defined ajust factor for maximum lift coefficient
    analyses = base_analysis(vehicle)
    analyses.aerodynamics.settings.maximum_lift_coefficient_factor = 0.90

    # --- Airport definition ---
    airport = SUAVE.Attributes.Airports.Airport()
    airport.tag = 'airport'
    airport.altitude = 0.0 * Units.ft
    airport.delta_isa = 0.0
    airport.atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()

    # =====================================
    # Landing field length evaluation
    # =====================================
    w_vec = np.linspace(20000., 44000., 10)
    landing_field_length = np.zeros_like(w_vec)
    for id_w, weight in enumerate(w_vec):
        landing_config.mass_properties.landing = weight
        landing_field_length[id_w] = estimate_landing_field_length(
            landing_config, analyses, airport)

    truth_LFL = np.array([
        736.09211533, 800.90439737, 865.71667941, 930.52896146, 995.3412435,
        1060.15352554, 1124.96580759, 1189.77808963, 1254.59037167,
        1319.40265372
    ])
    LFL_error = np.max(np.abs(landing_field_length - truth_LFL))
    assert (LFL_error < 1e-6)

    print('Maximum Landing Field Length Error= %.4e' % LFL_error)

    title = "LFL vs W"
    plt.figure(1)
    plt.plot(w_vec, landing_field_length, 'k-', label='Landing Field Length')

    plt.title(title)
    plt.grid(True)

    plt.figure(1)
    plt.plot(w_vec, truth_LFL, label='Landing Field Length (true)')
    legend = plt.legend(loc='lower right', shadow='true')
    plt.xlabel('Weight (kg)')
    plt.ylabel('Landing Field Length (m)')

    #assert( LFL_error   < 1e-5 )

    return
コード例 #6
0
def main():
    # ---------------------------------------------------------------------------------------
    # INITIALIZING AIRCRAFT

    configs, analyses, vehicle = full_setup()

    print 'full setup OK'
    simple_sizing(configs)

    configs.finalize()
    analyses.finalize()

    # ---------------------------------------------------------------------------------------
    # WEIGHT ANALYSIS
    weights = analyses.configs.base.weights
    weights.evaluate()

    print 'WEIGHTS OK'
    # ---------------------------------------------------------------------------------------
    # MISSION ANALYSIS
    mission = analyses.missions.base
    results = mission.evaluate()
    print 'MISSION OK'
    configs.cruise.conditions = Data()
    configs.cruise.conditions = results.segments.cruise.conditions

    # print weight breakdown
    print_weight_breakdown(configs.base, filename='ATR72_weight_breakdown.dat')

    # print parasite drag data into file - define reference condition for parasite drag
    ref_condition = Data()
    ref_condition.mach_number = 0.3
    ref_condition.reynolds_number = 12e6
    print_parasite_drag(ref_condition, configs.cruise, analyses,
                        'ATR72_parasite_drag.dat')

    # print compressibility drag data into file
    print_compress_drag(configs.cruise,
                        analyses,
                        filename='ATR72_compress_drag.dat')

    # print mission breakdown
    print_mission_breakdown(results, filename='ATR72_mission_breakdown.dat')

    state = Data()
    state.conditions = SUAVE.Analyses.Mission.Segments.Conditions.Aerodynamics(
    )
    state.numerics = SUAVE.Analyses.Mission.Segments.Conditions.Numerics()
    # ---------------------------------------------------------------------------------------
    # PLOT RESULTS

    plot_mission(results, 0)
    # ---------------------------------------------------------------------------------------
    # PAYLOAD RANGE DIAGRAM

    config = configs.base
    cruise_segment_tag = "cruise"
    reserves = [775., 1120., 1040.]

    weights.mass_properties.operating_empty = weights.mass_properties.operating_empty - 239.
    payloadrange = payload_range(config, mission, cruise_segment_tag, reserves)

    # ---------------------------------------------------------------------------------------
    # TAKE OFF FIELD LENGTH
    # ---- Inputs
    analyses.base = analyses.configs.base
    airport = mission.airport
    clb_grad = 1

    altitude = [0., 6000.]
    delta_isa = 0.  # +23
    # 1000, 1100, 1200, 1300, 1400, -, 1500, 1600
    # 1200, 1300, 1400, 1500, 1600, 1700
    weights_tofl = [[20062, 21044, 21954, 22801, 23000, 23452, 23754, 21200],
                    [18489, 19342, 20154, 20928, 21671, 22105, 21530]]

    # ---- Inputs: FLAP AND SLAT DEFLECTION
    flaps = [15., 0.]  # Deflections inboard local
    slats = [0., 0.]

    # ---- Inputs: FACTOR CLMAX
    configs.takeoff.max_lift_coefficient_factor = 1.189
    configs.takeoff.V2_VS_ratio = 1.143

    # ---- Open output file
    fid = open('TOFL.txt', 'w')  # Open output file

    # ---- Run
    for j, h in enumerate(altitude):
        airport.altitude = h * Units.ft
        airport.delta_isa = delta_isa
        fid.write('Altitude: %4.0f ft \n' % (h))
        fid.write(
            'TOFL      CLIMB GRADIENT     THRUST    L/D     L/Dv2    CDasym    CDwindm     CL     CD  CG_CORRECT\n'
        )
        tofl = np.zeros(len(weights_tofl[j]))
        secsegclbgrad = np.zeros(len(weights_tofl[j]))
        thrust = np.zeros(len(weights_tofl[j]))
        l_over_d = np.zeros(len(weights_tofl[j]))
        l_over_d_v2 = np.zeros(len(weights_tofl[j]))
        asymmetry_drag_coefficient = np.zeros(len(weights_tofl[j]))
        windmilling_drag_coefficient = np.zeros(len(weights_tofl[j]))
        clv2 = np.zeros(len(weights_tofl[j]))
        cdv2 = np.zeros(len(weights_tofl[j]))
        secsegclbgrad_corrected = np.zeros(len(weights_tofl[j]))

        CLmax_ind = 0
        # configs.takeoff.maximum_lift_coefficient = maximum_lift_coefficient[CLmax_ind]
        configs.takeoff.wings[
            'main_wing'].flaps.angle = flaps[CLmax_ind] * Units.deg
        configs.takeoff.wings[
            'main_wing'].slats.angle = slats[CLmax_ind] * Units.deg

        for i, TOW in enumerate(weights_tofl[j]):
            configs.takeoff.mass_properties.takeoff = TOW * Units.kg
            tofl[i], secsegclbgrad[i], thrust[i], l_over_d[i], l_over_d_v2[i], asymmetry_drag_coefficient[i], \
            windmilling_drag_coefficient[i], clv2[i], cdv2[i], secsegclbgrad_corrected[
                i] = estimate_take_off_field_length(configs.takeoff,
                                                    analyses, airport,
                                                    clb_grad)
            if secsegclbgrad_corrected[i] < 0.024:
                # CLmax_ind = CLmax_ind + 1
                # if CLmax_ind > 1:
                #     CLmax_ind = 1
                print CLmax_ind, CLmax_ind, CLmax_ind, CLmax_ind, CLmax_ind, CLmax_ind

                configs.takeoff.wings[
                    'main_wing'].flaps.angle = flaps[CLmax_ind] * Units.deg
                configs.takeoff.wings[
                    'main_wing'].slats.angle = slats[CLmax_ind] * Units.deg

                tofl[i], secsegclbgrad[i], thrust[i], l_over_d[i], l_over_d_v2[i], asymmetry_drag_coefficient[i], \
                windmilling_drag_coefficient[i], clv2[i], cdv2[i], secsegclbgrad_corrected[
                    i] = estimate_take_off_field_length(configs.takeoff,
                                                        analyses, airport,
                                                        clb_grad)

            fid.write(
                '%4.2f     %4.4f    %4.4f    %4.4f    %4.4f    %4.4f    %4.4f    %4.4f    %4.4f    %4.4f \n'
                % (tofl[i], secsegclbgrad[i], thrust[i], l_over_d[i],
                   l_over_d_v2[i], asymmetry_drag_coefficient[i],
                   windmilling_drag_coefficient[i], clv2[i], cdv2[i],
                   secsegclbgrad_corrected[i]))
        fid.write('\n')

    fid.close()
    # ---------------------------------------------------------------------------------------
    # LANDING FIELD LENGTH
    # ---- Inputs
    airport.delta_isa = 0
    altitude = [0, 6000]
    weights_lfl = [[17000, 18000, 19000, 20000, 21000, 22000, 22350],
                   [17000, 18000, 19000, 20000, 21000, 22000, 22350]]

    flaps = [30., 15.]
    slats = [0., 0.]
    configs.landing.landing_constants = Data()

    configs.landing.landing_constants[0] = 250. * 0.25
    configs.landing.landing_constants[1] = 0.
    configs.landing.landing_constants[2] = 2.485 / 9.81

    configs.landing.wings['main_wing'].flaps.angle = flaps[0] * Units.deg
    configs.landing.wings['main_wing'].slats.angle = slats[0] * Units.deg

    configs.landing.max_lift_coefficient_factor = 1.31

    fid = open('LFL.txt', 'w')  # Open output file
    for j, h in enumerate(altitude):
        airport.altitude = h * Units.ft
        lfl = np.zeros(len(weights_lfl[j]))
        fid.write('Altitude: %4.0f ft \n' % (h))
        for i, TOW in enumerate(weights_lfl[j]):
            configs.landing.mass_properties.landing = TOW * Units.kg
            lfl[i] = estimate_landing_field_length(configs.landing, analyses,
                                                   airport)
            fid.write('%4.2f \n' % (lfl[i]))
        fid.write('\n')
    fid.close()

    return