本文整理汇总了Python中SUAVE.Structure.Data.lift_force_vector方法的典型用法代码示例。如果您正苦于以下问题:Python Data.lift_force_vector方法的具体用法?Python Data.lift_force_vector怎么用?Python Data.lift_force_vector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Structure.Data
的用法示例。
在下文中一共展示了Data.lift_force_vector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import lift_force_vector [as 别名]
def __call__(self,conditions):
""" process vehicle to setup geometry, condititon and configuration
Inputs:
conditions - DataDict() of aerodynamic conditions
Outputs:
CL - array of lift coefficients, same size as alpha
CD - array of drag coefficients, same size as alpha
Assumptions:
linear intperolation surrogate model on Mach, Angle of Attack
and Reynolds number
locations outside the surrogate's table are held to nearest data
no changes to initial geometry or configuration
"""
# unpack
configuration = self.configuration
geometry = self.geometry
q = conditions.freestream.dynamic_pressure
Sref = geometry.reference_area
# lift needs to compute first, updates data needed for drag
CL = SUAVE.Methods.Aerodynamics.Supersonic_Zero.Lift.compute_aircraft_lift(conditions,configuration,geometry)
# drag computes second
CD = compute_aircraft_drag(conditions,configuration,geometry)
# pack conditions
conditions.aerodynamics.lift_coefficient = CL
conditions.aerodynamics.drag_coefficient = CD
# pack results
results = Data()
results.lift_coefficient = CL
results.drag_coefficient = CD
N = q.shape[0]
L = np.zeros([N,3])
D = np.zeros([N,3])
L[:,2] = ( -CL * q * Sref )[:,0]
D[:,0] = ( -CD * q * Sref )[:,0]
#if L.any < 0.0:
#k = 1
results.lift_force_vector = L
results.drag_force_vector = D
return results
示例2: __call__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import lift_force_vector [as 别名]
def __call__(self,conditions):
alpha = conditions.angle_of_attack
state = Data()
state.M = conditions.mach_number
state.rho = conditions.density
state.mew = conditions.viscosity
state.T = conditions.temperature
#state.q = conditions.dynamic_pressure
state.Sref = self.Sref
#N = state.M.shape[0]
##interpolation methods
#f_Cl = interp1d(self.aoa_range, self.Cl_a,bounds_error=False)
#Cl_inc=f_Cl(alpha)
##Cl_inc=self.f_Cl(alpha)
Cl_inc= self.CL0 + self.dCLdalpha*alpha
CL=Cl_inc/(numpy.sqrt(1-state.M**2))
#print 'alpha',alpha
#print 'Cl_inc',Cl_inc
#print 'CL',CL
#CD = self.CD0 + (CL**2)/(np.pi*self.AR*self.e) # parbolic drag
CD= self.drag(CL,state)
results = Data()
results.lift_coefficient = CL
results.drag_coefficient = CD
conditions.lift_coefficient = CL
conditions.drag_coefficient = CD
L = np.zeros([N,3])
D = np.zeros([N,3])
L[:,2] = ( -CL * state.q * state.Sref )[:,0]
D[:,0] = ( -CD * state.q * state.Sref )[:,0]
results.lift_force_vector = L
results.drag_force_vector = D
return [CL,CD]