def NPR_shock_at_exit(AsAc): """Compute Nozzle Pressure Ratio to get a choked, supersonic regime but shock at exit in a nozzle with As/Ac diffuser Args: AsAc ([real]): ratio of exit over throat surfaces Returns: [real]: Nozzle Pressure ratio (inlet total pressure over exit static pressure) """ Msup = mf.MachSup_Sigma(AsAc) Msh = sw.downstream_Mn(Msup) return Is.PtPs_Mach(Msh) / sw.Pi_ratio(Msup)
def _NPR_Ms_list(AsAc): """ Computes all NPR limits and associated exit Mach number internal function :param AsAc: ratio of section at exit over throat :return: result NPR and Mach numbers :Example: >>> import aerokit.aero.MassFlow as mf ; mf.Sigma_Mach(Is.Mach_PtPs(np.array(_NPR_Ms_list(2.)[:3:2]))) array([ 2., 2.]) .. seealso:: NPR_choked_subsonic(), NPR_choked_supersonic(), NPR_shock_at_exit() .. note:: available for scalar or array (numpy) computations """ Msub = mf.MachSub_Sigma(AsAc) NPR0 = Is.PtPs_Mach(Msub) Msup = mf.MachSup_Sigma(AsAc) Msh = sw.downstream_Mn(Msup) NPRsw = Is.PtPs_Mach(Msh) / sw.Pi_ratio(Msup) NPR1 = Is.PtPs_Mach(Msup) return NPR0, NPRsw, NPR1, Msub, Msh, Msup
ax[2].plot(CWalpha, CWm3, '-', color='#bb0000') # --- (UC) unstarted channel (A8 is sonic) alphamax = 1.1 * alphamax # M8 is sonic so M4 is known UCm4 = mf.Mach_Sigma(A3A2 / A8A2, .1, gam) # look for subsonic value UCm3low = mf.Mach_Sigma(A3A2, .1, gam) # look for subsonic value alphamin = ray.Ti_Ticri(UCm4, gam) / ray.Ti_Ticri(UCm3low, gam) print(" (restart) choked throat for Ti4/Ti0 = %6.3f" % (alphamin)) A1A2 = mf.Sigma_Mach(sw.downstream_Mn(M0, gam), gam) print(" critical flow for unstart condition if A1/A2 = %6.3f" % (A1A2)) print(" A1/A0 = %6.3f" % (A1A2 * A2A0)) UCalpha = np.log10(np.logspace(alphamin, alphamax, npts + 1)) UCpi0 = sw.Pi_ratio(M0) UCm3 = ray.SubMach_TiTicri(ray.Ti_Ticri(UCm4, gam) / UCalpha, gam) UCpi3 = UCpi0 * np.ones(npts + 1) UCpi4 = UCpi3 * ray.Pi_Picri(UCm4, gam) / ray.Pi_Picri(UCm3, gam) UCm4 = np.ones(npts + 1) * UCm4 ax[0].plot(UCalpha, UCpi3, '-', color='#990000') ax[1].plot(UCalpha, UCpi4, '-', color='#990000') ax[2].plot(UCalpha, UCm3, '-', color='#990000') # --- (RC) unstarted but choked channel (A2 and A8 are sonic) alphamax = alphamin RCm4 = mf.Mach_Sigma(A3A2 / A8A2, .1, gam) # look for subsonic value RCm3low = mf.Mach_Sigma(A3A2, 2., gam) # look for supersonic value alphamin = ray.Ti_Ticri(RCm4, gam) / ray.Ti_Ticri(RCm3low, gam)
def test_Ptshock(): assert sw.Pt_ratio(2.) == sw.Pi_ratio(2.)