예제 #1
0
 def find_inlet_conditions(self):
     """ Finds inlet temperature to core from inlet enthalpy (h_in must be found first) """
     obj = ST(P=self.pressure.to(self.U.MPa).magnitude,
              h=self.h_in.to(self.U.kJ / self.U.kg).magnitude)
     self.T_inf = (obj.T * self.U.degK).to(self.U.degR)
     self.rho_in = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
         self.U.lb / self.U.foot**3)
예제 #2
0
 def density(self, x):
     """ Returns the mixture density in the core """
     if x <= self.h_0.magnitude:
         en = ((self.h_z(x).to(self.U.kJ / self.U.kg) -
                self.quality(x) * self.h_g) /
               (1 - self.quality(x))).magnitude
         stuff = ST(h=en, P=self.pressure.to(self.U.MPa).magnitude)
         return (1 / (stuff.v * (self.U.m**3 / self.U.kg))).to(
             self.U.lb / self.U.foot**3).magnitude
     else:
         return (self.Dix(x) * self.rho_g +
                 (1 - self.Dix(x)) * self.rho_f).magnitude
예제 #3
0
    def __init__(self, pitch, D_clad, n_rods, height, pressure, n_grids,
                 k_grid, core_height, k_core_in, k_core_out, v_ID, b_OD, L_d,
                 k_d, L_hl, D_hl, HL_LD, k_hl_in, k_hl_out, k_sg_in, k_sg_out,
                 SG_LD, D_sg, SG_th, n_tubes, A_total, L_cl, D_cl, k_cl_in,
                 k_cl_out, CL_LD, T_in, T_out, m, U, loops):

        self.pitch, self.D_clad, self.n_rods, self.height, self.pressure, self.n_grids = pitch, D_clad, n_rods, height, pressure, n_grids
        self.k_grid, self.core_height, self.k_core_in, self.k_core_out, self.v_ID = k_grid, core_height, k_core_in, k_core_out, v_ID
        self.b_OD, self.L_d, self.k_d, self.L_hl, self.D_hl = b_OD, L_d, k_d, L_hl, D_hl
        self.k_hl_in, self.k_hl_out, self.HL_LD = k_hl_in, k_hl_out, HL_LD
        self.k_sg_in, self.k_sg_out, self.SG_LD = k_sg_in, k_sg_out, SG_LD
        self.D_sg, self.SG_th, self.n_tubes = D_sg, SG_th, n_tubes
        self.A_total, self.L_cl, self.D_cl, self.k_cl_in = A_total, L_cl, D_cl, k_cl_in
        self.k_cl_out, self.CL_LD = k_cl_out, CL_LD
        self.T_in, self.T_out, self.m, self.U, self.loops = T_in, T_out, m, U, loops

        self.U = U
        self.g = 32.2 * U.foot / U.s**2
        g = 32.2 * U.foot / U.s**2

        obj = ST(T=((T_in + T_out) / 2).to(self.U.degK).magnitude,
                 P=pressure.to(self.U.MPa).magnitude)
        self.rho = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(self.U.lb /
                                                                self.U.foot**3)
        self.mu = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))

        self.epsilon1 = .000005 * self.U.foot
        self.epsilon2 = .00015 * self.U.foot

        # Total Pressure Drop
        self.P_total = (self.P_sg(self.m) + self.P_hot_leg(self.m) +
                        self.P_cold_leg(self.m) + self.P_core(self.m) +
                        self.P_downcomer(self.m) +
                        self.rho * self.g * self.L_d -
                        self.rho * self.g * self.core_height)
        self.G_cl_stable = self.G_cl
        # Pump Work
        self.work = (self.m / self.loops) * (self.P_total / self.rho) / .75
        self.G_core_initial = self.G_core
        self.unit1 = 1 * self.U.lb / self.U.hour / self.U.foot**2
        self.G_values = fsolve(self.function, (10**7, 10**7, 10**6))
