当前位置: 首页>>代码示例>>Python>>正文


Python Data.freestream方法代码示例

本文整理汇总了Python中SUAVE.Core.Data.freestream方法的典型用法代码示例。如果您正苦于以下问题:Python Data.freestream方法的具体用法?Python Data.freestream怎么用?Python Data.freestream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SUAVE.Core.Data的用法示例。


在下文中一共展示了Data.freestream方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def main():
    
    # Setup and pack inputs, test several cases
    
    conditions = Data()
    conditions.frames = Data()
    conditions.frames.body = Data()    
    conditions.frames.planet = Data()
    conditions.frames.inertial = Data()
    conditions.freestream = Data()
    conditions.frames.body.inertial_rotations = np.zeros((4,3))
    conditions.frames.planet.start_time = time.strptime("Thu, Mar 20 12:00:00  2014", "%a, %b %d %H:%M:%S %Y",)
    conditions.frames.planet.latitude = np.array([[0.0],[35],[70],[0.0]])
    conditions.frames.planet.longitude = np.array([[0.0],[0.0],[0.0],[0.0]])
    conditions.frames.body.inertial_rotations[:,0] = np.array([0.0,np.pi/10,np.pi/5,0.0]) # Phi
    conditions.frames.body.inertial_rotations[:,1] = np.array([0.0,np.pi/10,np.pi/5,0.0]) # Theta
    conditions.frames.body.inertial_rotations[:,2] = np.array([0.0,np.pi/2,np.pi,0.0])    # Psi
    conditions.freestream.altitude = np.array([[600000.0],[0.0],[60000],[1000]])
    conditions.frames.inertial.time = np.array([[0.0],[0.0],[0.0],[43200]])
    
    # Call solar radiation
    rad = SUAVE.Components.Energy.Processes.Solar_Radiation()
    fluxes = rad.solar_radiation(conditions)
    
    print('Solar Fluxes')
    print fluxes
    truth_fluxes = [[ 1365.96369614],[  853.74651524],[  820.78323974],[    0.        ]]

    
    max_error =  np.max(np.abs(fluxes-truth_fluxes))
    
    assert( max_error < 1e-5 )
    
    return
开发者ID:Aircraft-Design-UniNa,项目名称:SUAVE,代码行数:36,代码来源:test_solar_radiation.py

示例2: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def main():
    
    # This script could fail if either the design or analysis scripts fail,
    # in case of failure check both. The design and analysis powers will 
    # differ because of karman-tsien compressibility corrections in the 
    # analysis scripts
    
    # Design the Propeller
    prop_attributes = Data()
    prop_attributes.number_blades       = 2.0 
    prop_attributes.freestream_velocity = 50.0
    prop_attributes.angular_velocity    = 2000.*(2.*np.pi/60.0)
    prop_attributes.tip_radius          = 1.5
    prop_attributes.hub_radius          = 0.05
    prop_attributes.design_Cl           = 0.7 
    prop_attributes.design_altitude     = 0.0 * Units.km
    prop_attributes.design_thrust       = 0.0
    prop_attributes.design_power        = 7000.
    prop_attributes                     = propeller_design(prop_attributes)    

    # Find the operating conditions
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    atmosphere_conditions =  atmosphere.compute_values(prop_attributes.design_altitude)
    
    V = prop_attributes.freestream_velocity
    
    conditions = Data()
    conditions.freestream = Data()
    conditions.propulsion = Data()
    conditions.freestream.update(atmosphere_conditions)
    conditions.freestream.dynamic_viscosity = atmosphere_conditions.dynamic_viscosity
    conditions.freestream.velocity = np.array([[V]])
    conditions.propulsion.throttle = np.array([[1.0]])
    
    # Create and attach this propeller
    prop                 = SUAVE.Components.Energy.Converters.Propeller()
    prop.prop_attributes = prop_attributes    
    prop.inputs.omega    = prop_attributes.angular_velocity
    
    F, Q, P, Cplast = prop.spin(conditions)
    
    # Truth values
    F_truth      = 166.41590262
    Q_truth      = 45.21732911
    P_truth      = 9470.2952633 # Over 9000!
    Cplast_truth = 0.00085898
    
    error = Data()
    error.Thrust  = np.max(np.abs(F-F_truth))
    error.Power   = np.max(np.abs(P-P_truth))
    error.Torque  = np.max(np.abs(Q-Q_truth))
    error.Cp      = np.max(np.abs(Cplast-Cplast_truth))   
    
    print 'Errors:'
    print  error
    
    for k,v in error.items():
        assert(np.abs(v)<0.001)
     
    return
