コード例 #1
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
コード例 #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
コード例 #3
0
ファイル: tube_wall_temp.py プロジェクト: imclab/Hyperloop
    def execute(self):
        """Calculate Various Paramters"""
        
        bearing_q = cu(self.bearing_air.W,'lbm/s','kg/s') * cu(self.bearing_air.Cp,'Btu/(lbm*degR)','J/(kg*K)') * (cu(self.bearing_air.Tt,'degR','degK') - self.temp_boundary)
        nozzle_q = cu(self.nozzle_air.W,'lbm/s','kg/s') * cu(self.nozzle_air.Cp,'Btu/(lbm*degR)','J/(kg*K)') * (cu(self.nozzle_air.Tt,'degR','degK') - self.temp_boundary)
        #Q = mdot * cp * deltaT 
        self.heat_rate_pod = nozzle_q +bearing_q 
        #Total Q = Q * (number of pods)
        self.total_heat_rate_pods = self.heat_rate_pod*self.num_pods

        #Determine thermal resistance of outside via Natural Convection or forced convection
        if(self.temp_outside_ambient < 400):
            self.GrDelTL3 = 41780000000000000000*((self.temp_outside_ambient)**(-4.639)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.GrDelTL3 = 4985000000000000000*((self.temp_outside_ambient)**(-4.284)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        
        #Prandtl Number
        #Pr = viscous diffusion rate/ thermal diffusion rate = Cp * dyanamic viscosity / thermal conductivity
        #Pr << 1 means thermal diffusivity dominates
        #Pr >> 1 means momentum diffusivity dominates
        if (self.temp_outside_ambient < 400):
            self.Pr = 1.23*(self.temp_outside_ambient**(-0.09685)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.Pr = 0.59*(self.temp_outside_ambient**(0.0239))
        #Grashof Number
        #Relationship between buoyancy and viscosity
        #Laminar = Gr < 10^8
        #Turbulent = Gr > 10^9
        self.Gr = self.GrDelTL3*(self.temp_boundary-self.temp_outside_ambient)*(self.diameter_outer_tube**3)
        #Rayleigh Number 
        #Buoyancy driven flow (natural convection)
        self.Ra = self.Pr * self.Gr
        #Nusselt Number
        #Nu = convecive heat transfer / conductive heat transfer
        if (self.Ra<=10**12): #valid in specific flow regime
            self.Nu = (0.6 + 0.387*self.Ra**(1./6.)/(1 + (0.559/self.Pr)**(9./16.))**(8./27.))**2 #3rd Ed. of Introduction to Heat Transfer by Incropera and DeWitt, equations (9.33) and (9.34) on page 465
        if(self.temp_outside_ambient < 400):
            self.k = 0.0001423*(self.temp_outside_ambient**(0.9138)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.k = 0.0002494*(self.temp_outside_ambient**(0.8152))
        #h = k*Nu/Characteristic Length
        self.h = (self.k * self.Nu)/ self.diameter_outer_tube
        #Convection Area = Surface Area
        self.area_convection = pi * self.length_tube * self.diameter_outer_tube 
        #Determine heat radiated per square meter (Q)
        self.q_per_area_nat_conv = self.h*(self.temp_boundary-self.temp_outside_ambient)
        #Determine total heat radiated over entire tube (Qtotal)
        self.total_q_nat_conv = self.q_per_area_nat_conv * self.area_convection
        #Determine heat incoming via Sun radiation (Incidence Flux)
        #Sun hits an effective rectangular cross section
        self.area_viewing = self.length_tube* self.diameter_outer_tube
        self.q_per_area_solar = (1-self.surface_reflectance)* self.nn_incidence_factor * self.solar_insolation
        self.q_total_solar = self.q_per_area_solar * self.area_viewing
        #Determine heat released via radiation
        #Radiative area = surface area
        self.area_rad = self.area_convection
        #P/A = SB*emmisitivity*(T^4 - To^4)
        self.q_rad_per_area = self.sb_constant*self.emissivity_tube*((self.temp_boundary**4) - (self.temp_outside_ambient**4))
        #P = A * (P/A)
        self.q_rad_tot = self.area_rad * self.q_rad_per_area
        #------------
        #Sum Up
        self.q_total_out = self.q_rad_tot + self.total_q_nat_conv
        self.q_total_in = self.q_total_solar + self.total_heat_rate_pods
        
        self.ss_temp_residual = (self.q_total_out - self.q_total_in)/1e6
コード例 #4
0
ファイル: tube_wall_temp.py プロジェクト: imclab/Hyperloop
        def configure(self):

            tm = self.add('tm', TubeWall())
            #tm.bearing_air.setTotalTP()
            driver = self.add('driver',BroydenSolver())
            driver.add_parameter('tm.temp_boundary',low=0.,high=10000.)
            driver.add_constraint('tm.ss_temp_residual=0')

            driver.workflow.add(['tm'])

    test = TubeHeatBalance()
    set_as_top(test)

    #set input values
    test.tm.nozzle_air.setTotalTP(1710, 0.304434211)
    test.tm.nozzle_air.W = 1.08
    test.tm.bearing_air.W = 0.
    test.tm.diameter_outer_tube = 2.22504#, units = 'm', iotype='in', desc='Tube out diameter') #7.3ft
    test.tm.length_tube = 482803.#, units = 'm', iotype='in', desc='Length of entire Hyperloop') #300 miles, 1584000ft
    test.tm.num_pods = 34.#, units = 'K', iotype='in', desc='Number of Pods in the Tube at a given time') #
    test.tm.temp_boundary = 340#, units = 'K', iotype='in', desc='Average Temperature of the tube') #
    test.tm.temp_outside_ambient = 305.6#, units = 'K', iotype='in', desc='Average Temperature of the outside air') #

    test.run()

    print "-----Completed Tube Heat Flux Model Calculations---"
    print ""
    print "CompressQ-{} SolarQ-{} RadQ-{} ConvecQ-{}".format(test.tm.total_heat_rate_pods, test.tm.q_total_solar, test.tm.q_rad_tot, test.tm.total_q_nat_conv )
    print "Equilibrium Wall Temperature: {} K or {} F".format(test.tm.temp_boundary, cu(test.tm.temp_boundary,'degK','degF'))
    print "Ambient Temperature:          {} K or {} F".format(test.tm.temp_outside_ambient, cu(test.tm.temp_outside_ambient,'degK','degF'))
    print "Q Out = {} W  ==>  Q In = {} W ==> Error: {}%".format(test.tm.q_total_out,test.tm.q_total_in,((test.tm.q_total_out-test.tm.q_total_in)/test.tm.q_total_out)*100)
コード例 #5
0
    check('Da_h',test.Da_h, 0.016082)
    check('Da_e',test.Da_e, 0.039586)
    check('Dw_h',test.Dw_h, test.Di_tube)
    check('Dw_e',test.Dw_e, test.Di_tube)
    check('Re_a',test.Re_a, 966613)
    check('Re_w',test.Re_w, 41650)
    check('Pr_a',test.Pr_a, 0.68)
    check('Pr_w',test.Pr_w, 2.25)
    check('Nu_a',test.Nu_a, 1210.)
    check('Nu_w',test.Nu_w, 145.)
    check('h_a',test.h_a, 1387.989)
    check('h_w',test.h_w, 2570.589)
    check('U_o',test.U_o, 879.019)
    check('LMTD',test.LMTD, 164.28)
    if (test.N < 2): #only check single pass case
        check('L',test.L, 14.078)

    print "-----Completed Heat Exchanger Sizing---"
    print ""
    print "Heat Exchanger Length: {} meters, with {} tube pass(es)".format(test.L/2,test.N)
    
    #sqrt(#passes * tube area * packing factor)
    #assumes shell magically becomes rectangular but keeps packing factor
    packing_factor =  (test.A_a/(test.A_a + test.A_w)) + 1
    x = cu(((test.N * pi*((test.Do_tube/2)**2)*packing_factor)**0.5),'m','ft')
    y = 2*x #height of a double pass
 
    tot_vol = x*y * cu(test.L,'m','ft')
    
    print "Heat Exchanger Dimensions: {}ft (Length) x {}ft (Width) x {}ft (Height)".format(cu(test.L,'m','ft')/2,x,y)
    print "Heat Exchanger Volume: {} ft^3".format( tot_vol)
コード例 #6
0
    check('Dw_e', test.Dw_e, test.Di_tube)
    check('Re_a', test.Re_a, 966613)
    check('Re_w', test.Re_w, 41650)
    check('Pr_a', test.Pr_a, 0.68)
    check('Pr_w', test.Pr_w, 2.25)
    check('Nu_a', test.Nu_a, 1210.)
    check('Nu_w', test.Nu_w, 145.)
    check('h_a', test.h_a, 1387.989)
    check('h_w', test.h_w, 2570.589)
    check('U_o', test.U_o, 879.019)
    check('LMTD', test.LMTD, 164.28)
    if (test.N < 2):  #only check single pass case
        check('L', test.L, 14.078)

    print "-----Completed Heat Exchanger Sizing---"
    print ""
    print "Heat Exchanger Length: {} meters, with {} tube pass(es)".format(
        test.L / 2, test.N)

    #sqrt(#passes * tube area * packing factor)
    #assumes shell magically becomes rectangular but keeps packing factor
    packing_factor = (test.A_a / (test.A_a + test.A_w)) + 1
    x = cu(((test.N * pi * ((test.Do_tube / 2)**2) * packing_factor)**0.5),
           'm', 'ft')
    y = 2 * x  #height of a double pass

    tot_vol = x * y * cu(test.L, 'm', 'ft')

    print "Heat Exchanger Dimensions: {}ft (Length) x {}ft (Width) x {}ft (Height)".format(
        cu(test.L, 'm', 'ft') / 2, x, y)
    print "Heat Exchanger Volume: {} ft^3".format(tot_vol)
コード例 #7
0
ファイル: tube_wall_temp.py プロジェクト: wind1239/Hyperloop
    def execute(self):
        """Calculate Various Paramters"""
        
        bearing_q = cu(self.bearing_air.W,'lbm/s','kg/s') * cu(self.bearing_air.Cp,'Btu/(lbm*degR)','J/(kg*K)') * (cu(self.bearing_air.Tt,'degR','degK') - self.temp_boundary)
        nozzle_q = cu(self.nozzle_air.W,'lbm/s','kg/s') * cu(self.nozzle_air.Cp,'Btu/(lbm*degR)','J/(kg*K)') * (cu(self.nozzle_air.Tt,'degR','degK') - self.temp_boundary)
        #Q = mdot * cp * deltaT 
        self.heat_rate_pod = nozzle_q +bearing_q 
        #Total Q = Q * (number of pods)
        self.total_heat_rate_pods = self.heat_rate_pod*self.num_pods

        #Determine thermal resistance of outside via Natural Convection or forced convection
        if(self.temp_outside_ambient < 400):
            self.GrDelTL3 = 41780000000000000000*((self.temp_outside_ambient)**(-4.639)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.GrDelTL3 = 4985000000000000000*((self.temp_outside_ambient)**(-4.284)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        
        #Prandtl Number
        #Pr = viscous diffusion rate/ thermal diffusion rate = Cp * dyanamic viscosity / thermal conductivity
        #Pr << 1 means thermal diffusivity dominates
        #Pr >> 1 means momentum diffusivity dominates
        if (self.temp_outside_ambient < 400):
            self.Pr = 1.23*(self.temp_outside_ambient**(-0.09685)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.Pr = 0.59*(self.temp_outside_ambient**(0.0239))
        #Grashof Number
        #Relationship between buoyancy and viscosity
        #Laminar = Gr < 10^8
        #Turbulent = Gr > 10^9
        self.Gr = self.GrDelTL3*(self.temp_boundary-self.temp_outside_ambient)*(self.diameter_outer_tube**3)
        #Rayleigh Number 
        #Buoyancy driven flow (natural convection)
        self.Ra = self.Pr * self.Gr
        #Nusselt Number
        #Nu = convecive heat transfer / conductive heat transfer
        if (self.Ra<=10**12): #valid in specific flow regime
            self.Nu = (0.6 + 0.387*self.Ra**(1./6.)/(1 + (0.559/self.Pr)**(9./16.))**(8./27.))**2 #3rd Ed. of Introduction to Heat Transfer by Incropera and DeWitt, equations (9.33) and (9.34) on page 465
        if(self.temp_outside_ambient < 400):
            self.k = 0.0001423*(self.temp_outside_ambient**(0.9138)) #SI units (https://mdao.grc.nasa.gov/publications/Berton-Thesis.pdf pg51)
        else:
            self.k = 0.0002494*(self.temp_outside_ambient**(0.8152))
        #h = k*Nu/Characteristic Length
        self.h = (self.k * self.Nu)/ self.diameter_outer_tube
        #Convection Area = Surface Area
        self.area_convection = pi * self.length_tube * self.diameter_outer_tube 
        #Determine heat radiated per square meter (Q)
        self.q_per_area_nat_conv = self.h*(self.temp_boundary-self.temp_outside_ambient)
        #Determine total heat radiated over entire tube (Qtotal)
        self.total_q_nat_conv = self.q_per_area_nat_conv * self.area_convection
        #Determine heat incoming via Sun radiation (Incidence Flux)
        #Sun hits an effective rectangular cross section
        self.area_viewing = self.length_tube* self.diameter_outer_tube
        self.q_per_area_solar = (1-self.surface_reflectance)* self.nn_incidence_factor * self.solar_insolation
        self.q_total_solar = self.q_per_area_solar * self.area_viewing
        #Determine heat released via radiation
        #Radiative area = surface area
        self.area_rad = self.area_convection
        #P/A = SB*emmisitivity*(T^4 - To^4)
        self.q_rad_per_area = self.sb_constant*self.emissivity_tube*((self.temp_boundary**4) - (self.temp_outside_ambient**4))
        #P = A * (P/A)
        self.q_rad_tot = self.area_rad * self.q_rad_per_area
        #------------
        #Sum Up
        self.q_total_out = self.q_rad_tot + self.total_q_nat_conv
        self.q_total_in = self.q_total_solar + self.total_heat_rate_pods
        
        self.ss_temp_residual = (self.q_total_out - self.q_total_in)/1e6
コード例 #8
0
ファイル: tube_wall_temp.py プロジェクト: wind1239/Hyperloop
        def configure(self):

            tm = self.add('tm', TubeWallTemp())
            #tm.bearing_air.setTotalTP()
            driver = self.add('driver',BroydenSolver())
            driver.add_parameter('tm.temp_boundary',low=0.,high=10000.)
            driver.add_constraint('tm.ss_temp_residual=0')

            driver.workflow.add(['tm'])

    test = TubeHeatBalance()
    set_as_top(test)

    #set input values
    test.tm.nozzle_air.setTotalTP(1710, 0.304434211)
    test.tm.nozzle_air.W = 1.08
    test.tm.bearing_air.W = 0.
    test.tm.diameter_outer_tube = 2.22504#, units = 'm', iotype='in', desc='Tube out diameter') #7.3ft
    test.tm.length_tube = 482803.#, units = 'm', iotype='in', desc='Length of entire Hyperloop') #300 miles, 1584000ft
    test.tm.num_pods = 34.#, units = 'K', iotype='in', desc='Number of Pods in the Tube at a given time') #
    test.tm.temp_boundary = 340#, units = 'K', iotype='in', desc='Average Temperature of the tube') #
    test.tm.temp_outside_ambient = 305.6#, units = 'K', iotype='in', desc='Average Temperature of the outside air') #

    test.run()

    print "-----Completed Tube Heat Flux Model Calculations---"
    print ""
    print "CompressQ-{} SolarQ-{} RadQ-{} ConvecQ-{}".format(test.tm.total_heat_rate_pods, test.tm.q_total_solar, test.tm.q_rad_tot, test.tm.total_q_nat_conv )
    print "Equilibrium Wall Temperature: {} K or {} F".format(test.tm.temp_boundary, cu(test.tm.temp_boundary,'degK','degF'))
    print "Ambient Temperature:          {} K or {} F".format(test.tm.temp_outside_ambient, cu(test.tm.temp_outside_ambient,'degK','degF'))
    print "Q Out = {} W  ==>  Q In = {} W ==> Error: {}%".format(test.tm.q_total_out,test.tm.q_total_in,((test.tm.q_total_out-test.tm.q_total_in)/test.tm.q_total_out)*100)