def Madapt_from_AsAc_NPR(AsAc, NPR): """ Computes Mach number for pressure adapted flow of a nozzle given As/Ac and NPR This method checks the NPR to define regime and computes Mach number in jet. The switch between overexpanded jet and underexpanded jet is :param AsAc: ratio of section at exit over throat :param NPR: ratio of total pressure at inlet over 'expected' static pressure at exit :return: result Mach number at exit :Example: >>> print round(Ms_from_AsAc_NPR(2.636, 1.5), 8) # case with shock in diffuser 0.32586574 .. seealso:: .. note:: NOT available for array (numpy) computations """ NPR0, NPRsw, NPR1, Msub, Msh, Msup = _NPR_Ms_list(AsAc) if (NPR < NPR0): Ms = Is.Mach_PtPs(NPR) elif (NPR > NPR1): # under expanded flow Ms = Is.Mach_PtPs(NPR) elif (NPR > NPRsw): # shock wave in jet Ms = sw.downstreamMach_Mach_ShockPsratio(Msup, NPR1 / NPR) else: gmu = defg._gamma - 1. K = NPR / AsAc / ((defg._gamma + 1.) / 2)**( (defg._gamma + 1.) / 2 / gmu) Ms = np.sqrt((np.sqrt(1. + 2. * gmu * K * K) - 1.) / gmu) return Ms
def set_NPR(self, NPR): """ Define Nozzle Pressure Ratio (inlet Ptot over outlet Ps) for this case Define Nozzle pressure ratio and compute Mach number, Ptot and Ps according to nozzle regime :param NPR: NPR value (>1) """ self._Pt = np.ones_like(self.AxoAc) if NPR < self.NPR0: _Ms = Is.Mach_PtPs(NPR, gamma=self.gamma) self._M = mf.MachSub_Sigma(self.AxoAc / self.AsoAc * mf.Sigma_Mach(_Ms), gamma=self.gamma) self._Ps = self._Pt / Is.PtPs_Mach(self._M, gamma=self.gamma) else: self._M = np.ones_like(self.AxoAc) self._M[:self.ithroat + 1] = mf.MachSub_Sigma( self.AxoAc[:self.ithroat + 1], gamma=self.gamma) self._M[self.ithroat + 1:] = mf.MachSup_Sigma( self.AxoAc[self.ithroat + 1:], gamma=self.gamma) if NPR < self.NPRsw: # analytical solution for Ms, losses and upstream Mach number of shock wave Ms = Ms_from_AsAc_NPR(self.AsoAc, NPR) Ptloss = Is.PtPs_Mach(Ms) / NPR Msh = sw.Mn_Pi_ratio(Ptloss) # redefine curves starting from 'ish' index (closest value of Msh in supersonic flow) ish = np.abs(self._M - Msh).argmin() self._M[ish:] = mf.MachSub_Sigma( self.AxoAc[ish:] * mf.Sigma_Mach(Ms) / self.AsoAc) self._Pt[ish:] = Ptloss self._Ps = self._Pt / Is.PtPs_Mach(self._M)
def update(self): gg.base.update(self) gh = self.gam_hot cph = gh * self.r_hot / (gh - 1.) self.Pt9 = np.maximum(self.Pt45 * self.xi_nozzle, self.P0) self.M9 = Is.Mach_PtPs(self.Pt9 / self.P0, gamma=self.gam_hot) self.V9 = Is.Velocity_MachTi(self.M9, self.Tt45, r=self.r_hot, gamma=self.gam_hot)
def stage_9(self): if self.current_stage_corps == 5: self.Tt9 = self.Tt5 self.Pt9 = self.Pt5 * self.xi_tuy self.P9 = self.P0 self.M9 = Is.Mach_PtPs(self.Pt9 / self.P9, self.g_fuel.gamma) self.V9 = Is.Velocity_MachTi(self.M9, self.Tt9, self.g_fuel.r, self.g_fuel.gamma) self.F_c = self.m_c * (self.V9 - self.V0) self.current_stage_corps = 9
def stage_19(self): if self.current_stage_fan == 13: self.Pt19 = self.Pt13 * self.xi_tuy self.Tt19 = self.Tt13 self.P19 = self.P0 self.M19 = Is.Mach_PtPs(self.Pt19 / self.P19, self.g.gamma) self.V19 = Is.Velocity_MachTi(self.M19, self.Tt19, self.g.r, self.g.gamma) self.F_f = self.m_f * (self.V19 - self.V0) self.current_stage_fan = 19
def compute_from_pt_rtt_p(self, pt, rtt, p): """Init state from Ptot r.Ttot and Ps (velocity sign is arbitrary and positive) Args: pt ([float]): [description] rtt ([float]): [description] p ([float]): [description] """ M = Is.Mach_PtPs(pt / p, self._gamma) rts = rtt / Is.TtTs_Mach(M, self._gamma) self.__init__(rho=p / rts, u=M * np.sqrt(self._gamma * rts), p=p)
def update(self): tj.turbojet_opt.update(self) gh = self.gam_hot cph = gh*self.r_hot/(gh-1.) Wsp_mono = (1.-(self.Pt45/self.P0*self.xi_nozzle)**(-(gh-1.)*self.etapolTBP/gh))*self.Tt45*cph*(1.+self.far) self.Tt5 = self.Tt45 - Wsp_mono*self.fanpower_ratio/cph/(1.+self.far) self.Pt5 = self.Pt45*(self.Tt5/self.Tt45)**(gh/((gh-1.)*self.etapolTBP)) # core nozzle self.Pt9 = self.Pt5 * self.xi_nozzle self.M9 = Is.Mach_PtPs(self.Pt9/self.P0, gamma=self.gam_hot) self.V9 = Is.Velocity_MachTi(self.M9, self.Tt5, r=self.r_hot, gamma=self.gam_hot) # fan gc = self.gam_cold cpc = gc*self.r_cold/(gc-1.) #print self.bpr, cpc self.Tt17 = self.Tt2 + self.eta_shaft*Wsp_mono*self.fanpower_ratio/(self.bpr*cpc) self.Pt17 = self.Pt2*(self.Tt17/self.Tt2)**((gc*self.etapolfan)/(gc-1.)) # bypass nozzle self.Tt19 = self.Tt17 self.Pt19 = self.Pt17*self.xi_nozzle self.M19 = Is.Mach_PtPs(self.Pt19/self.P0, gamma=gc) self.V19 = Is.Velocity_MachTi(self.M19, self.Tt19, r=self.r_cold, gamma=gc)
def deflection_Mach_IsentropicPsratio(Mach, Pratio, gamma=defg._gamma): m2 = Is.Mach_PtPs(Is.PtPs_Mach(Mach, gamma) / Pratio, gamma) return -PrandtlMeyer_Mach(Mach, gamma) + PrandtlMeyer_Mach(m2, gamma)
def test_stagnation_i2t(): assert Is.TtTs_Mach(2.) == Is.TiTs_Mach(2.) assert Is.PtPs_Mach(2.) == Is.PiPs_Mach(2.) assert Is.Mach_PiPs(3.) == Is.Mach_PtPs(3.) assert Is.Mach_TiTs(3.) == Is.Mach_TtTs(3.) assert Is.Velocity_MachTi(.8, 300.) == Is.Velocity_MachTt(.8, 300.)