开发者ID:Aircraft-Design-UniNa,项目名称:SUAVE,代码行数:62,代码来源:test_propeller.py

示例3: estimate_2ndseg_lift_drag_ratio

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def estimate_2ndseg_lift_drag_ratio(config):
    """Estimates the 2nd segment climb lift to drag ratio (all engine operating)
    
    Assumptions:
    All engines operating

    Source:
    Fig. 27.34 of "Aerodynamic Design of Transport Airplane" - Obert

    Inputs:
    config.
      V2_VS_ratio              [Unitless]
      wings.
        areas.reference        [m^2]
	spans.projected        [m]
	aspect_ratio           [Unitless]
      maximum_lift_coefficient [Unitless]

    Outputs:
    lift_drag_ratio            [Unitless]

    Properties Used:
    N/A
    """
    # ==============================================
	# Unpack
    # ==============================================
    try:
        V2_VS_ratio    = config.V2_VS_ratio
    except:
        V2_VS_ratio    = 1.20 # typical condition

    # getting geometrical data (aspect ratio)
    n_wing = 0
    for wing in config.wings:
        if not isinstance(wing,Wings.Main_Wing): continue
        reference_area = wing.areas.reference
        wing_span      = wing.spans.projected
        try:
            aspect_ratio = wing.aspect_ratio
        except:
            aspect_ratio = wing_span ** 2 / reference_area
        n_wing += 1

    if n_wing > 1:
        print(' More than one Main_Wing in the config. Last one will be considered.')
    elif n_wing == 0:
        print('No Main_Wing defined! Using the 1st wing found')
        for wing in config.wings:
            if not isinstance(wing,Wings.Wing): continue
            reference_area = wing.areas.reference
            wing_span      = wing.spans.projected
            try:
                aspect_ratio = wing.aspect_ratio
            except:
                aspect_ratio = wing_span ** 2 / reference_area
            break


    # Determining vehicle maximum lift coefficient
    try:   # aircraft maximum lift informed by user
        maximum_lift_coefficient = config.maximum_lift_coefficient
    except:
        # Using semi-empirical method for maximum lift coefficient calculation
        from SUAVE.Methods.Aerodynamics.Fidelity_Zero.Lift import compute_max_lift_coeff

        # Condition to CLmax calculation: 90KTAS @ 10000ft, ISA
        conditions = Data()
        conditions.freestream = Data()
        conditions.freestream.density           = 0.90477283
        conditions.freestream.dynamic_viscosity = 1.69220918e-05
        conditions.freestream.velocity          = 90. * Units.knots
        try:
            maximum_lift_coefficient, induced_drag_high_lift = compute_max_lift_coeff(config,conditions)
            config.maximum_lift_coefficient = maximum_lift_coefficient
        except:
            raise ValueError("Maximum lift coefficient calculation error. Please, check inputs")

    # Compute CL in V2
    lift_coeff = maximum_lift_coefficient / (V2_VS_ratio ** 2)

    # Estimate L/D in 2nd segment condition, ALL ENGINES OPERATIVE!
    lift_drag_ratio = -6.464 * lift_coeff + 7.264 * aspect_ratio ** 0.5

    return lift_drag_ratio
开发者ID:suavecode,项目名称:SUAVE,代码行数:87,代码来源:estimate_2ndseg_lift_drag_ratio.py

