def heat_exchanger_sizing2(Thi, Tho, Tci, Tco, Q, dint, N_tubes, U): R = (Thi - Tho) / (Tco - Tci) P = (Tco - Tci) / (Thi - Tci) Xp = 0.9 W = (R + 1 + (((R**2) + 1)**0.5) - (2 * R * Xp)) / (R + 1 + (((R**2) + 1)**0.5) - (2 * Xp)) num_shell = (math.log((1 - (R * P)) / (1 - P))) / (math.log(W)) num_shell2 = math.ceil(num_shell) N = num_shell2 Ft = ht.F_LMTD_Fakheri(Tci=Tci, Tco=Tco, Thi=Thi, Tho=Tho, shells=N) LMTempDiff = ht.LMTD(Thi=Thi, Tho=Tho, Tci=Tci, Tco=Tco) UA = Q / (Ft * LMTempDiff) A = UA / U tubes_length = A / (N_tubes * 3.14 * dint) return { 'UA': UA, 'U': U, 'A': A, 'Ft': Ft, 'LMTD': LMTempDiff, 'Shell number': N, 'Number of tubes': N_tubes, 'tubes_length': tubes_length }
def _design(self): # This functions also finds the cost A_range, C_func, U, _ = self._evap_data components = self.components evaporators = components['evaporators'] Design = self._Design Cost = self._Cost CE = bst.CE evap0 = evaporators[0] hu = evap0._heat_utilities[0] duty = evap0._H_out - evap0._H_in hu(duty, evap0.ins[0].T, evap0.outs[0].T) Q = abs(duty) Tci = evap0.ins[0].T Tco = evap0.outs[0].T Th = evap0._heat_utilities[0]._fresh.T LMTD = ht.LMTD(Th, Th, Tci, Tco) ft = 1 A = HXutility._calc_area(LMTD, U, Q, ft) self._evap_costs = evap_costs = [C_func(A, CE)] # Find condenser requirements condenser = components['condenser'] condenser._design() condenser._cost() Cost['Condenser'] = condenser._Cost['Heat exchanger'] # Find area and cost of evaporators As = [A] for evap in evaporators[1:]: Q = evap._Q Tc = evap.outs[0].T Th = evap.outs[2].T LMTD = Th - Tc A = HXutility._calc_area(LMTD, U, Q, ft) As.append(A) if not A_range[0] < A < A_range[1]: warn('area requirement ({A}) is out of range, {A_range}') evap_costs.append(C_func(A, CE)) self._As = As Design['Area'] = A = sum(As) Design['Volume'] = vol = self._N_evap * self.tau * self.ins[0].volnet Cost['Evaporators'] = sum(evap_costs) # Calculate power power, cost = vacuum_system( massflow=0, volflow=0, P_suction=evap.outs[0].P, vol=vol, vacuum_system_preference='Liquid-ring pump') Cost['Vacuum liquid-ring pump'] = cost self._power_utility(power)
def heat_exchanger_sizing(Thi, Tho, Tci, Tco, Q, dext, dint, hsf, htf, REs, Prs, ks, REt, Prt, kt, k, tubes_length): R = (Thi - Tho) / (Tco - Tci) P = (Tco - Tci) / (Thi - Tci) Xp = 0.9 W = (R + 1 + (((R**2) + 1)**0.5) - (2 * R * Xp)) / (R + 1 + (((R**2) + 1)**0.5) - (2 * Xp)) num_shell = (math.log((1 - (R * P)) / (1 - P))) / (math.log(W)) num_shell2 = math.ceil(num_shell) N = num_shell2 Ft = ht.F_LMTD_Fakheri(Tci, Tco, Thi, Tho, shells=N) LMTempDiff = ht.LMTD(Thi=Thi, Tho=Tho, Tci=Tci, Tco=Tco) UA = Q / (Ft * LMTempDiff) shell_Nu = ht.conv_external.Nu_cylinder_Sanitjai_Goldstein(Re=REs, Pr=Prs) hshell = (shell_Nu * ks) / dext friction_factor_darcy = (1.82 * math.log10(REt) - 1.64)**(-2) tube_nu = ht.conv_internal.turbulent_Gnielinski(Re=REt, Pr=Prt, fd=friction_factor_darcy) htube = (tube_nu * kt) / dint invU = (1 / hshell) + (1 / hsf) + (dext / (2 * k)) * (math.log(dext / dint)) + ( (dext / dint) / htf) + ( (dext / dint) / htube) U = 1 / invU A = UA / U number_of_tubes = A / (tubes_length * 3.14 * dint) return { 'UA': UA, 'U': U, 'A': A, 'Ft': Ft, 'LMTD': LMTempDiff, 'Shell number': N, 'Number of tubes': number_of_tubes, 'tubes_length': tubes_length }
def test_LMTD_vect(): dTlms = [ht.LMTD(T, 60., 30., 40.2) for T in [100, 101]] dTlms_vect = ht.vectorized.LMTD([100, 101], 60., 30., 40.2) assert_allclose(dTlms, dTlms_vect)