本文整理汇总了Python中SUAVE.Core.Data.total方法的典型用法代码示例。如果您正苦于以下问题:Python Data.total方法的具体用法?Python Data.total怎么用?Python Data.total使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Core.Data
的用法示例。
在下文中一共展示了Data.total方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: evaluate
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import total [as 别名]
def evaluate(self,state,settings,geometry):
"""Evaluates lift and drag using available surrogates.
Assumptions:
None
Source:
N/A
Inputs:
state.conditions.
freestream.dynamics_pressure [-]
angle_of_attack [radians]
Outputs:
conditions.aerodynamics.lift_breakdown.
inviscid_wings_lift[wings.*.tag] [-] CL (wing specific)
inviscid_wings_lift.total [-] CL
conditions.aerodynamics.
lift_coefficient_wing [-] CL (wing specific)
inviscid_wings_lift [-] CL
Properties Used:
self.surrogates.
lift_coefficient [-] CL
wing_lift_coefficient[wings.*.tag] [-] CL (wing specific)
"""
# unpack
surrogates = self.surrogates
conditions = state.conditions
# unpack
q = conditions.freestream.dynamic_pressure
AoA = conditions.aerodynamics.angle_of_attack
Sref = geometry.reference_area
wings_lift_model = surrogates.lift_coefficient
# inviscid lift of wings only
inviscid_wings_lift = Data()
inviscid_wings_lift.total = wings_lift_model(AoA)
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift = Data()
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift.total = inviscid_wings_lift.total
state.conditions.aerodynamics.lift_coefficient = inviscid_wings_lift.total
# store model for lift coefficients of each wing
state.conditions.aerodynamics.lift_coefficient_wing = Data()
for wing in geometry.wings.keys():
wings_lift_model = surrogates.wing_lift_coefficients[wing]
inviscid_wings_lift[wing] = wings_lift_model(AoA)
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift[wing] = inviscid_wings_lift[wing]
state.conditions.aerodynamics.lift_coefficient_wing[wing] = inviscid_wings_lift[wing]
return inviscid_wings_lift
示例2: main
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import total [as 别名]
def main():
# ------------------------------------------------------------------
# Testing
# B737-800
# ------------------------------------------------------------------
# Setup
fuselage = Data()
fuselage.fineness = Data()
fuselage.lengths = Data()
fuselage.heights = Data()
fuselage.areas = Data()
fuselage.number_coach_seats = 170.
fuselage.seat_pitch = 1.0
fuselage.seats_abreast = 6.0
fuselage.fineness.nose = 1.6
fuselage.fineness.tail = 2.0
fuselage.lengths.fore_space = 6.0
fuselage.lengths.aft_space = 5.0
fuselage.width = 3.74
fuselage.heights.maximum = 3.74
# Compute
fuselage_planform(fuselage)
# Truth Values
nose_length_truth = 5.984
tail_length_truth = 7.48
cabin_length_truth = 39.3333
total_length_truth = 52.79733
wetted_area_truth = 580.79624
frontal_area_truth = 10.98583535
dia_effective_truth = 3.74
# Compute Errors
error = Data()
error.nose = np.abs(fuselage.lengths.nose-nose_length_truth)/nose_length_truth
error.tail = np.abs(fuselage.lengths.tail-tail_length_truth)/tail_length_truth
error.cabin = np.abs(fuselage.lengths.cabin-cabin_length_truth)/cabin_length_truth
error.total = np.abs(fuselage.lengths.total-total_length_truth)/total_length_truth
error.wetted_area = np.abs(fuselage.areas.wetted-wetted_area_truth)/wetted_area_truth
error.front_area = np.abs(fuselage.areas.front_projected-frontal_area_truth)/frontal_area_truth
error.diameter = np.abs(fuselage.effective_diameter-dia_effective_truth)/dia_effective_truth
for k,v in list(error.items()):
assert np.any(np.abs(v)<1e-6)
示例3: empty
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import total [as 别名]
def empty(config,
speed_of_sound = 340.294,
max_tip_mach = 0.65,
disk_area_factor = 1.15,
max_thrust_to_weight_ratio = 1.1,
motor_efficiency = 0.85 * 0.98):
"""weight = SUAVE.Methods.Weights.Buildups.Electric_Stopped_Rotor.empty(
config,
speed_of_sound = 340.294,
max_tip_mach = 0.65,
disk_area_factor = 1.15,
max_thrust_to_weight_ratio = 1.1,
motor_efficiency = 0.85 * 0.98)
Calculates the empty fuselage mass for an electric stopped rotor including
seats, avionics, servomotors, ballistic recovery system, rotor and hub
assembly, transmission, and landing gear. Additionally incorporates
results of the following common buildup scripts:
fuselage,py
prop.py
wing.py
wiring.py
Originally written as part of an AA 290 project inteded for trade study
of the Electric Stopped Rotor along with the following defined SUAVE config types:
Electric Helicopter
Electric Tiltrotor
Sources:
Project Vahana Conceptual Trade Study
Inputs:
config SUAVE Config Data Structure
speed_of_sound Local Speed of Sound [m/s]
maximumTipMach Allowable Tip Mach Number [Unitless]
disk_area_factor Inverse of Disk Area Efficiency [Unitless]
max_thrust_to_weight_ratio Allowable Thrust to Weight Ratio [Unitless]
motor_efficiency Motor Efficiency [Unitless]
Outputs:
output: Data Dictionary of Component Masses [kg]
"""
output = Data()
#-------------------------------------------------------------------------------
# Unpack Inputs
#-------------------------------------------------------------------------------
rProp = config.propulsors.network.propeller.prop_attributes.tip_radius
mBattery = config.propulsors.network.battery.mass_properties.mass
mPayload = config.propulsors.network.payload.mass_properties.mass
MTOW = config.mass_properties.max_takeoff
nLiftProps = config.propulsors.network.number_of_engines/2
nThrustProps = config.propulsors.network.number_of_engines/2
nLiftBlades = config.propulsors.network.propeller.prop_attributes.number_blades
nThrustBlades = config.propulsors.network.propeller.prop_attributes.number_blades
fLength = config.fuselages.fuselage.lengths.total
fWidth = config.fuselages.fuselage.width
fHeight = config.fuselages.fuselage.heights.maximum
maxSpan = config.wings['main_wing'].spans.projected
sound = speed_of_sound
tipMach = max_tip_mach
k = disk_area_factor
ToverW = max_thrust_to_weight_ratio
etaMotor = motor_efficiency
output.payload = mPayload * Units.kg
output.seats = 30. *Units.kg
output.avionics = 15. *Units.kg
output.motors = config.propulsors.network.number_of_engines * 10. *Units.kg
output.battery = mBattery *Units.kg
output.servos = config.propulsors.network.number_of_engines * 0.65 *Units.kg
output.brs = 16. *Units.kg
output.hubs = config.propulsors.network.number_of_engines * 2. *Units.kg
output.landing_gear = MTOW * 0.02 *Units.kg
#-------------------------------------------------------------------------------
# Calculated Weights
#-------------------------------------------------------------------------------
# Preparatory Calculations
Vtip = sound * tipMach # Prop Tip Velocity
omega = Vtip/0.8 # Prop Ang. Velocity
maxLift = config.mass_properties.max_takeoff * ToverW # Maximum Thrust
Ct = maxLift/(1.225*np.pi*0.8**2*Vtip**2) # Thrust Coefficient
bladeSol = 0.1 # Blade Solidity
AvgCL = 6 * Ct / bladeSol # Average Blade CL
AvgCD = 0.012 # Average Blade CD
maxLiftPower = 1.15*maxLift*(
k*np.sqrt(maxLift/(2*1.225*np.pi*0.8**2)) +
bladeSol*AvgCD/8*Vtip**3/(maxLift/(1.225*np.pi*0.8**2))
#.........这里部分代码省略.........
示例4: turbofan_emission_index
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import total [as 别名]
def turbofan_emission_index(turbofan, state):
"""
Outputs a turbofan's emission_index takens from a regression calculated
from NASA's Engine Performance Program (NEPP)
Inputs:
turbofan.
combustor.
inputs.
stagnation_pressure [Pa]
stagnation_temperature [K]
outputs.
stagnation_temperature [K]
Outputs:
emission.
total.
NOx [kg]
CO2 [kg]
H2O [kg]
SO2 [kg]
index.
NOx [kg/kg]
CO2 [kg/kg]
H2O [kg/kg]
SO2 [kg/kg]
Source: Antoine, Nicholas, Aircraft Optimization for Minimal Environmental Impact, pp. 31 (PhD Thesis)
"""
results = turbofan(state)
p3 = turbofan.combustor.inputs.stagnation_pressure/Units.psi
T3 = turbofan.combustor.inputs.stagnation_temperature/Units.degR
T4 = turbofan.combustor.outputs.stagnation_temperature/Units.degR
mdot = state.conditions.weights.vehicle_mass_rate
I = state.numerics.time.integrate
NOx = .004194*T4*((p3/439.)**.37)*np.exp((T3-1471.)/345.)
CO2 = 3.155 # This is in kg/kg
H2O = 1.240 # This is in kg/kg
SO2 = 0.0008 # This is in kg/kg
#correlation in g Nox/kg fuel; convert to kg Nox/kg
NOx = NOx * (Units.g/Units.kg)
# Integrate them over the entire segment
NOx_total = np.dot(I,mdot*NOx)
CO2_total = np.dot(I,mdot*CO2)
SO2_total = np.dot(I,mdot*SO2)
H2O_total = np.dot(I,mdot*H2O)
emission = Data()
emission.total = Data()
emission.index = Data()
emission.total.NOx = NOx_total
emission.total.CO2 = CO2_total
emission.total.H2O = H2O_total
emission.total.SO2 = SO2_total
emission.index.NOx = NOx
emission.index.CO2 = CO2
emission.index.H2O = H2O
emission.index.SO2 = SO2
return emission
示例5: evaluate
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import total [as 别名]
def evaluate(self,state,settings,geometry):
"""Evaluates lift and drag using available surrogates.
Assumptions:
None
Source:
N/A
Inputs:
state.conditions.
freestream.dynamics_pressure [-]
angle_of_attack [radians]
Outputs:
conditions.aerodynamics.lift_breakdown.
inviscid_wings_lift[wings.*.tag] [-] CL (wing specific)
inviscid_wings_lift.total [-] CL
conditions.aerodynamics.
lift_coefficient_wing [-] CL (wing specific)
inviscid_wings_lift [-] CL
Properties Used:
self.surrogates.
lift_coefficient [-] CL
wing_lift_coefficient[wings.*.tag] [-] CL (wing specific)
"""
""" process vehicle to setup geometry, condititon and settings
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 settings
"""
# unpack
surrogates = self.surrogates
conditions = state.conditions
# unpack
q = conditions.freestream.dynamic_pressure
AoA = conditions.aerodynamics.angle_of_attack
Sref = geometry.reference_area
wings_lift_model = surrogates.lift_coefficient
# inviscid lift of wings only
inviscid_wings_lift = Data()
inviscid_wings_lift.total = wings_lift_model(AoA)
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift = Data()
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift.total = inviscid_wings_lift.total
state.conditions.aerodynamics.lift_coefficient = inviscid_wings_lift.total
# store model for lift coefficients of each wing
state.conditions.aerodynamics.lift_coefficient_wing = Data()
for wing in geometry.wings.keys():
wings_lift_model = surrogates.wing_lift_coefficients[wing]
inviscid_wings_lift[wing] = wings_lift_model(AoA)
conditions.aerodynamics.lift_breakdown.inviscid_wings_lift[wing] = inviscid_wings_lift[wing]
state.conditions.aerodynamics.lift_coefficient_wing[wing] = inviscid_wings_lift[wing]
return inviscid_wings_lift