示例4: print_compress_drag

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def print_compress_drag(vehicle,filename = 'compress_drag.dat'):
    """ SUAVE.Methods.Results.print_compress_drag(vehicle,filename = 'compress_drag.dat'):
        
        Print output file with compressibility drag
        
        Inputs:
            vehicle         - SUave type vehicle
            filename [optional] - Name of the file to be created

        Outputs:
            output file

        Assumptions:

    """ 

    # Imports
    from SUAVE.Methods.Aerodynamics.Fidelity_Zero.Drag.compressibility_drag_wing import compressibility_drag_wing
    import time                     # importing library
    import datetime                 # importing library

    # Unpack
    sweep           = vehicle.wings['Main Wing'].sweep  / Units.deg
    t_c             = vehicle.wings['Main Wing'].thickness_to_chord
    sref            = vehicle.reference_area
    configuration   = vehicle.configs.cruise.aerodynamics_model.configuration 
    
    # Define mach and CL vectors    
    mach_vec                = np.linspace(0.45,0.95,11)
    cl_vec                  = np.linspace(0.30,0.80,11)    
    # allocating array for each wing
    cd_compress = Data()
    for idw,wing in enumerate(vehicle.wings):
        cd_compress[wing.tag] = np.zeros((len(mach_vec),len(cl_vec)))
    cd_compress_tot = np.zeros_like(cd_compress[0])        
    
    # Alocatting array necessary for the drag estimation method
    conditions = Data()
    conditions.freestream = Data()
    conditions.aerodynamics = Data()
    conditions.aerodynamics.lift_breakdown = Data()
    conditions.aerodynamics.drag_breakdown = Data()
    conditions.freestream.mach_number      = mach_vec  
    
    # write header of file
    fid = open(filename,'w')   # Open output file
    fid.write('Output file with compressibility drag breakdown\n\n') 
    fid.write('  VEHICLE TAG : ' + vehicle.tag + '\n\n')
    fid.write('  REFERENCE AREA .............. ' + str('%5.1f' %   sref               )   + ' m2 ' + '\n')
    fid.write('  WING SWEEP .................. ' + str('%5.1f' %   sweep              )   + ' deg' + '\n')
    fid.write('  WING THICKNESS RATIO ........ ' + str('%5.2f' %   t_c                )   + '    ' + '\n')
    fid.write(' \n')
    fid.write(' TOTAL COMPRESSIBILITY DRAG \n')
    fid.write(np.insert(np.transpose(map('M={:5.3f} | '.format,(mach_vec))),0,'  CL   |  '))
    fid.write('\n')

    # call aerodynamic method for each CL
    for idcl, cl in enumerate(cl_vec):
        conditions.aerodynamics.lift_breakdown.compressible_wings = np.atleast_1d(cl)
        # call method
        compressibility_drag_wing(conditions,configuration,vehicle)
        # process output for print
        drag_breakdown = conditions.aerodynamics.drag_breakdown.compressible
        for wing in vehicle.wings:
            cd_compress[wing.tag][:,idcl] =  drag_breakdown[wing.tag].compressibility_drag
            cd_compress_tot[:,idcl]      +=  drag_breakdown[wing.tag].compressibility_drag
        # print first the TOTAL COMPRESSIBILITY DRAG    
        fid.write(np.insert((np.transpose(map('{:7.5f} | '.format,(cd_compress_tot[:,idcl])))),0,' {:5.3f} |  '.format(cl)))
        fid.write('\n')
    fid.write( 119*'-' )
    # print results of other components
    for wing in vehicle.wings: 
        fid.write('\n ' + wing.tag.upper() + '\n')
        fid.write(np.insert(np.transpose(map('M={:5.3f} | '.format,(mach_vec))),0,'  CL   |  '))
        fid.write('\n')
        for idcl, cl in enumerate(cl_vec):
            fid.write(np.insert((np.transpose(map('{:7.5f} | '.format,(cd_compress[wing.tag][:,idcl])))),0,' {:5.3f} |  '.format(cl)))
            fid.write('\n')
        fid.write(119*'-')
    # close file
    fid.close
    # Print timestamp
    fid.write('\n\n' + datetime.datetime.now().strftime(" %A, %d. %B %Y %I:%M:%S %p"))
    
    #done! 
    return
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:88,代码来源:print_compress_drag.py

