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


Python Wing_param.build_wing方法代码示例

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


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

示例1: __init_wing_param

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
 def __init_wing_param(self):
     OC=OperatingCondition('cond1')
     OC.set_Mach(0.7)
     OC.set_AoA(3.0)
     OC.set_altitude(5000.)
     OC.set_T0_deg(20.)
     OC.set_P0(101325.)
     OC.set_humidity(0.)
     OC.compute_atmosphere()
     
     wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
     wing_param.build_wing()
     wing_param.set_value('span',34.1)
     wing_param.set_value('sweep',32.)
     wing_param.set_value('break_percent',33.)
     wing_param.set_value('root_chord',6.1)
     wing_param.set_value('break_chord',4.6)
     wing_param.set_value('tip_chord',1.5)
     wing_param.set_value('root_height',1.28)
     wing_param.set_value('break_height',0.97)
     wing_param.set_value('tip_height',0.33)
     wing_param.convert_to_design_variable('span',(10.,50.))
     wing_param.convert_to_design_variable('sweep',(0.,40.))
     wing_param.convert_to_design_variable('break_percent',(20.,40.))
     wing_param.convert_to_design_variable('root_chord',(5.,7.))
     wing_param.convert_to_design_variable('break_chord',(3.,5.))
     wing_param.convert_to_design_variable('tip_chord',(1.,2.))
     wing_param.convert_to_design_variable('root_height',(1.,1.5))
     wing_param.convert_to_design_variable('break_height',(0.8,1.2))
     wing_param.convert_to_design_variable('tip_height',(0.2,0.5))
     wing_param.build_linear_airfoil(OC, AoA0=-2., Cm0=-0.1, set_as_ref=True)
     wing_param.build_airfoils_from_ref()
     wing_param.update()
     
     return wing_param
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:37,代码来源:test_wing_param.py

示例2: test_Wing_param_update

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
 def test_Wing_param_update(self):
     OC=self.__init_OC()
     wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
     wing_param.build_wing()
     wing_param.set_value('span',34.1)
     wing_param.set_value('sweep',32.)
     wing_param.set_value('break_percent',33.)
     wing_param.set_value('root_chord',6.1)
     wing_param.set_value('break_chord',4.6)
     wing_param.set_value('tip_chord',1.5)
     wing_param.set_value('root_height',1.28)
     wing_param.set_value('break_height',0.97)
     wing_param.set_value('tip_height',0.33)
     wing_param.convert_to_design_variable('span',(10.,50.))
     wing_param.convert_to_design_variable('sweep',(0.,40.))
     wing_param.convert_to_design_variable('break_percent',(20.,40.))
     wing_param.convert_to_design_variable('root_chord',(5.,7.))
     wing_param.convert_to_design_variable('break_chord',(3.,5.))
     wing_param.convert_to_design_variable('tip_chord',(1.,2.))
     wing_param.convert_to_design_variable('root_height',(1.,1.5))
     wing_param.convert_to_design_variable('break_height',(0.8,1.2))
     wing_param.convert_to_design_variable('tip_height',(0.2,0.5))
     wing_param.build_linear_airfoil(OC, AoA0=-2., Cm0=-0.1, set_as_ref=True)
     wing_param.build_airfoils_from_ref()
     try:
         wing_param.update()
         ok=True
     except:
         ok=False
     assert(ok)
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:32,代码来源:test_wing_param.py

