예제 #1
0
파일: CoaxialHX.py 프로젝트: yuson95/ACHP
 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)
     #
     h_r_2phase=ShahEvaporation_Average(self.xin_r,1.0,self.AS_r,
                 self.G_r,self.Dh_r,self.pin_r,q_flux,self.Tbubble_r,self.Tdew_r)
     self.h_r_2phase = h_r_2phase * self.h_tp_tuning
     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.AS_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.AS_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.AS_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
예제 #2
0
    def _TwoPhase_Forward(self,xout_r_2phase=0.0):
        # **********************************************************************
        #                      TWO-PHASE PART 
        # **********************************************************************
        """
            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_l = self.h_l #[J/kg]
        h_v = self.h_v #[J/kg]
        h_fg = h_v - h_l #[J/kg]
        
        # This block calculates the average frictional pressure drop griendient
        # and average refrigerant heat transfer coefficient by
        # integrating the local heat transfer coefficient between 
        # a quality of 1.0 and the outlet quality
        DPDZ_frict_2phase, h_r_2phase =KM_Cond_Average(xout_r_2phase,1.0,self.AS,self.G_r,self.Dh,Tbubble,Tdew,self.psat_r,self.beta)
        
        self.h_r_2phase=h_r_2phase*self.h_tp_tuning

        UA_overall = 1 / (1 / (self.Fins.eta_a * self.Fins.h_a * self.Fins.A_a * self.h_a_tuning) + 1 / (self.h_r_2phase * self.A_r_wetted) + self.Rw);
        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=DPDZ_frict_2phase*self.Lcircuit*self.w_2phase
        #Accelerational pressure drop component    
        DP_accel=-AccelPressureDrop(self.xout_2phase,1.0,self.AS,self.G_r,Tbubble,Tdew,slipModel='Zivi')*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.AS,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_satL=self.cp_satL
        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)
예제 #3
0
파일: Evaporator.py 프로젝트: yuson95/ACHP
    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 * self.h_a_tuning  #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.Rw = self.Rw / 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
        try:
            if self.AS.name() in 'CarbonDioxide':
                h_r = KandlikarEvaporation_average(self.xin_r,
                                                   self.xout_2phase, self.AS,
                                                   self.G_r, self.ID,
                                                   self.psat_r,
                                                   Q_target / DWS.A_r,
                                                   self.Tbubble_r, self.Tdew_r)
            else:
                h_r = ShahEvaporation_Average(self.xin_r, self.xout_2phase,
                                              self.AS, self.G_r, self.ID,
                                              self.psat_r, Q_target / DWS.A_r,
                                              self.Tbubble_r, self.Tdew_r)
        except:
            h_r = ShahEvaporation_Average(self.xin_r, self.xout_2phase,
                                          self.AS, self.G_r, self.ID,
                                          self.psat_r, Q_target / DWS.A_r,
                                          self.Tbubble_r, self.Tdew_r)

        DWS.h_r = h_r * self.h_tp_tuning  #correct refrigerant side convection heat transfer

        #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.AS,
                                      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.AS, self.G_r, self.ID,
            self.Tbubble_r, self.Tdew_r) * self.Lcircuit * w_2phase
        #Accelerational pressure drop component
        try:
            if self.AS.name() in 'CarbonDioxide':
                DP_accel = AccelPressureDrop(
                    self.xin_r,
                    self.xout_2phase,
                    self.AS,
                    self.G_r,
                    self.Tbubble_r,
                    self.Tdew_r,
                    D=self.ID,
                    slipModel='Premoli') * self.Lcircuit * w_2phase
            else:
                DP_accel = AccelPressureDrop(
                    self.xin_r,
                    self.xout_2phase,
                    self.AS,
                    self.G_r,
                    self.Tbubble_r,
                    self.Tdew_r,
                    slipModel='Zivi') * self.Lcircuit * w_2phase
        except:
            DP_accel = AccelPressureDrop(
                self.xin_r,
                self.xout_2phase,
                self.AS,
                self.G_r,
                self.Tbubble_r,
                self.Tdew_r,
                slipModel='Zivi') * 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
예제 #4
0
    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*self.h_a_tuning  #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.Rw=self.Rw/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
        #Shah correlation
        #h_r=ShahEvaporation_Average(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Dh,self.psat_r,Q_target/DWS.A_r,self.Tbubble_r,self.Tdew_r)
        #Bertsch correlation
        #h_r=Bertsch_MC_Average(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Dh,Q_target/DWS.A_r,self.Lcircuit,self.Tbubble_r,self.Tdew_r)
        #Kandlikar correlation
        #h_r=KandlikarEvaporation_average(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Dh,self.psat_r,Q_target/DWS.A_r,self.Tbubble_r,self.Tdew_r)
        #Kim and Mudawar (2013)
        DPDZ_frict_2phase, h_r = KM_Evap_Average(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Dh,self.Tbubble_r,self.Tdew_r,self.psat_r,self.beta,Q_target/DWS.A_r,self.PH_PF)
        DWS.h_r=h_r*self.h_tp_tuning #correct refrigerant side convection heat transfer
        
        #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.AS,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
        #Lockhart-Martinelli correlation
        #DP_frict=LMPressureGradientAvg(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Dh,self.Tbubble_r,self.Tdew_r)*self.Lcircuit*w_2phase
        #using the pressure gradient of Kim & Mudawar (2013) 
        DP_frict=DPDZ_frict_2phase*self.Lcircuit*w_2phase
        
        #Accelerational pressure drop component    
        if self.Ref in 'CarbonDioxide' or 'CO2' or 'R744': #TODO: self.AS.name() is not available yet for all backends, using self.Ref for now
            DP_accel=AccelPressureDrop(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Tbubble_r,self.Tdew_r,D=self.Dh,slipModel='Premoli')*self.Lcircuit*w_2phase
        else:
            DP_accel=AccelPressureDrop(self.xin_r,self.xout_2phase,self.AS,self.G_r,self.Tbubble_r,self.Tdew_r,slipModel='Zivi')*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