示例5: simple_sizing

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def simple_sizing(nexus):
    configs = nexus.vehicle_configurations
    base = configs.base

    # find conditions
    air_speed = nexus.missions.base.segments['cruise_2'].air_speed

    altitude = 18.5 * Units.km #nexus.missions.base.segments['climb_8'].altitude_end #FIXME

    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()

    freestream = atmosphere.compute_values(altitude)
    freestream0 = atmosphere.compute_values(6000. * Units.ft)  # cabin altitude

    diff_pressure = np.max(freestream0.pressure - freestream.pressure, 0)
    fuselage = base.fuselages['fuselage']
    fuselage.differential_pressure = diff_pressure

    # now size engine
    mach_number = air_speed / freestream.speed_of_sound

    # now add to freestream data object
    freestream.velocity = air_speed
    freestream.mach_number = mach_number
    freestream.gravity = 9.81

    conditions = SUAVE.Analyses.Mission.Segments.Conditions.Aerodynamics()  # assign conditions in form for propulsor sizing
    conditions.freestream = freestream
    # conditions.weights.vehicle_mass_rate = -200 * Units['kg/s']


    for config in configs:
        config.wings.horizontal_stabilizer.areas.reference = (26.0 / 92.0) * config.wings.main_wing.areas.reference

        for wing in config.wings:
            wing = SUAVE.Methods.Geometry.Two_Dimensional.Planform.wing_planform(wing)

            wing.areas.exposed = 0.8 * wing.areas.wetted
            wing.areas.affected = 0.6 * wing.areas.reference

        fuselage = config.fuselages['fuselage']
        fuselage.differential_pressure = diff_pressure

        turbofan_sizing(config.propulsors['turbofan'], mach_number, altitude)
        compute_turbofan_geometry(config.propulsors['turbofan'], conditions)

        # engine_length, nacelle_diameter, areas.wette
        # diff the new data
        config.store_diff()

    # ------------------------------------------------------------------
    #   Landing Configuration
    # ------------------------------------------------------------------
    landing = nexus.vehicle_configurations.landing
    landing_conditions = Data()
    landing_conditions.freestream = Data()

    # landing weight
    # landing.mass_properties.landing = 0.85 * config.mass_properties.takeoff

    # Landing CL_max
    altitude = nexus.missions.base.segments[-1].altitude_end
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    p, T, rho, a, mu = atmosphere.compute_values(altitude)
    landing_conditions.freestream.velocity = nexus.missions.base.segments['descent_final'].air_speed
    landing_conditions.freestream.density = rho
    landing_conditions.freestream.dynamic_viscosity = mu / rho
    CL_max_landing, CDi = compute_max_lift_coeff(landing, landing_conditions)
    landing.maximum_lift_coefficient = CL_max_landing
    # diff the new data
    landing.store_diff()

    # Takeoff CL_max
    takeoff = nexus.vehicle_configurations.takeoff
    takeoff_conditions = Data()
    takeoff_conditions.freestream = Data()
    altitude = nexus.missions.base.airport.altitude
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    p, T, rho, a, mu = atmosphere.compute_values(altitude)
    takeoff_conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
    takeoff_conditions.freestream.density = rho
    takeoff_conditions.freestream.dynamic_viscosity = mu / rho
    max_CL_takeoff, CDi = compute_max_lift_coeff(takeoff, takeoff_conditions)
    takeoff.maximum_lift_coefficient = max_CL_takeoff

    takeoff.store_diff()

    # Base config CL_max
    base = nexus.vehicle_configurations.base
    base_conditions = Data()
    base_conditions.freestream = Data()
    altitude = nexus.missions.base.airport.altitude
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    p, T, rho, a, mu = atmosphere.compute_values(altitude)
    base_conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
    base_conditions.freestream.density = rho
    base_conditions.freestream.dynamic_viscosity = mu / rho
    max_CL_base, CDi = compute_max_lift_coeff(base, base_conditions)
    base.maximum_lift_coefficient = max_CL_base
    base.store_diff()
#.........这里部分代码省略.........
开发者ID:martinjanssens,项目名称:suave_saga,代码行数:103,代码来源:Procedure.py

示例6: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]

