numB = 3 radius = 1.78 / 2 RPM = numpy.linspace(500, 3000, nn) LD = 15 T_req = 13000 / 8 / LD #N (TOGW/(L/D)) Cl = 0.4 alp0 = numpy.radians(-2) for v_inf in range(22, 72, 10): P_design = [0] * nn T_design = [0] * nn Q_design = [0] * nn eta_P = [0] * nn for ii in range(0, nn): atm = AtmData(v_inf, h, is_SI) atm.expand(1.4, 287) prop = Propeller(radius, numB, RPM[ii], eta_P, CP=0, CT=0, CQ=0, Cl=0.4) [_, _, _, P_design[ii], T_design[ii], Q_design[ii], eta_P[ii], _] = prop_design(atm, prop, T_req, m0_fn, Cd_fn) label = "$V_\infty$ = " + str(v_inf) + " (m/s)" plt.figure(1) plt.plot(RPM, Q_design, label=label) plt.figure(2)
if __name__ == '__main__': def m0_fn(Ma): if Ma <= 0.9: return (2 * math.pi) / numpy.sqrt(1 - Ma**2) else: return (2 * math.pi) / numpy.sqrt(1 - 0.9**2) def Cd_fn(Cl): return 0.0095 + 0.0040 * (Cl - 0.2)**2 nn = 101 h = 0 # m v_inf = 70 # m/s is_SI = True atm = AtmData(v_inf, h, is_SI) k = 1.4 R = 287 atm.expand(k, R) numB = 3 radius = 2 / 2 RPM = 2400 Cl = 0.4 alp0 = numpy.radians(-2) prop = Propeller(radius, numB, RPM, CP=0, CT=0, CQ=0, Cl=Cl, alp0=alp0) T_req = 13000 / 8 # N (TOGW/(L/D)) r_vec, c_vec, beta_vec, P_design, T_design, Q_design, eta_P, theta_vec = prop_design( atm, prop, T_req, m0_fn, Cd_fn) in_line = [0] * len(r_vec)
# Test A, constant Cl and airspeed, numbers from lecture 01.27.2021 const_logic = [True, True, False] W_initial = 2500 * 4.4482216153 # lbf to N W_final = 2215 * 4.4482216153 # lbf to N vel = 124 * 0.514444 # m/s c_p = 0.51 / (1980000 * 0.3048) # lb/(hp*hr) to 1/ft to 1/m eta_P = 0.85 CD_0 = 0.0340 CL = 0.305 CD = 0.0401 # Just to make class work area = 200 * 0.092903 # ft^2 to m^2 span = 1 / (numpy.pi * 0.0657) e = 1 atm = AtmData(vel, 'temp', 'pres', 'dens', 'visc', 'k', 'R', 'is_SI') wing = Wing(area, span, e, 'alpha', 'chord', 'c_bar', CL, 'CL_max', CD, CD_0, 'airfoil') prop = Propeller('radius', 'RPM', eta_P, 'CP', 'CT', 'CQ', 'Cl = 0.4', 'chord = 1', 'numB = 3', 'alp0 = 0', 'alpha = None', 'beta = None', 'theta = None', 'phi = None') R, E = propeller_in_cruise(W_initial, W_final, c_p, atm, prop, wing, const_logic) R *= 0.000539957 # m to nmi E /= 3600 # s to hr #print(R) # should be ~500 nmi #print(E) # should be ~4.03 hr # Checked!
return (2 * numpy.pi) / numpy.sqrt(1 - Ma**2) else: return (2 * numpy.pi) / numpy.sqrt(1 - 0.9**2) def Cd_fn(Cl): return 0.0095 + 0.0040 * (Cl - 0.2)**2 # Atm # P_eng = 177 * 745.7 # W v_des = 154 * 0.514444 # m/s v_climb = 87 * 0.514444 # m/s h = 8000 * 0.3048 # m is_SI = True is_HP = True atm_check = AtmData(v_des, h, is_SI) atm_check.expand(1.4, 287) # Propeller radius = 41 * 0.0254 # m numB = 3 Cl = 0.4 RPM = 2400 alp0 = numpy.radians(-2) dens = atm_check.dens CT = 0.0509 T_req = CT * dens * (RPM / 60)**2 * (radius * 2)**4 v_seq = numpy.arange(v_climb - 30 * 0.3048, v_climb + 126 * 0.3048, 2) prop_check = Propeller(radius, numB,
radius = diameter / 2 LD = 15 # Assumed is_SI = True # 3 Blades numB = 3 # Design condition T_req = 13000 / (8) * 1.2 * 0.601 # N (TOGW/(L/D)) Cl = 0.4 alp0 = numpy.radians(-2) v_hover = 2.54 v_cruise = 62 v_design = 30 atm = AtmData(v_design, 0, is_SI) atm.expand(1.4, 287) v_seq = numpy.arange(-10, 68, 2) ll = numpy.size(v_seq) Design_RPM = 3000 prop = Propeller(radius, numB, Design_RPM, eta_P=0, CP=0, CT=0, CQ=0, Cl=Cl) r, prop.chord, prop.bet, P_design, T_design, Q_design, eta_P, prop.theta = prop_design(atm, prop, T_req, m0_fn, Cd_fn) num_len = len(prop.bet) beta_75_index = int(num_len * 0.75) x = numpy.linspace(0, 1, num_len) x_need = x[x >= 0.15] c_need = prop.chord[x >= 0.15] AF = 10 ** 5 / 16 * numpy.trapz(c_need / diameter * x_need ** 3, x_need) # activity factor
from STOL_initial_sizing import STOL_initial_sizing from std_atm import std_atm from Class130 import AtmData v_stall_TO = 61 * 0.514444 # m/s, stall airspeed sigma = 1 vel = v_stall_TO h = 0 # m, sea level is_SI = True k = 1.4 R = 287 S_TO = 1000 # m S_L = 1000 # m sigma = 1 CL_max = 2.0 print(v_stall_TO) temp, pres, dens, c_sound, visc, g = std_atm(h, is_SI) atm_TO = AtmData(vel, temp, pres, dens, visc, k, R, is_SI) atm_L = AtmData(vel, temp, pres, dens, visc, k, R, is_SI) wing_load_TO, wing_load_L, weight_power_TO = STOL_initial_sizing( v_stall_TO, sigma, CL_max, S_TO, S_L, atm_TO, atm_L) print(wing_load_TO) print(wing_load_L) print(weight_power_TO)
def m0_fn(Ma): if numpy.any(Ma <= 0.9): return (2 * math.pi) / numpy.sqrt(1 - Ma ** 2) else: return (2 * math.pi) / numpy.sqrt(1 - 0.9 ** 2) def Cd_fn(Cl): return 0.0095 + 0.0040 * (Cl - 0.2) ** 2 v_inf = 156 * 0.514444 h = 2438.4 k = 1.4 R = 287 is_SI = True atm_check = AtmData(v_inf, h, is_SI) atm_check.expand(k, R) dens = atm_check.dens radius = 41 * 0.0254 RPM = 2400 CT = 0.0509 T_req = CT*dens*(RPM/60)**2*(radius*2)**4 # T_req = 425.6896 * 4.44822 Cl = 0.4 numB = 3 alp0 = numpy.radians(-2) prop_check = Propeller(radius, numB, RPM, eta_P=0, CP=0, CT=0, CQ=0, Cl=0.4) [r, prop_check.chord, prop_check.bet, P_design, T_design, Q_design, eta_P, prop_check.theta] = prop_design(atm_check, prop_check, T_req, m0_fn, Cd_fn) # Fixed pitch check
# 02.14.2021: Created by XT # 02.15.2021: Reviewed by TVG. # Changed line 32 to reflect changes in Wing class (added alpha and CD as dummy values). # Not verified relative to literature values # atm data v_inf = 87 * 0.514444 temp = 288 pres = 101250 dens = 1.225 visc = 3E-6 k = 1.4 R = 287 is_SI = True atm_check = AtmData(v_inf, temp, pres, dens, visc, k, R, is_SI) # prop. data radius = 41 * 0.0254 RPM = 1854.4805 Cl = 0.4 numB = 3 alp0 = numpy.radians(-2) prop_check = Propeller(radius, RPM, Cl, "chord", numB, alp0) # wing data area = 16 span = 5 e = 0.9 CL_max = 2.1
""" Calculates saturation pressure of water vapor :param T: float, (deg C), temperature of interest :return: (Pa), saturation pressure """ T_k = T + 273.15 # convert from C to K # from https://www.engineeringtoolbox.com/water-vapor-saturation-pressure-air-d_689.html exp_power = (77.3450 + 0.0057 * T_k - 7235 / T_k) / (T_k**8.2) # empirical return np.exp(exp_power) if __name__ == '__main__': # needed inputs vel = 121 * 0.514444 # airspeed, 121 knots to m/s h = 6000 * 0.3048 # altitude, 6000 ft to m atm = AtmData(vel, h, is_SI=True) x_loc = 0.0005 # m, location of interest (just 0.5 mm past leading edge) C_liquid = 4184 # J/(kg K), specific heat capacity of liquid water C_ice = 2093 # J/(kg K), specific heat capacity of ice L_f = 3.34e5 # J/kg, latent heat of water fusion T_target = 6 # deg C, target heating temperature T_inf = atm.temp - 273.15 # deg C, environment temperature (assume under standard atmosphere) T_skin = T_target # deg C, temperature at surface k_air = 0.0227 # W/(mK), thermal conductivity of air at 255.3 K R_h = 1 # Non-dimensional, relative humidity, actual / saturated vapor pressure C_p_air = 1000 # J/(kg K), specific heat capacity under constant pressure for air (at 300K) L_e = 2.257e6 # J/kg, latent heat of water evaporation rho_LWC = 4.5e-4 # kg/m^3, liquid water content, mass of supercooled water per volume (assume stratocumulus) thickness = 0.14166 * 1.26491 # m, maximum airfoil thickness, using mean chord length span = 12.65 # m, airfoil span-wise extension for total wing v_wall = 0 # m/s, (Seems to be) surface layer velocity (assumed 0 due to laminar flow)
if __name__ == '__main__': from Class130 import AtmData, Propeller, Wing #****** The range and endurance is too low for our mission g = 9.81 # m/s^2 W_initial = 13000 # N m_loss = 5 # this affects the output tremendously W_final = 13000 - (m_loss * g) # N W_diff = W_initial - W_final # atm data h = 6000 * 0.3048 # m vel = 62 # m/s is_SI = True atm = AtmData(vel, h, is_SI) atm.expand(1.4, 287) # prop data eta_P = 0.82 prop = Propeller('radius', 'numB', 'RPM', eta_P=eta_P) const_logic = [False, True, True] # [CL, v_inf, h] area = 16 # m^2 span = (4.7046 + 1.62) * 2 CL = (W_initial + W_final) / (atm.dens * atm.vel**2 * area) # CL = 0.4128 CD = 0.018 # from drag polar with no flap, 62 m/s, 6000 ft CD_0 = 0.012
numB = 3 radius = 1.78 / 2 RPM = numpy.linspace(500, 2950, nn) LD = 15 T_req = 13000 / 8 # N (TOGW/(L/D)) Cl = 0.4 alp0 = numpy.radians(-2) for v_inf in range(20, 70, 10): P_design = [0] * nn T_design = [0] * nn Q_design = [0] * nn eta_P = [0] * nn for ii in range(0, nn): atm = AtmData(v_inf, h, is_SI) atm.expand(1.4, 287) prop = Propeller(radius, numB, RPM[ii], eta_P, CP=0, CT=0, CQ=0, Cl=0.4) [_, _, _, P_design[ii], T_design[ii], Q_design[ii], eta_P[ii], _] = prop_design(atm, prop, T_req, m0_fn, Cd_fn) label = "$V_\infty$ = " + str(v_inf) + " (m/s)" plt.figure(4) plt.plot(RPM, Q_design, label=label) plt.figure(5) plt.plot(RPM, eta_P, label=label) plt.figure(6) plt.plot(RPM, P_design, label=label) # plt.figure(7) # plt.plot(RPM,T_design,label=label) plt.figure(4)
h = 500 # m is_SI = True num = 101 vel_start = -10 vel_end = 20 vel_vec = numpy.linspace(vel_start, vel_end, num) Cd_bar_start = 0.01 Cd_bar_end = 0.05 Cd_bar_num = 5 Cd_bar_vec = numpy.linspace(Cd_bar_start, Cd_bar_end, Cd_bar_num) # P_aero vs. v_inf plt.figure(figsize=[20, 15]) for i in range(Cd_bar_num): Cd_bar = Cd_bar_vec[i] P_aero_vec = [0] * num for j in range(num): atm_trial = AtmData(vel_vec[j], h, is_SI) P_aero_vec[j], _ = rotor_hover_power(Weight, gamma, num_rotor, f_body, atm_trial, prop_trial, Cd_bar=Cd_bar) plt.plot(vel_vec, P_aero_vec, label='Cd_bar = {:.2f}'.format(Cd_bar)) title = 'Total Climb Power versus. Climb Speed' plt.title(title) plt.xlabel(r'Climb Speed $V_\infty$ (m/s)') plt.ylabel(r'Total Power $P_{aero}$ (W)') plt.grid() plt.legend(loc='upper right') plt.show()
from Class130 import Airfoil, AtmData # Use XFOIL to test the stall angle of NLF 0414 F airfoil foilpath = '../Sizing/OpenVSP/v1.5_03_13_2021/Airfoil/NLF 0414F.dat' foilname = 'NLF0414' # Atm h = 6000 / 3.28084 # ft vel = 62 # m/s is_SI = True atm = AtmData(vel, h, is_SI) c = 1 Re = (atm.dens * atm.vel * c) / atm.visc alf_start = 0 alf_end = 80 num_alfs = 50 iter_num = 100 foil = Airfoil(foilname) foil.set_iter_num(iter_num) foil.set_num_alfs(num_alfs) foil.add_geom_file(foilpath) foil.get_polar(Re, alf_start, alf_end) foil.lift_curve() foil.drag_polar()