|
| 1 | +''' |
| 2 | +This example shows how to perform a simulation of a 5-ton variable-speed |
| 3 | +heat pump unit with a rotary compressor. The heat pump model |
| 4 | +is fully-mechanistic: charge-sensitive, flow model of TXV, both subcooling and |
| 5 | +superheat are estimated. |
| 6 | +''' |
| 7 | +from __future__ import division, absolute_import, print_function |
| 8 | +from ACHP.Cycle import VariableSpeedHPClass |
| 9 | +from ACHP.Plots import PlotsClass |
| 10 | +from ACHP.convert_units import * |
| 11 | + |
| 12 | +# Instantiate the cycle class |
| 13 | +Cycle=VariableSpeedHPClass() |
| 14 | + |
| 15 | +#-------------------------------------- |
| 16 | +# Cycle parameters |
| 17 | +#-------------------------------------- |
| 18 | +Cycle.Verbosity = 1 #the idea here is to have different levels of debug output |
| 19 | +Cycle.ImposedVariable = 'Charge' #'Subcooling' |
| 20 | +Cycle.ChargeMethod = 'Two-point' #'One-point' |
| 21 | +Cycle.CycleType = 'DX' |
| 22 | +Cycle.Charge_target = 4.81 #[kg] (i.e., 10.6lbs) #uncomment for use with imposed 'Charge' |
| 23 | +Cycle.DT_sc_target = 5.2 |
| 24 | +Cycle.Mode='AC' |
| 25 | +Cycle.Ref='R410A' |
| 26 | +Cycle.Backend='HEOS' #Backend for refrigerant properties calculation: 'HEOS','TTSE&HEOS','BICUBIC&HEOS','REFPROP','SRK','PR' |
| 27 | +Cycle.Oil = 'POE32' |
| 28 | +Cycle.shell_pressure = 'low-pressure' |
| 29 | +Cycle.CompModel = 'Miranda-Mendoza' |
| 30 | +Cycle.CompType = 'Hitachi-RollingPiston' |
| 31 | +Cycle.EvapSolver = 'Moving-Boundary' #choose the type of Evaporator solver scheme ('Moving-Boundary' or 'Finite-Element') |
| 32 | +Cycle.EvapType = 'Fin-tube' #if EvapSolver = 'Moving-Boundary', choose the type of evaporator ('Fin-tube' or 'Micro-channel') |
| 33 | +Cycle.CondSolver = 'Moving-Boundary' #choose the type of Condenser solver scheme ('Moving-Boundary' or 'Finite-Element') |
| 34 | +Cycle.CondType = 'Fin-tube' #if CondSolver = 'Moving-Boundary', choose the type of condenser ('Fin-tube' or 'Micro-channel') |
| 35 | +Cycle.Update() |
| 36 | + |
| 37 | +#-------------------------------------- |
| 38 | +# Charge correction parameters (activate by setting Cycle.ImposedVariable to 'Charge' and Cycle.ChargeMethod to either 'One-point' or 'Two-point') |
| 39 | +#-------------------------------------- |
| 40 | +Cycle.C = 1.339535791 #[kg] using Test A2 |
| 41 | +Cycle.K = -2.108650822 #[kg] using Test A2 and Test B2 |
| 42 | +Cycle.w_ref = 0.117130605 #[-] |
| 43 | + |
| 44 | +#------------------------------------- |
| 45 | +# Tuning coefficients |
| 46 | +#------------------------------------- |
| 47 | +x = [0.96, 1.15, 1.3, 0.99, 1.23, 1.31, 0.97] |
| 48 | + |
| 49 | +#-------------------------------------- |
| 50 | +# Compressor parameters |
| 51 | +#-------------------------------------- |
| 52 | +# A 4 ton cooling capacity compressor map of rolling piston compressor |
| 53 | +params={ |
| 54 | + 'Ref': Cycle.Ref, |
| 55 | + 'Tamb': 35. + 273.15, |
| 56 | + 'fp':0, #Fraction of electrical power lost as heat to ambient |
| 57 | + 'Vdisp': 47e-6, #Displacement volume, m^3 |
| 58 | + 'Vdot_ratio': x[0], #Displacement Scale factor |
| 59 | + 'N': 3600, #Rotational speed, rpm |
| 60 | + 'a_etav':[1.,-0.32094114,0.00170576,-0.03695206], #Volumetric eff. coeff. |
| 61 | + 'a_etais':[1.,0.24148598,0.37491376,0.07996134,-0.03366503], #Isentropic eff. coeff. |
| 62 | + 'a_etaoi':[1.,-0.01360404,-0.07435644,0.18584579,0.63589724], #Overall eff. coeff. |
| 63 | + 'shell_pressure': Cycle.shell_pressure, |
| 64 | + 'Oil': Cycle.Oil, |
| 65 | + 'V_oil_sump': 1600e-6, |
| 66 | + 'Verbosity': 0.0 |
| 67 | + } |
| 68 | + |
| 69 | +Cycle.Compressor.Update(**params) |
| 70 | + |
| 71 | +#-------------------------------------- |
| 72 | +# Condenser parameters |
| 73 | +#-------------------------------------- |
| 74 | +Cycle.Condenser.Fins.Tubes.NTubes_per_bank=24 #number of tubes per bank=row |
| 75 | +Cycle.Condenser.Fins.Tubes.Nbank=2 #number of banks/rows |
| 76 | +Cycle.Condenser.Fins.Tubes.Ncircuits=8 |
| 77 | +Cycle.Condenser.Fins.Tubes.Ltube=2.252 |
| 78 | +Cycle.Condenser.Fins.Tubes.OD=0.00913 |
| 79 | +Cycle.Condenser.Fins.Tubes.ID=0.00849 |
| 80 | +Cycle.Condenser.Fins.Tubes.Pl=0.0191 #distance between center of tubes in flow direction |
| 81 | +Cycle.Condenser.Fins.Tubes.Pt=0.0254 #distance between center of tubes orthogonal to flow direction |
| 82 | +Cycle.Condenser.Fins.Tubes.kw=237 #wall thermal conductivity (i.e pipe material) |
| 83 | + |
| 84 | +Cycle.Condenser.Fins.Fins.FPI=20 #Number of fins per inch |
| 85 | +Cycle.Condenser.Fins.Fins.Pd=0.001 #2* amplitude of wavy fin |
| 86 | +Cycle.Condenser.Fins.Fins.xf=0.001 #1/2 period of fin |
| 87 | +Cycle.Condenser.Fins.Fins.t=0.00011 #Thickness of fin material |
| 88 | +Cycle.Condenser.Fins.Fins.k_fin=237 #Thermal conductivity of fin material |
| 89 | + |
| 90 | +Cycle.Condenser.Fins.Air.Vdot_ha=cfm2cms(4046)#1.7934 #rated volumetric flowrate |
| 91 | +Cycle.Condenser.Fins.Air.Tmean=35.0+273.1 |
| 92 | +Cycle.Condenser.Fins.Air.Tdb=35.0+273.15 # AHRI Standard 210/240 - Cooling test variable speed A2 |
| 93 | +Cycle.Condenser.Fins.Air.p=101325 #Condenser Air pressure in Pa |
| 94 | +Cycle.Condenser.Fins.Air.RH=0.51 |
| 95 | +Cycle.Condenser.Fins.Air.RHmean=0.51 |
| 96 | +Cycle.Condenser.Fins.Air.FanPower=250 |
| 97 | + |
| 98 | +Cycle.Condenser.FinsType = 'WavyLouveredFins' #WavyLouveredFins, HerringboneFins, PlainFins |
| 99 | +Cycle.Condenser.Verbosity=0 |
| 100 | + |
| 101 | +params={ |
| 102 | + 'h_a_tuning':x[1], |
| 103 | + 'h_tp_tuning':x[2], |
| 104 | + 'DP_tuning':x[3] |
| 105 | + } |
| 106 | +Cycle.Condenser.Update(**params) |
| 107 | + |
| 108 | +#-------------------------------------- |
| 109 | +# Evaporator Parameters |
| 110 | +#-------------------------------------- |
| 111 | +Cycle.Evaporator.Fins.Tubes.NTubes_per_bank=60 |
| 112 | +Cycle.Evaporator.Fins.Tubes.Nbank=3 |
| 113 | +Cycle.Evaporator.Fins.Tubes.Ltube=0.452 |
| 114 | +Cycle.Evaporator.Fins.Tubes.OD=0.00913 |
| 115 | +Cycle.Evaporator.Fins.Tubes.ID=0.00849 |
| 116 | +Cycle.Evaporator.Fins.Tubes.Pl=0.0191 |
| 117 | +Cycle.Evaporator.Fins.Tubes.Pt=0.0254 |
| 118 | +Cycle.Evaporator.Fins.Tubes.Ncircuits=8 |
| 119 | +Cycle.Evaporator.Fins.Tubes.kw=117 #wall thermal conductivity (i.e pipe material) |
| 120 | + |
| 121 | +Cycle.Evaporator.Fins.Fins.FPI=14.5 |
| 122 | +Cycle.Evaporator.Fins.Fins.Pd=0.001 |
| 123 | +Cycle.Evaporator.Fins.Fins.xf=0.001 |
| 124 | +Cycle.Evaporator.Fins.Fins.t=0.00011 |
| 125 | +Cycle.Evaporator.Fins.Fins.k_fin=117 |
| 126 | + |
| 127 | +Cycle.Evaporator.Fins.Air.Vdot_ha= 0.408 #cfm2cms(1750) |
| 128 | +Cycle.Evaporator.Fins.Air.Tmean=26.7+273.15 |
| 129 | +Cycle.Evaporator.Fins.Air.Tdb=26.7+273.15 # AHRI Standard 210/240 - Cooling test variable speed A2 |
| 130 | +Cycle.Evaporator.Fins.Air.p=101325 #Evaporator Air pressure in Pa |
| 131 | +Cycle.Evaporator.Fins.Air.RH=0.51 |
| 132 | +Cycle.Evaporator.Fins.Air.RHmean=0.51 |
| 133 | +Cycle.Evaporator.Fins.Air.FanPower= 438 |
| 134 | + |
| 135 | +Cycle.Evaporator.FinsType = 'WavyLouveredFins' #WavyLouveredFins, HerringboneFins, PlainFins |
| 136 | +Cycle.Evaporator.Verbosity=0 |
| 137 | +Cycle.Evaporator.DT_sh= 7 #target superheat |
| 138 | + |
| 139 | +params={ |
| 140 | + 'h_a_tuning':x[4], |
| 141 | + 'h_tp_tuning':x[5], |
| 142 | + 'DP_tuning':x[6] |
| 143 | + } |
| 144 | + |
| 145 | +Cycle.Evaporator.Update(**params) |
| 146 | + |
| 147 | + |
| 148 | +# ---------------------------------- |
| 149 | +# Expansion device Parameters |
| 150 | +# ---------------------------------- |
| 151 | +params={ |
| 152 | + 'ExpType':'Nonlinear-TXV', #expansion device type |
| 153 | + 'Tsh_static':2.626, #static superheat |
| 154 | + 'Tsh_max':9.855, #maximum superheat |
| 155 | + 'D':0.009525, #inside diameter [m] |
| 156 | + 'C':3.6787e-06, #constant from manufacturer [m^2/K] |
| 157 | + 'Adj':0.754, #Adjust the diameter (tuning factor) |
| 158 | + } |
| 159 | +Cycle.ExpDev.Update(**params) |
| 160 | + |
| 161 | +# ---------------------------------- |
| 162 | +# Liquid Line Set Parameters |
| 163 | +# ---------------------------------- |
| 164 | +params={ |
| 165 | + 'L':7.6, |
| 166 | + 'k_tube':0.19, |
| 167 | + 't_insul':0.02, |
| 168 | + 'k_insul':0.036, |
| 169 | + 'T_air':27 + 273.15, |
| 170 | + 'h_air':0.0000000001, |
| 171 | + 'LineSetOption': 'On' |
| 172 | + } |
| 173 | + |
| 174 | +Cycle.LineSetLiquid.Update(**params) |
| 175 | +Cycle.LineSetLiquid.OD=in2m(3/8) #3/8" |
| 176 | +Cycle.LineSetLiquid.ID=in2m(0.25) #1/4" |
| 177 | + |
| 178 | +# ---------------------------------- |
| 179 | +# Evap to Accumulator Line Set Parameters |
| 180 | +# ---------------------------------- |
| 181 | +params={ |
| 182 | + 'L':0.571, |
| 183 | + 'k_tube':0.19, |
| 184 | + 't_insul':0.0, |
| 185 | + 'k_insul':0.036, |
| 186 | + 'T_air':27 + 273.15, |
| 187 | + 'h_air':0.0000000001, |
| 188 | + 'LineSetOption': 'On' |
| 189 | + } |
| 190 | + |
| 191 | +Cycle.LineSetEvapAccumulator.Update(**params) |
| 192 | +Cycle.LineSetEvapAccumulator.OD=in2m(7/8) #7/8" |
| 193 | +Cycle.LineSetEvapAccumulator.ID=in2m(3/4) |
| 194 | + |
| 195 | +# ---------------------------------- |
| 196 | +# Suction Line Set Parameters |
| 197 | +# ---------------------------------- |
| 198 | +params={ |
| 199 | + 'L':7.6, |
| 200 | + 'k_tube':0.19, |
| 201 | + 't_insul':0.02, |
| 202 | + 'k_insul':0.036, |
| 203 | + 'T_air':27 + 273.15, |
| 204 | + 'h_air':0.0000000001, |
| 205 | + 'LineSetOption': 'On' |
| 206 | + } |
| 207 | + |
| 208 | +Cycle.LineSetSuction.Update(**params) |
| 209 | +Cycle.LineSetSuction.OD=in2m(1.125) #1-1/8" |
| 210 | +Cycle.LineSetSuction.ID=in2m(1.025) |
| 211 | + |
| 212 | +# ---------------------------------- |
| 213 | +# Line Set Discharge Parameters |
| 214 | +# ---------------------------------- |
| 215 | +params={ |
| 216 | + 'L':0.3, #tube length in m |
| 217 | + 'k_tube':0.19, |
| 218 | + 't_insul':0, #no insulation |
| 219 | + 'k_insul':0.036, |
| 220 | + 'T_air':27 + 273.15, |
| 221 | + 'h_air':0.0000000001, |
| 222 | + 'LineSetOption': 'On' |
| 223 | + } |
| 224 | + |
| 225 | +Cycle.LineSetDischarge.Update(**params) |
| 226 | +Cycle.LineSetDischarge.OD=in2m(1.125) #1-1/8" |
| 227 | +Cycle.LineSetDischarge.ID=in2m(1.025) |
| 228 | + |
| 229 | +# ---------------------------------- |
| 230 | +# Suction Accumulator Parameters |
| 231 | +# ---------------------------------- |
| 232 | +params={ |
| 233 | + 'Tamb':27 + 273.15, |
| 234 | + 'ID':0.115, |
| 235 | + 'OD': 0.1236, |
| 236 | + 'h_tank': 0.274, |
| 237 | + } |
| 238 | + |
| 239 | +Cycle.SuctionAccumulator.Update(**params) |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | +#Now solve |
| 244 | +from time import time |
| 245 | +t1=time() |
| 246 | +Cycle.PreconditionedSolve() |
| 247 | +print ('Took '+str(time()-t1)+' seconds to run Cycle model') |
| 248 | +print ('Cycle COP is '+str(Cycle.COSP)) |
| 249 | +print ('Cycle refrigerant charge is '+str(Cycle.Charge)+' kg') |
| 250 | +print (Cycle.OutputList()) |
| 251 | +#Now do cycle plotting |
| 252 | +plot = PlotsClass() |
| 253 | +plot.TSOverlay(Cycle) |
| 254 | +plot.PHOverlay(Cycle) |
| 255 | + |
0 commit comments