#.........这里部分代码省略.........
     esc_forward.voltageout(conditions)       
     # link
     motor_forward.inputs.voltage = esc_forward.outputs.voltageout
     
     # Run the motor
     motor_forward.omega(conditions)
     # link
     propeller_forward.inputs.omega =  motor_forward.outputs.omega
     propeller_forward.thrust_angle = self.thrust_angle_forward   
     
     # Run the propeller
     F_forward, Q_forward, P_forward, Cp_forward = propeller_forward.spin(conditions)
         
     # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
     eta = conditions.propulsion.throttle[:,0,None]
     P_forward[eta>1.0] = P_forward[eta>1.0]*eta[eta>1.0]
     F_forward[eta>1.0] = F_forward[eta>1.0]*eta[eta>1.0]        
     
     # Run the motor for current
     motor_forward.current(conditions)  
     # link
     esc_forward.inputs.currentout =  motor_forward.outputs.current     
     
     # Run the esc
     esc_forward.currentin(conditions)        
    
     ###
     # Evaluate thrust from the lift propulsors
     ###
     
     # Make a new set of konditions, since there are differences for the esc and motor
     konditions                 = Data()
     konditions.propulsion      = Data()
     konditions.freestream      = Data()
     konditions.frames          = Data()
     konditions.frames.inertial = Data()
     konditions.frames.body     = Data()
     konditions.propulsion.throttle                    = conditions.propulsion.lift_throttle * 1.
     konditions.propulsion.propeller_power_coefficient = conditions.propulsion.propeller_power_coefficient_lift * 1.
     konditions.freestream.density                     = conditions.freestream.density * 1.
     konditions.freestream.velocity                    = conditions.freestream.velocity * 1.
     konditions.freestream.dynamic_viscosity           = conditions.freestream.dynamic_viscosity * 1.
     konditions.freestream.speed_of_sound              = conditions.freestream.speed_of_sound *1.
     konditions.freestream.temperature                 = conditions.freestream.temperature * 1.
     konditions.frames.inertial.velocity_vector        = conditions.frames.inertial.velocity_vector *1.
     konditions.frames.body.transform_to_inertial      = conditions.frames.body.transform_to_inertial
     
     # Throttle the voltage
     esc_lift.voltageout(konditions)       
     # link
     motor_lift.inputs.voltage = esc_lift.outputs.voltageout
     
     # Run the motor
     motor_lift.omega(konditions)
     # link
     propeller_lift.inputs.omega =  motor_lift.outputs.omega
     propeller_lift.thrust_angle = self.thrust_angle_lift
     
     # Run the propeller
     F_lift, Q_lift, P_lift, Cp_lift = propeller_lift.spin(konditions)
         
     # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
     eta = state.conditions.propulsion.lift_throttle
     P_lift[eta>1.0] = P_lift[eta>1.0]*eta[eta>1.0]
     F_lift[eta>1.0] = F_lift[eta>1.0]*eta[eta>1.0]        
     
开发者ID:suavecode,项目名称:SUAVE,代码行数:69,代码来源:Lift_Forward_Propulsor.py

示例7: Data

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
    #  Fuselage
    # ------------------------------------------------------------------

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

    fuselage.number_coach_seats = 114  #
    fuselage.seat_pitch         = 0.7455    # m
    fuselage.seats_abreast      = 4    #
    fuselage.fineness.nose      = 2.0  #
    fuselage.fineness.tail      = 3.0  #
    fuselage.fwdspace           = 0    #
    fuselage.aftspace           = 0    #
    fuselage.width              = 3.0  #
    fuselage.heights.maximum    = 3.4  #

    # add to vehicle
    vehicle.append_component(fuselage)

    conditions = Data()
    conditions.freestream = Data()
    conditions.freestream.mach_number = 0.3
    conditions.freestream.velocity    = 51. #m/s
    conditions.freestream.density     = 1.1225 #kg/m?
    conditions.freestream.dynamic_viscosity   = 1.79E-05


    Cl_max_ls, Cd_ind = compute_max_lift_coeff(vehicle,conditions)
    print 'CLmax : ', Cl_max_ls, 'dCDi :' , Cd_ind

开发者ID:Aircraft-Design-UniNa,项目名称:SUAVE,代码行数:31,代码来源:compute_max_lift_coeff.py