예제 #4
0
    def __init__(self,
                 power=None,
                 height=None,
                 pitch=None,
                 T_inf=None,
                 PF_power=None,
                 PF_axial=None,
                 D_clad=None,
                 c_thick=None,
                 D_pellet=None,
                 k_c=None,
                 n_rods=None,
                 hg=None,
                 pressure=None,
                 G=None,
                 gamma=None,
                 cp=None,
                 U=None,
                 T_sat=None,
                 channel='average',
                 heat_flux=None,
                 h_in=None,
                 method='thom',
                 life='MOC',
                 CPR=None,
                 core_height=None,
                 D_clad_inner=None,
                 W_can=None,
                 n_w_rods=None,
                 n_grids=None,
                 k_grid=None,
                 T_fuel_max=None,
                 k_core_in=None,
                 k_core_out=None,
                 k_dc=None,
                 k_dry_in=None,
                 k_dry_out=None,
                 D_vessel=None,
                 D_chimney=None,
                 n_dryers=None,
                 A_sep=None,
                 L_sep=None,
                 L_dc=None):

        # Defining all initial class attributes (variables) to be used throughout code
        self.U = U
        self.core_height, self.D_clad_inner, self.W_can = core_height, D_clad_inner, W_can
        self.n_w_rods, self.n_grids, self.k_grid, self.T_fuel_max = n_w_rods, n_grids, k_grid, T_fuel_max
        self.k_core_in, self.k_core_out, self.k_dc, self.k_dry_in = k_core_in, k_core_out, k_dc, k_dry_in
        self.k_dry_out, self.D_vessel, self.D_chimney, self.n_dryers = k_dry_out, D_vessel, D_chimney, n_dryers
        self.A_sep, self.L_sep, self.L_dc = A_sep, L_sep, L_dc
        self.gamma, self.life, self.CPR = gamma, life, CPR
        self.height = height.to(self.U.inch)
        self.pitch = pitch.to(self.U.inch)
        self.PF_axial = PF_axial
        self.D_clad = D_clad.to(self.U.inch)
        self.power = power.to(self.U.MW)
        self.PF_power = PF_power
        self.n_rods = n_rods
        self.k_c = k_c.to(self.U.Btu /
                          (self.U.hour * self.U.feet * self.U.rankine))
        self.hg = hg.to(self.U.Btu /
                        (self.U.hour * self.U.feet**2 * self.U.rankine))

        try:
            if D_pellet == None:
                D_pellet = D_clad - 2 * c_thick
                self.D_pellet = D_pellet.to(self.U.inch)
            else:
                self.D_pellet = D_pellet.to(self.U.inch)
        except:
            pass

        # Finding necessary areas and equivalent diameters
        self.Ax = (pitch**2 - np.pi * (D_clad**2) / 4)
        self.A_assembly = W_can**2 - 92 * np.pi * (D_clad**2) / 4
        self.A_core = self.A_assembly * 45
        self.A_dc = np.pi / 4 * (self.D_vessel**2 - self.D_chimney**2)
        self.De_dc = self.D_vessel - self.D_chimney
        self.De_sep = ((self.A_sep * 4 / np.pi)**0.5)
        self.De = (4 * (pitch**2 - np.pi * (D_clad**2) / 4)) / (np.pi * D_clad)
        self.A_ch = np.pi * self.D_chimney**2 / 4

        # Defining useful terms for later calculations
        self.pressure = pressure.to(self.U.psi)
        self.p_crit = 3206 * self.U.psi
        self.h0_guess = 5
        self.g = 32.2 * U.foot / U.s**2
        self.mesh_size = 10
        self.z_mesh = np.linspace(0, self.height.magnitude, self.mesh_size)

        # Determining feed inlet enthalpy
        obj = ST(P=pressure.to(self.U.MPa).magnitude,
                 T=T_inf.to(self.U.degK).magnitude)
        self.h_feed_in = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu /
                                                            self.U.lb)
        self.rho_in = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
            self.U.lb / self.U.foot**3)

        # Finding all state values for saturation etc.
        obj = ST(P=pressure.to(self.U.MPa).magnitude, x=0)
        self.T_sat = (obj.T * self.U.degK).to(self.U.degR)
        self.rho_f = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
            self.U.lb / self.U.foot**3)
        self.sigma = (obj.sigma * self.U.N / self.U.m).to(self.U.lbf /
                                                          self.U.foot)
        self.h_f = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)
        self.mu_f = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))
        self.k_f = (obj.k * self.U.W / (self.U.m * self.U.degK)).to(
            self.U.Btu / self.U.hour / self.U.foot / self.U.degR)
        self.cp_f = (obj.cp * U.kJ / U.degK / U.kg).to(
            self.U.Btu / (self.U.lb * self.U.degR))
        self.prandt = obj.Prandt
        self.cp = (obj.cp * U.kJ / U.degK / U.kg).to(self.U.Btu /
                                                     (self.U.lb * self.U.degR))
        self.mu = obj.mu * self.U.Pa * self.U.s
        self.k_water = obj.k * self.U.W / (self.U.m * self.U.degK)

        obj = ST(P=pressure.to(self.U.MPa).magnitude, x=1)
        self.rho_g = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
            self.U.lb / self.U.foot**3)
        self.h_g = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)
        self.mu_g = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))
        self.h_fg = self.h_g - self.h_f
        self.v_fg = 1 / (self.rho_f - self.rho_g)
        self.gc = 32.2 * (self.U.lb * self.U.foot) / (self.U.lbf * self.U.s**2)
        self.method = method
        self.shape = 1

        # Finds the lambda for beginning of cycle
        def trial(x):
            return x * np.cos(x) + np.sin(x)

        x1 = root(trial, 2).x[0]
        self.shape = np.sin(x1) * x1

        def q_z2(z, lambda_):
            return (np.pi * (self.height.magnitude + lambda_ - z) /
                    (self.height.magnitude + 2 * lambda_)) * np.sin(
                        np.pi * (self.height.magnitude + lambda_ - z) /
                        (self.height.magnitude + 2 * lambda_))

        def find_lambda(lambda_):
            return self.PF_axial - (
                (self.shape * self.height.magnitude) /
                (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

        self.lambda_ = root(find_lambda, 1).x[0] * self.U.inch

        # defining roughness and calculating mass flow rate of feed from inputs
        self.epsilon1 = .000005 * self.U.foot
        self.epsilon2 = .00015 * self.U.foot
        self.m_dot_fd = self.power / (self.h_g - self.h_feed_in)
예제 #5
0
    def __init__(self, heat_flux, pressure, mass_flux, enthalpy, height, Fx,
                 pitch, D_rod, U, intervals, life):
        self.U = U
        self.heat_flux = heat_flux.to(self.U.Btu / self.U.hour /
                                      self.U.foot**2)
        self.height = height.to(self.U.inch)
        self.pitch = pitch.to(self.U.inch)
        self.Fx = Fx
        self.D_rod = D_rod.to(self.U.inch)
        self.pressure = pressure.to(self.U.psi)
        self.G = mass_flux.to(self.U.lb / (self.U.hour * self.U.feet**2))
        self.h1 = enthalpy.to(self.U.Btu / self.U.lb)
        self.ax = self.pitch**2 - (np.pi / 4) * self.D_rod**2
        self.De = (4 * (self.ax)) / (np.pi * self.D_rod)
        self.gravity = 9.81 * self.U.m / self.U.s**2
        self.intervals = intervals

        obj0 = ST(P=pressure.to(self.U.MPa).magnitude, x=0)
        self.rho_l = (1 / obj0.v * self.U.kg / self.U.m**3).to(self.U.lb /
                                                               self.U.foot**3)
        self.h_f = (obj0.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)

        obj1 = ST(P=pressure.to(self.U.MPa).magnitude, x=1)
        self.rho_g = (1 / obj1.v * self.U.kg / self.U.m**3).to(self.U.lb /
                                                               self.U.foot**3)
        self.h_g = (obj1.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)
        self.sigma = (obj1.sigma * self.U.N / self.U.m).to(self.U.lbf /
                                                           self.U.feet)
        self.life = life

        self.h_fg = self.h_g - self.h_f
        self.inst = 0

        if life == 'MOC':
            """ Finds the lambda for middle of cycle """
            def q_z2(z, lambda_):
                return np.sin(np.pi * ((z + lambda_) /
                                       (self.height.magnitude + 2 * lambda_)))

            def find_lambda(lambda_):
                return self.Fx - (
                    self.height.magnitude /
                    (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

            self.lambda_ = root(find_lambda, 1).x[0] * self.U.inch
        elif life == 'BOC':
            """ Finds the lambda for beginning of cycle """
            def trial(x):
                return x * np.cos(x) + np.sin(x)

            x1 = root(trial, 2).x[0]
            hold = np.sin(x1) * x1

            def q_z2(z, lambda_):
                return (np.pi * (self.height.magnitude + lambda_ - z) /
                        (self.height.magnitude + 2 * lambda_)) * np.sin(
                            np.pi * (self.height.magnitude + lambda_ - z) /
                            (self.height.magnitude + 2 * lambda_))

            def find_lambda(lambda_):
                return self.Fx - (
                    (hold * self.height.magnitude) /
                    (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

            self.lambda_ = root(find_lambda, 36).x[0] * self.U.inch

        def find_q_dprime(x1):
            """ Used for finding the q naught """
            return ((x1 / self.height) *
                    quad(self.q_dprime, 0, self.height.magnitude)[0] *
                    self.U.inch) - self.heat_flux.magnitude

        self.q_dprime_avg = root(find_q_dprime, 150000).x[0] * (
            self.U.Btu / self.U.hour / self.U.foot**2)
예제 #6
0
    def __init__(self,
                 power=None,
                 height=None,
                 pitch=None,
                 T_inf=None,
                 Fq=None,
                 Fx=None,
                 D_clad=None,
                 c_thick=None,
                 D_pellet=None,
                 k_c=None,
                 n_rods=None,
                 hg=None,
                 pressure=None,
                 G=None,
                 gamma=None,
                 cp=None,
                 U=None,
                 T_sat=None,
                 channel='average',
                 heat_flux=None,
                 h_in=None,
                 method='thom',
                 life='MOC',
                 CPR=None):
        self.U = U
        if power != None:
            self.power = power.to(self.U.MW)
        if T_inf != None:
            self.T_inf = T_inf.to(self.U.degR)
        if Fq != None:
            self.Fq = Fq
        if n_rods != None:
            self.n_rods = n_rods
        if c_thick != None:
            self.c_thick = c_thick.to(self.U.inch)
        if k_c != None:
            self.k_c = k_c.to(self.U.Btu /
                              (self.U.hour * self.U.feet * self.U.rankine))
        if hg != None:
            self.hg = hg.to(self.U.Btu /
                            (self.U.hour * self.U.feet**2 * self.U.rankine))
        try:
            if D_pellet == None:
                D_pellet = D_clad - 2 * c_thick
                self.D_pellet = D_pellet.to(self.U.inch)
            else:
                self.D_pellet = D_pellet.to(self.U.inch)
        except:
            pass

        self.height = height.to(self.U.inch)
        self.pitch = pitch.to(self.U.inch)
        self.Fx = Fx
        self.D_clad = D_clad.to(self.U.inch)
        self.Ax = pitch**2 - np.pi * (D_clad**2) / 4
        self.De = (4 * (pitch**2 - np.pi * (D_clad**2) / 4)) / (np.pi * D_clad)
        self.pressure = pressure.to(self.U.psi)
        self.G = G.to(self.U.lb / (self.U.hour * self.U.feet**2))
        self.gamma = gamma
        self.life = life
        self.CPR = CPR
        self.p_crit = 3206 * self.U.psi
        self.h0_guess = 20
        self.gravity = 9.81 * self.U.m / self.U.s**2
        if h_in != None:
            self.h_in = h_in
        else:
            obj = ST(P=pressure.to(self.U.MPa).magnitude,
                     T=T_inf.to(self.U.degK).magnitude)
            self.h_in = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu /
                                                           self.U.lb)

        obj = ST(P=pressure.to(self.U.MPa).magnitude, x=0)
        self.T_sat = (obj.T * self.U.degK).to(self.U.degR)
        self.rho_f = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
            self.U.lb / self.U.foot**3)
        self.sigma = (obj.sigma * self.U.N / self.U.m).to(self.U.lbf /
                                                          self.U.foot)
        self.h_f = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)
        self.mu_f = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))
        self.k_f = (obj.k * self.U.W / (self.U.m * self.U.degK)).to(
            self.U.Btu / self.U.hour / self.U.foot / self.U.degR)
        self.cp_f = (obj.cp * U.kJ / U.degK / U.kg).to(
            self.U.Btu / (self.U.lb * self.U.degR))

        obj = ST(P=pressure.to(self.U.MPa).magnitude, x=1)
        self.rho_g = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(
            self.U.lb / self.U.foot**3)
        self.h_g = (obj.h * self.U.kJ / self.U.kg).to(self.U.Btu / self.U.lb)
        self.mu_g = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))
        self.h_fg = self.h_g - self.h_f
        self.v_fg = 1 / (self.rho_f - self.rho_g)
        self.gc = 32.2 * (self.U.lb * self.U.foot) / (self.U.lbf * self.U.s**2)
        self.method = method
        self.shape = 1

        if life == 'MOC' or self.life == 'Nominal':
            """ Finds the lambda for middle of cycle """
            def q_z2(z, lambda_):
                return np.sin(np.pi * ((z + lambda_) /
                                       (self.height.magnitude + 2 * lambda_)))

            def find_lambda(lambda_):
                return self.Fx - (
                    self.height.magnitude /
                    (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

            self.lambda_ = root(find_lambda, 1).x[0] * self.U.inch
        elif life == 'BOC' or self.life == 'Bottom':
            """ Finds the lambda for beginning of cycle """
            def trial(x):
                return x * np.cos(x) + np.sin(x)

            x1 = root(trial, 2).x[0]
            self.shape = np.sin(x1) * x1

            def q_z2(z, lambda_):
                return (np.pi * (self.height.magnitude + lambda_ - z) /
                        (self.height.magnitude + 2 * lambda_)) * np.sin(
                            np.pi * (self.height.magnitude + lambda_ - z) /
                            (self.height.magnitude + 2 * lambda_))

            def find_lambda(lambda_):
                return self.Fx - (
                    (self.shape * self.height.magnitude) /
                    (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

            self.lambda_ = root(find_lambda, 1).x[0] * self.U.inch
        elif self.life == 'Top':
            """ Finds the lambda for Top Peaked Core """
            def trial(x):
                return x * np.cos(x) + np.sin(x)

            x1 = root(trial, 2).x[0]
            self.shape = np.sin(x1) * x1

            def q_z2(z, lambda_):
                return (np.pi * (lambda_ + z) /
                        (self.height.magnitude + 2 * lambda_)) * np.sin(
                            np.pi * (lambda_ + z) /
                            (self.height.magnitude + 2 * lambda_))

            def find_lambda(lambda_):
                return self.Fx - (
                    (self.shape * self.height.magnitude) /
                    (quad(q_z2, 0, self.height.magnitude, args=(lambda_))[0]))

            self.lambda_ = root(find_lambda, 1).x[0] * self.U.inch

        try:
            if channel == 'average':
                self.q_dprime = ((gamma * power * Fx) /
                                 (n_rods * np.pi * self.D_clad * height)).to(
                                     self.U.lb / self.U.second**3)
            elif channel == 'hot':
                holder = ((gamma * power) /
                          (n_rods * np.pi * self.D_clad * height)).to(
                              self.U.lb / self.U.second**3)
                self.q_dprime = holder * Fq
            else:
                self.q_dprime = ((gamma * power * Fx) /
                                 (n_rods * np.pi * self.D_clad * height)).to(
                                     self.U.lb / self.U.second**3)
        except:
            pass

        try:
            try:
                self.heat_flux = heat_flux.to(self.U.Btu / self.U.hour /
                                              self.U.foot**2)

                def find_q_dprime(x1):
                    """ Used for finding the q_0 """
                    return ((x1 / self.height) *
                            quad(self.q_z, 0, self.height.magnitude)[0] *
                            self.U.inch) - self.heat_flux.magnitude

                self.q_dprime = root(find_q_dprime, 150000).x[0] * (
                    self.U.Btu / self.U.hour / self.U.foot**2)
            except:
                self.q_dprime = self.q_dprime / self.shape
        except:
            pass

        if T_inf != None:
            T_holding = (self.T_inf + self.T_sat) / 2
            obj = ST(P=pressure.to(self.U.MPa).magnitude,
                     T=T_holding.to(self.U.degK).magnitude)
        else:
            obj = ST(P=pressure.to(self.U.MPa).magnitude,
                     h=h_in.to(self.U.kJ / self.U.kg).magnitude)
            self.T_inf = (obj.T * self.U.degK).to(self.U.degR)

        self.prandt = obj.Prandt
        self.cp = (obj.cp * U.kJ / U.degK / U.kg).to(self.U.Btu /
                                                     (self.U.lb * self.U.degR))
        self.mu = obj.mu * self.U.Pa * self.U.s
        self.k_water = obj.k * self.U.W / (self.U.m * self.U.degK)
        self.h0 = obj.h * self.U.kJ / self.U.kg
        self.reynolds = ((self.G * self.De / self.mu).to(
            self.U.dimensionless)).magnitude
        self.hc = (.042 * pitch / D_clad -
                   .024) * self.reynolds**.8 * self.prandt**(1 / 3) * (
                       self.k_water / (4 * (pitch**2 - np.pi *
                                            (D_clad**2 / 4)) /
                                       (np.pi * D_clad)))
        self.hc = self.hc.to(self.U.Btu /
                             (self.U.hour * self.U.foot**2 * self.U.degR))

        try:
            T_holder = self.T_coolant(self.height)
            T_holding = (self.T_inf + T_holder) / 2
            obj = ST(P=pressure.to(self.U.MPa).magnitude,
                     T=T_holding.to(self.U.degK).magnitude)
            self.prandt = obj.Prandt
            self.cp = (obj.cp * U.kJ / U.degK / U.kg).to(
                self.U.Btu / (self.U.lb * self.U.degR))
            self.mu = obj.mu * self.U.Pa * self.U.s
            self.k_water = obj.k * self.U.W / (self.U.m * self.U.degK)
            self.h0 = obj.h * self.U.kJ / self.U.kg
            self.reynolds = ((self.G * self.De / self.mu).to(
                self.U.dimensionless)).magnitude
            self.hc = (.042 * pitch / D_clad -
                       .024) * self.reynolds**.8 * self.prandt**(1 / 3) * (
                           self.k_water / (4 * (pitch**2 - np.pi *
                                                (D_clad**2 / 4)) /
                                           (np.pi * D_clad)))
            self.hc = self.hc.to(self.U.Btu /
                                 (self.U.hour * self.U.foot**2 * self.U.degR))
        except:
            pass

        self.T_mixed_guess = 1100
        try:
            self.zn = self.find_zn()
            self.zb_guess = self.find_zn().magnitude + 36
            self.zb = self.find_zb()
        except:
            pass

        try:
            self.x_c1 = self.x_c1()
            self.x_c2 = self.x_c2()
            self.h_0 = self.find_h0().to(self.U.inch)
            holder = self.max_Q()
        except:
            pass

        try:
            self.h2_flux = self.h_2flux()
        except:
            pass
예제 #7
0
    def __init__(self, m, T_hl, T_cl, A_ht, n_tubes, D, wall_th, L, radius_max,
                 radius_min, plate_th, inlet_k, exit_k, eq_long, eq_short, U):

        #Inputs
        self.m = m
        self.T_hl = T_hl
        self.T_cl = T_cl
        self.A_ht = A_ht
        self.n_tubes = n_tubes
        self.D = D
        self.wall_th = wall_th
        self.L = L
        self.radius_max = radius_max
        self.radius_min = radius_min
        self.plate_th = plate_th
        self.inlet_k = inlet_k
        self.exit_k = exit_k
        self.eq_long = eq_long
        self.eq_short = eq_short
        self.U = U

        #Start Calculations
        self.Di = D - 2 * wall_th
        self.G = m / (n_tubes * np.pi / 4 * self.Di**2)
        self.L_long = 2 * self.L + np.pi * self.radius_max
        self.L_short = 2 * self.L + np.pi * self.radius_min
        self.L_avg = (self.L_long + self.L_short) / 2
        self.L_tube = (A_ht / (n_tubes * np.pi * D)).to(self.U.foot)

        T_avg = (T_hl + T_cl) / 2
        obj = ST(T=T_avg.to(self.U.degK).magnitude, x=0)
        obj = ST(T=T_avg.to(self.U.degK).magnitude,
                 P=(2250 * self.U.psi).to(self.U.MPa).magnitude)
        self.rho = (1 / (obj.v * (self.U.m**3 / self.U.kg))).to(self.U.lb /
                                                                self.U.foot**3)
        self.mu = (obj.mu * self.U.Pa * self.U.s).to(
            self.U.lb / (self.U.foot * self.U.hour))
        self.epsilon = .000005 * self.U.foot
        self.Re = ((self.G * self.Di) / self.mu).to(
            self.U.dimensionless).magnitude
        self.friction = root(self.root_friction,
                             .01,
                             args=(self.epsilon, self.Di, self.Re)).x[0]

        self.dP_plate = (self.inlet_k + self.friction * self.plate_th /
                         self.Di) * self.G**2 / (2 * self.rho) + self.G**2 / (
                             2 * self.rho)
        self.dP_loss = self.friction * (
            2 * self.L / self.Di +
            (self.eq_long + self.eq_short) / 2) * self.G**2 / (2 * self.rho)
        self.dP_exit = (self.exit_k + self.friction * self.plate_th /
                        self.Di) * self.G**2 / (2 * self.rho)
        self.total_dp = (self.dP_plate + self.dP_loss + self.dP_exit).to(U.psi)

        self.long_k = (self.friction * (self.L_long / self.Di + eq_long)).to(
            self.U.dimensionless).magnitude
        self.short_k = (self.friction *
                        (self.L_short / self.Di + eq_short)).to(
                            self.U.dimensionless).magnitude

        self.v_avg = self.G / self.rho
        self.G_long = root(self.long, 10**
                           6).x[0] * (self.U.lb / self.U.foot**2 / self.U.hour)
        self.G_short = root(self.short, 10**6).x[0] * (
            self.U.lb / self.U.foot**2 / self.U.hour)
        self.v_long = self.G_long / self.rho
        self.v_short = self.G_short / self.rho