summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_C_P_Arora/Chapter7.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_by_C_P_Arora/Chapter7.ipynb')
-rwxr-xr-xThermodynamics_by_C_P_Arora/Chapter7.ipynb932
1 files changed, 932 insertions, 0 deletions
diff --git a/Thermodynamics_by_C_P_Arora/Chapter7.ipynb b/Thermodynamics_by_C_P_Arora/Chapter7.ipynb
new file mode 100755
index 00000000..a9e9200a
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/Chapter7.ipynb
@@ -0,0 +1,932 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0bbd88c617eea37997c2d1895d18307cb6167940684ace795d89722f10167f53"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7:COMBINED FIRST AND SECOND LAWS APPLICATION TO PROCESSES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page No:316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=1; # Initial pressure of fluid in MPa\n",
+ "T1=250; # Initial temperture of fluid in degree celcius\n",
+ "V=0.28; # Volume of container in m^3\n",
+ "p2=0.35; # Initial pressure of the fluid in MPa\n",
+ "# (a).Water\n",
+ "v1=0.2327; # specific volume of vapour from steam table at state 1 in m^3/kg\n",
+ "v2=v1; # constant volume process\n",
+ "vf2=0.001079; vfg2=0.5232; # specific volume of vapour from steam table at state 2 in m^3/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "m=V/v1; # mass of steam\n",
+ "x2=(v2-vf2)/vfg2; # quality of steam at state 2\n",
+ "t2=138.88; # Final temperature of fluid in degree celcius (saturation temperature at p2)\n",
+ "# following are the values taken from steam tables\n",
+ "u1=2709.9; # specific internal energy at state 1 in kJ/kg\n",
+ "s1=6.9247; # Specific entropy at state 1 in kJ/kg K\n",
+ "uf2=582.95; ug2=2548.9; # specific internal energy at state 2 in kJ/kg\n",
+ "sf2=1.7245; sg2=6.9405; # Specific entropy at state 2 in kJ/kg K\n",
+ "u2=(1-x2)*uf2+x2*ug2; # specific internal energy at state 2 \n",
+ "s2=(1-x2)*sf2+x2*sg2; # specific enropy at state 2 \n",
+ "Q=m*(u2-u1); # Heat transferred\n",
+ "S21=m*(s2-s1); # Entropy change\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Water\",\"Final Temperature = \",t2,\"oC\",\"\\nHeat transferred = \",round(Q,3),\"kJ (answer mentioned in the textbook is wrong)\"\n",
+ "print \"Entropy change = \",round(S21,3),\"kJ/kg K (round off error)\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\n",
+ "Cvo=0.7165; # Specific heat at constant volume in kJ/kg K\n",
+ "R=0.287; # characteristic gas constant of air in kJ/kg K\n",
+ "m=(p1*10**3*V)/(R*(T1+273)); # Mass of air\n",
+ "T2=(p2/p1)*(273+T1); # Final temperature of air\n",
+ "Q=m*Cvo*(T2-(T1+273)); # Heat transferred\n",
+ "S21=m*Cvo*math.log (T2/(273+T1)); # Change in entropy\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Air\",\"Final Temperature = \",round(T2,0),\"oC\",\"\\nHeat transferred = \",round(Q,0),\"kJ (roundoff error)\"\n",
+ "print \"Entropy change = \",round(S21,3),\"kJ/kg K (round off error)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Water Final Temperature = 138.88 oC \n",
+ "Heat transferred = -1512.051 kJ (answer mentioned in the textbook is wrong)\n",
+ "Entropy change = -3.479 kJ/kg K (round off error)\n",
+ "\n",
+ "(b).Air Final Temperature = 183.0 oC \n",
+ "Heat transferred = -454.0 kJ (roundoff error)\n",
+ "Entropy change = -1.403 kJ/kg K (round off error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page No:319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=1.0021; # Initial pressure of the fluid in MPa\n",
+ "T1=180; # Initial temperature of the fluid in degree celcius\n",
+ "m=0.5; # Mass of the fluid in kg\n",
+ "p2=p1; # Constant pressure process\n",
+ "# (a).Steam\n",
+ "x1=0.8; # Quality of the steam at state 1\n",
+ "# Following are the values taken from steam table \n",
+ "vf1=0.001127; vfg1=0.1929; # specific volume of the steam in m^3/kg\n",
+ "hf1=763.2; hfg1=2015; # specific enthalpy in kJ/kg \n",
+ "sf1=2.1396; sfg1=4.4460; # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "v1=vf1+x1*vfg1; # specific volume in m^3/kg\n",
+ "h1=hf1+x1*hfg1; # specific enthalpy in kJ/kg \n",
+ "s1=sf1+x1*sfg1; # specific entropy in kJ/kg K\n",
+ "v2=2*v1; # Final volume of the fluid\n",
+ "t2=410.5; # Final temperature of steam in degree celcius (from superheated steam table)\n",
+ "h2=3286.4; # specific enthalpy in kJ/kg \n",
+ "s2=7.525; # specific entropy in kJ/kg K\n",
+ "S21=m*(s2-s1); # Change in entropy\n",
+ "W=m*p1*10**3*(v2-v1); # Work done\n",
+ "Q=m*(h2-h1); # Heat transferred\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Steam\",\"Final Temperature = \",t2+273,\"K\",\"\\nChange in entropy = \",S21,\"kJ/K (Error in textbook)\"\n",
+ "print \"Work done = \",round(W,1),\"kJ\",\"\\nHeat transferred = \",Q,\"kJ\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\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",
+ "V1=m*R*(T1+273)/(p1*10**3); # Initil volume\n",
+ "V2=2*V1; # Final volume\n",
+ "T2=(T1+273)*V2/V1; # Final temperature\n",
+ "S21=m*Cpo*math.log (V2/V1); # Change in entropy\n",
+ "W=p1*10**3*(V2-V1); # Work done\n",
+ "Q=m*Cpo*(T2-(T1+273));# Heat transferred\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Air\",\"Final Temperature = \",T2,\"K\",\"\\nChange in entropy = \",round(S21,3),\"kJ/K\"\n",
+ "print \"Work done = \",round(W,0),\"kJ\",\"\\nHeat transferred = \",round(Q,1),\"kJ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Steam Final Temperature = 683.5 K \n",
+ "Change in entropy = 0.9143 kJ/K (Error in textbook)\n",
+ "Work done = 77.9 kJ \n",
+ "Heat transferred = 455.6 kJ\n",
+ "\n",
+ "(b).Air Final Temperature = 906.0 K \n",
+ "Change in entropy = 0.348 kJ/K\n",
+ "Work done = 65.0 kJ \n",
+ "Heat transferred = 227.3 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page No:321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=1.5; # Mass of the fluid in kg\n",
+ "p1=1; # Initial pressure of fluid in bar\n",
+ "T1=150; # Initial temperture of fluid in degree celcius\n",
+ "v2=0.3; # Final specific volume in m^3/kg\n",
+ "# (a).Steam\n",
+ "# Following are the values taken from steam table \n",
+ "u1=2582.8; # specific internal energy in kJ/kg\n",
+ "s1=7.6134; # specific entropy in kJ/kg K\n",
+ "vf2=0.001091; vfg2=0.3917; # specific volume of the steam in m^3/kg\n",
+ "sf2=1.8418; sfg2=4.9961; # specific entropy in kJ/kg K\n",
+ "uf2=631.7; ufg2=1927.8; # specific internal energy in kJ/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "x2=(v2-vf2)/vfg2; # Quality of steam at state 2\n",
+ "s2=sf2+x2*sfg2; # specific entropy in kJ/kg K\n",
+ "u2=uf2+x2*ufg2; # specific internal energy in kJ/kg\n",
+ "S21=m*(s2-s1); # Change in entropy\n",
+ "U21=m*(u2-u1); # Change in internal energy\n",
+ "Q=(T1+273)*(S21); # Heat transferred\n",
+ "W=Q-U21; # Work done\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Steam\",\"\\nChange in internal energy = \",round(U21,0),\"kJ\"\n",
+ "print \"Change in entropy = \",round(S21,4),\"kJ/K\",\"\\nWork done = \",round(W,1),\"kJ\",\"\\nHeat transferred = \",round(Q,1),\"kJ\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\n",
+ "U21=0; # From fig 7.6\n",
+ "R=0.287; # characteristic gas constant of air in kJ/kg K\n",
+ "v1=(R*(T1+273))/(p1*10**2); # initial specific volume\n",
+ "S21=m*R*math.log (v2/v1); # Change in entropy\n",
+ "Q=(T1+273)*(S21); # Heat transferred\n",
+ "W=Q; # Work done\n",
+ "\n",
+ "#Result for(b)\n",
+ "print \"\\n(b).Air\",\"\\nChange in internal energy = \",round(U21,0),\"kJ\"\n",
+ "print \"Change in entropy = \",round(S21,4),\"kJ/K\",\"\\nWork done = \",round(W,1),\"kJ\",\"\\nHeat transferred = \",round(Q,1),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Steam \n",
+ "Change in internal energy = -720.0 kJ\n",
+ "Change in entropy = -2.9386 kJ/K \n",
+ "Work done = -523.0 kJ \n",
+ "Heat transferred = -1243.0 kJ\n",
+ "\n",
+ "(b).Air \n",
+ "Change in internal energy = 0.0 kJ\n",
+ "Change in entropy = -0.6018 kJ/K \n",
+ "Work done = -254.6 kJ \n",
+ "Heat transferred = -254.6 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page No:323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "m=1.5; # Mass of the fluid in kg\n",
+ "p1=1.6; # Initial pressure of fluid in MPa\n",
+ "T1=250; # Initial temperture of fluid in degree celcius\n",
+ "p2=150; # Initial pressure of the fluid in kPa\n",
+ "# (a).Steam\n",
+ "# Following are the values taken from steam table \n",
+ "# state 1 is superheated\n",
+ "u1=2692.3; # specific internal energy in kJ/kg\n",
+ "s1=6.6732; # specific entropy in kJ/kg K\n",
+ "v1=0.14184; # specific volume of the steam in m^3/kg\n",
+ "# State 2 is wet (s1=s2<sg2)\n",
+ "T2=111.37; # Final temperature of steam in degree celcius\n",
+ "sf2=1.4336; sfg2=5.7897; # specific entropy in kJ/kg K\n",
+ "uf2=466.94; ufg2=2052.7; # specific internal energy in kJ/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "x2=(s1-sf2)/sfg2; # Quality of steam at state 2\n",
+ "u2=uf2+x2*ufg2; # specific internal energy in kJ/kg\n",
+ "W=-m*(u2-u1);# Work done\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Steam\",\"\\nFinal temperature of steam =\",T2+273,\"K\",\"\\nWork done = \",round(W,1),\"kJ\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\n",
+ "Cvo=0.7165; # Specific heat at constant volume in kJ/kg K\n",
+ "k=1.4; # index of reversible adiabatic process\n",
+ "T2=(T1+273)*((p2*10**-3)/p1)**((k-1)/k); # Final temperature of air\n",
+ "W=-m*Cvo*(T2-(T1+273)); # Work done\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"(b).Air\",\"\\nFinal temperature of steam =\",round(T2,1),\"K\",\"\\nWork done = \",round(W,1),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Steam \n",
+ "Final temperature of steam = 384.37 K \n",
+ "Work done = 551.5 kJ\n",
+ "(b).Air \n",
+ "Final temperature of steam = 265.9 K \n",
+ "Work done = 276.3 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "`Example 7.5, Page No:325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=1.5; # Mass of the fluid in kg\n",
+ "p1=1.6; # Initial pressure of fluid in MPa\n",
+ "T1=250; # Initial temperture of fluid in degree celcius\n",
+ "p2=150; # Initial pressure of the fluid in kPa\n",
+ "n=1.25; # Index of polytropic process\n",
+ "# (a).Steam\n",
+ "# Following are the values taken from steam table \n",
+ "# state 1 is superheated\n",
+ "u1=2692.3; # specific internal energy in kJ/kg\n",
+ "s1=6.6732; # specific entropy in kJ/kg K\n",
+ "v1=0.14184; # specific volume of the steam in m^3/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "v2=v1*(p1/(p2*10**-3))**(1/n); # specific volume of the steam at state 2\n",
+ "# State 2 is wet \n",
+ "T2=111.37; # Final temperature of steam in degree celcius\n",
+ "vf2=0.0010531; vfg2=1.1582; # specific volume of the steam in m^3/kg\n",
+ "x2=(v2-vf2)/vfg2; # Quality of steam at state 2\n",
+ "sf2=1.4336; sfg2=5.7897; # specific entropy in kJ/kg K\n",
+ "uf2=466.94; ufg2=2052.7; # specific internal energy in kJ/kg\n",
+ "s2=sf2+x2*sfg2; # specific entropy in kJ/kg K\n",
+ "u2=uf2+x2*ufg2; # specific internal energy in kJ/kg\n",
+ "W=m*((p2*v2)-(p1*10**3*v1))/(1-n); # Work done\n",
+ "Q=m*(u2-u1)+W; # Heat ttransferred\n",
+ "S21=m*(s2-s1); # Change in entropy\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Steam\",\"\\nFinal Temperature = \",T2+273,\"K\",\"\\nChange in entropy = \",round(S21,1),\"kJ/K\"\n",
+ "print \"Work done = \",round(W,0),\"kJ\",\"\\nHeat transferred = \",round(Q,0),\"kJ\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\n",
+ "R=0.287; # characteristic gas constant of air in kJ/kg K\n",
+ "Cvo=0.7165; # Specific heat at constant volume in kJ/kg K\n",
+ "T2=(T1+273)*((p2*10**-3)/p1)**((n-1)/n); # Final temperature of air\n",
+ "W=m*R*(T2-(T1+273))/(1-n); # Work done\n",
+ "Q=m*Cvo*(T2-(T1+273))+W; # Heat transferred\n",
+ "S21=m*(Cvo+R/(1-n))*math.log (T2/(T1+273)); # Change in entropy\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Air\",\"\\nFinal Temperature = \",round(T2,0),\"K\",\"\\nChange in entropy = \",round(S21,3),\"kJ/K\"\n",
+ "print \"Work done = \",round(W,0),\"kJ\",\"\\nHeat transferred = \",round(Q,1),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Steam \n",
+ "Final Temperature = 384.37 K \n",
+ "Change in entropy = -0.8 kJ/K\n",
+ "Work done = 514.0 kJ \n",
+ "Heat transferred = -322.0 kJ\n",
+ "\n",
+ "(b).Air \n",
+ "Final Temperature = 326.0 K \n",
+ "Change in entropy = 0.306 kJ/K\n",
+ "Work done = 340.0 kJ \n",
+ "Heat transferred = 127.7 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6, Page No:335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "m=1; # Massflow rate of the steam in kg/s\n",
+ "p1=3.5; # Pressure at inlet in MPa\n",
+ "T1=400; # Temperature at inlet in degree celcius\n",
+ "V1=250; # Velocity of stesm at inlet in m/s\n",
+ "p2=50; # Pressure at outlet in kPa\n",
+ "T2=100; # Temperature at outlet in degree celcius\n",
+ "V2=30; # Velocity of stesm at outlet in m/s\n",
+ "# For actual expansion in the turbine\n",
+ "h1=3222.3; h2=2682.5; # specific enthalpy in kJ/kg at inlet and exit\n",
+ "\n",
+ "#Calculation\n",
+ "wa=h1-h2+(V1**2-V2**2)/2000; # Work done\n",
+ "W=m*wa; # Power output\n",
+ "# For reversible adiabatic expansion\n",
+ "# Following are the values taken from steam table \n",
+ "s1=6.8405; # specific entropy in kJ/kg K\n",
+ "s2s=s1; # Isentropic expansion\n",
+ "sf2=1.091; sfg2=6.5029; # specific entropy in kJ/kg K\n",
+ "hf2=340.49; hfg2=2305.4; # specific enthalpy in kJ/kg\n",
+ "x2s=(s1-sf2)/sfg2; # Quality of steam at state 2\n",
+ "h2s=hf2+x2s*hfg2; # specific enthalpy in kJ/kg\n",
+ "ws=h1-h2s+(V1**2-V2**2)/2000; # Isentropic Work done\n",
+ "eff_isen=wa/ws; # Isentropic efficiency of the turbine\n",
+ "\n",
+ "#Result\n",
+ "print \"Power output of the turbine = \",round(W,0),\"kW (Error in textbook)\"\n",
+ "print \"Isentropic efficiency of the turbine = \",round(eff_isen*100,1),\"% (Error in textbook)\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power output of the turbine = 571.0 kW (Error in textbook)\n",
+ "Isentropic efficiency of the turbine = 65.3 % (Error in textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7, Page No:336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "m=1; # Massflow rate of the steam in kg/s\n",
+ "p1=3.5; # Pressure at inlet in bar\n",
+ "T1=160; # Temperature at inlet in degree celcius\n",
+ "p2=1; # Pressure at outlet in bar\n",
+ "Cpo=1.005; # Specific heat at constant pressure in kJ/kg K\n",
+ "eff_isen=0.85; # Isentropic efficiency of the turbine\n",
+ "k=1.4; # index of isentropic process\n",
+ "\n",
+ "#Calculation\n",
+ "T2s=(T1+273)*(p2/p1)**((k-1)/k); # Final temperature after isentropic expansion\n",
+ "Ws=m*Cpo*((T1+273)-T2s); # Isentropic power developed\n",
+ "Wa=eff_isen*Ws; # Actual power developed\n",
+ "T2=(T1+273)-(Wa/(m*Cpo)); # Final temperature after expansion\n",
+ "\n",
+ "#Result\n",
+ "print \"Actual power developed =\",round(Wa,0),\"kW (Error in textbook)\",\n",
+ "print \"\\nFinal temperature after expansion = \",round(T2,1),\"K(Roundoff error)\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Actual power developed = 111.0 kW (Error in textbook) \n",
+ "Final temperature after expansion = 322.3 K(Roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8, Page No: 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "m=0.05; # mass flowrate of Freon 12 in kg/s\n",
+ "p1=300; # Pressure of Freon 12 at inlet in kpa\n",
+ "t1=5; # Temperature of Freon 12 at inlet in degree celcius\n",
+ "p2=1.2; # Pressure of Freon 12 at outlet in MPa\n",
+ "t2=80; # Temperature of Freon 12 at outlet in degree celcius\n",
+ "W=-2.3; # Power consumption of compressor in kW\n",
+ "# (a).Heat transfer from the body of compressor to environment\n",
+ "# From the table of properties of Freon 12\n",
+ "h1= 190.8; h2=230.4; # specific enthalpy in kJ/kg \n",
+ "s1=0.71; s2=0.7514 # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "Q=m*(h2-h1)+W; # Heat transfer \n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Heat transfer from the body of compressor to environment =\",Q,\"kW\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Adiabatic efficiency of the compressor\n",
+ "# For adiabatic compression p2=1.2Mpa,s2s=s1\n",
+ "t2s=61.7;# Temperature of Freon 12 at outlet in degree celcius\n",
+ "h2s=216.14; # specific enthalpy in kJ/kg \n",
+ "ws=(h2s-h1); # Reversible adiabatic work\n",
+ "wa=W/m; # Actual work\n",
+ "eff_com=abs (ws/wa); # Adiabatic efficiency\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Adiabatic efficiency of the compressor = \",round(eff_com*100,0),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Heat transfer from the body of compressor to environment = -0.32 kW\n",
+ "\n",
+ "(b).Adiabatic efficiency of the compressor = 55.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9, Page No:340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "p1=1; # Pressure of air at inlet of compressor in bar\n",
+ "T1=30; # Temperature of air at inlet of compressor in degree celcius\n",
+ "p2=12; # Delivery pressure of air in bar\n",
+ "T2=400; # Temperature of air at inlet of compressor in degree celcius\n",
+ "V2=90; # Velocity of air at exit in m/s\n",
+ "w=3740; # Power input to compressor in kW\n",
+ "k=1.4; # Index of reversible adiabatic process\n",
+ "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculation\n",
+ "wa=Cpo*(T2-T1)+V2**2/2000; # Actual specific work input\n",
+ "m=w/wa; # Mass flow rate of air\n",
+ "T2s=(T1+273)*(p2/p1)**((k-1)/k);# Isentropic discharge temperature\n",
+ "ws=Cpo*(T2s-(T1+273))+V2**2/2000; # Isentropic work\n",
+ "eff_com=ws/wa; # Isentrpic efficiency\n",
+ "\n",
+ "#Result\n",
+ "print \"Isentropic discharge temperature = \",round(T2s,1),\"K\",\"\\nIsentrpic efficiency of compressor =\",round(eff_com*100,0),\"%\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Isentropic discharge temperature = 616.3 K \n",
+ "Isentrpic efficiency of compressor = 85.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exapmle 7.10, Page No:344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=3; # Pressure of fluid at inlet in bar\n",
+ "T1=150; # Temperature of fluid at inlet in degree celcius\n",
+ "V1=90; # Velocity of fluid at inlet in m/s \n",
+ "eff_nozzle=0.85; # Nozzle efficiency\n",
+ "k=1.4; # Index of reversible adiabatic process\n",
+ "p2=1/3*p1;\n",
+ "# (a).Steam\n",
+ "# Following are taken from steam table\n",
+ "h1=2761; # specific enthalpy in kJ/kg \n",
+ "s1=7.0778;# specific entropy in kJ/kg K\n",
+ "s2s=s1; # Isentropic process\n",
+ "sf2s=1.3026; sfg2s=6.0568;# specific entropy in kJ/kg K\n",
+ "hf2=417.46; hfg2=2258; # specific enthalpy in kJ/kg \n",
+ "\n",
+ "#Calculation for (a)\n",
+ "x2s=(s2s-sf2s)/sfg2s; # Quality of steam\n",
+ "h2s=hf2+x2s*hfg2;\n",
+ "V2s=math.sqrt (2000*(h1-h2s)+V1**2); # Isentropic Velocity \n",
+ "V2=math.sqrt (eff_nozzle) *V2s; # Actual nozzle exit velocity\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Steam\",\"\\nActual nozzle exit velocity = \",round(V2,1),\"m/s (round off error)\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Air\n",
+ "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
+ "T2s=(T1+273)*(p2/p1)**((k-1)/k); # Isentropic temperature\n",
+ "V2s=math.sqrt ((2000*Cpo*((T1+273)-T2s))+V1**2); # Isentropic Velocity and (answer mentioned in the textbook is wrong)\n",
+ "V2=math.sqrt (eff_nozzle) *V2s; # Actual nozzle exit velocity\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Air\",\"\\n Actual nozzle exit velocity = \",round(V2,1),\"m/s (answer mentioned in the textbook is wrong)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Steam \n",
+ "Actual nozzle exit velocity = 575.1 m/s (round off error)\n",
+ "\n",
+ "(b).Air \n",
+ " Actual nozzle exit velocity = 448.7 m/s (answer mentioned in the textbook is wrong)\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.11, Page No:348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "p1=200; # Pressure of fluid at inlet in kPa\n",
+ "T1=200; # Temperature of fluid at inlet in degree celcius\n",
+ "V1=700; # Velocity of fluid at inlet in m/s \n",
+ "V2=70; # Velocity of fluid at outlet in m/s \n",
+ "# (a).Reversible Adiabatic process\n",
+ "# state of steam entering diffuser (superheated)\n",
+ "h1=2870.5;# specific enthalpy in kJ/kg \n",
+ "s1=7.5066; # specific entropy in kJ/kg K\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "h2=h1+(V1**2-V2**2)/2000; # From first and second laws\n",
+ "s2=s1; # Isentropic peocess\n",
+ "# From superheated table\n",
+ "p2s=550; # Pressure of fluid at outlet in kPa\n",
+ "T2=324; # Temperature of fluid at outlet in degree celcius\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Reversible adiabatic process\",\"\\nPressure of fluid at outlet = \",p2s,\"kPa\"\n",
+ "print \"Temperature of fluid at outlet =\",T2,\"oC\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Actual diffusion\n",
+ "# for the same change in K.E, from first law\n",
+ "h2=3113.1;# specific enthalpy in kJ/kg\n",
+ "p2=400; # Actual exit pressure in kPa\n",
+ "t2=322.4; # from superheated table in degree celcius\n",
+ "eff_d=(p2-p1)/(p2s-p1); # Diffuser efficiency\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Actual diffusion\",\"\\nThe exit temperature =\",t2,\"oC\",\"\\nDiffuser efficiency = \",round(eff_d*100,0),\"%\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Reversible adiabatic process \n",
+ "Pressure of fluid at outlet = 550 kPa\n",
+ "Temperature of fluid at outlet = 324 oC\n",
+ "\n",
+ "(b).Actual diffusion \n",
+ "The exit temperature = 322.4 oC \n",
+ "Diffuser efficiency = 57.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12, Page No:349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p1=1; # Pressure of fluid at inlet in bar\n",
+ "T1=60; # Temperature of fluid at inlet in degree celcius\n",
+ "p2=2.8; # Pressure of fluid at outlet in bar\n",
+ "eff_d=0.80; # Diffuser efficiency\n",
+ "k=1.4; # Index of reversible adiabatic process\n",
+ "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculation\n",
+ "# (a).Actual Diffuser\n",
+ "p2s=((p2-p1)/eff_d)+p1; # Isentropic pressure\n",
+ "T2=(T1+273)*(p2s/p1)**((k-1)/k); # Exit temperature\n",
+ "V1=math.sqrt (2000*Cpo*(T2-(T1+273))); # Initial Velocity\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Actual Diffuser\",\"\\nTemperature of air leaving diffuser =\",round(T2,1),\"K\"\n",
+ "print \"Initial Velocity =\",round(V1,1),\"m/s\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Reversible Adiabatic diffuser\n",
+ "T2s=(T1+273)*(p2/p1)**((k-1)/k); # Isentropic exit temperature\n",
+ "V1=math.sqrt (2000*Cpo*(T2s-(T1+273))); # Initial Velocity\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Reversible Adiabatic diffuser\",\"\\nTemperature of air leaving diffuser =\",round(T2s,0),\"K\"\n",
+ "print \"Initial Velocity =\",round(V1,1),\"m/s\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Actual Diffuser \n",
+ "Temperature of air leaving diffuser = 466.3 K\n",
+ "Initial Velocity = 517.3 m/s\n",
+ "\n",
+ "(b).Reversible Adiabatic diffuser \n",
+ "Temperature of air leaving diffuser = 447.0 K\n",
+ "Initial Velocity = 478.1 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.13, Page No:350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "m=18; # mass flow rate of air in kg/s\n",
+ "p1=3.6; # Pressure of fluid at inlet of turbine in MPa\n",
+ "T1=800; # Temperature of fluid at inlet of turbine in Kelvin\n",
+ "V1=100; # Velocity of fluid at inlet of turbine in m/s \n",
+ "V2=150; # Velocity of fluid at outlet of turbine in m/s\n",
+ "W=3.6; # Power output of turbine in MW\n",
+ "p3=1.01; # pressure at diffuser outlet in bar\n",
+ "k=1.4; # Index of reversible adiabatic process\n",
+ "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
+ "\n",
+ "#Calculation\n",
+ "# (a) Pressure at diffuser inlet\n",
+ "T2=((Cpo*T1)-((W*10**3)/m+(V2**2-V1**2)/2000))/Cpo; # Temperature at outlet of turbine\n",
+ "T3=(T2+273)+((V2**2)/(2*Cpo*10**3)); # Temperature of fluid at diffuser inlet\n",
+ "p2=p3*((T2+273)/T3)**(k/(k-1)); #pressure at diffuser inlet\n",
+ "\n",
+ "#Result \n",
+ "print \"(a).pressure at diffuser inlet =\",round(p2,3),\"bar\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).pressure at diffuser inlet = 0.966 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14, Page No:351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T1=35; # Temperature of freon 12 before throttling in degree celcius\n",
+ "T2=5; # Temperature of freon 12 after throttling in degree celcius\n",
+ "# from property table of freon 12\n",
+ "h1=69.49;# specific enthalpy in kJ/kg \n",
+ "hf2=40.66; hfg2=148.86; # specific enthalpy in kJ/kg \n",
+ "h2=h1; # throttling process\n",
+ "\n",
+ "#Calculation \n",
+ "x2=(h2-hf2)/hfg2; # Quality of Freon 12 vapour\n",
+ "\n",
+ "#Result\n",
+ "print \"Quality of Freon 12 vapour = \",round(x2,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality of Freon 12 vapour = 0.194\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.15, Page No:353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "p2=276; # Pressure at inlet in kPa\n",
+ "p=6.5; # gauge pressure at outlet in cm Hg\n",
+ "T3=110; # Temperature at outlet in degree celcius\n",
+ "pa=756; # Barometric pressure in mm Hg\n",
+ "mc=760;# Mass of condensed steam in g\n",
+ "ms=25; # Mass of separated water in g\n",
+ "den=13600; # Density of mercury in kg/m^3\n",
+ "g=9.81; # Acceleration due to gravity in m/s^2\n",
+ "\n",
+ "#Calculation\n",
+ "z=(pa*10**-3)+(p*10**-2);# absolute pressure in m Hg\n",
+ "p3=den*g*z; # Pressure after throttling\n",
+ "h3=2697.4;# specific enthalpy in kJ/kg \n",
+ "hf2=545.31; hfg2=2175.2; # specific enthalpy in kJ/kg \n",
+ "x2=(h3-hf2)/hfg2; # Quality of steam\n",
+ "x1=(mc/(mc+ms))*x2; # Quality of steam in the main line\n",
+ "\n",
+ "#Result\n",
+ "print \"Quality of steam in the main line =\",round(x1,4),\" (roundoff error)\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quality of steam in the main line = 0.9579 (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file