示例8: estimate_2ndseg_lift_drag_ratio

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def estimate_2ndseg_lift_drag_ratio(config):
    """ SUAVE.Methods.Aerodynamics.Drag.Correlations.estimate_2ndseg_lift_drag_ratio(config):
        Estimates the 2nd segment Lift to drag ration (all engine operating)
        Inputs:
            config   - data dictionary with fields:
                reference_area             - Airplane reference area
                V2_VS_ratio                - Ratio between V2 and Stall speed
                                             [optional. Default value = 1.20]
                Main_Wing.aspect_ratio     - Main_Wing aspect ratio
                maximum_lift_coefficient   - Maximum lift coefficient for the config
                                             [Calculated if not informed]

        Outputs:
            takeoff_field_length            - Takeoff field length

        Assumptions:
            All engines Operating. Must be corrected for second segment climb configuration
            reference: Fig. 27.34 of "Aerodynamic Design of Transport Airplane" - Obert

"""
    # ==============================================
	# Unpack
    # ==============================================
    try:
        V2_VS_ratio    = config.V2_VS_ratio
    except:
        V2_VS_ratio    = 1.20 # typical condition

    # getting geometrical data (aspect ratio)
    n_wing = 0
    for wing in config.wings:
        if not isinstance(wing,Wings.Main_Wing): continue
        reference_area = wing.areas.reference
        wing_span      = wing.spans.projected
        try:
            aspect_ratio = wing.aspect_ratio
        except:
            aspect_ratio = wing_span ** 2 / reference_area
        n_wing += 1

    if n_wing > 1:
        print ' More than one Main_Wing in the config. Last one will be considered.'
    elif n_wing == 0:
        print  'No Main_Wing defined! Using the 1st wing found'
        for wing in config.wings:
            if not isinstance(wing,Wings.Wing): continue
            reference_area = wing.areas.reference
            wing_span      = wing.spans.projected
            try:
                aspect_ratio = wing.aspect_ratio
            except:
                aspect_ratio = wing_span ** 2 / reference_area
            break


    # Determining vehicle maximum lift coefficient
    try:   # aircraft maximum lift informed by user
        maximum_lift_coefficient = config.maximum_lift_coefficient
    except:
        # Using semi-empirical method for maximum lift coefficient calculation
        from SUAVE.Methods.Aerodynamics.Fidelity_Zero.Lift import compute_max_lift_coeff

        # Condition to CLmax calculation: 90KTAS @ 10000ft, ISA
        conditions = Data()
        conditions.freestream = Data()
        conditions.freestream.density           = 0.90477283
        conditions.freestream.dynamic_viscosity = 1.69220918e-05
        conditions.freestream.velocity          = 90. * Units.knots
        try:
            maximum_lift_coefficient, induced_drag_high_lift = compute_max_lift_coeff(config,conditions)
            config.maximum_lift_coefficient = maximum_lift_coefficient
        except:
            raise ValueError, "Maximum lift coefficient calculation error. Please, check inputs"

    # Compute CL in V2
    lift_coeff = maximum_lift_coefficient / (V2_VS_ratio ** 2)

    # Estimate L/D in 2nd segment condition, ALL ENGINES OPERATIVE!
    lift_drag_ratio = -6.464 * lift_coeff + 7.264 * aspect_ratio ** 0.5

    return lift_drag_ratio
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:83,代码来源:estimate_2ndseg_lift_drag_ratio.py

示例9: estimate_clmax

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def estimate_clmax(nexus):
    
    # Condition to CLmax calculation: 90KTAS @ 10000ft, ISA
    conditions = Data()
    conditions.freestream = Data()
    conditions.freestream.density           = 0.90477283
    conditions.freestream.dynamic_viscosity = 1.69220918e-05
    conditions.freestream.velocity          = 90. * Units.knots
    
    #Takeoff CL_max
    config = nexus.vehicle_configurations.takeoff
    maximum_lift_coefficient,CDi = compute_max_lift_coeff(config,conditions) 
    config.maximum_lift_coefficient = maximum_lift_coefficient 
    # diff the new data
    config.store_diff()  
    
    #Takeoff CL_max - for short field config
    config = nexus.vehicle_configurations.short_field_takeoff
    maximum_lift_coefficient,CDi = compute_max_lift_coeff(config,conditions) 
    config.maximum_lift_coefficient = maximum_lift_coefficient 
    # diff the new data
    config.store_diff()  
        
    # compute V2 speed for noise, based in MTOW   
    config = nexus.vehicle_configurations.takeoff       
    weight = config.mass_properties.max_takeoff
    reference_area = config.wings.main_wing.areas.reference
    max_CL_takeoff = config.maximum_lift_coefficient
    stall_speed = (2 * 9.81 * weight / (1.225 * reference_area * max_CL_takeoff)) ** 0.5
    V2_speed    = 1.20 * stall_speed            
    speed_for_noise = V2_speed + nexus.noise_V2_increase
    
    #nexus.missions.takeoff_initialization.segments.climb.air_speed   = speed_for_noise    
    nexus.missions.takeoff.segments.climb.air_speed          = speed_for_noise
    nexus.missions.takeoff.segments.cutback.air_speed        = speed_for_noise
    nexus.missions.sideline_takeoff.segments.climb.air_speed = speed_for_noise
    
    # ------------------------------------------------------------------
    #   Landing Configuration
    # ------------------------------------------------------------------
    landing = nexus.vehicle_configurations.landing
    landing_conditions = Data()
    landing_conditions.freestream = Data()

    # landing weight
    landing.mass_properties.takeoff = 0.85 * config.mass_properties.takeoff
    landing.mass_properties.landing = 0.85 * config.mass_properties.takeoff
      
    # Landing CL_max
    maximum_lift_coefficient,CDi = compute_max_lift_coeff(landing,conditions) 
    landing.maximum_lift_coefficient = maximum_lift_coefficient 
    
    # compute approach speed
    weight = landing.mass_properties.landing
    stall_speed = (2 * 9.81 * weight / (1.225 * reference_area * maximum_lift_coefficient)) ** 0.5
    Vref_speed  = 1.23 * stall_speed  
    nexus.missions.landing.segments.descent.air_speed   = Vref_speed  + 10. * Units.knots    
    
    # diff the new data
    landing.store_diff()      
    
    return nexus
