From f270f72badd9c61d48f290c3396004802841b9df Mon Sep 17 00:00:00 2001 From: kinitrupti Date: Fri, 12 May 2017 18:53:46 +0530 Subject: Removed duplicates --- Thermodynamics_by_C_P_Arora/Chapter7.ipynb | 932 +++++++++++++++++++++++++++++ 1 file changed, 932 insertions(+) create mode 100755 Thermodynamics_by_C_P_Arora/Chapter7.ipynb (limited to 'Thermodynamics_by_C_P_Arora/Chapter7.ipynb') 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