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


Python Data.mac方法代码示例

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


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

示例1: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mac [as 别名]
def main():

    # new units style
    a = 4 * Units.mm # convert into base units
    b = a / Units.mm # convert out of base units

    engine = Data()
    wing = Data()
    aircraft = Data()
    fuselage = Data()
    horizontal = Data()
    vertical = Data()

    # Parameters Required
    aircraft.Nult      = 1.5 * 2.5                       # Ultimate load
    aircraft.TOW       = 52300.  * Units.kilograms # Maximum takeoff weight in kilograms
    aircraft.zfw       = 42600. * Units.kilograms # Maximum zero fuel weight in kilograms
    aircraft.Nlim      = 2.5                       # Limit Load
    aircraft.num_eng   = 2.                        # Number of engines on the aircraft
    aircraft.num_pax   = 110.                      # Number of passengers
    aircraft.wt_cargo  = 0.  * Units.kilogram  # Mass of cargo
    aircraft.num_seats = 110.                      # Number of seats on aircraft
    aircraft.ctrl      = "partially powered"       # Specify fully powered, partially powered or anything else is fully aerodynamic
    aircraft.ac        = "medium-range"              # Specify what type of aircraft you have
    aircraft.w2h       = 16.     * Units.meters    # Length from the mean aerodynamic center of wing to mean aerodynamic center of the horizontal tail

    wing.gross_area    = 92.    * Units.meter**2  # Wing gross area in square meters
    wing.span          = 27.8     * Units.meter     # Span in meters
    wing.taper         = 0.28                       # Taper ratio
    wing.t_c           = 0.105                      # Thickness-to-chord ratio
    wing.sweep         = 23.5     * Units.deg       # sweep angle in degrees
    wing.c_r           = 5.4     * Units.meter     # Wing exposed root chord length
    wing.mac           = 12.     * Units.ft    # Length of the mean aerodynamic chord of the wing

    fuselage.area      = 320.      * Units.meter**2  # Fuselage wetted area 
    fuselage.diff_p    = 8.5     * Units.force_pound / Units.inches**2    # Maximum differential pressure
    fuselage.width     = 3.      * Units.meter     # Width of the fuselage
    fuselage.height    = 3.35    * Units.meter     # Height of the fuselage
    fuselage.length    = 36.24     * Units.meter     # Length of the fuselage

    engine.thrust_sls  = 18500.   * Units.force_pound    # Define Thrust in Newtons

    horizontal.area    = 26.     * Units.meters**2 # Area of the horizontal tail
    horizontal.span    = 12.08     * Units.meters    # Span of the horizontal tail
    horizontal.sweep   = 34.5     * Units.deg       # Sweep of the horizontal tail
    horizontal.mac     = 2.4      * Units.meters    # Length of the mean aerodynamic chord of the horizontal tail
    horizontal.t_c     = 0.11                      # Thickness-to-chord ratio of the horizontal tail
    horizontal.exposed = 0.9                         # Fraction of horizontal tail area exposed

    vertical.area      = 16.     * Units.meters**2 # Area of the vertical tail
    vertical.span      = 5.3     * Units.meters    # Span of the vertical tail
    vertical.t_c       = 0.12                      # Thickness-to-chord ratio of the vertical tail
    vertical.sweep     = 35.     * Units.deg       # Sweep of the vertical tail
    vertical.t_tail    = "no"                      # Set to "yes" for a T-tail

    aircraft.weight = Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)

    outputWeight(aircraft,'weight_EMB190.dat')
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:60,代码来源:test_weights_Embraer_190.py

示例2: import

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mac [as 别名]
from SUAVE.Core import Units
import numpy as np
from SUAVE.Core import (
    Data, Container, Data_Exception, Data_Warning,
)

import empty as empty

wing       = Data()
horizontal = Data()
vertical   = Data()
aircraft   = Data()

wing.sref   = 31.00
wing.span   = 34.10
wing.mac    = wing.sref/wing.span
wing.Nwr    = 2*41+22
wing.deltaw = (wing.span**2)/(wing.Nwr*wing.sref)
wing.t_c    = 0.128
wing.Nwer   = 10.

horizontal.area   = 10. #FAKE NUMBER!!!!!
horizontal.span   = wing.sref*((1.+3./16.)/9.)
horizontal.mac    = horizontal.area/horizontal.span
horizontal.Nwr    = 16.
horizontal.deltah = (horizontal.span**2)/(horizontal.Nwr*horizontal.area)
horizontal.t_c    = 0.12 # I have no idea