开发者ID:michK,项目名称:SUAVE,代码行数:64,代码来源:Procedure.py

示例10: simple_sizing

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]
def simple_sizing(nexus):
    configs    = nexus.vehicle_configurations
    analyses   = nexus.analyses
    base       = configs.base

    
    
    m_guess                            = nexus.m_guess #take in sizing inputs
    base.mass_properties.max_takeoff   = m_guess
 
    #find conditions
    air_speed   = nexus.missions.base.segments['cruise'].air_speed 
    altitude    = nexus.missions.base.segments['climb_3'].altitude_end
    atmosphere  = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    freestream  = atmosphere.compute_values(altitude)
    freestream0 = atmosphere.compute_values(6000.*Units.ft)  #cabin altitude
    
    
    diff_pressure                  = np.max(freestream0.pressure-freestream.pressure,0)
    fuselage                       = base.fuselages['fuselage']
    fuselage.differential_pressure = diff_pressure 
    
    #now size engine
    mach_number        = air_speed/freestream.speed_of_sound
    
    #now add to freestream data object
    freestream.velocity    = air_speed
    freestream.mach_number = mach_number
    freestream.gravity     = 9.81
    
    conditions             = SUAVE.Analyses.Mission.Segments.Conditions.Aerodynamics()   #assign conditions in form for propulsor sizing
    conditions.freestream  = freestream
    
    nose_load_fraction     = .06
   
    #now evaluate all of the vehicle configurations
    for config in configs:
        config.wings.horizontal_stabilizer.areas.reference = (26.0/92.0)*config.wings.main_wing.areas.reference
         
         
        for wing in config.wings:
            
            wing = SUAVE.Methods.Geometry.Two_Dimensional.Planform.wing_planform(wing)
            
            wing.areas.exposed  = 0.8 * wing.areas.wetted
            wing.areas.affected = 0.6 * wing.areas.reference
            


        fuselage                       = config.fuselages['fuselage']
        fuselage.differential_pressure = diff_pressure 
     
        #now evaluate weights

        # diff the new data
        
        config.mass_properties.max_takeoff     = m_guess #take in parameters
        config.mass_properties.takeoff         = m_guess 
        config.mass_properties.max_zero_fuel   = base.mass_properties.max_zero_fuel
        config.store_diff()
       
       
    #now evaluate the weights   
    weights = analyses.base.weights.evaluate() #base.weights.evaluate()  
    #update zfw
    empty_weight       = base.mass_properties.operating_empty
    payload            = base.mass_properties.max_payload
    zfw                = empty_weight + payload 
    
    base.max_zero_fuel = zfw  
    base.store_diff()
    for config in configs:
        config.pull_base()
    # ------------------------------------------------------------------
    #   Landing Configuration
    # ------------------------------------------------------------------
    landing = nexus.vehicle_configurations.landing
    landing_conditions = Data()
    landing_conditions.freestream = Data()

    # landing weight
    landing.mass_properties.landing = base.mass_properties.max_zero_fuel
    
    # Landing CL_max
    altitude                                         = nexus.missions.base.segments[-1].altitude_end
    atmosphere                                       = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    
    freestream             = atmosphere.compute_values(altitude)
    mu                     = freestream.dynamic_viscosity
    rho                    = freestream.density

    landing_conditions.freestream.velocity           = nexus.missions.base.segments['descent_3'].air_speed
    landing_conditions.freestream.density            = rho
    landing_conditions.freestream.dynamic_viscosity  = mu/rho
    CL_max_landing,CDi                               = compute_max_lift_coeff(landing,landing_conditions)
    landing.maximum_lift_coefficient                 = CL_max_landing
    # diff the new data
    landing.store_diff()
    
    
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:sizing_loop.py

