def __init__(self): super().__init__() self.af_left = Airfoil() self.af_right = Airfoil() self.it_point_list_right = [] self.it_point_list_left = [] self.af_left.data_changed.connect(self.connect_airfoils) self.af_right.data_changed.connect(self.connect_airfoils)
def generator(): """ generates airofil data for defined set of airfoils consider paths """ for name in ['mh114', 'mh115', 'mh117']: airfoil = Airfoil( 'XFOIL', r'E:/propeller/mh_airofils/{}/{}xfoil.txt'.format(name, name)) generate(airfoil, r'E:\propeller\qprop\airfoildata\{}.txt'.format(name))
def foilProps(self): # ------------------------------------------------------------------------------- # section to define airfoils and local properties # ------------------------------------------------------------------------------- def foilname(t): """ return airfoil name for given thickness, in % chord """ # thicknesses = np.array([9.8, 11, 13, 14.7, 16.2]) # names = ['mh117','mh115', 'mh114','mh113','mh112' ] thicknesses = np.array([.05]) names = ['mh117'] return 'mh117' a = np.insert(thicknesses, 0, 0) thresholds = thicknesses - 0.5 * (thicknesses - a[:-1]) for i in range(len(thresholds) - 1): if t < thresholds[i + 1] and t > thresholds[i]: return names[i] return names[i + 1] self.airfoils = [] self.airfoilsdata = [] # use this to load preevaluated airofil data # list of airfoil objects for each radial postion for i in range(self.N_stations): # print(foilname(self.t[i] / self.chord[i]*100)) self.airfoils.append( Airfoil('XFOIL', r'E:/propeller/mh_airofils/{}/{}xfoil.txt'.format( foilname(self.ts[i] * 100), foilname(self.ts[i] * 100)), origin=0)) for name in ['mh112', 'mh113', 'mh114', 'mh115', 'mh117']: self.airfoilsdata.append( np.loadtxt( r'E:\propeller\qprop\airfoildata\{}.txt'.format(name))) def returnX(name): i = 0 for nm in ['mh112', 'mh113', 'mh114', 'mh115', 'mh117']: if nm == name: return self.airfoilsdata[i] i += 1 # arrays of airofil properties self.Cl0 = np.zeros(self.N_stations) self.Cla = np.zeros(self.N_stations) self.Cd0 = np.zeros(self.N_stations) self.ClCd0 = np.zeros(self.N_stations) self.Cd2u = np.zeros(self.N_stations) self.Cd2l = np.zeros(self.N_stations) self.m = self.rs * 2 * self.rpm * np.pi / 60. / 340. self.re = self.m * 340 * self.chords / 1.42e-5 print('\nr [m]\tchord\tfoil\tmach\tRe') for i in range(self.N_stations): print('{:.2f}\t{:.2f}\t{}\t{:.2f}\t{:.1f}'.format( self.rs[i], self.chords[i], foilname(self.ts[i] * 100), self.m[i], self.re[i])) for i in range(self.N_stations): # first option when dont have airfoil data # second uses preevaluated airofil polar data # self.Cl0[i], self.Cla[i], self.Cd0[i], self.ClCd0[i], self.Cd2u[i], self.Cd2l[i] = self.airfoils[i].qpropData(self.m[i], self.re[i]) self.Cl0[i], self.Cla[i], self.Cd0[i], self.ClCd0[i], self.Cd2u[ i], self.Cd2l[i] = readQPolar( self.re[i], X=returnX(foilname(self.ts[i] / self.chords[i] * 100))) self.Clmin = np.ones(self.N_stations) * .2 self.Clmax = np.ones(self.N_stations) * 1 self.Reref = self.chords * self.rs
def genAirfoil(self, t=0): """ generate airfoil""" return Airfoil('XFOIL', self.xfoil, t=t)
def get_airfoil(self, obj, numpoints=50, curvature_factor=0.5): coordinates = self.discretize(obj, numpoints, curvature_factor) return Airfoil(coordinates)
def genAirfoil(self, t=0): return Airfoil('XY', x=self.x, y=self.y, t=t)