Exemplo n.º 1
0
 def _Superheat_Forward(self,w_superheat):
     self.w_superheat=w_superheat
     DWS=DWSVals() #DryWetSegment structure
 
     # Store temporary values to be passed to DryWetSegment
     DWS.A_a=self.Fins.A_a*w_superheat
     DWS.cp_da=self.Fins.cp_da
     DWS.eta_a=self.Fins.eta_a
     DWS.h_a=self.Fins.h_a  #Heat transfer coefficient
     DWS.mdot_da=self.mdot_da*w_superheat
     DWS.pin_a=self.Fins.Air.p
     DWS.Fins=self.Fins
     DWS.FinsType = self.FinsType           
 
     # Inputs on the air side to two phase region are inlet air again
     DWS.Tin_a=self.Tin_a
     DWS.RHin_a=self.Fins.Air.RH
 
     DWS.Tin_r=self.Tdew_r
     DWS.A_r=self.A_r_wetted*w_superheat
     DWS.cp_r=PropsSI('C','T',self.Tdew_r+2.5, 'P', self.psat_r, self.Ref) #Use a guess value of 6K superheat to calculate cp 
     DWS.pin_r=self.psat_r
     DWS.mdot_r=self.mdot_r
     DWS.IsTwoPhase=False
     
     #Use a guess value of 6K superheat to calculate the properties
     self.f_r_superheat, self.h_r_superheat, self.Re_r_superheat=f_h_1phase_Tube(self.mdot_r / self.Ncircuits, self.ID, 
         self.Tdew_r+3, self.psat_r, self.Ref, "Single");
     
     # Average Refrigerant heat transfer coefficient
     DWS.h_r=self.h_r_superheat
     
     #Run DryWetSegment
     DryWetSegment(DWS)
     
     rho_superheat=PropsSI('D','T',(DWS.Tout_r+self.Tdew_r)/2.0, 'P', self.psat_r, self.Ref)
     self.Charge_superheat = w_superheat * self.V_r * rho_superheat
     
     #Pressure drop calculations for superheated refrigerant
     v_r=1/rho_superheat
     #Pressure gradient using Darcy friction factor
     dpdz_r=-self.f_r_superheat*v_r*self.G_r**2/(2*self.ID)  #Pressure gradient
     self.DP_r_superheat=dpdz_r*self.Lcircuit*self.w_superheat
     
     #Set values
     self.Q_superheat=DWS.Q
     self.Q_sensible_superheat=DWS.Q_sensible
     self.fdry_superheat=DWS.f_dry
     self.Tout_a_superheat=DWS.Tout_a
     self.Tout_r=DWS.Tout_r
