예제 #1
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
예제 #2
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