def get_takeoff_ground_roll(self): mu_r = 0.05 n = 1 v_to = 0.77 * self.get_v_stall_at_sea_level() t = self._engine_power / v_to d = (0.5 * AirDensity.get_air_density_english(0) * (v_to ** 2) * self.get_wing_area() * self.get_cD0()) + \ (self.get_K() * (self.get_cL_max() ** 2)) l = 0.5 * AirDensity.get_air_density_english(0) * (v_to ** 2) * self.get_wing_area() * self.get_cL_max() w = self.get_gross_takeoff_weight() return ((1.21 * self.get_wing_loading()) / (34.172 * AirDensity.get_air_density_english(0) * self.get_cL_max() * ((t / w) - (d / w) - (mu_r * (1 - (l / w)))))) + (1.1 * n * self.get_v_stall_at_sea_level())
def get_max_rate_of_climb(self): air_density = AirDensity.get_air_density_english(0) return ((self._propeller_efficiency * self._engine_power) / self.get_gross_takeoff_weight()) - \ ((((2 / air_density) * ((self.get_K() / (3 * self.get_cD0())) ** 0.5) * self.get_wing_loading()) ** 0.5) * (1.155 / ((1 / (4 * self.get_K() * self.get_cD0())) ** 0.5)))
def get_rate_of_climb_at_cruise(self): power = ((1.132 * (self._air_density / AirDensity.get_air_density_english(0))) - 0.132) * self._engine_power return ((self._propeller_efficiency * power) / self.get_gross_takeoff_weight()) - \ ((((2 / self._air_density) * ((self.get_K() / (3 * self.get_cD0())) ** 0.5) * self.get_wing_loading()) ** 0.5) * (1.155 / ((1 / (4 * self.get_K() * self.get_cD0())) ** 0.5)))
def get_landing_ground_roll(self): j = 1.15 n = 3 t_rev = 0 mu_r = 0.3 v_td = 1.15 * self.get_v_stall_at_sea_level() d = (0.5 * AirDensity.get_air_density_english(0) * (v_td ** 2) * self.get_wing_area() * self.get_cD0()) + \ (self.get_K() * (self.get_cL_max() ** 2)) l = 0.5 * AirDensity.get_air_density_english(0) * (v_td ** 2) * self.get_wing_area() * self.get_cL_max() w = self.get_gross_takeoff_weight() return (j * n * self.get_v_stall_at_sea_level()) + \ (((j ** 2) * self.get_wing_loading()) / (34.172 * AirDensity.get_air_density_english(0) * self.get_cL_max()) * ((t_rev / w) + (d / w) + (mu_r * (1 - (l / w)))))
def __init__(self, filename): # Using the "XFLRData" class to extract data from a XFLR5 text file location = "AirFoils/" + filename data = XFLR5Data.XFLR5DataMetricElectric(location) name = filename if ".txt" in filename: name = name[:-3] self._battery_energy = data.get_battery_energy() self._motor_efficiency = data.get_motor_efficiency() self._propeller_efficiency = data.get_propeller_efficiency() self._motor_power = data.get_motor_power() self._air_density = self._air_density = AirDensity.get_air_density_metric( data.get_cruise_altitude()) super().__init__(name, data.get_wingspan(), data.get_chord(), data.get_swept_angle(), data.get_cruise_altitude(), data.get_angle_of_attack_at_cruise(), data.get_target_cruise_velocity(), data.get_max_velocity(), data.get_aircraft_mass(), data.get_cargo_mass(), data.get_fuel_mass(), data.get_empty_weight_friction(), data.get_span_efficiency_factor(), data.get_n_structure(), data.get_alpha_list(), data.get_cl_list(), data.get_cd_list())
def __init__(self, filename, plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_mass, cargo_mass, fuel_mass, empty_weight_friction, span_efficiency_factor, thrust_specific_fuel_consumption, engine_thrust, n_structure): name = "AirFoils/" + filename data = XFLR5Data.XFLR5Data(name) self._thrust_specific_fuel_consumption = thrust_specific_fuel_consumption self._aircraft_mass = aircraft_mass self._cargo_mass = cargo_mass self._fuel_mass = fuel_mass self._air_density = self._air_density = AirDensity.get_air_density_metric( cruise_alt) self._engine_thrust = engine_thrust self._gravity = 9.81 super().__init__(plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_mass, cargo_mass, fuel_mass, empty_weight_friction, span_efficiency_factor, n_structure, data.get_alpha_list(), data.get_cl_list(), data.get_cd_list())
def __init__(self, filename, plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_weight, cargo_weight, fuel_weight, empty_weight_friction, span_efficiency_factor, thrust_specific_fuel_consumption, engine_thrust, n_structure): name = "AirFoils/" + filename data = XFLR5Data.XFLR5Data(name) self._thrust_specific_fuel_consumption = thrust_specific_fuel_consumption * ( 8.6335972 * (10**-5)) # conversion from lbm/(lbf*hr) to slugs/(lbf*s) self._aircraft_weight = aircraft_weight self._cargo_weight = cargo_weight self._fuel_weight = fuel_weight self._air_density = AirDensity.get_air_density_english(cruise_alt) self._engine_thrust = engine_thrust super().__init__(plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_weight, cargo_weight, fuel_weight, empty_weight_friction, span_efficiency_factor, n_structure, data.get_alpha_list(), data.get_cl_list(), data.get_cd_list())
def get_velocity_for_max_rate_of_climb(self): air_density = AirDensity.get_air_density_english(0) v_climb = (((2 / air_density) * ((self.get_K() / (3 * self.get_cD0())) ** 0.5) * self.get_wing_loading()) ** 0.5) / 1.687811 if v_climb < self.get_v_stall_at_sea_level(): return self.get_v_stall_at_sea_level() else: return v_climb
def __init__(self, filename, plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_weight, cargo_weight, fuel_weight, empty_weight_friction, span_efficiency_factor, specific_fuel_consumption, propeller_efficiency, engine_power, n_structure): name = "AirFoils/" + filename data = XFLR5Data.XFLR5Data(name) self._specific_fuel_consumption = specific_fuel_consumption * 5.11686929 * (10 ** (-7)) # conversion from # lb/(hp*hr) to lb/(((lb*ft)/s)*s) self._propeller_efficiency = propeller_efficiency self._aircraft_weight = aircraft_weight self._cargo_weight = cargo_weight self._fuel_weight = fuel_weight self._air_density = AirDensity.get_air_density_english(cruise_alt) self._engine_power = (engine_power * 32572) / 60 super().__init__(plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_weight, cargo_weight, fuel_weight, empty_weight_friction, span_efficiency_factor, n_structure, data.get_alpha_list(), data.get_cl_list(), data.get_cd_list())
def __init__(self, filename, plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_mass, cargo_mass, battery_mass, battery_energy, empty_weight_friction, span_efficiency_factor, motor_power, motor_efficiency, propeller_efficiency, n_structure): name = "AirFoils/" + filename data = XFLR5Data.XFLR5Data(name) self._battery_energy = battery_energy self._motor_efficiency = motor_efficiency self._propeller_efficiency = propeller_efficiency self._motor_power = motor_power self._air_density = self._air_density = AirDensity.get_air_density_metric( cruise_alt) super().__init__(plane_airfoil_str, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_mass, cargo_mass, battery_mass, empty_weight_friction, span_efficiency_factor, n_structure, data.get_alpha_list(), data.get_cl_list(), data.get_cd_list())
import AirDensity units = input("Input Unit System (1 - English (ft), 2 - Metric (m)): ") alt = input("Input the altitude: ") units = int(units) alt = float(alt) if units == 1: print(str(AirDensity.get_air_density_english(alt)) + " slugs/ft^3") elif units == 2: print(str(AirDensity.get_air_density_metric(alt)) + " kg/m^3")
def __init__(self, name, wing_span, chord, swept_angle, cruise_alt, angle_of_attack_at_cruise, target_cruise_velocity, max_velocity, aircraft_mass, cargo_mass, fuel_mass, cD0, span_efficiency_factor, n_structure, alpha, cl, cd): # Setting variable from the constructor self._name = name self._wing_span = wing_span self._alpha = alpha self._clx = cl self._cdx = cd self._target_cruise_velocity = target_cruise_velocity self._cD0 = cD0 self._air_density = AirDensity.get_air_density_metric(cruise_alt) self._n_structure = n_structure self._max_velocity = max_velocity self._aircraft_weight = aircraft_mass * _gravity_metric self._cargo_weight = cargo_mass * _gravity_metric self._fuel_weight = fuel_mass * _gravity_metric # Block to calculate constants used in flight performance self._wing_area = wing_span * chord aspect_ratio = (wing_span ** 2) / self._wing_area self._wing_loading = ((aircraft_mass + cargo_mass + fuel_mass) * 9.81) / self._wing_area self._k = 1 / (math.pi * span_efficiency_factor * aspect_ratio) self._e0 = 0 if swept_angle == 0: self._e0 = (1.78 * (1 - (0.045 * (aspect_ratio ** 0.68)))) - 0.64 else: self._e0 = (4.61 * (1 - (aspect_ratio ** 0.68)) * (math.cos(math.radians(swept_angle)) ** 0.15)) - 3.1 self._K = 1 / (math.pi * self._e0 * aspect_ratio) # set of code to find a linear curve fit of the data in the usable range i = 0 x_sum = 0 y_sum = 0 while i < len(self._alpha): x_sum += self._alpha[i] y_sum += self._clx[i] i += 1 n = len(self._alpha) x = x_sum / n y = y_sum / n i = 0 x1y1 = 0 x2 = 0 while i < len(self._alpha): x1y1 += (self._alpha[i] - x) * (self._clx[i] - y) x2 += (self._alpha[i] - x) ** 2 i += 1 # finding parameters "a0" and "zero_lift_angle" self._a0_per_degree = x1y1 / x2 self._a0_per_radian = self._a0_per_degree * 57.3 self._b = y - (self._a0_per_degree * x) self._zero_lift_angle = -(self._b / self._a0_per_degree) # creating a line from "a0_degrees" and "b" self._cl = [] self._alpha_range = [] for i in range(0, len(self._alpha)): self._cl.append((self._a0_per_degree * self._alpha[i]) + self._b) self._alpha_range.append(self._alpha[i]) # Calculating a common constant used in the denominator denominator = 1 + (self._a0_per_radian * math.cos(math.radians(swept_angle)) * self._K) self._a_per_radian = (self._a0_per_radian * math.cos(math.radians(swept_angle))) / denominator self._a_per_degree = self._a_per_radian / 57.3 # For loop to find the "_cd_at_cruise" for i in range(0, len(self._alpha)): if self._alpha[i] == angle_of_attack_at_cruise: self._cd_at_cruise = self._cdx[i] break # Block to estimate the 3D CL data at alpha # List for 3D CL data self._cL = [] # For loop to add the 3D wing analysis to "cL" self._cL_max = 0 for i in range(0, len(self._alpha)): # Equation to estimate cL at angle alpha cL_value = self._a_per_degree * (self._alpha[i] - self._zero_lift_angle) self._cL.append(cL_value) if cL_value > self._cL_max: self._cL_max = cL_value self._cL_slope = (self._cL[len(self._cL) - 1] - self._cL[0]) / len(self._alpha) self._cL_at_cruise = self._a_per_degree * (angle_of_attack_at_cruise - self._zero_lift_angle) self._cd0 = self._cdx[0] for i in range(0, len(self._alpha)): temp = self._cdx[i] if temp < self._cd0: self._cd0 = temp # Block to estimate the 3D CD data at alpha # List for 3D CD data self._cD = [] self._cd = [] for i in range(0, len(self._alpha)): # Equation to estimate cD at angle alpha cD_value = (((self._a_per_degree * (self._alpha[i] - self._zero_lift_angle)) ** 2) * self._K) + \ (self._cD0 + self._cd0) # Adding "cD_value" to the list "cD" self._cD.append(cD_value) self._cd.append(self._cd0) self._cD_at_cruise = (((self._a_per_degree * (angle_of_attack_at_cruise - self._zero_lift_angle)) ** 2) * self._K) + self._cD0 # Equation for the gross takeoff weight self._gross_takeoff_weight = (cargo_mass + fuel_mass + aircraft_mass) * _gravity_metric # Equation for the empty weight, aircraft weight with no fuel self._empty_weight = (cargo_mass + aircraft_mass) * _gravity_metric # Block to get the thrust and power required at specified velocities # Lists for power, trust, and velocity self._power = [] self._thrust = [] self._velocity = [] self._min_power_required = 0 self._min_thrust_required = 0 self._power_req_at_target_cruise = 0 self._thrust_req_at_target_cruise = 0 # Precision of the velocity to calculate power and thrust precision = 1 i = precision # While to calculate power and thrust required from 0 m/s to "max_velocity" while i <= max_velocity: # adding "i" to "velocity" self._velocity.append(i) # Calculating thrust required thrust_required = (.5 * self._air_density * (i ** 2) * self._wing_area * self._cD0) + \ ((2 * self._K * (self._gross_takeoff_weight ** 2)) / (self._air_density * (i ** 2) * self._wing_area)) # Calculating power required power_required = (.5 * self._air_density * (i ** 3) * self._wing_area * self._cD0) + \ ((2 * self._K * (self._gross_takeoff_weight ** 2)) / (self._air_density * i * self._wing_area)) if self._min_power_required == 0 and self._min_thrust_required == 0: self._min_power_required = power_required self._min_thrust_required = thrust_required else: if self._min_power_required > power_required: self._min_power_required = power_required if self._min_thrust_required > thrust_required: self._min_thrust_required = thrust_required if i == target_cruise_velocity: self._power_req_at_target_cruise = power_required self._thrust_req_at_target_cruise = thrust_required # Adding the calculated values to their list respectively self._power.append(power_required) self._thrust.append(thrust_required) i += precision