summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_C_P_Arora/Chapter10.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_by_C_P_Arora/Chapter10.ipynb')
-rwxr-xr-xThermodynamics_by_C_P_Arora/Chapter10.ipynb763
1 files changed, 763 insertions, 0 deletions
diff --git a/Thermodynamics_by_C_P_Arora/Chapter10.ipynb b/Thermodynamics_by_C_P_Arora/Chapter10.ipynb
new file mode 100755
index 00000000..fbcc64f3
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/Chapter10.ipynb
@@ -0,0 +1,763 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:897b863d1c4a7fc08bdd18a7c97541fdce377415c35a75aa9b7ef0eec5c061e1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10:AVAILABILITY AND IRREVERSIBILITY"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page No:472"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=100; # Mass of water in kg\n",
+ "T0=90; # Initial temperature of water in degree celcius\n",
+ "T=30; # temperature of Surroundings in degree celcius\n",
+ "C=4.1868; # Specific heat in kJ/kg K\n",
+ "\n",
+ "#Calculation\n",
+ "AE=m*C*((T0-T)-(T+273)*math.log ((T0+273)/(T+273))); # Available energy\n",
+ "Q=m*C*(T0-T); # Heat supplied\n",
+ "UE=Q-AE; # Unavailable energy\n",
+ "\n",
+ "#Result\n",
+ "print \"Available energy =\",round(AE,0),\"kJ\"\n",
+ "print \"Heat supplied = \",round(Q,0),\"kJ\",\"\\nUnavailable energy = \",round(UE,0),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Available energy = 2201.0 kJ\n",
+ "Heat supplied = 25121.0 kJ \n",
+ "Unavailable energy = 22920.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page No:474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=250; # Evaporation teemperature of water in degree celcius\n",
+ "Ta=1250; # Initial temperature of combustion gas in degree celcius\n",
+ "Tb=350; # Final temperature of combustion gas in degree celcius\n",
+ "C=1.08; # Specific heat of gas in kJ/kg K\n",
+ "T0=30; # temperature of Surroundings in degree celcius\n",
+ "hfg=1716.2; # Enthalpy of evaporation at T temperature\n",
+ "\n",
+ "#Calculation\n",
+ "del_SH2O=hfg/(T+273); # Entropy change of water\n",
+ "mgas=hfg/(C*(Ta-Tb)); # Mass of gas\n",
+ "del_Sgas=mgas*C*math.log ((Tb+273)/(Ta+273)); # Enthalpy change of gas\n",
+ "del_Stotal=del_SH2O+del_Sgas; # Total entropy change\n",
+ "l_AE=(T0+273)*del_Stotal; # Loss of available energy\n",
+ "\n",
+ "#Result\n",
+ "print \"Loss of available energy = \",round(l_AE,1),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss of available energy = 477.8 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page No:475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Cp=1.1; # Specific heat of combustion gas in kJ/kg K\n",
+ "T3=1600; # Initial temperature of combustion gas in Kelvin\n",
+ "T4=1150; # Final temperature of combustion gas in Kelvin\n",
+ "p1=0.1; # Pressure at inlet of boiler in MPa\n",
+ "p2=8;# Pressure at outlet of boiler in MPa\n",
+ "T2=600; # Temperature at outlet of boiler in degree celcius\n",
+ "m=1; # Mass of water in kg\n",
+ "T0=298; # temperature of Surroundings in kelvin\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).mass flow rate of gases per kg of water\n",
+ "# From steam table \n",
+ "h1=2758; h2=3642;# specific enthalpy in kJ/kg \n",
+ "s1=5.7432; s2=7.0206; # specific entropy in kJ/kg K\n",
+ "mgas=(h2-h1)/(Cp*(T3-T4)); #mass flow rate of gases per kg of water\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"(b).mass flow rate of gases per kg of water =\",round(mgas,3),\"kg gas / kg water\"\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c). Degrease in Available energy\n",
+ "S21=s2-s1; # Change in entropy of water\n",
+ "S34=mgas*Cp*math.log (T3/T4); # Change in entropy of gases\n",
+ "UEgases=T0*S34; # UnAvailable energy of gas\n",
+ "UEsteam=T0*S21; # UnAvailable energy of steam\n",
+ "d_AE=UEsteam-UEgases; # Degrease in Available energy\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"\\n(c).\",\"\\nChange in entropy of water = \",round(S21,4),\"kJ/K\",\"\\nChange in entropy of gas = \",round(-S34,4),\"kJ/K\"\n",
+ "print \"Unavailable energy of gas = \",round(UEgases,1),\"kJ\",\"\\nUnavailable energy of steam =\",round(UEsteam,1),\"kJ\"\n",
+ "print \"Degrease in Available energy = \",round(d_AE,1),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b).mass flow rate of gases per kg of water = 1.786 kg gas / kg water\n",
+ "\n",
+ "(c). \n",
+ "Change in entropy of water = 1.2774 kJ/K \n",
+ "Change in entropy of gas = -0.6487 kJ/K\n",
+ "Unavailable energy of gas = 193.3 kJ \n",
+ "Unavailable energy of steam = 380.7 kJ\n",
+ "Degrease in Available energy = 187.3 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5, Page No:481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=700;# Exhaust gas temperature in degree celcius\n",
+ "p=120;# Exhaust gas pressure in kPa\n",
+ "Cpo=1.089; # Specific heat at constant pressure in kJ/kg K\n",
+ "R=0.287; # characteristic gas constant in kJ/kg K\n",
+ "p0=100; # Pressure of Surroundings in kPa\n",
+ "T0=30; # temperature of Surroundings in degree celcius\n",
+ "\n",
+ "#Calculation\n",
+ "Cvo=Cpo-R; # Specific heat at constant volume\n",
+ "AE=(Cvo*(T-T0))+(p0*R*((T+273)/p-(T0+273)/p0))-((T0+273)*((Cpo*math.log((T+273)/(T0+273)))-(R*math.log (p/p0)))); # Available energy\n",
+ "\n",
+ "#Result \n",
+ "print \"Available energy in Exhaust gas =\",round(AE,0),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Available energy in Exhaust gas = 314.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6, Page No:482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=450; # Initial pressure in kPa\n",
+ "T=600; # Initial temperature in kelvin\n",
+ "V1=0.01; # Initial volume in m^3\n",
+ "TR=1200; # Temperature of heat source in Kelvin\n",
+ "V2=0.02; # Final volume in m^3\n",
+ "p0=100; # Pressure of Surroundings in kPa\n",
+ "T0=300; # temperature of Surroundings in kelvin\n",
+ "\n",
+ "#Calculation\n",
+ "# Useful Work\n",
+ "W=p1*V1*math.log (V2/V1); # Actual work\n",
+ "Wsurr=p0*(V2-V1); # Surrounding work\n",
+ "Wu=W-Wsurr; # Useful work\n",
+ "# Reversible work\n",
+ "Q=W; # For isothermal process\n",
+ "S21=Q/T; # Entropy change of system\n",
+ "Wrev=T0*S21-Wsurr+Q*(1-T0/TR); # reversible work\n",
+ "# Irreversibility of the process\n",
+ "I=Wrev-Wu; # Irreversibility\n",
+ "# Entropy generation \n",
+ "del_Sgen=S21-Q/TR;#Entropy generation\n",
+ "\n",
+ "#Results\n",
+ "print \"Useful Work for the process =\",round(Wu,2),\"kJ\"\n",
+ "print \"Reversible work for the provess =\",round(Wrev,1),\"kJ\"\n",
+ "print \"Irreversibility of the process = \",round(I,2),\"kJ\"\n",
+ "print \"Entropy generation of the process = \",round(del_Sgen,4),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful Work for the process = 2.12 kJ\n",
+ "Reversible work for the provess = 2.9 kJ\n",
+ "Irreversibility of the process = 0.78 kJ\n",
+ "Entropy generation of the process = 0.0026 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7, Page No:485"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration for (i)\n",
+ "# (i).Irreversibility in Turbine\n",
+ "p1=9; # Steam pressure at turbine inlet in MPa\n",
+ "T1=450; # Steam temperature at turbine inlet in degree celcius\n",
+ "p2=50; # Steam pressure at turbine outlet in MPa\n",
+ "x2=0.95; # Quality of steam \n",
+ "p0=100; # Pressure of Surroundings in kPa\n",
+ "T0=300; # temperature of Surroundings in kelvin\n",
+ "q=-10; # Heat loss in kJ/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "# (a).Decrease in availability\n",
+ "# from steam table\n",
+ "h1=3256.6; h2=2415.4;# specific enthalpy in kJ/kg \n",
+ "s1=6.4844; s2=6.944; # specific entropy in kJ/kg K\n",
+ "d_AE=(h1-h2)-(T0*(s1-s2)); # Decrease in availability\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(i).Irreversibility in turbine\",\"\\n (a).Decrease in availability =\",round(d_AE,1),\"kJ/kg\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Maxximum work output\n",
+ "wrev=d_AE; #Maxximum work output\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \" (b).Maxximum work output =\",round(wrev,1),\"kJ/kg\"\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c).Actual work output \n",
+ "w=(h1-h2)+q; # From SSSF energy equation\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \" (c).Actual work output = \",round(w,1),\"kJ/kg\"\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "# (d).Irreversibility\n",
+ "I=wrev-w; #Irreversibility\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \" (d).Irreversibility = \",round(I,1),\"kJ/kg\"\n",
+ "\n",
+ "#Variable declaration for (ii)\n",
+ "# (ii).Ammonia compressor\n",
+ "T1=-10; # Temperature at inlet in degree celcius\n",
+ "p2=1.554; # Pressure at outlet in MPa\n",
+ "T2=140; # Temperature at outlet in degree celcius\n",
+ "T0=298; # temperature of Surroundings in kelvin\n",
+ "#from ammonia tables \n",
+ "h1=1433; h2=1752;# specific enthalpy in kJ/kg \n",
+ "s1=5.477; s2=5.655; # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation for (ii)\n",
+ "wactual=-(h2-h1); # Actual work\n",
+ "wmin=-((h2-h1)-(T0*(s2-s1)));# mimimum work\n",
+ "I=wmin-wactual;# Irreversibility\n",
+ "\n",
+ "#Result for (ii)\n",
+ "print \"\\n(ii).Ammonia compressor\",\"\\nActual work = \",wactual,\"kJ/kg\"\n",
+ "print \"Minimum work =\",round(wmin,0),\"kJ/kg\",\"\\nIrreversibility =\",round(I,0),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i).Irreversibility in turbine \n",
+ " (a).Decrease in availability = 979.1 kJ/kg\n",
+ " (b).Maxximum work output = 979.1 kJ/kg\n",
+ " (c).Actual work output = 831.2 kJ/kg\n",
+ " (d).Irreversibility = 147.9 kJ/kg\n",
+ "\n",
+ "(ii).Ammonia compressor \n",
+ "Actual work = -319 kJ/kg\n",
+ "Minimum work = -266.0 kJ/kg \n",
+ "Irreversibility = 53.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.8, Page No:487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Cp=1.1; # Specific heat of combustion gas in kJ/kg K\n",
+ "T3=1600; # Initial temperature of combustion gas in Kelvin\n",
+ "T4=1150; # Final temperature of combustion gas in Kelvin\n",
+ "p1=0.1; # Pressure at inlet of boiler in MPa\n",
+ "p2=8;# Pressure at outlet of boiler in MPa\n",
+ "T2=600; # Temperature at outlet of boiler in degree celcius\n",
+ "m=1; # Mass of water in kg\n",
+ "T0=298; # temperature of Surroundings in kelvin\n",
+ "# From steam table \n",
+ "h1=2758; h2=3642;# specific enthalpy in kJ/kg \n",
+ "s1=5.7432; s2=7.0206; # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation \n",
+ "mgas=(h2-h1)/(Cp*(T3-T4)); #mass flow rate of gases per kg of water\n",
+ "S21=s2-s1; # Change in entropy of water\n",
+ "S34=mgas*Cp*math.log (T3/T4); # Change in entropy of gases\n",
+ "# (a).Decrease in availability of gases\n",
+ "d_AEgas=mgas*Cp*(T3-T4)-T0*S34#Decrease in availability of gases\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Decrease in availability of gases = \",round(d_AEgas,2),\"kJ\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Decrease in availability of water\n",
+ "d_AEwater=(h1-h2)-T0*(s1-s2);# Decrease in availability of water\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"(b).Decrease in availability of water =\",round(d_AEwater,1),\"kJ\"\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c).Reversible work for the process\n",
+ "Wrev=d_AEgas+d_AEwater; #Reversible work for the process\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"(c).Reversible work for the process=\",round(Wrev,1),\"kJ\"\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "# (d).Actual work for the process\n",
+ "W=0; # Actual work\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \"(d).Actual work for the process =\",W,\"kJ\"\n",
+ "\n",
+ "#Calculation for (e)\n",
+ "# (e).Irreversibility\n",
+ "I=Wrev-W; #Irreversibility\n",
+ "\n",
+ "#Result for (e)\n",
+ "print \"(e).Irreversibility = \",round(I,1),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Decrease in availability of gases = 690.68 kJ\n",
+ "(b).Decrease in availability of water = -503.3 kJ\n",
+ "(c).Reversible work for the process= 187.3 kJ\n",
+ "(d).Actual work for the process = 0 kJ\n",
+ "(e).Irreversibility = 187.3 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.9, Page No:487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "TH=600; # Temperature of heat sorce in degree celcius\n",
+ "T3=311.06; # Boiler temperature in degree celcius\n",
+ "p3=10; # Boiler pressure in MPa\n",
+ "T4=32.88; # Condensor temperature in degree celcius\n",
+ "p4=5; # Condensor pressure in kPa\n",
+ "T0=288;# Temperature of surroundings in kelvin\n",
+ "# From steam table and refer figure 10.10 for states\n",
+ "h1=137.82; h2=147.82; h3=2724.7; hf4=197.82; hfg4=2423.7; h4=1913.6; # specific enthalpy in kJ/kg \n",
+ "s1=0.4764; s2=s1; s3=5.6141; s4=s3; sf4=0.4764; sfg4=7.9187; s4=6.2782; # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation\n",
+ "wT=h3-h4; # Turbine work\n",
+ "wp=h2-h1; # Pump work\n",
+ "wnet=wT-wp; # Net work\n",
+ "qH=h3-h2; # Heat supplied in boiler\n",
+ "qL=h4-h1; # Heat rejected in condensor\n",
+ "Wrev_Wpump=T0*(s2-s1); \n",
+ "Wrev_Wboiler=T0*(s3-s2)-T0*qH/(TH+273);\n",
+ "Wrev_Wturbine=T0*(s4-s3);\n",
+ "Wrev_Wcondenser=T0*(s1-s4)+qL;\n",
+ "Wrev_Wcycle=Wrev_Wpump+Wrev_Wboiler+Wrev_Wturbine+Wrev_Wcondenser; \n",
+ "\n",
+ "#Result\n",
+ "print \"The lost (Wrev-W)for the Pump = \",Wrev_Wpump,\"kJ/kg\",\"\\nThe lost (Wrev-W)for the Boiler = \",round(Wrev_Wboiler,1),\"kJ/kg\"\n",
+ "print \"The lost (Wrev-W)for the Turbine = \",round(Wrev_Wturbine,1),\"kJ/kg\"\n",
+ "print \"The lost (Wrev-W)for the condensor = \",round(Wrev_Wcondenser,1),\"kJ/kg\"\n",
+ "print \"The lost (Wrev-W)for the overall cycle = \",round(Wrev_Wcycle,0),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lost (Wrev-W)for the Pump = 0.0 kJ/kg \n",
+ "The lost (Wrev-W)for the Boiler = 629.6 kJ/kg\n",
+ "The lost (Wrev-W)for the Turbine = 191.3 kJ/kg\n",
+ "The lost (Wrev-W)for the condensor = 104.9 kJ/kg\n",
+ "The lost (Wrev-W)for the overall cycle = 926.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.10, Page No:491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "# State after reversible adiabatic expansion\n",
+ "p2=50; # pressure in kPa\n",
+ "s2s=6.4844; s1=6.4844; s2=6.944; # specific entropy in kJ/kg K\n",
+ "x2s=0.829; # Quality of steam \n",
+ "h2s=2252.6; h1=3256.6; # specific enthalpy in kJ/kg \n",
+ "T2=81.33; T0=27; # Temperature in degree celcius\n",
+ "\n",
+ "#Calculation\n",
+ "ws=h1-h2s; # Reversible adiabatic work\n",
+ "wa=831.2; # Actual work output in kJ/kg\n",
+ "d_AE=979.1; # Decrease in availability in kJ/LG\n",
+ "eff_I=wa/ws; # First law efficiency of turbine\n",
+ "eff_II=wa/d_AE; # Second law efficiency of turbine\n",
+ "w2srev2=(T2-T0)*(s2-s1); # Negative work\n",
+ "w1rev2=ws-w2srev2; # Decrease in availability\n",
+ "\n",
+ "#Result\n",
+ "print \"First law efficiency of turbine = \",round(eff_I*100,1),\"%\",\"\\nSecond law efficiency of turbine = \",round(eff_II*100,1),\"%\"\n",
+ "print \"Negative work = \",round(w2srev2,2),\"kJ/kg\",\"\\nDcresase in Availability = \",round(w1rev2,2),\"kJ/kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "First law efficiency of turbine = 82.8 % \n",
+ "Second law efficiency of turbine = 84.9 %\n",
+ "Negative work = 24.97 kJ/kg \n",
+ "Dcresase in Availability = 979.03 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.11, Page No:493"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=100; # Pressure at inlet in kPa\n",
+ "T1=30; # Temperature at inlet in degree celcius\n",
+ "V1=0; # Velocity at inlet in m/s\n",
+ "p2=350; # Pressure at outlet in kPa\n",
+ "T2=141; # Temperature at exit in degree celcius\n",
+ "V2=90; # Velocity at exit in m/s\n",
+ "p0=100; # Pressure of Surroundings in kPa\n",
+ "T0=30; # temperature of Surroundings in degree celcius\n",
+ "k=1.4; # Index of the Isentropic compression process\n",
+ "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
+ "R=0.287; # characteristic gas constant of air in kJ/kg K\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "# (a).Adiabatic or polytropic compression\n",
+ "T2s=(T1+273)*(p2/p1)**((k-1)/k); # Temperature after isentropic compression\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Adiabatic or polytropic compression\",\"\\nTemperature after isentropic compression =\",round(T2s,1),\"K\"\n",
+ "print \"T2s>T2. Hence there is cooling . Compression is polytropic.\" \n",
+ " \n",
+ "#Calculation for (b)\n",
+ "# (b).The first law efficiency of the compressor\n",
+ "wa=Cpo*(T1-T2)-V2**2/2000; #Actual work of compression\n",
+ "wT=(-R*(T1+273)*math.log (p2/p1))-(V2**2/2000); # Isothermal work\n",
+ "eff_Ilaw=wT/wa; # The first law efficiency of the compressor\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).The first law efficiency of the compressor = \",round(eff_Ilaw*100,1),\"%\"\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c).Minimum work input & Irreversibility\n",
+ "d_AE=(Cpo*(T1-T2))+((T0+273)*((R*math.log (p2/p1))-(Cpo*math.log ((T2+273)/(T1+273)))))-V2**2/2000; # decrease in availability\n",
+ "wmin=d_AE; # Minimum work input\n",
+ "wrev=wmin;\n",
+ "I=wrev-wa; # Irreversibility\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"\\n(c).Minimum work input & Irreversibility\",\"\\nMinimum work input =\",round(wmin,1),\"kJ/kg\"\n",
+ "print \"Irreversibility =\",round(I,0),\"kJ/kg\"\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "# (d).Second law efficiency of the compressor\n",
+ "eff_IIlaw=wmin/wa; # Second law efficiency of the compressor\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \"\\n(d).Second law efficiency of the compressor =\",round(eff_IIlaw*100,0),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Adiabatic or polytropic compression \n",
+ "Temperature after isentropic compression = 433.4 K\n",
+ "T2s>T2. Hence there is cooling . Compression is polytropic.\n",
+ "\n",
+ "(b).The first law efficiency of the compressor = 97.9 %\n",
+ "\n",
+ "(c).Minimum work input & Irreversibility \n",
+ "Minimum work input = -101.4 kJ/kg\n",
+ "Irreversibility = 14.0 kJ/kg\n",
+ "\n",
+ "(d).Second law efficiency of the compressor = 88.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.12, Page No:498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T0=313; # Surroundings temperature in kelvin\n",
+ "TL=233; # Refrigerated space temperature in kelvin\n",
+ "QL=3.5167; # Refrigeration load in kW\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "# (a).Carnot cycle\n",
+ "COPcarnot=TL/(T0-TL); # COP of carnot cycle\n",
+ "Wcarnot=QL/COPcarnot; # Work done\n",
+ "Q0=QL+Wcarnot; # Heat rejected\n",
+ "d_SL=-QL/TL;# Entropy change of refrigerated space\n",
+ "d_S0=Q0/T0; #Entropy change of surroundings\n",
+ "d_Sgen= d_SL+ d_S0; # Entropy generation\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Carnot cycle\",\"\\nWork done = \",round(Wcarnot,4),\"kW\",\"\\nCOP of carnot cycle = \",round(COPcarnot,4)\n",
+ "print (\" Entropy generation = %d kJ/K s \")%d_Sgen\n",
+ "\n",
+ "#Variable declaration for (b)\n",
+ "# (b).Vapour compression cycle\n",
+ "# From Freon-12 property table & figure 10.17\n",
+ "p1=0.0642; p2=0.9607; # Pressure in MPa\n",
+ "h1=169.5; h3=74.5; # specific enthalpy in kJ/kg \n",
+ "s1=0.7269; s3=0.2716;# specific entropy in kJ/kg K\n",
+ "# By calculations s2=s1 gives the following from property table\n",
+ "t2=58.9; # Temperature in degree celcius\n",
+ "h2=217.6; # specific enthalpy in kJ/kg \n",
+ "# From h4=h3 gives the following from chart\n",
+ "h4=h3;\n",
+ "x4=0.44; # Quality of vapour\n",
+ "s4=0.3195;# specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "m=QL/(h1-h4); # Mass flow rate of refrigerant\n",
+ "W=m*(h2-h1); # Work done of vapour compression cycle\n",
+ "COP=QL/W; # COP of vapour compression cycle\n",
+ "QH=QL+W; # Heat rejected to surroundings\n",
+ "d_SL=-QL/TL;# Entropy change of refrigerated space\n",
+ "d_S0=QH/T0; #Entropy change of surroundings\n",
+ "d_Sgen= d_SL+ d_S0; # Entropy generation\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Vapour compression cycle\",\"Work done = \",round(W,3),\"kW\",\"\\nCOP of vapour compression cycle = \",round(COP,2)\n",
+ "print (\" Entropy generation = %f kJ/K s \")%round(d_Sgen,5)\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c).Difference in work = Lost work of the cycle\n",
+ "d_work=W-Wcarnot; # Difference in work\n",
+ "LWcycle=QH-T0*QL/TL; # Lost work of the cycle\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"\\n(c).Difference in work = Lost work of the cycle\",\"\\nDifference in work = \",round(d_work,4),\"kW\"\n",
+ "print \"Lost work of the cycle= \",round(LWcycle,4),\"kW\",\"which is same as Difference in work\"\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "# (d).Second Law efficiency of the vapour compression cycle\n",
+ "eff_II=COP/COPcarnot; #Second Law efficiency\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \"\\n(d).Second Law efficiency of the vapour compression cycle = \",round(eff_II*100,1),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Carnot cycle \n",
+ "Work done = 1.2075 kW \n",
+ "COP of carnot cycle = 2.9125\n",
+ " Entropy generation = 0 kJ/K s \n",
+ "\n",
+ "(b).Vapour compression cycle Work done = 1.781 kW \n",
+ "COP of vapour compression cycle = 1.98\n",
+ " Entropy generation = 0.001830 kJ/K s \n",
+ "\n",
+ "(c).Difference in work = Lost work of the cycle \n",
+ "Difference in work = 0.5731 kW\n",
+ "Lost work of the cycle= 0.5731 kW which is same as Difference in work\n",
+ "\n",
+ "(d).Second Law efficiency of the vapour compression cycle = 67.8 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file