def _TwoPhase_Forward(self,w_2phase): DWS=DWSVals() #DryWetSegment structure # Store temporary values to be passed to DryWetSegment DWS.Fins=self.Fins DWS.FinsType = self.FinsType DWS.A_a=self.Fins.A_a*w_2phase DWS.cp_da=self.Fins.cp_da DWS.eta_a=self.Fins.eta_a DWS.h_a=self.Fins.h_a #Heat transfer coefficient, not enthalpy DWS.mdot_da=self.mdot_da*w_2phase DWS.pin_a=self.Fins.Air.p DWS.Tdew_r=self.Tdew_r DWS.Tbubble_r=self.Tbubble_r DWS.Tin_a=self.Tin_a DWS.RHin_a=self.Fins.Air.RH DWS.Tin_r=self.Tsat_r DWS.A_r=self.A_r_wetted*w_2phase DWS.cp_r=1.0e15 #In the two-phase region the cp is infinite, use 1e15 as a big number; DWS.pin_r=self.psat_r DWS.mdot_r=self.mdot_r DWS.IsTwoPhase=True #Target heat transfer to go from inlet quality to saturated vapor Q_target=self.mdot_r*(self.xout_2phase-self.xin_r)*self.h_fg if Q_target<0: raise ValueError('Q_target in Evaporator must be positive') # Average Refrigerant heat transfer coefficient DWS.h_r=ShahEvaporation_Average(self.xin_r,self.xout_2phase,self.Ref,self.G_r,self.ID,self.psat_r,Q_target/DWS.A_r,self.Tbubble_r,self.Tdew_r) #Run the DryWetSegment to carry out the heat and mass transfer analysis DryWetSegment(DWS) self.Q_2phase=DWS.Q self.Q_sensible_2phase=DWS.Q_sensible self.h_r_2phase=DWS.h_r self.fdry_2phase=DWS.f_dry self.Tout_a_2phase=DWS.Tout_a rho_average=TwoPhaseDensity(self.Ref,self.xin_r,self.xout_2phase,self.Tdew_r,self.Tbubble_r,slipModel='Zivi') self.Charge_2phase = rho_average * w_2phase * self.V_r #Frictional pressure drop component DP_frict=LMPressureGradientAvg(self.xin_r,self.xout_2phase,self.Ref,self.G_r,self.ID,self.Tbubble_r,self.Tdew_r)*self.Lcircuit*w_2phase #Accelerational pressure drop component DP_accel=AccelPressureDrop(self.xin_r,self.xout_2phase,self.Ref,self.G_r,self.Tbubble_r,self.Tdew_r)*self.Lcircuit*w_2phase self.DP_r_2phase=DP_frict+DP_accel; if self.Verbosity>7: print w_2phase,DWS.Q,Q_target,self.xin_r,"w_2phase,DWS.Q,Q_target,self.xin_r" return DWS.Q-Q_target
def _TwoPhaseH_OnePhaseC_Qimposed(self,Inputs): """ Hot stream is condensing, cold stream is single phase """ h_h_2phase=LongoCondensation((Inputs['xout_h']+Inputs['xin_h'])/2,self.mdot_h/self.A_h_flow,self.Dh_h,self.Ref_h,self.Tbubble_h,self.Tdew_h); h_c,cp_c,PlateOutput_c=self.PlateHTDP(self.Ref_c, Inputs['Tmean_c'], Inputs['pin_c'],self.mdot_c/self.NgapsCold) #Use cp calculated from delta h/delta T cp_c=Inputs['cp_c'] UA_total=1/(1/(h_c*self.A_c_wetted)+1/(h_h_2phase*self.A_h_wetted)+self.PlateThickness/(self.PlateConductivity*(self.A_c_wetted+self.A_h_wetted)/2.)) C_c=cp_c*self.mdot_c Q=Inputs['Q'] Qmax=C_c*(Inputs['Tsat_h']-Inputs['Tin_c']) epsilon=Q/Qmax #Cr = 0, so NTU is simply try: NTU=-log(1-epsilon) except: pass UA_req=NTU*C_c w=UA_req/UA_total rho_c=Props('D','T',Inputs['Tmean_c'], 'P', self.pin_c, self.Ref_c) Charge_c = w * self.V_c * rho_c rho_h=TwoPhaseDensity(self.Ref_h,Inputs['xout_h'],Inputs['xin_h'],self.Tdew_h,self.Tbubble_h,slipModel='Zivi') Charge_h = w * self.V_h * rho_h #Use Lockhart Martinelli to calculate the pressure drop. Claesson found good agreement using C parameter of 4.67 DP_frict_h=LMPressureGradientAvg(Inputs['xin_h'],Inputs['xout_h'],self.Ref_h,self.mdot_h/self.A_h_flow,self.Dh_h,self.Tbubble_h,self.Tdew_h,C=4.67)*w*self.Lp #Accelerational pressure drop component DP_accel_h=-AccelPressureDrop(Inputs['xin_h'],Inputs['xout_h'],self.Ref_h,self.mdot_h/self.A_h_flow,self.Tbubble_h,self.Tdew_h) #Pack outputs Outputs={ 'w': w, 'Tout_c': Inputs['Tin_c']-Q/(self.mdot_c*cp_c), 'DP_c': -PlateOutput_c['DELTAP'], 'DP_h': DP_frict_h+DP_frict_h, 'Charge_c':Charge_c, 'Charge_h':Charge_h, 'h_h':h_h_2phase, 'h_c':h_c, } return dict(Inputs.items()+Outputs.items())
def _TwoPhase_Forward(self, w_2phase=1.0, xout_2phase=1.0): # Update outlet quality field [-] self.xout_2phase = xout_2phase # Heat transfer rate based on inlet quality [W] self.Q_2phase = self.mdot_r * (self.xout_2phase - self.xin_r) * self.h_fg # Heat flux in 2phase section (for Shah correlation) [W/m^2] q_flux = self.Q_2phase / (w_2phase * self.A_r_wetted) # self.h_r_2phase = ShahEvaporation_Average(self.xin_r, 1.0, self.Ref_r, self.G_r, self.Dh_r, self.pin_r, q_flux, self.Tbubble_r, self.Tdew_r) UA_2phase = w_2phase / (1 / (self.h_g * self.A_g_wetted) + 1 / (self.h_r_2phase * self.A_r_wetted) + self.Rw) C_g = self.cp_g * self.mdot_g Ntu_2phase = UA_2phase / (C_g) #for Cr=0 and counter flow in two-phase: epsilon_2phase = 1 - exp(-Ntu_2phase) Q_2phase_eNTU = epsilon_2phase * C_g * (self.T_g_x - self.Tsat_r) rho_average = TwoPhaseDensity(self.Ref_r, self.xin_r, xout_2phase, self.Tdew_r, self.Tbubble_r, slipModel='Zivi') self.Charge_r_2phase = rho_average * w_2phase * self.V_r # Frictional prssure drop component DP_frict = LMPressureGradientAvg(self.xin_r, xout_2phase, self.Ref_r, self.G_r, self.Dh_r, self.Tbubble_r, self.Tdew_r) * w_2phase * self.L # Accelerational prssure drop component DP_accel = AccelPressureDrop(self.xin_r, xout_2phase, self.Ref_r, self.G_r, self.Tbubble_r, self.Tdew_r) * w_2phase * self.L self.DP_r_2phase = DP_frict + DP_accel if self.Verbosity > 4: print Q_2phase_eNTU - self.Q_2phase return Q_2phase_eNTU - self.Q_2phase
def _TwoPhase_Forward(self, xout_r_2phase=0.0): """ xout_r_2phase: quality of refrigerant at end of two-phase portion default value is 0.0 (full two phase region) """ ## Bubble and dew temperatures (same for fluids without glide) Tbubble = self.Tbubble Tdew = self.Tdew ## Mean temperature for use in HT relationships Tsat_r = (Tbubble + Tdew) / 2 h_fg = (PropsSI('H', 'T', Tdew, 'Q', 1, self.Ref) - PropsSI('H', 'T', Tbubble, 'Q', 0, self.Ref)) #*1000 #J/kg # This block calculates the average refrigerant heat transfer coefficient by # integrating the local heat transfer coefficient between # a quality of 1.0 and the outlet quality self.h_r_2phase = ShahCondensation_Average(xout_r_2phase, 1.0, self.Ref, self.G_r, self.ID, self.psat_r, Tbubble, Tdew) UA_overall = 1 / (1 / (self.Fins.eta_a * self.Fins.h_a * self.Fins.A_a) + 1 / (self.h_r_2phase * self.A_r_wetted)) self.epsilon_2phase = 1 - exp(-UA_overall / (self.mdot_da * self.Fins.cp_da)) self.w_2phase = -self.mdot_r * h_fg * (1.0 - xout_r_2phase) / ( self.mdot_da * self.Fins.cp_da * (self.Tin_a - Tsat_r) * self.epsilon_2phase) #Positive Q is heat input to the refrigerant, negative Q is heat output from refrigerant. #Heat is removed here from the refrigerant since it is condensing self.Q_2phase = self.epsilon_2phase * self.Fins.cp_da * self.mdot_da * self.w_2phase * ( self.Tin_a - Tsat_r) self.xout_2phase = xout_r_2phase # Frictional pressure drop component DP_frict = LMPressureGradientAvg(self.xout_2phase, 1.0, self.Ref, self.G_r, self.ID, Tbubble, Tdew) * self.Lcircuit * self.w_2phase #Accelerational pressure drop component DP_accel = -AccelPressureDrop(self.xout_2phase, 1.0, self.Ref, self.G_r, Tbubble, Tdew) * self.Lcircuit * self.w_2phase # Total pressure drop is the sum of accelerational and frictional components (neglecting gravitational effects) self.DP_r_2phase = DP_frict + DP_accel rho_average = TwoPhaseDensity(self.Ref, self.xout_2phase, 1.0, self.Tdew, self.Tbubble, slipModel='Zivi') self.Charge_2phase = rho_average * self.w_2phase * self.V_r if self.Verbosity > 7: print '2phase cond resid', self.w_2phase - (1 - self.w_superheat) print 'h_r_2phase', self.h_r_2phase #Calculate an effective pseudo-subcooling based on the equality # cp*DT_sc=-dx*h_fg cp_satL = PropsSI('C', 'T', self.Tbubble, 'Q', 0.0, self.Ref) #*1000 self.DT_sc_2phase = -self.xout_2phase * h_fg / (cp_satL) #If the quality is being solved for, the length of the two-phase and subcooled # sections should add to the length of the HX. Return the residual return self.w_2phase - (1 - self.w_superheat)
def _OnePhaseH_TwoPhaseC_Qimposed(self,Inputs): """ The hot stream is all single phase, and the cold stream is evaporating """ #Calculate the mean temperature for the single-phase fluid h_h,cp_h,PlateOutput_h=self.PlateHTDP(self.Ref_h, Inputs['Tmean_h'], Inputs['pin_h'],self.mdot_h/self.NgapsHot) #Use cp calculated from delta h/delta T cp_h=Inputs['cp_h'] #Mole mass of refrigerant for Cooper correlation M=Props('M','T',0,'P',0,self.Ref_c) #Reduced pressure for Cooper Correlation pstar=Inputs['pin_c']/Props('E','T',0,'P',0,self.Ref_c) change=999 w=1 Q=Inputs['Q'] """ The Cooper Pool boiling relationship is a function of the heat flux, therefore the heat flux must be iteratively determined """ while abs(change)>1e-6: q_flux=Q/(w*self.A_c_wetted) #Heat transfer coefficient from Cooper Pool Boiling h_c_2phase=Cooper_PoolBoiling(pstar,1.0,q_flux,M) #1.5 correction factor comes from Claesson Thesis on plate HX G=self.mdot_c/self.A_c_flow Dh=self.Dh_c x=(Inputs['xin_c']+Inputs['xout_c'])/2 UA_total=1/(1/(h_h*self.A_h_wetted)+1/(h_c_2phase*self.A_c_wetted)+self.PlateThickness/(self.PlateConductivity*self.A_c_wetted)) C_h=cp_h*self.mdot_h Qmax=C_h*(Inputs['Tin_h']-Inputs['Tsat_c']) epsilon=Q/Qmax if epsilon>=1.0: epsilon=1.0-1e-12 NTU=-log(1-epsilon) UA_req=NTU*C_h change=UA_req/UA_total-w w=UA_req/UA_total #Refrigerant charge rho_h=Props('D','T',Inputs['Tmean_h'], 'P', self.pin_h, self.Ref_h) Charge_h = w * self.V_h * rho_h rho_c=TwoPhaseDensity(self.Ref_c,Inputs['xin_c'],Inputs['xout_c'],self.Tdew_c,self.Tbubble_c,slipModel='Zivi') Charge_c = rho_c * w * self.V_c #Use Lockhart Martinelli to calculate the pressure drop. Claesson found good agreement using C parameter of 4.67 DP_frict_c=LMPressureGradientAvg(Inputs['xin_c'],Inputs['xout_c'],self.Ref_c,self.mdot_c/self.A_c_flow,self.Dh_c,self.Tbubble_c,self.Tdew_c,C=4.67)*w*self.Lp #Accelerational pressure drop component DP_accel_c=AccelPressureDrop(Inputs['xin_c'],Inputs['xout_c'],self.Ref_c,self.mdot_c/self.A_c_flow,self.Tbubble_c,self.Tdew_c) #Pack outputs Outputs={ 'w':w, 'Tout_h': Inputs['Tin_h']-Q/(self.mdot_h*cp_h), 'Charge_c': Charge_c, 'Charge_h': Charge_h, 'DP_h': -PlateOutput_h['DELTAP'], 'DP_c': DP_frict_c+DP_accel_c, 'h_h':h_h, 'h_c':h_c_2phase, 'q_flux':q_flux } return dict(Inputs.items()+Outputs.items())