示例11: test

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import freestream [as 别名]

#.........这里部分代码省略.........
    #Wing2.Cl        = 0.2
    Wing2.e          = 0.9
    Wing2.twist_rc   = 3.0*numpy.pi/180
    Wing2.twist_tc   = 0.0*numpy.pi/180   
  
    aircraft.append_component(Wing2)
    
    
    Wing3=Wing(tag = 'Wing3')
        
    Wing3.sref      = 32.488
    Wing3.ar        = 1.91
    Wing3.span      = 7.877
    Wing3.sweep     = 0.0*numpy.pi/180
    Wing3.symmetric = False
    Wing3.t_c       = 0.08
    Wing3.taper     = 0.25
       
    wing_planform(Wing3)
    
    Wing3.chord_mac  = 8.0
    Wing3.S_exposed  = 0.8*Wing3.area_wetted
    Wing3.S_affected = 0.6*Wing3.area_wetted     
    #Wing3.Cl        = 0.002  
    Wing3.e          = 0.9
    Wing3.twist_rc   = 0.0*numpy.pi/180
    Wing3.twist_tc   = 0.0*numpy.pi/180   
    Wing3.vertical   = True
        
    aircraft.append_component(Wing3)
   
   
    fus=Fuselage(tag = 'fuselage1')
    
    fus.num_coach_seats = 200
    fus.seat_pitch      = 1
    fus.seats_abreast   = 6
    fus.fineness_nose   = 1.6
    fus.fineness_tail   =  2
    fus.fwdspace        = 6
    fus.aftspace        = 5
    fus.width           = 4
    fus.height          = 4   
    
    fuselage_planform(fus)
    
    aircraft.append_component(fus)

    turbofan=Turbofan()
    turbofan.nacelle_dia= 4.0
    aircraft.append_component(turbofan)

    wing_aero = SUAVE.Attributes.Aerodynamics.Fidelity_Zero()
    wing_aero.initialize(aircraft)
    aircraft.Aerodynamics = wing_aero 


    Seg=Base_Segment()
    Seg.p   = 23900.0            # Pa
    Seg.T   = 218.0            # K
    Seg.rho = 0.41          # kg/m^3
    Seg.mew = 1.8*10**-5          # Ps-s
    Seg.M   = 0.8            # dimensionless


    
    conditions = Data()
    conditions.freestream   = Data()
    conditions.aerodynamics = Data()

    # freestream conditions
    #conditions.freestream.velocity           = ones_1col * 0
    conditions.freestream.mach_number        = Seg.M
    conditions.freestream.pressure           = Seg.p   
    conditions.freestream.temperature        = Seg.T  
    conditions.freestream.density            = Seg.rho
    #conditions.freestream.speed_of_sound     = ones_1col * 0
    conditions.freestream.dynamic_viscosity          = Seg.mew
    #conditions.freestream.altitude           = ones_1col * 0
    #conditions.freestream.gravity            = ones_1col * 0
    #conditions.freestream.reynolds_number    = ones_1col * 0
    #conditions.freestream.dynamic_pressure   = ones_1col * 0
    
    # aerodynamics conditions
    conditions.aerodynamics.angle_of_attack  = 0.  
    conditions.aerodynamics.side_slip_angle  = 0.
    conditions.aerodynamics.roll_angle       = 0.
    conditions.aerodynamics.lift_coefficient = 0.
    conditions.aerodynamics.drag_coefficient = 0.
    conditions.aerodynamics.lift_breakdown   = Data()
    conditions.aerodynamics.drag_breakdown   = Data()

    
    [Cl,Cd]=aircraft.Aerodynamics(conditions)
  
    print 'Aerodynamics module test script'
    print 'aircraft Cl' , Cl
    print 'aircraft Cd' , Cd
  
    return
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:104,代码来源:test_aerodynamics.py


注:本文中的SUAVE.Core.Data.freestream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。