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


Python Data.aerodynamics方法代码示例

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


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

示例1: test

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import aerodynamics [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.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:designToolDeveloper,项目名称:SUAVE,代码行数:104,代码来源:test_aerodynamics.py

示例2: main

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import aerodynamics [as 别名]
def main():
    
    vehicle = vehicle_setup() # Create the vehicle for testing
    
    test_num = 11 # Length of arrays used in this test
    
    # --------------------------------------------------------------------
    # Test Lift Surrogate
    # --------------------------------------------------------------------    
    
    AoA = np.linspace(-.174,.174,test_num) # +- 10 degrees
    
    lift_model = vehicle.configs.cruise.aerodynamics_model.configuration.surrogate_models.lift_coefficient
    
    wing_lift = lift_model(AoA)
    
    wing_lift_r = np.array([-0.79420805, -0.56732369, -0.34043933, -0.11355497,  0.11332939,
                            0.34021374,  0.5670981 ,  0.79398246,  1.02086682,  1.24775117,
                            1.47463553])
    
    surg_test = np.abs((wing_lift-wing_lift_r)/wing_lift)
    
    print 'Surrogate Test Results \n'
    print surg_test
    
    assert(np.max(surg_test)<1e-4), 'Aero regression failed at surrogate test'

    
    # --------------------------------------------------------------------
    # Initialize variables needed for CL and CD calculations
    # Use a seeded random order for values
    # --------------------------------------------------------------------
    
    random.seed(1)
    Mc = np.linspace(0.05,0.9,test_num)
    random.shuffle(Mc)
    rho = np.linspace(0.3,1.3,test_num)
    random.shuffle(rho)
    mu = np.linspace(5*10**-6,20*10**-6,test_num)
    random.shuffle(mu)
    T = np.linspace(200,300,test_num)
    random.shuffle(T)
    pressure = np.linspace(10**5,10**6,test_num)

    
    conditions = Data()
    
    conditions.freestream = Data()
    conditions.freestream.mach_number = Mc
    conditions.freestream.density = rho
    conditions.freestream.viscosity = mu
    conditions.freestream.temperature = T
    conditions.freestream.pressure = pressure
    
    conditions.aerodynamics = Data()
    conditions.aerodynamics.angle_of_attack = AoA
    conditions.aerodynamics.lift_breakdown = Data()
    
    configuration = vehicle.configs.cruise.aerodynamics_model.configuration
    
    conditions.aerodynamics.drag_breakdown = Data()

    geometry = Data()
    for k in ['fuselages','wings','propulsors']:
        geometry[k] = deepcopy(vehicle[k])    
    geometry.reference_area = vehicle.reference_area  
    
    # --------------------------------------------------------------------
    # Test compute Lift
    # --------------------------------------------------------------------
    
    compute_aircraft_lift(conditions, configuration, None) # geometry is third variable, not used
    
    lift = conditions.aerodynamics.lift_breakdown.total
    lift_r = np.array([-2.07712357, -0.73495391, -0.38858687, -0.1405849 ,  0.22295808,
                       0.5075275 ,  0.67883681,  0.92787301,  1.40470556,  2.08126751,
                       1.69661601])
    
    lift_test = np.abs((lift-lift_r)/lift)
    
    print '\nCompute Lift Test Results\n'
    print lift_test
        
    assert(np.max(lift_test)<1e-4), 'Aero regression failed at compute lift test'    
    
    
    # --------------------------------------------------------------------
    # Test compute drag 
    # --------------------------------------------------------------------
    
    compute_aircraft_drag(conditions, configuration, geometry)
    
    # Pull calculated values
    drag_breakdown = conditions.aerodynamics.drag_breakdown
    
    # Only one wing is evaluated since they rely on the same function
    cd_c           = drag_breakdown.compressible['Main Wing'].compressibility_drag
    cd_i           = drag_breakdown.induced.total
    cd_m           = drag_breakdown.miscellaneous.total
    cd_m_fuse_base = drag_breakdown.miscellaneous.fuselage_base
#.........这里部分代码省略.........
开发者ID:spendres,项目名称:SUAVE,代码行数:103,代码来源:test_aerodynamics.py

示例3: __defaults__

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import aerodynamics [as 别名]
    def __defaults__(self):
        self.tag = 'Aerodynamic Segment'

        # atmosphere and planet
        self.planet     = None
        self.atmosphere = None
        self.start_time = time.gmtime()


        # --- Conditions and Unknowns

        # user shouldn't change these in an input script
        # only used for processing / post processing
        # they will be shared with analysis modules and meaningful naming is important

        # base matricies
        # use a trivial operation to copy the array
        ones_1col = np.ones([1,1])
        ones_2col = np.ones([1,2])
        ones_3col = np.ones([1,3])


        # --- Conditions

        # setup conditions
        conditions = Data()
        conditions.frames       = Data()
        conditions.freestream   = Data()
        conditions.aerodynamics = Data()
        conditions.propulsion   = Data()
        conditions.weights      = Data()
        conditions.energies     = Data()
        self.conditions = conditions

        # inertial frame conditions
        conditions.frames.inertial = Data()
        conditions.frames.inertial.position_vector      = ones_3col * 0
        conditions.frames.inertial.velocity_vector      = ones_3col * 0
        conditions.frames.inertial.acceleration_vector  = ones_3col * 0
        conditions.frames.inertial.gravity_force_vector = ones_3col * 0
        conditions.frames.inertial.total_force_vector   = ones_3col * 0
        conditions.frames.inertial.time                 = ones_1col * 0

        # wind frame conditions
        conditions.frames.wind = Data()
        conditions.frames.wind.body_rotations           = ones_3col * 0   # rotations in [X,Y,Z] -> [phi,theta,psi]
        conditions.frames.wind.velocity_vector          = ones_3col * 0
        conditions.frames.wind.lift_force_vector        = ones_3col * 0
        conditions.frames.wind.drag_force_vector        = ones_3col * 0
        conditions.frames.wind.transform_to_inertial    = np.empty([0,0,0])

        # body frame conditions
        conditions.frames.body = Data()
        conditions.frames.body.inertial_rotations       = ones_3col * 0    # rotations in [X,Y,Z] -> [phi,theta,psi]
        conditions.frames.body.thrust_force_vector      = ones_3col * 0
        conditions.frames.body.transform_to_inertial    = np.empty([0,0,0])

        # planet frame conditions
        conditions.frames.planet = Data()
        conditions.frames.planet.start_time      = None
        conditions.frames.planet.latitude        = ones_1col * 0
        conditions.frames.planet.longitude       = ones_1col * 0

        # freestream conditions
        conditions.freestream.velocity           = ones_1col * 0
        conditions.freestream.mach_number        = ones_1col * 0
        conditions.freestream.pressure           = ones_1col * 0
        conditions.freestream.temperature        = ones_1col * 0
        conditions.freestream.density            = ones_1col * 0
        conditions.freestream.speed_of_sound     = ones_1col * 0
        conditions.freestream.viscosity          = ones_1col * 0
        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  = ones_1col * 0
        conditions.aerodynamics.side_slip_angle  = ones_1col * 0
        conditions.aerodynamics.roll_angle       = ones_1col * 0
        conditions.aerodynamics.lift_coefficient = ones_1col * 0
        conditions.aerodynamics.drag_coefficient = ones_1col * 0
        conditions.aerodynamics.lift_breakdown   = Data()
        conditions.aerodynamics.drag_breakdown   = Data()

        # propulsion conditions
        conditions.propulsion.throttle           = ones_1col * 0
        conditions.propulsion.fuel_mass_rate     = ones_1col * 0
        conditions.propulsion.battery_energy     = ones_1col * 0
        conditions.propulsion.thrust_breakdown   = Data()

        # weights conditions
        conditions.weights.total_mass            = ones_1col * 0
        conditions.weights.weight_breakdown      = Data()

        # energy conditions
        conditions.energies.total_energy         = ones_1col * 0
        conditions.energies.total_efficiency     = ones_1col * 0
        conditions.energies.gravity_energy       = ones_1col * 0
        conditions.energies.propulsion_power     = ones_1col * 0
#.........这里部分代码省略.........
开发者ID:designToolDeveloper,项目名称:SUAVE,代码行数:103,代码来源:Aerodynamic_Segment.py


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