Exemplo n.º 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  #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
Exemplo n.º 3
0
 def Calculate(self):
     """
     This function is now simply a wrapper around the DryWetSegment() 
     function in order to decrease the amount of code replication
     """
     
     self.Initialize()
 
     DWS=DWSVals() #DryWetSegment structure
 
     # Store temporary values to be passed to DryWetSegment
     DWS.A_a=self.Fins.A_a
     DWS.cp_da=self.Fins.cp_da
     DWS.eta_a=self.Fins.eta_a
     DWS.h_a=self.Fins.h_a  #Heat transfer coefficient
     DWS.mdot_da=self.Fins.mdot_da
     DWS.pin_a=self.Fins.Air.p
     DWS.Tin_a=self.Tin_a
     DWS.RHin_a=self.Fins.Air.RH
     DWS.Fins=self.Fins
     DWS.FinsType=self.FinsType              #Added to pass FinsType to DryWetSegment
 
     DWS.Tin_r=self.Tin_g
     DWS.A_r=self.A_g_wetted
     DWS.cp_r=PropsSI('C','T',(self.Tin_g+DWS.Tin_a)/2.0, 'P', self.pin_g, self.Ref_g)#*1000 #Use a guess value of 6K superheat to calculate cp 
     DWS.pin_r=self.pin_g
     DWS.mdot_r=self.mdot_g
     DWS.IsTwoPhase=False
     
     #Use a guess value of 6K superheat to calculate the properties
     self.f_g, self.h_g, self.Re_g=f_h_1phase_Tube(self.mdot_g / self.Ncircuits, self.ID, 
         (self.Tin_g+DWS.Tin_a)/2.0, self.pin_g, self.Ref_g, "Single");
     
     # Average Refrigerant heat transfer coefficient
     DWS.h_r=self.h_g
     
     #Run DryWetSegment
     DryWetSegment(DWS)
     
     #Average mass flux of glycol in circuit
     self.G_g = self.mdot_g/(self.Ncircuits*pi*self.ID**2/4.0) #[kg/m^2-s]
 
     #Pressure drop calculations for glycol (water)
     Dh_g=self.ID
     v_g=1/PropsSI('D','T',self.Tin_g, 'P',self.pin_g,self.Ref_g)
     #Pressure gradient using Darcy friction factor
     dp_dz_g=-self.f_g*v_g*self.G_g**2/(2*Dh_g)
     DP_g=dp_dz_g*self.Lcircuit
 
     self.f_dry=DWS.f_dry
     self.DP_g=DP_g
     self.Q=DWS.Q
     self.Tout_g=DWS.Tout_r
     self.Tout_a=DWS.Tout_a
     self.hout_a=DWS.hout_a
     self.hin_a=DWS.hin_a
     self.SHR=self.Fins.cp_da*(DWS.Tout_a-DWS.Tin_a)/(DWS.hout_a-DWS.hin_a)
     self.Capacity=DWS.Q-self.Fins.Air.FanPower
Exemplo n.º 4
0
 def _Superheat_Forward(self,w_superheat,T_inlet_r=-99):
     if T_inlet_r==-99:  #catch if default case is used
         T_inlet_r=self.Tdew_r
     self.w_superheat=w_superheat
     DWS=DWSVals() #DryWetSegment structure
 
     # Store temporary values to be passed to DryWetSegment
     DWS.A_a=self.Fins.A_a*w_superheat
     DWS.cp_da=self.Fins.cp_da
     DWS.eta_a=self.Fins.eta_a
     DWS.h_a=self.Fins.h_a  #Heat transfer coefficient
     DWS.mdot_da=self.mdot_da*w_superheat
     DWS.pin_a=self.Fins.Air.p
     DWS.Fins=self.Fins
 
     # Inputs on the air side to two phase region are inlet air again
     DWS.Tin_a=self.Tin_a
     DWS.RHin_a=self.Fins.Air.RH
 
     DWS.Tin_r=T_inlet_r  #default is dew temperature; can change to consider for initial superheat
     DWS.A_r=self.A_r_wetted*w_superheat
     DWS.cp_r=self.cp_r
     DWS.pin_r=self.psat_r
     DWS.mdot_r=self.mdot_r
     DWS.IsTwoPhase=False
     
     #Use a guess value of 6K superheat to calculate the properties
     self.f_r_superheat, self.h_r_superheat, self.Re_r_superheat=f_h_1phase_Tube(self.mdot_r / self.Ncircuits, self.ID, 
         self.Tdew_r+3, self.psat_r, self.Ref, "Single");
     
     # Average Refrigerant heat transfer coefficient
     DWS.h_r=self.h_r_superheat
     
     #Run DryWetSegment
     DryWetSegment(DWS)
     try:
         rho_superheat=Props('D','T',(DWS.Tout_r+self.Tdew_r)/2.0, 'P', self.psat_r, self.Ref)
         #members = [attr for attr in dir(DWS()) if not callable(attr) and not attr.startswith("__")]
         #print members
     except:
         print "error in Evaporator, unreasonable inputs?","Inputs to calculate density are DWS.Tout_r,self.Tdew_r,self.psat_r",DWS.Tout_r,self.Tdew_r,self.psat_r,"<<"
         print "DWS values are", 'DWS.A_a',DWS.A_a,'DWS.Tin_r',DWS.Tin_r,'DWS.mdot_da',DWS.mdot_da,"DWS.mdot_r",DWS.mdot_r,'DWS.mdot_da',DWS.mdot_da,'DWS.mdot_r',DWS.mdot_r
         print "plot DWS vals to figure out what is going on"
         raise()
     self.Charge_superheat = w_superheat * self.V_r * rho_superheat
     
     #Pressure drop calculations for subcooled refrigerant
     v_r=1/rho_superheat
     #Pressure gradient using Darcy friction factor
     dpdz_r=-self.f_r_superheat*v_r*self.G_r**2/(2*self.ID)  #Pressure gradient
     self.DP_r_superheat=dpdz_r*self.Lcircuit*self.w_superheat
     
     #Set values
     self.Q_superheat=DWS.Q
     self.Q_sensible_superheat=DWS.Q_sensible
     self.fdry_superheat=DWS.f_dry
     self.Tout_a_superheat=DWS.Tout_a
     self.Tout_r=DWS.Tout_r
     self.omega_out_superheat=DWS.omega_out
