{
 "metadata": {
  "name": "",
  "signature": "sha256:772f93702cda26918438fd90c36e1594260fd40351e3deed6d4e9bb6febe0344"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8 : Vapor Power Cycles"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1  Page No : 380"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#From the Steam Tables or Mollier chart in Appendix 3,we find that\n",
      "hf = 340.49; \t\t\t#Unit:kJ/kg \t\t\t#at 50kPa \t\t\t#enthalpy\n",
      "h1 = hf; \t\t\t#at 50kPa \t\t\t#hf = enthalpy of saturated liquid \t\t\t#Unit:kJ/kg\n",
      "h4 = 3230.9; \t\t\t#Unit:kJ/kg \t\t\t#enthalpy\n",
      "h5 = 2407.4; \t\t\t#Unit:kJ/kg \t\t\t#\t\t\t#enthalpy\n",
      "#Here,point 5 is in the wet steam region.\n",
      "print \"Solution for a\";\n",
      "#Neglecting pump work (h2 = h1) gives\n",
      "nR = (h4-h5)/(h4-h1); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle is %.2f percentage\"%(nR*100);\n",
      "\n",
      "print \"Solution for b\";\n",
      "p2 = 3000; \t\t\t#Unit:kPa \t\t\t#Upper pressure\n",
      "p1 = 50; \t\t\t#Unit:kPa \t\t\t#Lower pressure\n",
      "vf = 0.001030; \t\t\t#Specific volume of saturated liquid  \t\t\t#m**3/kg\n",
      "Pumpwork = (p2-p1)*vf; \t\t\t#Unit:kJ/kg \t\t\t#pump work\n",
      "#The efficiency of the cycle including pump work is\n",
      "nR = ((h4-h5)-Pumpwork)/((h4-h1)-Pumpwork); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle including pump work is %.2f percentage\"%(nR*100);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Solution for a\n",
        "The thermal efficiency of the cycle is 28.49 percentage\n",
        "Solution for b\n",
        "The thermal efficiency of the cycle including pump work is 28.42 percentage\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2  Page No : 381"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Using the computer disk to obtain the neccesary properties\n",
      "print \"Solution for a\";\n",
      "#For the conditions given in problem8.1,the properties are found to be\n",
      "hf = 340.49; \t\t\t#Unit:kJ/kg \t\t\t#at 50kPa \t\t\t#enthalpy\n",
      "h1 = hf; \t\t\t#at 50kPa \t\t\t#hf = enthalpy of saturated liquid\n",
      "h2 = h1; \t\t\t#Enthalpy \t\t\t#Unit:kJ/kg\n",
      "h4 = 3230.9; \t\t\t#Unit:kJ/kg \t\t\t#enthalpy\n",
      "h5 = 2407.4; \t\t\t#Unit:kJ/kg \t\t\t#enthalpy\n",
      "#Neglecting pump work \n",
      "nR = (h4-h5)/(h4-h2); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle is %.2f percentage\"%(nR*100);\n",
      "\n",
      "print \"Solution for b\";\n",
      "#For the pump work,we do not need the approximation,because the computerized tables give us the necessary values directly.\n",
      "#Assuming that the condensate leaving the condenser is saturated liquid gives us an enthalpy of 340.54 kJ/kg and an entropy of 1.0912 kJ/kg*K for an isentropic compression, the final cond-ition is the boiler pressure of 3Mpa and an entropy of 1.0912 kJ/kg*K. For these values,the program yields an enthalpy of 343.59 kJ/kg*K.The isentropic pump work is equal to \n",
      "Pumpwork = 343.59-340.54; \t\t\t#Unit:kJ/kg \t\t\t#pumpwork\n",
      "#The efficiency of the cycle including pump work is\n",
      "nR = ((h4-h5)-Pumpwork)/((h4-h1)-Pumpwork); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle including pump work is %.2f percentage\"%(nR*100);\n",
      "#Final results in this problem agree with the result in problem8.1\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Solution for a\n",
        "The thermal efficiency of the cycle is 28.49 percentage\n",
        "Solution for b\n",
        "The thermal efficiency of the cycle including pump work is 28.42 percentage\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3  Page No : 382"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Solution for (a)\n",
      "#Figurre 8.3 with the cycle extending into the superheat region and expanding along 4->5 is the appropriate diagram for this process.\n",
      "\n",
      "print \"Solution for b\";\n",
      "#This problem can be solved either by use of the Mollier chart or the Steam Tables.If the chart is used,14.696 psia is first located on the saturated vapor line.Because the expansion,4->5,is isentropic,a vertical line on the chart is the path of the process.The point corresponding to 4 in figure 8.3 is found where this vertical line intersects 400 psia.At this point,the ent-halpy is 1515 Btu/lbm,and the corresponding temperature is approximatelty 980F.Saturated vapor at 14.696 psia  has an enthalpy of 1150.5 Btu/lbm(from the Mollier chart).The Steam Tables sh-ow that saturated liquid at 14.696 psia has an enthalpy of 180.15 Btu/lbm.In terms of figure 8.3,and neglecting pump work,we have \n",
      "h1 = 180.15; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "h2 = h1; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm\n",
      "h4 = 1515; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "h5 = 1150.5; \t\t\t#Unit:kJ/kg \t\t\t#enthalpy\n",
      "#Neglecting pump work yields\n",
      "nR = (h4-h5)/(h4-h2); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"Neglecting the pump work, The thermal efficiency of the cycle is %.2f percentage\"%(nR*100);\n",
      "p2 = 400; \t\t\t#Unit:Psia \t\t\t#Upper pressure\n",
      "p1 = 14.696; \t\t\t#Unit:Psia \t\t\t#Lower pressure\n",
      "vf = 0.01167; \t\t\t#Specific volume of saturated liquid  \t\t\t#ft**3/lbm\n",
      "J = 778; \t\t\t#Conversion factor\n",
      "Pumpwork = ((p2-p1)*vf*144)/J; \t\t\t#Unit:Btu/lbm \t\t\t#1ft**2 = 144 in**2 \t\t\t#pumpwork\n",
      "#The efficiency of the cycle including pump work is\n",
      "nR = ((h4-h5)-Pumpwork)/((h4-h1)-Pumpwork); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle including pump work is %.2f percentage\"%(nR*100);\n",
      "#where the denominator is h4-h2 = h4-h1-(h2-h1).Neglecting pump work is obviously justified in this case.An alternative solution is obtained by Using the Steam Tables:at 14.696 psia ans sat-uration,sg = 1.7567 ; at 400 psia,s =  1.7567.From Table 3(at 400 psia)\n",
      "#   s      h      t\n",
      "#1.7632  1523.6  1000 \n",
      "#1.7567  1514.2  982.4\n",
      "#1.7558  1512.9  980"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Solution for b\n",
        "Neglecting the pump work, The thermal efficiency of the cycle is 27.31 percentage\n",
        "The thermal efficiency of the cycle including pump work is 27.26 percentage\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4  Page No : 383"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Refer to figure8.3.The desired  quantities are obtained as follows:\n",
      "#at 14.696 psia,saturated vapor (x = 1),s = 1.7566 Btu/lbm*R\n",
      "h5 = 1150.4; \t\t\t#Unit:Btu/lbm \t\t\t#enthaply\n",
      "#at 14.696 psia,saturated liquid (x = 0),s = 0.3122 Btu/lbm*R\n",
      "h2 = 180.17; \t\t\t#Unit:Btu/lbm \t\t\t#enthaply \n",
      "h1 = h2;\n",
      "#at 400 psia,s = 1.7566 Btu/lbm*R,\n",
      "h4 = 1514.0; \t\t\t#Unit:Btu/lbm \t\t\t#Enthalpy\n",
      "t = 982.07; \t\t\t#Unit:F \t\t\t#tempearature\n",
      "#at 400 psia,s = 0.3122 Btu/lbm*R, \t\t\t#s = entropy\n",
      "h = 181.39; \t\t\t#Unit:Btu/lbm \t\t\t#Enthalpy\n",
      "#Note the agreement of these values with the ones obtained for problem8.4.Alos,note the temperature of 982.07F compared to 982.4F.Continuing,\n",
      "#Neglecting pump work \n",
      "nR = (h4-h5)/(h4-h2); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"Neglecting the pump work, The thermal efficiency of the cycle is %.2f percentage\"%(nR*100);\n",
      "Pumpwork = h-h2; \t\t\t#Unit:kJ/kg \t\t\t#/pumpwork\n",
      "#The efficiency of the cycle including pump work is\n",
      "nR = ((h4-h5)-Pumpwork)/((h4-h2)-Pumpwork); \t\t\t#Thermal efficiency of the cycle\n",
      "print \"The thermal efficiency of the cycle including pump work is %.2f percentage\"%(nR*100);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Neglecting the pump work, The thermal efficiency of the cycle is 27.26 percentage\n",
        "The thermal efficiency of the cycle including pump work is 27.19 percentage\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5  Page No : 385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#The Carnot cycle would operate between 982.4F and 212F.\n",
      "T1 = 982.4+460; \t\t\t#temperature converted to absolute temperature \t\t\t#Unit:R\n",
      "T2 = 212+460; \t\t\t#temperature converted to absolute temperature \t\t\t#Unit:R\n",
      "nc = ((T1-T2)/T1)*100; \t\t\t#Efficiency of carnot cycle\n",
      "print \"The efficiency is %.2f percentage\"%(nc);\n",
      "#In problem 8.3,\n",
      "nR = 27.3; \t\t\t#Thermal efficiency of the cycle neglecting the pump work\n",
      "typen = (nR/nc)*100; \t\t\t#Type efficiency = ideal thermal efficiency/efficiency of carnot cycle operating between min and max temperature limits\n",
      "print \"The type efficiency of the ideal Rankine cycle is %.2f percentage\"%(typen);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency is 53.41 percentage\n",
        "The type efficiency of the ideal Rankine cycle is 51.11 percentage\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6  Page No : 385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#For the upper temperature of the cycle,we have 400C,and for 50kPa,the steam tables give us a saturation temperature of 81.33C.The efficiency of a Carnot cycle operating between the limits would be\n",
      "T1 = 400+273; \t\t\t#Celcius temperature converted to fahrenheit temperature\n",
      "T2 = 81.33+273; \t\t\t#temperature converted to fahrenheit temperature\n",
      "nc = ((T1-T2)/T1)*100; \t\t\t#Efficiency of carnot cycle\n",
      "print \"The efficiency is %.2f percentage\"%(nc);\n",
      "#In problem 8.1,\n",
      "nR = 28.5; \t\t\t#Thermal efficiency of the cycle neglecting the pump work\n",
      "typen = (nR/nc)*100; \t\t\t#Type efficiency = ideal thermal efficiency/efficiency of carnot cycle operating between min and max temperature limits\n",
      "print \"The type efficiency of the ideal Rankine cycle is %.2f percentage\"%(typen);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency is 47.35 percentage\n",
        "The type efficiency of the ideal Rankine cycle is 60.19 percentage\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7  Page No : 386"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#From problem 8.3,\n",
      "work = 1515-1150.5; \t\t\t#Unit:Btu/lbm of steam \t\t\t#pump work is neglected \t\t\t#Useful ideal work\n",
      "#Because of the heat losses, 50 Btu/lbm of the 364.5 Btu/lbm becomes unavailable.\n",
      "available = 364.5-50; \t\t\t#Unit:Btu/lbm \n",
      "n = available/(1515-180.15); \t\t\t#Thermal efficiency of the cycle neglecting pump work h4 = 1515; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy & h1 = 180.15; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "print \"The thermal efficiency of the cycle neglecting pump work is %.2f percentage\"%(n*100);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The thermal efficiency of the cycle neglecting pump work is 23.56 percentage\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8  Page No : 387"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Neglecting the pump work,we have\n",
      "heatrate = 3413/0.273; \t\t\t#Unit:Btu/kWh \t\t\t#0.273 = efficiency \t\t\t#1 kWh = 3413 \t\t\t#heat rate\n",
      "print \"The heat rate is %.2f Btu/kWh\"%(heatrate);\n",
      "#Per pound of steam,1515-1150.5 = 364.5 Btu is delivered.\n",
      "#Because 1 kWh = 3413\n",
      "print \"The steam rate is %.2f lbm of steam per kilowatt-hour\"%(3413./1515-1150.5)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat rate is 12501.83 Btu/kWh\n",
        "The steam rate is -1148.25 lbm of steam per kilowatt-hour\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.9  Page No : 388"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#The Mollier chart provides a convenient way of solving this problem.Expanding from 980F,400 psia,s = 1.7567 to 200 psia yields a final enthalpy of 1413 Btu/lbm.Expanding from 200 psia ans  an enthalpy of 1515 Btu/lbm to 14.696 psia yields a final enthaply of 1205 Btu/lbm. \n",
      "h4 = 1515; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "h5 = 1205; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "h7 = 1413; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "h1 = 180.15; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "nreheat = ((h4-h5)+(h4-h7))/((h4-h1)+(h4-h7)); \t\t\t#The efficiency of the reheat cycle\n",
      "print \"The efficiency of the reheat cycle is %.2f percentage\"%(nreheat*100);\n",
      "#It is apparent that for the conditions of this problem,the increase in efficiency is not very large.The final condition of the fluid after the second expansion is superheated steam at \n",
      "#14.696 psia.By condenmath.sing at this relatively high pressure condition,a large amount of heat is rejected to the condenser cooling water.7\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the reheat cycle is 28.67 percentage\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.10  Page No : 389"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Some of the property data required was found in problem8.4.In addition we have,\n",
      "#at 200 psia,s = 1.7566 Btu/lbm*R,\n",
      "h7 = 1413.6; \t\t\t#Unit:Btu/lbm \t\t\t#Enthalpy\n",
      "#at 200 psia,s = 1.8320 Btu/lbm*R,\n",
      "h4 = 1514.0; \t\t\t#Unit:Btu/lbm \t\t\t#Enthalpy\n",
      "#at 14.696 psia,s = 1.8320 Btu/lbm*R,\n",
      "h5 = 1205.2; \t\t\t#Unit:Btu/lbm \t\t\t#Enthalpy\n",
      "h1 = 180.17; \t\t\t#Unit:Btu/lbm \t\t\t#enthalpy\n",
      "\n",
      "# Calculations\n",
      "#Using these data,\n",
      "nreheat = ((h4-h5)+(h4-h7))/((h4-h1)+(h4-h7)); \t\t\t#The efficiency of the reheat cycle \n",
      "\n",
      "# Results\n",
      "print \"The efficiency of the reheat cycle is %.2f percentage\"%(nreheat*100);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the reheat cycle is 28.53 percentage\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.11  Page No : 394"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print \"Solution for a\";\n",
      "#For the rankine cycle,the Mollier chart gives\n",
      "h4 = 1505; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm\n",
      "h5 = 922; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm\n",
      "h6 = h5; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm\n",
      "#and at the condenser,\n",
      "h1 = 69.74; \t\t\t#enthalpy \t\t\t#Unit:Btu/lbm\n",
      "nR = (h4-h5)/(h4-h1); \t\t\t#efficiency of rankine cycle\n",
      "print \"The efficiency of rankine cycle is %.2f percentage\"%(nR*100);\n",
      "\n",
      "print \"Solution for b\";\n",
      "#Figure 8.16 shows the regenerative cycle.After doing work(isentropically),W lbs of steam are bled from the turbine at 50 psia for each lbm of steam leaving the steam generator,and (1-W)    pound goes through the turbine and is condensed in the condenser to saturated liquid at 1 psia.This condensate is pumped to the heater,where it mixes with the extraced steam and leaves as  saturated liquid at 50 psia.The required enthalpies are:\n",
      "#Leaving turbine:\n",
      "h5 = 1168; \t\t\t#Btu/lbm at 50 psia \n",
      "#Leaving condenser:\n",
      "h7 = 69.74; \t\t\t#Btu/lbm at 1 psia \t\t\t# is equal to h8 if pump work is neglected\n",
      "#Leaving heater:\n",
      "h1 = 250.24; \t\t\t#Btu/lbm at 50 psia \t\t\t#is equal to h2 if pump work is neglected(saturated liquid)\n",
      "#A Heat balance around the heater gives\n",
      "#W*h5 + (1-W)*h7  =  1*h1 \n",
      "W = ((1*h1)-h7)/(h5-h7); \t\t\t#Unit:lbm \t\t\t#W lb of steam \n",
      "print \"W = %.2f lbm\"%(W);\n",
      "work = (1-W)*(h4-922) + W*(h4-h5); \t\t\t#h5 = 922 from the mollier chart \t\t\t#Unit:Btu/lbm \t\t\t#The work output\n",
      "print \"The work output is %.2f Btu/lbm\"%(work);\n",
      "#Heat into steam generator equals the enthalpy leaving minus the enthalpy of the saturated liquid entering at 50 psia:\n",
      "qin = h4-h1; \t\t\t#Unit:Btu/lbm \t\t\t#Heat in\n",
      "n = work/qin; \t\t\t#Efficiency of regenerative cycle\n",
      "print \"The efficiency of regenerative cycle is %.2f percentage\"%(n*100);\n",
      "#The efficiency of a regenerative cycle with one open heater is given by \n",
      "n = 1-(((h5-h1)*(h6-h7))/((h4-h1)*(h5-h7)));  \t\t\t#efficiency of a regenerative cycle\n",
      "W = (h1-h7)/(h5-h7); \t\t\t#Unit:lbm  \t\t\t#W lb of steam\n",
      "print \"When the rankine cycle is compared with regenerative cycle\"\n",
      "print \"W = %.2f lbm and the efficiency of a regenerative cycle with one open heater is given by %.2f percentage\"%(W,n*100)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Solution for a\n",
        "The efficiency of rankine cycle is 40.62 percentage\n",
        "Solution for b\n",
        "W = 0.16 lbm\n",
        "The work output is 542.57 Btu/lbm\n",
        "The efficiency of regenerative cycle is 43.24 percentage\n",
        "When the rankine cycle is compared with regenerative cycle\n",
        "W = 0.16 lbm and the efficiency of a regenerative cycle with one open heater is given by 43.24 percentage\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.12  Page No : 396"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Figure 8.16(a) shows the cycle.For this cycle,W2 pounds are extracted at 100 psia,and W1 pounds are extracted at 50 psia for each pound produced by the steam generator.The enthalpies that  are required are:\n",
      "#Leaving turbine: 922 \t\t\t#Btu/lbm at 1 psia\n",
      "#Leaving condenser: 69.74 \t\t\t#Btu/lbm at 1 psia (saturated liquid)\n",
      "#Leaving low pressure heater: 250.24 \t\t\t#Btu/lbm at 50 psia (saturated liquid)\n",
      "#Leaving high pressure heater: 298.61 \t\t\t#Btu/lbm at 100 psia\n",
      "#At low pressure extraction: 1168 \t\t\t#Btu/lbm at 50 psia\n",
      "#At high pressure extraction: 1228.6 \t\t\t#Btulbm at 100 psia\n",
      "#Entering turbine: 1505 \t\t\t#Btu/lbm\n",
      "#The heat balance around the high pressure heater gives us\n",
      "#W2*1228.6 + (1-W2)*250.24  =  1*298.61\n",
      "W2 = ((1*298.61)-250.24)/(1228.6-250.24); \t\t\t#lbm \t\t\t#W2 pounds are extracted at 100 psia\n",
      "print \"W2 = %.2f lbm\"%(W2);\n",
      "#A heat balance around the low pressure heater yields\n",
      "#W1*1168 + (1-W1-W2)*69.74  =  (1-W2)*250.24\n",
      "W1 = (((1-W2)*250.24)-69.74+(W2*69.74))/(1168-69.74); \t\t\t#lbm \t\t\t#W1 pounds are extracted at 50 psia\n",
      "print \"W1 = %.2f lbm\"%(W1);\n",
      "work = ((1505-1228.6)*1)+((1-W2)*(1228.6-1168))+((1-W1-W2)*(1168-922)); \t\t\t#The work output \t\t\t#Btu/lbm\n",
      "print \"The work output is %.2f Btu/lbm\"%(work);\n",
      "#Heat into the steam generator equals the enthalpy leaving minus the enthalpy of saturated liquid at 100 psia:\n",
      "qin = 1505-298.61; \t\t\t#Btu/lbm \t\t\t#Heat in \n",
      "print \"Heat in  =  %.2f Btu/lbm\"%(qin);\n",
      "n = work/qin; \t\t\t#The efficiency\n",
      "print \"The efficiency is %.2f percentage\"%(n*100);\n",
      "#In terms of figure 8.16a,\n",
      "#W2 = (h1-h11)/(h5-h11)\n",
      "#W1 = (h5-h1/h6-h9)*(h10-h9/h5-h10) neglecting the pump work\n",
      "#n = 1-(h7-h8/h4-h1)*(h5-h1/h5-h10)*(h6-h10/h6-h8)\n",
      "#For this problem , h8 = h9 , h10 = h11 and h1 = h2.Thus\n",
      "W2 = (298.61-250.24)/(1228.6-250.24); \t\t\t#lbm \t\t\t#W2 pounds are extracted at 100 psia\n",
      "print \"Comparing the results\"\n",
      "print \"W2 = %.2f lbm\"%(W2);\n",
      "W1 = ((1228.6-298.61)*(250.24-69.74))/((1168-69.74)*(1228.6-250.24)); \t\t\t#lbm \t\t\t#W1 pounds are extracted at 50 psia\n",
      "print \"W1 = %.2f lbm\"%(W1); \n",
      "n = 1-(((922-69.74)*(1228.6-298.61)*(1168-250.24))/((1505-298.61)*(1228.6-250.24)*(1168-69.74))); \t\t\t#Efficiency\n",
      "print \"The efficiency is %.2f percentage\"%(n*100);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W2 = 0.05 lbm\n",
        "W1 = 0.16 lbm\n",
        "The work output is 529.41 Btu/lbm\n",
        "Heat in  =  1206.39 Btu/lbm\n",
        "The efficiency is 43.88 percentage\n",
        "Comparing the results\n",
        "W2 = 0.05 lbm\n",
        "W1 = 0.16 lbm\n",
        "The efficiency is 43.88 percentage\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.13  Page No : 398"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Regenerative cycle\n",
      "#Assume that 1 lbm of steam leaves the steam generator and that W1 lbm is bled off to the closed heater at 100psia and that W2 lbm is bled off to the open heater at 50 psia.Alos,assume that the feedwater leaving the closed heater at 310F,18F less than the saturation temperature corresponding to 100 psia.For calculation purposes,we will use hf at 310 F for this enthalpy.Using the Mollier diagram and the steam tables,we find the following values of enthalpy:\n",
      "\n",
      "#h to turbine = 1505 Btu/lbm(at 1000 psia and 1000F)\n",
      "#h at first extraction = 1228 Btu/lbm(isentropically to 100 psia)\n",
      "#h at second extraction = 1168 Btu/lbm(isentropically to 100 psia)\n",
      "#h at turbine exit = 922 Btu/lbm (isentropically to 1 psia)\n",
      "#hf = 298.61 Btu/lbm(at 100 psia)\n",
      "#hf = 250.24 Btu/lbm(at 50 psia)\n",
      "#hf = 280.06 Btu/lbm(at 310 F)\n",
      "#hf = 69.74 Btu/lbm (at 1 psia)\n",
      "#A heat balance around the high pressure heater gives us\n",
      "#W1*(1228-298.61)  =  1*(280.06-250.24)\n",
      "W1 = ((1*(280.06-250.24)))/(1228-298.61); \t\t\t#lbm \t\t\t#W1 lbm is extracted at 100 psia\n",
      "print \"W1 = %.2f lbm\"%(W1);\n",
      "#A heat balance around the open heater gives us\n",
      "#W2*1168 +(1-W1-W2)*69.74 + W1*268.61  =  1*250.24\n",
      "W2 = ((1*250.24)-(W1*268.61)-69.74+(W1*69.74))/(1168-69.74); \t\t\t#lbm \t\t\t#W2 lbm is extracted at 50 psia\n",
      "print \"W2 = %.2f lbm\"%(W2);\n",
      "#The work output of the cycle consists of the work that 1 lbm does in expanding isentropically to 100 psia,plus the work done by (1-W1)lbm expanding isentropicaly from 100 to 50 psia,plus the work done by (1-W1-W2)lbm expanding isentropically from 50 to 1 psia.\n",
      "#Numerically,the work is\n",
      "workoutput = (1*(1505-1228))+((1-W1)*(1228-1168))+((1-W1-W2)*(1168-922)); \t\t\t#Btu/lbm \t\t\t#the work output\n",
      "print \"The work output is %.2f Btu/lbm\"%(workoutput);\n",
      "heatinput = 1505-280.06; \t\t\t#Btu/lbm \t\t\t#the heat input\n",
      "print \"The heat input is %.2f Btu/lbm\"%(heatinput);\n",
      "n = workoutput/heatinput; \t\t\t#Efficiency\n",
      "print \"The efficiency is %.2f percentage\"%(n*100);\n",
      "#When compared to 8.11,we conclude that the addition of additional closed heater raises the efficiency. \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W1 = 0.03 lbm\n",
        "W2 = 0.16 lbm\n",
        "The work output is 534.18 Btu/lbm\n",
        "The heat input is 1224.94 Btu/lbm\n",
        "The efficiency is 43.61 percentage\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.14  Page No : 426"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#From problem 8.11,\n",
      "#Leaving turbine:\n",
      "h5 = 1168.; \t\t\t#Btu/lbm at 50 psia \n",
      "#For the rankine cycle,the Mollier chart gives\n",
      "h4 = 1505.; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm\n",
      "h6 = 922.; \t\t\t#Enthalpy \t\t\t#Unit:Btu/lbm \t\t\t#h6 = h5;\n",
      "#and at the condenser,\n",
      "h1 = 69.74; \t\t\t#enthalpy \t\t\t#Unit:Btu/lbm\n",
      "#Leaving condenser:\n",
      "h7 = 69.74; \t\t\t#Btu/lbm at 1 psia \t\t\t# is equal to h8 if pump work is neglected\n",
      "#Leaving heater:\n",
      "h2 = 250.24; \t\t\t#Btu/lbm at 50 psia \t\t\t#is equal to h1 if pump work is neglected(saturated liquid)\n",
      "#A Heat balance around the heater gives\n",
      "#W*h5 + (1-W)*h7  =  1*h1 \n",
      "W = ((1*h2)-h7)/(h5-h7); \t\t\t#Unit:lbm\n",
      "liquidleaving = (W*h2)+(1-W)*h1; \t\t\t#Btu/lbm \t\t\t#liquid leaving the heatexchange\n",
      "\n",
      "#Using these data,,\n",
      "heatin = h4-liquidleaving; \t\t\t#Btu/lbm \t\t\t#heat in the boiler\n",
      "print \"Heat in at boiler is %.2f Btu/lbm\"%(heatin);\n",
      "workout = ((1-W)*(h4-h6))+(W*(h4-h5)); \t\t\t#Btu/lbm \t\t\t#The work out of turbine\n",
      "print \"The work out of turbine is %.2f Btu/lbm\"%(workout);\n",
      "n = workout/heatin; \t\t\t#efficiency \t\t\t#The conventional thermal efficiency\n",
      "print \"The conventional thermal efficiency is %.2f percentage\"%(n*100);\n",
      "#If at this time we have define the efficiency of energy utilization to be the ratio of the work out plus the useful heat out divided by the heat input to the    cycle, nenergyutilization = ((w+qoutuseful)/qin)*100\n",
      "qout = W*(h5-h2); \t\t\t#heat out \t\t\t#Btu/lbm\n",
      "n = (workout+qout)/heatin; \t\t\t#efficiency of energy utilization\n",
      "print \"Efficiency of energy utilization is %.2f percentage\"%(n*100);\n",
      "#Comparing with 8.11, we see that conventional thermal efficiency is decreased and efficiency of energy utilization is increased\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat in at boiler is 1405.59 Btu/lbm\n",
        "The work out of turbine is 542.57 Btu/lbm\n",
        "The conventional thermal efficiency is 38.60 percentage\n",
        "Efficiency of energy utilization is 49.33 percentage\n"
       ]
      }
     ],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}