{
 "metadata": {
  "name": "",
  "signature": "sha256:43030cb407ee8b4a262c4ba255fecb3e020be8690e26722c194a6ec2d965f42c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 14 : Refrigeration Cycles"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.1 Page No : 587"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T2 = 268.; \n",
      "T1 = 308.;\n",
      "\n",
      "# Calculation\n",
      "COP = T2/(T1-T2);\n",
      "ACOP = COP/3; \t\t\t# Actual COP\n",
      "Q2 = 29.; \t\t\t# in kW\n",
      "W = Q2/ACOP;\n",
      "\n",
      "# Results\n",
      "print \"Power required to derive the plane is %.0f kW\"%W\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power required to derive the plane is 13 kW\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.2 Page No : 589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "h1 = 236.04; s1 = 0.9322; s2 = s1;\n",
      "P2 = 0.8; \t\t\t# in MPa\n",
      "h2 = 272.05; h3 = 93.42; h4 = h3;\n",
      "m = 0.06; \t\t\t# mass flow rate\n",
      "\n",
      "# Calculation\n",
      "Q2 = m*(h1-h4);\n",
      "Wc = m*(h2-h1);\n",
      "Q1 = m*(h2-h4);\n",
      "COP = Q2/Wc;\n",
      "\n",
      "# Results\n",
      "print \"The rate of heat removal is %.2f kW\"%Q2\n",
      "print \"Power input to the compressor is %.2f kW\"%Wc\n",
      "print \"The heat rejection rate in the condenser is %.2f kW\"%Q1\n",
      "print \"COP is %.3f\"%COP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate of heat removal is 8.56 kW\n",
        "Power input to the compressor is 2.16 kW\n",
        "The heat rejection rate in the condenser is 10.72 kW\n",
        "COP is 3.961\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.3 Page No : 589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "h1 = 183.19; \n",
      "h2 = 209.41; \n",
      "h3 = 74.59; \n",
      "h4 = h3;\n",
      "T1 = 313.; \n",
      "T2 = 263.;\n",
      "W = 70000./3600; \t\t\t# Plant capacity in kW\n",
      "\n",
      "# Calculation\n",
      "w = W/(h1-h4); \t\t\t# Refrigerant flow rate\n",
      "v1 = 0.077;\n",
      "VFR = w*v1;\n",
      "T = 48.; \t\t\t# in degree\n",
      "P2 = 9.6066; P1 = 2.1912;\n",
      "rp = P2/P1; \t\t\t# Pressure ratio\n",
      "Q1 = w*(h2-h3);\n",
      "hf = 26.87; hfg = 156.31;\n",
      "x4 = (h4-hf)/hfg;\n",
      "COP = (h1-h4)/(h2-h1);\n",
      "PI = w*(h2-h1);\n",
      "COP = T2/(T1-T2);\n",
      "COP_v = 4.14;\n",
      "r = COP_v/COP;\n",
      "\n",
      "# Results\n",
      "print \"Refrigerant flow rate is %.2f Kg/s\"%w\n",
      "print \"Volume flow rate is %.4f m3/s\"%VFR\n",
      "print \"Compressor discharge temperature is\",T,\"degree\"\n",
      "print \"Pressure ratio is %.2f\"%rp\n",
      "print \"Heat rejected to the condenser is %.2f kW\"%Q1\n",
      "print \"Flash gas percentage is %.1f %%\"%(x4*100)\n",
      "print \"COP is\",COP\n",
      "print \"Power required to drive the compressor is %.2f kW\"%PI\n",
      "print \"Ratio of COP of carnot refrigerator is %.3f\"%r\n",
      "\n",
      "# note : rounding off error is there."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refrigerant flow rate is 0.18 Kg/s\n",
        "Volume flow rate is 0.0138 m3/s\n",
        "Compressor discharge temperature is 48.0 degree\n",
        "Pressure ratio is 4.38\n",
        "Heat rejected to the condenser is 24.14 kW\n",
        "Flash gas percentage is 30.5 %\n",
        "COP is 5.26\n",
        "Power required to drive the compressor is 4.69 kW\n",
        "Ratio of COP of carnot refrigerator is 0.787\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.4 Page No : 590"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "h3 = 882.\n",
      "h2 = 1034.;\n",
      "h6 = 998.\n",
      "h1 = 1008.;\n",
      "v1 = 0.084;\n",
      "\n",
      "# Calculation and Results\n",
      "h4 = h3-h1+h6; h5 = h4;\n",
      "t4 = 25.+273;\n",
      "print \"Refrigeration effect is\",h6-h5,\"kJ/kg\"\n",
      "\n",
      "m = 10.;\n",
      "w = (m*14000)/((h6-h5)*3600); \t\t\t# in kg/s\n",
      "print \"Refrigerant flow rate is %.2f kg/s\"%w\n",
      "\n",
      "v1 = 0.084;\n",
      "VFR = w*3600*v1; \t\t\t# in kg/h\n",
      "ve = 0.8; \t\t\t# volumetric efficiency\n",
      "CD = VFR/(ve*60); \t\t\t# in m3/min\n",
      "N = 900;\n",
      "n = 2;\n",
      "D = ((CD*4)/(math.pi*1.1*N*n))**(1./3); \t\t\t# L = 1.1D L = length D = diameter\n",
      "L = 1.1*D;\n",
      "print \"Diameter of cylinder is %.1f cm\"%(D*100)\n",
      "print \"Length of cylinder is %.2f cm\"%(L*100)\n",
      "COP = (h6-h5)/(h2-h1);\n",
      "PI = w*(h2-h1);\n",
      "print \"Power required to drive the compresor is %.2f kW\"%PI\n",
      "print \"COP is %.2f\"%COP\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refrigeration effect is 126.0 kJ/kg\n",
        "Refrigerant flow rate is 0.31 kg/s\n",
        "Diameter of cylinder is 10.8 cm\n",
        "Length of cylinder is 11.85 cm\n",
        "Power required to drive the compresor is 8.02 kW\n",
        "COP is 4.85\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.5 Page No : 592"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P2 = 1554.3;\n",
      "P1 = 119.5;\n",
      "Pi = math.sqrt(P1*P2);\n",
      "h1 = 1404.6; \n",
      "h2 = 1574.3; \n",
      "h3 = 1443.5; \n",
      "h4 = 1628.1;\n",
      "h5 = 371.7; h6 = h5; h7 = 181.5;\n",
      "w = 30.; \t\t\t# capacity of plant\n",
      "\n",
      "# Calculation\n",
      "m2_dot = (3.89*30)/(h1-h7);\n",
      "m1_dot = m2_dot*((h2-h7)/(h3-h6));\n",
      "Wc_dot = m2_dot*(h2-h1)+m1_dot*(h4-h3);\n",
      "COP = w*3.89/Wc_dot;\n",
      "\t\t\t# math.single stage\n",
      "h1_ = 1404.6; h2_ = 1805.1;\n",
      "h3_ = 371.1; h4_ = h3_;\n",
      "m_dot = (3.89*30)/(h1_-h4_);\n",
      "Wc = m_dot*(h2_-h1_);\n",
      "COP_ = w*3.89/Wc;\n",
      "IW = (Wc-Wc_dot)/Wc_dot;\n",
      "ICOP = (COP-COP_)/COP_\n",
      "\n",
      "# Results\n",
      "print \"Increase in work of compression is %.2f\"%(IW*100)\n",
      "print \"Increase in COP for 2 stage compression is %.2f %%\"%(ICOP*100)\n",
      "\n",
      "# note : rounding error is there."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Increase in work of compression is 15.72\n",
        "Increase in COP for 2 stage compression is 15.72 %\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.6 Page No : 593"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "tsat = 120.2+273\n",
      "hfg = 2201.9;\n",
      "T1 = 120.2+273;\n",
      "T2 = 30.+273;\n",
      "Tr = -10.+273;\n",
      "\n",
      "# Calculation\n",
      "COP_max = ((T1-T2)*Tr)/((T2-Tr)*T1);\n",
      "ACOP = 0.4*COP_max;\n",
      "Qe = (20.*14000)/3600; \t\t\t# in KW\n",
      "Qg = Qe/ACOP;\n",
      "x = 0.9; \n",
      "H = x*hfg;\n",
      "SFR = Qg/H;\n",
      "\n",
      "# Results\n",
      "print \"Steam flow rate required is %.4f kg/s\"%SFR\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Steam flow rate required is 0.0651 kg/s\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.7 Page No : 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = 277.; \n",
      "T3 = 273.+55;\n",
      "rp = 3.; \t\t\t# Pressure ratio\n",
      "g = 1.4; \n",
      "cp = 1.005;\n",
      "\n",
      "# Calculation and Results\n",
      "T2s = T1*(rp**((g-1)/g));\n",
      "T2 = T1+(T2s-T1)/0.72\n",
      "T4s = T3/(rp**((g-1)/g));\n",
      "T34 = 0.78*(T3-T4s); \t\t\t# T3-T4\n",
      "T4 = T3-T34;\n",
      "COP = (T1-T4)/((T2-T1)-(T3-T4));\n",
      "print \"COP of the refrigerator is %.2f\"%COP\n",
      "P = (3.*14000)/(COP*3600)\n",
      "print \"Driving power required is %.1f kW\"%P\n",
      "m = (3.*14000)/(cp*(T1-T4));\n",
      "print \"Mass flow rate is %.2f kg/s\"%(m/3600)\n",
      "\n",
      "# note: rounding off error is there."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP of the refrigerator is 0.25\n",
        "Driving power required is 47.5 kW\n",
        "Mass flow rate is 0.65 kg/s\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.8 Page No : 596"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P1 = 2.4; T1 = 0+273;\n",
      "h1 = 188.9; s1 = 0.7177; v1 = 0.0703;\n",
      "P2 = 9; T2 = 60+273;\n",
      "h2 = 219.37;\n",
      "h2s = 213.27;\n",
      "h3 = 71.93; h4 = h3;\n",
      "v1 = 0.0703;\n",
      "A1V1 = 0.6/60;\n",
      "\n",
      "# Calculation\n",
      "m_dot = A1V1/0.0703;\n",
      "Wc_dot = m_dot*(h2-h1);\n",
      "Q1_dot = m_dot*(h2-h3);\n",
      "COP = Q1_dot/Wc_dot;\n",
      "nis = (h2s-h1)/(h2-h1);\n",
      "\n",
      "# Results\n",
      "print \"Power input is %.2f kW\"%Wc_dot\n",
      "print \"Heating capacity is %.2f kW\"%Q1_dot\n",
      "print \"COP is %.3f\"%COP\n",
      "print \"The isentropic compressor efficiency is %.2f %%\"%(nis*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power input is 4.33 kW\n",
        "Heating capacity is 20.97 kW\n",
        "COP is 4.839\n",
        "The isentropic compressor efficiency is 79.98 %\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.9 Page No : 597"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = 275.; \n",
      "T3 = 310.;\n",
      "P1 = 1. ; P2 = 4.;\n",
      "\n",
      "# Calculation\n",
      "T2s = T1*(P2/P1);\n",
      "nc = 0.8;\n",
      "T2 = T1 + (T2s-T1)*nc;\n",
      "pr = 0.1;\n",
      "P3 = P2-0.1;\n",
      "P4 = P1+0.08;\n",
      "PR = P3/P4;\n",
      "\n",
      "# Results\n",
      "print \"Pressure ratio for the turbine is %.3f\"%PR\n",
      "T4s = T3*(1./PR)**(0.286);\n",
      "nt = 0.85;\n",
      "T4 = T3-(T3-T4s)*nt;\n",
      "COP = (T1-T4)/((442.26-T3)-(T1-T4));\n",
      "print \"COP is %.3f\"%COP\n",
      "\n",
      "# note : rounding off error is there."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure ratio for the turbine is 3.611\n",
        "COP is 0.533\n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}