"Vapor compression refrigeration cycle - Irreversible compressor" T_evap = 5 T_cond = 40 eta_comp = 0.8 "compressor isentropic efficiency" "Point 1: evaporator outlet (saturated vapor)" x[1] = 1 T[1] = T_evap P[1] = pressure(R134a, T = T[1], x = x[1]) h[1] = enthalpy(R134a, T = T[1], x = x[1]) s[1] = entropy(R134a, T = T[1], x = x[1]) "Point 2: compressor outlet (isentropic compression)" s_is[2] = s[1] P[2] = pressure(R134a, T = T_cond, s = s_is[2]) "same pressure for points 2 and 2is" h_is[2] = enthalpy(R134a, T = T_cond, s = s_is[2]) W_comp_is = h_is[2] - h[1] "reversible compressor work" eta_comp = W_comp_is/W_comp "calculation for the irreverssible compressor work" h[2] = h[1] + W_comp s[2] = entropy(R134a, P = P[2], h = h[2]) T[2] = temperature(R134a, P = P[2], h = h[2]) "Point 3: condenser outlet (saturated liquid)" x[3] = 0 P[3] = P[2] h[3] = enthalpy(R134a, T = T_cond, x = x[3]) s[3] = entropy(R134a, T = T_cond, x = x[3]) T[3] = temperature(R134a, P = P[3], x = x[3]) "Point 4: expansion valve outlet (isenthalpic expansion)" P[4] = P[1] h[4] = h[3] s[4] = entropy(R134a, P = P[4], h = h[4]) x[4] = quality(R134a, P = P[4], h = h[4]) T[4] = temperature(R134a, P = P[4], h = h[4]) "Cycle performance" Q_evap = h[1] - h[4] COP = Q_evap/W_comp