vertical.area   = 10. #FAKE NUMBER!!!!!
vertical.span   = wing.sref*((11./16.)/9.)
vertical.mac    = horizontal.area/horizontal.span
开发者ID:Aircraft-Design-UniNa,项目名称:SUAVE,代码行数:33,代码来源:test_human_powered_weights.py

示例3: print_parasite_drag

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mac [as 别名]
def print_parasite_drag(ref_condition,vehicle,analyses,filename = 'parasite_drag.dat'):
    """ SUAVE.Methods.Results.print_parasite_drag(ref_condition,vehicle,filename = 'parasite_drag.dat'):
        
        Print output file with parasite drag breakdown
        
        Inputs:
            ref_condition   - data dictionary with fields:
                mach_number     - Mach number to be used in the drag estimation
                reynolds_number - Reynolds number to be used in the drag estimation
                
            vehicle         - SUave type vehicle

            filename [optional] - Name of the file to be created

        Outputs:
            output file

        Assumptions:
            Altitude to be estimated, in order to have a condition with the Reynolds 
            and Mach number required

    """
    
    # Imports
    import time                     # importing library
    import datetime                 # importing library

    # Unpack
    Mc                      = ref_condition.mach_number
    Rey                     = ref_condition.reynolds_number
    mean_aerodynamic_chord  = vehicle.wings['main_wing'].chords.mean_aerodynamic
    aspect_ratio            = vehicle.wings['main_wing'].aspect_ratio
    sweep                   = vehicle.wings['main_wing'].sweep  / Units.deg
    t_c                     = vehicle.wings['main_wing'].thickness_to_chord
    taper                   = vehicle.wings['main_wing'].taper
    oswald                  = vehicle.wings['main_wing'].span_efficiency
    sref                    = vehicle.reference_area
    
    settings                = analyses.configs.cruise.aerodynamics.settings

    # Defining conditions to solve for altitude that gives the input Rey and Mach
    alt_conditions = Data()
    alt_conditions.Mc  = Mc
    alt_conditions.Rey = Rey
    alt_conditions.mac = mean_aerodynamic_chord
    # solve system
    altitude = fsolve( func  = solve_altitude  ,
                        x0   = 0.              ,
                        args = alt_conditions           )

    # compute atmosphere
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    p , T , rho , a , mew  = atmosphere.compute_values(altitude)

    # Define variables needed in the aerodynamic method
    state = Data()
    state.conditions = Data()
    state.conditions.freestream = Data()
    state.conditions.freestream.mach_number       = np.atleast_1d(Mc)
    state.conditions.freestream.density           = np.atleast_1d(rho)
    state.conditions.freestream.dynamic_viscosity = np.atleast_1d(mew)
    state.conditions.freestream.temperature       = np.atleast_1d(T)
    state.conditions.freestream.pressure          = np.atleast_1d(p)
    state.conditions.aerodynamics = Data()
    state.conditions.aerodynamics.drag_breakdown = Data()
    state.conditions.aerodynamics.drag_breakdown.parasite = Data()

    configuration = vehicle #.aerodynamics_model.configuration
    # call method    
##    parasite_drag_aircraft(state,settings,vehicle)
    
    compute = analyses.configs.cruise.aerodynamics.process.compute.drag
    for wing in vehicle.wings:
        compute.parasite.wings.wing(state,settings,wing)
    
    for fuselage in vehicle.fuselages:
        compute.parasite.fuselages.fuselage(state,settings,fuselage)    
        
    for propulsor in vehicle.propulsors:
        compute.parasite.propulsors.propulsor(state,settings,propulsor) 
      
    compute.parasite.pylons(state,settings,vehicle) 
    compute.miscellaneous(state,settings,vehicle)
    compute.parasite.total(state,settings,vehicle)
             
    # reynolds number
    Re_w = rho * Mc * a * mean_aerodynamic_chord/mew

    fid = open(filename,'w')   # Open output file
    fid.write('Output file with parasite drag breakdown\n\n') #Start output printing    
    fid.write( '  VEHICLE TAG : ' + vehicle.tag + '\n\n')
    fid.write( '  REFERENCE AREA .............. ' + str('%5.1f' %   sref               )   + ' m2 ' + '\n')
    fid.write( '  ASPECT RATIO ................ ' + str('%5.1f' %   aspect_ratio       )   + '    ' + '\n')
    fid.write( '  WING SWEEP .................. ' + str('%5.1f' %   sweep              )   + ' deg' + '\n')
    fid.write( '  WING THICKNESS RATIO ........ ' + str('%5.2f' %   t_c                )   + '    ' + '\n')
    fid.write( '  SPAN EFFICIENCY FACTOR ...... ' + str('%5.3f' %   oswald             )   + '    '  + '\n')
    fid.write( '  MEAN AEROD. CHORD ........... ' + str('%5.3f' %mean_aerodynamic_chord)   + ' m ' + '\n')
    fid.write( '  REYNOLDS NUMBER ............. ' + str('%5.1f' %   (Re_w / (10**6))   )   + ' millions' + '\n')
    fid.write( '  MACH NUMBER ................. ' + str('%5.3f' %   Mc                 )   + '    '  + '\n')

