diff options
author | hardythe1 | 2015-04-07 15:58:05 +0530 |
---|---|---|
committer | hardythe1 | 2015-04-07 15:58:05 +0530 |
commit | 92cca121f959c6616e3da431c1e2d23c4fa5e886 (patch) | |
tree | 205e68d0ce598ac5caca7de839a2934d746cce86 /Thermodynamics_An_Engineering_Approach/Chapter8.ipynb | |
parent | b14c13fcc6bb6d01c468805d612acb353ec168ac (diff) | |
download | Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.gz Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.bz2 Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.zip |
added books
Diffstat (limited to 'Thermodynamics_An_Engineering_Approach/Chapter8.ipynb')
-rwxr-xr-x | Thermodynamics_An_Engineering_Approach/Chapter8.ipynb | 764 |
1 files changed, 764 insertions, 0 deletions
diff --git a/Thermodynamics_An_Engineering_Approach/Chapter8.ipynb b/Thermodynamics_An_Engineering_Approach/Chapter8.ipynb new file mode 100755 index 00000000..e91e1b78 --- /dev/null +++ b/Thermodynamics_An_Engineering_Approach/Chapter8.ipynb @@ -0,0 +1,764 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Exergy: A Measure of Work Potential"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-1 ,Page No.426"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi\n",
+ "\n",
+ "# given data\n",
+ "D=12.0;#diameter of rotor in m\n",
+ "V=10.0;#average velocity in m/s\n",
+ "\n",
+ "# density of air at 25C & 1atm\n",
+ "p=1.18;\n",
+ "\n",
+ "#calculations\n",
+ "ke=(V**2)/2/1000;#factor of 1000 for converting J into kJ\n",
+ "m=p*pi*(D**2)*V/4.0; \n",
+ "MP=m*(ke);\n",
+ "print'Maximum power %f kW'%round(MP,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power 66.700000 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-2 ,Page No.427"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given values\n",
+ "TH=2000.0;#temperature of large furnace in R\n",
+ "T0=77+460.0;#temperature of enviroment in R\n",
+ "Qin=3000.0;#heat rate in Btu/sec\n",
+ "\n",
+ "#calculation\n",
+ "nth=1-(T0/TH);\n",
+ "Wmax=nth*Qin;\n",
+ "Wmax=round(Wmax)\n",
+ "print'the rate of energy flow %i Btu/s'%round(Wmax)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the rate of energy flow 2195 Btu/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-3 ,Page No.429"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "Tsink=300.0;#temperature of sink in K\n",
+ "Tsource=1200.0;#temperature of source in K\n",
+ "Qin=500.0;#heat rate in kJ/s\n",
+ "Wuout=180;#power output in W\n",
+ "\n",
+ "#calculations\n",
+ "Wrev=(1-Tsink/Tsource)*Qin;\n",
+ "print'The reversible power %i kW'%round(Wrev);\n",
+ "I=Wrev-Wuout;\n",
+ "print'the irreversiblity rate %i kW'%round(I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reversible power 375 kW\n",
+ "the irreversiblity rate 195 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-4 ,Page No.429"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from scipy.integrate import quad \n",
+ "from pylab import *\n",
+ "\n",
+ "#given data\n",
+ "m=500.0;#mass of iron block in kg\n",
+ "T1=473.0;#temperature of iron block in K\n",
+ "T0=300.0;#temperature of surrondings in K\n",
+ "\n",
+ "\n",
+ "#from Table A-3\n",
+ "cavg=0.45;\n",
+ "\n",
+ "#calculations\n",
+ "def intgrnd1(T): \n",
+ " return ((1-T0/T)*(-m*cavg))#intergrant\n",
+ "Wrev, err = quad(intgrnd1,T1,T0) ;\n",
+ "Qtotal=m*cavg*(T1-T0);\n",
+ "print'The reversible power %i kJ'%round(Wrev);\n",
+ "Wu=0;\n",
+ "I=Wrev-Wu;\n",
+ "print'the irreversiblity rate %i kJ'%round(I)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reversible power 8191 kJ\n",
+ "the irreversiblity rate 8191 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-5 ,Page No.431"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "Wrev=8191.0;#reversible work from Ex - 8.4\n",
+ "Wtotal=38925.0;#total work is equivalent to total heat lost to heat engine from Ex - 8.4\n",
+ "TL=278.0;#outdoor temperature in K\n",
+ "TH=300.0;#temperature of house in K\n",
+ "\n",
+ "#calculations\n",
+ "Wrm=Wtotal-Wrev;#work remaining\n",
+ "COPHP=1/(1-TL/TH);\n",
+ "Wd=COPHP*Wrev;#work delivered\n",
+ "PS=Wd+Wrm;\n",
+ "PS=round(PS/1000);#factor of 1000 for converting kJ into MJ\n",
+ "print'Maximum amount of heat that can be supplied %i MJ'%PS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum amount of heat that can be supplied 142 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-6 ,Page No.434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "COP=1.0;# the efficiency that the dealer is referring to is the first law efficiency, meaning that for each unit of electric energy (work) consumed, the heater will supply the house with 1 unit of energy (heat). That is,the advertised heater has a COP of 1\n",
+ "TL=283.0;#outdoor temperature in K\n",
+ "TH=294.0;#indoor temperature in K\n",
+ "\n",
+ "#calculations\n",
+ "COPHP=1/(1-TL/TH);\n",
+ "nII=COP/COPHP;\n",
+ "print'the second law efficiency %f'%round(nII,3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the second law efficiency 0.037000\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-7 ,Page No.438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log\n",
+ "\n",
+ "#given data\n",
+ "P1=1000.0;#pressure of compressed air in KPa\n",
+ "V=200.0;#volumne of rigid tank in m^3\n",
+ "T1=300.0;#temperature of enviroment in K\n",
+ "T0=T1;#state of air in tank\n",
+ "P0=100.0;#pressure of enviroment in KPa\n",
+ "\n",
+ "#constants used\n",
+ "R=0.287;#in kPa m^3/kg K\n",
+ "\n",
+ "#calculations\n",
+ "m1=P1*V/(R*T1);\n",
+ "O1=R*T0*(P0/P1-1)+R*T0*log(P1/P0);# O refers to exergy\n",
+ "X1=m1*O1/1000;#factor of 1000 for converting kJ into MJ\n",
+ "print'work obtained %i MJ'%round(X1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "work obtained 281 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-8 ,Page No.439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T0=20+273;#temperature of enviroment in K\n",
+ "P1=0.14;#intail pressure in MPa\n",
+ "T1=-10;#intail temperature in K\n",
+ "P2=0.8;#final pressure in MPa\n",
+ "T2=50;#final temperature in K\n",
+ "\n",
+ "#the properties of refrigerant\n",
+ "#at inlet\n",
+ "h1=246.36;\n",
+ "s1=0.9724;\n",
+ "#at outlet\n",
+ "h2=286.69;\n",
+ "s2=0.9802;\n",
+ "dO=h2-h1-T0*(s2-s1);# O refers to exergy\n",
+ "print'the exergy change of the refrigerant %i kJ/kg'%round(dO)\n",
+ "wmin=dO;\n",
+ "print'the minimum work input that needs to be supplied is %i kJ/kg'%wmin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the exergy change of the refrigerant 38 kJ/kg\n",
+ "the minimum work input that needs to be supplied is 38 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-10 ,Page No.447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given values\n",
+ "Q=1035.0;#rate of heat transfer in W\n",
+ "T0=273.0;#outdoor temperature in C\n",
+ "Tin=293.0;#inner wall surface temperature in K\n",
+ "Tout=278.0;#outer wall surface temperature in K\n",
+ "T1=300.0;#indoor temperature in C\n",
+ "\n",
+ "#calculations\n",
+ "#Xin - Xout - Xdestroyed = dX/dt\n",
+ "Xdestroyed=Q*(1-T0/Tin)-Q*(1-T0/Tout);\n",
+ "Xdestroyed=round(Xdestroyed);\n",
+ "print'the rate of exergy destroyed %i W'%round(Xdestroyed);\n",
+ "#the total rate of exergy destroyed\n",
+ "Xdestroyed=Q*(1-T0/T1)-Q*(1-T0/T0);\n",
+ "print'the total of exergy destroyed %f W'%round(Xdestroyed,1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the rate of exergy destroyed 52 W\n",
+ "the total of exergy destroyed 93.100000 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-11 ,Page No.448"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "m=0.05;#mass of steam in kg\n",
+ "P1=1000;#intial pressure in MPa\n",
+ "T1=300+273;#intial temperature in K\n",
+ "P2=200;#final pressure in MPa\n",
+ "T2=150+273;#final temperature in K\n",
+ "P0=100;#pressure of surroundings in KPa\n",
+ "T0=25+273;#temperature of surroundings in K\n",
+ "Qout=2;#heat losses in kJ\n",
+ "\n",
+ "#from Table A-6 & A-4\n",
+ "u1=2793.7;\n",
+ "v1=0.25799;\n",
+ "s1=7.1246;\n",
+ "u2=2577.1;\n",
+ "v2=0.95986;\n",
+ "s2=7.2810;\n",
+ "u0=104.83;\n",
+ "v0=0.00103;\n",
+ "s0=0.3672;\n",
+ "\n",
+ "#calculations\n",
+ "X1=m*(u1-u0-T0*(s1-s0)+P0*(v1-v0));\n",
+ "X2=m*(u2-u0-T0*(s2-s0)+P0*(v2-v0));\n",
+ "print'exergy of intial state %i kJ'%round(X1);\n",
+ "print'exergy of final state %f kJ'%round(X2,1);\n",
+ "dX=X2-X1;\n",
+ "print'exergy change in system %f kJ'%round(dX,1);\n",
+ "Wout=-Qout-m*(u2-u1);\n",
+ "Wu=Wout-P0*m*(v2-v1);\n",
+ "Xdestroyed=X1-X2-Wu;\n",
+ "print'the exergy destroyed %f kJ'%round(Xdestroyed,1);\n",
+ "nII=Wu/(X1-X2);\n",
+ "print'second law efficiency of this process is %f'%round(nII,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "exergy of intial state 35 kJ\n",
+ "exergy of final state 25.400000 kJ\n",
+ "exergy change in system -9.700000 kJ\n",
+ "the exergy destroyed 4.300000 kJ\n",
+ "second law efficiency of this process is 0.551000\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-12 ,Page No.451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from scipy.integrate import quad \n",
+ "from pylab import *\n",
+ "\n",
+ "#given data\n",
+ "m=2.0;#mass of air in lbm\n",
+ "T0=70+460.0;#intial temperature in R\n",
+ "P1=20.0;#intial pressure in psia\n",
+ "T1=70+460.0;#temperature of surroundings in R\n",
+ "T2=130+460.0;#final temperature in R\n",
+ "\n",
+ "#constants used\n",
+ "Cv=0.172;#in Btu/lbm - F\n",
+ "\n",
+ "#calculations\n",
+ "Xdestroyed=T0*m*Cv*log(T2/T1);\n",
+ "print'exergy destroyed %f Btu'%round(Xdestroyed,1);\n",
+ "def intgrnd1(T): \n",
+ " return ((1-T0/T)*m*Cv)#intergrant\n",
+ "Wrev, err = quad(intgrnd1,T1,T2) ;\n",
+ "print'the reversible work %f Btu'%round(Wrev,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "exergy destroyed 19.600000 Btu\n",
+ "the reversible work 1.100000 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-13 ,Page No.453"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T0=20+273.0;#temperature of surrounding in K\n",
+ "P0=100.0;#pressure of surrounding in kPa\n",
+ "Tiw=30+273.0;#temperature of water in K\n",
+ "mw=100.0;#mass of water in kg\n",
+ "Tii=350+273.0;#temperature of block in K\n",
+ "mi=5.0;#mass of block in kg\n",
+ "\n",
+ "#constants used(Table A-3)\n",
+ "cw=4.18;#specific heat of water in kJ/kg C\n",
+ "ci=0.45;#specific heat of iron in kJ/kg C\n",
+ "\n",
+ "#calculations\n",
+ "Tfk=(mi*ci*Tii+mw*cw*Tiw)/(mw*cw+mi*ci);\n",
+ "Tfc=Tfk-273;#in C\n",
+ "print'the final equilibrium temperature %f C'%round(Tfc,1);\n",
+ "X1i=mi*ci*(Tii-T0-T0*log(Tii/T0));\n",
+ "X1w=mw*cw*(Tiw-T0-T0*log(Tiw/T0));\n",
+ "X1t=X1i+X1w;#total exergy \n",
+ "print'intial exergy of combined systems %i kJ'%round(X1t);\n",
+ "X2i=mi*ci*(Tfk-T0-T0*log(Tfk/T0));\n",
+ "X2w=mw*cw*(Tfk-T0-T0*log(Tfk/T0));\n",
+ "X2t=X2i+X2w;#total exergy \n",
+ "print'intial exergy of combined systems %f kJ'%round(X2t,1);\n",
+ "Xdestroyed=X1t-X2t;\n",
+ "print'the wasted work %f kJ'%round(Xdestroyed,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the final equilibrium temperature 31.700000 C\n",
+ "intial exergy of combined systems 315 kJ\n",
+ "intial exergy of combined systems 95.800000 kJ\n",
+ "the wasted work 219.100000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-14 ,Page No.455"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "TR=1200.0;#temperature of furnace \n",
+ "T0=300;#temperature of surrounding in K\n",
+ "P0=100;#pressure of surrounding in kPa\n",
+ "Tsys=400.0;#temperature of argon in K\n",
+ "P1=350;#temperature of argon in K\n",
+ "V1=0.01;#intail volumne in m^3\n",
+ "V2=2*V1;#final volumne\n",
+ "\n",
+ "#calculations\n",
+ "W=P1*V1*log(V2/V1);\n",
+ "Wsurr=P0*(V2-V1);\n",
+ "Wu=W-Wsurr;\n",
+ "print'the useful work output %f kJ'%round(Wu,2);\n",
+ "# Qin - W = m*Cv*dT, Since dt=0\n",
+ "Q=W;\n",
+ "Sgen=Q/Tsys-Q/TR;\n",
+ "Xdestroyed=T0*Sgen;\n",
+ "print'the exergy destroyed %f kJ/K'%round(Xdestroyed,2);\n",
+ "Wrev=T0*Q/Tsys-Wsurr+(1-T0/TR)*Q;\n",
+ "print'the reversible work is done in the process %f kJ'%round(Wrev,2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the useful work output 1.430000 kJ\n",
+ "the exergy destroyed 1.210000 kJ/K\n",
+ "the reversible work is done in the process 2.640000 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-15 ,Page No.460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculation error in textbook in part - b which changes all the following answers\n",
+ "\n",
+ "#given data\n",
+ "m=8.0;#mass flow rate in kg/s\n",
+ "T0=298.0;#temperature of surrounding in K\n",
+ "P0=100.0;#pressure of surrounding in kPa\n",
+ "P1=3000.0;#inlet pressure in kPa\n",
+ "T1=450.0;#inlet temperature in K\n",
+ "P2=200.0;#outlet pressure in kPa\n",
+ "T2=150.0;#outlet temperature in K\n",
+ "Qout=300.0;#heat rate in kW\n",
+ "\n",
+ "#from Table A-6 and A-4\n",
+ "h1=3344.9;\n",
+ "s1=7.0856;\n",
+ "h2=2769.1;\n",
+ "s2=7.2810;\n",
+ "h0=104.83;\n",
+ "s0=0.3672;\n",
+ "\n",
+ "#calculations\n",
+ "# Ein = Eout\n",
+ "Wout=m*(h1-h2)-Qout;\n",
+ "Wout=round(Wout)\n",
+ "print'the actual power output %i kW'%Wout\n",
+ "# Xin = Xout\n",
+ "Wrev=m*(h1-h2)-(T0*(s1-s2));\n",
+ "Wrev=round(Wrev);\n",
+ "print'the maximum possible work output %i kW'%Wrev;\n",
+ "nII=Wout/Wrev;\n",
+ "print'second law efficiency is %f'%round(nII,3);\n",
+ "Xdestroyed=Wrev-Wout;\n",
+ "print'the exergy destroyed %i kW'%round(Xdestroyed);\n",
+ "X1=h1-h0-T0*(s1-s0);\n",
+ "print'the exergy of the steam at inlet conditions %i kJ/kg'%round(X1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the actual power output 4306 kW\n",
+ "the maximum possible work output 4665 kW\n",
+ "second law efficiency is 0.923000\n",
+ "the exergy destroyed 359 kW\n",
+ "the exergy of the steam at inlet conditions 1238 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-16 ,Page No.462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T0=70+460;#temperature of surroundings in R\n",
+ "T1=50;#temperature of water in F\n",
+ "T2=240;#temperature of steam in F\n",
+ "T3=130;#outlet temperature in F\n",
+ "#as dicussed in example 7-20\n",
+ "m1=300;#mass flow rate of water in lbm/min\n",
+ "m2=22.7;#mass flow rate of steam in lbm/min\n",
+ "m3=322.7;#outlet mass flow rate in lbm/min\n",
+ "\n",
+ "#from steam tables\n",
+ "h1=18.07;\n",
+ "s1=0.03609;\n",
+ "h2=1162.3;\n",
+ "s2=1.7406;\n",
+ "h3=97.99;\n",
+ "s3=0.18174;\n",
+ "\n",
+ "#calculations\n",
+ "Wrev=m1*(h1-T0*s1)+m2*(h2-T0*s2)-m3*(h3-T0*s3);\n",
+ "Wrev=round(Wrev);\n",
+ "print'the reversible power %i Btu/min'%round(Wrev)\n",
+ "Xdestroyed=Wrev;\n",
+ "print'the rate of exergy destruction %i Btu/min'%Xdestroyed\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the reversible power 4588 Btu/min\n",
+ "the rate of exergy destruction 4588 Btu/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8-17 ,Page No.463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "V=200.0;#volumne of rigid tank in m^3\n",
+ "P1=100.0;#intial surroundings in kPa\n",
+ "P2=1000.0;#final pressure in kPa\n",
+ "P0=100.0;#pressure of surroundings in kPa\n",
+ "T=300.0;#temperature of surroundings in K\n",
+ "\n",
+ "#constants used\n",
+ "R=0.287;#in kPa m^3/kg K\n",
+ "\n",
+ "#calculations\n",
+ "#Xin - Xout = Xdestroyed = X2 - X1\n",
+ "m2=P2*V/(R*T);\n",
+ "X2=R*T*(log(P2/P0)+P0/P2-1);\n",
+ "Wrev=m2*X2/1000;\n",
+ "Wrev=round(Wrev);\n",
+ "print'Work requirement %i MJ'%Wrev\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work requirement 281 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |