{
 "metadata": {
  "name": "",
  "signature": "sha256:53a735279bd0b4b47d350239e84293c3d52753ef579aa2d9f892dff4596cafc6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12 : Fuels and Combustion"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1 Page No : 412"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "xCO2 = 0.03 \t\t\t#mole fraction of CO2\n",
      "xCO = 0.19 \t\t\t#mole fraction of CO\n",
      "xH2 = 0.41 \t\t\t#mole fraction of H2\n",
      "xCH4 = 0.25 \t\t\t#mole fraction of CH4\n",
      "xC2H4 = 0.09 \t\t\t#mole fraction of C2H4\n",
      "xN2 = 0.03 \t\t\t#mole fraction of N2\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "#Part(a)\n",
      "print \"Parta\";\n",
      "M = xCO2*44 + xCO*28 + xH2*2 + xC2H4*28 +xCH4*16 + xN2*28 \t\t\t#kg/mol \t\t\t#average molar mass\n",
      "yCO2 = xCO2*(44/M)\n",
      "yCO = xCO*(28/M)\n",
      "yH2 = xH2*(2/M)\n",
      "yCH4 = xCH4*(16/M)\n",
      "yC2H4 = xC2H4*(28/M)\n",
      "yN2 = xN2*(28/M)\n",
      "print \"yCO2 = %.1f%%\"%(yCO2*100)\n",
      "print \"yCO = %.1f%%\"%(yCO*100)\n",
      "print \"yH2 = %.1f%%\"%(yH2*100)\n",
      "print \"yCH4 = %.0f%%\"%(yCH4*100)\n",
      "print \"yC2H4 = %.1f%%\"%(yC2H4*100)\n",
      "print \"yN2 = %.1f%%\"%(yN2*100)\n",
      "\n",
      "#Part(b)\n",
      "print \"Partb\";\n",
      "nC = xCO2 + xCO + xCH4 + xC2H4*2 \t\t\t#number of moles of C\n",
      "nH2 = xH2 + xCH4*2 + xC2H4*2 \t\t\t#number of moles of H2\n",
      "nO2 = xCO2 + 0.5*xCO \t\t\t#number of moles of O2\n",
      "nN2 = xN2 \t\t\t#number of moles of N2\n",
      "\n",
      "mC = nC*12/M\n",
      "mH2 = nH2*2/M\n",
      "mO2 = nO2*32/M\n",
      "mN2 = nN2*28/M\n",
      "print \"mC = %.1f%%\"%(mC*100)\n",
      "print \"mH2 = %.1f%%\"%(mH2*100)\n",
      "print \"mO2 = %.0f%%\"%(mO2*100)\n",
      "print \"mN2 = %.1f%%\"%(mN2*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parta\n",
        "yCO2 = 8.9%\n",
        "yCO = 35.9%\n",
        "yH2 = 5.5%\n",
        "yCH4 = 27%\n",
        "yC2H4 = 17.0%\n",
        "yN2 = 5.7%\n",
        "Partb\n",
        "mC = 52.6%\n",
        "mH2 = 14.7%\n",
        "mO2 = 27%\n",
        "mN2 = 5.7%\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2 Page No : 416"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "#Molar masses of O2,H2,N2,C and S respectively\n",
      "MO2 = 32. \t\t\t#g/mol\n",
      "MH2 = 2. \t\t\t#g/mol\n",
      "MN2 = 28. \t\t\t#g/mol\n",
      "MC = 12. \t\t\t#g/mol\n",
      "MS = 32. \t\t\t#g/mol\n",
      "#Part(a)\n",
      "print \"Parta\"\n",
      "print \"Stoichiometric airCarbon) = %.2f kg/kg carbon\"%((MO2 + 3.76*MN2)/MC)\n",
      "#Part(b)\n",
      "print \"Partb\"\n",
      "print \"Stoichiometric airHydrogen) = %.1f kg/kg hydrogen\"%(0.5*(MO2 + 3.76*MN2)/MH2)\n",
      "#Part(c)\n",
      "print \"Partc\"\n",
      "print \"Stoichiometric airSulphur) = %.1f kg/kg sulphur\"%((MO2 + 3.76*MN2)/MS)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parta\n",
        "Stoichiometric airCarbon) = 11.44 kg/kg carbon\n",
        "Partb\n",
        "Stoichiometric airHydrogen) = 34.3 kg/kg hydrogen\n",
        "Partc\n",
        "Stoichiometric airSulphur) = 4.3 kg/kg sulphur\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3 Page No : 417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "xC3H8 = 0.2 \t\t\t#mole fraction of propane\n",
      "xC4H10 = 0.8 \t\t\t#mole fraction of bumath.tane\n",
      "#Molar masses of O2,H2,N2 & C respectively\n",
      "MO2 = 32. \t\t\t#g/mol\n",
      "MH2 = 2. \t\t\t#g/mol\n",
      "MN2 = 28. \t\t\t#g/mol\n",
      "MC = 12. \t\t\t#g/mol\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "#C balance\n",
      "b = xC3H8*3+xC4H10*4\n",
      "#H2 balance\n",
      "d = xC3H8*4 + xC4H10*5\n",
      "#O2 balance\n",
      "a = b + d/2\n",
      "#N2 balance\n",
      "c = 3.76*a\n",
      "\n",
      "Stoichiometric_air =  a*(MO2 + 3.76*MN2)/(xC3H8*(MC+MO2)+xC4H10*(MC*4+MH2*5))\n",
      "print \"Stoichiometric air = %.2f kg/kg cooking gas\"%(Stoichiometric_air)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stoichiometric air = 15.42 kg/kg cooking gas\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4 Page No : 418"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "xC3H8 = 0.2 \t\t\t#mole fraction of propane\n",
      "xC4H10 = 0.8 \t\t\t#mole fraction of bumath.tane\n",
      "\n",
      "xO2 = 0.21 \t\t\t#mole fraction of O2\n",
      "xN2 = 0.79 \t\t\t#mole fraction of N2\n",
      "#Molar masses of O2,H2,N2 & C respectively\n",
      "MO2 = 32. \t\t\t#g/mol\n",
      "MH2 = 2. \t\t\t#g/mol\n",
      "MN2 = 28. \t\t\t#g/mol\n",
      "MC = 12. \t\t\t#g/mol\n",
      "Stoichiometric_air = 15.42 \t\t\t#kg/kg\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "#C balance\n",
      "b = xC3H8*3+xC4H10*4\n",
      "#H2 balance\n",
      "e = xC3H8*4 + xC4H10*5\n",
      "#O2 balance\n",
      "d = 40*xO2-b -0.5*e\n",
      "#N2 balance\n",
      "c = 40*xN2\n",
      "\n",
      "actual_air = 40*(xO2*MO2 + xN2*MN2)/(xC3H8*(MC*3+MH2*4)+xC4H10*(MC*4+MH2*5)) \t\t\t#kg/kg gas\n",
      "\n",
      "excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100\n",
      "print \"Excess air = %.1f%%\"%(excess_air)\n",
      "\n",
      "theoritical_air = 100+excess_air\n",
      "print \"Theoritical air = %.1f%%\"%(theoritical_air)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Excess air = 35.5%\n",
        "Theoritical air = 135.5%\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5 Page No : 420"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "nCO2 = 3.8 \t\t\t#Number of moles of CO2\n",
      "nN2 = 31.6 \t\t\t#Number of moles of N2\n",
      "nO2 = 2.2 \t\t\t#Number of moles of O2\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "n = nCO2 + nN2 + nO2\n",
      "xCO2 = nCO2/n \t\t\t#mole fraction of CO2\n",
      "xN2 = nN2/n \t\t\t#mole fraction of N2\n",
      "xO2 = nO2/n \t\t\t#mole fraction of O2\n",
      "\n",
      "print \"xCO2 = %.1f %% \"%(xCO2*100)\n",
      "print \"xN2 = %.1f %% \"%(xN2*100)\n",
      "print \"xO2 = %.1f %% \"%(xO2*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "xCO2 = 10.1 % \n",
        "xN2 = 84.0 % \n",
        "xO2 = 5.9 % \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6 Page No : 421"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "nCO2 = 3.8 \t\t\t#Number of moles of CO2\n",
      "nN2 = 31.6 \t\t\t#Number of moles of N2\n",
      "nO2 = 2.2 \t\t\t#Number of moles of O2\n",
      "nH2O = 4.8 \t\t\t#Number of moles of H2O\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "n = nCO2 + nN2 + nO2 + nH2O\n",
      "xCO2 = nCO2/n \t\t\t#mole fraction of CO2\n",
      "xN2 = nN2/n \t\t\t#mole fraction of N2\n",
      "xO2 = nO2/n \t\t\t#mole fraction of O2\n",
      "xH2O = nH2O/n \t\t\t#mole fraction of H2O\n",
      "\n",
      "print \"Volume fraction of CO2 = %.1f%%\"%(xCO2*100)\n",
      "print \"Volume fraction of N2 = %.1f%%\"%(xN2*100)\n",
      "print \"Volume fraction of O2 = %.1f%%\"%(xO2*100)\n",
      "print \"Volume fraction of H2O = %.1f%%\"%(xH2O*100)\n",
      "\n",
      "M = xCO2*44 + xN2*28 + xO2*32 + xH2O*18 \t\t\t#Mass of combustion product\n",
      "\n",
      "yCO2 = xCO2*(44/M)\n",
      "yH2O = xH2O*(18/M)\n",
      "yN2 = xN2*(28/M)\n",
      "yO2 = xO2*(32/M)\n",
      "\n",
      "print \"Mass fraction of CO2 = %.1f%%\"%(yCO2*100)\n",
      "print \"Mass fraction of N2 = %.1f%%\"%(yN2*100)\n",
      "print \"Mass fraction of O2 = %.1f%%\"%(yO2*100)\n",
      "print \"Mass fraction of H2O = %.1f%%\"%(yH2O*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Volume fraction of CO2 = 9.0%\n",
        "Volume fraction of N2 = 74.5%\n",
        "Volume fraction of O2 = 5.2%\n",
        "Volume fraction of H2O = 11.3%\n",
        "Mass fraction of CO2 = 13.8%\n",
        "Mass fraction of N2 = 73.2%\n",
        "Mass fraction of O2 = 5.8%\n",
        "Mass fraction of H2O = 7.1%\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.7 Page No : 422"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Part(a)\n",
      "print \"Parta\"\n",
      "mC = 0.65 \t\t\t#kg \t\t\t#mass of C per kg coal\n",
      "mA = 0.15 \t\t\t#kg \t\t\t#mass of Ash per kg coal\n",
      "CR = 0.05 \t\t\t#kg \t\t\t#mass of carbon in solid refuse per kg coal\n",
      "mR = 0.2 \t\t\t#kg \t\t\t#mass of refuse per kg coal\n",
      "m = mC- CR \t\t\t#kg \t\t\t#mass of carbon burnt per kg coal\n",
      "\n",
      "#By C balance\n",
      "x = (14 + 1)*(12/0.6) \t\t\t#kg \t\t\t#mass of burnt coal\n",
      "#By H2 balance\n",
      "b = x*(0.06/2)\n",
      "#By O2 Balance\n",
      "a = (14 + 0.5 + 3.5 + 4.5)-(x*0.1/32) \n",
      "actual_air = a*(32+3.76*28)/x \t\t\t#kg/kg coal\n",
      "print \"Actual air = %.3f kg/kg coal\"%(actual_air)\n",
      "\n",
      "#Part(b)\n",
      "print \"Partb\"\n",
      "Stoichiometric_air = (0.6*11.45+0.06*34.3)-(0.1/0.232) \t\t\t#kg\n",
      "excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100 \n",
      "print \"Excess air = %.1f%%\"%(excess_air)\n",
      "\n",
      "#Part(c)\n",
      "print \"Partc\";\n",
      "print \"Percentage theoritical air = %.1f%%\"%(100+excess_air)\n",
      "\n",
      "#Part(d)\n",
      "print \"Partd\"\n",
      "m = 14*44 + 1*28 +3.5*32 +81.5*28 +9*18 \t\t\t#kg \t\t\t#mass of combustion product\n",
      "print \"Mass fraction of CO2 = %.2f%%\"%(14*44/m*100)\n",
      "print \"Mass fraction of CO = %.3f%%\"%(1*28/m*100)\n",
      "print \"Mass fraction of O2 = %.2f%%\"%(3.5*32/m*100)\n",
      "print \"Mass fraction of N2 = %.2f%%\"%(81.5*28/m*100)\n",
      "print \"Mass fraction of H2O = %.2f%%\"%(9*18/m*100)\n",
      "\n",
      "#Part(e)\n",
      "print \"Parte\"\n",
      "xH2O = 9/(14+1+3.5+81.5+9) \t\t\t#molfraction of H2O\n",
      "pH2O = xH2O*1e5 \t\t\t#Pa \t\t\t#partial pressure\n",
      "#From steam table\n",
      "tdp = 42.5 \t\t\t#\u00b0C\n",
      "print \"Dew point temperature = %.1f \u00b0C\"%(tdp)\n",
      "\n",
      "\n",
      "# note : part b is calculated wrong in book. so answers might be different."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parta\n",
        "Actual air = 9.867 kg/kg coal\n",
        "Partb\n",
        "Excess air = 16.1%\n",
        "Partc\n",
        "Percentage theoritical air = 116.1%\n",
        "Partd\n",
        "Mass fraction of CO2 = 19.25%\n",
        "Mass fraction of CO = 0.875%\n",
        "Mass fraction of O2 = 3.50%\n",
        "Mass fraction of N2 = 71.31%\n",
        "Mass fraction of H2O = 5.06%\n",
        "Parte\n",
        "Dew point temperature = 42.5 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.8 Page No : 425"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "xCO2 = 9.7 \t\t\t#mole percent CO2\n",
      "xCO = 1.1 \t\t\t#mole percent CO\n",
      "xO2 = 4 \t\t\t#mole percent O2\n",
      "xN2 = 85.2 \t\t\t#mole percent N2\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "#by C balance\n",
      "b = 2\n",
      "#by H2 balance\n",
      "d = 2\n",
      "#by O2 balance\n",
      "a = b+d*.5\n",
      "#by N2 balance\n",
      "c = 3.76*a\n",
      "\n",
      "Stoichiometric_air = a*(32+3.76*28)/28 \t\t\t#kg/kg ethylene\n",
      "\n",
      "#by C balance\n",
      "x = (xCO2+xCO)/2 \t\t\t#kmol of ehtylene be burnt\n",
      "#by H2 balance\n",
      "q = 2*x\n",
      "#by O2 balance\n",
      "p = xCO2 + xCO/2 + xO2 + q/2\n",
      "\n",
      "actual_air = p*(32+3.76*28)/(x*28) \t\t\t#kg/kg ethylene\n",
      "excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100\n",
      "print \"Actual air = %.1f kg/kg ethylene \"%(actual_air)\n",
      "print \"Excess air = %.0f%%\"%(excess_air)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Actual air = 17.8 kg/kg ethylene \n",
        "Excess air = 21%\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.9 Page No : 433"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables\n",
      "excess_air = 10. \t\t\t#%\n",
      "tR = 30. \t\t\t#\u00b0C \t\t\t#temperature of reacmath.tant\n",
      "tP = 120. \t\t\t#\u00b0C \t\t\t#temperature of product\n",
      "delta_H = -802.3*1000 \t\t\t#kJ/kmol CH4\n",
      "Cp_CH4 = 36. \t\t\t#kJ/lmolK\n",
      "Cp_O2 = 29.5 \t\t\t#kJ/lmolK\n",
      "Cp_N2 = 29.2 \t\t\t#kJ/lmolK\n",
      "Cp_CO2 = 37. \t\t\t#kJ/lmolK\n",
      "Cp_H2O = 33.7 \t\t\t#kJ/lmolK\n",
      "tA = 30. \t\t\t#\u00b0C\n",
      "tX = 25. \t\t\t#\u00b0C\n",
      "tY = tX \t\t\t#\u00b0C\n",
      "tB = 120. \t\t\t#\u00b0C\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "Q_AB = (1*Cp_CO2 + 0.2*Cp_O2 + 8.272*Cp_N2 + 2*Cp_H2O)*(tB-tX)+ delta_H + (1*Cp_CH4 + 2.2*Cp_O2 +8.272*Cp_N2)*(tY-tA)\n",
      "print \"The heat transfer from the combustor = %.1f kJ/kg CH4 \"%(Q_AB/16)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transfer from the combustor = -48161.7 kJ/kg CH4 \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.10 Page No : 435"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "deltaH_gasgas = -2651.4e3 \t\t\t#kJ/kmol bumath.tane\n",
      "hfg_butane = 370 \t\t\t#kJ/kg \t\t\t#enthalpies of vaporisation of butance\n",
      "hfg_water = 2442 \t\t\t#kJ/kg \t\t\t#enthalpies of vaporisation of water\n",
      "M_butane = 58 \t\t\t#g/mol\n",
      "M_water = 18 \t\t\t#g/mol\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "deltaH_liqliq = deltaH_gasgas + M_butane*hfg_butane - 5*M_water*hfg_water\n",
      "print \"Enthalpy of reaction = %.1f kJ/kg\"%(deltaH_liqliq/M_butane)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Enthalpy of reaction = -49133.1 kJ/kg\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.11 Page No : 437"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "#Formation Enthalpies\n",
      "hf_CO2 = -393510. \t\t\t#kJ/kmol\n",
      "hf_H2O = -285838. \t\t\t#kJ/kmol\n",
      "hf_C3H8 = -104680. \t\t\t#kJ/kmol\n",
      "hf_O2 = 0. \t\t\t#kJ/kmol\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "Hp = 3*hf_CO2 + 4*hf_H2O \n",
      "Hr = hf_C3H8 + 5*hf_O2\n",
      "deltaH_std = Hp-Hr\n",
      "print \"Standard change in enthalpy for the reaction = %.0f kJ/kg\"%(deltaH_std/44)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Standard change in enthalpy for the reaction = -50436 kJ/kg\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.12 Page No : 438"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "Cp_C2H4 = 28*1.548 \t\t\t#kJ/lmolK\n",
      "Cp_O2 = 32*0.922 \t\t\t#kJ/lmolK\n",
      "Cp_N2 = 28*1.042 \t\t\t#kJ/lmolK\n",
      "Cp_CO2 = 44*0.842 \t\t\t#kJ/lmolK\n",
      "Cp_H2O = 18*1.86 \t\t\t#kJ/lmolK\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "deltaH_BX = (2*Cp_CO2 + 2*Cp_H2O + 0.3*Cp_O2 + 12.408*Cp_N2)*(120-25)\n",
      "deltaH_YA = (Cp_C2H4 + 3.3*Cp_O2 + 12.408*Cp_N2)*(25-50)\n",
      "hf_CO2 = -393510. \t\t\t#kJ/kmol\n",
      "hf_H2O = -241820. \t\t\t#kJ/kmol\n",
      "hf_C2H4 = 52283. \t\t\t#kJ/kmol\n",
      "deltaH_XY = 2*hf_CO2 + 2*hf_H2O - hf_C2H4 \t\t\t#kJ/kmol\n",
      "deltaH_BA = deltaH_BX + deltaH_YA + deltaH_XY \t\t\t#kJ/kmol\n",
      "\n",
      "print \"The heat transferred from the combustor per kg ethylene = %.0f kJ/kg ethane\"%(deltaH_BA/28)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transferred from the combustor per kg ethylene = -45960 kJ/kg ethane\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.13 Page No : 441"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Part(a)\n",
      "print \"Parta\"\n",
      "#Picking up various Cp values from Table 12.1\n",
      "tB = (16*50010)/(44*0.842+2*18*1.86+3*32*0.922+22.56*28*1.042)+25\n",
      "print \"Adiabatic combustion temperature using average Cp values)= %.1f K\"%(tB+273)\n",
      "\n",
      "#Part(b)\n",
      "print \"Partb\"\n",
      "tb1 = 1000. \t\t\t#K \t\t\t#first guess temperature\n",
      "tb2 = 1200. \t\t\t#K second guess temperature\n",
      "tb = (tb1 - tb2)/(637617-836847)*(800160-836847) + tb2\n",
      "print \"Adiabatic combustion temperature using ideal gas enthalpy = %.0f K\"%(tb)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parta\n",
        "Adiabatic combustion temperature using average Cp values)= 1238.6 K\n",
        "Partb\n",
        "Adiabatic combustion temperature using ideal gas enthalpy = 1163 K\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.14 Page No : 443"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "delta_H_std = -45101. \t\t\t#kJ/kg\n",
      "hfg = 2442.          \t\t\t#kJ/kg \t\t\t#enthalpy of vaporisation\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "LCV = -1*delta_H_std \t\t\t# kJ/kg hexane\n",
      "print \"LCV of gaseous hexane = %.1f kJ/kg hexane\"%(LCV)\n",
      "\n",
      "m = 7.*18./86 \t\t\t#mass of H2O per kg hexane\n",
      "HCV = LCV+m*hfg \t\t\t#kJ/kg hexane\n",
      "print \"HCV of gaseous hexane = %d kJ/kg hexane\"%(HCV)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "LCV of gaseous hexane = 45101.0 kJ/kg hexane\n",
        "HCV of gaseous hexane = 48678 kJ/kg hexane\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}