diff options
Diffstat (limited to 'Fundamental_of_Thermodynamics_by_Moran_and_Shapiro')
13 files changed, 6242 insertions, 0 deletions
diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/10-Refrigeration_and_Heat_Pump_Systems.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/10-Refrigeration_and_Heat_Pump_Systems.ipynb new file mode 100644 index 0000000..9e4b97e --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/10-Refrigeration_and_Heat_Pump_Systems.ipynb @@ -0,0 +1,268 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Refrigeration and Heat Pump Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Tc = 273.00 // temperature of cold region in kelvin\n", +"Th = 299.00 // temperature of hot region in kelvin\n", +"mdot = 0.08 // mass flow rate in kg/s\n", +"// Analysis\n", +"// At the inlet to the compressor, the refrigerant is a saturated vapor at 0C, so from Table A-10\n", +"h1 = 247.23 // in kj/kg\n", +"s1 = 0.9190 // in kj/kg.k\n", +"// The pressure at state 2s is the saturation pressure corresponding to 26C, or\n", +"p2 = 6.853 // in bars\n", +"// The refrigerant at state 2s is a superheated vapor with\n", +"h2s = 264.7 // in kj/kg\n", +"// State 3 is saturated liquid at 26C, so\n", +"h3 = 85.75 // in kj/kg\n", +"h4 = h3 // since The expansion through the valve is a throttling process\n", +"// Part(a)\n", +"Wcdot = mdot*(h2s-h1) // The compressor work input in KW\n", +"printf( ' The compressor power, in kW, is: %.2f',Wcdot)\n", +"// Part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 // refrigeration capacity in ton\n", +"printf( ' The refrigeration capacity in tons is: %.2f',Qindot)\n", +"// Part(c)\n", +"beta1 = (h1-h4)/(h2s-h1)\n", +"printf( ' The coefficient of performance is: %.2f',beta1)\n", +"// Part(d)\n", +"betamax = Tc/(Th-Tc)\n", +"printf( ' The coefficient of performance of a Carnot refrigeration cycle operating between warm and cold regions at 26 and 0C, respectively is: %.2f',betamax);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"mdot = 0.08 // mass flow rate in kg/s\n", +"// Analysis\n", +"// At the inlet to the compressor, the refrigerant is a saturated vapor at 10C, so from Table A-10,\n", +"h1 = 241.35 // in kj/kg\n", +"s1 = .9253 // in kj/kg.k\n", +"// Interpolating in Table A-12 gives\n", +"h2s = 272.39 // in kj/kg.k\n", +"// State 3 is a saturated liquid at 9 bar, so\n", +"h3 = 99.56 // in kj/kg\n", +"h4 = h3 // since The expansion through the valve is a throttling process\n", +"// Part(a)\n", +"Wcdot = mdot*(h2s-h1) // The compressor power input in KW\n", +"// Result\n", +"printf( ' \nThe compressor power in kw is: %.2f',Wcdot)\n", +"// Part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 // refrigeration capacity in tons\n", +"// Result\n", +"printf( ' \nThe refrigeration capacity in tons is: %.2f',Qindot)\n", +"// Part(c)\n", +"beta1 = (h1-h4)/(h2s-h1)\n", +"// Result\n", +"printf( ' \nThe coefficient of performance is: %.2f',beta1)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Tnot = 299 //in kelvin\n", +"etac = .8 //compressor efficiency of 80 percent\n", +"mdot = .08 //mass flow rate in kg/s\n", +"//analysis\n", +"//State 1 is the same as in Example 10.2, so\n", +"h1 = 241.35 //in kj/kg\n", +"s1 = .9253 //in kj/kg.k\n", +"//from example 10.2\n", +"h2s = 272.39 //in kj/kg\n", +"h2 =(h2s-h1)/etac + h1 //in kj/kg\n", +"//Interpolating in Table A-12,\n", +"s2 = .9497 //in kj/kg.k\n", +"h3 = 91.49 //in kj/kg\n", +"s3 = .3396\n", +"h4 = h3 //since The expansion through the valve is a throttling process\n", +"//from data table\n", +"hf4 = 36.97 //in kj/kg\n", +"hg4 = 241.36 //in kj/kg\n", +"sf4 = .1486 //in kj/kg.k\n", +"sg4 = .9253 //in kj/kg.k\n", +"x4 = (h4-hf4)/(hg4-hf4) //quality at state 4\n", +"s4 = sf4 + x4*(sg4-sf4) //specific entropy at state 4 in kj/kg.k\n", +"//part(a)\n", +"Wcdot = mdot*(h2-h1) //compressor power in kw\n", +"printf( 'The compressor power in kw is: %.2f kW',Wcdot)\n", +"//part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 //refrigeration capacity in ton\n", +"printf( 'The refrigeration capacity in ton is: %.2f ton',Qindot)\n", +"//part(c)\n", +"beta = (h1-h4)/(h2-h1) //coefficient of performance \n", +"printf( 'The coefficient of performance is: %.2f',beta)\n", +"//part(d)\n", +"Eddotc = mdot*Tnot*(s2-s1) //in kw\n", +"Eddotv = mdot*Tnot*(s4-s3) //in kw\n", +"printf( 'The rate of exergy destruction within the compressor is: %.2f kW',Eddotc)\n", +"printf( 'The rate of exergy destruction within the valve is: %.2f kw',Eddotv)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 1.00 // in bar\n", +"T1 = 270.00 // in kelvin\n", +"AV = 1.4 // in m^3/s\n", +"r = 3.00 // compressor pressure ratio\n", +"T3 = 300.00 // turbine inlet temperature in kelvin\n", +"// Analysis\n", +"// From Table A-22,\n", +"h1 = 270.11 // in kj/kg\n", +"pr1 = 0.9590\n", +"// Interpolating in Table A-22,\n", +"h2s = 370.1 // in kj/kg\n", +"// From Table A-22,\n", +"h3 = 300.19 // in kj/kg\n", +"pr3 = 1.3860\n", +"// Interpolating in Table A-22, we obtain\n", +"h4s = 219.00 // in kj/kg\n", +"// Calculations\n", +"pr2 = r*pr1\n", +"pr4 = pr3/r\n", +"// Part(a)\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// Results\n", +"mdot = (AV*p1)/((R/M)*T1)*10**2 // mass flow rate in kg/s\n", +"Wcycledot = mdot*((h2s-h1)-(h3-h4s))\n", +"printf( ' The net power input in kw is: %.2f',Wcycledot)\n", +"// Part(b)\n", +"Qindot = mdot*(h1-h4s) // refrigeration capacity in kw\n", +"printf( ' The refregeration capacity in kw is: %.2f',Qindot)\n", +"// Part(c)\n", +"beta = Qindot/Wcycledot // coefficient of performance\n", +"printf( 'The coefficient of performance is: %.2f',beta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"wcdots = 99.99 // work per unit mass for the isentropic compression determined with data from the solution in Example 10.4 in kj/kg\n", +"mdot = 1.807 // mass flow rate in kg/s from 10.4\n", +"etac = 0.8 // isentropic efficiency of compressor\n", +"Wcdot = (mdot*wcdots)/etac // The power input to the compressor in kw\n", +"// Using data form the solution to Example 10.4 gives\n", +"wtdots =81.19 // in kj/kg\n", +"etat = 0.8 // isentropic efficiency of turbine\n", +"// Calculations\n", +"Wtdot = mdot*etat*wtdots // actual turbine work in kw\n", +"Wdotcycle = Wcdot-Wtdot // The net power input to the cycle in kw\n", +"// Result\n", +"printf( ' The net power input in kw is: %.2f',Wdotcycle)\n", +"// Part(b)\n", +"h3 = 300.19 // in kj/kg\n", +"// From table A-22\n", +"h1 = 270.11 // in kj/kg\n", +"// Calculations\n", +"h4 = h3 -Wtdot/mdot\n", +"Qindot = mdot*(h1-h4) // refrigeration capacity in kw\n", +"// Result\n", +"printf( ' The refrigeration capacity in kw is: %.2f',Qindot)\n", +"// Part(c)\n", +"beta = Qindot/Wdotcycle // coefficient of performance \n", +"// Result\n", +"printf( ' The coefficient of performance is: %.2f',beta)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/11-Thermodynamic_Relations.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/11-Thermodynamic_Relations.ipynb new file mode 100644 index 0000000..b76ed75 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/11-Thermodynamic_Relations.ipynb @@ -0,0 +1,392 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Thermodynamic Relations" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Analysis\n", +"V = 0.241 // volume of the mixture in m^3\n", +"T = 511.00 // temperature of the mixture in kelvin\n", +"n1 = 0.18 // number of moles of methane in kmol\n", +"n2 = 0.274 // number of moles of butane in kmol\n", +"Rbar = 8314 // universal gas constant in (N.m)/(kmol.K)\n", +"// Calculations\n", +"n = n1 + n2 // The total number of moles of mixture\n", +"y1 = n1/n // mole fraction of methane\n", +"y2 = n2/n // mole fraction of butane\n", +"vbar = V/(n) // The specific volume of the mixture on a molar basis in m^3/kmol\n", +"// Part(a)\n", +"p = (Rbar*T/vbar)*10**-5 // in bar\n", +"// Result\n", +"printf( ' The pressure in bar obtained using ideal gas equation is: %.2f',p)\n", +"// Part(b)\n", +"// From table A-1\n", +"Tc1 = 191.00 // critical temperature for methane in kelvin \n", +"Pc1 = 46.4 // critical pressure for methane in bar\n", +"Tc2 = 425.00 // critical temperature for butane in kelvin\n", +"Pc2 = 38.00 // critical pressure for butane in bar\n", +"Z = 0.88\n", +"// Calculations\n", +"Tc = y1*Tc1 + y2*Tc2 // critical temperature in kelvin\n", +"Pc = y1*Pc1 + y2*Pc2 // critical pressure in bar\n", +"TR = T/Tc // reduced temperature of the mixture\n", +"vRdash= vbar*Pc/(Rbar*Tc)\n", +"p = ((Z*Rbar*T)/vbar)*10**-5 // mixture pressure in bar\n", +"// Result\n", +"printf( ' Pressure obtained using Kay’s rule together with the generalized compressibility chart, is: %.2f ',p)\n", +"// Part(c)\n", +"// Table A-24 gives the following van der Waals constants values for methane\n", +"a1 = 2.293 // in (m^3/kmol)^2\n", +"b1 = 0.0428 // in m^3/kmol\n", +"// Table A-24 gives the following van der Waals constants values for butane\n", +"a2 = 13.86 // in (m^3/kmol)^2\n", +"b2 = 0.1162 // in m^3/kmol\n", +"a = (y1*a1**.5 + y2*a2**.5)**2 // in bar*(m^3/kmol)^2\n", +"b = y1*b1+y2*b2 // in m^3/kmol\n", +"// From van der Waals equation\n", +"p = ((Rbar*T)/(vbar-b))*10**-5 - a/(vbar**2)\n", +"printf( ' The pressure in bar from van der Waals equation is: %.2f',p)\n", +"// Part(d)\n", +"// For methane\n", +"TR1 = T/Tc1\n", +"vR1dash = (.241/.18)*10**5*Pc1/(Rbar*Tc1)\n", +"Z1 = 1.00\n", +"// For butane\n", +"TR2 = T/Tc2\n", +"vR2dash = (.88*10**5*Pc2)/(Rbar*Tc2)\n", +"Z2 = 0.8\n", +"Z = y1*Z1 + y2*Z2\n", +"// Accordingly, the same value for pressure as determined in part (b) using Kay’s rule results:\n", +"p = 70.4\n", +"// Result\n", +"printf( ' The pressure in bar obtained using the rule of additive pressures employing the generalized compressibility chart is: %.2f',p)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m = 4.00 // mass of carbon monoxide in kg\n", +"T = 223.00 // temperature of carbon monoxide in kelvin\n", +"D = 0.2 // inner diameter of cylinder in meter\n", +"L = 1.00 // length of the cylinder in meter\n", +"pi=3.14\n", +"// Analysis\n", +"M = 28.00 // molar mass in kg/kmol\n", +"// Calculations\n", +"V = (pi*D**2.00/4.00)*L // volume occupied by the gas in m^3\n", +"vbar = M*(V/m) // The molar specific volume in m^3/kmol\n", +"// Part(a)\n", +"// From Table A-1 for CO\n", +"Tc = 133 // in kelvin\n", +"Pc = 35 // in bar\n", +"Tr = T/Tc // reduced temperature\n", +"Rbar = 8314 // universal gas constant in N.m/kmol.K\n", +"Z = 0.9\n", +"// Calculations\n", +"vrdash = (vbar*Pc*10**5)/(Rbar*Tc) // pseudoreduced specific volume\n", +"p = (Z*Rbar*T/vbar)*10**-5 // in bar\n", +"// Result\n", +"printf( '\n part(a)the pressure in bar is: %.2f bar',p)\n", +"// Part(b)\n", +"// The ideal gas equation of state gives\n", +"// Calculations\n", +"p = (Rbar*T/vbar)/10**5 // in bar\n", +"// Result\n", +"printf( '\n Part(b)the pressure in bar is: %.2f bar',p)\n", +"// Part(c)\n", +"// For carbon monoxide, the van der Waals constants a and b can be read directly from Table A-24\n", +"a = 1.474 // in (m^3/kmol)^2\n", +"b = 0.0395 // in m^3/kmol\n", +"// Calculations\n", +"p = (Rbar*T/(vbar-b))/10**5 - a/vbar**2\n", +"// Result\n", +"printf( '\n Part(c)the pressure in bars is: %.2f bar',p)\n", +"// Part(d)\n", +"// For carbon monoxide, the Redlich–Kwong constants can be read directly from Table A-24\n", +"a = 17.22 // in m^6*K^.5/kmol^2\n", +"b = 0.02737 // in m^3/kmol\n", +"// Calculations\n", +"p = (Rbar*T/(vbar-b))/10**5 - a/(vbar*(vbar+b)*T**.5)\n", +"// Result\n", +"printf( '\n Part(d)the pressure in bar is: %.2f bar', p)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"v = 0.4646 // specific volume in in m^3/kg\n", +"M = 18.02 // molar mass of water in kg/kmol\n", +"// At the specified state, the temperature is 513 K and the specific volume on a molar basis is\n", +"vbar = v*M // in m^3/kmol\n", +"// From Table A-24\n", +"a = 142.59 // (m^3/kmol)^2 * K^.5\n", +"b = 0.0211 // in m^3/kmol\n", +"Rbar = 8314.0 // universal gas constant in N.m/kmol.K\n", +"T = 513.0 // in kelvin\n", +"delpbydelT = (Rbar/(vbar-b) + a/(2*vbar*(vbar+b)*T**1.5)*10**5)/10**3 // in kj/(m^3*K)\n", +"// By The Maxwell relation\n", +"delsbydelv = delpbydelT\n", +"// Result\n", +"printf( ' The value of delpbydelT in kj/(m^3*K) is: %.2f',delpbydelT);\n", +"// Part(b)\n", +"// A value for (dels/delv)T can be estimated using a graphical approach with steam table data, as follows: At 240C, Table A-4 provides the values for specific entropy s and specific volume v tabulated below\n", +"T = 240.0 // in degree celcius\n", +"// At p =1, 1.5, 3, 5, 7, 10 bar respectively\n", +"y = [7.994, 7.805, 7.477, 7.230, 7.064, 6.882] \n", +"x = [2.359, 1.570, 0.781, 0.4646, 0.3292, 0.2275] \n", +"plot(x,y)\n", +"xlabel('Specific volume')\n", +"ylabel('Specific entropy')\n", +"// The pressure at the desired state is 5 bar.The corresponding slope is\n", +"delsbydelv = 1 // in kj/m^3.K\n", +"printf( ' From the data of the table,delsbydelv = %.2f',delsbydelv);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Analysis\n", +"// For comparison, Table A-2 gives at 100C,\n", +"hgf =2257.00 // in kj/kg\n", +"ugf = 2087.6 // in kj/kg\n", +"sgf = 6.048 // in kj/kg.K\n", +"// Values\n", +"printf( ' From table, hg-hf = %.2f',hgf);\n", +"printf( ' From table, ug-uf = %.2f',ugf);\n", +"printf( ' From table, sg-sf = %.2f',sgf);\n", +"// Part(a)\n", +"T = 373.15 // in kelvin\n", +"// If we plot a graph between temperature and saturation pressure using saturation pressure–temperature data from the steam tables, the desired slope is:\n", +"delpbydelT = 3570.00 // in N/(m^2.K)\n", +"vg = 1.673 // in m^3/kg\n", +"vf = 1.0435e-3 // in m^3/kg\n", +"// Calculations\n", +"// From the Clapeyron equation\n", +"hgf = T*(vg-vf)*delpbydelT*10**-3 // in kj/kg\n", +"// Result\n", +"printf( '\n Part(a)using Clapeyron equation, hg-hf = %.2f KJ/kg', hgf);\n", +"// Part(b)\n", +"psat = 1.014e5 // in N/m^2\n", +"hgf = 2256.00 // can be obtained using IT software in kj/kg\n", +"// Calculations\n", +"ugf = hgf - psat*(vg-vf)/10**3 // in kj/kg\n", +"// Result\n", +"printf( '\n Part(b)ug-uf = %.2f KJ/kg',ugf)\n", +"// Part(c)\n", +"// Calculation\n", +"sgf =hgf/T // in kj/kg.K \n", +"// Result\n", +"printf( '\n Part(c)sg-sf = %.2f KJ/kg. k',sgf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"v = 1.00/998.21 // specific volume of water in m^3/kg\n", +"T = 293.00 // given temperature in kelvin\n", +"beta = 206.6e-6 // volume expansivity in /K\n", +"k = 45.90e-6 // isothermal compressibility in /bar\n", +"// Interpolating in Table A-19\n", +"cp = 4.188 // in kj/kg.k\n", +"// Calculations\n", +"cpv = (v*T*beta**2.00/k)*10**2 // in kj/kg.k\n", +"cv = cp-cpv // in kj/kg.k\n", +"errorPercentage = 100*(cp-cv)/cv\n", +"// Result\n", +"printf( ' The percentage error is: %.2f',errorPercentage)\n", +"// Part(b)\n", +"// Calculations\n", +"K = cp/cv // specific heat ratio\n", +"c = ((K*v/k)*10**5)**0.5 // velocity of sound in m/s\n", +"// Result\n", +"printf( ' The velocity of sound is: %.2f m/s',c)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 100.00 // in bar\n", +"T1 = 300.00 // in kelvin\n", +"p2 = 40.00 // in bar\n", +"T2 = 245.00 // in kelvin\n", +"// From table A-23\n", +"h1starbar = 8723.00 // in kj/kmol\n", +"h2starbar = 7121.00 // in kj/kmol\n", +"// From Tables A-1\n", +"Tc = 126.00 // critical temperature in kelvin\n", +"pc = 33.9 // critical pressure in bar\n", +"M = 28.00 // molar mass in kg/kmol\n", +"Rbar = 8.314 // universal gas constant in kj/(kmol.K)\n", +"Term1 = 0.5 \n", +"Term2 = 0.31\n", +"// Calculations\n", +"TR1 = T1/Tc // reduced temperature at the inlet\n", +"PR1 = p1/pc // reduced pressure at the inlet\n", +"TR2 = T2/Tc // reduced temperature at the exit\n", +"PR2 = p2/pc // reduced pressure at the exit\n", +"wcvdot = (1.00/M)*(h1starbar-h2starbar-Rbar*Tc*(Term1-Term2)) // in kj/kg\n", +"// Result\n", +"printf( ' The work developed, in kJ per kg of nitrogen flowing is : %.2f',wcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"// With values from Table A-23\n", +"sT2bar = 185.775 // in kj/(kmol.K)\n", +"sT1bar = 191.682 // in kj/(kmol.K)\n", +"Rbar = 8.314 // universal gas constant\n", +"M = 28.00 // molar mass in kg/kmol \n", +"p2 = 40.00 // in bar\n", +"p1 = 100.00 // in bar\n", +"Term1 = 0.21\n", +"Term2 = 0.14\n", +"// Calculations\n", +"S2StarBarMinusS1StarBar = sT2bar-sT1bar-Rbar*log(p2/p1) // The change in specific entropy in kj/(kmol.K)\n", +"sigmacvdot = (1.00/M)*(S2StarBarMinusS1StarBar-Rbar*(Term2-Term1))\n", +"// Result\n", +"printf( ' the rate of entropy production in kj/kg.K is: %.2f', sigmacvdot)\n", +"// Part(b)\n", +"// From Table A-23,\n", +"h2starbar = 6654.00 // in kj/kmol\n", +"h1starbar = 8723.00 // in kj/kmol\n", +"Tc = 126.00 // critical temperature in kelvin\n", +"Term2 = 0.36\n", +"Term1 = 0.5\n", +"wcvdot = 50.1 // from example 11.8\n", +"// Calculations\n", +"wcvdots = (1.00/M)*(h1starbar-h2starbar-Rbar*Tc*(Term1-Term2)) // isentropic work in kj/kg\n", +"etat = wcvdot/wcvdots // turbine efficiency\n", +"// Result\n", +"printf( ' The isentropic turbine efficiency is: %.2f', etat)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/12-Ideal_Gas_Mixtures_and_Psychrometrics_Applications.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/12-Ideal_Gas_Mixtures_and_Psychrometrics_Applications.ipynb new file mode 100644 index 0000000..a92e181 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/12-Ideal_Gas_Mixtures_and_Psychrometrics_Applications.ipynb @@ -0,0 +1,772 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Ideal Gas Mixtures and Psychrometrics Applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"AV1 = 150.0 // entry volumetric flow rate in m^3/min\n", +"T1 = 10.0 // entry temperature in degree celcius\n", +"psi1 = 0.8 \n", +"T2 = 30.0 // exit temperature in degree celcius\n", +"p = 1.0 // in bar\n", +"// Part(a)\n", +"Rbar = 8314.0 // universal gas constant\n", +"Ma = 28.97 // molar mass of air\n", +"// The specific enthalpies of the dry air are obtained from Table A-22 at the inlet and exit temperatures T1 and T2, respectively:\n", +"ha1 = 283.1 // in kj/kg\n", +"ha2 = 303.2 // in kj/kg\n", +"// The specific enthalpies of the water vapor are found using hv hg and data from Table A-2 at T1 and T2, respectively:\n", +"hv1 = 2519.8 // in kj/kg\n", +"hv2 = 2556.3 // in kj/kg\n", +"// From table A-2\n", +"pg1 = 0.01228 // in bar\n", +"// Calculations\n", +"pv1 = psi1*pg1 // the partial pressure of the water vapor in bar\n", +"pa1 = p-pv1\n", +"va1 = (Rbar/Ma)*(T1+273)/(pa1*10**5) // specific volume of the dry air in m^3/kg\n", +"madot = AV1/va1 // mass flow rate of the dry air in kg/min\n", +"omega = 0.622*(pv1/(p-pv1)) // humidity ratio\n", +"Qcvdot = madot*((ha2-ha1)+omega*(hv2-hv1)) // in kj/min\n", +"// Result\n", +"printf( 'Rate of heat transfer, in kJ/min is: %.2f',Qcvdot);\n", +"// Part(b)\n", +"// From Table A-2 at 30C\n", +"pg2 = 0.04246 // in bar\n", +"// Calculations\n", +"pv2 = pv1\n", +"psi2 = pv2/pg2 // relative humidity at the exit\n", +"// Result\n", +"printf( 'The relative humidity at the exit is: %.2f',psi2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 30.0 // in degree celcius\n", +"AV1 = 280.0 // in m^3/min\n", +"psi1 = 0.5 // relative humidity at the inlet\n", +"T2 = 10.0 // in degree celcius\n", +"p = 1.013 // pressure in bar\n", +"// Part(a)\n", +"// From table A-2\n", +"pg1 = 0.04246 // in bar\n", +"Rbar = 8314 // universal gas constant\n", +"Ma = 28.97 // molar mass of air\n", +"// Calculations\n", +"pv1 = psi1*pg1 // in bar\n", +"pa1 = p-pv1 // partial pressure of the dry air in bar\n", +"madot = AV1/((Rbar/Ma)*((T1+273)/(pa1*10**5))) // common mass flow rate of the dry air in kg/min\n", +"// Result\n", +"printf( '\n The mass flow rate of the dry air in kg/min is: %.2f',madot);\n", +"// Part(b)\n", +"// From table A-2\n", +"pv2 = 0.01228 // in bar\n", +"// Calculations\n", +"omega1 = 0.622*(pv1/(p-pv1))\n", +"omega2 = 0.622*(pv2/(p-pv2))\n", +"mwdotbymadot = omega1-omega2 \n", +"// Result\n", +"printf( '\n The rate at which water is condensed, in kg per kg of dry air flowing through the control volume is: %.4f',mwdotbymadot);\n", +"// Part(c)\n", +"// From table A-2 and A-22\n", +"ha2 = 283.1 // in kg/kj\n", +"ha1 = 303.2 // in kg/kj\n", +"hg1 = 2556.3 // in kg/kj\n", +"hg2 = 2519.8 // in kg/kj\n", +"hf2 = 42.01 // in kg/kj\n", +"// Calculations\n", +"Qcvdot = madot*((ha2-ha1)-omega1*hg1+omega2*hg2+(omega1-omega2)*hf2) // in kj/min\n", +"// Result\n", +"printf( '\n The required refrigerating capacity, in tons is: %.2f',Qcvdot/211);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.12: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 22.0 // entry temperature of moist air in degree celcius\n", +"Twb = 9.0 // wet-bulb temperature of entering moist air in degree celcius\n", +"madot = 90.0 // mass flow rate of dry air in kg/min\n", +"Tst = 110.0 // temperature of injected saturated water vapor in degree celcius\n", +"mstdot = 52.0 // mass flow rate of injected saturated water vapor in kg/h\n", +"p = 1.0 // pressure in bar\n", +"// Part(a)\n", +"// By inspection of the psychrometric chart\n", +"omega1 = 0.002\n", +"// Calculation\n", +"omega2 = omega1 + mstdot/(madot*60)\n", +"// Result\n", +"printf( 'The humidity ratio at the exit is: %.2f',omega2);\n", +"// Part(b)\n", +"// The steady-state form of the energy rate balance can be rearranged as\n", +"// (ha + omega*hg)2 = (ha + omega*hg)1 + (omega2-omega1)*hg3\n", +"// On putting values in the above equation from tables and figures, temperature at the exit can then be read directly from the chart\n", +"T2 = 23.5 // in degree celcius\n", +"// Result\n", +"printf( 'The temperature at the exit in degree celcius is: %.2f',T2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 38.0 // temperature of entering air in degree celcius\n", +"psi1 = 0.1 // relative humidity of entering air \n", +"AV1 = 140.0 // volumetric flow rate of entering air in m^3/min\n", +"Tw = 21.0 // temperature of added water in degree celcius\n", +"T2 = 21.0 // temperature of exiting moist air in degree celcius\n", +"p = 1.0 // pressure in atm\n", +"// Part(a)\n", +"// From table A-2\n", +"pg1 = 0.066 // in bar\n", +"// The specific volume of the dry air can be evaluated from the ideal gas equation of state. The result is\n", +"va1 = .887 // in m^3/kg\n", +"cpa = 1.005\n", +"// From table A-2\n", +"hf = 88.14\n", +"hg1 = 2570.7\n", +"hg2 = 2539.94\n", +"// Calculations\n", +"pv1 = psi1*pg1 // the partial pressure of the moist air entering the control volume in bar\n", +"omega1 = 0.622*(pv1/(p*1.01325-pv1))\n", +"omega2 = (cpa*(T1-T2)+omega1*(hg1-hf))/(hg2-hf)\n", +"madot = AV1/va1 // mass flow rate of the dry air in kg/min\n", +"mwdot = madot*60*(omega2-omega1) // in kg/h\n", +"// Result\n", +"printf( '\n The mass flow rate of the water to the soaked pad in is: %.2f kg(water)/h',mwdot);\n", +"// Part(b)\n", +"pv2 = (omega2*p*1.01325)/(omega2+0.622) // in bars\n", +"// At 21C, the saturation pressure is\n", +"pg2 = 0.02487\n", +"psi2 = pv2/pg2\n", +"// Result\n", +"printf( '\n The relative humidity of the moist air at the exit to the evaporative cooler is: %.2f',psi2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.14: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"AV1 = 142.0 // in m^3/min\n", +"T1 = 5.0 // in degree celcius\n", +"omega1 = 0.002\n", +"AV2 = 425.0 // in m^3/min\n", +"T2 = 24.0 // in degree celcius\n", +"psi2 = 0.5\n", +"p = 1.0 // in bar\n", +"// Part(a)\n", +"// From the psychrometric chart, Fig. A-9.\n", +"va1 = 0.79 // in m^3/kg\n", +"va2 = 0.855 // in m^3/kg\n", +"omega2 = 0.0094\n", +"// Calculations\n", +"ma1dot = AV1/va1 // in kg/min\n", +"ma2dot = AV2 /va2 // in kg/min\n", +"omega3 = (omega1*ma1dot+omega2*ma2dot)/(ma1dot + ma2dot) \n", +"// Result\n", +"printf( '\n The humidity ratio is: %.4f',omega3);\n", +"// Part(b)\n", +"// Reduction of the energy rate balance gives\n", +"// (ha + omega*hv)3 = [ma1dot*(ha + omega*hv)1 + ma2dot*(ha + omega*hv)2]/(ma1dot+ma2dot)\n", +"// With (ha + omega*hv)1 = 10kj/kg and (ha + omega*hv)2 = 47.8kj/kg from figure A-9\n", +"LHS = (ma1dot*10+ma2dot*47.8)/(ma1dot + ma2dot)\n", +"// This value for the enthalpy of the moist air at the exit, together with the previously determined value for omega3, fixes the state of the exiting moist air. From inspection of Fig. A-9,\n", +"T3 = 19.0 // in degree celcius\n", +"// Result\n", +"printf( '\n The temperature of the exiting mixed stream in degree celcius T3 is : %.2f',T3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.15: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 38.0 // in degree celcius\n", +"m1dot = 4.5e7 // in kg/h\n", +"T2 = 30.0 // in degree celcius\n", +"m2dot = 4.5e7 // in kg/h\n", +"T3 = 25.0 // in degree celcius\n", +"psi3 = 0.35\n", +"T4 = 35.0 // in degree celcius\n", +"psi4 = 0.9\n", +"T5 = 20.0 // in degree celcius\n", +"// Analysis\n", +"// The humidity ratios omega3 and omega4 can be determined using the partial pressure of the water vapor obtained with the respective relative humidity\n", +"omega3 =0.00688\n", +"omega4 = 0.0327\n", +"// From tables A-2 and A-22\n", +"hf1 = 159.21\n", +"hf2 = 125.79\n", +"ha4 = 308.2\n", +"ha3 = 298.2\n", +"hg4 = 2565.3\n", +"hg3 = 2547.2\n", +"hf5 = 83.96\n", +"// Calculations\n", +"madot = (m1dot*(hf1-hf2))/(ha4-ha3+omega4*hg4-omega3*hg3-(omega4-omega3)*hf5) // in kg/h\n", +"m5dot = madot*(omega4-omega3) // in kg/h\n", +"// Results\n", +"printf( 'The mass flow rate of dry air in kg/h is: %.2f',madot)\n", +"printf( 'The mass flow rate of makeup water in kg/h is: %.2f',m5dot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"n1 = 0.08 // mole fraction of CO2\n", +"n2 = 0.11 // mole fraction of H2O\n", +"n3 = 0.07 // mole fraction of O2\n", +"n4 = 0.74 // mole fraction of N2\n", +"// Part(a)\n", +"M1 = 44.0 // molar mass of CO2 in kg/kmol\n", +"M2 = 18.0 // molar mass of H2O in kg/kmol\n", +"M3 = 32.0 // molar mass of O2 in kg/kmol\n", +"M4 = 28.0 // molar mass of N2 in kg/kmol\n", +"// Calculations\n", +"M = M1*n1 + M2*n2 + M3*n3 + M4*n4 // in kg/kmol\n", +"// Result\n", +"printf( 'The apparent molecular weight of the mixture in kg/kmol is: %f',M)\n", +"// Part(b)\n", +"mf1 = (M1*n1/M)*100.0 // mass fraction of CO2 in percentage \n", +"mf2 = (M2*n2/M)*100.0 // mass fraction of H2O in percentage\n", +"mf3 = (M3*n3/M)*100.0 // mass fraction of O2 in percentage\n", +"mf4 = (M4*n4/M)*100.0 // mass fraction of N2 in percentage\n", +"// Results\n", +"printf( 'The mass fraction of CO2 in percentage is: %f',mf1)\n", +"printf( 'The mass fraction of H2O in percentage is: %f',mf2)\n", +"printf( 'The mass fraction of O2 in percentage is: %f',mf3)\n", +"printf( 'The mass fraction of N2 in percentage is: %f',mf4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"mf1 = 0.1 // mass fractiion of H2\n", +"mf2 = 0.6 // mass fraction of N2\n", +"mf3 = 0.3 // mass fraction of CO2\n", +"// Part(a)\n", +"M1 = 2.0 // molar mass of H2 in kg/kmol\n", +"M2 = 28.0 // molar mass of N2 in kg/kmol\n", +"M3 = 44.0 // molar mass of CO2 in kg/kmol\n", +"// Calculations\n", +"n1 = (mf1/M1)/(mf1/M1 + mf2/M2 + mf3/M3) // mole fraction of H2 \n", +"n2 = (mf2/M2)/(mf1/M1 + mf2/M2 + mf3/M3) // mole fraction of N2\n", +"n3 = (mf3/M3)/(mf1/M1 + mf2/M2 + mf3/M3) // mole fraction of CO2\n", +"// Results\n", +"printf( 'The mole fraction of H2 in percentage is: %f',n1*100)\n", +"printf( 'The mole fraction of N2 in percentage is: %f',n2*100)\n", +"printf( 'The mole fraction of CO2 in percentage is: %f',n3*100)\n", +"// Part(b)\n", +"// Calculation\n", +"M = n1*M1 + n2*M2 + n3*M3 // in kg/kmol\n", +"// Result\n", +"printf( 'The apparent molecular weight of the mixture in kg/kmol is: %f',M);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m1 = 0.3 // mass of CO2 in kg\n", +"m2 = 0.2 // mass of N2 in kg\n", +"p1 = 1.0 // in bar\n", +"T1 = 300.0 // in kelvin\n", +"p2 = 3.0 // in bar\n", +"n = 1.25\n", +"// Part(a)\n", +"// Calculation\n", +"T2 = T1*(p2/p1)**((n-1)/n) // in kelvin\n", +"// Result\n", +"printf( 'The final temperature in Kelvin is: %f',T2);\n", +"// Part(b)\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"// Calculations\n", +"M = (m1+m2)/(m1/44 + m2/28) // molar mass of mixture in kg/kmol\n", +"W = ((m1+m2)*(Rbar/M)*(T2-T1))/(1-n) // in kj\n", +"// Result\n", +"printf( 'The work in kj is: %f',W )\n", +"// Part(c)\n", +"// From table A-23\n", +"uCO2T1 = 6939.0 // internal energy of CO2 on molar mass basis at temperature T1\n", +"uCO2T2 = 9198.0 // internal energy of CO2 on molar mass basis at temperature T2\n", +"uN2T1 = 6229.0 // internal energy of N2 on molar mass basis at temperature T1\n", +"uN2T2 = 7770.0 // internal energy of N2 on molar mass basis at temperature T2\n", +"deltaU = (m1/44)*(uCO2T2-uCO2T1) + (m2/28)*(uN2T2-uN2T1) // internal energy change of the mixture in KJ\n", +"// With assumption, The changes in kinetic and potential energy between the initial and final states can be ignored\n", +"Q = deltaU + W\n", +"// Result\n", +"printf( 'The heat transfer in kj is: %f',Q);\n", +"// Part(d)\n", +"// From table A-23\n", +"sbarT2CO2 = 222.475\n", +"sbarT1CO2 = 213.915 \n", +"sbarT2N2 = 198.105\n", +"sbarT1N2 = 191.682\n", +"Rbar = 8.314 // universal gas constant\n", +"// Calculation\n", +"deltaS = (m1/44)*(sbarT2CO2-sbarT1CO2-Rbar*log(p2/p1)) + (m2/28)*(sbarT2N2-sbarT1N2-Rbar*log(p2/p1))\n", +"// Result\n", +"printf( 'The change in entropy of the mixture in kj/k is: %f',deltaS)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"y1 = 0.8 // mole fraction of CO2\n", +"y2 = 0.2 // mole fraction of O2\n", +"T1 = 700.0 // in kelvin\n", +"p1 = 5.0 // in bars\n", +"V1 = 3.0 // in m/s\n", +"p2 = 1.0 // in bars\n", +"// Part(a)\n", +"// From table A-23\n", +"sO2barT1 = 231.358\n", +"sCO2barT1 = 250.663\n", +"// Calculations\n", +"RHS = y2*sO2barT1 + y1*sCO2barT1 + 8.314*log(p2/p1)\n", +"// Using table A-23\n", +"LHSat510K = y2*221.206 + y1*235.7\n", +"LHSat520K = y2*221.812 + y1*236.575\n", +"// Using linear interpolation,\n", +"T2 = 510 +((520-510)/(LHSat520K-LHSat510K))*(RHS-LHSat510K)\n", +"// Result \n", +"printf( 'The temperature at the nozzle exit in K is: %f',T2);\n", +"// Part(b)\n", +"// From table A-23\n", +"sbarO2T2 = 221.667 // in kj/kmol.K\n", +"sbarO2T1 = 231.358 // in kj/kmol.K\n", +"sbarCO2T2 = 236.365 // in kj/kmol.K\n", +"sbarCO2T1 = 250.663 // in kj/kmol.K\n", +"// Calculations\n", +"deltasbarO2 = sbarO2T2-sbarO2T1-8.314*log(p2/p1) // in kj/kmol.K\n", +"deltasbarCO2 = sbarCO2T2-sbarCO2T1-8.314*log(p2/p1) // in kj/kmol.K\n", +"// Results\n", +"printf( 'The entropy changes of the CO2 from inlet to exit, in KJ/Kmol.K is: %f',deltasbarCO2)\n", +"printf( 'The entropy change of the O2 from inlet to the exit in kj/kmol.k is: %f',deltasbarO2)\n", +"// Part(c)\n", +"// From table A-23, the molar specific enthalpies of O2 and CO2 are\n", +"h1barO2 = 21184.0\n", +"h2barO2 = 15320.0\n", +"h1barCO2 = 27125.0\n", +"h2barCO2 = 18468.0\n", +"// Calculations\n", +"M = y1*44.0 + y2*32.0 // apparent molecular weight of the mixture in kg/kmol\n", +"deltah = (1.0/M)*(y2*(h1barO2-h2barO2) + y1*(h1barCO2-h2barCO2))\n", +"V2 = sqrt(V1**2+ 2*deltah*10**3)\n", +"// Result\n", +"printf( 'The exit velocity in m/s is: %f',V2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"nN2 = 0.79 // initial moles of nitrogen in kmol\n", +"pN2 = 2.0 // initial pressure of nitrogen in bars\n", +"TN2 = 250.0 // initial temperature of nitrogen in kelvin\n", +"nO2 = 0.21 // initial moles of oxygen in kmol\n", +"pO2 = 1.0 // initial pressure of oxygen in bars\n", +"TO2 = 300.0 // initial temperature of oxygen in kelvin\n", +"// Part(a)\n", +"MN2 = 28.01 // molar mass of nitrogen in kg/kmol\n", +"MO2 = 32.0 // molar mass of oxygen in kg/kmol\n", +"// Calculations\n", +"// With the help of table A-20\n", +"cvbarN2 = MN2*0.743 // in kj/kmol.K\n", +"cvbarO2 = MO2*0.656 // in kj/kmol.K\n", +"T2 = (nN2*cvbarN2*TN2+nO2*cvbarO2*TO2)/(nN2*cvbarN2+nO2*cvbarO2)\n", +"// Result\n", +"printf( 'The final temperature of the mixture in kelvin is: %f',T2);\n", +"// Part(b)\n", +"// Calculation\n", +"p2 = ((nN2+nO2)*T2)/(nN2*TN2/pN2 + nO2*TO2/pO2)\n", +"// Result\n", +"printf( 'The final pressure of the mixture in bar is: %f',p2);\n", +"// Part(c)\n", +"Rbar = 8.314 // universal gas constant\n", +"// Calculations\n", +"cpbarN2 = cvbarN2 + Rbar\n", +"cpbarO2 = cvbarO2 + Rbar\n", +"yN2 = nN2/(nN2+nO2) // mole fraction of N2\n", +"yO2 = nO2/(nN2+nO2) // mole fraction of O2\n", +"sigma = nN2*(cpbarN2*log(T2/TN2)-Rbar*log(yN2*p2/pN2)) + nO2*(cpbarO2*log(T2/TO2)-Rbar*log(yO2*p2/pO2))\n", +"// Result\n", +"printf( 'The amount of entropy produced in the mixing process, in kJ/K is: %f',sigma);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 32.0 // temperature of dry air in degree celcius\n", +"p1 = 1.0 // pressure of dry air in bar\n", +"AV1 = 100.0 // volume rate of dry air in m^3/min\n", +"T2 = 127.0 // temperature of oxygen stream in degree celcius\n", +"p2 = 1.0 // pressure of oxygen stream in bar\n", +"T3 = 47.0 // temperature of mixed stream in degree celcius\n", +"p3 = 1.0 // pressure of mixed stream in bar\n", +"// Part(a)\n", +"Rbar = 8314.0 // universal gas constant\n", +"Ma = 28.97 // molar mass of air\n", +"Mo = 32.0 // molar mass of oxygen\n", +"// From table A-22 and A-23\n", +"haT3 = 320.29 // in kj/kg\n", +"haT1 = 305.22 // in kj/kg\n", +"hnotT2 = 11711.0 // in kj/kmol\n", +"hnotT1 = 9325.0 // in kj/kmol\n", +"// Calculations\n", +"va1 = (Rbar/Ma)*(T1+273.0)/(p1*10**5) // specific volume of air in m^3/kg\n", +"ma1dot = AV1/va1 // mass flow rate of dry air in kg/min\n", +"modot = ma1dot*(haT3-haT1)/((1/Mo)*(hnotT2-hnotT1)) // in kg/min\n", +"// Results\n", +"printf( 'The mass flow rate of dry air in kg/min is: %f',ma1dot);\n", +"printf( 'The mass flow rate of oxygen in kg/min is: %f',modot);\n", +"// Part(b)\n", +"nadot = ma1dot/Ma // molar flow rate of air in kmol/min\n", +"nodot = modot/Mo // molar flow rate of oxygen in kmol/min\n", +"ya = nadot/(nadot+nodot) // mole fraction of air\n", +"yo = nodot/(nadot+nodot) // mole fraction of oxygen\n", +"// Results\n", +"printf( 'The mole fraction of dry air in the exiting mixture is: %f',ya)\n", +"printf( 'The mole fraction of dry oxygen in the exiting mixture is: %f',yo)\n", +"// Part(c)\n", +"// With the help of tables A-22 and A-23\n", +"sanotT3 = 1.7669 // in kj/kg.K\n", +"sanotT1 = 1.71865 // in kj/kg.K\n", +"sbarT3 = 207.112 // in kj/kmol.K\n", +"sbarT2 = 213.765 // in kj/kmol.K\n", +"// Calculations\n", +"sigmadot = ma1dot*(sanotT3-sanotT1-(8.314/Ma)*log(ya))+ (modot/Mo)*(sbarT3-sbarT2-8.314*log(yo))\n", +"// Result\n", +"printf( 'The time rate of entropy production, in kJ/K . min is: %f',sigmadot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m =1.0 // mass of sample in kg\n", +"T1 = 21.0 // initial temperature in degree celcius\n", +"psi1 = 0.7 // initial relative humidity\n", +"T2 = 5.0 // final temperature in degree celcius\n", +"// Part(a)\n", +"// From table A-2\n", +"pg = 0.02487 // in bar\n", +"// Calculations \n", +"pv1 = psi1*pg // partial pressure of water vapor in bar\n", +"omega1 = 0.622*(0.2542)/(14.7-0.2542)\n", +"// Result \n", +"printf( 'the initial humidity ratio is: %f',omega1)\n", +"// Part(b)\n", +"// The dew point temperature is the saturation temperature corresponding to the partial pressure, pv1. Interpolation in Table A-2 gives\n", +"T = 15.3 // the dew point temperature in degree celcius\n", +"// Result\n", +"printf( 'The dew point temperature in degree celcius is: %f',T)\n", +"// Part(c)\n", +"// The partial pressure of the water vapor remaining in the system at the final state is the saturation pressure corresponding to 5C:\n", +"// Calculations\n", +"mv1 = 1/((1/omega1)+1) // initial amount of water vapor in the sample in kg\n", +"ma = m-mv1 // mass of dry air present in kg\n", +"pg = 0.00872 // in bar\n", +"omega2 = 0.622*(pg)/(1.01325-pg) // humidity ratio after cooling\n", +"mv2 = omega2*ma // The mass of the water vapor present at the final state\n", +"mw = mv1-mv2\n", +"// Result\n", +"printf( 'The amount of water vapor that condenses, in kg. is: %f',mw)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"V = 35.0 // volume of the vessel in m^3\n", +"p1 = 1.5 // in bar\n", +"T1 = 120.0 // in degree celcius\n", +"psi1 = 0.1 \n", +"T2 = 22.0 // in degree celcius\n", +"// Part(a)\n", +"// The dew point temperature at the initial state is the saturation temperature corresponding to the partial pressure pv1. With the given relative humidity and the saturation pressure at 120C from Table A-2\n", +"pg1 = 1.985\n", +"// Interpolating in Table A-2 gives the dew point temperature as\n", +"T = 60.0 // in degree celcius\n", +"// Calculation\n", +"pv1 = psi1*pg1 // partial pressure in bar\n", +"// Result\n", +"printf( 'The dew point temperature corresponding to the initial state, in degee celcius is: %f',T)\n", +"// Part(b)\n", +"Rbar = 8314.0 // universal gas constant\n", +"Mv = 18.0 // molar mass of vapor in kj/kmol\n", +"// Interpolation in Table A-2\n", +"Tdash = 56.0 // in degrees\n", +"vv1 =((Rbar/Mv)*(T1+273))/(pv1*10**5) // the specific volume of the vapor at state 1 in m^3/kg\n", +"// Result\n", +"printf( 'The temperature at which condensation actually begins in degree celcius is: %f',Tdash)\n", +"// Part(c)\n", +"// From table \n", +"vf2 = 1.0022e-3\n", +"vg2 = 51.447\n", +"vv2 = vv1 // specific volume at final state\n", +"// Calculations\n", +"mv1 = V/vv1 // initial amount of water vapor present in kg\n", +"x2 = (vv2-vf2)/(vg2-vf2) // quality\n", +"mv2 = x2*mv1 // the mass of the water vapor contained in the system at the final state\n", +"mw2 = mv1-mv2\n", +"// Result\n", +"printf( 'The amount of water condense in kg is: %f',mw2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"V = 35.0 // volume of vessel in m^3\n", +"p1 = 1.5 // initial pressure in bar\n", +"T1 = 120.0 // initial temperature in degree celcius\n", +"psi = 0.1\n", +"T2 = 22.0 // in degree celcius\n", +"Rbar = 8314.0 // universal gas constant\n", +"Ma = 28.97 // molar mass of air\n", +"pv1 = 0.1985 // in bar, from example 12.8\n", +"mv2 = 0.681 // in kg, from examples 12.8\n", +"mv1 = 3.827 // in kg, from example 12.8\n", +"mw2 = 3.146 // in kg, from example 12.8\n", +"// evaluating internal energies of dry air and water from Tables A-22 and A-2, respectively\n", +"ua2 = 210.49 // in kj/kg\n", +"ua1 = 281.1 // in kj/kg\n", +"ug2 = 2405.7 // in kj/kg\n", +"uf2 = 92.32 // in kj/kg\n", +"ug1 = 2529.3 // in kj/kg\n", +"// Calculations\n", +"ma =( ((p1-pv1)*10**5)*V)/((Rbar/Ma)*(T1+273)) // mass of dry air in kg\n", +"Q = ma*(ua2-ua1) + mv2*ug2 + mw2*uf2 - mv1*ug1\n", +"// Result\n", +"printf( 'The heat transfer during the process, in kJ is: %f',Q)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/13-Reacting_Mixtures_and_Combustion.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/13-Reacting_Mixtures_and_Combustion.ipynb new file mode 100644 index 0000000..443a3c1 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/13-Reacting_Mixtures_and_Combustion.ipynb @@ -0,0 +1,727 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Reacting Mixtures and Combustion" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"// The chemical equation for the complete combustion of methane with oxygen is\n", +"// CH4 + 2O2 --- CO2 + 2H2O\n", +"yCH4 = 1.0/3.0\n", +"yO2 = 2.0/3.0\n", +"yCO2 = 1.0/3.0\n", +"yH2O = 2.0/3.0\n", +"// From table A-25\n", +"sbarCH4atTref = 186.16 // in kj/kmol.K\n", +"sbarO2atTref = 205.03 // in kj/kmol.K\n", +"p2 = 3.02 // in atm\n", +"pref = 1.0 // in atm\n", +"// Calculations\n", +"sbarCH4 = sbarCH4atTref - Rbar*log(yCH4)\n", +"sbarO2 = sbarO2atTref - Rbar*log(yO2)\n", +"// With help from table A-23\n", +"sbarCO2 = 263.559 - Rbar*log(yCO2*p2/pref) // in kj/kmol.K\n", +"sbarH2O = 228.321 - Rbar*log(yH2O*p2/pref) // in kj/kmol.K\n", +"deltaS = sbarCO2 + 2*sbarH2O - sbarCH4 -2*sbarO2 // in kj/K\n", +"// Result\n", +"printf( ' The change in entropy of the system is: %.2f kJ/K ',deltaS)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Methane is formed from carbon and hydrogen according to\n", +"// C + 2H2 ----- CH4\n", +"// In the present case, all substances are at the same temperature and pressure, 25C and 1 atm, which correspond to the standard reference state values\n", +"hCbar = 0\n", +"hH2bar = 0\n", +"gRbar = 0\n", +"// With enthalpy of formation and absolute entropy data from Table A-25\n", +"hfbarCH4 = -74850\n", +"sbarCH4 = 186.16\n", +"sbarC = 5.74\n", +"sbarH2 = 130.57\n", +"Tref = 298.15 // in kelvin\n", +"// Calculation\n", +"gfbarCH4 = hfbarCH4 -Tref*(sbarCH4-sbarC-2*sbarH2) // in kj/kmol\n", +"// Result\n", +"printf( ' The gibbs function of formation of methane at the standard state is: %f kJ/mol',gfbarCH4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.12: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Complete combustion of liquid octane with O2 is described by\n", +"// C8H18(l) + 12.5O2 ----- 8CO2 + 9H2O\n", +"// Part(a)\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"Tnot = 298.15 // in kelvin\n", +"// From table A-25\n", +"gbarC8H18 = 6610.0\n", +"gbarO2 = 0\n", +"gbarCO2 = -394380\n", +"gbarH2O = -228590\n", +"yO2 = 0.2035\n", +"yCO2 = 0.0003\n", +"yH2O = 0.0312\n", +"M = 114.22 // molecular weight of liquid octane\n", +"// Calculations\n", +"ech = ((gbarC8H18 + 12.5*gbarO2 -8*gbarCO2 -9*gbarH2O) + Rbar*Tnot*log(yO2**12.5/(yCO2**8*yH2O**9 )))/M\n", +"// Result\n", +"printf( ' Part(a) the chemical exergy obtained on a unit mass basis is: %.2f kJ/K',ech)\n", +"// Part(b)\n", +"// With data from Table A-25 and Model II of Table A-26\n", +"gbarH2O = -237180.0\n", +"ebarCO2 = 19870.0\n", +"ebarH2O = 900.0\n", +"ebarO2 = 3970.0\n", +"// Calculation\n", +"ech = ((gbarC8H18 + 12.5*gbarO2 -8*gbarCO2 - 9*gbarH2O) + 8*ebarCO2 + 9*ebarH2O - 12.5*ebarO2)/M\n", +"// Result\n", +"printf( ' Part(b) chemical exergy on a unit mass basis is: %.3f kJ/K',ech)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.13: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"Tnot = 298.0 // in kelvin\n", +"// With data from the steam tables\n", +"h = 2939.9 // in kj/kg\n", +"hnot = 104.9 // in kj/kg\n", +"s = 7.2307 // in kj/kg\n", +"snot = 0.3674 // in kj/kg\n", +"// With data from Table A-25\n", +"gbarH2Oliq = -237180.0\n", +"gbarH2Ogas = -228590.0\n", +"yeH2O = 0.0303\n", +"M =18.0 // molar mass of steam\n", +"// Calculations\n", +"ech = (1.0/M)*(gbarH2Oliq-gbarH2Ogas + Rbar*Tnot*log(1/yeH2O)) // in kj/kg\n", +"ef = h-hnot-Tnot*(s-snot) + ech // in kj/kg\n", +"// Result\n", +"printf( ' The flow exergy of the steam, in is: %.2f kJ/kg ',ef)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.14: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// For 140% theoretical air, the reaction equation for complete combustion of methane is\n", +"// CH4 + 2.8(O2 + 3.76N2) ------ CO2 + 2H2O + 10.53N2 + .8O2\n", +"// For product side\n", +"yCO2p = 1.0/(1.0+2.0+10.53+.8)\n", +"yH2Op = 2.0/(1.0+2.0+10.53+.8)\n", +"yN2p = 10.53/(1.0+2.0+10.53+.8)\n", +"yO2p = 0.8/(1.0+2.0+10.53+.8)\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"Tnot = 298.15 // in kelvin\n", +"yeN2 = 0.7567\n", +"yeO2 = 0.2035\n", +"yeH2O = 0.0303\n", +"yeCO2 = 0.0003\n", +"// Calculations\n", +"ebarch = Rbar*Tnot*(log(yCO2p/yeCO2) + 2*log(yH2Op/yeH2O) + 10.53*log(yN2p/yeN2) + .8*log(yO2p/yeO2))\n", +"// with data from tables A-23 at 480 and 1560 kelvin,the thermomechanical contribution to the flow exergy, per mole of fuel, is\n", +"contri480 = 17712.0 // kJ per kmol of fuel\n", +"contri1560 = 390853.0 // kJ per kmol of fuel\n", +"efbar480 = contri480 + ebarch // kJ per kmol of fuel\n", +"efbar1560 = contri1560 + ebarch // kJ per kmol of fuel\n", +"// Results\n", +"printf( ' At T= 480k, the flow exergy of the combustion products, in kJ per kmol of fuel is: %.2f',efbar480)\n", +"printf( ' At T = 1560K, the flow exergy of the combustion products, in kJ per kmol of fuel is: %.2f',efbar1560)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.15: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"mFdot = 1.8e-3 // fuel mass flow rate in kg/s\n", +"ech = 47346.0 // in kj/kg, from example 13.12(a)\n", +"Wcvdot = 37.0 // power developed by the engine in kw\n", +"// Calculations\n", +"Efdot = mFdot*ech // rate at which exergy enters with the fuel in kw\n", +"epsilon = Wcvdot/Efdot // exergetic efficiency\n", +"// Result\n", +"printf( ' The exergetic efficiency is: %.3f',epsilon)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.16: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Tnot = 298 // in kelvin\n", +"// For the case of complete combustion with the theoretical amount of air\n", +"sigmadot = 5404.0 // rate of entropy production from example 13.9, in kj/kmol.K\n", +"Efdot = 5407843.0 // rate at which exergy enters with the fuel from example 13.12, in kj/kmol\n", +"// Calculations:-\n", +"Eddot = Tnot*sigmadot // in kj/kmol\n", +"epsilon = 1-Eddot/Efdot\n", +"// Result\n", +"printf( ' The exergetic efficiency with theoretical amount of air is: %.3f',epsilon)\n", +"// For the case of combustion with 400% theoretical air\n", +"sigmadot = 9754.0 // rate of entropy production from example 13.9, in kj/kmol.K\n", +"// Calculations\n", +"Eddot = Tnot*sigmadot // in kj/kmol\n", +"epsilon = 1-Eddot/Efdot\n", +"// Result\n", +"printf( 'The exergetic efficiency with 400 percent theoretical amount of air is: %.3f ',epsilon)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"// The combustion equation can be written in the form of \n", +"// C8H18 + a(O2 + 3.76N2) - b CO2 + c H2O + d N2\n", +"// Using conservation of mass principle\n", +"b = 8.00\n", +"c = 18.00/2.00\n", +"a = (2.00*b+c)/2.00\n", +"d = 3.76*a\n", +"// The air–fuel ratio on a molar basis is\n", +"AFbar = a*(1+3.76)/1.00\n", +"Ma = 28.97 // molar mass of air\n", +"MC8H18 = 114.22 // molar mass of C8H18\n", +"// The air–fuel ratio expressed on a mass basis is\n", +"AF = AFbar*(Ma/MC8H18)\n", +"// Result\n", +"printf( ' The air–fuel ratio on a molar basis is: %f', AFbar);\n", +"printf( ' The air–fuel ratio expressed on a mass basis is: %.2f',AF)\n", +"// Part(b)\n", +"// For 150% theoretical air, the chemical equation for complete combustion takes the form\n", +"// c8H18 + 1.5*12.5*(O2 + 3.76N2) -- b CO2 + c H2O + d N2 + e O2\n", +"// Using conservation of mass\n", +"// Calculations\n", +"b = 8.00\n", +"c =18.00/2.00\n", +"e = (1.5*12.5*2 - c -2*b)/2.00\n", +"d = 1.5*12.5*3.76\n", +"// The air–fuel ratio on a molar basis is\n", +"AFbar = 1.5*12.5*(1+3.76)/1\n", +"// The air–fuel ratio expressed on a mass basis is\n", +"AF = AFbar*(Ma/MC8H18)\n", +"// Results\n", +"printf( ' The air–fuel ratio on a molar basis is: %f', AFbar)\n", +"printf( ' The air–fuel ratio expressed on a mass basis is: %.2f',AF)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"// The chemical equation\n", +"// a CH4 + b*(O2 + 3.76N2) -- 9.7CO2 + .5CO + 2.95O2 + 86.85N2 + cH2O\n", +"// Calculations\n", +"// Applying conservation of mass \n", +"a = 9.7 + 0.5\n", +"c = 2.0*a\n", +"b = ((9.7)*(2.0)+(0.5)+((2.0)*(2.95))+c)/2.00\n", +"Ma = 28.97 // molar mass of air\n", +"MCH4 = 16.04 // molar mass of methane\n", +"// On a molar basis, the air–fuel ratio is\n", +"AFbar = (b*(1+3.76))/a\n", +"// On a mass basis\n", +"AF = AFbar*(Ma/MCH4)\n", +"// Results\n", +"printf( ' The air-fuel ratio on a molar basis is: %f',AFbar)\n", +"printf( ' The air-fuel ratio on a mass basis is: %.2f',AF)\n", +"// Part(b)\n", +"// The balanced chemical equation for the complete combustion of methane with the theoretical amount of air is\n", +"// CH4 + 2(O2 + 3.76N2) -- CO2 + 2H2O + 7.52N2\n", +"// The theoretical air–fuel ratio on a molar basis is\n", +"// Calculations\n", +"AFbartheo = 2.00*(1+3.76)/1.0\n", +"// The percent theoretical air is\n", +"Ta = AFbar/AFbartheo\n", +"// Result\n", +"printf( ' The percent theoretical air is: %.2f',Ta*100)\n", +"// Ppart(c)\n", +"// The mole fraction of the water vapor is\n", +"yv = 20.4/(100+20.4)\n", +"pv = yv*1\n", +"// Interpolating in Table A-2,\n", +"T = 57 // in degree celcius\n", +"// Result\n", +"printf( ' The dew point temperature of the products, in C, if the mixture were cooled at 1 atm is: %f',T);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"// The chemical equation\n", +"// (.8062CH4 + .0541C2H6 + .0187C3H8 + .0160C4H10 + .1050N2) + a(O2 + 3.76N2) --- b(.078CO2 + .002CO + .07O2 + .85N2) + c H2O\n", +"// Calculations\n", +"// Using mass conservation\n", +"b = (0.8062 + 2*.0541 + 3*.0187 + 4*.0160)/(.078 + .002)\n", +"c = (4*.8062 + 6*.0541 + 8*.0187 + 10*.0160)/2\n", +"a = (b*(2*.078+.002+2*.07) + c)/2\n", +"// The air–fuel ratio on a molar basis is\n", +"AFbar = a*(1+3.76)/1\n", +"// Result\n", +"printf( ' The air-fuel ratio on a molar mass basis is: %.2f',AFbar)\n", +"// Part(b)\n", +"p = 1.0 // in bar\n", +"V = 100.0 // in m^3\n", +"Rbar = 8314.0 // in N.m/kmol.K\n", +"T = 300.0 // in kelvin\n", +"// Calculations\n", +"// The amount of fuel in kmol\n", +"nF = (p*10**5*V)/(Rbar*T)\n", +"// The amount of product mixture that would be formed from 100 m3 of fuel mixture is\n", +"n = nF*(b+c)\n", +"// Result\n", +"printf( ' The amount of products in kmol that would be formed from 100 m3 of fuel mixture at 300 K and 1 bar is: %.2f',n)\n", +"// Part(c)\n", +"// The balanced chemical equation for the complete combustion of the fuel mixture with the theoretical amount of air is\n", +"// (10.8062CH4 + 0.0541C2H6 + 0.0187C3H8 + 0.0160C4H10 + 0.1050N2) + 2(O2 + 3.76N2) --- 1.0345CO2 + 1.93H2O + 7.625N2\n", +"// Calculations\n", +"// The theoretical air–fuel ratio on a molar basis is\n", +"AFbartheo = 2*(1+3.76)/1\n", +"// The percent theoretical air is\n", +"Ta = AFbar/AFbartheo\n", +"// Result\n", +"printf( ' The percent of theoretical air is: %.2f ',Ta*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// The balanced chemical equation for complete combustion with the theoretical amount of air is obtained from the solution to Example 13.1 as\n", +"// C8H18 +12.5O2 + 47N2 ---- 8CO2 + 9H2O + 47N2\n", +"// From tabel A-25\n", +"hRbar = -249910 // in kj/kmol\n", +"mfdot = 1.8e-3 // mass flow rate of liquid octane in kg/s\n", +"M = 114.22 // molar mass of octane\n", +"Wcvdot = 37 // power output of the engine in kw\n", +"// Calculations\n", +"// With enthalpy of formation values for CO2 and H2O(g) from Table A-25, and enthalpy values for N2, H2O, and CO2 from Table A-23\n", +"hpbar = 8*(-393520 + (36876 - 9364)) + 9*(-241820 + (31429 - 9904)) + 47*((26568 - 8669))\n", +"nFdot = mfdot/M // molar flow rate of the fuel in kmol/s\n", +"Qcvdot = Wcvdot + nFdot*(hpbar-hRbar) // in kw\n", +"// Result\n", +"printf( ' The rate of heat transfer from the engine, in kW is: %.2f',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// When expressed on a per mole of fuel basis, the balanced chemical equation obtained in the solution to Example 13.2 takes the form\n", +"// CH4 + 2.265O2 + 8.515N2 ----- .951CO2 + .049CO + .289O2 + 8.515N2 + 2H2O\n", +"cpbar = 38.00 // specific heat in KJ/kmol.K\n", +"// From table A-25\n", +"hfnotbar = -74850.00 // enthalpy of formation for methane\n", +"// From table A-23\n", +"deltahbarO2 = 14770-8682\n", +"deltahbarN2 = 14581-8669\n", +"// Calculations\n", +"hRbar = hfnotbar + cpbar*(400-298) + 2.265*deltahbarO2 + 8.515*deltahbarN2 // in kj/kmol\n", +"// With enthalpy of formation values for CO2, CO, and H2O(g) from Table A-25 and enthalpy values from Table A-23\n", +"hpbar = .951*(-393520 + (88806 - 9364)) + .049*(-110530 + (58191 - 8669)) + .289*(60371 - 8682) + 8.515*(57651 - 8669) + 2*(-241820 + (72513 - 9904))\n", +"Qcvdot = hpbar - hRbar // in kj/kmol\n", +"// Result\n", +"printf( ' The rate of heat transfer from the combustion chamber in kJ per kmol of fuel is: %.2f',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"nCH4 = 1.00 // moles of methane in kmol\n", +"nO2 = 2.00 // moles of oxygen in kmol\n", +"T1 = 25.00 // in degree celcius\n", +"p1 = 1.00 // in atm\n", +"T2 = 900.00 // in kelvin\n", +"Rbar = 8.314 // universal gas constant\n", +"// The chemical reaction equation for the complete combustion of methane with oxygen is\n", +"// CH4 + 2O2 --- CO2 + 2H2O\n", +"// Part(a)\n", +"// with enthalpy of formation values from table A-25\n", +"hfbarCO2 = -393520\n", +"hfbarH2O = -241820\n", +"hfbarCH4 = -74850\n", +"// Calculations\n", +"// with enthalpy values from table A-23\n", +"deltahbarCO2 = 37405-9364\n", +"deltahbarH2O = 31828-9904\n", +"Q = ((hfbarCO2 + deltahbarCO2)+2*(hfbarH2O + deltahbarH2O) - hfbarCH4) + 3*Rbar*(T1+273-T2)\n", +"// Result\n", +"printf( ' The amount of heat transfer in kJ is: %.2f', Q)\n", +"// Part(b)\n", +"p2 = p1*(T2/(T1+273)) // in atm\n", +"// Result\n", +"printf( ' The final pressure in atm is: %.2f',p2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// The combustion equation is\n", +"// CH4 + 2O2 + 7.52N2 --- CO2 + 2H2O + 7.52N2\n", +"// Part(a)\n", +"// With enthalpy of formation values from Table A-25\n", +"hfbarCO2 = -393520 // in kj/kmol\n", +"hfbarH2O = -285830 // in kj/kmol\n", +"hfbarCH4 = -74850 // in kj/kmol\n", +"M = 16.04 // molar mass of CH4 in kg/kmol\n", +"// Calculations\n", +"hRPbar = hfbarCO2 + 2*hfbarH2O - hfbarCH4 // in kj/kmol\n", +"hRP = hRPbar/M // in kj/kg\n", +"// Result\n", +"printf( ' Part(a)the enthalpy of combustion of gaseous methane, fuel is: %f kJ/kg.',hRP)\n", +"// Part(b)\n", +"hfbarCO2 = -393520 // in kj/kmol\n", +"hfbarH2O = -241820 // in kj/kmol\n", +"hfbarCH4 = -74850 // in kj/kmol\n", +"// Calculations\n", +"hRPbar = hfbarCO2 + 2*hfbarH2O - hfbarCH4 // in kj/kmol\n", +"hRP = hRPbar/M // in kj/kg\n", +"// Result\n", +"printf( ' Part(b)the enthalpy of combustion of gaseous methane, fuel is: %f kJ/kg',hRP);\n", +"// Part(c)\n", +"// From table A-23\n", +"deltahbarO2 = 31389-8682 // in kj/kmol\n", +"deltahbarH2O = 35882-9904 // in kj/kmol\n", +"deltahbarCO2 = 42769-9364 // in kj/kmol\n", +"// Using table A-21\n", +"// Calculations\n", +"// function cpbar = f(T)\n", +"T=298 // in kelvin\n", +"function T = cpbar(T)\n", +" T = (3.826 - (3.979e-3)*T + 24.558e-6*T**2 - 22.733e-9*T**3 + 6.963e-12*T**4)*8.314\n", +"endfunction\n", +"deltahbarCH4 = intg(298,1000,cpbar)\n", +"var = deltahbarCH4(1)\n", +"hRPbar = hRPbar + (deltahbarCO2 + 2*deltahbarH2O - var -2*deltahbarO2)\n", +"hRP = hRPbar/M // in kj/kg\n", +"// Result\n", +"printf( ' Part(c)the enthalpy of combustion of gaseous methane, per kg of fuel is %.f kJ/kg',hRP);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"// For combustion of liquid octane with the theoretical amount of air, the chemical equation is\n", +"// C8H18(l) + 12.5 O2 + 47N2 ------ 8 CO2 + 9 H2O(g) + 47N2\n", +"// with enthalpy of formation data from Table A-25\n", +"hfbarC8H18 = -249910.0 // in kj/kmol\n", +"hfbarCO2 = -393520.0\n", +"hfbarH2O = -241820.0\n", +"// Calculations\n", +"RHS = hfbarC8H18 -(8*hfbarCO2 + 9*hfbarH2O) // in kj/kmol\n", +"// at temperature 2400k\n", +"LHS1 = 5089337.0 // in kj/kmol\n", +"// at temperature 2350 k\n", +"LHS2 = 4955163.0 // in kj/kmol\n", +"// Interpolation between these temperatures gives\n", +"Tp = 2400.00 + ((2400.0-2350.0)/(LHS1-LHS2))*(RHS-LHS1)\n", +"// Result\n", +"printf( ' The temperature in kelvin with theoretical amount of air is: %.2f', Tp)\n", +"// Part(b)\n", +"// For complete combustion of liquid octane with 400% theoretical air, the chemical equation is\n", +"// C8H18(l) + 50O2 + 188N2 ------- 8CO2 + 9H2O + 37.5O2 + 188N2\n", +"// Proceeding iteratively as part(a)\n", +"Tp = 962 // in kelvin\n", +"// Result\n", +"printf( ' The temperature in kelvin using 400 percent theoretical air is: %.2f ',Tp)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"Tp = 2395 // in kelvin, from example 13.8\n", +"// For combustion of liquid octane with the theoretical amount of air, the chemical equation is\n", +"// C8H18(l) + 12.5O2 + 47N2 --- 8CO2 + 9H2O(g) + 47N2\n", +"// From table A-25\n", +"sFbar = 360.79 // absolute entropy of liquid octane in kj/kmol.K\n", +"// From table A-23\n", +"// For reactant side\n", +"sbarO2atTref = 205.03 // in kj/kmol.K\n", +"sbarN2atTref = 191.5 // in kj/kmol.K\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"yO2 = 0.21\n", +"yN2 = 0.79\n", +"// For product side\n", +"yCO2 = 8.0/64.0\n", +"yH2O = 9.0/64.0\n", +"yN2p = 47.0/64.0\n", +"// Calculations\n", +"sbarO2 = sbarO2atTref - Rbar*log(yO2) // in kj/kmol.K\n", +"sbarN2 = sbarN2atTref - Rbar*log(yN2) // in kj/kmol.K\n", +"// With the help from table A-23\n", +"sbarCO2 = 320.173 - Rbar*log(yCO2)\n", +"sbarH2O = 273.986 - Rbar*log(yH2O)\n", +"sbarN2p = 258.503 - Rbar*log(yN2p)\n", +"sigmadot = (8*sbarCO2 + 9*sbarH2O + 47*sbarN2p) - sFbar - (12.5*sbarO2 + 47*sbarN2)\n", +"// Result\n", +"printf( ' The rate of entropy production, in kJ/K per kmol of fuel with theoretical amount of air is: %.2f',sigmadot)\n", +"// Part(b)\n", +"// The complete combustion of liquid octane with 400% theoretical air is described by the following chemical equation:\n", +"// C8H18(l) + 50 O2 + 188N2 ---- 8 CO2 + 9H2O(g) + 37.5O2 + 188N2\n", +"// For product side \n", +"yCO2 = 8.0/242.5\n", +"yH2O = 9.0/242.5\n", +"yO2 = 37.5/242.5\n", +"yN2p = 188.0/242.5\n", +"// Calculations\n", +"// With help from table A-23\n", +"sbarCO2 = 267.12 - Rbar*log(yCO2)\n", +"sbarH2O = 231.01 - Rbar*log(yH2O)\n", +"sbarO2p = 242.12 - Rbar*log(yO2)\n", +"sbarN2p = 226.795 - Rbar*log(yN2p)\n", +"sigmadot = (8.0*sbarCO2 + 9.0*sbarH2O + 37.5*sbarO2p +188.0*sbarN2p) -sFbar - (50.0*sbarO2 + 188.0*sbarN2)\n", +"// Result\n", +"printf( ' The rate of entropy production, in kJ/K per kmol of fuel with 400 percent theoretical air is: %.2f ', sigmadot)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/14-Chemical_and_Phase_Equilibrium.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/14-Chemical_and_Phase_Equilibrium.ipynb new file mode 100644 index 0000000..1de8cbe --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/14-Chemical_and_Phase_Equilibrium.ipynb @@ -0,0 +1,317 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Chemical and Phase Equilibrium" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// With data from Table A-2 at 20C,\n", +"vf = 1.0018e-3 // in m^3/kg\n", +"psat = 0.0239 // in bar\n", +"p = 1.0 // in bar\n", +"T = 293.15 // in kelvin\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"M = 18.02 // molat mass of water in kg/kmol\n", +"e=2.715\n", +"// Calculations\n", +"pvbypsat = e**(vf*(p-psat)*10**5/((1000*Rbar/M)*T))\n", +"percent = (pvbypsat-1)*100\n", +"// Result\n", +"printf( ' The departure, in percent, of the partial pressure of the water vapor from the saturation pressure of water at 20 is: %.3f',percent)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// The reaction is CO + .5O2 --- CO2\n", +"// Part(a)\n", +"T = 298.0 // in kelvin\n", +"Rbar = 8.314 // universal gas constant in SI units\n", +"// From table A-25\n", +"hfbarCO2 = -393520.0 // in kj/kmol\n", +"hfbarCO = -110530.0 // in kj/kmol\n", +"hfbarO2 = 0 // in kj/kmol\n", +"deltahbarCO2 = 0 // in kj/kmol\n", +"deltahbarCO = 0 // in kj/kmol\n", +"deltahbarO2 = 0 // in kj/kmol\n", +"sbarCO2 = 213.69 // in kj/kmol.K\n", +"sbarCO = 197.54 // in kj/kmol.K\n", +"sbarO2 = 205.03 // in kj/kmol.K\n", +"// From table A-27\n", +"logKtable = 45.066\n", +"// Calculations\n", +"deltaG = (hfbarCO2-hfbarCO-.5*hfbarO2) + (deltahbarCO2-deltahbarCO-.5*deltahbarO2) - T*(sbarCO2-sbarCO-.5*sbarO2)\n", +"lnK = -deltaG/(Rbar*T)\n", +"logK = (1/log(10))*lnK\n", +"// Results\n", +"printf( ' Part(a) the value of equilibrium constant expressed as log10K is: %f',logK);\n", +"printf( ' The value of equilibrium constant expressed as log10K from table A-27 is: %f ',logKtable);\n", +"// Part(b)\n", +"T = 2000.0 // in kelvin\n", +"// From table A-23\n", +"hfbarCO2 = -393520.0 // in kj/kmol\n", +"hfbarCO = -110530.0 // in kj/kmol\n", +"hfbarO2 = 0 // in kj/kmol\n", +"deltahbarCO2 = 100804-9364 // in kj/kmol\n", +"deltahbarCO = 65408 - 8669 // in kj/kmol\n", +"deltahbarO2 = 67881 - 8682 // in kj/kmol\n", +"sbarCO2 = 309.210 // in kj/kmol.K\n", +"sbarCO = 258.6 // in kj/kmol.K\n", +"sbarO2 = 268.655 // in kj/kmol.K\n", +"// Calculations\n", +"deltaG = (hfbarCO2-hfbarCO-.5*hfbarO2) + (deltahbarCO2-deltahbarCO-.5*deltahbarO2) - T*(sbarCO2-sbarCO-.5*sbarO2)\n", +"lnK = -deltaG/(Rbar*T)\n", +"logK = (1/log(10))*lnK\n", +"// From table A-27\n", +"logKtable = 2.884\n", +"// Results\n", +"printf( ' Part(b) the value of equilibrium constant expressed as log10K is: %f ',logK);\n", +"printf( ' The value of equilibrium constant expressed as log10K from table A-27 is: %f ',logKtable);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Applying conservation of mass, the overall balanced chemical reaction equation is\n", +"// CO + .5O2 ------ zCO + (z/2)O2 + (1-z)CO2\n", +"// At 2500 K, Table A-27 gives\n", +"log10K = -1.44\n", +"// Part(a)\n", +"p = 1.0 // in atm\n", +"// Calculations\n", +"K = (10.0)**(log10K) // equilibrium constant\n", +"// Solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives\n", +"z = 0.129\n", +"yCO = 2.0*z/(2.0 + z)\n", +"yO2 = z/(2.0 + z)\n", +"yCO2 = 2.0*(1.0 - z)/(2.0 + z)\n", +"// Results\n", +"printf( ' Part(a) mole fraction of CO is: %.3f ',yCO)\n", +"printf( ' Mole fraction of O2 is: %.3f',yO2)\n", +"printf( ' Mole fraction of CO2 is: %.3f',yCO2)\n", +"// Part(b)\n", +"p = 10.0 // in atm\n", +"// Solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives\n", +"z = 0.062\n", +"yCO = 2.0*z/(2.0 + z)\n", +"yO2 = z/(2.0 + z)\n", +"yCO2 = 2.0*(1.0 - z)/(2.0 + z)\n", +"// Results\n", +"printf( ' Part(b) mole fraction of CO is: %.3f',yCO)\n", +"printf( ' Mole fraction of O2 is: %.3f',yO2)\n", +"printf( ' Mole fraction of CO2 is: %.3f ',yCO2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"yCO = 0.298\n", +"p = 1 // in atm\n", +"pref = 1 // in atm\n", +"// With this value of K, table A-27 gives\n", +"T = 2881\n", +"// Calculations\n", +"// Solving yCO = 2z/(2 + z)\n", +"z = 2*yCO/(2 - yCO)\n", +"K = (z/(1-z))*(z/(2 + z))**.5*(p/pref)**.5\n", +"// Result\n", +"printf( ' The temperature T of the mixture in kelvin is: %f',T);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// For a complete reaction of CO with the theoretical amount of air\n", +"// CO + .5 O2 + 1.88N2 ---- CO2 + 1.88N2 \n", +"// Accordingly, the reaction of CO with the theoretical amount of air to form CO2, CO, O2, and N2 is\n", +"// CO + .5O2 + 1.88N2 -- zCO + z/2 O2 + (1-z)CO2 + 1.88N2\n", +"K = 0.0363 // equilibrium constant the solution to Example 14.2\n", +"p =1.0 // in atm\n", +"pref = 1.0 // in atm\n", +"// Calculations\n", +"// Solving K = (z*z^.5/(1-z))*((p/pref)*2/(5.76+z))^.5 gives\n", +"z = 0.175\n", +"yCO = 2.0*z/(5.76 + z)\n", +"yO2 = z/(5.76 + z)\n", +"yCO2 = 2.0*(1.0-z)/(5.76 + z)\n", +"yN2 = 3.76/(5.76 + z)\n", +"// Results\n", +"printf( ' The mole fraction of CO is: %.3f ',yCO)\n", +"printf( ' The mole fraction of O2 is: %.3f ',yO2)\n", +"printf( ' The mole fraction of CO2 is: %.3f',yCO2)\n", +"printf( ' The mole fraction of N2 is: %.3f',yN2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Applying the conservation of mass principle, the overall dissociation reaction is described by\n", +"// CO2 --- zCO2 + (1-z)CO + ((1-z)/2)O2\n", +"p = 1.0 // in atm\n", +"pref = 1.0 // in atm\n", +"// At 3200 K, Table A-27 gives\n", +"log10k = -.189\n", +"// Solving k = ((1-z)/2)*((1-z)/(3-z))^.5 gives\n", +"z = 0.422\n", +"// Calculations\n", +"k = 10**log10k\n", +"// From tables A-25 and A-23\n", +"hfbarCO2 = -393520.0 // in kj/kmol\n", +"deltahbarCO2 = 174695-9364 // in kj/kmol\n", +"hfbarCO = -110530.0 // in kj/kmol\n", +"deltahbarCO = 109667-8669 // in kj/kmol\n", +"hfbarO2 = 0 // in kj/kmol\n", +"deltahbarO2 = 114809-8682 // in kj/kmol\n", +"hfbarCO2r = -393520.0 // in kj/kmol\n", +"deltahbarCO2r = 0 // in kj/kmol\n", +"Qcvdot = 0.422*(hfbarCO2 + deltahbarCO2) + 0.578*(hfbarCO + deltahbarCO) + 0.289*(hfbarO2 + deltahbarO2)- (hfbarCO2r + deltahbarCO2r) \n", +"// Result\n", +"printf( ' The heat transfer to the reactor, in kJ per kmol of CO2 entering is: %f', Qcvdot);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// The ionization of cesium to form a mixture of Cs, Cs+, and e- is described by\n", +"// Cs --- (1-z)Cs + zCs+ + Ze-\n", +"K = 15.63\n", +"z = 0.95\n", +"pref =1 // in atm\n", +"// Calculation\n", +"p = pref*K*((1-z**2)/z**2)\n", +"// Results\n", +"printf( ' The pressure if the ionization of CS is 95 percent complete is: %f atm',p);\n", +"x = linspace(0,10,100)\n", +"for i = 1:100\n", +" y(i)= 100*((1/(1+x(i)/K))**0.5)\n", +"end\n", +"plot(x,y)\n", +"xlabel('Pressure (atm)')\n", +"ylabel('Ionization')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/2-Energy_and_the_First_Law_of_Thermodynamics.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/2-Energy_and_the_First_Law_of_Thermodynamics.ipynb new file mode 100644 index 0000000..6b1d537 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/2-Energy_and_the_First_Law_of_Thermodynamics.ipynb @@ -0,0 +1,269 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Energy and the First Law of Thermodynamics" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 3*(10**5) // initial pressure of gas in pascal\n", +"v1 = 0.1 // initial volumme of gas in meter^3\n", +"v2 = 0.2 // final volume of gas in meter^3\n", +"// calculations\n", +"// Part (a) i.e. n=1.5\n", +"//constant = p1*(v1**n) // p*(v^n) = constant\n", +"constant1 = p1*(v1**1.5) \n", +"constant2 = p1*(v1**1) \n", +"constant3 = p1*(v1**0) \n", +"// function p \n", +"function v = p1(v)\n", +" v = constant1/(v^1.5)\n", +"endfunction\n", +"function v = p2(v)\n", +" v = constant2/(v^1)\n", +"endfunction\n", +"function v = p3(v)\n", +" v = constant3/(v^0)\n", +"endfunction\n", +"work1 = intg(v1,v2,p1) // integrating pdv from initial to final volume \n", +"w1 = work1(1)/1000 // divided by 1000 to convert to KJ\n", +"printf( 'The work done for n=1.5 in KJ is %.2f',w1)\n", +"//part(b) i.e. n = 1\n", +"work2 = intg(v1,v2,p2)\n", +"w2 = work2(1)/1000\n", +"printf( 'The work done for n=1 in KJ is %.2f',w2)\n", +"//part(c) i.e. n=0\n", +"work3 = intg(v1,v2,p3)\n", +"w3 = work3(1)/1000\n", +"printf( 'The work done for n=0 in KJ is %.2f',w3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 3*(10**5) // initial pressure in pascal\n", +"v1 = 0.1 // initial volume in m3\n", +"v2 = 0.2 // final volume\n", +"m = 4.0 // mass of the gas in kg\n", +"deltau = -4.6 // change in specific internal energy in KJ/Kg\n", +"// Calculations\n", +"constant = p1*(v1**1.5) // p*(v^n) = constant\n", +"function v = p(v)\n", +" v = constant/(v**1.5) // expressing pressure as function of volume \n", +"endfunction\n", +"work = intg(v1,v2,p) // integrating pdv from initial to final volume \n", +"w=work(1)/1000 // divided by 1000 to convert to KJ\n", +"deltaU = m*deltau // change in internal energy in KJ\n", +"Q = deltaU + w // neglecting kinetic and potential energy changes\n", +"// Result\n", +"printf( 'net heat transfer for the process in KJ %.2f',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"clc;\n", +"patm = 10**5 // atmospheric pressure in pascal.\n", +"mp = 45.0 // mass of piston in Kg\n", +"A = 0.09 // face area of piston in m2\n", +"deltaV = 0.045 // increment of the volume of air in m3\n", +"m = 0.27 // mass of air in kg\n", +"deltau = 42.0 // specific internal energy increase of air in kJ/kg\n", +"g = 9.81 // local acceleration of gravity\n", +"// Part (a) i.e. air is system\n", +"// Calculations\n", +"p = (mp*g)/A + patm // constant pressure of air obtained from equilibrium of piston\n", +"w = (p*deltaV)/1000 // work done in KJ\n", +"deltaU = m*deltau // internal energy change of air in KJ\n", +"Q = w + deltaU // applying first with air as system\n", +"// Result\n", +"printf( '\nheat transfer from resistor to air in KJ for air alone as system is: %.2f',Q)\n", +"// The answer given in book is incorrect. deltaU is incorrect in book. \n", +"// Part(b) i.e. (air+piston) is system\n", +"// Calculations\n", +"wd = (patm*deltaV)/1000 // work done in KJ\n", +"deltaz = (deltaV)/A // change in elevation of piston\n", +"deltaPE = (mp*g*deltaz)/1000 // change in potential energy of piston in KJ\n", +"Qt = wd + deltaPE + deltaU // applying first law with air plus piston as system \n", +"// Result\n", +"printf( '\nheat transfer from resistor to air in KJ for air + piston as system is: %.2f',Qt)\n", +"// note : The answer given in book is incorrect.They have miscalculated deltaU. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"w1dot = -60.0 // input work rate in KW\n", +"h = 0.171 // heat transfer coefficient,unit in KW/m2 .K\n", +"A = 1.0 // outer surface area of gearbox, unit in m2\n", +"Tb = 300.0 // outer surface temperature in kelvin\n", +"Tf = 293.0 // temperature of the sorrounding\n", +"// Calculations\n", +"Qdot = -h*A*(Tb-Tf); // rate of energy transfer by heat\n", +"wdot = Qdot; // steady state energy equation\n", +"w2dot = wdot-w1dot;\n", +"// Results\n", +"printf( 'The heat transfer rate in KW is:\n\tQdot = %f',Qdot)\n", +"printf( 'The power delivered through output shaft in KW is: = %f',w2dot);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"s=5*(10**-3) // measurement on a side in meter\n", +"wdot = -0.225 // power input in watt\n", +"Tf = 293.0 // coolant temprature in kelvin\n", +"h = 150.0 // heat transfer coefficient in w/m2 k\n", +"A = s**2 // surface area\n", +"// Calculation\n", +"Tb = ((-wdot/(h*A)) + Tf - 273) // surface temperature in degree\n", +"// Result\n", +"printf( 'The surface temperature of the chip in degree celcius is: %f ',Tb);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"omega = 100.0 //motor rotation speed in rad/s\n", +"tau = 18.0 //torque applied by shaft in N.m\n", +"Welecdot = -2.0 //electric power input in KW\n", +"Wshaftdot = (tau*omega)/1000 //shaft work rate in KW\n", +"Wdot = Welecdot + Wshaftdot //net work rate in KW\n", +"//function [Qdot]=f(t)\n", +"//Qdot = (-0.2)* [1-2**(-0.05*t)]\n", +"//function [Edot]=f1(t) //function for rate of change of energy\n", +"//Edot = (-0.2)*[1-2**(-0.05*t)] - Wdot \n", +"//function [deltaE] =f2(t) //function for change in energy \n", +"t = linspace(0,120,100);\n", +"for i = 1:100\n", +" Qd(i) = i\n", +" Wd(i) = i\n", +" dltaE(i) = i \n", +" Qd(i) = (-0.2*(1-%e^(-0.05*t(i)))) \n", +" Wd(i) = Wdot \n", +" dltaE(i) = 4*(1 - %e^(-0.05*t(i)))\n", +"end\n", +"subplot(2,2,1) \n", +"plot(t,Qd)\n", +"xlabel('Time (s)')\n", +"ylabel('Qdot (KW)')\n", +"subplot(2,2,2)\n", +"plot(t,Wd)\n", +"xlabel('Time (s)')\n", +"ylabel('Wdot (KW)')\n", +"subplot(2,2,3)\n", +"plot(t,dltaE)\n", +"xlabel('Time (s)')\n", +"ylabel('deltaE (KJ)')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/3-Evaluating_Properties.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/3-Evaluating_Properties.ipynb new file mode 100644 index 0000000..a132b3b --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/3-Evaluating_Properties.ipynb @@ -0,0 +1,393 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Evaluating Properties" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 1.0 // initial pressure in bar\n", +"T1 = 295.0 // initial temperature in kelvin \n", +"p2 = 5.0 // final pressure in bar\n", +"n = 1.3 // polytropic constant\n", +"R = 8314/28.97 // gas constant for air in SI units\n", +"// From table A-22\n", +"u2 = 306.53\n", +"u1 = 210.49\n", +"// Calculations\n", +"T2 = T1*(p2/p1)**((n-1)/n)\n", +"w = R*(T2-T1)/(1-n)\n", +"Q = u2-u1+w/1000\n", +"// Results\n", +"printf( ' The work done per unit mass is %f KJ/kg.',w/1000)\n", +"printf( ' The heat transfer per unit mass is %f KJ/kg.',Q);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Those with 1 are of state 1 and 2 are with state 2\n", +"// State 1\n", +"p1 = 10**5 // initial pressure in pascal \n", +"x1 = 0.5 // initial quality\n", +"T1 = 99.63 // temperature in degree celcius, from table A-3\n", +"v = 0.5 // volume of container in m3\n", +"vf1 = 1.0432*(10**(-3)) // specific volume of fluid in state 1 in m3/Kg(from table A-3)\n", +"vg1 = 1.694 // specific volume of gas in state 1 in m3/kg(from table A-3)\n", +"// State 2\n", +"p2 = 1.5*(10**5) // pressure after heating in pascal\n", +"T2 = 111.4 // temperature in degree celcius in state 2, from A-3\n", +"vf2 = 1.0582*(10**(-3)) // specific volume of fluid in state 2 in m3/Kg, from A-3\n", +"vg2 = 1.159 // specific volume of gas in state 2 in m3/Kg,from A-3\n", +"// Calculations\n", +"v1 = vf1 + x1*(vg1-vf1) // specific volume in state 1 in m3/Kg\n", +"v2 = v1 // specific volume in state 2 in m3/Kg\n", +"m = v/v1 // total mass in Kg\n", +"mg1 = x1*m // mass of vapour in state 1 in Kg\n", +"x2 = (v1-vf2)/(vg2-vf2) // quality in state 2\n", +"mg2 = x2*m // mass of vapor in state 2 in Kg \n", +"// State 3\n", +"p3 = 2.11 // pressure in state 3 from table A-3\n", +"// Results\n", +"printf( ' The temperature in state 1 is %f degree celcius.',T1)\n", +"printf( ' The temperature in state 2 is %f degree celcius.',T2)\n", +"printf( ' The mass of vapour in state 1 is %.2f kg.',mg1) \n", +"printf( ' The mass of vapour in state 2 is %.2f kg.',mg2)\n", +"printf( ' The pressure corresponding to state 3 is %.2f bar',p3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m = 0.05 // mass of ammonia in kg \n", +"p1 = 1.5*(10**5) // initial pressure of ammonia in pascal\n", +"v1 = 0.7787 // specific volume in state 1 in m3/kg from table A-14\n", +"v2 = 0.9553 // specific volume in state 2 in m3/kg from table A-15\n", +"T2 = 25.0 // final temperature in degree celcius\n", +"// Calculations\n", +"V1 = m*v1 // volume occupied by ammonia in state 1 in m3\n", +"V2 = m*v2 // volume occupied by ammonia in state 2 in m3\n", +"w = (p1*(V2-V1))/1000 // work in KJ\n", +"// Results\n", +"printf( ' The volume occupied by ammonia in state 1 is %.2f m^3.',V1)\n", +"printf( ' The volume occupied by ammonia in state 2 is %.2f m^3',V2)\n", +"printf( ' The work done for the process is %.2f KJ',w)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"V = 0.25 // volume of tank in m3\n", +"v = 1.673 // specific volume in m3/kg obtained using table A-2\n", +"// State 1\n", +"T1 = 100.0 // initial temperature in degree celcius\n", +"u1 = 2506.5 // specific internal energy in state 1 in KJ/Kg obtained from table A-2\n", +"// State 2\n", +"p2 = 1.5 // final pressure in bars\n", +"T2 = 273.0 // temperature in state 2 in degree celcius obtained from table A-4\n", +"u2 = 2767.8 // specific internal energy in state 2 in KJ/Kg obtained from table A-4\n", +"// Calculations\n", +"m = V/v // mass of the system in kg\n", +"DeltaU = m*(u2-u1) // change in internal energy in KJ\n", +"W = - DeltaU // from energy balance\n", +"// Results\n", +"printf( ' The temperature at the final state in is %.2f degree celcius.',T2)\n", +"printf( ' The work during the process is %f KJ.',W);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// State \n", +"P1 = 10*(10**5) // initial pressure in pascal\n", +"T1 = 400.0 // initial temperature in degree celcius\n", +"v1 = 0.3066 // specific volume in state 1 in m3/kg obtained from table A-4\n", +"u1 = 2957.3 // specific internal energy in state 1 in KJ/Kg obtained from table A-4\n", +"// State 2\n", +"v2 = 0.1944 // specific volume in state 2 in m3/kg obtained from table A-3\n", +"w2to3 = 0 // work in process 2-3\n", +"// State 3 \n", +"v3 = v2\n", +"vf3 = 1.0905*(10**(-3)) // specific volume of fluid in state 3 from table A-2\n", +"vg3 = 0.3928 // specific volume of gas in state 3 from table A-2\n", +"uf3 = 631.68 // specific internal energy for fluid in state 3 from table A-2\n", +"ug3 = 2559.5 // specific internal energy for gas in state 3 from table A-2\n", +"// Calculations\n", +"w1to2 = (P1*(v2-v1))/1000 // work in KJ/Kg in process 1-2\n", +"W = w1to2 + w2to3 // net work in KJ/kg\n", +"x3 = (v3-vf3)/(vg3-vf3)\n", +"u3 = uf3+x3*(ug3-uf3) // specific internal energy in state 3 in Kj/Kg\n", +"q = (u3-u1) + W // heat transfer in Kj/Kg\n", +"// Results\n", +"printf( ' The work done in the overall process is %f KJ/kg.',W);\n", +"printf( ' The heat transfer in the overall process is %f KJ/kg.',q);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// State 1\n", +"p1 = 20.0 // initial pressure in MPa\n", +"T1 = 520.0 // initial temperature in degree celcius\n", +"Z1 = 0.83 // compressibility factor\n", +"R = 8.314 // universal gas constant in SI unit\n", +"n = 1000.0/18.02 // number of moles in a kg of water\n", +"// State 2\n", +"T2 = 400.0 // final temperature in degree celcius\n", +"// From table A-1\n", +"Tc = 647.3 // critical temperature in kelvin\n", +"pc = 22.09 // critical pressure in MPa\n", +"// Calculations\n", +"Tr = (T1+273)/Tc // reduced temperature\n", +"Pr = p1/pc // reduced pressure \n", +"v1 = (Z1*n*R*(T1+273))/(p1*(10**6))\n", +"vr = v1*(pc*(10**6))/(n*R*Tc)\n", +"Tr2 = (T2+273)/Tc\n", +"PR = 0.69 // at above vr and Tr2\n", +"P2 = pc*PR\n", +"// Results \n", +"printf( ' The specific volume in state1 is %f m3/kg and the corresponding value obtained from table A-4 is .01551 m^3/Kg',v1)\n", +"printf( ' The pressure in MPa in the final state is %f MPa and the corresponding value from the table is 15.16Mpa',P2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 //temperature in state 1 in kelvin\n", +"P1 = 1.00 //pressure in state 1 in bar\n", +"P2 = 2.00 //pressure in state 2 in bar\n", +"R = 287.00 //gas constant of air in SI units\n", +"// Calculations\n", +"v1 = (R*T1)/(P1*10**5) //specific volume in state 1\n", +"P = linspace(1,2,50)\n", +"for i = 1:50\n", +" v(i) = v1\n", +"end\n", +" \n", +"T2 = (P2*10**5*v1)/R\n", +"v3 = (R*T2)/(P1*10**5)\n", +"vv = linspace(v1,v3,50)\n", +"for i = 1:50\n", +" Pa(i) = P1\n", +"end\n", +"//function[out]= f(inp)\n", +"//out = (R*T2)/(inp\n", +"VV = linspace(v1,v3,50)\n", +"for j = 1:50\n", +" pp(j) = (R*T2)/VV(j)/(10**5)\n", +"end\n", +"vcommon = cat(1,v,VV')\n", +"pcommon = [P pp']\n", +"size(vcommon)\n", +"size(pcommon)\n", +"//subplot(211)\n", +"plot(vcommon,pcommon)\n", +"xlabel('v')\n", +"ylabel('p(bar)')\n", +"//subplot(212)\n", +"plot(vv,Pa)\n", +"xlabel('v')\n", +"ylabel('p(bar)')\n", +"//The two steps are shown in one graph and the other on is shown in the other graph'''\n", +"printf( 'The temperature in kelvin in state 2 is T2 = %f',T2)\n", +"printf( 'The specific volume in state 3 in m^3/kg is v = %f',v3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// State 1\n", +"m = 0.9 // mass of air in kg\n", +"T1 = 300.0 // initial temperature in kelvin\n", +"P1 = 1.0 // initial pressure in bar\n", +"// State 2\n", +"T2 = 470.0 // final temperature in kelvin\n", +"P2 = 6.0 // final pressure in bar\n", +"Q = -20.0 // heat transfer in kj\n", +"// From table A-22 \n", +"u1 = 214.07 // in KJ/kg\n", +"u2 = 337.32 // in KJ/Kg\n", +"// Calculations\n", +"deltaU = m*(u2-u1) // change in internal energy in kj\n", +"W = Q - deltaU // in KJ/kg\n", +"// Results\n", +"printf( ' The work during the process is %f KJ.',W);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// State 1\n", +"m1 = 2.0 // initial mass of gas in tank 1 in kg\n", +"T1 = 350.0 // initial temperature in kelvin in tank1\n", +"p1 = 0.7 // initial pressure in bar in tank 1\n", +"// State 2\n", +"m2 = 8.0 // initial mass of gas in tank 2 in kg\n", +"T2 = 300.0 // initial temperature in kelvin in tank 2\n", +"p2 = 1.2 // initial pressure in bar in tank 2\n", +"Tf = 315.0 // final equilibrium temperature in kelvin\n", +"// From table A-20\n", +"Cv = 0.745 // in KJ/Kg.k\n", +"// Calculations\n", +"pf = ((m1+m2)*Tf)/((m1*T1/p1)+(m2*T2/p2)) \n", +"Ui = (m1*Cv*T1)+(m2*Cv*T2)\n", +"Uf = (m1+m2)*Cv*Tf\n", +"deltaU = Uf-Ui\n", +"Q = deltaU\n", +"// Results\n", +"printf( ' The final equilibrium pressure is %f bar.',pf);\n", +"printf( ' The heat transfer for the process is %f KJ.',Q);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/4-Control_Volume_Analysis_Using_Energy.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/4-Control_Volume_Analysis_Using_Energy.ipynb new file mode 100644 index 0000000..a91b9ec --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/4-Control_Volume_Analysis_Using_Energy.ipynb @@ -0,0 +1,458 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Control Volume Analysis Using Energy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 1.0 // pressure of industrial discharge in bar\n", +"T1 = 478.0 // temperature of industrial discharge in kelvin\n", +"m1dot = 69.78 // mass flow rate of industrial discharge in kg/s\n", +"T2 = 400.0 // temperature of exit products from steam generator in kelvin\n", +"P2 = 1.0 // pressure of exit products from steam generator in bar\n", +"P3 = 0.275 // pressure of water stream entering the generator in Mpa\n", +"T3 = 38.9 // temperature of water stream entering the generator in degree celcius\n", +"m3dot = 2.079 // mass flow rate of water stream entering in kg/s\n", +"P5 = 0.07 // exit pressure of the turbine in bars\n", +"x5 = 0.93 // quality of turbine exit\n", +"// Part (a)\n", +"m2dot = m1dot // since gas and water streams do not mix\n", +"m5dot = m3dot // --DO\n", +"// from table A-22, A-2 and A-3:-\n", +"h1 = 480.3 // in kj/kg\n", +"h2 = 400.98 // in Kj/kg\n", +"h3 = 162.9 // assumption: h3 = hf(T3), units in Kj/kg\n", +"hf5 = 161.0 // in kj/kg\n", +"hg5 = 2571.72 // in kj/kg\n", +"// Part (b)\n", +"P4 = P3 // from the assumption that there is no pressure drop for water flowing through the steam generator\n", +"T4 = 180 // in degree celcius\n", +"// Calculations:-\n", +"h5 = hf5 + x5*(hg5-hf5)\n", +"Wcvdot = m1dot*h1 + m3dot*h3 - m2dot*h2 - m5dot*h5\n", +"h4 = h3 + (m1dot/m3dot)*(h1 -h2) // from steady state energy rate balance\n", +" // interpolating in table A-4, with these P4 and h4\n", +"// Results:-\n", +"printf( ' The power developed by the turbine is %.2f kJ/s.',Wcvdot)\n", +"printf( ' Turbine inlet temperature is %.2f degree celcius.',T4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"V = 0.85 // volume of tank in m^3\n", +"T1 = 260.0 // initial temperature of the tank in degree celcius\n", +"X1 = 0.7 // initial quality\n", +"// from table A-2\n", +"uf1 = 1128.4 // in kg/kg\n", +"ug1 = 2599.0 // in kg/kg\n", +"vf1 = 1.2755e-3 // in m^3/kg\n", +"vg1 = 0.04221 // in m^3/kg\n", +"// for final state, from table A-2,\n", +"u2 = 2599.0 // units in KJ/kg \n", +"v2 = 42.21e-3 // units in m^3/Kg\n", +"he = 2796.6 // units in KJ/kg\n", +"// Calculations:-\n", +"u1 = uf1 + X1*(ug1-uf1) // in kj/kg\n", +"v1 = vf1 + X1*(vg1-vf1) // in m^3/kg\n", +"m1 = V/v1 // initial mass in kg\n", +"m2 = V/v2 // final mass in kg\n", +"U2 = m2*u2 // final internal energy in KJ\n", +"U1 = m1*u1 // initial internal energy in KJ\n", +"Qcv = (U2-U1) - he*(m2-m1) \n", +"// Results:-\n", +"printf( ' The amount of heat transfer is %.2f KJ.',Qcv)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.12: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:- \n", +"Pv = 15.0 // pressure in the vessel in bar\n", +"Tv = 320.0 // temperature in the vessel in degree celcius\n", +"Vt = 0.6 // volume of a tank in m^3\n", +"Tt = 400.0 // temperature in the tank in degree celcius when the tank is full\n", +"// Since the tank is initially empty:-\n", +"m1 = 0\n", +"u1 = 0\n", +"// From table A-4, at 15bar and 400 degree celcius:-\n", +"v2 = 0.203 // Volume in m^3/kg\n", +"m2 = Vt/v2 // mass within the tank at the end of the process in kg\n", +"hi = 3081.9 // in kj/kg\n", +"u2 = 2951.3 // in kj/kg\n", +"// Calculations:-\n", +"deltaUcv = m2*u2-m1*u1\n", +"Wcv = hi*(m2-m1)-deltaUcv\n", +"// Results:-\n", +"printf( ' The amount of work developed by the turbine is %.2f kJ.',Wcv)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// At inlet 1:-\n", +"p1= 7.0 // pressure in bar\n", +"T2= 200.0 // temperature in degree celcius\n", +"m1dot= 40.0 // mass flow rate in kg/s\n", +"// At inlet 2:-\n", +"p2= 7.0 // pressure in bar\n", +"T2= 40.0 // temperature in degree celcius\n", +"A2= 25.0 // area in cm^2\n", +"// At exit:-\n", +"p3= 7.0 // pressure in bar\n", +"AV3= 0.06 // Volumetric flow rate through wxir in m^3/s\n", +"// From table A-3\n", +"v3 = (1.108)*(10**(-3)) // specific volume at the exit in m^3/kg\n", +"// from table A-2\n", +"v2= (1.0078)*(10**(-3)) // specific volume in state 2 in m^3/kg\n", +"// Calculation:-\n", +"m3dot= AV3/v3 // mass flow rate at exit\n", +"m2dot = m3dot-m1dot // mass flow rate at inlet 2\n", +"V2= (m2dot*v2)/(A2*(10**(-4)))\n", +"// Results:-\n", +"printf( ' The mass flow rate at the inlet 2 is %.2f kg/s.',m2dot)\n", +"printf( ' The mass flow rate at the exit is %.2f kg/s.',m3dot)\n", +"printf( ' The velocity at the inlet is %.2f m/s.', V2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1= 40.0 // pressure in bar\n", +"T1= 400.0 // temperature in degree celcius\n", +"V1= 10.0 // velocity m/s\n", +"// At exit:-\n", +"p2= 10.0 // pressure in bar\n", +"V2= 665.0 // velocity in m/s\n", +"mdot= 2.0 // mass flow rate in kg/s\n", +"// From table A-4\n", +"h1= 3213.6 // snpecific enthalpy in kJ/kg\n", +"v2 = 0.1627 // specific volume at the exit in m^3/kg\n", +"// Calculation:-\n", +"h2 = h1 + ((V1**2-V2**2)/2)/1000 // snpecific enthalpy in kJ/kg\n", +"A2=(mdot*v2)/V2 // Exit area\n", +"// Results:-\n", +"printf( ' The exit Area of the nozzle is %.4f m^2', A2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m1dot = 4600.0 // mass flow rate in kg/h\n", +"Wcvdot= 1000.0 // turbine power output in kv\n", +"p1= 60.0 // pressure in bar\n", +"T1=400.0 // temperature in degree celc\n", +"V1= 10.0 // velocity in m/s\n", +"// At exit:-\n", +"p2= 0.10 // pressure in bar\n", +"q2= 0.90 // quality \n", +"V2= 50.0 // velocity in m/s\n", +"// From table A-2 and A-3:-\n", +"h1= 3177.2 // specific enthalpy at inlet in kJ/kg\n", +"hf2= 191.83\n", +"hg2= 2584.63\n", +"// Calculation:-\n", +"h2 = hf2+q2*(hg2-hf2) // specific enthalpy at exit in kJ/kg\n", +"Qcvdot = Wcvdot + m1dot*((h2-h1)+(V2**2- V1**2)/(2*1000))/3600\n", +" \n", +"// Results:-\n", +"printf( ' The rate of heat transfer between the turbine and surroundings is %.2f kW',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1=1.00 // pressure in bar\n", +"t1= 290.00 // temperature in kelvin\n", +"A1= 0.1 // area in m^2\n", +"V1= 6.00 // velocity in m/s\n", +"// At exit:-\n", +"p2=7.00 // pressure in bar\n", +"t2= 450.00 // temperature in kelvin\n", +"V2= 2.00 // velocity in m/s\n", +"Qcvdot= -180.0 // heat transfer rate in kJ/min\n", +"R= 8.314 // universal gas constant in SI units\n", +"// from table A-22\n", +"h1= 290.16 // specific enthalpy in kJ/kg\n", +"h2= 451.8 // specific enthalpy in kJ/kg\n", +"// Calculations:-\n", +"v1 = (R*1000*t1)/(28.97*p1*10**5) // specific volume\n", +"mdot=(A1*V1)/v1 // mass flow rate\n", +"Wcvdot = Qcvdot/60 + mdot*((h1-h2)+(V1**2-V2**2)/(2*1000))\n", +"// Results:-\n", +" \n", +"printf( ' The power input to the compressor is %.2f kw',Wcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// At Entry:=\n", +"t1=20.0 // Temperatue in deg celcius\n", +"p1=1.0 // pressure in atm\n", +"AV1= 0.1 // volumetric flow rate in litre/s\n", +"D1=2.5 // Diameter of th hose in cm\n", +"// At Exit:=\n", +"t2=23.0 // temperatuer in deg celcius\n", +"p2=1.0 // pressure in atm\n", +"V2=50.0 // Velocity in m/s\n", +"Z2=5.0 // elevation in m\n", +"g= 9.8 // acceleration due to gravity in m/s^2\n", +"// from table A-2 and A-19:-\n", +"v= (1.0018)*((10.0)**(-3)) // specific volume in m^3/kg\n", +"c= 4.18 \n", +"// Calculation:-\n", +"mdot = (AV1/1000)/v // mass flow rate in kg/s\n", +"V1= (AV1/1000)/(3.14*(D1/(2*100))**2) // Entry velocity in m/s\n", +"deltah = c*(t2-t1)+v*(p2-p1)\n", +"Wcvdot= ((mdot*10)/9)*(-deltah+(V1**2-V2**2)/(2*1000)+g*(0-Z2)/1000)\n", +"// Results:-\n", +"printf( ' The power input to the motor is %.2f kw',Wcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Entering:-\n", +"p1=0.1 // pressure in bar\n", +"x1= 0.95 // Quality\n", +"p2= 0.1 // pressure in bar\n", +"t2= 45.0 // temperature in deg celcius\n", +"t3=20.0 // temperature of cooling entry in deg cel\n", +"t4=35.0 // temperature of cooling exit\n", +"// From table A-3\n", +"hf= 191.53 // Enthalpy in KJ/kg\n", +"hg= 2584.7 // Enthalpy in KJ/kg\n", +"h2=188.45 // Assumption at states 2,3 and 4, h is approx equal to hf(T), in kJ/kg\n", +"deltah4_3= 62.7 // Assumption 4, in kJ/kg\n", +"// Calculations:-\n", +"h1= hf + x1*(hg-hf)\n", +"ratio= (h1-h2)/(deltah4_3)\n", +"QRate= (h2-h1) // Part B\n", +"// Results:-\n", +"printf('The rate of the mass flow rate of the cooling water to the mass flow rate of the condenstaing stream is (m3dot/m1dot) %.2f ',ratio)\n", +"printf('The rate of energy transfer from the condensing steam to the cooling water of the steam passing through the condenser is %.2f kJ/kg.',QRate)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 293.0 // In kelvin\n", +"P1= 1.01325 * (10**5) // In pascal\n", +"V1max= 1.3 // maximum velocity of entering air in m/s\n", +"T2max= 305.0 // maximum temperature at the exit in kelvin\n", +"pec= -80.0 // power received by electronic components in watt\n", +"Pf= -18.0 // Power received by fan in watt\n", +"R= 8.314 // Universal gas constant\n", +"M= 28.97*(10**(-3)) // Molar mass of air in kg\n", +"Qcvdot=0 // Heat transfer from the outer surface of the electronics enclosure to the surroundings is negligible.\n", +"Cp= 1.005*(10**3) // in j/kg*k\n", +"// Calculations:-\n", +"Wcvdot = pec +Pf // total electric power provided to electronic components and fan in watt\n", +"mdotmin= (-Wcvdot)/(Cp*(T2max-T1)) // minimum mass flow rate\n", +"v1= ((R/M)*T1)/P1 // specific volume\n", +"A1min = (mdotmin*v1)/V1max\n", +"D1min = (4*A1min/(%pi))**(0.5)\n", +"// Results:-\n", +"printf( ' The smallest fan inlet diameter is %.2f cm',D1min*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 20.0 // pressure in supply line in bars\n", +"P2 = 1.0 // exhaust pressure in bar\n", +"T2 = 120.0 // exhaust temperature in degree celcius\n", +"// from table A-3 at 20 bars\n", +"hf1 = 908.79 // Enthalpy in kj/kg\n", +"hg1 = 2799.5 // Enthalpy in kj/kg\n", +"// from table A-4, at 1 bar and 120 degree celcius\n", +"h2 = 2766.6 // in kj/kg\n", +"h1 = h2 // from throttling process assumption\n", +"// Calculations:-\n", +"x1 = (h1-hf1)/(hg1-hf1)\n", +"// Results:-\n", +"printf( ' The quality of the steam in the supply line is %.2f',x1)\n", +"// Note : rounding off error. please check manually." + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/5-The_Second_Law_of_Thermodynamics.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/5-The_Second_Law_of_Thermodynamics.ipynb new file mode 100644 index 0000000..29fa9db --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/5-The_Second_Law_of_Thermodynamics.ipynb @@ -0,0 +1,116 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: The Second Law of Thermodynamics" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"W = 410.00 // net work output in kj claimed \n", +"Q = 1000.00 // energy input by heat transfer in kj\n", +"Tc = 300.00 // temperature of cold reservoir in kelvin\n", +"TH = 500.00 // temperature of hot reservoir in kelvin\n", +"// Calculations \n", +"eta = W/Q // thermal efficiency\n", +"etamax = 1-(Tc/TH)\n", +"// Results\n", +"printf( ' Eta = %.4f',eta)\n", +"printf( ' Etamax = %.4f',etamax)\n", +"printf( ' Since eta is more than etamax, the claim is not authentic')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"Qcdot = 8000.00 // in kj/h\n", +"Wcycledot = 3200.00 // in kj/h\n", +"Tc = 268.00 // temperature of compartment in kelvin\n", +"TH = 295.00 // temperature of the surrounding air in kelvin\n", +"// Calculations \n", +"beta = Qcdot/Wcycledot // coefficient of performance\n", +"betamax = Tc/(TH-Tc) // reversible coefficient of performance\n", +"// Results\n", +"printf( ' Coefficient of performance is %.3f',beta)\n", +"printf( ' Coefficient of performance of a reversible cycle is %.3f',betamax)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"Tc = 283.0 // in kelvin\n", +"TH = 295.0 // in kelvin\n", +"QH = 5*(10**5) // in kj per day\n", +"// Calculations\n", +"Wcyclemin = (1-(Tc/TH))*QH\n", +"// Results\n", +"printf( ' Minimum theoretical work input for one day of operation in kJ is: %.2f',Wcyclemin)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/6-Using_Entropy.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/6-Using_Entropy.ipynb new file mode 100644 index 0000000..d7eef21 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/6-Using_Entropy.ipynb @@ -0,0 +1,569 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Using Entropy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"m1 = 5.00 // initial mass in kg\n", +"P1 = 5.00 // initial pressure in bar\n", +"T1 = 500.00 // initial temperature in kelvin\n", +"P2 = 1.00 // final pressure in bar\n", +"// From table A-22\n", +"pr1 = 8.411\n", +"// Using this value of pr2 and interpolation in table A-22\n", +"T2 = 317.00 // in kelvin\n", +"// Calculations \n", +"pr2 = (P2/P1)*pr1\n", +"m2 = (P2/P1)*(T1/T2)*m1\n", +"// Results\n", +"printf('The amount of mass remaining in the tank is %f kg',m2)\n", +"printf('and its temperature is %f kelvin.',T2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 1.00 // inlet pressure in bar\n", +"T1 = 593.00 // inlet temperature in kelvin\n", +"P2 = 1.00 // exit pressure in bar\n", +"eta =0.75 // turbine efficiency\n", +"// From table A-4\n", +"h1 = 3105.6 // in Kj/kg\n", +"s1 = 7.5308 // in kj/kg.k\n", +"// From table A-4 at 1 bar\n", +"h2s = 2743.00 // in kj/kg\n", +"// Calculations\n", +"w = eta*(h1 - h2s)\n", +"// Result\n", +"printf( ' The work developed per unit mass of steam flowing through is %f kJ/kg.',w);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 3.00 // pressure of air entering in bar\n", +"T1 = 390.00 // temperature of air entering in kelvin\n", +"P2 = 1.00 // pressure of exit air\n", +"Wcvdot = 74.00 // work developed in kj/kg\n", +"// From table A-22,at 390k\n", +"h1 = 390.88 // in kj/kg\n", +"pr1 = 3.481\n", +"// From interpolation table A-22\n", +"h2s = 285.27 // in kj/kg\n", +"// calculations\n", +"pr2 = (P2/P1)*pr1\n", +"Wcvdots = h1 - h2s\n", +"eta = Wcvdot/Wcvdots\n", +"// Result\n", +"printf( ' The turbine efficiency is %.4f ',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 1.00 // pressure of entering steam in Mpa\n", +"T1 = 593.00 // temperature of entering steam in kelvin\n", +"V1 = 30.00 // velocity of entering steam in m/s\n", +"P2 = 0.3 // pressure of exit steam in Mpa\n", +"T2 = 453.00 // temperature of exit steam in kelvin\n", +"// From table A-4, at T1 = 593 kelvin and P1 = 1 Mpa;\n", +"// and at T2 = 453 kelvin and P2 = .3 Mpa\n", +"h1 = 3093.9 // in kj/kg\n", +"s1 = 7.1962 // in kj/kg.k\n", +"h2 = 2823.9 // in kj/kg\n", +"// Interpolating in table A-4\n", +"h2s = 2813.3 // in kj/kg\n", +"// Calculations\n", +"V2squareby2 = h1 - h2 + (V1**2)/2000\n", +"V2squareby2s = h1 - h2s + (V1**2)/2000\n", +"eta = V2squareby2/V2squareby2s\n", +"// Results\n", +"printf( ' The nozzle efficiency is %.4f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.14: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// From table A-9\n", +"h1 = 249.75 // in kj/kg\n", +"h2 = 294.17 // in kj/kg\n", +"mdot = 0.07 // in kg/s\n", +"// From table A-9\n", +"s1 = 0.9572 // in Kj/Kg.k\n", +"h2s = 285.58 // in kj/kg\n", +"// Calculations\n", +"wcvdot = -(mdot*(h2-h1))\n", +"eta = (h2s-h1)/(h2-h1) \n", +"// Results\n", +"printf( ' The power in is %f kw',wcvdot);\n", +"printf( ' The isentropic efficiency is %.3f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.15: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 1.00 // pressure of entering air in bar\n", +"T1 = 293.00 // temperature of entering air in kelvin\n", +"P2 = 5.00 // pressure of exit air in bar\n", +"n = 1.3\n", +"R = 8.314/28.97\n", +"// From table A-22\n", +"h1 = 293.17 // in kj/kg\n", +"h2 = 426.35 // in kj/kg\n", +"// Calculations\n", +"T2 = T1*((P2/P1)**((n-1)/n)) // in kelvin\n", +"wcvdot=((n*R)/(n-1))*(T1-T2) // in kj/kg\n", +"Qcvdot= wcvdot + (h2-h1) // in kj/kg\n", +"// Results\n", +"printf( ' The work per unit mass passing through the device is %.2f kJ/kg',wcvdot)\n", +"printf( ' The heat transfer per unit mass is %.2f kJ/kg. ',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T = 373.15 // temperature in kelvin\n", +"// From table A-2\n", +"p = 1.014*(10**5) // pressure in pascal\n", +"vg = 1.673\n", +"vf = 1.0435e-3\n", +"sg = 7.3549\n", +"sf = 1.3069\n", +"// Calculations\n", +"w = p*(vg-vf)*(10**(-3))\n", +"Q = T*(sg-sf)\n", +"// Results \n", +"printf( ' The work per unit mass is %.3f KJ/Kg',w)\n", +"printf( ' The heat transfer per unit mass is %.2f kj/kg',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Assumptions:\n", +"// From table A-2 at 100 degree celcius\n", +"ug = 2506.5 // in kj/kg\n", +"uf = 418.94 // in kj/kg\n", +"sg = 7.3549\n", +"sf = 1.3069\n", +"// Calculations:-\n", +"// From energy balance\n", +"W = -(ug-uf)\n", +"// From entropy balance\n", +"sigmabym = (sg-sf)\n", +"// Results\n", +"printf( ' The net work per unit mass is %.2f KJ/kg. ',W)\n", +"printf( ' The amount of entropy produced per unit mass is %.2f KJ/kg.',sigmabym)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 273.0 // initial temperature of saturated vapor in kelvin\n", +"P2 = 0.7*(10**6) // final pressure in pascal\n", +"// From table A-10,\n", +"u1 = 227.06 // in kj/kg\n", +"// minimum theoretical work corresponds to state of isentropic compression\n", +"// From table A-12,\n", +"u2s = 244.32 // in kj/kg\n", +" \n", +"// Calculations \n", +"Wmin = u2s-u1\n", +"// Results\n", +"printf( ' The minimum theoretical work input required per unit mass of refrigerant is: %.2f kJ/kg',Wmin)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"Qdot = -1.2 // in kilo watt\n", +"Tb = 300.0 // in kelvin\n", +"Tf = 293.0 // in kelvin\n", +"// Calculations\n", +"// Part (a)\n", +"// From entropy balance \n", +"sigmadot = -Qdot/Tb\n", +"// Part(b)\n", +"// From entropy balance \n", +"sigmadt = -Qdot/Tf\n", +"// Results\n", +"printf( ' The rate of entropy production with gearbox as system is %f kw/k',sigmadot)\n", +"printf( ' The rate of entropy production with gearbox + sorrounding as system is %f kw/k',sigmadt)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// GIven:-\n", +"Tmi = 1200.0 // initial temperature of metal in kelvin\n", +"cm = 0.42 // specific heat of metal in KJ/kg.k\n", +"mm = 0.3 // mass of metal in kg\n", +"Twi = 300.0 // initial temperature of water in kelvin\n", +"cw = 4.2 // specific heat of water in KJ/Kg.k\n", +"mw = 9.0 // mass of water in kg\n", +"// Calculations\n", +"// Part(a)\n", +"// Solving energy balance equation yields\n", +"Tf = (mw*(cw/cm)*Twi+mm*Tmi)/(mw*(cw/cm)+mm)\n", +"// Part (b)\n", +"// Solving entropy balance equation yields\n", +"sigma = mw*cw*log(Tf/Twi)+mm*cm*log(Tf/Tmi)\n", +"// Results\n", +"printf( ' The final equilibrium temperature of the metal bar and the water is %.2f kelvin.',Tf)\n", +"printf( ' The amount of entropy produced is: %.2f kJ/k.',sigma)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 30.0 // pressure of steam entering the turbine in bar\n", +"T1 = 400.0 // temperature of steam entering the turbine in degree celcius\n", +"V1 = 160.0 // velocity of steam entering the turbine in m/s\n", +"T2 = 100.0 // temperature of steam exiting in degree celcius\n", +"V2 = 100.0 // velocity of steam exiting in m/s\n", +"Wcvdot = 540.0 // work produced by turbine in kJ/kg of steam\n", +"Tb = 350.0 // temperature of the boundary in kelvin\n", +"// From table A-4 and table A-2\n", +"h1 = 3230.9 // specific enthalpy at entry in Kj/kg\n", +"h2 = 2676.1 // specific enthalpy at exit in kj/kg\n", +"// Calculations\n", +"// Reduction in mass and energy balance equations results in \n", +"Qcvdot = Wcvdot + (h2 - h1)+ (V2**2-V1**2)/(2*(10**3)) // heat transfer rate\n", +"// From table A-2\n", +"s2 = 7.3549 // in kj/kg.k\n", +"// From table A-4\n", +"s1 = 6.9212 // in kj/kg.k\n", +"// From entropy and mass balance equations\n", +"sigmadot = -(Qcvdot/Tb) + (s2-s1)\n", +"// Results\n", +"printf( 'The rate at which entropy is produced within the turbine per kg of steam flowing is %.2f kJ/kg.k',sigmadot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 294.0 // entry temperature of air in kelvin\n", +"P1 = 5.1 // entry pressure of air in bars\n", +"T2 = 352.0 // exit temperature of hot stream in kelvin\n", +"P2 = 1.0 // exit pressure of hot stream in bars\n", +"T3 = 255.0 // exit temperature of cold stream in kelvin\n", +"P3 = 1.0 // exit pressure of cold stream in bars\n", +"cp = 1.0 // in kj/kg.k\n", +"// Calculations\n", +"R = 8.314/28.97\n", +"se = 0.4*(cp*log((T2)/(T1))-R*log(P2/P1)) + 0.6*(cp*log((T3)/(T1))-R*log(P3/P1))\n", +" // specific entropy in kj/kg.k\n", +"// Results\n", +"printf( ' Specific entropy in kj/kg.k = %.3f KJ/kg.',se)\n", +"printf( ' Since se > 0, the claim of the writer is true');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 3.5 // pressure of refrigerant entering the compressor in bars\n", +"T1 = 268.0 // temperature of refrigerant entering the compressor in kelvin\n", +"P2 = 14.0 // pressure of refrigerant entering the condenser in bars\n", +"T2 = 348.0 // temperature of refrigerant entering the condenser in kelvin\n", +"P3 = 14.0 // pressure of refrigerant exiting the condenser in bars\n", +"T3 = 301.0 // temperature of refrigerant exiting the condenser in kelvin\n", +"P4 = 3.5 // pressure of refrigerant after passing through expansion valve in bars\n", +"P5 = 1.0 // pressure of indoor return air entering the condenser in bars\n", +"T5 = 293.0 // temperature of indoor return air entering the condenser in kelvin\n", +"AV5 = 0.42 // volumetric flow rate of indoor return air entering the condenser in m^3/s\n", +"P6 = 1.0 // pressure of return air exiting the condenser in bar\n", +"T6 = 323.0 // temperature of return air exiting the condenser in kelvin\n", +"// Part(a)\n", +"// From table A-9\n", +"s1 = 0.9572 // in kj/kg.k\n", +"// Interpolating in table A-9\n", +"s2 = 0.98225 // in kj/kg.k\n", +"h2 = 294.17 // in kj/kg\n", +"// From table A-7\n", +"s3 = 0.2936 // in kj/kg.k\n", +"h3 = 79.05 // in kj/kg\n", +"h4 = h3 // since expansion through valve is throttling process\n", +"// From table A-8\n", +"hf4 = 33.09 // in kj/kg\n", +"hg4 = 246.00 // in kj/kg\n", +"sf4 = 0.1328 // in kj/kg.k\n", +"sg4 = 0.9431 // in kj/kg.k\n", +"cp = 1.005 // in kj/kg.k\n", +"// Calculations\n", +"x4 = (h4-hf4)/(hg4-hf4) // quality at state 4\n", +"s4 = sf4 + x4*(sg4-sf4) // specific entropy at state 4\n", +"// CONDENSER!!\n", +"v5 = ((8314/28.97)*T5)/(P5*(10**5)) // specific volume at state 5\n", +"mairdot = AV5/v5 \n", +"h6 = cp*T6\n", +"h5 = cp*T5\n", +"mrefdot = mairdot*(h6-h5)/(h2-h3)\n", +"deltaS65 = cp*log(T6/T5)-(8.314/28.97)*log(P6/P5) // change in specific entropy\n", +"sigmacond = (mrefdot*(s3-s2)) + (mairdot*(deltaS65))\n", +"// COMPRESSOR!!\n", +"sigmacomp = mrefdot*(s2-s1)\n", +"// VALVE!!\n", +"sigmavalve = mrefdot *(s4-s3)\n", +"// Results\n", +"printf( ' The rates of entropy production for control volume enclosing the condenser is %f kw/k',sigmacond);\n", +"printf( ' The rates of entropy production for control volume enclosing the compressor is %f kW/K.',sigmacomp);\n", +"printf( ' The rates of entropy production for control volume enclosing the expansion valve is %f kW/K ',sigmavalve)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"P1 = 1.00 // initial pressure in bar\n", +"T1 = 300.00 // initial temperature in kelvin\n", +"T2 = 650.00 // final temperature in kelvin\n", +"// Part(a)\n", +"// From table A-22\n", +"pr2 = 21.86 \n", +"pr1 = 1.3860\n", +"k = 1.39 // From table A-20\n", +"// Calculations\n", +"p2 = P1*(pr2/pr1)\n", +"p2a = P1*((T2/T1)**(k/(k-1)))\n", +"// Results\n", +"printf( ' P2 = %f bar.',p2)\n", +"printf( ' Part(b) IT software problem');\n", +"printf( ' P2a = %f bar',p2a);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/7-Exergy_Analysis.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/7-Exergy_Analysis.ipynb new file mode 100644 index 0000000..6f0623c --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/7-Exergy_Analysis.ipynb @@ -0,0 +1,525 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Exergy Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"EfFdot = 100.00 // exergy rate of fuel entering the boiler in MW\n", +"cF = 1.44 // unit cost of fuel in cents per kw.h\n", +"Zbdot = 1080.00 // the cost of owning and operating boiler in dollars per hour\n", +"Ef1dot = 35.00 // exergy rate of exiting steam from the boiler in MW\n", +"p1 = 50.00 // pressure of exiting steam from the boiler in bar\n", +"T1 = 466.00 // temperature of exiting steam from the boiler in degree celcius\n", +"Ztdot = 92.00 // the cost of owning and operating turbine in dollars per hour\n", +"p2 = 5.00 // pressure of exiting steam from the turbine in bars\n", +"T2 = 205.00 // temperature of exiting steam from the turbine in degree celcius\n", +"m2dot = 26.15 // mass flow rate of exiting steam from the turbine in kg/s\n", +"T0 = 298.00 // in kelvin \n", +"// Part(a)\n", +"// From table A-4,\n", +"h1 = 3353.54 // in kj/kg\n", +"h2 = 2865.96 // in kj/kg\n", +"s1 = 6.8773 // in kj/kg.k\n", +"s2 = 7.0806 // in kj/kg.k\n", +"// Calculations\n", +"// From assumption,For each control volume,Qcvdot = 0 and kinetic and potential energy effects are negligible,the mass and energy rate \n", +"// balances for a control volume enclosing the turbine reduce at steady state to give\n", +"Wedot = m2dot *(h1-h2)/1000 // power in MW\n", +"Ef2dot = Ef1dot+m2dot*(h2-h1-T0*(s2-s1))/1000 // the rate exergy exits with the steam in MW\n", +"// Results\n", +"printf( ' For the turbine,the power is %.2f MW.',Wedot)\n", +"printf( ' For the turbine,the rate exergy exits with the steam is %.2f MW.',Ef2dot)\n", +"// Part(b)\n", +"// Calculations\n", +"c1 = cF*(EfFdot/Ef1dot) + ((Zbdot/Ef1dot)/10**3)*100 // unit cost of exiting steam from boiler in cents/Kw.h\n", +"c2 = c1 // Assigning the same unit cost to the steam entering and exiting the turbine\n", +"ce = c1*((Ef1dot-Ef2dot)/Wedot) + ((Ztdot/Wedot)/10**3)*100 // unit cost of power in cents/kw.h\n", +"// Results\n", +"printf('The unit costs of the steam exiting the boiler of exergy is: %.2f cents per kw.h.',c1)\n", +"printf('The unit costs of the steam exiting the turbine of exergy is: %.2f cents per kw.h.',c2)\n", +"printf('Unit cost of power is: %f cents per kw.h.',ce)\n", +"// Part(c)\n", +"C2dot = (c2*Ef2dot*10**3)/100 // cost rate for low-pressure steam in dollars per hour\n", +"Cedot = (ce*Wedot*10**3)/100 // cost rate for power in dollars per hour\n", +"// Results\n", +"printf( ' The cost rate of the steam exiting the turbine is: %.2f dollars per hour.',C2dot)\n", +"printf( ' The cost rate of the power is: %.2f dollars per hour.',Cedot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"v = 2450.00 // volume of gaseous products in cm^3\n", +"P = 7.00 // pressure of gaseous product in bar\n", +"T = 867.00 // temperature of gaseous product in degree celcius\n", +"T0 = 300.00 // in kelvin\n", +"P0 = 1.013 // in bar\n", +"// From table A-22\n", +"u = 880.35 // in kj/kg\n", +"u0 = 214.07 // in kj/kg\n", +"s0T = 3.11883 // in kj/kg.k\n", +"s0T0 = 1.70203 // in kj/kg.k\n", +"// Calculations\n", +"e = (u-u0) + (P0*(8.314/28.97)*(((T+273)/P)-(T0/P0))) - T0*(s0T-s0T0-(8.314/28.97)*log(P/P0)) // kj/kg\n", +"// Results\n", +"printf( ' The specific exergy of the gas is %.3f kJ/kg.',e)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"mR = 1.11 // mass of the refrigerant in kg\n", +"T1 = -28.00 // initial temperature of the saturated vapor in degree celcius\n", +"P2 = 1.4 // final pressure of the refrigerant in bar\n", +"T0 = 293.00 // in kelvin\n", +"P0 = 1.00 // in bar\n", +"// Part (a)\n", +"// From table A-10\n", +"u1 = 211.29 // in kj/kg\n", +"v1 = 0.2052 // in m^3/kg\n", +"s1 = 0.9411 // in kj/kg.k\n", +"// From table A-12\n", +"u0 = 246.67 // in kj/kg\n", +"v0 = 0.23349 // in m^3/kg\n", +"s0 = 1.0829 // in kj/kg.k\n", +"// From table A-12\n", +"u2 = 300.16 // in kj/kg\n", +"s2 = 1.2369 // in kj/kg.k\n", +"v2 = v1\n", +"// Calculations \n", +"E1 = mR*((u1-u0) + P0*(10**5)*(v1-v0)*(10**(-3))-T0*(s1-s0))\n", +"E2 = mR*((u2-u0) + P0*(10**5)*(v2-v0)*(10**(-3))-T0*(s2-s0))\n", +"// Results for Part A\n", +"printf( ' Part(a) The initial exergy is %.2f kJ.',E1)\n", +"printf( ' The final exergy is %.2f kJ.',E2)\n", +"printf( ' The change in exergy of the refrigerant is %.2f kj',E2-E1)\n", +"// Part (b)\n", +"// Calculations\n", +"deltaU = mR*(u2-u1)\n", +"// From energy balance\n", +"deltaPE = -deltaU\n", +"// With the assumption::The only significant changes of state are experienced by the refrigerant and the suspended mass. For the refrigerant, \n", +"// there is no change in kinetic or potential energy. For the suspended mass, there is no change in kinetic or internal energy. Elevation is \n", +"// the only intensive property of the suspended mass that changes\n", +"deltaE = deltaPE\n", +"// Results for part b\n", +"printf( ' Part(b)The change in exergy of the suspended mass is %.3f kJ',deltaE)\n", +"// Part(c)\n", +"// Calculations\n", +"deltaEiso = (E2-E1) + deltaE\n", +"// Results\n", +"printf( ' Part(c)The change in exergy of an isolated system of the vessel and pulley–mass assembly is %.2f kJ',deltaEiso)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"T = 373.15 // initial temperature of saturated liquid in kelvin\n", +"T0 = 293.15 // in kelvin\n", +"P0 = 1.014 // in bar\n", +"// Part(a)\n", +"// From table A-2\n", +"ug = 2506.5 // in kj/kg\n", +"uf = 418.94 // in kj/kg\n", +"vg = 1.673 // in m^3/kg\n", +"vf = 1.0435*(10**(-3)) // in m^3/kg\n", +"sg = 7.3549 // in kj/kg.k\n", +"sf = 1.3069 // in kj/kg.k\n", +"// Calculations \n", +"// Energy transfer accompanying work\n", +"etaw = 0 // since p = p0\n", +"// Exergy transfer accompanying heat\n", +"Q = 2257 // in kj/kg,obtained from example 6.1\n", +"etah = (1-(T0/T))*Q\n", +"// Exergy destruction\n", +"ed = 0 // since the process is accomplished without any irreversibilities\n", +"deltae = ug-uf + P0*(10**5)*(vg-vf)/(10**3)-T0*(sg-sf)\n", +"// Results\n", +"printf( ' Part(a)the change in exergy is %.2f kJ/kg.',deltae)\n", +"printf( ' The exergy transfer accompanying work is %.2f kJ/kg.',etaw)\n", +"printf( ' The exergy transfer accompanying heat is %.2f kJ/kg',etah)\n", +"printf( ' The exergy destruction is %.2f kJ/kg.',ed)\n", +"// Part(b)\n", +"Deltae = deltae // since the end states are same \n", +"Etah = 0 // since process is adiabatic\n", +"// Exergy transfer along work\n", +"W = -2087.56 // in kj/kg from example 6.2\n", +"Etaw = W- P0*(10**5)*(vg-vf)/(10**3)\n", +"// Exergy destruction\n", +"Ed = -(Deltae+Etaw)\n", +"// Results\n", +"printf( ' Part(b)the change in exergy is %.2f kJ/kg.',Deltae)\n", +"printf( ' The exergy transfer accompanying work is %.2f kJ/kg.',Etaw)\n", +"printf( ' The exergy transfer accompanying heat is %.2f kJ/kg.',Etah)\n", +"printf( ' The exergy destruction is %.2f kJ/kg.',Ed)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T0 = 293.00 // in kelvin\n", +"Qdot = -1.2 // in KW, from example 6.4a\n", +"Tb = 300.00 // temperature at the outer surface of the gearbox in kelvin from example 6.4a\n", +"sigmadot = 0.004 // rate of entropy production in KW/k from example 6.4a\n", +"// Calculations\n", +"R = -(1-T0/Tb)*Qdot // time rate of exergy transfer accompanying heat\n", +"Eddot = T0*sigmadot // rate of exergy destruction\n", +"// Results\n", +"printf( ' Balance sheet');\n", +"printf( '\n Rate of exergy in high speed shaft 60Kw' )\n", +"printf( '\n Disposition of the exergy: Rate of exergy out low-speed shaft %.1f Kw',58.8 )\n", +"printf( '\n Heat transfer is %.3f kw.',R)\n", +"printf( '\n Rate of exergy destruction is %.3f kw',Eddot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 3.0 // entry pressure in Mpa\n", +"p2 = 0.5 // exit pressure in Mpa\n", +"T1 = 320.0 // entry temperature in degree celcius\n", +"T0 = 25.0 // in degree celcius\n", +"p0 = 1.0 // in atm\n", +"// From table A-4\n", +"h1 = 3043.4 // in kj/kg\n", +"s1 = 6.6245 // in kj/kg.k\n", +"h2 = h1 // from reduction of the steady-state mass and energy rate balances\n", +"s2 = 7.4223 // Interpolating at a pressure of 0.5 MPa with h2 = h1, units in kj/kg.k\n", +"// From table A-2\n", +"h0 = 104.89 // in kj/kg\n", +"s0 = 0.3674 // in kj/kg.k\n", +"// Calculations \n", +"ef1 = h1-h0-(T0+273)*(s1-s0) // flow exergy at the inlet\n", +"ef2 = h2-h0-(T0+273)*(s2-s0) // flow exergy at the exit\n", +"// From the steady-state form of the exergy rate balance\n", +"Ed = ef1-ef2 // the exergy destruction per unit of mass flowing is\n", +"// Results \n", +"printf( ' The specific flow exergy at the inlet is %.2f kJ/kg.',ef1)\n", +"printf( ' The specific flow exergy at the exit is %.2f kJ/kg.',ef2)\n", +"printf( ' The exergy destruction per unit of mass flowing is %.2f kJ/kg.',Ed)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 610.0 // temperature of the air entering heat exchanger in kelvin\n", +"p1 = 10.0 // pressure of the air entering heat exchanger in bar\n", +"T2 = 860.0 // temperature of the air exiting the heat exchanger in kelvin\n", +"p2 = 9.70 // pressure of the air exiting the heat exchanger in bar\n", +"T3 = 1020.0 // temperature of entering hot combustion gas in kelvin\n", +"p3 = 1.10 // pressure of entering hot combustion gas in bar\n", +"p4 = 1.0 // pressure of exiting hot combustion gas in bar\n", +"mdot = 90.0 // mass flow rate in kg/s\n", +"T0 = 300.0 // in kelvin\n", +"p0 = 1.0 // in bar\n", +"// Part (a)\n", +"// From table A-22\n", +"h1 = 617.53 // in kj/kg\n", +"h2 = 888.27 // in kj/kg\n", +"h3 = 1068.89 // in kj/kg\n", +"// Calculations\n", +"h4 = h3+h1-h2\n", +"// Using interpolation in table A-22 gives\n", +"T4 = 778 // in kelvin\n", +"// Results\n", +"printf( ' The exit temperature of the combustion gas is %f kelvin.',T4);\n", +"// Part(b)\n", +"// From table A-22\n", +"s2 = 2.79783 // in kj/kg.k\n", +"s1 = 2.42644 // in kj/kg.k\n", +"s4 = 2.68769 // in kj/kg.k\n", +"s3 = 2.99034 // in kj/kg.k\n", +"// Calculations for part b\n", +"deltaR = (mdot*((h2-h1)-T0*(s2-s1-(8.314/28.97)*log(p2/p1))))/1000\n", +"deltRc = mdot*((h4-h3)-T0*(s4-s3-(8.314/28.97)*log(p4/p3)))/1000\n", +"// Results for part b\n", +"printf( ' The net change in the flow exergy rate from inlet to exit of compressed gas is %.3f MW.',deltaR)\n", +"printf( ' The net change in the flow exergy rate from inlet to exit of hot combustion gas is %.3f MW.',deltRc)\n", +"// Part(c)\n", +"//From an exergy rate balance\n", +"Eddot = -deltaR-deltRc\n", +"// Results \n", +"printf( ' The rate exergy destroyed, is %.3f MW.',Eddot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 30.0 // pressure of entering steam in bar\n", +"t1 = 400.0 // temperature of entering steam in degree celcius\n", +"v1 = 160.0 // velocity of entering steam in m/s\n", +"t2 = 100.0 // temperature of exiting saturated vapor in degree celcius\n", +"v2 = 100.0 // velocity of exiting saturated vapor in m/s\n", +"W = 540.0 // rate of work developed in kj per kg of steam\n", +"Tb = 350.0 // the temperature on the boundary where heat transfer occurs in kelvin\n", +"T0 = 25.0 // in degree celcius\n", +"p0 = 1.0 // in atm\n", +"// From table A-4\n", +"h1 = 3230.9 // in kj/kg\n", +"s1 = 6.9212 // in kj/kg.k\n", +"// From table A-2 \n", +"h2 = 2676.1 // in kj/kg\n", +"s2 = 7.3549 // in kj/kg.k\n", +"// From example 6.6\n", +"Q = -22.6 // in kj/kg\n", +" \n", +"// Calculations\n", +"DELTAef = (h1-h2)-(T0+273)*(s1-s2)+(v1**2-v2**2)/(2*1000)\n", +"// The net exergy carried in per unit mass of steam flowing in kj/kg\n", +"Eq = (1-(T0+273)/Tb)*(Q) // exergy transfer accompanying heat in kj/kg\n", +"Ed = ((1-(T0+273)/Tb)*(Q))-W+(DELTAef) // The exergy destruction determined by rearranging the steady-state form of the exergy \n", +" // rate balance\n", +"// Results\n", +"printf( ' Balance sheet')\n", +"printf( ' Net rate of exergy %f kJ/kg,',DELTAef)\n", +"printf( ' Disposition of the exergy:')\n", +"printf( '* Rate of exergy out')\n", +"printf( ' Work %f kJ/kg.',W)\n", +"printf( ' Heat transfer %f',-Eq)\n", +"printf( '• Rate of exergy destruction %f kJ/kg.',Ed)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"clc;\n", +"m1dot = 69.78 // in kg/s\n", +"p1 = 1.0 // in bar\n", +"T1 = 478.0 // in kelvin\n", +"T2 = 400.0 // in kelvin\n", +"p2 = 1.0 // in bar\n", +"p3 = 0.275 // in Mpa\n", +"T3 = 38.9 // in degree celcius\n", +"m3dot = 2.08 // in kg/s\n", +"T4 = 180.0 // in degree celcius\n", +"p4 = 0.275 // in Mpa\n", +"p5 = 0.07 // in bar\n", +"x5 = 0.93\n", +"Wcvdot = 876.8 // in kW\n", +"T0 = 298.0 // in kelvin\n", +"// Part(a)\n", +"// From table A-22\n", +"h1 = 480.35 // in kj/kg\n", +"h2 = 400.97 // in kj/kg\n", +"s1 = 2.173 // in kj/kg\n", +"s2 = 1.992 // in kj/kg\n", +"// From table A-2E\n", +"h3 = 162.82 // in kj/kg\n", +"s3 = 0.5598 // in kj/kg.k\n", +"// Using saturation data at 0.07 bars from Table A-3\n", +"h5 = 2403.27 // in kj/kg\n", +"s5 = 7.739 // in kj/kg.k\n", +"//The net rate exergy carried out by the water stream\n", +"// From table A-4\n", +"h4 = 2825.0 // in kj/kg\n", +"s4 = 7.2196 // in kj/kg.k\n", +"// Calculations\n", +"netRE = m1dot*(h1-h2-T0*(s1-s2-(8.314/28.97)*log(p1/p2))) // the net rate exergy carried into the control volume\n", +"netREout = m3dot*(h5-h3-T0*(s5-s3))\n", +"// From an exergy rate balance applied to a control volume enclosing the steam generator\n", +"Eddot = netRE + m3dot*(h3-h4-T0*(s3-s4)) // the rate exergy is destroyed in the heat-recovery steam generator\n", +"// From an exergy rate balance applied to a control volume enclosing the turbine\n", +"EdDot = -Wcvdot + m3dot*(h4-h5-T0*(s4-s5)) // the rate exergy is destroyed in the tpurbine\n", +"// Results \n", +"printf( '\n balance sheet')\n", +"printf( '\n- Net rate of exergy in: %f kJ/kg.',netRE)\n", +"printf( '\n Disposition of the exergy:')\n", +"printf( '\n• Rate of exergy out')\n", +"printf( '\n power developed %f kJ/kg.',netRE-netREout-Eddot-EdDot)\n", +"printf( '\n water stream %f',netREout)\n", +"printf( '\n• Rate of exergy destruction')\n", +"printf( '\n heat-recovery steam generator %f kJ/kg',Eddot)\n", +"printf( '\n turbine %f',EdDot)\n", +"// note : answer is slightly different because of rounding off error." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T0 = 273.00 // in kelvin\n", +"pricerate = 0.08 // exergy value at $0.08 per kw.h\n", +"// From example 6.8\n", +"sigmadotComp = 17.5e-4 // in kw/k\n", +"sigmadotValve = 9.94e-4 // in kw/k\n", +"sigmadotcond = 7.95e-4 // in kw/k\n", +"// Calculations\n", +"// The rates of exergy destruction\n", +"EddotComp = T0*sigmadotComp // in kw\n", +"EddotValve = T0*sigmadotValve // in kw\n", +"Eddotcond = T0*sigmadotcond // in kw\n", +"mCP = 3.11 // From the solution to Example 6.14, the magnitude of the compressor power in kW\n", +"// Results\n", +"printf( ' Daily cost in dollars of exergy destruction due to compressor irreversibilities = %.3f',EddotComp*pricerate*24)\n", +"printf( ' Daily cost in dollars of exergy destruction due to irreversibilities in the throttling valve = %.3f',EddotValve*pricerate*24)\n", +"printf( ' Daily cost in dollars of exergy destruction due to irreversibilities in the condenser = %.3f ',Eddotcond*pricerate*24)\n", +"printf( ' Daily cost in dollars of electricity to operate compressor = %.3f',mCP*pricerate*24)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/8-Vapor_Power_Systems.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/8-Vapor_Power_Systems.ipynb new file mode 100644 index 0000000..f4bba27 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/8-Vapor_Power_Systems.ipynb @@ -0,0 +1,552 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Vapor Power Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"p1 = 8.0 // pressure of saturated vapor entering the turbine in MPa\n", +"p3 = 0.008 // pressure of saturated liquid exiting the condenser in MPa\n", +"Wcycledot = 100.00 // the net power output of the cycle in MW\n", +"// Analysis\n", +"// From table A-3\n", +"h1 = 2758.0 // in kj/kg\n", +"s1 = 5.7432 // in kj/kg.k\n", +"s2 = s1\n", +"sf = 0.5926 // in kj/kg.k\n", +"sg = 8.2287 // in kj/kg.k\n", +"hf = 173.88 // in kj/kg\n", +"hfg = 2403.1 // in kj/kg\n", +"v3 = 1.0084e-3 // in m^3/kg\n", +"// State 3 is saturated liquid at 0.008 MPa, so\n", +"h3 = 173.88 // in kj/kg\n", +"// Calculations\n", +"x2 = (s2-sf)/(sg-sf) // quality at state 2\n", +"h2 = hf + x2*hfg\n", +"p4 = p1\n", +"h4 = h3 + v3*(p4-p3)*10**6*10**-3 // in kj/kg\n", +"// Part(a)\n", +"//Mass and energy rate balances for control volumes around the turbine and pump give, respectively\n", +"wtdot = h1 - h2\n", +"wpdot = h4-h3\n", +"// The rate of heat transfer to the working fluid as it passes through the boiler is determined using mass and energy rate balances as\n", +"qindot = h1-h4\n", +"eta = (wtdot-wpdot)/qindot // thermal efficiency)\n", +"// Result for part a\n", +"printf( ' The thermal efficiency for the cycle is %.2f',eta)\n", +"// Part(b)\n", +"bwr = wpdot/wtdot // back work ratio\n", +"// Result\n", +"printf( ' The back work ratio is %f',bwr)\n", +"// Part(c)\n", +"mdot = (Wcycledot*10**3*3600)/((h1-h2)-(h4-h3)) // mass flow rate in kg/h\n", +"// Result \n", +"printf( ' The mass flow rate of the steam is %.2f kg/h .',mdot)\n", +" \n", +"// Part(d)\n", +"Qindot = mdot*qindot/(3600*10**3) // in MW\n", +"// Results\n", +"printf('The rate of heat transfer,Qindot , into the working fluid as it passes through the boiler, is %.2f MW.',Qindot)\n", +"// Part(e)\n", +"Qoutdot = mdot*(h2-h3)/(3600*10**3) // in MW\n", +"// Results\n", +"printf( ' The rate of heat transfer,Qoutdot from the condensing steam as it passes through the condenser, is %.2f MW.',Qoutdot)\n", +"// Part(f)\n", +"// From table A-2\n", +"hcwout= 146.68 // in kj/kg\n", +"hcwin= 62.99 // in kj/kg\n", +"mcwdot= (Qoutdot*10**3*3600)/(hcwout-hcwin) // in kg/h\n", +"// Results\n", +"printf( ' The mass flow rate of the condenser cooling water is %.2f kg/ h.',mcwdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"etat= .85 // given that the turbine and the pump each have an isentropic efficiency of 85%\n", +"// Analysis\n", +"// State 1 is the same as in Example 8.1, so\n", +"h1 = 2758.0 // in kj/kg\n", +"s1 = 5.7432 // in kj/kg.k\n", +"// From example 8.1 \n", +"h1 = 2758.0 // in kj/kg\n", +"h2s = 1794.8 // in kj/kg\n", +"// State 3 is the same as in Example 8.1, so\n", +"h3 = 173.88 // in kj/kg\n", +"// Calculations\n", +"h2 = h1 - etat*(h1-h2s) // in kj/kg\n", +"wpdot = 8.06/etat // where the value 8.06 is obtained from example 8.1\n", +"h4 = h3 + wpdot\n", +"// Part(a)\n", +"eta = ((h1-h2)-(h4-h3))/(h1-h4) // thermal efficiency\n", +"// Result for part (a)\n", +"printf( ' Thermal efficiency is: %.3f',eta)\n", +"// Part(b)\n", +"Wcycledot = 100 // given,a net power output of 100 MW\n", +"// Calculations\n", +"mdot = (Wcycledot*(10**3)*3600)/((h1-h2)-(h4-h3))\n", +"// Result for part (b)\n", +"printf( ' The mass flow rate of steam, in kg/h, for a net power output of 100 MW is %.3f kg/h. ',mdot)\n", +"// Part(c)\n", +"Qindot = mdot*(h1-h4)/(3600 * 10**3)\n", +"// Result\n", +"printf( ' The rate of heat transfer Qindot into the working fluid as it passes through the boiler, is %.3f MW.',Qindot)\n", +"// Part(d)\n", +"Qoutdot = mdot*(h2-h3)/(3600*10**3)\n", +"// Result\n", +"printf( ' The rate of heat transfer Qoutdotfrom the condensing steam as it passes through the condenser, is %.3f MW.',Qoutdot)\n", +"// Part(e)\n", +"// From table A-2\n", +"hcwout = 146.68 // in kj/kg\n", +"hcwin = 62.99 // in kj/kg\n", +"mcwdot = (Qoutdot*10**3*3600)/(hcwout-hcwin)\n", +"// Result\n", +"printf( ' The mass flow rate of the condenser cooling water, is: %.3f kg/h.',mcwdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"clc;\n", +"T1 = 480.0 // temperature of steam entering the first stage turbine in degree celcius\n", +"p1 = 8.0 // pressure of steam entering the first stage turbine in MPa\n", +"p2 = 0.7 // pressure of steam exiting the first stage turbine in MPa\n", +"T3 = 440.0 // temperature of steam before entering the second stage turbine \n", +"Pcond = 0.008 // condenser pressure in MPa\n", +"Wcycledot = 100.0 // the net power output in MW\n", +"// Analysis\n", +"// From table A-4\n", +"h1 = 3348.4 // in kj/kg\n", +"s1 = 6.6586 // in kj/kg.k\n", +"s2 = s1 // isentropic expansion through the first-stage turbine\n", +"// From table A-3\n", +"sf = 1.9922 // in kj/kg.k\n", +"sg = 6.708 // in kj/kg.k\n", +"hf = 697.22 // in kj/kg\n", +"hfg = 2066.3 // in kj/kg\n", +"// Calculations \n", +"x2 = (s2-sf)/(sg-sf)\n", +"h2 = hf + x2*hfg\n", +"// State 3 is superheated vapor with p3 = 0.7 MPa and T3= 440C, so from Table A-4\n", +"h3 = 3353.3 // in kj/kg\n", +"s3 = 7.7571 // in kj/kg.k\n", +"s4 = s3 // isentropic expansion through the second-stage turbine\n", +"// For determing quality at state 4,from table A-3\n", +"sf = 0.5926 // in kj/kg.k\n", +"sg = 8.2287 // in kj/kg.k\n", +"hf = 173.88 // in kj/kg\n", +"hfg = 2403.1 // in kj/kg\n", +"// Calculations\n", +"x4 = (s4-sf)/(sg-sf)\n", +"h4 = hf + x4*hfg\n", +"// State 5 is saturated liquid at 0.008 MPa, so\n", +"h5 = 173.88\n", +"// The state at the pump exit is the same as in Example 8.1, so\n", +"h6 = 181.94\n", +"// Part(a)\n", +"eta = ((h1-h2)+(h3-h4)-(h6-h5))/((h1-h6)+(h3-h2))\n", +"// Result\n", +"printf( '\n The thermal efficiency of the cycle is: %.2f',eta)\n", +"// Part(b)\n", +"mdot = (Wcycledot*3600*10**3)/((h1-h2)+(h3-h4)-(h6-h5))\n", +"printf( '\n The mass flow rate of steam, is: %.2f kg/h.',mdot)\n", +"// Part(c)\n", +"Qoutdot = (mdot*(h4-h5))/(3600*10**3)\n", +"printf('\nThe rate of heat transfer Qoutdot from the condensing steam as it passes through the condenser, is %.2f MW',Qoutdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"// Part (a)\n", +"etat = 0.85 // given efficiency\n", +"// From the solution to Example 8.3, the following specific enthalpy values are known, in kJ/kg\n", +"h1 = 3348.4\n", +"h2s = 2741.8\n", +"h3 = 3353.3\n", +"h4s = 2428.5\n", +"h5 = 173.88\n", +"h6 = 181.94\n", +"// Calculations\n", +"h2 = h1 - etat*(h1 - h2s) // The specific enthalpy at the exit of the first-stage turbine in kj/kg\n", +"h4 = h3 - etat*(h3-h4s) // The specific enthalpy at the exit of the second-stage turbine in kj/kg\n", +"eta = ((h1-h2)+(h3-h4)-(h6-h5))/((h1-h6)+(h3-h2)) \n", +"// Result\n", +"printf( ' The thermal efficiency is: %f',eta)\n", +"// Part (b)\n", +"x = linspace(0.85,1,50)\n", +"for i =1:50\n", +" h2(i) = h1 - x(i)*(h1 - h2s) // The specific enthalpy at the exit of the first-stage turbine in kj/kg\n", +" h4(i) = h3 - x(i)*(h3-h4s) // The specific enthalpy at the exit of the second-stage turbine in kj/kg\n", +" y(i) = ((h1-h2(i))+(h3-h4(i))-(h6-h5))/((h1-h6)+(h3-h2(i))) \n", +"end\n", +"plot(x,y)\n", +"xlabel('isentropic turbine efficiency')\n", +"ylabel('cycle thermal efficiency')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 480.0 // temperature of steam entering the turbine in degree celcius\n", +"p1 = 8.0 // pressure of steam entering the turbine in MPa\n", +"Pcond = 0.008 // condenser pressure in MPa\n", +"etat = 0.85 // turbine efficiency\n", +"Wcycledot = 100.0 // net power output of the cycle\n", +"// Analysis\n", +"// With the help of steam tables\n", +"h1 = 3348.4 // in kj/kg\n", +"h2 = 2832.8 // in kj/kg\n", +"s2 = 6.8606 // in kj/kg.k\n", +"h4 = 173.88 // in kj/kg\n", +"// With s3s = s2, the quality at state 3s is x3s= 0.8208; using this, we get\n", +"h3s = 2146.3 // in kj/kg\n", +"// Calculations\n", +"// The specific enthalpy at state 3 can be determined using the efficiency of the second-stage turbine\n", +"h3 = h2 - etat*(h2-h3s)\n", +"// State 6 is saturated liquid at 0.7 MPa. Thus,\n", +"h6 = 697.22 // in kj/kg\n", +"// For determining specific enthalpies at states 5 and 7 ,we have\n", +"p5 = 0.7 // in MPa\n", +"p4 = 0.008 // in MPa\n", +"p7 = 8.0 // in MPa\n", +"p6 = 0.7 // in MPa\n", +"v4 = 1.0084e-3 // units in m^3/kg,obtained from steam tables\n", +"v6 = 1.1080e-3 // units in m^3/kg,obtained from steam tables\n", +"// Calculations\n", +"h5 = h4 + v4*(p5-p4)*10**6*10**-3 // in kj/kg\n", +"h7 = h6 + v6*(p7-p6)*10**3 // in kj/kg\n", +"// Applying mass and energy rate balances to a control volume enclosing the open heater, we find the fraction y of the flow extracted at state 2 from\n", +"y = (h6-h5)/(h2-h5)\n", +"// Part(a)\n", +"wtdot = (h1-h2) + (1-y)*(h2-h3) // the total turbine work output, units in KJ/Kg\n", +"wpdot = (h7-h6) + (1-y)*(h5-h4) // The total pump work per unit of mass passing through the first-stage turbine,in KJ/kg\n", +"qindot = h1 - h7 // in kj/kg\n", +"eta = (wtdot-wpdot)/qindot\n", +"// Results\n", +"printf( ' The thermal efficiency is: %.2f',eta)\n", +"// Part(b)\n", +"m1dot = (Wcycledot*3600*10**3)/(wtdot-wpdot)\n", +"// Results\n", +"printf( ' The mass flow rate of steam entering the first turbine stage, is: %.2f kg/h.',m1dot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Analysis\n", +"// State 1 is the same as in Example 8.3, so\n", +"h1 = 3348.4 // in kj/kg\n", +"s1 = 6.6586 // in kj/kg.k\n", +"// State 2 is fixed by p2 2.0 MPa and the specific entropy s2, which is the same as that of state 1. Interpolating in Table A-4, we get\n", +"h2 = 2963.5 // in kj/kg\n", +"// The state at the exit of the first turbine is the same as at the exit of the first turbine of Example 8.3, so\n", +"h3 = 2741.8 // in kj/kg\n", +"// State 4 is superheated vapor at 0.7 MPa, 440C. From Table A-4,\n", +"h4 = 3353.3 // in kj/kg\n", +"s4 = 7.7571 // in kj/kg.k\n", +"// Interpolating in table A-4 at p5 = .3MPa and s5 = s4, the enthalpy at state 5 is\n", +"h5 = 3101.5 // in kj/kg\n", +"// Using s6 = s4, the quality at state 6 is found to be\n", +"x6 = 0.9382\n", +"// Using steam tables, for state 6\n", +"hf = 173.88 // in kj/kg\n", +"hfg = 2403.1 // in kj/kg\n", +"h6 = hf + x6*hfg\n", +"// At the condenser exit, we have \n", +"h7 = 173.88 // in kj/kg\n", +"v7 = 1.0084e-3 // in m^3/kg\n", +"p8 = 0.3 // in MPa\n", +"p7 = 0.008 // in MPa\n", +"h8 = h7 + v7*(p8-p7)*10**6*10**-3 // The specific enthalpy at the exit of the first pump in kj/kg\n", +"// The liquid leaving the open feedwater heater at state 9 is saturated liquid at 0.3 MPa. The specific enthalpy is\n", +"h9 = 561.47 // in kj/kg\n", +"// For the exit of the second pump,\n", +"v9 = 1.0732e-3 // in m^3/kg\n", +"p10 = 8.0 // in MPa\n", +"p9 = 0.3 // in MPa\n", +"h10 = h9 + v9*(p10-p9)*10**6*10**-3 // The specific enthalpy at the exit of the second pump in kj/kg\n", +"// The condensate leaving the closed heater is saturated at 2 MPa. From Table A-3,\n", +"h12 = 908.79 // in kj/kg\n", +"h13 = h12 // since The fluid passing through the trap undergoes a throttling process\n", +"// For the feedwater exiting the closed heater\n", +"hf = 875.1 // in kj/kg\n", +"vf = 1.1646e-3 // in m^3/kg\n", +"p11 = 8.0 // in MPa\n", +"psat = 1.73 // in MPa\n", +"h11 = hf + vf*(p11-psat)*10**6*10**-3 // in kj/kg\n", +"ydash = (h11-h10)/(h2-h12) // the fraction of the total flow diverted to the closed heater\n", +"ydashdash = ((1-ydash)*h8+ydash*h13-h9)/(h8-h5) // the fraction of the total flow diverted to the open heater\n", +"// Part(a)\n", +"wt1dot = (h1-h2) + (1-ydash)*(h2-h3) // The work developed by the first turbine per unit of mass entering in kj/kg\n", +"wt2dot = (1-ydash)*(h4-h5) + (1-ydash-ydashdash)*(h5-h6) // The work developed by the second turbine per unit of mass in kj/kg\n", +"wp1dot = (1-ydash-ydashdash)*(h8-h7) // The work for the first pump per unit of mass in kj/kg\n", +"wp2dot = h10-h9 // The work for the second pump per unit of mass in kj/kg\n", +"qindot = (h1-h11) + (1-ydash)*(h4-h3) // The total heat added expressed on the basis of a unit of mass entering the first\n", +" // turbine\n", +"eta = (wt1dot+wt2dot-wp1dot-wp2dot)/qindot // thermal efficiency\n", +"// Result\n", +"printf( ' The thermal efficiency is: %.2f',eta)\n", +"// Part(b)\n", +"Wcycledot = 100.0 // the net power output of the cycle in MW\n", +"m1dot = (Wcycledot*3600*10**3)/(wt1dot+wt2dot-wp1dot-wp2dot)\n", +"// Result\n", +"printf( ' The mass flow rate of the steam entering the first turbine, in kg/h is: %.2f',m1dot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Analysis\n", +"// The solution to Example 8.2 gives\n", +"h1 = 2758 // in kj/kg\n", +"h4 = 183.36 // in kj/kg\n", +"// From table A-22\n", +"hi = 1491.44 // in kj/kg\n", +"he = 843.98 // in kj/kg\n", +"// Using the conservation of mass principle and energy rate balance, the ratio of mass flow rates of air and water is\n", +"madotbymdot = (h1-h4)/(hi-he)\n", +"// From example 8.2\n", +"mdot = 4.449e5 // in kg/h\n", +"madot = madotbymdot*mdot // in kg/h\n", +"// Part(a)\n", +"T0 = 295 // in kelvin\n", +"// From table A-22\n", +"si = 3.34474 // in kj/kg.k\n", +"se = 2.74504 // in MW\n", +"// Calculation\n", +"Rin = madot*(hi-he-T0*(si-se))/(3600*10**3) // The net rate at which exergy is carried into the heat exchanger \n", +" // unit by the gaseous stream \n", +"// Result\n", +"printf('The net rate at which exergy is carried into the heat exchanger unit by the gas stream, is : %.2f MW ',Rin)\n", +"// Part(b)\n", +"// From table A-3\n", +"s1 = 5.7432 // in kj/kg.k\n", +"// From interpolation in table A-5 gives\n", +"s4 = 0.5957 // in kj/kg.k\n", +"// Calculation\n", +"Rout = mdot*(h1-h4-T0*(s1-s4))/(3600*10**3) // in MW\n", +"// Result\n", +"printf( ' The net rate at which exergy is carried from the heat exchanger by the water stream, is : %.2f MW .',Rout)\n", +"// Part(c)\n", +"Eddot = Rin-Rout // in MW\n", +"// Result\n", +"printf( ' The rate of exergy destruction, in MW is : %.2f',Eddot)\n", +"// Part(d)\n", +"epsilon = Rout/Rin\n", +"// Result\n", +"printf( ' The exergetic efficiency is: %.2f',epsilon)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T0 = 295.00 // in kelvin\n", +"P0 = 1.00 // in atm\n", +"// Analysis\n", +"// From table A-3\n", +"s1 = 5.7432 // in kj/kg.k\n", +"s3 =0.5926 // in kj/kg.k\n", +"// Using h2 = 1939.3 kJ/kg from the solution to Example 8.2, the value of s2 can be determined from Table A-3 as\n", +"s2 = 6.2021 // in kj/kg.k\n", +"s4 = 0.5957 // in kj/kg.k\n", +"mdot = 4.449e5 // in kg/h\n", +"// Calculations\n", +"Eddot = mdot*T0*(s2-s1)/(3600*10**3) // the rate of exergy destruction for the turbine in MW\n", +"EddotP = mdot*T0*(s4-s3)/(3600*10**3) // the exergy destruction rate for the pump\n", +"// Results\n", +"printf( ' The rate of exergy destruction for the turbine is: %.2f MW.',Eddot)\n", +"// From the solution to Example 8.7, the net rate at which exergy is supplied by the cooling combustion gases is 231.28 MW\n", +"printf( ' The turbine rate of exergy destruction expressed as a percentage is: %.f',(Eddot/231.28)*100)\n", +"// However, since only 69% of the entering fuel exergy remains after the stack loss and combustion exergy destruction are accounted for, \n", +"// it can be concluded that\n", +"printf( ' Percentage of the exergy entering the plant with the fuel destroyed within the turbine is : %.2f',0.69*(Eddot/231.28)*100)\n", +"printf( ' The exergy destruction rate for the pump in MW is : %.2f ',EddotP)\n", +"printf( 'and expressing this as a percentage of the exergy entering the plant as calculated above, we have %.2f',(EddotP/231.28)*69) \n", +"printf( ' The net power output of the vapor power plant of Example 8.2 is 100 MW. Expressing this as a percentage of the rate at which exergy is ')\n", +"printf( 'carried into the plant with the fuel, %.2f',(100/231.28)*69)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T0 = 295 // in kelvin\n", +"// Analysis\n", +"// From solution to Example 8.2.\n", +"mcwdot = 9.39e6 // mass flow rate of the cooling water in kg/h\n", +"// Part(a)\n", +"// With saturated liquid values for specific enthalpy and entropy from Table A-2\n", +"he = 146.68 // in kj/kg\n", +"hi = 62.99 // in kj/kg\n", +"se = 0.5053 // in kj/kg.k\n", +"si = 0.2245 // in kj/kg.k\n", +"// Calculations\n", +"Rout = mcwdot*(he-hi-T0*(se-si))/(3600*10**3) // The net rate at which exergy is carried out of the condenser in MW\n", +"// Results\n", +"printf( ' The net rate at which exergy is carried from the condenser by the cooling water, is: %.2f MW.',Rout)\n", +"printf( ' Expressing this as a percentage of the exergy entering the plant with the fuel, we get %.2f percent',(Rout/231.28)*69)\n", +"// Part(b)\n", +"// From table \n", +"s3 = 0.5926 // in kj/kg.k\n", +"s2 = 6.2021 // in kg/kg.k\n", +"mdot = 4.449e5 // in kg/h\n", +"// Calculations\n", +"Eddot = T0*(mdot*(s3-s2)+mcwdot*(se-si))/(3600*10**3) // the rate of exergy destruction for the condenser in MW\n", +"// Results\n", +"printf( ' The rate of exergy destruction for the condenser is: %.2f MW.',Eddot)\n", +"printf( ' Expressing this as a percentage of the exergy entering the plant with the fuel, we get, %.2f percent',(Eddot/231.28)*69)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/9-Gas_Power_Systems.ipynb b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/9-Gas_Power_Systems.ipynb new file mode 100644 index 0000000..aeb2169 --- /dev/null +++ b/Fundamental_of_Thermodynamics_by_Moran_and_Shapiro/9-Gas_Power_Systems.ipynb @@ -0,0 +1,884 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Gas Power Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 // in kelvin\n", +"p1 = 100.00 // in kpa\n", +"mdot = 5.807 // in kg/s\n", +"p2 = 300.00 // in kpa\n", +"p3 = p2\n", +"p4 = 1000.00 // in kpa\n", +"p5 = p4\n", +"p6 = p4\n", +"T6 = 1400.00 // in kelvin\n", +"T8 = T6\n", +"p7 = 300.00 // in kpa\n", +"p8 = p7\n", +"etac = 0.8 // isentropic efficiency of compressor\n", +"etat = 0.8 // isentropic efficiency of turbine\n", +"etareg = 0.8 // regenerator effectiveness\n", +"// Analysis\n", +"// From example 9.9\n", +"h1 = 300.19 // in kj/kg\n", +"h3 = h1 // in kj/kg\n", +"h2s = 411.3 // in kj/kg\n", +"h4s = 423.8 // in kj/kg\n", +"// From example 9.8\n", +"h6 = 1515.4 // in kj/kg\n", +"h8 = h6\n", +"h7s = 1095.9 // in kj/kg\n", +"h9s = 1127.6 // in kj/kg\n", +"// Calculations\n", +"h4 = h3 + (h4s-h3)/etac // in kj/kg\n", +"h2 = h1 + (h2s-h1)/etac // in kj/kg\n", +"h9 = h8-etat*(h8-h9s) // in kj/kg\n", +"h7 = h6-etat*(h6-h7s) // in kj/kg\n", +"h5 = h4+etareg*(h9-h4) // in kj/kg\n", +"// Part(a)\n", +"// Calculations\n", +"wtdot = (h6-h7)+(h8-h9) // The total turbine work per unit of mass flow in kj/kg\n", +"wcdot = (h2-h1)+(h4-h3) // The total compressor work input per unit of mass flow in kj/kg\n", +"qindot = (h6-h5)+(h8-h7) // The total heat added per unit of mass flow in kj/kg\n", +"eta = (wtdot-wcdot)/qindot // thermal efficiency\n", +"// Result\n", +"printf( ' The thermal efficiency is: %.2f',eta)\n", +"// Part(b)\n", +"bwr = wcdot/wtdot // back work ratio\n", +"// Result\n", +"printf( ' The back work ratio is: %.2f',bwr)\n", +"// Part(c)\n", +"Wcycledot = mdot*(wtdot-wcdot) // net power developed in kw\n", +"// Result\n", +"printf( ' The net power developed, is: %.2f kW.',Wcycledot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Ta = 240.00 // in kelvin\n", +"pa = 0.8 // in bar\n", +"Va = 278.00 // in m/s\n", +"PR = 8.00 // pressure ratio across the compressor\n", +"T3 = 1200.00 // in kelvin\n", +"p5 = 0.8 // in bar\n", +"// From table A-22\n", +"ha = 240.02 // in kj/kg\n", +"h1 = ha + ((Va**2)/2)*10**-3 // in kj/kg\n", +"// Interpolating in Table A-22 gives\n", +"pr1 = 1.070\n", +"pra = .6355\n", +"// Interpolating in Table A-22, we get\n", +"h2 = 505.5 // in kj/kg\n", +"// At state 3 the temperature is given as T3 = 1200 K. From Table A-22\n", +"h3 = 1277.79 // in kj/kg\n", +"// Interpolating in Table A-22 with h4, gives\n", +"pr4 = 116.8\n", +"// pr data from table A-22 gives\n", +"pr4 = 116.00\n", +"pr3 = 238.00\n", +"// From table A-22\n", +"h5 = 621.3 // in kj/kg\n", +"// The expansion through the nozzle is isentropic to\n", +"p5 = .8 // in bars\n", +"// Calculations\n", +"p1 = (pr1/pra)*pa // in bars\n", +"// With the help of assumption, 'The turbine work output equals the work required to drive the compressor.',\n", +"h4 = h3+h1-h2 // in kj/kg\n", +"p2 = PR*p1 // in bars\n", +"// Using assumption 'There is no pressure drop for flow through the combustor', \n", +"p3 = p2\n", +"p4 = p3*(pr4/pr3) // in bars\n", +"pr5 = pr4*(p5/p4)\n", +"V5 = ((2*(h4-h5)*10**3))**(0.5) // the velocity at the nozzle exit in m/s\n", +"// Results\n", +"printf( ' The velocity at the nozzle exit in m/s is: %.2f', V5)\n", +"printf( ' pa in bars = %.2f',pa)\n", +"printf( ' p1 in bars = %.2f',p1)\n", +"printf( ' p2 in bars = %.2f',p2)\n", +"printf( ' p3 in bars = %.2f',p3)\n", +"printf( ' p4 in bars = %.2f',p4)\n", +"printf( ' p5 in bars = %.2f',p5)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Wnetdot = 45.00 // in MW\n", +"T1 = 300.00 // in kelvin\n", +"p1 = 100.00 // in kpa\n", +"etac = 0.84 // The isentropic efficiency of the compressor\n", +"T3 = 1400.00 // in kelvin\n", +"p2 = 1200.00 // in kpa\n", +"p3 = p2\n", +"etat = 0.88 // isentropic efficiency of the turbine\n", +"T5 = 400.00 // in kelvin\n", +"p4 = 100.00 // in kpa\n", +"p5 = p4\n", +"T7 = 400.00 // in degree celcius\n", +"p7 = 8.00 // in MPa\n", +"etatw =0.9 // isentropic efficiency of turbine of the vapor cycle\n", +"p8 = 8.00 // in kpa\n", +"p9 = p8\n", +"etap = 0.8 // isentropic efficiency of pump of the vapor cycle\n", +"T0 = 300.00 // in kelvin\n", +"p0 = 100.00 // -in kpa\n", +"// Analysis\n", +"// With procedure similar to that used in the examples of chapters 8 and 9,we can determine following property data\n", +"h1 = 300.19 // in kj/kg\n", +"h2 = 669.79 // in kj/kg\n", +"h3 = 1515.42 // in kj/kg\n", +"h4 = 858.02 // in kj/kg\n", +"h5 = 400.98 // in kj/kg\n", +"h6 = 183.96 // in kj/kg\n", +"h7 = 3138.30 // in kj/kg\n", +"h8 = 2104.74 // in kj/kg\n", +"h9 = 173.88 // in kj/kg\n", +"s1 = 1.7020 // in kj/kg.k\n", +"s2 = 2.5088 // in kj/kg.k\n", +"s3 = 3.3620 // in kj/kg.k \n", +"s4 = 2.7620 // in kj/kg.k\n", +"s5 = 1.9919 // in kj/kg.k\n", +"s6 = 0.5975 // in kj/kg.k\n", +"s7 = 6.3634 // in kj/kg.k\n", +"s8 = 6.7282 // in kj/kg.k\n", +"s9 = 0.5926 // in kj/kg.k\n", +"// Part(a)\n", +"// By applying mass and energy rate balances\n", +"// Calculations\n", +"mvdotbymgdot = (h4-h5)/(h7-h6) // ratio of mass flow rates of vapor and air\n", +"mgdot = (Wnetdot*10**3)/(((h3-h4)-(h2-h1)) + mvdotbymgdot*((h7-h8)-(h6-h9))) // mass flow rate of air in kg/s\n", +"mvdot = mvdotbymgdot*mgdot // mass flow rate of vapor in kg/s\n", +"Wgasdot = mgdot*((h3-h4)-(h2-h1))*10**-3 // net power developed by gas turbine in MW\n", +"Wvapdot = mvdot*((h7-h8)-(h6-h9))*10**-3 // net power developed by vapor cycle in MW\n", +"// Results\n", +"printf( ' Mass flow rate of air is: %.2f kg/s.',mgdot)\n", +"printf( ' Mass flow rate of vapor is: %.2f kg/s.',mvdot)\n", +"printf( ' Net power developed by gas turbine is: %.2f MW.',Wgasdot)\n", +"printf( ' Net power developed by vapor cycle is: %.2f MW.',Wvapdot)\n", +"// Part(b)\n", +"// The net rate of exergy increase of the air passing through the combustor is\n", +"Edotf32 = mgdot*(h3-h2-T0*(s3-s2))*10**-3 // in MW\n", +"// The net rate exergy is carried out by the exhaust air stream at 5 is\n", +"Edotf51 = mgdot*(h5-h1-T0*(s5-s1))/10**3 // in MW\n", +"// The net rate exergy is carried out as the water passes through the condenser is\n", +"Edotf89 = mvdot*(h8-h9-T0*(s8-s9))*10**-3 // in MW\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// The rate of exergy destruction for air turbine is\n", +"Eddott = mgdot*T0*(s4-s3-(R/M)*log(p4/p3))/10**3 // in MW\n", +"// The rate of exergy destruction for compressor is\n", +"Eddotc = mgdot*T0*(s2-s1-(R/M)*log(p2/p1))/10**3 // in MW\n", +"// The rate of exergy destruction for steam turbine is\n", +"Eddotst = mvdot*T0*(s8-s7)/10**3 // in MW\n", +"// The rate of exergy destruction for pump is\n", +"Eddotp = mvdot*T0*(s6-s9)/10**3 // in MW\n", +"// For heat exchanger\n", +"EddotHE = T0*(mgdot*(s5-s4)+mvdot*(s7-s6))/10**3 // in MW\n", +"// Results\n", +"printf( ' Balance sheet')\n", +"printf( 'Net exergy increase of the gas passing')\n", +"printf( ' Through the combustor: %.2f MW',Edotf32)\n", +"printf( 'Disposition of the exergy:')\n", +"printf( '• Net power developed')\n", +"printf( 'gas turbine cycle %.2f MW',Wgasdot)\n", +"printf( 'vapor cycle %.2f MW',Wvapdot)\n", +"printf( '• Net exergy lost')\n", +"printf( 'with exhaust gas at state 5 %.2f MW',Edotf51)\n", +"printf( 'from water passing through condenser %.2f MW',Edotf89)\n", +"printf( '• Exergy destruction')\n", +"printf( 'air turbine %.2f MW',Eddott)\n", +"printf( 'compressor %.2f MW',Eddotc)\n", +"printf( 'steam turbine %.2f MW',Eddotst)\n", +"printf( 'pump %.2f MW',Eddotp)\n", +"printf( 'heat exchanger %.2f MW',EddotHE)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.14: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"Tnot = 360.00 // in kelvin\n", +"pnot = 1.00 // in MPa\n", +"A2 = 0.001 // in m^2\n", +"k = 1.4\n", +"// Calculations\n", +"pstarbypnot = (1+(k-1)/2)**(k/(1-k))\n", +"pstar = pstarbypnot*pnot\n", +"// Part(a)\n", +"// Since back pressure of 500 kpa is less than critical pressure pstar(528kpa in this case) found above, the nozzle is choked\n", +"// At the exit\n", +"M = 1.00\n", +"p2 = pstar // in MPa\n", +"T2 = Tnot/(1+((k-1)/2)*(M**2)) // exit temperature in kelvin\n", +"R = 8.314 // universal gas constant, in SI units\n", +"Mwt = 28.97 // molar mass of air in grams\n", +"V2 = ((k*(R/Mwt)*T2*10**3)**0.5) // exit velocity in m/s\n", +"mdot = (p2/((R/Mwt)*T2))*A2*V2*10**3 // mass flow rate in kg/s\n", +"// Results\n", +"printf( ' The exit mach number for back pressure of 500kpa is: %.2f',M)\n", +"printf( ' The mass flow rate in kg/s for back pressure of 500kpa is: %.2f',mdot)\n", +"// Part(b)\n", +"// Since the back pressure of 784kpa is greater than critical pressure of pstar determined above,the flow throughout the nozzle is subsonic and the exit pressure equals the back pressure,\n", +"p2 = 784.00 // exit pressure in kpa\n", +"// Calculations\n", +"M2 = (((2.00)/(k-1))*(((pnot*10**3)/p2)**((k-1)/k)-1))**0.5 // exit mach number\n", +"T2 = Tnot/(1+((k-1)/2)*(M2**2)) // exit temperature in kelvin\n", +"V2 = M2*((k*(R/Mwt)*10**3*T2)**0.5) // exit velocity in m/s\n", +"mdot2 = (p2/((R/Mwt)*T2))*A2*V2 // mass flow rate in kg/s\n", +"// Results\n", +"printf( ' The mass flow rate at the exit for back pressure of 784kpa is: %.2f kg/s.',mdot2)\n", +"printf( ' The exit mach number for back pressure of 784 kpa is: %.2f',M2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.15: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"Mt = 0.7 // mach mumber at the throat\n", +"At = 6.25 // throat area in cm^2\n", +"Ae = 15.00 // exit area in cm^2\n", +"// The flow throughout the nozzle, including the exit, is subsonic. Accordingly, with this value for A2byAstar, Table 9.1 gives\n", +"M2 = 0.24\n", +"// For M2 = 0.24,\n", +"T2byTnot = 0.988\n", +"p2bypnot = 0.959\n", +"k = 1.4\n", +"T0 = 280.00 // in kelvin\n", +"pnot = 6.8 // in bars\n", +"// Calculations\n", +"// With Mt = 0.7, Table 9.1 gives\n", +"AtbyAstar = 1.09437\n", +"A2byAstar = (Ae/At)*AtbyAstar\n", +"T2 = T2byTnot*T0 // in kelvin\n", +"p2 = p2bypnot*pnot // in bars\n", +"V2 = M2*((k*(8.314/28.97)*T2*10**3)**0.5) // velocity at the exit in m/s\n", +"mdot = (p2/((8.314/28.97)*T2))*Ae*V2*10**-2 // mass flow rate in kg/s\n", +"// Results\n", +"printf( ' Part(a) the mass flow rate in kg/s is: %.2f',mdot)\n", +"printf( ' The exit pressure in bars is: %.2f',p2)\n", +"printf( ' The exit mach number is: %.2f',M2)\n", +"// Part(b)\n", +"Mt = 1.00 // mach number at the throat\n", +"// From table 9.1\n", +"M2 = 0.26\n", +"T2byTnot = 0.986 \n", +"p2bypnot = 0.953\n", +"T0 = 280.00 // in kelvin\n", +"pnot = 6.8 // in bars\n", +"// Calculations\n", +"T2 = T2byTnot*T0 // in kelvin\n", +"p2 = p2bypnot*pnot // in bars\n", +"k = 1.4\n", +"V2 = M2*((k*(8314/28.97)*T2)**0.5) // exit velocity in m/s\n", +"mdot = (p2/((8.314/28.97)*T2))*Ae*V2*10**-2 // mass flow rate in kg/s\n", +"// Results\n", +"printf( ' Part(b) the mass flow rate is: %.f kg/s.',mdot)\n", +"printf( ' The exit pressure is: %f bars. ',p2)\n", +"printf( ' The exit mach number is: %f',M2)\n", +"// Part(c)\n", +"// From part (b), the exit Mach number in the present part of the example is\n", +"M2 = 2.4\n", +"// Using this, Table 9.1 gives\n", +"p2bypnot = 0.0684\n", +"pnot = 6.8 // in bars\n", +"// Calculation\n", +"p2 = p2bypnot*pnot // in bars\n", +"// Results\n", +"// Since the nozzle is choked, the mass flow rate is the same as found in part (b).\n", +"printf( ' Part(c) the mass flow rate is: %f kg/s.',mdot)\n", +"printf( ' The exit pressure is: %f bars.',p2)\n", +"printf( ' The exit mach number is: %f',M2)\n", +"// Part(d)\n", +"// Since a normal shock stands at the exit and the flow upstream of the shock is isentropic, the Mach number Mx and the pressure px correspond to the values found in part (c), \n", +"Mx = 2.4\n", +"px = 0.465 // in bars\n", +"// Then, from Table 9.2\n", +"My = 0.52\n", +"//py is the exit pressure\n", +"pybypx = 6.5533\n", +"py = px*pybypx\n", +"// The pressure downstream of the shock is thus 3.047 bars. This is the exit pressure\n", +"// The mass flow is the same as found in part (b).\n", +"// Results\n", +"printf( ' Part(d) the mass flow rate is: %f kg/s.',mdot)\n", +"printf( ' The exit pressure is: %.3f bars.',py)\n", +"printf( ' The exit mach number is: %f',My)\n", +"// Part(e)\n", +"// A shock stands in the diverging portion where the area is\n", +"Ax = 12.5 // in cm^2\n", +"// Since a shock occurs, the flow is sonic at the throat, so\n", +"Axstar = 6.25 // in cm^2\n", +"At = Axstar\n", +"// The Mach number Mx can then be found from Table 9.1, by using AxbyAxstar as\n", +"Mx = 2.2\n", +"// Results\n", +"// With Mx = 2.2, the ratio of stagnation pressures is obtained from Table 9.2 as\n", +"pnotybypnotx = 0.62812\n", +"// Using this ratio and noting that the flow is subsonic after the shock, Table 9.1 gives\n", +"M2 = 0.43\n", +"// For M2 = 0.43,\n", +"p2bypnoty = 0.88\n", +"// Calculations\n", +"A2byAystar = (Ae/Axstar)*pnotybypnotx\n", +"p2 = p2bypnoty*pnotybypnotx*pnot // in bars\n", +"// Results\n", +"// Since the flow is choked, the mass flow rate is the same as that found in part (b).\n", +"printf( ' part(e) the mass flow rate is: %f kg/s.',mdot)\n", +"printf( ' the exit pressure is: %f bars',p2)\n", +"printf( ' the exit mach number is: %f',M2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 // The temperature at the beginning of the compression process in kelvin\n", +"p1 = 1.00 // the pressure at the beginning of the compression process in bar\n", +"r = 8.00 // compression ratio\n", +"V1 = 560.00 // the volume at the beginning of the compression process in cm^3\n", +"T3 = 2000.00 // maximum temperature during the cycle in kelvin\n", +"// Part(a)\n", +"// At T1 = 300k,table A-22 gives\n", +"u1 = 214.07 // in kj/kg\n", +"vr1 = 621.2 \n", +"// Interpolating with vr2 in Table A-22, we get\n", +"T2 = 673.00 // in kelvin\n", +"u2 = 491.2 // in kj/kg\n", +"// At T3 = 2000 K, Table A-22 gives\n", +"u3 = 1678.7 // in kj/kg\n", +"vr3 = 2.776\n", +"// Interpolating in Table A-22 with vr4 gives\n", +"T4 = 1043 // in kelvin\n", +"u4 = 795.8 // in kj/kg\n", +"// Calculations\n", +"// For the isentropic compression Process 1–2\n", +"vr2 = vr1/r\n", +"// With the ideal gas equation of state\n", +"p2 = p1*(T2/T1)*(r) // in bars\n", +"// Since Process 2–3 occurs at constant volume, the ideal gas equation of state gives\n", +"p3 = p2*(T3/T2) // in bars\n", +"// For the isentropic expansion process 3–4\n", +"vr4 = vr3*(r)\n", +"// The ideal gas equation of state applied at states 1 and 4 gives\n", +"p4 = p1*(T4/T1) // in bars\n", +"// Results\n", +"printf( ' At state1, the pressure is: %f bar.',p1)\n", +"printf( ' At state1, the temperature is %f kelvin.',T1)\n", +"printf( ' At state2, the pressure is : %.3f bar.',p2)\n", +"printf( ' At state2, the temperature is %f kelvin.',T2)\n", +"printf( ' At state3, the pressure is : %.3f bar.',p3)\n", +"printf( ' At state3, the temperature is %f kelvin.',T3)\n", +"printf( ' At state4, the pressure is : %.4f bar.',p4)\n", +"printf( ' At state4, the temperature is %f kelvin.',T4)\n", +"// Part(b)\n", +"eta = 1-(u4-u1)/(u3-u2) // thermal efficiency\n", +"// Result\n", +"printf( ' The thermal efficiency is : %.2f ',eta)\n", +"// Part(c)\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// Calculations\n", +"m = ((p1*V1)/((R/M)*T1))*10**-6*10**5*10**-3 // mass of the air in kg\n", +"Wcycle = m*((u3-u4)-(u2-u1)) // the net work per cycle in KJ\n", +"mep = (Wcycle/(V1*(1-1/r)))*10**6*10**3*10**-5 // in bars\n", +"// Result\n", +"printf( ' The mean effective pressure, is : %.4f atm.',mep)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"clc;\n", +"r = 18.00 // compression ratio\n", +"T1 = 300.00 // temperature at the beginning of the compression process in kelvin\n", +"p1 = 0.1 // pressure at the beginning of the compression process in MPa\n", +"rc = 2.00 // cutoff ratio\n", +"// Part(a)\n", +"// With T1 = 300 K, Table A-22 gives\n", +"u1 = 214.07 // in kj/kg\n", +"vr1 = 621.2 \n", +"// Interpolating in Table A-22, we get\n", +"T2 = 898.3 // in kelvin \n", +"h2 = 930.98 // in kj/kg\n", +"// From Table A-22,\n", +"h3 = 1999.1 // in kj/kg\n", +"vr3 = 3.97\n", +"// Interpolating in Table A-22 with vr4, we get\n", +"u4 = 664.3 // in kj/kg\n", +"T4 = 887.7 // in kelvin\n", +"// Calculations\n", +"// Since Process 2–3 occurs at constant pressure, the ideal gas equation of state gives\n", +"T3 = rc*T2 // in kelvin\n", +"// With the ideal gas equation of state\n", +"p2 = p1*(T2/T1)*(r) // in MPa\n", +"p3 = p2\n", +"// For the isentropic compression process 1–2\n", +"vr2 = vr1/r\n", +"// For the isentropic expansion process 3–4\n", +"vr4 = (r/rc)*vr3\n", +"// The ideal gas equation of state applied at states 1 and 4 gives\n", +"p4 = p1*(T4/T1) // in MPa\n", +"// Results\n", +"printf( '\n At state1, the pressure is : %.2f bar.',p1)\n", +"printf( '\n At state1, the temperature is %.2f kelvin.' ,T1)\n", +"printf( '\n At state2, the pressure in bar is : %.2f bar.',p2)\n", +"printf( '\n At state2, the temperature is %.2f kelvin.',T2)\n", +"printf( '\n At state3, the pressure in bar is : %.2f bar.',p3)\n", +"printf( '\n At state3, the temperature is %.2f kelvin.',T3)\n", +"printf( '\n At state4, the pressure is: %.2f MPa.',p4)\n", +"printf( '\n At state4, the temperature is %.2f kelvin.',T4)\n", +"// Part(b)\n", +"eta = 1- (u4-u1)/(h3-h2)\n", +"printf( '\n The thermal efficiency is : %.2f ',eta)\n", +"// Part(c)\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// Calculations\n", +"wcycle = (h3-h2)-(u4-u1) // The net work of the cycle in kj/kg\n", +"v1 = ((R/M)*T1/p1)/10**3 // The specific volume at state 1 in m^3/kg\n", +"mep = (wcycle/(v1*(1-1/r)))*10**3*10**-6 // in MPa\n", +"// Results\n", +"printf( '\n The mean effective pressure, is : %.2f MPa.',mep)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given :-\n", +"T1 = 300.00 // beginning temperature in kelvin\n", +"p1 = 0.1 // beginning pressure in MPa\n", +"r = 18.00 // compression ratio\n", +"pr = 1.5 // The pressure ratio for the constant volume part of the heating process\n", +"vr = 1.2 // The volume ratio for the constant pressure part of the heating process\n", +"// Analysis\n", +"// States 1 and 2 are the same as in Example 9.2, so \n", +"u1 = 214.07 // in kj/kg\n", +"T2 = 898.3 // in kelvin\n", +"u2 = 673.2 // in kj/kg\n", +"// Interpolating in Table A-22, we get\n", +"h3 = 1452.6 // in kj/kg\n", +"u3 = 1065.8 // in kj/kg\n", +"// From Table A-22,\n", +"h4 = 1778.3 // in kj/kg\n", +"vr4 = 5.609\n", +"// Interpolating in Table A-22, we get\n", +"u5 = 475.96 // in kj/kg\n", +"// Calculations\n", +"// Since Process 2–3 occurs at constant volume, the ideal gas equation of state reduces to give\n", +"T3 = pr*T2 // in kelvin\n", +"// Since Process 3–4 occurs at constant pressure, the ideal gas equation of state reduces to give\n", +"T4 = vr*T3 // in kelvin\n", +"// Process 4–5 is an isentropic expansion, so\n", +"vr5 = vr4*r/vr\n", +"// Part(a)\n", +"eta = 1-(u5-u1)/((u3-u2)+(h4-h3))\n", +"// Result\n", +"printf( ' The thermal efficiency is : %.2f',eta)\n", +"// Part(b)\n", +"// The specific volume at state 1 is evaluated in Example 9.2 as\n", +"v1 = 0.861 // in m^3/kg\n", +"mep = (((u3-u2)+(h4-h3)-(u5-u1))/(v1*(1-1/r)))*10**3*10**-6 // in MPa\n", +"// Result\n", +"printf( ' The mean effective pressure, is : %.2f MPa.',mep)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 // in kelvin\n", +"AV = 5.00 // volumetric flow rate in m^3/s\n", +"p1 = 100.00 // in kpa\n", +"pr = 10.00 // compressor pressure ratio\n", +"T3 = 1400.00 // turbine inlet temperature in kelvin\n", +"// Analysis\n", +"// At state 1, the temperature is 300 K. From Table A-22,\n", +"h1 = 300.19 // in kj/kg\n", +"pr1 = 1.386\n", +"// Interpolating in Table A-22,\n", +"h2 = 579.9 // in kj/kg\n", +"// From Table A-22\n", +"h3 = 1515.4 // in kj/kg\n", +"pr3 = 450.5\n", +"// Interpolating in Table A-22, we get\n", +"h4 = 808.5 // in kj/kg\n", +"// calculations\n", +"pr2 = pr*pr1\n", +"pr4 = pr3*1/pr\n", +"// Part(a)\n", +"eta = ((h3-h4)-(h2-h1))/(h3-h2) // thermal efficiency\n", +"// Result\n", +"printf( ' The thermal efficiency is : %.4f ',eta)\n", +"// Part(b)\n", +"bwr = (h2-h1)/(h3-h4) // back work ratio\n", +"// Result\n", +"printf( ' The back work ratio is : %.4f',bwr)\n", +"// Part(c)\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// Calculations\n", +"mdot = AV*p1/((R/M)*T1) // mass flow rate in kg/s\n", +"Wcycledot = mdot*((h3-h4)-(h2-h1)) // The net power developed\n", +"// Result\n", +"printf( ' The net power developed, is : %.2f kW .',Wcycledot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 // in kelvin\n", +"AV = 5.00 // volumetric flow rate in m^3/s\n", +"p1 = 100.00 // in kpa\n", +"pr = 10.00 // compressor pressure ratio\n", +"T3 = 1400.00 // turbine inlet temperature in kelvin\n", +"Wt_ms = 706.9 // kJ/kg\n", +"Wc_m = 279.7 \n", +"// Analysis\n", +"// At state 1, the temperature is 300 K. From Table A-22,\n", +"h1 = 300.19 // in kj/kg\n", +"pr1 = 1.386\n", +"// Interpolating in Table A-22,\n", +"h2 = 579.9 // in kj/kg\n", +"// From Table A-22\n", +"h3 = 1515.4 // in kj/kg\n", +"pr3 = 450.5\n", +"// Interpolating in Table A-22, we get\n", +"h4 = 808.5 // in kj/kg\n", +"// calculations\n", +"Wtbym = 0.8*Wt_ms\n", +"Wcbym = Wc_m/0.8\n", +"h2 = 300.19 + Wcbym\n", +"//pr2 = pr*pr1\n", +"//pr4 = pr3*1/pr\n", +"// Part(a)\n", +"//eta = ((h3-h4)-(h2-h1))/(h3-h2) // thermal efficiency\n", +"Qinbym = h3 - h2\n", +"n = (Wtbym-Wcbym)/Qinbym\n", +"// Result\n", +"printf( '\n The thermal efficiency is : %.3f ',n)\n", +"// Part(b)\n", +"//bwr = (h2-h1)/(h3-h4) // back work ratio\n", +"bwr = Wcbym/Wtbym\n", +"// Result\n", +"printf( '\n The back work ratio is : %.3f',bwr)\n", +"// Part(c)\n", +"R = 8.314 // universal gas constant, in SI units\n", +"M = 28.97 // molar mass of air in grams\n", +"// Calculations\n", +"//mdot = AV*p1/((R/M)*T1) // mass flow rate in kg/s\n", +"Wcycledot = 5.807*(Wcbym-Wtbym) // The net power developed\n", +"// Result\n", +"printf( '\n The net power developed, is : %.f kW .',-Wcycledot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Part(a)\n", +"etareg = 0.8 // regenerator effectiveness of 80%.\n", +"// From example 9.4\n", +"h1 = 300.19 // in kj/kg\n", +"h2 = 579.9 // in kj/kg\n", +"h3 = 1515.4 // in kj/kg\n", +"h4 = 808.5 // in kj/kg\n", +"// Calculations\n", +"hx = etareg*(h4-h2)+h2 // in kj/kg\n", +"eta = ((h3-h4)- (h2-h1))/(h3-hx) // thermal efficiency\n", +"// Result\n", +"printf('The thermal efficiency is: %.2f',eta)\n", +"// Part(b)\n", +"etareg = linspace(0,0.8,50)\n", +"for i = 1:50\n", +" x(i) = (etareg(i)*(h4-h2))+h2 \n", +" eta(i) = ((h3-h4)- (h2-h1))/(h3-x(i))\n", +"end\n", +"plot(etareg,eta)\n", +"xlabel('Regenerator effectiveness')\n", +"ylabel('Thermal efficiency')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"// Analysis\n", +"// States 1, 2, and 3 are the same as in Example 9.4:\n", +"h1 = 300.19 // in kj/kg\n", +"h2 = 579.9 // in kj/kg\n", +"h3 = 1515.4 // in kj/kg\n", +"// The temperature at state b is the same as at state 3, so \n", +"hb = h3\n", +"pa = 300.00 // in kpa\n", +"p3 = 1000.00 // in kpa\n", +"// From table A-22\n", +"pr3 = 450.5\n", +"// Interpolating in Table A-22, we get\n", +"ha = 1095.9 // in kj/kg\n", +"p4 = 100.00 // in kpa\n", +"pb = 300.00 // in kpa\n", +"// Interpolating in Table A-22, we obtain\n", +"h4 = 1127.6 // in kj/kg\n", +"// Calculions\n", +"pra = pr3*(pa/p3)\n", +"prb = pra\n", +"pr4 = prb*(p4/pb)\n", +"// Since the regenerator effectiveness is 100%,\n", +"hx = h4\n", +"eta = ((h3-ha)+(hb-h4)-(h2-h1))/((h3-hx)+(hb-ha)) // thermal efficiency\n", +"// Result\n", +"printf( ' The thermal efficiency is : %.2f ', eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: Example.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Given:-\n", +"T1 = 300.00 // in kelvin\n", +"p1 = 100.00 // in kpa\n", +"p2 = 1000.00 // in kpa\n", +"p3 = p2\n", +"pc = 300.00 // in kpa\n", +"pd = 300.00 // in kpa\n", +"Td = 300.00 // in kelvin\n", +"// Part(a)\n", +"// From table A-22\n", +"prd = 1.386\n", +"// Interpolating in Table A-22, we get\n", +"T2 = 422 // in kelvin\n", +"h2 = 423.8 // in kj/kg\n", +"// Calculations\n", +"pr2 = prd*(p2/pd)\n", +"// Result\n", +"printf( ' The temperature at the exit of the second compressor stage is : %.2f kelvin.',T2)\n", +"// Part(b)\n", +"// From Table A-22 at T1 = 300\n", +"h1 = 300.19 // in kj/kg\n", +"// Since Td = T1,\n", +"hd = 300.19 // in kj/kg\n", +"// with pr data from Table A-22 together\n", +"pr1 = 1.386\n", +"// Interpolating in Table A-22, we obtain\n", +"hc = 411.3 // in kj/kg\n", +"// Calculations\n", +"prc = pr1*(pc/p1)\n", +"wcdot = (hc-h1)+(h2-hd) // The total compressor work per unit of mass in kj/kg\n", +"// Result\n", +"printf( ' The total compressor work input per unit of mass flow is : %.2f kJ/kg',wcdot)\n", +"// Part(c)\n", +"// Interpolating in Table A-22, we get\n", +"T3 = 574 // in kelvin\n", +"h3 = 579.9 // in kj/kg\n", +"// Calculations\n", +"pr3 = pr1*(p3/p1)\n", +"wcdot = h3-h1 // The work input for a single stage of compression in kj/kg\n", +"// Results\n", +"printf( ' For a single stage of compression, the temperature at the exit state is : %.2f kelvin',T3)\n", +"printf( ' For a single stage of compression, the work input is : %.2f kJ.',wcdot)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |