{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

# Chapter 7: USING ENTROPY

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.01, page: 149

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "T1 = 100 #degC\n", "\n", "#calculations:\n", "#from Table T-2\n", "vg = 1.673 #m3/kg\n", "vf = 1.0435E-3 #m3/kg\n", "P = 1.014 #bar\n", "#Work done per unit mass\n", "Wm = P*(vg - vf)*100\n", "\n", "#from Table T-2\n", "sg = 7.3549 #kJ/kg-K\n", "sf = 1.3069 #kJ/kg-K\n", "T = T1 + 273.15\n", "#Heat per unit mass\n", "Qm = T*(sg-sf)\n", "\n", "\n", "P=1.014;\n", "vg=1.673;\n", "vf=1.0435/1000;\n", "T=373.15#temperature\n", "sg=7.3549;\n", "sf=1.3069;\n", "k=P*(vg-vf)*10**5/1000;\n", "\n", "#Results\n", "print \"the work and heat transfer per unit mass are\", Wm,\"kJ/kg and\", Qm,\"kJ/kg respectively\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the work and heat transfer per unit mass are 169.5363891 kJ/kg and 2256.8112 kJ/kg respectively\n" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.02, page: 154

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "T1 = 100 #degC\n", "\n", "#calculations:\n", "#from table T-2\n", "ug = 2506.5 #kJ/kg\n", "uf = 418.94 #kJ/kg\n", "#Work per unit mass\n", "Wm = -1*(ug-uf)\n", "\n", "#from table T-2\n", "sg = 7.3549#kJ/kg-K\n", "sf = 1.3069#kJ/kg-K\n", "#entropy per unit mass\n", "Sm = sg - sf\n", "\n", "#Results\n", "print \"the net work per unit mass is\", round(Wm,2),\"kJ/kg and the entropy produced per unit mass is\",round(Sm,3),\"kJ/kg-K\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the net work per unit mass is -2087.56 kJ/kg and the entropy produced per unit mass is 6.048 kJ/kg-K\n" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.03, page: 156

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "T = 10 #degF\n", "P = 120 #lbf/in2\n", "\n", "#calculations:\n", "#from table T-6E\n", "u1 = 94.68 #Btu/lb\n", "u2s = 107.46 #Btu/lb\n", "#minimum work input\n", "Wmmin = u2s - u1\n", "\n", "#Results\n", "print \"the minimum theoretical work input required per unit of mass is\", round(Wmmin,2),\"Btu/lb\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the minimum theoretical work input required per unit of mass is 12.78 Btu/lb\n" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.04, page: 156

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "Tf = 293 #K\n", "h = -0.171;\n", "A = 1;\n", "Tb = 300#temperature\n", "\n", "#calculations:\n", "W1dot = -60.0\n", "Qdot = h*A*(Tb-Tf)\n", "W2dot = Qdot-W1dot\n", "#entropy rate\n", "Sdot1 = -1*Qdot/Tb\n", "\n", "#entropy rate\n", "Sdot2 = -1*Qdot/Tf\n", "\n", "#Results\n", "print \"a) the rate of entropy production for 1st system is\", round(Sdot1,3),\"kW/K\"\n", "print \"b) the rate of entropy production for 2nd system is\", round(Sdot2,4),\"kW/K\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "a) the rate of entropy production for 1st system is 0.004 kW/K\n", "b) the rate of entropy production for 2nd system is 0.0041 kW/K\n" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.05, page: 159

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 30 #bar\n", "T1 = 400 #degC\n", "V1 = 160 #m/s\n", "T2 = 100 #degC\n", "V2 = 100 #m/s\n", "Tb = 350 #K\n", "Wmdot = 540 #kJ/kg\n", "\n", "#calculations:\n", "#from Table T-4\n", "h1 = 3230.9 #kJ/kg\n", "#from Table T-2\n", "h2 = 2676.1 #kJ/kg\n", "#heat tranfer rate\n", "Qmdot = Wmdot + (h2 - h1) + (V2**2 - V1**2)/2000\n", "\n", "#from Table T-4\n", "s1 = 6.9212 #kJ/kg-K\n", "#from Table T-2\n", "s2 = 7.3549 #kJ/kg-K\n", "#Entropy rate\n", "Smdot = Qmdot/Tb + (s2 - s1)\n", "\n", "#Results\n", "print \"heat tranfer rate is\", round(Qmdot,1),\"kJ/kg\"\n", "print \"Entropy rate is\", round(Smdot,4),\"kJ/kg-K\"\n", "#answer wrong in book\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "heat tranfer rate is -22.6 kJ/kg\n", "Entropy rate is 0.3691 kJ/kg-K\n" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.06, page: 160

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "T1 = 70 #degF\n", "P1 = 5.1 #atm\n", "P2 = 1 #atm\n", "T2 = 175 #degF\n", "T3 = 0 #degF\n", "P3 = 1 #atm\n", "R = 1.986/29.87 #Btu/lb-degR\n", "\n", "#calculations:\n", "m1dot = 1\n", "m2dot = 0.4\n", "m3dot = 0.6\n", "\n", "#temps in Rankine\n", "T1r = ((T1-32)*5/9 + 273)*1.8\n", "T2r = ((T2-32)*5/9 + 273)*1.8\n", "T3r = ((T3-32)*5/9 + 273)*1.8\n", "#assumptions\n", "Wdot = 0\n", "Qdot = 0\n", "Cp = 0.24 #Btu/lb-degR\n", "#\n", "h1 = Cp*T1r\n", "h2 = Cp*T2r\n", "h3 = Cp*T3r\n", "#Sa = s2 - s1 and Sb = s3 - s1\n", "Sa = Cp*math.log(T2r/T1r) - R*math.log(P2/P1)\n", "Sb = Cp*math.log(T3r/T1r) - R*math.log(P3/P1)\n", "#\n", "a = m2dot*Cp*(T1 - T2) + m3dot*Cp*(T1 - T3)\n", "#Specific Enthalpy\n", "Sm1dot = m2dot*Sa + m3dot*Sb\n", "\n", "#Results\n", "if (a == 0):\n", " print \"a)with the given data the conservation of mass and energy principles are satisfied.\"\n", "else:\n", " print \"a)with the given data the conservation of mass and energy principles are not satisfied.\"\n", "print \"b)changes in specific entropy are\", round(Sm1dot,4),\" Btu/lb-degR, thus second law of thermodynamics is also conserved\" \n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "a)with the given data the conservation of mass and energy principles are satisfied.\n", "b)changes in specific entropy are 0.1053 Btu/lb-degR, thus second law of thermodynamics is also conserved\n" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.07, page: 162

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "T1 = -5 #degC\n", "P1 = 3.5 #bar\n", "T2 = 75 #degC\n", "P2 = 14 #bar\n", "P3 = 14 #Bar\n", "T3 = 28 #degC\n", "P4 = 3.5 #bar\n", "T5 = 20 #degC\n", "P5 = 1 #bar\n", "AV5 = 0.42 #m3/s\n", "T6 = 50 #degC\n", "P6 = 1 #bar\n", "R = 8.314/28.97 #kJ/kg-K\n", "\n", "#calculations:\n", "Cp = 1.005 #kJ/kg-K\n", "#from Table T-14,\n", "s1 = 0.9572 #kJ/kg-K\n", "s2 = 0.98225 #kJ/kg-K\n", "h2 = 294.17 #kJ/kg\n", "#from Table T-12\n", "s3 = 0.2936 #kJ/kg-K\n", "h3 = 79.05 #kJ/kg\n", "#From Table T-14\n", "h4 = h3\n", "hf4 = 33.09 #kJ/kg\n", "hfg4 = 212.91 #kJ/kg\n", "sf4 = 0.1328 #kJ/kg-K\n", "sg4 = 0.9431 #kJ/kg-K\n", "#Quality at 4\n", "x4 = (h4 - hf4)/hfg4\n", "#Specific Entropy at 4\n", "s4 = sf4 + x4*(sg4 - sf4)\n", "\n", "#mass flow rate of air\n", "mairdot = AV5*P5*100/(R*(T5 + 273))\n", "#ref mass rate\n", "mrefdot = mairdot*Cp*(T6 - T5)/(h2 - h3)\n", "#change in specific entropy\n", "s6_s5 = Cp*math.log((T6 + 273)/(T5 + 273)) - R*math.log(P6/P5)\n", "#entropy balance for condensor\n", "Sdotcond = mrefdot*(s3 - s2) + mairdot*s6_s5\n", "#entropy balance for Compressor\n", "Sdotcomp = mrefdot*(s2-s1)\n", "#entropy balance for valve\n", "Sdotvalve = mrefdot*(s4-s3)\n", "\n", "\n", "#Results\n", "print \"the entropy production rates for control volumes enclosing the condenser is\", round(Sdotcond,6),\"kW/K\"\n", "print \"the entropy production rates for control volumes enclosing the compressor is\", round(Sdotcomp,6),\"kW/K\"\n", "print \"the entropy production rates for control volumes enclosing the valve is\", round(Sdotvalve,6),\"kW/K\"\n", "#answer wrong in book\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the entropy production rates for control volumes enclosing the condenser is 0.000724 kW/K\n", "the entropy production rates for control volumes enclosing the compressor is 0.001754 kW/K\n", "the entropy production rates for control volumes enclosing the valve is 0.000988 kW/K\n" ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.08, page: 165

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 1 #atm\n", "T1 = 540 #degR\n", "T2 = 1160 #degR\n", "Tm = 850 #degR\n", "\n", "#calculations:\n", "#from table T-9E, Pr values are\n", "Pr2 = 21.18\n", "Pr1 = 1.3860\n", "P2a = P1*Pr2/Pr1\n", "\n", "#from table T-10E\n", "k = 1.39\n", "P2b = P1*(T2/T1)**(k/(k-1))\n", "\n", "#Results\n", "print \"a) Final Pressure using Pr data is\", round(P2a,2),\"atm\"\n", "print \"b) Final Pressure using a constant value for the specific heat ratio k is\", round(P2b,2),\"atm\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "a) Final Pressure using Pr data is 15.28 atm\n", "b) Final Pressure using a constant value for the specific heat ratio k is 15.26 atm\n" ] } ], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.09, page: 169

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "#Initialization of Variable\n", "P1 = 5 #bar\n", "T1 = 320 #degC\n", "P2 = 1 #bar\n", "nt = 0.75 #isentropic efficiency\n", "\n", "#calculations:\n", "#from table T-4\n", "h1 = 3105.6 #kJ/kg\n", "s1 = 7.5308 #kJ/kg-K\n", "s2s = s1\n", "h2s = 2743.0 #kJ/kg\n", "# work developed perunit mass\n", "Wmdot = nt*(h1-h2s)\n", "\n", "#Results\n", "print \"work developed per unit mass of steam flowing through the turbine is\", round(Wmdot,2),\"kJ/kg\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "work developed per unit mass of steam flowing through the turbine is 271.95 kJ/kg\n" ] } ], "prompt_number": 12 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.10, page: 170

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 3 #bar\n", "T1 = 390 #K\n", "P2 = 1 #bar\n", "Wmdot = 74 #kJ/kg\n", "\n", "#calculations:\n", "#from table T-9\n", "h1 = 390.88 #kJ/kg\n", "Pr1 = 3.481\n", "PrT2s = P2*Pr1/P1\n", "\n", "h2s = 285.27 #kJ/kg\n", "Wmdots = h1 - h2s\n", "#efficiency\n", "nt = Wmdot/Wmdots\n", "\n", "#Results\n", "print \"the turbine efficiency is\", round(nt*100,0),\"%\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the turbine efficiency is 70.0 %\n" ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.11, page: 171

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 140 #lbf/in2\n", "T1 = 600 #degF\n", "V1 = 100 #ft/s\n", "P2 = 40 #lbf/in2\n", "T2 = 350 #degF\n", "\n", "#calculations:\n", "#assumption\n", "Wdot = 0\n", "#from Table T-4E\n", "h1 = 1326.4 #Btu/lb\n", "s1 = 1.7191 #Btu/lb-degR\n", "h2 = 1211.8 #Btu/lb\n", "\n", "#actual specific kinetic energy at the exit\n", "#KE = (V2**2)/2\n", "KE = h1 - h2 + (V1**2)/(2*32.2*778)\n", "\n", "#from Table T-4E\n", "S2s = s1\n", "h2s = 1202.3 #Btu/lb-degR\n", "#specific kinetic energy at the exit for an isentropic expansion\n", "#KEs = ((V2**2)/2)s\n", "KEs = h1 - h2s + (V1**2)/(2*32.2*778)\n", "\n", "#efficiency\n", "n_nozzle = KE/KEs\n", "\n", "#Results\n", "print \"the nozzle efficiency\",round(n_nozzle*100,1),\"%\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the nozzle efficiency 92.4 %\n" ] } ], "prompt_number": 14 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.12, page: 171

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 3.5 #bar\n", "T1 = -5 #degC\n", "P2 = 14 #bar\n", "T2 = 75 #degC\n", "mdot = 0.07 #kg/s\n", "\n", "#calculations:\n", "#from Table T-14\n", "h1 = 249.75 #kJ/kg\n", "h2 = 294.17 #kJ/kg\n", "s1 = 0.9572 #kJ/kg-K\n", "s2s = s1\n", "h2s = 285.58 #kJ/kg\n", "\n", "#the compressor power\n", "Wdot = mdot*(h1-h2)\n", "\n", "#isentropic compressor efficiency\n", "nc = (h2s - h1)/(h2 - h1)\n", "\n", "#Results\n", "print \"the compressor power is\", round(Wdot,2),\"kW and isentropic efficiency is\",round(nc*100,0),\"%\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the compressor power is -3.11 kW and isentropic efficiency is 81.0 %\n" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

## Example 7.13, page: 174

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "# Initialization of Variable\n", "P1 = 1 #bar\n", "T1 = 20 #degC\n", "P2 = 5 #bar\n", "n = 1.3\n", "R = 8.314/28.97 #kJ/kg-K\n", "\n", "#calculations:\n", "T2 = (T1+273)*(P2/P1)**((n-1)/n) - 273\n", "#Work per unit mass\n", "Wmdot = -1*(n*R/(n-1))*(T2-T1)\n", "\n", "#from Table T-9\n", "h1 = 293.17 #kJ/kg\n", "h2 = 426.35 #kJ/kg\n", "#heat transfer per unit of mass\n", "Qmdot = Wmdot + h2 - h1\n", "\n", "#Results\n", "print \"Work Per unit mass is\", round(Wmdot,1),\"kJ/kg and heat transfer per unit of mass is\", round(Qmdot,0),\"kJ/kg\"\n", "#Answer wrong in book\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Work Per unit mass is -163.9 kJ/kg and heat transfer per unit of mass is -31.0 kJ/kg\n" ] } ], "prompt_number": 16 } ], "metadata": {} } ] }