Exemplo n.º 5
0
    def Calculate(self):
        """
        This function is now simply a wrapper around the DryWetSegment() 
        function in order to decrease the amount of code replication
        """

        self.Initialize()

        DWS = DWSVals()  #DryWetSegment structure

        # Store temporary values to be passed to DryWetSegment
        DWS.A_a = self.Fins.A_a
        DWS.cp_da = self.Fins.cp_da
        DWS.eta_a = self.Fins.eta_a
        DWS.h_a = self.Fins.h_a  #Heat transfer coefficient
        DWS.mdot_da = self.Fins.mdot_da
        DWS.pin_a = self.Fins.Air.p
        DWS.Tin_a = self.Tin_a
        DWS.RHin_a = self.Fins.Air.RH
        DWS.Fins = self.Fins

        DWS.Tin_r = self.Tin_g
        DWS.A_r = self.A_g_wetted
        DWS.cp_r = Props(
            'C', 'T', (self.Tin_g + DWS.Tin_a) / 2.0, 'P', self.pin_g, self.
            Ref_g) * 1000  #Use a guess value of 6K superheat to calculate cp
        DWS.pin_r = self.pin_g
        DWS.mdot_r = self.mdot_g
        DWS.IsTwoPhase = False

        #Use a guess value of 6K superheat to calculate the properties
        self.f_g, self.h_g, self.Re_g = f_h_1phase_Tube(
            self.mdot_g / self.Ncircuits, self.ID,
            (self.Tin_g + DWS.Tin_a) / 2.0, self.pin_g, self.Ref_g, "Single")

        # Average Refrigerant heat transfer coefficient
        DWS.h_r = self.h_g

        #Run DryWetSegment
        DryWetSegment(DWS)

        #Average mass flux of glycol in circuit
        self.G_g = self.mdot_g / (self.Ncircuits * pi * self.ID**2 / 4.0
                                  )  #[kg/m^2-s]

        #Pressure drop calculations for glycol (water)
        Dh_g = self.ID
        v_g = 1 / Props('D', 'T', self.Tin_g, 'P', self.pin_g, self.Ref_g)
        #Pressure gradient using Darcy friction factor
        dp_dz_g = -self.f_g * v_g * self.G_g**2 / (2 * Dh_g)
        DP_g = dp_dz_g * self.Lcircuit

        self.f_dry = DWS.f_dry
        self.DP_g = DP_g
        self.Q = DWS.Q
        self.Tout_g = DWS.Tout_r
        self.Tout_a = DWS.Tout_a
        self.hout_a = DWS.hout_a
        self.hin_a = DWS.hin_a
        self.SHR = self.Fins.cp_da * (DWS.Tout_a - DWS.Tin_a) / (DWS.hout_a -
                                                                 DWS.hin_a)
        self.Capacity = DWS.Q - self.Fins.Air.FanPower