本文整理汇总了Python中DLLM.DLLMGeom.wing_param.Wing_param.convert_to_design_variable方法的典型用法代码示例。如果您正苦于以下问题:Python Wing_param.convert_to_design_variable方法的具体用法?Python Wing_param.convert_to_design_variable怎么用?Python Wing_param.convert_to_design_variable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DLLM.DLLMGeom.wing_param.Wing_param
的用法示例。
在下文中一共展示了Wing_param.convert_to_design_variable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init_wing_param
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [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
示例2:
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [as 别名]
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',34.)
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()
print wing_param
x0=wing_param.get_dv_array()
示例3: test_Wing_param_update
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [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)
示例4: test_Wing_param_convert
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [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)
示例5: Wing_param
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [as 别名]
OC.set_P0(101325.0)
OC.set_humidity(0.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", 34.0)
wing_param.set_value("break_percent", 33.0)
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", (0.0, 50.0))
wing_param.convert_to_design_variable("sweep", (0.0, 40.0))
wing_param.convert_to_design_variable("break_percent", (20.0, 40.0))
wing_param.convert_to_design_variable("root_chord", (5.0, 7.0))
wing_param.convert_to_design_variable("break_chord", (3.0, 5.0))
wing_param.convert_to_design_variable("tip_chord", (1.0, 2.0))
wing_param.convert_to_design_variable("root_height", (1.0, 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.0, Cm0=-0.1, set_as_ref=True)
wing_param.build_airfoils_from_ref()
wing_param.update()
print wing_param
示例6: Wing_param
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [as 别名]
OC.set_P0(101325.0)
OC.set_humidity(0.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) # 34.1
wing_param.set_value("sweep", 34.0)
wing_param.set_value("break_percent", 23.0) # 33.
wing_param.set_value("root_chord", 5.4) # 6.1
wing_param.set_value("break_chord", 4.6)
wing_param.set_value("tip_chord", 1.2) # 1.5
wing_param.set_value("root_height", 0.98)
wing_param.set_value("break_height", 0.70)
wing_param.set_value("tip_height", 0.18)
wing_param.convert_to_design_variable("span", (10.0, 50.0))
wing_param.convert_to_design_variable("sweep", (0.0, 40.0))
wing_param.convert_to_design_variable("break_percent", (20.0, 40.0))
wing_param.convert_to_design_variable("root_chord", (5.0, 7.0))
wing_param.convert_to_design_variable("break_chord", (3.0, 5.0))
wing_param.convert_to_design_variable("tip_chord", (1.0, 2.0))
wing_param.convert_to_design_variable("root_height", (0.7, 1.0))
wing_param.convert_to_design_variable("break_height", (0.45, 0.8))
wing_param.convert_to_design_variable("tip_height", (0.10, 0.26))
# wing_param.build_linear_airfoil(OC, AoA0=-2., Cm0=-0.1, set_as_ref=True)
wing_param.build_meta_airfoil(
OC, "../MetaModelCleaning.xml", relative_thickness=0.12, camber=0.0, Sref=1.0, Lref=1.0, sweep=0.0, set_as_ref=True
)
wing_param.build_airfoils_from_ref()
wing_param.update()
示例7: DLLMOpenMDAOComponent
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import convert_to_design_variable [as 别名]
#.........这里部分代码省略.........
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
are defined when optimization problem is set
"""
for i in xrange(self.N):
self.__wing_param.convert_to_design_variable(
'rtwist%s' % i, (-float('inf'), float('inf')))
for param in Wing_param.DISCRETE_ATTRIBUTES_LIST:
self.__wing_param.convert_to_design_variable(param, (-float('inf'), float('inf')))
return
def __set_OC_values(self):
""" Set default operating conditions"""
self.OC.set_Mach(self.Mach)
self.OC.set_altitude(self.altitude)
self.OC.set_T0(self.T0)
self.OC.set_P0(self.P0)
self.OC.set_humidity(0.)
self.OC.compute_atmosphere()
def __update_wing_parame_values(self):
for dv_id in self.__wing_param.get_dv_id_list():
if dv_id.startswith('rtwist'):
i_twist = int(dv_id.replace('rtwist', ''))
self.__wing_param.set_value(dv_id, self.rtwist[i_twist])
else:
self.__wing_param.set_value(dv_id,getattr(self,dv_id))
self.__wing_param.build_linear_airfoil(self.OC, AoA0=-2., Cm0=-0.1, set_as_ref=True)
self.__set_wing_param_bounds()
self.__wing_param.build_airfoils_from_ref()
self.__wing_param.update()
return
def execute(self):
""" Perform a DLLM computation with the """
self.__update_wing_parame_values()
self.__set_OC_values()
self.__DLLM.set_target_Lift(self.Target_Lift)