Example #1
0
    def execute(self):

    	fs_tube = self.fs_tube = FlowStation()

        tube_rad = self.radius_tube*0.0328084 #convert to ft
        inlet_rad = self.radius_inlet*0.0328084

        self._tube_area  = pi*(tube_rad**2) #ft**2
        self._bypass_area = pi*(tube_rad**2-inlet_rad**2)

        self._Ts = self.Ts_tube*1.8 #convert to R
        self._Ps = self.Ps_tube*0.000145037738 #convert to psi


        area_ratio_target = self._tube_area/self._bypass_area

        def f(m_guess): 
            fs_tube.setStaticTsPsMN(self._Ts, self._Ps , m_guess)
            gam = fs_tube.gamt
            g_exp = (gam+1)/(2*(gam-1))
            ar = ((gam+1)/2)**(-1*g_exp)*((1+ (gam-1)/2*m_guess**2)**g_exp)/m_guess
            return ar - area_ratio_target

        self.limit_Mach = secant(f, .3, x_min=0, x_max=1)
        self.limit_speed = fs_tube.Vflow*0.3048 #convert to meters
        
        #excess mass flow calculation
        fs_tube.setStaticTsPsMN(self._Ts, self._Ps, self.Mach_pod)
        self.W_tube = fs_tube.rhos*fs_tube.Vflow*self._tube_area*0.45359

        fs_tube.Mach = self.Mach_bypass #Kantrowitz flow is at these total conditions, but with Mach 1
        self.W_kant = fs_tube.rhos*fs_tube.Vflow*self._bypass_area*0.45359
        #print "test", fs_tube.rhos, fs_tube.Vflow, self._bypass_area, self.W_kant

        self.W_excess = self.W_tube - self.W_kant
Example #2
0
    def execute(self):

        fs_tube = self.fs_tube = FlowStation()

        tube_rad = cu(self.radius_tube, 'cm', 'ft')  #convert to ft
        inlet_rad = cu(self.radius_inlet, 'cm', 'ft')
        #A = pi(r^2)
        self._tube_area = pi * (tube_rad**2)  #ft**2
        self._inlet_area = pi * (inlet_rad**2)  #ft**2
        self._bypass_area = self._tube_area - self._inlet_area

        self._Ts = cu(self.Ts_tube, 'degK', 'degR')  #convert to R
        self._Ps = cu(self.Ps_tube, 'Pa', 'psi')  #convert to psi

        area_ratio_target = self._tube_area / self._bypass_area

        #iterate over pod speed until the area ratio = A_tube / A_bypass
        def f(m_guess):
            fs_tube.setStaticTsPsMN(
                self._Ts, self._Ps, m_guess
            )  #set the static conditions iteratively until correct (Ts, Ps are known)
            gam = fs_tube.gamt
            g_exp = (gam + 1) / (2 * (gam - 1))
            ar = ((gam + 1) / 2)**(-1 * g_exp) * (
                (1 + (gam - 1) / 2 * m_guess**2)**g_exp) / m_guess
            return ar - area_ratio_target
    #Solve for Mach where AR = AR_target

        self.limit_Mach = secant(
            f, .3, x_min=0, x_max=1
        )  #value not actually needed, fs_tube contains necessary flow information
        self.limit_speed = cu(fs_tube.Vflow, 'ft',
                              'm')  #convert to meters/second

        #excess mass flow calculation
        fs_tube.setStaticTsPsMN(self._Ts, self._Ps, self.Mach_pod)
        self.W_tube = cu(fs_tube.rhos * fs_tube.Vflow * self._tube_area, 'lbm',
                         'kg')  #convert to kg/sec

        fs_tube.Mach = self.Mach_bypass  #Kantrowitz flow is at these total conditions, but with Mach 1
        self.W_kant = cu(fs_tube.rhos * fs_tube.Vflow * self._bypass_area,
                         'lbm', 'kg')  #convert to kg/sec
        #print "test", fs_tube.rhos, fs_tube.Vflow, self._bypass_area, self.W_kant

        self.W_excess = self.W_tube - self.W_kant
    def execute(self):

    	fs_tube = self.fs_tube = FlowStation()

        tube_rad = cu(self.radius_tube,'cm','ft') #convert to ft
        inlet_rad = cu(self.radius_inlet,'cm','ft')
        #A = pi(r^2) 
        self._tube_area  = pi*(tube_rad**2) #ft**2
        self._inlet_area  = pi*(inlet_rad**2) #ft**2
        self._bypass_area = self._tube_area - self._inlet_area

        self._Ts = cu(self.Ts_tube,'degK','degR') #convert to R
        self._Ps = cu(self.Ps_tube,'Pa','psi') #convert to psi

        area_ratio_target = self._tube_area/self._bypass_area

        #iterate over pod speed until the area ratio = A_tube / A_bypass
        def f(m_guess): 
            fs_tube.setStaticTsPsMN(self._Ts, self._Ps , m_guess) #set the static conditions iteratively until correct (Ts, Ps are known)
            gam = fs_tube.gamt
            g_exp = (gam+1)/(2*(gam-1))
            ar = ((gam+1)/2)**(-1*g_exp)*((1+ (gam-1)/2*m_guess**2)**g_exp)/m_guess
            return ar - area_ratio_target
        #Solve for Mach where AR = AR_target
        self.limit_Mach = secant(f, .3, x_min=0, x_max=1) #value not actually needed, fs_tube contains necessary flow information
        self.limit_speed = cu(fs_tube.Vflow,'ft','m') #convert to meters/second
        
        #excess mass flow calculation
        fs_tube.setStaticTsPsMN(self._Ts, self._Ps, self.Mach_pod)
        self.W_tube = cu(fs_tube.rhos*fs_tube.Vflow*self._tube_area,'lbm','kg') #convert to kg/sec

        fs_tube.Mach = self.Mach_bypass #Kantrowitz flow is at these total conditions, but with Mach 1
        self.W_kant = cu(fs_tube.rhos*fs_tube.Vflow*self._bypass_area,'lbm','kg') #convert to kg/sec
        #print "test", fs_tube.rhos, fs_tube.Vflow, self._bypass_area, self.W_kant

        self.W_excess = self.W_tube - self.W_kant
