def compute_initial_expansion_fan(self): M_max = gd.PR_expansion_mach(self.PR, self.gamma) # print('M_max: ' + str(M_max)) mach_fan = np.linspace(1.1, M_max, self.n) (T_ratio, p_ratio, rho_ratio, a_ratio) = gd.isentropic_ratios(0, mach_fan, self.gamma) V_fan = a_ratio * self.spike.a_c * mach_fan W_fan = V_fan / self.V_l theta_fan = -gd.prandtl_meyer(mach_fan, self.gamma) + self.slope_init angle_fan = gd.mach_angle(mach_fan) # print(180/np.pi*np.arcsin(np.sqrt((gamma-1)/2*(1/W_fan**2-1)))) # print(W_fan) # print(angle_fan*180/np.pi) x_fan = np.ones(angle_fan.shape) * self.spike.lip_x y_fan = np.ones(angle_fan.shape) * self.spike.lip_y #print(theta_fan*180/np.pi) # print(gd.mach_angle_velocity_ratio(gd.prandtl_meyer(2.3,gamma),0.3,gamma)) initial_point = self.contour_point(chr_point(self.gamma, x_fan[0], y_fan[0], theta_fan[0], W_fan[0], 'N/A'), plot_chr=self.plot_chr) self.ID += 1 self.ID_contour_chr.pop(0) self.chr_array = np.append(self.chr_array, initial_point) for point in x_fan[1:-1]: temp_point = chr_point(self.gamma, x_fan[self.ID], y_fan[self.ID], theta_fan[self.ID], W_fan[self.ID], 'N/A') new_point = self.general_point(temp_point, self.chr_array[self.ID - 1], plot_chr=self.plot_chr) # adding to arrays self.chr_array = np.append(self.chr_array, new_point) self.ID += 1 first_jet = chr_point(self.gamma, x_fan[-1], y_fan[-1], theta_fan[-1], W_fan[-1], 'N/A') second_jet = self.jet_boundary_point(first_jet, self.chr_array[self.ID - 1], plot_chr=self.plot_chr) self.chr_array = np.append(self.chr_array, second_jet) #self.ID_jet_boundary.append(self.ID) self.ID += 1 self.add_break_ID()
def design_nozzle(self): # discrete contour design variables self.M = np.linspace(1, self.M_e, self.n) self.A = self.A_t * gd.expansion_ratio(1, self.M, self.gamma) self.alpha = gd.prandtl_meyer(self.M_e, self.gamma) - gd.prandtl_meyer( self.M, self.gamma) + gd.mach_angle(self.M) self.l = (self.r_e - np.sqrt( np.abs(self.r_e**2 - (self.A * self.M * np.sin(self.alpha) / np.pi)))) / np.sin( self.alpha) self.x = self.l * np.cos(self.alpha) self.y = self.l * np.sin(self.alpha) self.centre_spike() self.length = self.x.max()