示例3: test_Wing_param_convert

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
 def test_Wing_param_convert(self):
     wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
     wing_param.build_wing()
     wing_param.set_value('span',34.1)
     wing_param.set_value('sweep',32.)
     wing_param.set_value('break_percent',33.)
     wing_param.set_value('root_chord',6.1)
     wing_param.set_value('break_chord',4.6)
     wing_param.set_value('tip_chord',1.5)
     wing_param.set_value('root_height',1.28)
     wing_param.set_value('break_height',0.97)
     wing_param.set_value('tip_height',0.33)
     try:
         wing_param.convert_to_design_variable('span',(10.,50.))
         wing_param.convert_to_design_variable('sweep',(0.,40.))
         wing_param.convert_to_design_variable('break_percent',(20.,40.))
         wing_param.convert_to_design_variable('root_chord',(5.,7.))
         wing_param.convert_to_design_variable('break_chord',(3.,5.))
         wing_param.convert_to_design_variable('tip_chord',(1.,2.))
         wing_param.convert_to_design_variable('root_height',(1.,1.5))
         wing_param.convert_to_design_variable('break_height',(0.8,1.2))
         wing_param.convert_to_design_variable('tip_height',(0.2,0.5))
         ok=True
     except:
         ok=False
     assert(ok)
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:28,代码来源:test_wing_param.py

示例4: test_Wing_param_build_wing

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
 def test_Wing_param_build_wing(self):
     wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
     try:
         wing_param.build_wing()
         ok=True
     except:
         ok=False
     assert(ok)
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:10,代码来源:test_wing_param.py

示例5: test_Wing_param_set_value

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
 def test_Wing_param_set_value(self):
     """
     test set value for Wing_param
     """
     wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
     wing_param.build_wing()
     try:
         wing_param.set_value('span',34.1)
         wing_param.set_value('sweep',32.)
         wing_param.set_value('break_percent',33.)
         wing_param.set_value('root_chord',6.1)
         wing_param.set_value('break_chord',4.6)
         wing_param.set_value('tip_chord',1.5)
         wing_param.set_value('root_height',1.28)
         wing_param.set_value('break_height',0.97)
         wing_param.set_value('tip_height',0.33)
         ok=True
     except:
         ok=False
     assert(ok)
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:22,代码来源:test_wing_param.py

示例6:

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
from MDOTools.OC.operating_condition import OperatingCondition
from MDOTools.ValidGrad.FDValidGrad import FDValidGrad
import numpy
import sys

OC=OperatingCondition('cond1')
OC.set_Mach(0.3)
OC.set_AoA(0.)
OC.set_altitude(3000.)
OC.set_T0_deg(15.)
OC.set_P0(101325.)
OC.set_humidity(0.)
OC.compute_atmosphere()

wing_param=Wing_param('test_param',geom_type='Broken',n_sect=20)
wing_param.build_wing()
wing_param.set_value('span',40.)
wing_param.set_value('sweep',0.)
wing_param.set_value('break_percent',33.)
wing_param.set_value('root_chord',1.0)
wing_param.set_value('break_chord',1.0)
wing_param.set_value('tip_chord',1.0)
wing_param.set_value('root_height',0.15)
wing_param.set_value('break_height',0.15)
wing_param.set_value('tip_height',0.15)
wing_param.build_linear_airfoil(OC, AoA0=0., Cm0=0.0, set_as_ref=True)
wing_param.build_airfoils_from_ref()
wing_param.update()

print wing_param
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:32,代码来源:Rect_sweep0.py

示例7: DLLMOpenMDAOComponent

# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import build_wing [as 别名]
class DLLMOpenMDAOComponent(Component):
    # set up interface to the framework
    # pylint: disable-msg=E1101
    # Outputs of lifting line problem
    """OpenMDAO component for DLLM implementation
    """
    
    Lift = Float(iotype='out', desc='Lift')
    Drag = Float(iotype='out', desc='Drag')
    Drag_Pressure = Float(iotype='out', desc='Drag_Pressure')
    Drag_Induced = Float(iotype='out', desc='Drag_Induced')
    Drag_Wave = Float(iotype='out', desc='Drag_Wave')
    Drag_Friction = Float(iotype='out', desc='Drag_Friction')
    Cd = Float(iotype='out', desc='Cd')
    Cdp = Float(iotype='out', desc='Cdp')
    Cdi = Float(iotype='out', desc='Cdi')
    Cdw = Float(iotype='out', desc='Cdw')
    Cdf = Float(iotype='out', desc='Cdf')
    Cl = Float(iotype='out', desc='Cl')
    LoD = Float(iotype='out', desc='LoD')
    Sref = Float(iotype='out', desc='Sref')

    # Design variables of lifting line problem
    rtwist = Array([], desc='rtwist', iotype="in")
    span = Float(desc='span', default_value=34., iotype="in")
    sweep = Float(desc='sweep', default_value=34., iotype="in")
    break_percent = Float(desc='break_percent', default_value=33., iotype="in")
    root_chord = Float(desc='root_chord', default_value=6.1, iotype="in")
    break_chord = Float(desc='break_chord', default_value=4.6, iotype="in")
    tip_chord = Float(desc='tip_chord', default_value=1.5, iotype="in")
    root_height = Float(desc='root_height', default_value=1.28, iotype="in")
    break_height = Float(desc='break_height', default_value=0.97, iotype="in")
    tip_height = Float(desc='tip_height', default_value=0.33, iotype="in")
    # Operating conditions variables
    Mach = Float(iotype='in', default_value=0.7, desc='Mach')
    altitude = Float(iotype='in', default_value=10000., desc='Altitude')
    T0 = Float(iotype='in',default_value=OperatingCondition.T0,
        desc='Ground ISA ref Temperature')
    P0 = Float(iotype='in',default_value=OperatingCondition.P0,
        desc='Ground ISA ref Pressure')

    def __init__(self,Target_Lift, N = 10, verbose=0):
        """Initialization of DLLM component.
        DLLM component use target lift capability of DLLM kernel
            @param Target_Lift : the targeted lift value (float)
            @param N : integer. Number of discrete section on 1/2 wing
            @param verbose : integer : verbosity level
        """
        try :
            float(Target_Lift)
        except:
            raise ValueError('You MUST define a float target lift value, get '+str(Target_Lift)+' instead.')

        self.Target_Lift = Target_Lift
        self.N = N
        self.OC = None
        self.rtwist = np.zeros(N)
        self.__display_wing_param = True
        self.__verbose = verbose
        self.__wing_param = None
        super(DLLMOpenMDAOComponent, self).__init__()        
        self.OC = OperatingCondition(tag='DLLMOC', atmospheric_model='ISA')
        self.__set_OC_values()
        self.__set_wing_param()
        self.__DLLM = DLLMTargetLift('test', self.__wing_param,
                                   self.OC, verbose=self.__verbose)
        self.__DLLM.set_target_Lift(Target_Lift)
        self.__DLLM.run_direct()
        self.__DLLM.run_post()

    def __set_wing_param(self, wing_param_name='test_param'):
        """Method for wing parameters setting : design variables initial values and bounds
        @param wing_param_name : wing parametrization names
        """
        self.__set_wing_param_values(wing_param_name=wing_param_name)

        self.__set_wing_param_bounds()
        self.__wing_param.build_linear_airfoil(self.OC, AoA0=-2., Cm0=-0.1, set_as_ref=True)
        self.__wing_param.build_airfoils_from_ref()
        self.__wing_param.update()

        if self.__display_wing_param:
            self.__display_wing_param = False
            print self.__wing_param

    def __set_wing_param_values(self, wing_param_name='test_param'):
        """Method for wing parameters variables setting
        @param wing_param_name : wing parametrization names
        """
        self.__wing_param = Wing_param(wing_param_name,
                                     geom_type='Broken', n_sect=self.N * 2)
        self.__wing_param.build_wing()
        for i in xrange(self.N):
            self.__wing_param.set_value('rtwist%s' % i, 0.)
        for param in Wing_param.DISCRETE_ATTRIBUTES_LIST:
            self.__wing_param.set_value(param, getattr(self, param))

    def __set_wing_param_bounds(self):
        """Method for desing variables bounds settings
        Values are set to inf/-inf in DLLM component and their 'real' bounds
#.........这里部分代码省略.........
开发者ID:FrancoisGallard,项目名称:DLLM,代码行数:103,代码来源:OpenMDAOWrapper.py


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