Example #4
0
    def execute(self): 

        Fl_I = self.Fl_I
        Fl_O = self.Fl_O
        Fl_ref = self.Fl_ref

        fs_throat = CanteraFlowStation()
        fs_exitIdeal = CanteraFlowStation()

        fs_throat.W = Fl_I.W
        fs_throat.setTotalTP( Fl_I.Tt, Fl_I.Pt )
        fs_throat.Mach = 1.0
        Athroat_dmd = fs_throat.area

        fs_exitIdeal.W = Fl_I.W
        fs_exitIdeal.setTotalTP( Fl_I.Tt, Fl_I.Pt )
        fs_exitIdeal.Ps = Fl_ref.Ps

        Fl_O.W = Fl_I.W
        Fl_O.setTotalTP( Fl_I.Tt, Fl_I.Pt )
        Fl_O.Mach = fs_exitIdeal.Mach

        if self.run_design: 
            # Design Calculations at throat
            self.Athroat_des = fs_throat.area

            # Design calculations at exit
            self.Aexit_des = fs_exitIdeal.area
            self.switchRegime = "PERFECTLY_EXPANDED"
        else:
            # Find subsonic solution, curve 4
            Fl_O.sub_or_super = "sub"
            Fl_O.area = self.Aexit_des

            MachSubsonic = Fl_O.Mach

            if MachSubsonic > 1:
                print "invalid nozzle subsonic solution"
            PsSubsonic = Fl_O.Ps

            # Find supersonic solution, curve 5
            Fl_O.sub_or_super = "super"
            PsOut = Fl_ref.Ps
            def F( Ps ):
                Fl_O.Ps = Ps
                return Fl_O.area - self.Aexit_des
            Fl_O.Ps = secant( F, PsOut )
            MachSupersonic = Fl_O.Mach
            PsSupersonic = Fl_O.Ps

            # normal shock at nozzle exit, curve c
            Fl_O.sub_or_super = "sub"
            Msuper = MachSupersonic
            PtExit = self.shockPR( Msuper, fs_throat.gams ) * fs_throat.Pt
            Fl_O.setTotalTP( fs_throat.Tt, PtExit )
            Fl_O.area = self.Aexit_des      
            PsShock = Fl_O.Ps
            
            # find correct operating regime
            # curves 1 to 4
            if Fl_ref.Ps >= PsSubsonic:
                self.switchRegime = "UNCHOKED"
                
                fs_throat.sub_or_super = "sub"
                Fl_O.sub_or_super = "sub"
                fs_throat.area = self.Athroat_des
                Fl_O.setTotalTP( fs_throat.Tt, fs_throat.Pt )
                Fl_O.area = self.Aexit_des

            # between curves 4 and c
            elif Fl_ref.Ps < PsSubsonic and Fl_ref.Ps >= PsShock:
                self.switchRegime = "NORMAL_SHOCK"

                Msuper = 1.5
                def F( MN ):
                    PtExit = self.shockPR( MN, fs_throat.gams) * fs_throat.Pt
                    Fl_O.setTotalTP( fs_throat.Tt, PtExit )
                    Fl_O.sub_or_super = "sub"
                    Fl_O.area = self.Aexit_des
                    return (Fl_O.Ps - Fl_ref.Ps)/Fl_ref.Ps
                Fl_O.Mach = secant( F, Msuper )

            # between curves c and 5
            elif Fl_ref.Ps < PsShock and Fl_ref.Ps > PsSupersonic:
                self.switchRegime = "OVEREXPANDED"
                Fl_O.sub_or_super = "super"
                Fl_O.setTotalTP( fs_throat.Tt, fs_throat.Pt )
                Fl_O.area = self.Aexit_des

            # between curves 5 and e
            elif Fl_ref.Ps <= PsSupersonic:
                self.switchRegime = "UNDEREXPANDED"
                Fl_O.sub_or_super = "super"
                Fl_O.setTotalTP( fs_throat.Tt, fs_throat.Pt )
                Fl_O.area = self.Aexit_des
            if abs(Fl_ref.Ps - PsSupersonic)/Fl_ref.Ps < .001: 
                self.switchRegime = "PERFECTLY_EXPANDED"