#.........这里部分代码省略.........
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:103,代码来源:print_parasite_drag.py

示例4: print_parasite_drag

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mac [as 别名]
def print_parasite_drag(ref_condition,vehicle,analyses,filename = 'parasite_drag.dat'):
    """This creates a file showing a breakdown of compressibility drag for the vehicle. Esimates
    altitude based on reference conditions.

    Assumptions:
    None

    Source:
    N/A

    Inputs:
    ref_condition.
      mach_number
      reynolds_number
    vehicle.wings.main_wing.
      chords.mean_aerodynamic
      aspect_ratio
      sweeps.quarter_chord     [-]
      thickness_to_chord
      taper
    vehicle.wings.*.
      tag                     <string>
    vehicle.reference_area    [m^2]
    analyses.configs.cruise.aerodynamics.settings    Used in called functions:
      compute.parasite.wings.wing(state,settings,wing)                (for all wings)
      compute.parasite.fuselages.fuselage(state,settings,fuselage)    (for all fuselages)
      compute.parasite.propulsors.propulsor(state,settings,propulsor) (for all propulsors)
      compute.parasite.pylons(state,settings,vehicle) 
      compute.miscellaneous(state,settings,vehicle)
      compute.parasite.total(state,settings,vehicle)
      compute.induced(state,settings,vehicle)    
        with compute = analyses.configs.cruise.aerodynamics.process.compute.drag
    filename                  Sets file name to save (optional)


    Outputs:
    filename                  Saved file with name as above

    Properties Used:
    N/A
    """        
    # Imports
    import time                     # importing library
    import datetime                 # importing library

    # Unpack
    Mc                      = ref_condition.mach_number
    Rey                     = ref_condition.reynolds_number
    mean_aerodynamic_chord  = vehicle.wings['main_wing'].chords.mean_aerodynamic
    aspect_ratio            = vehicle.wings['main_wing'].aspect_ratio
    sweep                   = vehicle.wings['main_wing'].sweeps.quarter_chord  / Units.deg
    t_c                     = vehicle.wings['main_wing'].thickness_to_chord
    taper                   = vehicle.wings['main_wing'].taper
    sref                    = vehicle.reference_area
    
    settings                = analyses.configs.cruise.aerodynamics.settings

    # Defining conditions to solve for altitude that gives the input Rey and Mach
    alt_conditions = Data()
    alt_conditions.Mc  = Mc
    alt_conditions.Rey = Rey
    alt_conditions.mac = mean_aerodynamic_chord
    # solve system
    altitude = fsolve( func  = solve_altitude  ,
                        x0   = 0.              ,
                        args = alt_conditions           )

    # compute atmosphere
    atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    atmo_data = atmosphere.compute_values(altitude)
    
    p   = atmo_data.pressure
    T   = atmo_data.temperature
    rho = atmo_data.density
    a   = atmo_data.speed_of_sound
    mu = atmo_data.dynamic_viscosity
    
    # Find the dimensional RE, ie. Reynolds number/length
    re = rho*Mc*a/mu

    # Define variables needed in the aerodynamic method
    state = Data()
    state.conditions = Data()
    state.conditions.freestream = Data()
    state.conditions.freestream.mach_number       = np.atleast_1d(Mc)
    state.conditions.freestream.density           = np.atleast_1d(rho)
    state.conditions.freestream.dynamic_viscosity = np.atleast_1d(mu)
    state.conditions.freestream.reynolds_number   = np.atleast_1d(re)
    state.conditions.freestream.temperature       = np.atleast_1d(T)
    state.conditions.freestream.pressure          = np.atleast_1d(p)
    state.conditions.aerodynamics = Data()
    state.conditions.aerodynamics.drag_breakdown = Data()
    state.conditions.aerodynamics.drag_breakdown.parasite = Data()

    # Compute parasite drag of components    
    compute = analyses.configs.cruise.aerodynamics.process.compute.drag
    for wing in vehicle.wings:
        compute.parasite.wings.wing(state,settings,wing)
    
    for fuselage in vehicle.fuselages:
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:print_parasite_drag.py


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