本文整理汇总了Python中SUAVE.Structure.Data.mew方法的典型用法代码示例。如果您正苦于以下问题:Python Data.mew方法的具体用法?Python Data.mew怎么用?Python Data.mew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Structure.Data
的用法示例。
在下文中一共展示了Data.mew方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import mew [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]
示例2: estimate_landing_field_length
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import mew [as 别名]
def estimate_landing_field_length(vehicle,config,airport):
""" SUAVE.Methods.Performance.estimate_landing_field_length(vehicle,config,airport):
Computes the landing field length for a given vehicle condition in a given airport
Inputs:
vehicle - SUAVE type vehicle
config - data dictionary with fields:
Mass_Props.m_landing - Landing weight to be evaluated
S - Wing Area
Vref_VS_ratio - Ratio between Approach Speed and Stall speed
[optional. Default value = 1.23]
maximum_lift_coefficient - Maximum lift coefficient for the config
[optional. Calculated if not informed]
airport - SUAVE type airport data, with followig fields:
atmosphere - Airport atmosphere (SUAVE type)
altitude - Airport altitude
delta_isa - ISA Temperature deviation
Outputs:
landing_field_length - Landing field length
Assumptions:
- Landing field length calculated according to Torenbeek, E., "Advanced
Aircraft Design", 2013 (equation 9.25)
- Considering average aav/g values of two-wheel truck (0.40)
"""
# ==============================================
# Unpack
# ==============================================
atmo = airport.atmosphere
altitude = airport.altitude * Units.ft
delta_isa = airport.delta_isa
weight = config.Mass_Props.m_landing
reference_area = config.S
try:
Vref_VS_ratio = config.Vref_VS_ratio
except:
Vref_VS_ratio = 1.23
# ==============================================
# Computing atmospheric conditions
# ==============================================
p0, T0, rho0, a0, mew0 = atmo.compute_values(0)
p , T , rho , a , mew = atmo.compute_values(altitude)
T_delta_ISA = T + delta_isa
sigma_disa = (p/p0) / (T_delta_ISA/T0)
rho = rho0 * sigma_disa
a_delta_ISA = atmo.gas.compute_speed_of_sound(T_delta_ISA)
mew = 1.78938028e-05 * ((T0 + 120) / T0 ** 1.5) * ((T_delta_ISA ** 1.5) / (T_delta_ISA + 120))
sea_level_gravity = atmo.planet.sea_level_gravity
# ==============================================
# Determining vehicle maximum lift coefficient
# ==============================================
try: # aircraft maximum lift informed by user
maximum_lift_coefficient = config.maximum_lift_coefficient
except:
# Using semi-empirical method for maximum lift coefficient calculation
from SUAVE.Methods.Aerodynamics.Lift.High_lift_correlations import compute_max_lift_coeff
# Condition to CLmax calculation: 90KTAS @ 10000ft, ISA
p_stall , T_stall , rho_stall , a_stall , mew_stall = atmo.compute_values(10000. * Units.ft)
conditions = Data()
conditions.rho = rho_stall
conditions.mew = mew_stall
conditions.V = 90. * Units.knots
try:
maximum_lift_coefficient, induced_drag_high_lift = compute_max_lift_coeff(config,conditions)
config.maximum_lift_coefficient = maximum_lift_coefficient
except:
raise ValueError, "Maximum lift coefficient calculation error. Please, check inputs"
# ==============================================
# Computing speeds (Vs, Vref)
# ==============================================
stall_speed = (2 * weight * sea_level_gravity / (rho * reference_area * maximum_lift_coefficient)) ** 0.5
Vref = stall_speed * Vref_VS_ratio
# ========================================================================================
# Computing landing distance, according to Torenbeek equation
# Landing Field Length = k1 + k2 * Vref**2
# ========================================================================================
# Defining landing distance equation coefficients
try:
landing_constants = config.landing_constants # user defined
except: # default values - According to Torenbeek book
landing_constants = np.zeros(3)
landing_constants[0] = 250.
landing_constants[1] = 0.
landing_constants[2] = 2.485 / sea_level_gravity # Two-wheels truck : [ (1.56 / 0.40 + 1.07) / (2*sea_level_gravity) ]
## landing_constants[2] = 2.9725 / sea_level_gravity # Four-wheels truck: [ (1.56 / 0.32 + 1.07) / (2*sea_level_gravity) ]
# Calculating landing field length
landing_field_length = 0.
#.........这里部分代码省略.........
示例3: estimate_take_off_field_length
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import mew [as 别名]
def estimate_take_off_field_length(vehicle,config,airport):
""" SUAVE.Methods.Performance.estimate_take_off_field_length(vehicle,config,airport):
Computes the takeoff field length for a given vehicle condition in a given airport
Inputs:
vehicle - SUAVE type vehicle
config - data dictionary with fields:
Mass_Props.m_takeoff - Takeoff weight to be evaluated
S - Wing Area
V2_VS_ratio - Ratio between V2 and Stall speed
[optional. Default value = 1.20]
takeoff_constants - Coefficients for takeoff field lenght equation
[optional. Default values: PASS method]
maximum_lift_coefficient - Maximum lift coefficient for the config
[optional. Calculated if not informed]
airport - SUAVE type airport data, with followig fields:
atmosphere - Airport atmosphere (SUAVE type)
altitude - Airport altitude
delta_isa - ISA Temperature deviation
Outputs:
takeoff_field_length - Takeoff field length
Assumptions:
Correlation based.
"""
# ==============================================
# Unpack
# ==============================================
atmo = airport.atmosphere
altitude = airport.altitude * Units.ft
delta_isa = airport.delta_isa
weight = config.Mass_Props.m_takeoff
reference_area = config.S
try:
V2_VS_ratio = config.V2_VS_ratio
except:
V2_VS_ratio = 1.20
# ==============================================
# Computing atmospheric conditions
# ==============================================
p0, T0, rho0, a0, mew0 = atmo.compute_values(0)
p , T , rho , a , mew = atmo.compute_values(altitude)
T_delta_ISA = T + delta_isa
sigma_disa = (p/p0) / (T_delta_ISA/T0)
rho = rho0 * sigma_disa
a_delta_ISA = atmo.gas.compute_speed_of_sound(T_delta_ISA)
mew = 1.78938028e-05 * ((T0 + 120) / T0 ** 1.5) * ((T_delta_ISA ** 1.5) / (T_delta_ISA + 120))
sea_level_gravity = atmo.planet.sea_level_gravity
# ==============================================
# Determining vehicle maximum lift coefficient
# ==============================================
try: # aircraft maximum lift informed by user
maximum_lift_coefficient = config.maximum_lift_coefficient
except:
# Using semi-empirical method for maximum lift coefficient calculation
from SUAVE.Methods.Aerodynamics.Lift.High_lift_correlations import compute_max_lift_coeff
# Condition to CLmax calculation: 90KTAS @ 10000ft, ISA
p_stall , T_stall , rho_stall , a_stall , mew_stall = atmo.compute_values(10000. * Units.ft)
conditions = Data()
conditions.rho = rho_stall
conditions.mew = mew_stall
conditions.V = 90. * Units.knots
try:
maximum_lift_coefficient, induced_drag_high_lift = compute_max_lift_coeff(config,conditions)
config.maximum_lift_coefficient = maximum_lift_coefficient
except:
raise ValueError, "Maximum lift coefficient calculation error. Please, check inputs"
# ==============================================
# Computing speeds (Vs, V2, 0.7*V2)
# ==============================================
stall_speed = (2 * weight * sea_level_gravity / (rho * reference_area * maximum_lift_coefficient)) ** 0.5
V2_speed = V2_VS_ratio * stall_speed
speed_for_thrust = 0.70 * V2_speed
# ==============================================
# Determining vehicle number of engines
# ==============================================
engine_number = 0.
for propulsor in vehicle.Propulsors : # may have than one propulsor
engine_number += propulsor.no_of_engines
if engine_number == 0:
raise ValueError, "No engine found in the vehicle"
# ==============================================
# Getting engine thrust
# ==============================================
#state = Data()
#state.q = np.atleast_1d(0.5 * rho * speed_for_thrust**2)
#state.g0 = np.atleast_1d(sea_level_gravity)
#.........这里部分代码省略.........
示例4: define_mission
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import mew [as 别名]
def define_mission(vehicle):
# ------------------------------------------------------------------
# Initialize the Mission
# ------------------------------------------------------------------
mission = SUAVE.Attributes.Missions.Mission()
mission.tag = 'EMBRAER_E190AR test mission'
# atmospheric model
atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
planet = SUAVE.Attributes.Planets.Earth()
# ------------------------------------------------------------------
# Takeoff Segment
# ------------------------------------------------------------------
segment = Takeoff()
segment.tag = "Takeoff Roll"
# connect vehicle configuration
segment.config = vehicle.Configs.takeoff
# define segment attributes
airport_altitude = 0.0 * Units.km
segment.atmosphere = atmosphere
segment.planet = planet
segment.altitude = airport_altitude
#Determine liftoff speed (which will be the segment end velocity)
g_to = planet.sea_level_gravity
p_to, T_to, rho_to, a_to, mew_to = atmosphere.compute_values(segment.altitude)
v_rot_assumed = 175 * Units.mile / Units.hour
rot_conditions = Data()
rot_conditions.V = v_rot_assumed
rot_conditions.mew = mew_to
rot_conditions.rho = rho_to
CL_max = SUAVE.Methods.Aerodynamics.Lift.High_lift_correlations.compute_max_lift_coeff(vehicle,rot_conditions)[0][0]
v_mu = (vehicle.Mass_Props.m_takeoff*g_to / (0.5*rho_to*CL_max*vehicle.S))**0.5
v_rot = 1.1 * v_mu
print v_rot
segment.velocity_start = 0.0 * Units['m/s']
segment.velocity_end = v_rot
# add to misison
mission.append_segment(segment)
# ------------------------------------------------------------------
# First Climb Segment: Constant Speed, Constant Climb Rate
# ------------------------------------------------------------------
segment = SUAVE.Attributes.Missions.Segments.Climb.Constant_Speed_Constant_Rate()
segment.tag = "Climb to 35'"
# connect vehicle configuration
segment.config = vehicle.Configs.takeoff
# define segment attributes
segment.atmosphere = atmosphere
segment.planet = planet
segment.altitude_start = airport_altitude
segment.altitude_end = airport_altitude + 35. * Units.feet
segment.climb_rate = 3000. * Units['ft/min']
segment.air_speed = 1.2 * v_mu * Units['m/s']
print segment.air_speed, segment.climb_rate
# add to misison
mission.append_segment(segment)
# ------------------------------------------------------------------
# Mission definition complete
# ------------------------------------------------------------------
return mission