diff options
Diffstat (limited to 'Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran')
13 files changed, 8384 insertions, 0 deletions
diff --git a/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/10-Refrigeration_and_heat_pump_systems.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/10-Refrigeration_and_heat_pump_systems.ipynb new file mode 100644 index 0000000..8205f91 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/10-Refrigeration_and_heat_pump_systems.ipynb @@ -0,0 +1,353 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Refrigeration and heat pump systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(10.1) Refrigerant 134a is the working fluid in an ideal vapor-compression refrigeration cycle that communicates thermally with a cold region at 0C and a warm region at 26C. Saturated vapor enters the compressor at 0C and saturated liquid leaves the condenser at 26C. The mass flow rate of the refrigerant is 0.08 kg/s. Determine (a) the compressor power, in kW, (b) the refrigeration capacity, in tons, (c) the coefficient of performance, and (d) the coefficient of performance of a Carnot refrigeration cycle operating between warm and cold regions at 26 and 0C, respectively.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"\n", +"Tc = 273 //temperature of cold region in kelvin\n", +"Th = 299 //temperature of hot region in kelvin\n", +"mdot = .08 //mass flow rate in kg/s\n", +"\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 = .9190 //in kj/kg.k\n", +"\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", +"\n", +"//part(a)\n", +"Wcdot = mdot*(h2s-h1) //The compressor work input in KW\n", +"printf('the compressor power, in kW, is: %f',Wcdot)\n", +"\n", +"//part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 //refrigeration capacity in ton\n", +"printf('\nthe refrigeration capacity in tons is: %f',Qindot)\n", +"\n", +"//part(c)\n", +"funcprot(0)\n", +"beta = (h1-h4)/(h2s-h1)\n", +"printf('\nthe coefficient of performance is: %f',beta)\n", +"\n", +"//part(d)\n", +"betamax = Tc/(Th-Tc)\n", +"printf('\n the coefficient of performance of a Carnot refrigeration cycle operating between warm and cold regions at 26 and 0C, respectively is: %f',betamax)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(10.2) Modify Example 10.1 to allow for temperature differences between the refrigerant and the warm and cold regions as follows. Saturated vapor enters the compressor at 10C. Saturated liquid leaves the condenser at a pressure of 9 bar. Determine for the modified vapor-compression refrigeration cycle (a) the compressor power, in kW, (b) the refrigeration capacity, in tons, (c) the coefficient of performance. Compare results with those of Example 10.1.\n", +"\n", +"//solution\n", +"mdot = .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", +"\n", +"//part(a)\n", +"Wcdot = mdot*(h2s-h1) //The compressor power input in KW\n", +"printf('the compressor power in kw is: %f',Wcdot)\n", +"\n", +"//part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 //refrigeration capacity in tons\n", +"printf('\nthe refrigeration capacity in tons is: %f',Qindot)\n", +"\n", +"//part(c)\n", +"beta = (h1-h4)/(h2s-h1)\n", +"printf('\nthe coefficient of performance is: %f',beta)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(10.3) Reconsider the vapor-compression refrigeration cycle of Example 10.2, but include in the analysis that the compressor has an efficiency of 80%. Also, let the temperature of the liquid leaving the condenser be 30C. Determine for the modified cycle (a) the compressor power, in kW, (b) the refrigeration capacity, in tons, (c) the coefficient of performance, and (d) the rates of exergy destruction within the compressor and expansion valve, in kW, for T0 = 299 K (26C).\n", +"\n", +"//solution\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", +"\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", +"\n", +"//part(a)\n", +"Wcdot = mdot*(h2-h1) //compressor power in kw\n", +"printf('the compressor power in kw is: %f',Wcdot)\n", +"\n", +"//part(b)\n", +"Qindot = mdot*(h1-h4)*60/211 //refrigeration capacity in ton\n", +"printf('\n\nnthe refrigeration capacity in ton is: %f',Qindot)\n", +"\n", +"//part(c)\n", +"beta = (h1-h4)/(h2-h1) //coefficient of performance \n", +"printf('\n\nthe coefficient of performance is: %f',beta)\n", +"\n", +"//part(d)\n", +"Eddotc = mdot*Tnot*(s2-s1) //in kw\n", +"Eddotv = mdot*Tnot*(s4-s3) //in kw\n", +"printf('\n\nthe rate of exergy destruction within the compressor is: %f',Eddotc)\n", +"printf('\nthe rate of exergy destruction within the valve is: %f',Eddotv)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(10.4) Air enters the compressor of an ideal Brayton refrigeration cycle at 1 bar, 270K, with a volumetric flow rate of 1.4 m3/s. If the compressor pressure ratio is 3 and the turbine inlet temperature is 300K, determine (a) the net power input, in kW, (b) the refrigeration capacity, in kW, (c) the coefficient of performance\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 1 //in bar\n", +"T1 = 270 //in kelvin\n", +"AV = 1.4 //in m^3/s\n", +"r = 3 //compressor pressure ratio\n", +"T3 = 300 //turbine inlet temperature in kelvin\n", +"\n", +"//analysis\n", +"//From Table A-22,\n", +"h1 = 270.11 //in kj/kg\n", +"pr1 = .9590\n", +"pr2 = r*pr1\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", +"pr4 = pr3/r\n", +"//Interpolating in Table A-22, we obtain\n", +"h4s = 219 //in kj/kg\n", +"\n", +"//part(a)\n", +"R = 8.314 //universal gas constant, in SI units\n", +"M = 28.97 //molar mass of air in grams\n", +"mdot = (AV*p1)/((R/M)*T1)*10^2 //mass flow rate in kg/s\n", +"\n", +"Wcycledot = mdot*((h2s-h1)-(h3-h4s))\n", +"printf('the net power input in kw is: %f',Wcycledot)\n", +"\n", +"//part(b)\n", +"Qindot = mdot*(h1-h4s) //refrigeration capacity in kw\n", +"printf('\nthe refregeration capacity in kw is: %f',Qindot)\n", +"\n", +"//part(c)\n", +"beta = Qindot/Wcycledot //coefficient of performance\n", +"printf('\nthe coefficient of performance is: %f',beta)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(10.5) Reconsider Example 10.4, but include in the analysis that the compressor and turbine each have an isentropic efficiency of 80%. Determine for the modified cycle (a) the net power input, in kW, (b) the refrigeration capacity, in kW, (c) the coefficient of performance, and interpret its value.\n", +"\n", +"//solution\n", +"funcprot(0)\n", +"\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 = .8 //isentropic efficiency of compressor\n", +"Wcdot = mdot*wcdots/etac //The power input to the compressor in kw\n", +"\n", +"//Using data form the solution to Example 10.4 gives\n", +"wtdots =81.19 //in kj/kg\n", +"etat = .8 //isentropic efficiency of turbine\n", +"Wtdot = mdot*etat*wtdots //actual turbine work in kw\n", +"\n", +"Wdotcycle = Wcdot-Wtdot //The net power input to the cycle in kw\n", +"printf('the net power input in kw is: %f',Wdotcycle)\n", +"\n", +"//part(b)\n", +"h3 = 300.19 //in kj/kg\n", +"h4 = h3 -Wtdot/mdot\n", +"//from table A-22\n", +"h1 = 270.11 //in kj/kg\n", +"Qindot = mdot*(h1-h4) //refrigeration capacity in kw\n", +"printf('\nthe refrigeration capacity in kw is: %f',Qindot)\n", +"\n", +"//part(c)\n", +"beta = Qindot/Wdotcycle //coefficient of performance \n", +"printf('\nthe coefficient of performance is: %f',beta)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/11-Thermodynamic_relations.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/11-Thermodynamic_relations.ipynb new file mode 100644 index 0000000..df3c288 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/11-Thermodynamic_relations.ipynb @@ -0,0 +1,644 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Thermodynamic relations" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.10) A mixture consisting of 0.18 kmol of methane (CH4) and 0.274 kmol of butane (C4H10) occupies a volume of 0.241 m3 at a temperature of 238C. The experimental value for the pressure is 68.9 bar. Calculate the pressure, in bar, exerted by the mixture by using (a) the ideal gas equation of state, (b) Kay’s rule together with the generalized compressibility chart, (c) the van der Waals equation, and (d) the rule of additive pressures employing the generalized compressibility chart. Compare the calculated values with the known experimental value.\n", +"\n", +"//solution\n", +"\n", +"//analysis\n", +"V = .241 //volume of the mixture in m^3\n", +"T = 511 //temperature of the mixture in kelvin\n", +"n1 = .18 //number of moles of methane in kmol\n", +"n2 = .274 //number of moles of butane in kmol\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", +"Rbar = 8314 //universal gas constant in (N.m)/(kmol.K)\n", +"vbar = V/(n) //The specific volume of the mixture on a molar basis in m^3/kmol\n", +"\n", +"//part(a)\n", +"p = (Rbar*T/vbar)*10^-5 //in bar\n", +"printf('the pressure in bar obtained using ideal gas equation is: %f',p)\n", +"\n", +"//part(b)\n", +"//from table A-1\n", +"Tc1 = 191 //critical temperature for methane in kelvin \n", +"Pc1 = 46.4 //critical pressure for methane in bar\n", +"Tc2 = 425 //critical temperature for butane in kelvin\n", +"Pc2 = 38 //critical pressure for butane in bar\n", +"\n", +"Tc = y1*Tc1 + y2*Tc2 //critical temperature in kelvin\n", +"Pc = y1*Pc1 + y2*Pc2 //critical pressure in bar\n", +"\n", +"TR = T/Tc //reduced temperature of the mixture\n", +"vRdash= vbar*Pc/(Rbar*Tc)\n", +"\n", +"Z = .88\n", +"p = ((Z*Rbar*T)/vbar)*10^-5 //mixture pressure in bar\n", +"printf('\npressure obtained using Kay’s rule together with the generalized compressibility chart, is: %f',p)\n", +"\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 = .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 = .1162 //in m^3/kmol\n", +"\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('\nthe pressure in bar from van der Waals equation is: %f ',p)\n", +"\n", +"//part(d)\n", +"//for methane\n", +"TR1 = T/Tc1\n", +"vR1dash = (.241/.18)*10^5*Pc1/(Rbar*Tc1)\n", +"Z1 = 1\n", +"//for butane\n", +"TR2 = T/Tc2\n", +"vR2dash = (.88*10^5*Pc2)/(Rbar*Tc2)\n", +"Z2 = .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", +"printf('\nthe pressure in bar obtained using the rule of additive pressures employing the generalized compressibility chart is: %f',p)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.1) A cylindrical tank containing 4.0 kg of carbon monoxide gas at 50C has an inner diameter of 0.2 m and a length of 1 m. Determine the pressure, in bar, exerted by the gas using (a) the generalized compressibility chart, (b) the ideal gas equation of state, (c) the van der Waals equation of state, (d) the Redlich–Kwong equation of state. Compare the results obtained.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m = 4 //mass of carbon monoxide in kg\n", +"T = 223 //temperature of carbon monoxide in kelvin\n", +"D = .2 //inner diameter of cylinder in meter\n", +"L = 1 //length of the cylinder in meter\n", +"\n", +"//analysis\n", +"V = (%pi*D^2/4)*L //volume occupied by the gas in m^3\n", +"M = 28 //molar mass in kg/kmol\n", +"vbar = M*(V/m) //The molar specific volume in m^3/kmol\n", +"\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", +"vrdash = (vbar*Pc&10^5)/(Rbar*Tc) //pseudoreduced specific volume\n", +"Z = .9\n", +"\n", +"p = (Z*Rbar*T/vbar)*10^-5 //in bar\n", +"printf('part(a)the pressure in bar is: %f',p)\n", +"\n", +"//part(b)\n", +"//The ideal gas equation of state gives\n", +"p = (Rbar*T/vbar)/10^5 //in bar\n", +"printf('\npart(b)the pressure in bar is: %f',p)\n", +"\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 = .0395 //in m^3/kmol\n", +"\n", +"p = (Rbar*T/(vbar-b))/10^5 - a/vbar^2\n", +"printf('\npart(c)the pressure in bars is: %f',p)\n", +"\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 = .02737 //in m^3/kmol\n", +"\n", +"p = (Rbar*T/(vbar-b))/10^5 - a/[vbar*(vbar+b)*T^.5]\n", +"printf('\npart(d)the pressure in bar is: %f',p)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('theoretical problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.3) Evaluate the partial derivative (dels/delv)T for water vapor at a state fixed by a temperature of 240C and a specific volume of 0.4646 m3/kg. (a) Use the Redlich–Kwong equation of state and an appropriate Maxwell relation. (b) Check the value obtained using steam table data.\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"v = .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 = .0211 //in m^3/kmol\n", +"\n", +"Rbar = 8314 //universal gas constant in N.m/kmol.K\n", +"T = 513 //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", +"\n", +"//by The Maxwell relation\n", +"delsbydelv = delpbydelT\n", +"printf('the value of delpbydelT in kj/(m^3*K) is: %f ',delpbydelT)\n", +"\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 //in degree celcius\n", +"//at p =1 bar\n", +"s(1,1) = 7.9949 //in kj/kg.k\n", +"v(1,1) = 2.359 //in m^3/kg\n", +"//at p= 1.5 bar\n", +"s(2,1) = 7.8052 //in kj/kg.k\n", +"v(2,1) = 1.570 //in m^3/kg\n", +"//at p = 3 bar\n", +"s(3,1) = 7.4774 //in kj/kg.k\n", +"v(3,1) = .781 //in m^3/kg\n", +"//at p = 5 bar\n", +"s(4,1) = 7.2307 //in kj/kg.k\n", +"v(4,1) = .4646 //in m^3/kg\n", +"//at p =7 bar\n", +"s(5,1) = 7.0641 //in kj/kg.k\n", +"v(5,1) = .3292 //in m^3/kg\n", +"//at p = 10 bar\n", +"s(6,1) = 6.8817 //in kj/kg.k\n", +"v(6,1) = .2275 //in m^3/kg\n", +"plot(v,s)\n", +"xtitle('','Specific volume, m3/kg','Specific entropy, kJ/kg·K')\n", +"//The pressure at the desired state is 5 bar.The corresponding slope is\n", +"delsbydelv = 1 //in kj/m^3.K\n", +"printf('\n\nfrom the data of the table,delsbydelv = %f',delsbydelv) \n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.4)Using p–v–T data for saturated water, calculate at 100C (a) hg - hf, (b) ug - uf, (c) sg - sf. Compare with the respective steam table value.\n", +"\n", +"//solution\n", +"\n", +"//analysis\n", +"//For comparison, Table A-2 gives at 100C,\n", +"hgf =2257 //in kj/kg\n", +"ugf = 2087.6 //in kj/kg\n", +"sgf = 6.048 //in kj/kg.K\n", +"printf('from table, hg-hf = %f',hgf)\n", +"printf('\nfrom table, ug-uf = %f',ugf)\n", +"printf('\nfrom table, sg-sf = %f',sgf)\n", +"\n", +"//(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 //in N/(m^2.K)\n", +"\n", +"vg = 1.673 //in m^3/kg\n", +"vf = 1.0435e-3 //in m^3/kg\n", +"//from the Clapeyron equation\n", +"hgf = T*(vg-vf)*delpbydelT*10^-3 //in kj/kg\n", +"\n", +"printf('\n\npart(a)using Clapeyron equation, hg-hf = %f',hgf)\n", +"//(b)\n", +"psat = 1.014e5 //in N/m^2\n", +"hgf = 2256 //can be obtained using IT software in kj/kg\n", +"ugf = hgf - psat*(vg-vf)/10^3 //in kj/kg\n", +"printf('\npart(b)ug-uf = %f',ugf)\n", +"//(c)\n", +"sgf =hgf/T //in kj/kg.K \n", +"printf('\npart(c)sg-sf = %f',sgf)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('theoretical problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.6) For liquid water at 1 atm and 20C, estimate (a) the percent error in cv that would result if it were assumed that cp = cv, (b) the velocity of sound, in m/s.\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"funcprot(0)\n", +"v = 1/998.21 //specific volume of water in m^3/kg\n", +"T = 293 //given temperature in kelvin\n", +"beta = 206.6e-6 //volume expansivity in /K\n", +"k = 45.90e-6 //isothermal compressibility in /bar\n", +"\n", +"cpv = (v*T*beta^2/k)*10^2 //in kj/kg.k\n", +"\n", +"//Interpolating in Table A-19\n", +"cp = 4.188 //in kj/kg.k\n", +"cv = cp-cpv //in kj/kg.k\n", +"\n", +"errorPercentage = 100*(cp-cv)/cv\n", +"printf('the percentage error is: %f',errorPercentage)\n", +"\n", +"//part(b)\n", +"\n", +"K = cp/cv //specific heat ratio\n", +"c = sqrt((K*v/k)*10^5) //velocity of sound in m/s\n", +"printf('\nthe velocity of sound in m/s is: %f',c)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('theoretical problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.8) Nitrogen enters a turbine operating at steady state at 100 bar and 300 K and exits at 40 bar and 245 K. Using the enthalpy departure chart, determine the work developed, in kJ per kg of nitrogen flowing, if heat transfer with the surroundings can be ignored. Changes in kinetic and potential energy from inlet to exit also can be neglected.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 100 //in bar\n", +"T1 = 300 //in kelvin\n", +"p2 = 40 //in bar\n", +"T2 = 245 //in kelvin\n", +"\n", +"\n", +"//from table A-23\n", +"h1starbar = 8723 //in kj/kmol\n", +"h2starbar = 7121 //in kj/kmol\n", +"//From Tables A-1\n", +"Tc = 126 //critical temperature in kelvin\n", +"pc = 33.9 //critical pressure in bar\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", +"\n", +"M = 28 //molar mass in kg/kmol\n", +"Rbar = 8.314 //universal gas constant in kj/(kmol.K)\n", +"\n", +"Term1 = .5 \n", +"Term2 = .31\n", +"\n", +"wcvdot = (1/M)*[h1starbar-h2starbar-Rbar*Tc*(Term1-Term2)] //in kj/kg\n", +"printf('the work developed, in kJ per kg of nitrogen flowing is : %f',wcvdot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(11.9) For the case of Example 11.8, determine (a) the rate of entropy production, in and (b) the isentropic turbine efficiency.\n", +"\n", +"//solution\n", +"\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", +"\n", +"Rbar = 8.314 //universal gas constant\n", +"M = 28 //molar mass in kg/kmol \n", +"p2 = 40 //in bar\n", +"p1 = 100 //in bar\n", +"\n", +"S2StarBarMinusS1StarBar = sT2bar-sT1bar-Rbar*log(p2/p1) //The change in specific entropy in kj/(kmol.K)\n", +"\n", +"Term1 = .21\n", +"Term2 = .14\n", +"\n", +"sigmacvdot = (1/M)*(S2StarBarMinusS1StarBar-Rbar*(Term2-Term1))\n", +"printf('the rate of entropy production in kj/kg.K is: %f',sigmacvdot)\n", +"\n", +"//part(b)\n", +"//From Table A-23,\n", +"h2starbar = 6654 //in kj/kmol\n", +"h1starbar = 8723 //in kj/kmol\n", +"Tc = 126 //critical temperature in kelvin\n", +"Term2 = .36\n", +"Term1 = .5\n", +"\n", +"wcvdots = (1/M)*[h1starbar-h2starbar-Rbar*Tc*(Term1-Term2)] //isentropic work in kj/kg\n", +"wcvdot = 50.1 //from example 11.8\n", +"\n", +"etat = wcvdot/wcvdots //turbine efficiency\n", +"printf('\nthe isentropic turbine efficiency is: %f',etat)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/12-Ideal_gas_mixture_and_psychrometric_applications.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/12-Ideal_gas_mixture_and_psychrometric_applications.ipynb new file mode 100644 index 0000000..f083d96 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/12-Ideal_gas_mixture_and_psychrometric_applications.ipynb @@ -0,0 +1,1057 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Ideal gas mixture and psychrometric applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.10) Moist air enters a duct at 10C, 80% relative humidity, and a volumetric flow rate of 150 m3/min. The mixture is heated as it flows through the duct and exits at 30C. No moisture is added or removed, and the mixture pressure remains approximately constant at 1 bar. For steady-state operation, determine (a) the rate of heat transfer, in kJ/min, and (b) the relative humidity at the exit. Changes in kinetic and potential energy can be ignored.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"AV1 = 150 //entry volumetric flow rate in m^3/min\n", +"T1 = 10 //entry temperature in degree celcius\n", +"psi1 = .8 \n", +"T2 = 30 //exit temperature in degree celcius\n", +"p = 1 //in bar\n", +"\n", +"//part(a)\n", +"Rbar = 8314 //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 = .01228 //in bar\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", +"\n", +"madot = AV1/va1 //mass flow rate of the dry air in kg/min\n", +"\n", +"omega = .622*(pv1/(p-pv1)) //humidity ratio\n", +"\n", +"Qcvdot = madot*[(ha2-ha1)+omega*(hv2-hv1)] //in kj/min\n", +"printf('rate of heat transfer, in kJ/min is: %f',Qcvdot)\n", +"\n", +"//part(b)\n", +"//from Table A-2 at 30C\n", +"pg2 = .04246 //in bar\n", +"pv2 = pv1\n", +"psi2 = pv2/pg2 //relative humidity at the exit\n", +"printf('\n\nthe relative humidity at the exit is: %f',psi2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.11) Moist air at 30C and 50% relative humidity enters a dehumidifier operating at steady state with a volumetric flow rate of 280 m3/min. The moist air passes over a cooling coil and water vapor condenses. Condensate exits the dehumidifier saturated at 10C. Saturated moist air exits in a separate stream at the same temperature. There is no significant loss of energy by heat transfer to the surroundings and pressure remains constant at 1.013 bar. Determine (a) the mass flow rate of the dry air, in kg/min, (b) the rate at which water is condensed, in kg per kg of dry air flowing through the control volume, and (c) the required refrigerating capacity, in tons.\n", +"\n", +"//solution \n", +"\n", +"//variable initialization\n", +"T1 = 30 //in degree celcius\n", +"AV1 = 280 //in m^3/min\n", +"psi1 = .5 //relative humidity at the inlet\n", +"T2 = 10 //in degree celcius\n", +"p = 1.013 //pressure in bar\n", +"\n", +"//part(a)\n", +"//from table A-2\n", +"pg1 = .04246 //in bar\n", +"pv1 = psi1*pg1 //in bar\n", +"\n", +"pa1 = p-pv1 //partial pressure of the dry air in bar\n", +"\n", +"Rbar = 8314 //universal gas constant\n", +"Ma = 28.97 //molar mass of air\n", +"madot = AV1/[(Rbar/Ma)*((T1+273)/(pa1*10^5))] //common mass flow rate of the dry air in kg/min\n", +"printf('the mass flow rate of the dry air in kg/min is: %f',madot)\n", +"\n", +"//part(b)\n", +"omega1 = .622*[pv1/(p-pv1)]\n", +"\n", +"//from table A-2\n", +"pv2 = .01228 //in bar\n", +"\n", +"omega2 = .622*[pv2/(p-pv2)]\n", +"\n", +"mwdotbymadot = omega1-omega2 \n", +"printf('\n\nthe rate at which water is condensed, in kg per kg of dry air flowing through the control volume is: %f',mwdotbymadot)\n", +"\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", +"\n", +"Qcvdot = madot*[(ha2-ha1)-omega1*hg1+omega2*hg2+(omega1-omega2)*hf2] //in kj/min\n", +"printf('\n\nthe required refrigerating capacity, in tons is: %f',Qcvdot/211)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.12) Moist air with a temperature of 22C and a wet-bulb temperature of 9C enters a steam-spray humidifier. The mass flow rate of the dry air is 90 kg/min. Saturated water vapor at 110C is injected into the mixture at a rate of 52 kg/h. There is no heat transfer with the surroundings, and the pressure is constant throughout at 1 bar. Using the psychrometric chart, determine at the exit (a) the humidity ratio and (b) the temperature, in C.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 22 //entry temperature of moist air in degree celcius\n", +"Twb = 9 //wet-bulb temperature of entering moist air in degree celcius\n", +"madot = 90 //mass flow rate of dry air in kg/min\n", +"Tst = 110 //temperature of injected saturated water vapor in degree celcius\n", +"mstdot = 52 //mass flow rate of injected saturated water vapor in kg/h\n", +"p = 1 //pressure in bar\n", +"\n", +"//part(a)\n", +"//by inspection of the psychrometric chart\n", +"omega1 = .002\n", +"omega2 = omega1 + mstdot/(madot*60)\n", +"printf('the humidity ratio at the exit is: %f',omega2)\n", +"\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", +"printf('\n\nthe temperature at the exit in degree celcius is: %f',T2)\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.13) Air at 38C and 10% relative humidity enters an evaporative cooler with a volumetric flow rate of 140 m3/min. Moist air exits the cooler at 21C. Water is added to the soaked pad of the cooler as a liquid at 21C and evaporates fully into the moist air. There is no heat transfer with the surroundings and the pressure is constant throughout at 1 atm. Determine (a) the mass flow rate of the water to the soaked pad, in lb/h, and (b) the relative humidity of the moist air at the exit to the evaporative cooler.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 38 //temperature of entering air in degree celcius\n", +"psi1 = .1 //relative humidity of entering air \n", +"AV1 = 140 //volumetric flow rate of entering air in m^3/min\n", +"Tw = 21 //temperature of added water in degree celcius\n", +"T2 = 21 //temperature of exiting moist air in degree celcius\n", +"p = 1 //pressure in atm\n", +"\n", +"//part(a)\n", +"//from table A-2\n", +"pg1 = .066 //in bar\n", +"pv1 = psi1*pg1 //the partial pressure of the moist air entering the control volume in bar\n", +"omega1 = .622*[pv1/(p*1.01325-pv1)]\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", +"madot = AV1/va1 //mass flow rate of the dry air in kg/min\n", +"//from table A-2\n", +"hf = 88.14\n", +"hg1 = 2570.7\n", +"hg2 = 2539.94\n", +"\n", +"omega2 = [cpa*(T1-T2)+omega1*(hg1-hf)]/(hg2-hf)\n", +"mwdot = madot*60*(omega2-omega1) //in kg/h\n", +"printf('the mass flow rate of the water to the soaked pad in kj/h is: %f',mwdot)\n", +"\n", +"//part(b)\n", +"pv2 = (omega2*p*1.01325)/(omega2+.622) //in bars\n", +"//At 21C, the saturation pressure is\n", +"pg2 = .02487\n", +"psi2 = pv2/pg2\n", +"printf('\n the relative humidity of the moist air at the exit to the evaporative cooler is: %f',psi2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.14) A stream consisting of 142 m3/min of moist air at a temperature of 5C and a humidity ratio of 0.002 kg(vapor)kg(dry air) is mixed adiabatically with a second stream consisting of 425 m3/min of moist air at 24C and 50% relative humidity. The pressure is constant throughout at 1 bar. Using the psychrometric chart, determine (a) the humidity ratio and (b) the temperature of the exiting mixed stream, in C.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"AV1 = 142 //in m^3/min\n", +"T1 = 5 //in degree celcius\n", +"omega1 = .002\n", +"AV2 = 425 //in m^3/min\n", +"T2 = 24 //in degree celcius\n", +"psi2 = .5\n", +"p = 1 //in bar\n", +"\n", +"\n", +"//part(a)\n", +"//from the psychrometric chart, Fig. A-9.\n", +"va1 = .79 //in m^3/kg\n", +"va2 = .855 //in m^3/kg\n", +"omega2 = .0094\n", +"\n", +"ma1dot = AV1/va1 //in kg/min\n", +"ma2dot = AV2 /va2 //in kg/min\n", +"\n", +"omega3 = (omega1*ma1dot+omega2*ma2dot)/(ma1dot + ma2dot) \n", +"printf('the humidity ratio is: %f',omega3)\n", +"\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", +"\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 //in degree celcius\n", +"printf('\n\nthe temperature of the exiting mixed stream in degree celcius is: %f',T3)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.15: Example_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.15) Water exiting the condenser of a power plant at 38C enters a cooling tower with a mass flow rate of 4.5 X 107 kg/h. A stream of cooled water is returned to the condenser from a cooling tower with a temperature of 30C and the same flow rate. Makeup water is added in a separate stream at 20C. Atmospheric air enters the cooling tower at 25C and 35% relative humidity. Moist air exits the tower at 35C and 90% relative humidity. Determine the mass flow rates of the dry air and the makeup water, in kg/h. The cooling tower operates at steady state. Heat transfer with the surroundings and the fan power can each be neglected, as can changes in kinetic and potential energy. The pressure remains constant throughout at 1 atm.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 38 //in degree celcius\n", +"m1dot = 4.5e7 //in kg/h\n", +"T2 = 30 //in degree celcius\n", +"m2dot = 4.5e7 //in kg/h\n", +"T3 = 25 //in degree celcius\n", +"psi3 = .35\n", +"T4 = 35 //in degree celcius\n", +"psi4 = .9\n", +"T5 = 20 //in degree celcius\n", +"\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 =.00688\n", +"omega4 = .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", +"\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", +"printf('the mass flow rate of dry air in kg/h is: %e',madot)\n", +"printf('\nthe mass flow rate of makeup water in kg/h is: %e',m5dot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.1) The molar analysis of the gaseous products of combustion of a certain hydrocarbon fuel is CO2, 0.08; H2O, 0.11; O2, 0.07; N2, 0.74. (a) Determine the apparent molecular weight of the mixture. (b) Determine the composition in terms of mass fractions (gravimetric analysis).\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"n1 = .08 // mole fraction of CO2\n", +"n2 = .11 // mole fraction of H2O\n", +"n3 = .07 //mole fraction of O2\n", +"n4 = .74 //mole fraction of N2\n", +"\n", +"//part(a)\n", +"M1 = 44 //molar mass of CO2 in kg/kmol\n", +"M2 = 18 //molar mass of H2O in kg/kmol\n", +"M3 = 32 //molar mass of O2 in kg/kmol\n", +"M4 = 28 //molar mass of N2 in kg/kmol\n", +"\n", +"M = M1*n1 + M2*n2 + M3*n3 + M4*n4 //in kg/kmol\n", +"printf('the apparent molecular weight of the mixture in kg/kmol is: %f',M)\n", +"\n", +"//part(b)\n", +"mf1 = (M1*n1/M)*100 //mass fraction of CO2 in percentage \n", +"mf2 = (M2*n2/M)*100 //mass fraction of H2O in percentage\n", +"mf3 = (M3*n3/M)*100 //mass fraction of O2 in percentage\n", +"mf4 = (M4*n4/M)*100 //mass fraction of N2 in percentage\n", +"\n", +"printf('\n\nthe mass fraction of CO2 in percentage is: %f',mf1)\n", +"printf('\nthe mass fraction of H2O in percentage is: %f',mf2)\n", +"printf('\nthe mass fraction of O2 in percentage is: %f',mf3)\n", +"printf('\nthe mass fraction of N2 in percentage is: %f',mf4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.2) A gas mixture has the following composition in terms of mass fractions: H2, 0.10; N2, 0.60; CO2, 0.30. Determine (a) the composition in terms of mole fractions and (b) the apparent molecular weight of the mixture.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"mf1 = .1 //mass fractiion of H2\n", +"mf2 = .6 //mass fraction of N2\n", +"mf3 = .3 //mass fraction of CO2\n", +"\n", +"//part(a)\n", +"M1 = 2 //molar mass of H2 in kg/kmol\n", +"M2 = 28 //molar mass of N2 in kg/kmol\n", +"M3 = 44 //molar mass of CO2 in kg/kmol\n", +"\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", +"\n", +"printf('the mole fraction of H2 in percentage is: %f',n1*100)\n", +"printf('\nthe mole fraction of N2 in percentage is: %f',n2*100)\n", +"printf('\nthe mole fraction of CO2 in percentage is: %f',n3*100)\n", +"\n", +"//part(b)\n", +"M = n1*M1 + n2*M2 + n3*M3 //in kg/kmol\n", +"printf('\n\nthe apparent molecular weight of the mixture in kg/kmol is: %f',M)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.3) A mixture of 0.3 kg of carbon dioxide and 0.2 kg of nitrogen is compressed from p1 = 1 bar, T1 = 300 K to p2 = 3 bars in a polytropic process for which n= 1.25. Determine (a) the final temperature, in K, (b) the work, in kJ, (c) the heat transfer, in kJ, (d) the change in entropy of the mixture, in kJ/K.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m1 = .3 //mass of CO2 in kg\n", +"m2 = .2 //mass of N2 in kg\n", +"p1 = 1 //in bar\n", +"T1 = 300 //in kelvin\n", +"p2 = 3 //in bar\n", +"n = 1.25\n", +"\n", +"//part(a)\n", +"T2 = T1*(p2/p1)^[(n-1)/n] //in kelvin\n", +"printf('the final temperature in Kelvin is: %f',T2)\n", +"\n", +"//part(b)\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"M = (m1+m2)/(m1/44 + m2/28) //molar mass of mixture in kg/kmol\n", +"\n", +"W = [(m1+m2)*(Rbar/M)*(T2-T1)]/(1-n) //in kj\n", +"printf('\nthe work in kj is: %f',W) \n", +"\n", +"//part(c)\n", +"//from table A-23\n", +"uCO2T1 = 6939 //internal energy of CO2 on molar mass basis at temperature T1\n", +"uCO2T2 = 9198 //internal energy of CO2 on molar mass basis at temperature T2\n", +"uN2T1 = 6229 //internal energy of N2 on molar mass basis at temperature T1\n", +"uN2T2 = 7770 //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", +"\n", +"//with assumption, The changes in kinetic and potential energy between the initial and final states can be ignored\n", +"Q = deltaU + W\n", +"printf('\nthe heat transfer in kj is: %f',Q)\n", +"\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", +"\n", +"deltaS = (m1/44)*[sbarT2CO2-sbarT1CO2-Rbar*log(p2/p1)] + (m2/28)*[sbarT2N2-sbarT1N2-Rbar*log(p2/p1)]\n", +"printf('\nthe change in entropy of the mixture in kj/k is: %f',deltaS)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.4) A gas mixture consisting of CO2 and O2 with mole fractions 0.8 and 0.2, respectively, expands isentropically and at steady state through a nozzle from 700 K, 5 bars, 3 m/s to an exit pressure of 1 bar. Determine (a) the temperature at the nozzle exit, in K, (b) the entropy changes of the CO2 and O2 from inlet to exit, in KJ/Kmol.K (c) the exit velocity, in m/s.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"y1 = .8 //mole fraction of CO2\n", +"y2 = .2 //mole fraction of O2\n", +"T1 = 700 //in kelvin\n", +"p1 = 5 //in bars\n", +"V1 = 3 //in m/s\n", +"p2 = 1 //in bars\n", +"\n", +"\n", +"//part(a)\n", +"//from table A-23\n", +"sO2barT1 = 231.358\n", +"sCO2barT1 = 250.663\n", +"\n", +"RHS = y2*sO2barT1 + y1*sCO2barT1 + 8.314*log(p2/p1)\n", +"\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", +"printf('the temperature at the nozzle exit in K is: %f',T2)\n", +"\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", +"\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", +"\n", +"printf('\n\nthe entropy changes of the CO2 from inlet to exit, in KJ/Kmol.K is: %f',deltasbarCO2)\n", +"printf('\nthe entropy change of the O2 from inlet to the exit in kj/kmol.k is: %f',deltasbarO2)\n", +"\n", +"//part(c)\n", +"//from table A-23, the molar specific enthalpies of O2 and CO2 are\n", +"h1barO2 = 21184\n", +"h2barO2 = 15320\n", +"h1barCO2 = 27125\n", +"h2barCO2 = 18468\n", +"\n", +"M = y1*44 + y2*32 //apparent molecular weight of the mixture in kg/kmol\n", +"deltah = (1/M)*[y2*(h1barO2-h2barO2) + y1*(h1barCO2-h2barCO2)]\n", +"V2 = sqrt(V1^2+ 2*deltah*10^3)\n", +"printf('\n\nthe exit velocity in m/s is: %f',V2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.5) Two rigid, insulated tanks are interconnected by a valve. Initially 0.79 kmol of nitrogen at 2 bars and 250 K fills one tank. The other tank contains 0.21 kmol of oxygen at 1 bar and 300 K. The valve is opened and the gases are allowed to mix until a final equilibrium state is attained. During this process, there are no heat or work interactions between the tank contents and the surroundings. Determine (a) the final temperature of the mixture, in K, (b) the final pressure of the mixture, in atm, (c) the amount of entropy produced in the mixing process, in kJ/K\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"nN2 = .79 //initial moles of nitrogen in kmol\n", +"pN2 = 2 //initial pressure of nitrogen in bars\n", +"TN2 = 250 //initial temperature of nitrogen in kelvin\n", +"nO2 = .21 //initial moles of oxygen in kmol\n", +"pO2 = 1 //initial pressure of oxygen in bars\n", +"TO2 = 300 //initial temperature of oxygen in kelvin\n", +"//part(a)\n", +"MN2 = 28.01 //molar mass of nitrogen in kg/kmol\n", +"MO2 = 32 //molar mass of oxygen in kg/kmol\n", +"\n", +"//with the help of table A-20\n", +"cvbarN2 = MN2*.743 //in kj/kmol.K\n", +"cvbarO2 = MO2*.656 //in kj/kmol.K\n", +"\n", +"T2 = (nN2*cvbarN2*TN2+nO2*cvbarO2*TO2)/(nN2*cvbarN2+nO2*cvbarO2)\n", +"printf('the final temperature of the mixture in kelvin is: %f',T2)\n", +"\n", +"//part(b)\n", +"p2 = [(nN2+nO2)*T2]/[nN2*TN2/pN2 + nO2*TO2/pO2]\n", +"printf('\n\nthe final pressure of the mixture in bar is: %f',p2)\n", +"\n", +"//part(c)\n", +"Rbar = 8.314 //universal gas constant\n", +"cpbarN2 = cvbarN2 + Rbar\n", +"cpbarO2 = cvbarO2 + Rbar\n", +"\n", +"yN2 = nN2/(nN2+nO2) //mole fraction of N2\n", +"yO2 = nO2/(nN2+nO2) //mole fraction of O2\n", +"\n", +"sigma = nN2*(cpbarN2*log(T2/TN2)-Rbar*log(yN2*p2/pN2)) + nO2*(cpbarO2*log(T2/TO2)-Rbar*log(yO2*p2/pO2))\n", +"printf('\n\nthe amount of entropy produced in the mixing process, in kJ/K is: %f',sigma)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.6) At steady state, 100 m3/min of dry air at 32C and 1 bar is mixed adiabatically with a stream of oxygen (O2) at 127C and 1 bar to form a mixed stream at 47C and 1 bar. Kinetic and potential energy effects can be ignored. Determine (a) the mass flow rates of the dry air and oxygen, in kg/min, (b) the mole fractions of the dry air and oxygen in the exiting mixture, and (c) the time rate of entropy production, in kJ/K . min\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 32 //temperature of dry air in degree celcius\n", +"p1 = 1 //pressure of dry air in bar\n", +"AV1 = 100 //volume rate of dry air in m^3/min\n", +"T2 = 127 //temperature of oxygen stream in degree celcius\n", +"p2 = 1 //pressure of oxygen stream in bar\n", +"T3 = 47 //temperature of mixed stream in degree celcius\n", +"p3 = 1 //pressure of mixed stream in bar\n", +"\n", +"//part(a)\n", +"Rbar = 8314 //universal gas constant\n", +"Ma = 28.97 //molar mass of air\n", +"Mo = 32 //molar mass of oxygen\n", +"\n", +"va1 = (Rbar/Ma)*(T1+273)/(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", +"\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 //in kj/kmol\n", +"hnotT1 = 9325 //in kj/kmol\n", +"\n", +"modot = ma1dot*(haT3-haT1)/[(1/Mo)*(hnotT2-hnotT1)] //in kg/min\n", +"printf('the mass flow rate of dry air in kg/min is: %f',ma1dot)\n", +"printf('\nthe mass flow rate of oxygen in kg/min is: %f',modot)\n", +"\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", +"\n", +"ya = nadot/(nadot+nodot) //mole fraction of air\n", +"yo = nodot/(nadot+nodot) //mole fraction of oxygen\n", +"\n", +"printf('\n\nthe mole fraction of dry air in the exiting mixture is: %f',ya)\n", +"printf('\nthe mole fraction of dry oxygen in the exiting mixture is: %f',yo)\n", +"\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", +"\n", +"sigmadot = ma1dot*[sanotT3-sanotT1-(8.314/Ma)*log(ya)] + (modot/Mo)*[sbarT3-sbarT2-8.314*log(yo)]\n", +"printf('\n\nthe time rate of entropy production, in kJ/K . min is: %f',sigmadot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.7) A 1 kg sample of moist air initially at 21C, 1 bar, and 70% relative humidity is cooled to 5C while keeping the pressure constant. Determine (a) the initial humidity ratio, (b) the dew point temperature, in C, and (c) the amount of water vapor that condenses, in kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m =1 //mass of sample in kg\n", +"T1 = 21 //initial temperature in degree celcius\n", +"psi1 = .7 //initial relative humidity\n", +"T2 = 5 //final temperature in degree celcius\n", +"\n", +"//part(a)\n", +"//from table A-2\n", +"pg = .02487 //in bar\n", +"\n", +"pv1 = psi1*pg //partial pressure of water vapor in bar\n", +"\n", +"omega1 = .622*(.2542)/(14.7-.2542)\n", +"printf('the initial humidity ratio is: %f',omega1)\n", +"\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", +"printf('\n\nthe dew point temperature in degree celcius is: %f',T)\n", +"\n", +"//part(c)\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", +"\n", +"//the partial pressure of the water vapor remaining in the system at the final state is the saturation pressure corresponding to 5C:\n", +"pg = .00872 //in bar\n", +"omega2 = .622*(pg)/(1.01325-pg) //humidity ratio after cooling\n", +"\n", +"mv2 = omega2*ma //The mass of the water vapor present at the final state\n", +"mw = mv1-mv2\n", +"printf('\n\n the amount of water vapor that condenses, in kg. is: %f',mw)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.8) An air–water vapor mixture is contained in a rigid, closed vessel with a volume of 35 m3 at 1.5 bar, 120C, and psi = 10%. The mixture is cooled at constant volume until its temperature is reduced to 22C. Determine (a) the dew point temperature corresponding to the initial state, in C, (b) the temperature at which condensation actually begins, in C, and (c) the amount of water condensed, in kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"V = 35 //volume of the vessel in m^3\n", +"p1 = 1.5 //in bar\n", +"T1 = 120 //in degree celcius\n", +"psi1 = .1 \n", +"T2 = 22 //in degree celcius\n", +"\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", +"pv1 = psi1*pg1 //partial pressure in bar\n", +"//Interpolating in Table A-2 gives the dew point temperature as\n", +"T = 60 //in degree celcius\n", +"printf('the dew point temperature corresponding to the initial state, in degee celcius is: %f',T)\n", +"\n", +"//part(b)\n", +"Rbar = 8314 //universal gas constant\n", +"Mv = 18 //molar mass of vapor in kj/kmol\n", +"vv1 =((Rbar/Mv)*(T1+273))/(pv1*10^5) //the specific volume of the vapor at state 1 in m^3/kg\n", +"//Interpolation in Table A-2\n", +"Tdash = 56 //in degrees\n", +"printf('\n\nthe temperature at which condensation actually begins in degree celcius is: %f',Tdash)\n", +"\n", +"//part(c)\n", +"mv1 = V/vv1 //initial amount of water vapor present in kg\n", +"//from table \n", +"vf2 = 1.0022e-3\n", +"vg2 = 51.447\n", +"vv2 = vv1 //specific volume at final state\n", +"\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", +"printf('\n\n the amount of water condense in kg is: %f',mw2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(12.9) An air–water vapor mixture is contained in a rigid, closed vessel with a volume of 35 m3 at 1.5 bar, 120C, and psi = 10%. The mixture is cooled until its temperature is reduced to 22C. Determine the heat transfer during the process, in kJ.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"V = 35 //volume of vessel in m^3\n", +"p1 = 1.5 //initial pressure in bar\n", +"T1 = 120 //initial temperature in degree celcius\n", +"psi = .1\n", +"T2 = 22 //in degree celcius\n", +"\n", +"Rbar = 8314 //universal gas constant\n", +"Ma = 28.97 //molar mass of air\n", +"\n", +"pv1 = .1985 //in bar, from example 12.8\n", +"mv2 = .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", +"\n", +"ma =( [(p1-pv1)*10^5]*V)/[(Rbar/Ma)*(T1+273)] //mass of dry air in kg\n", +"\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", +"\n", +"Q = ma*(ua2-ua1) + mv2*ug2 + mw2*uf2 - mv1*ug1\n", +"printf(' the heat transfer during the process, in kJ is: %f',Q)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/13-Reacting_mixtures_and_combustion.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/13-Reacting_mixtures_and_combustion.ipynb new file mode 100644 index 0000000..dff2110 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/13-Reacting_mixtures_and_combustion.ipynb @@ -0,0 +1,917 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Reacting mixtures and combustion" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.10) Determine the change in entropy of the system of Example 13.6 in kJ/K.\n", +"\n", +"\n", +"//solution\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/3\n", +"yO2 = 2/3\n", +"yCO2 = 1/3\n", +"yH2O = 2/3\n", +"//from table A-25\n", +"sbarCH4atTref = 186.16 //in kj/kmol.K\n", +"sbarO2atTref = 205.03 //in kj/kmol.K\n", +"\n", +"sbarCH4 = sbarCH4atTref - Rbar*log(yCH4)\n", +"sbarO2 = sbarO2atTref - Rbar*log(yO2)\n", +"\n", +"p2 = 3.02 //in atm\n", +"pref = 1 //in atm\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", +"\n", +"deltaS = sbarCO2 + 2*sbarH2O - sbarCH4 -2*sbarO2 //in kj/K\n", +"printf('the chenge in entropy of the system in kJ/K is: %f',deltaS)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.11) Determine the Gibbs function of formation of methane at the standard state, 25C and 1 atm, in kJ/kmol, and compare with the value given in Table A-25.\n", +"\n", +"\n", +"\n", +"//solution\n", +"\n", +"//Methane is formed from carbon and hydrogen according to\n", +"//C + 2H2 ------> CH4\n", +"\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", +"\n", +"Tref = 298.15 //in kelvin\n", +"\n", +"gfbarCH4 = hfbarCH4 -Tref*(sbarCH4-sbarC-2*sbarH2) //in kj/kmol\n", +"printf('the gibbs function of formation of methane at the standard state is: %f',gfbarCH4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.12) Determine the chemical exergy of liquid octane at 25C, 1 atm, in kJ/kg. (a) Using Eq. 13.36, evaluate the chemical exergy for an environment consisting of a gas phase at 25C, 1 atm obeying the ideal gas model with the following composition on a molar basis: N2, 75.67%; O2, 20.35%; H2O, 3.12%; CO2, 0.03%; other, 0.83%. (b) Evaluate the chemical exergy using Eq. 13.44b and standard chemical exergies from Table A-26 (Model II).\n", +"\n", +"\n", +"\n", +"//solution\n", +"\n", +"//Complete combustion of liquid octane with O2 is described by\n", +"//C8H18(l) + 12.5O2 ------> 8CO2 + 9H2O\n", +"\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\n", +"gbarO2 = 0\n", +"gbarCO2 = -394380\n", +"gbarH2O = -228590\n", +"\n", +"yO2 = .2035\n", +"yCO2 = .0003\n", +"yH2O = .0312\n", +"\n", +"M = 114.22 //molecular weight of liquid octane\n", +"\n", +"ech = ((gbarC8H18 + 12.5*gbarO2 -8*gbarCO2 -9*gbarH2O) + Rbar*Tnot*log(yO2^12.5/(yCO2^8*yH2O^9 )))/M\n", +"printf('part(a) the chemical exergy obtained on a unit mass basis is: %f',ech)\n", +"\n", +"//part(b)\n", +"//With data from Table A-25 and Model II of Table A-26\n", +"gbarH2O = -237180\n", +"ebarCO2 = 19870\n", +"ebarH2O = 900\n", +"ebarO2 = 3970\n", +"\n", +"ech = ((gbarC8H18 + 12.5*gbarO2 -8*gbarCO2 - 9*gbarH2O) + 8*ebarCO2 + 9*ebarH2O - 12.5*ebarO2)/M\n", +"printf('\n\npart(b) chemical exergy on a unit mass basis is: %f',ech)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.13) Steam at 5 bar, 240C leaks from a line in a vapor power plant. Evaluate the flow exergy of the steam, in kJ/kg, relative to an environment at 25C, 1 atm in which the mole fraction of water vapor is yeH2O = 0.0303\n", +"\n", +"\n", +"//solution\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"Tnot = 298 //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 = .3674 //in kj/kg\n", +"//With data from Table A-25\n", +"gbarH2Oliq = -237180\n", +"gbarH2Ogas = -228590\n", +"yeH2O = .0303\n", +"M =18 //molar mass of steam\n", +"\n", +"ech = (1/M)*(gbarH2Oliq-gbarH2Ogas + Rbar*Tnot*log(1/yeH2O)) //in kj/kg\n", +"\n", +"ef = h-hnot-Tnot*(s-snot) + ech //in kj/kg\n", +"printf(' the flow exergy of the steam, in kJ/k is: %f',ef)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.14) Methane gas enters a reactor and burns completely with 140% theoretical air. Combustion products exit as a mixture at temperature T and a pressure of 1 atm. For T = 480 and 1560 K, evaluate the flow exergy of the combustion products, in kJ per kmol of fuel. Perform calculations relative to an environment consisting of an ideal gas mixture at 25C, 1 atm with the molar analysis, yeN2 = 0.7567, yeO2 = 0.2035, yeH2O = 0.0303, yeCO2 = 0.0003.\n", +"\n", +"\n", +"\n", +"//solution\n", +"\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", +"\n", +"//for product side\n", +"yCO2p = 1/(1+2+10.53+.8)\n", +"yH2Op = 2/(1+2+10.53+.8)\n", +"yN2p = 10.53/(1+2+10.53+.8)\n", +"yO2p = .8/(1+2+10.53+.8)\n", +"\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"Tnot = 298.15 //in kelvin\n", +"\n", +"yeN2 = .7567\n", +"yeO2 = .2035\n", +"yeH2O = .0303\n", +"yeCO2 = .0003\n", +"\n", +"ebarch = Rbar*Tnot*(log(yCO2p/yeCO2) + 2*log(yH2Op/yeH2O) + 10.53*log(yN2p/yeN2) + .8*log(yO2p/yeO2))\n", +"\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 //kJ per kmol of fuel\n", +"contri1560 = 390853 //kJ per kmol of fuel\n", +"\n", +"efbar480 = contri480 + ebarch //kJ per kmol of fuel\n", +"efbar1560 = contri1560 + ebarch //kJ per kmol of fuel\n", +"\n", +"printf('at T= 480k, the flow exergy of the combustion products, in kJ per kmol of fuel is: %f',efbar480)\n", +"printf('\nat T = 1560K, the flow exergy of the combustion products, in kJ per kmol of fuel is: %f',efbar1560)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.15: Example_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.15) Devise and evaluate an exergetic efficiency for the internal combustion engine of Example 13.4. For the fuel, use the chemical exergy value determined in Example 13.12(a).\n", +"\n", +"\n", +"//solution\n", +"\n", +"mFdot = 1.8e-3 //fuel mass flow rate in kg/s\n", +"ech = 47346 //in kj/kg, from example 13.12(a)\n", +"Wcvdot = 37 //power developed by the engine in kw\n", +"\n", +"Efdot = mFdot*ech //rate at which exergy enters with the fuel in kw\n", +"\n", +"epsilon = Wcvdot/Efdot //exergetic efficiency\n", +"printf('the exergetic efficiency is: %f',epsilon)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.16: Example_16.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.16) For the reactor of Example 13.9, determine the exergy destruction, in kJ per kmol of fuel, and devise and evaluate an exergetic efficiency. Consider (a) complete combustion with the theoretical amount of air (b) complete combustion with 400% theoretical air. For the fuel, use the chemical exergy value determined in Example 13.12(a).\n", +"\n", +"\n", +"//solution\n", +"\n", +"Tnot = 298 //in kelvin\n", +"\n", +"//For the case of complete combustion with the theoretical amount of air\n", +"sigmadot = 5404 //rate of entropy production from example 13.9, in kj/kmol.K\n", +"Eddot = Tnot*sigmadot //in kj/kmol\n", +"Efdot = 5407843 //rate at which exergy enters with the fuel from example 13.12, in kj/kmol\n", +"epsilon = 1-Eddot/Efdot\n", +"printf('the exergetic efficiency with theoretical amount of air is: %f',epsilon)\n", +"\n", +"//for the case of combustion with 400% theoretical air\n", +"sigmadot = 9754 //rate of entropy production from example 13.9, in kj/kmol.K\n", +"Eddot = Tnot*sigmadot ////in kj/kmol\n", +"epsilon = 1-Eddot/Efdot\n", +"printf('\nthe exergetic efficiency with 400 percent theoretical amount of air is: %f',epsilon)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.1) Determine the air–fuel ratio on both a molar and mass basis for the complete combustion of octane, C8H18, with (a) the theoretical amount of air, (b) 150% theoretical air (50% excess air).\n", +"\n", +"//solution\n", +"\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\n", +"c = 18/2\n", +"a = (2*b+c)/2\n", +"d = 3.76*a\n", +"\n", +"//The air–fuel ratio on a molar basis is\n", +"AFbar = a*(1+3.76)/1\n", +"\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", +"\n", +"printf('The air–fuel ratio on a molar basis is: %f',AFbar)\n", +"printf('\nThe air–fuel ratio expressed on a mass basis is: %f',AF)\n", +"\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", +"b = 8\n", +"c =18/2\n", +"e = (1.5*12.5*2 - c -2*b)/2\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", +"printf('\n\nThe air–fuel ratio on a molar basis is: %f',AFbar)\n", +"printf('\nThe air–fuel ratio expressed on a mass basis is: %f',AF)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.2) Methane, CH4, is burned with dry air. The molar analysis of the products on a dry basis is CO2, 9.7%; CO, 0.5%; O2, 2.95%; and N2, 86.85%. Determine (a) the air–fuel ratio on both a molar and a mass basis, (b) the percent theoretical air, (c) the dew point temperature of the products, in C, if the mixture were cooled at 1 atm.\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"//The chemical equation\n", +"//a CH4 + b*(O2 + 3.76N2) ---> 9.7CO2 + .5CO + 2.95O2 + 86.85N2 + cH2O\n", +"\n", +"//applying conservation of mass \n", +"a = 9.7 + .5\n", +"c = 2*a\n", +"b = [9.7*2+.5+2*2.95+c]/2\n", +"\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", +"\n", +"printf('the air-fuel ratio on a molar basis is: %f',AFbar)\n", +"printf('\nthe air-fuel ratio on a mass basis is: %f',AF)\n", +"\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", +"AFbartheo = 2*(1+3.76)/1\n", +"//The percent theoretical air is\n", +"Ta = AFbar/AFbartheo\n", +"printf('\n\nthe percent theoretical air is: %f',Ta*100)\n", +"\n", +"//part(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", +"printf('\n\nthe dew point temperature of the products, in C, if the mixture were cooled at 1 atm is: %f',T)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.3) A natural gas has the following molar analysis: CH4, 80.62%; C2H6, 5.41%; C3H8, 1.87%; C4H10, 1.60%; N2, 10.50%. The gas is burned with dry air, giving products having a molar analysis on a dry basis: CO2, 7.8%; CO, 0.2%; O2, 7%; N2, 85%. (a) Determine the air–fuel ratio on a molar basis. (b) Assuming ideal gas behavior for the fuel mixture, determine the amount of products in kmol that would be formed from 100 m3 of fuel mixture at 300 K and 1 bar. (c) Determine the percent of theoretical air.\n", +"\n", +"//solution\n", +"\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", +"\n", +"//using mass conservation\n", +"b = [.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", +"\n", +"//The air–fuel ratio on a molar basis is\n", +"AFbar = a*(1+3.76)/1\n", +"printf('the air-fuel ratio on a molar mass basis is: %f',AFbar)\n", +"\n", +"//part(b)\n", +"p = 1 //in bar\n", +"V = 100 //in m^3\n", +"Rbar = 8314 //in N.m/kmol.K\n", +"T = 300 //in kelvin\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", +"printf('\n\nthe amount of products in kmol that would be formed from 100 m3 of fuel mixture at 300 K and 1 bar is: %f',n)\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", +"//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", +"printf('\n\nthe percent of theoretical air is: %f',Ta*100)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.4) Liquid octane enters an internal combustion engine operating at steady state with a mass flow rate of 1.8 103 kg/s and is mixed with the theoretical amount of air. The fuel and air enter the engine at 25C and 1 atm. The mixture burns completely and combustion products leave the engine at 890 K. The engine develops a power output of 37 kW. Determine the rate of heat transfer from the engine, in kW, neglecting kinetic and potential energy effects.\n", +"//solution\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", +"//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", +"mfdot = 1.8e-3 //mass flow rate of liquid octane in kg/s\n", +"M = 114.22 //molar mass of octane\n", +"nFdot = mfdot/M //molar flow rate of the fuel in kmol/s\n", +"Wcvdot = 37 //power output of the engine in kw\n", +"Qcvdot = Wcvdot + nFdot*(hpbar-hRbar) //in kw\n", +"printf('the rate of heat transfer from the engine, in kW is: %f',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.5) Methane gas at 400 K and 1 atm enters a combustion chamber, where it is mixed with air entering at 500 K and 1 atm. The products of combustion exit at 1800 K and 1 atm with the product analysis given in Example 13.2. For operation at steady state, determine the rate of heat transfer from the combustion chamber in kJ per kmol of fuel. Neglect kinetic and potential energy effects. The average value for the specific heat cpbar of methane between 298 and 400 K is 38 kJ/kmol K.\n", +"\n", +"\n", +"//solution\n", +"\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 //specific heat in KJ/kmol.K\n", +"//from table A-25\n", +"hfnotbar = -74850 //enthalpy of formation for methane\n", +"//from table A-23\n", +"deltahbarO2 = 14770-8682\n", +"deltahbarN2 = 14581-8669\n", +"\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", +"\n", +"Qcvdot = hpbar - hRbar //in kj/kmol\n", +"printf('the rate of heat transfer from the combustion chamber in kJ per kmol of fuel is: %f',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.6) A mixture of 1 kmol of gaseous methane and 2 kmol of oxygen initially at 25C and 1 atm burns completely in a closed, rigid container. Heat transfer occurs until the products are cooled to 900 K. If the reactants and products each form ideal gas mixtures, determine (a) the amount of heat transfer, in kJ, and (b) the final pressure, in atm.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"nCH4 = 1 //moles of methane in kmol\n", +"nO2 = 2 //moles of oxygen in kmol\n", +"T1 = 25 //in degree celcius\n", +"p1 = 1 //in atm\n", +"T2 = 900 //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", +"\n", +"//part(a)\n", +"//with enthalpy of formation values from table A-25\n", +"hfbarCO2 = -393520\n", +"hfbarH2O = -241820\n", +"hfbarCH4 = -74850\n", +"//with enthalpy values from table A-23\n", +"deltahbarCO2 = 37405-9364\n", +"deltahbarH2O = 31828-9904\n", +"\n", +"Q = ((hfbarCO2 + deltahbarCO2)+2*(hfbarH2O + deltahbarH2O) - hfbarCH4) + 3*Rbar*(T1+273-T2)\n", +"printf('the amount of heat transfer in kJ is: %f',Q)\n", +"\n", +"//part(b)\n", +"p2 = p1*(T2/(T1+273)) //in atm\n", +"printf('\nthe final pressure in atm is: %f',p2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.7) Calculate the enthalpy of combustion of gaseous methane, in kJ per kg of fuel, (a) at 25C, 1 atm with liquid water in the products, (b) at 25C, 1 atm with water vapor in the products. (c) Repeat part (b) at 1000 K, 1 atm.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//The combustion equation is\n", +"//CH4 + 2O2 + 7.52N2 ----> CO2 + 2H2O + 7.52N2\n", +"\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", +"\n", +"hRPbar = hfbarCO2 + 2*hfbarH2O - hfbarCH4 //in kj/kmol\n", +"M = 16.04 //molar mass of CH4 in kg/kmol\n", +"hRP = hRPbar/M //in kj/kg\n", +"printf('part(a)the enthalpy of combustion of gaseous methane, in kJ per kg of fuel is: %f',hRP)\n", +"\n", +"//part(b)\n", +"hfbarCO2 = -393520 //in kj/kmol\n", +"hfbarH2O = -241820 //in kj/kmol\n", +"hfbarCH4 = -74850 //in kj/kmol\n", +"\n", +"hRPbar = hfbarCO2 + 2*hfbarH2O - hfbarCH4 //in kj/kmol\n", +"hRP = hRPbar/M //in kj/kg\n", +"printf('\n\npart(b)the enthalpy of combustion of gaseous methane, in kJ per kg of fuel is: %f',hRP)\n", +"\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", +"\n", +"//using table A-21\n", +"function cpbar = f(T)\n", +" cpbar = (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", +"\n", +"deltahbarCH4 = intg(298,1000,f)\n", +"var = deltahbarCH4\n", +"\n", +"hRPbar = hRPbar + (deltahbarCO2 + 2*deltahbarH2O - var -2*deltahbarO2)\n", +"hRP = hRPbar/M //in kj/kg\n", +"printf('\n\npart(c)the enthalpy of combustion of gaseous methane, in kJ per kg of fuel is: %f',hRP)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.8) Liquid octane at 25C, 1 atm enters a well-insulated reactor and reacts with air entering at the same temperature and pressure. For steady-state operation and negligible effects of kinetic and potential energy, determine the temperature of the combustion products for complete combustion with (a) the theoretical amount of air, (b) 400% theoretical air.\n", +"\n", +"//solution\n", +"\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 //in kj/kmol\n", +"hfbarCO2 = -393520\n", +"hfbarH2O = -241820\n", +"\n", +"RHS = hfbarC8H18 -(8*hfbarCO2 + 9*hfbarH2O) //in kj/kmol\n", +"\n", +"//at temperature 2400k\n", +"LHS1 = 5089337 //in kj/kmol\n", +"//at temperature 2350 k\n", +"LHS2 = 4955163 //in kj/kmol\n", +"//Interpolation between these temperatures gives\n", +"Tp = 2400 + [(2400-2350)/(LHS1-LHS2)]*(RHS-LHS1)\n", +"printf('the temperature in kelvin with theoretical amount of air is: %f',Tp)\n", +"\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", +"\n", +"//proceeding iteratively as part(a)\n", +"Tp = 962 //in kelvin\n", +"printf('\n\nthe temperature in kelvin using 400 percent theoretical air is: %f',Tp)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(13.9) Liquid octane at 25C, 1 atm enters a well-insulated reactor and reacts with air entering at the same temperature and pressure. The products of combustion exit at 1 atm pressure. For steady-state operation and negligible effects of kinetic and potential energy, determine the rate of entropy production, in kJ/K per kmol of fuel, for complete combustion with (a) the theoretical amount of air, (b) 400% theoretical air.\n", +"\n", +"//solution\n", +"\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", +"\n", +"//from table A-25\n", +"sFbar = 360.79 //absolute entropy of liquid octane in kj/kmol.K\n", +"\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", +"\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"\n", +"yO2 = .21\n", +"yN2 = .79\n", +"\n", +"sbarO2 = sbarO2atTref - Rbar*log(yO2) //in kj/kmol.K\n", +"sbarN2 = sbarN2atTref - Rbar*log(yN2) //in kj/kmol.K\n", +"\n", +"//for product side\n", +"yCO2 = 8/64\n", +"yH2O = 9/64\n", +"yN2p = 47/64\n", +"\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", +"\n", +"sigmadot = (8*sbarCO2 + 9*sbarH2O + 47*sbarN2p) - sFbar - (12.5*sbarO2 + 47*sbarN2)\n", +"printf(' the rate of entropy production, in kJ/K per kmol of fuel with theoretical amount of air is: %f',sigmadot)\n", +"\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", +"\n", +"//for product side \n", +"yCO2 = 8/242.5\n", +"yH2O = 9/242.5\n", +"yO2 = 37.5/242.5\n", +"yN2p = 188/242.5\n", +"\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", +"\n", +"sigmadot = (8*sbarCO2 + 9*sbarH2O + 37.5*sbarO2p +188*sbarN2p) -sFbar - (50*sbarO2 + 188*sbarN2)\n", +"printf('\n\nthe rate of entropy production, in kJ/K per kmol of fuel with 400 percent theoretical air is: %f',sigmadot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/14-Chemical_and_phase_equilibrium.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/14-Chemical_and_phase_equilibrium.ipynb new file mode 100644 index 0000000..b2b9289 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/14-Chemical_and_phase_equilibrium.ipynb @@ -0,0 +1,452 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Chemical and phase equilibrium" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.10) A closed system at a temperature of 20C and a pressure of 1 bar consists of a pure liquid water phase in equilibrium with a vapor phase composed of water vapor and dry air. Determine the departure, in percent, of the partial pressure of the water vapor from the saturation pressure of water at 20C.\n", +"\n", +"\n", +"\n", +"//solution\n", +"//With data from Table A-2 at 20C,\n", +"vf = 1.0018e-3 //in m^3/kg\n", +"psat = .0239 //in bar\n", +"p = 1 //in bar\n", +"T = 293.15 //in kelvin\n", +"\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"M = 18.02 //molat mass of water in kg/kmol\n", +"\n", +"pvbypsat = %e^(vf*(p-psat)*10^5/[(1000*Rbar/M)*T])\n", +"\n", +"percent = (pvbypsat-1)*100\n", +"printf('the departure, in percent, of the partial pressure of the water vapor from the saturation pressure of water at 20 is: %f',percent)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.1) Evaluate the equilibrium constant, expressed as log10K, for the reaction at (a) 298 K and (b) 2000 K. Compare with the value obtained from Table A-27.\n", +" \n", +" \n", +"//solution\n", +"\n", +"//The reaction is CO + .5O2 ----> CO2\n", +"\n", +"//part(a)\n", +"T = 298 //in kelvin\n", +"Rbar = 8.314 //universal gas constant in SI units\n", +"//from table A-25\n", +"\n", +"hfbarCO2 = -393520 //in kj/kmol\n", +"hfbarCO = -110530 //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", +"\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 = 45.066\n", +"printf('part(a) the value of equilibrium constant expressed as log10K is: %f',logK)\n", +"printf('\nthe value of equilibrium constant expressed as log10K from table A-27 is: %f',logKtable)\n", +"\n", +"//part(b)\n", +"T = 2000 //in kelvin\n", +"//from table A-23\n", +"hfbarCO2 = -393520 //in kj/kmol\n", +"hfbarCO = -110530 //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", +"\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", +"printf('\n\npart(b) the value of equilibrium constant expressed as log10K is: %f',logK)\n", +"printf('\nthe value of equilibrium constant expressed as log10K from table A-27 is: %f',logKtable)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.2) One kilomole of carbon monoxide, CO, reacts with .5kmol of oxygen, O2, to form an equilibrium mixture of CO2, CO, and O2 at 2500 K and (a) 1 atm, (b) 10 atm. Determine the equilibrium composition in terms of mole fractions\n", +"\n", +"\n", +"//solution\n", +"\n", +"//Applying conservation of mass, the overall balanced chemical reaction equation is\n", +"//CO + .5O2 -------> zCO + (z/2)O2 + (1-z)CO2\n", +"\n", +"//At 2500 K, Table A-27 gives\n", +"log10K = -1.44\n", +"K = 10^log10K //equilibrium constant\n", +"//part(a)\n", +"p = 1 //in atm\n", +"//solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives\n", +"z = .129\n", +"yCO = 2*z/(2 + z)\n", +"yO2 = z/(2 + z)\n", +"yCO2 = 2*(1 - z)/(2 + z)\n", +"printf('part(a) mole fraction of CO is: %f',yCO)\n", +"printf('\nmole fraction of O2 is: %f',yO2)\n", +"printf('\nmole fraction of CO2 is: %f',yCO2)\n", +"\n", +"//part(b)\n", +"p = 10 //in atm\n", +"//solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives\n", +"z = .062\n", +"yCO = 2*z/(2 + z)\n", +"yO2 = z/(2 + z)\n", +"yCO2 = 2*(1 - z)/(2 + z)\n", +"printf('\n\npart(b) mole fraction of CO is: %f',yCO)\n", +"printf('\nmole fraction of O2 is: %f',yO2)\n", +"printf('\nmole fraction of CO2 is: %f',yCO2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.3) Measurements show that at a temperature T and a pressure of 1 atm, the equilibrium mixture for the system of Example 14.2 has the composition yCO = 0.298,yO2 = .149, yCO2 = .553.Determine the temperature T of the mixture, in K.\n", +"\n", +"\n", +"//solution\n", +"yCO = .298\n", +"//solving yCO = 2z/(2 + z)\n", +"z = 2*yCO/(2 - yCO)\n", +"\n", +"p = 1 //in atm\n", +"pref = 1 //in atm\n", +"\n", +"K = (z/(1-z))*(z/(2 + z))^.5*(p/pref)^.5\n", +"\n", +"//with this value of K, table A-27 gives\n", +"T = 2881\n", +"printf('the temperature T of the mixture in kelvin is: %f',T)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.4) One kilomole of carbon monoxide reacts with the theoretical amount of air to form an equilibrium mixture of CO2, CO, O2, and N2 at 2500 K and 1 atm. Determine the equilibrium composition in terms of mole fractions, and compare with the result of Example 14.2.\n", +"\n", +"\n", +"\n", +"//solution\n", +"\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", +"\n", +"K = .0363 //equilibrium constant the solution to Example 14.2\n", +"p =1 //in atm\n", +"pref = 1 //in atm\n", +"\n", +"//solving K = (z*z^.5/(1-z))*((p/pref)*2/(5.76+z))^.5 gives\n", +"z = .175\n", +"yCO = 2*z/(5.76 + z)\n", +"yO2 = z/(5.76 + z)\n", +"yCO2 = 2*(1-z)/(5.76 + z)\n", +"yN2 = 3.76/(5.76 + z)\n", +"printf('the mole fraction of CO is: %f',yCO)\n", +"printf('\nthe mole fraction of O2 is: %f',yO2)\n", +"printf('\nthe mole fraction of CO2 is: %f',yCO2)\n", +"printf('\nthe mole fraction of N2 is: %f',yN2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.5) Carbon dioxide at 25C, 1 atm enters a reactor operating at steady state and dissociates, giving an equilibrium mixture of CO2, CO, and O2 that exits at 3200 K, 1 atm. Determine the heat transfer to the reactor, in kJ per kmol of CO2 entering. The effectsof kinetic and potential energy can be ignored and Wcvdot = 0\n", +"\n", +"\n", +"\n", +"//solution\n", +"\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", +"\n", +"p = 1 //in atm\n", +"pref = 1 //in atm\n", +"//At 3200 K, Table A-27 gives\n", +"log10k = -.189\n", +"k = 10^log10k\n", +"//solving k = ((1-z)/2)*((1-z)/(3-z))^.5 gives\n", +"z = .422\n", +"\n", +"//from tables A-25 and A-23\n", +"hfbarCO2 = -393520 //in kj/kmol\n", +"deltahbarCO2 = 174695-9364 //in kj/kmol\n", +"hfbarCO = -110530 //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 //in kj/kmol\n", +"deltahbarCO2r = 0 //in kj/kmol\n", +"\n", +"Qcvdot = .422*(hfbarCO2 + deltahbarCO2) + .578*(hfbarCO + deltahbarCO) + .289*(hfbarO2 + deltahbarO2)- (hfbarCO2r + deltahbarCO2r) \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.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.6) Carbon monoxide at 25C, 1 atm enters a well-insulated reactor and reacts with the theoretical amount of air entering at the same temperature and pressure. An equilibrium mixture of CO2, CO, O2, and N2 exits the reactor at a pressure of 1 atm. For steady-state operation and negligible effects of kinetic and potential energy, determine the composition and temperature of the exiting mixture in K.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//The overall reaction is\n", +"//CO + .5O2 + 1.88N2 -------> zCO + (z/2)O2 + (1-z)CO2 + 1.88N2\n", +"p =1 //in atm\n", +"pref = 1 //in atm\n", +"\n", +"//solving equations K = (z/(1-z))*(z/(5.76+z))^.5 and z*deltahbarCO + (z/2)*deltahbarO2 + (1-z)*deltahbarCO2 + 1.88deltahbarN2 + (1-z)*[hfbarCO2-hfbarCO]= 0\n", +"z = .125\n", +"T = 2399 //in kelvin\n", +"printf('the temperature of the exiting mixture in kelvin is: %f',T)\n", +"printf('\ncomposition of the equilibrium mixture, in kmol per kmol of CO entering the reactor, is then 0.125CO, 0.0625O2, 0.875CO2, 1.88N2.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('IT software problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.8) Consider an equilibrium mixture at 2000K consisting of Cs, Cs+, and e-, where Cs denotes neutral cesium atoms, Cs+ singly ionized cesium ions, and e- free electrons. The ionization-equilibrium constant at this temperature for\n", +"// Cs <--> Cs+ + e-\n", +"//is K = 15.63. Determine the pressure, in atmospheres, if the ionization of Cs is 95% complete, and plot percent completion of ionization versus pressure ranging from 0 to 10 atm.\n", +"\n", +"\n", +"\n", +"//solution\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", +"\n", +"K = 15.63\n", +"z = .95\n", +"pref =1 //in atm\n", +"p = pref*K*((1-z^2)/z^2)\n", +"printf('the pressure in atm if the ionization of CS is 95 percent complete is: %f',p)\n", +"\n", +"x = linspace(0,10,100)\n", +"for i = 1:100\n", +" y(1,i) = 100*sqrt(1/(1+x(1,i)/K))\n", +"end\n", +"plot(x,y)\n", +"xtitle('','p(atm)','z(%)')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(14.9) As a result of heating, a system consisting initially of 1 kmol of CO2,.5 kmol of O2, and 5 kmol of N2 forms an equilibrium mixture of CO2, CO, O2, N2, and NO at 3000 K, 1 atm. Determine the composition of the equilibrium mixture.\n", +"\n", +"\n", +"\n", +"//solution\n", +"\n", +"//The overall reaction can be written as\n", +"//CO2 + .5O2 + .5N2 ----> aCO + bNO + (1-a)CO2 + .5(1+a-b)O2 + .5(1-b)N2\n", +"\n", +"//At 3000 K, Table A-27 provides\n", +"log10K1 = -.485 //equilibrium constant of the reaction CO2 <--> CO + .5O2\n", +"log10K2 = -.913 //equilibrium constant of the reaction .5O2 + .5N2 <-->NO\n", +"\n", +"K1 = 10^log10K1\n", +"K2 = 10^log10K2\n", +"\n", +"//solving equations K1 = (a/(1-a))*((1+a-b)/(4+a))^.5 and K2 = 2b/((1+a-b)*(1-b))^.5\n", +"a = .3745\n", +"b = .0675\n", +"printf('The composition of the equilibrium mixture, in kmol per kmol of CO2 present initially, is then 0.3745CO, 0.0675NO, 0.6255CO2, 0.6535O2, 0.4663N2.')" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/2-Energy_and_the_first_law_of_thermodynamics.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/2-Energy_and_the_first_law_of_thermodynamics.ipynb new file mode 100644 index 0000000..bbcdd10 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/2-Energy_and_the_first_law_of_thermodynamics.ipynb @@ -0,0 +1,308 @@ +{ +"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": [ +"//(2.1) A gas in a piston–cylinder assembly undergoes an expansion process for which the relationship between pressure and volume is given by p*(v^n) = constant.The initial pressure is 3 bar, the initial volume is 0.1 m3, and the final volume is 0.2 m3. Determine the work for the process,in kJ, if (a) n=1.5, (b) n=1.0,and (c) n=0.\n", +"\n", +"//solution\n", +"\n", +"// variable initialization\n", +"p1 = 3*(10^5) // initial pressure of gas in pascal\n", +"v1 = .1 //initial volumme of gas in meter^3\n", +"v2 = .2 //final volume of gas in meter^3\n", +"\n", +"//part (a) i.e. n=1.5\n", +"funcprot(0);\n", +"function [constant] = f1(n)\n", +" constant = p1*(v1^n); //p*(v^n) = constant\n", +"endfunction;\n", +"\n", +"function [p] = f2(v,n) \n", +" p = f1(n)/(v^n); //expressing pressure as function of volume \n", +"endfunction;\n", +"\n", +"function [work1] = f3(n)\n", +" work1 = intg(v1,v2,f2); //integrating pdv from initial to final volume \n", +"endfunction;\n", +"\n", +"w1 = f3(1.5)/1000; // divided by 1000 to convert to KJ\n", +"disp(w1,'the work done for n=1.5 in KJ is');\n", +"\n", +"//part(b) i.e. n = 1\n", +"\n", +"w2 = f3(1)/1000;\n", +"disp(w2,'the work done for n=1 in KJ is');\n", +"\n", +"//part(c) i.e. n=0\n", +"\n", +"w3 = f3(0)/1000;\n", +"disp(w3,'the work done for n=0 in KJ is');\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (2.2) Four kilograms of a certain gas is contained within a piston–cylinder assembly. The gas undergoes a process for which the pressure–volume relationship is p*(v^1.5) = constant. The initial pressure is 3 bar, the initial volume is 0.1 m3, and the final volume is 0.2 m3. The change in specific internal energy of the gas in the process is u2-u1 =- 4.6 kJ/kg. There are no significant changes in kinetic or potential energy. Determine the net heat transfer for the process, in kJ.\n", +"\n", +"// solution\n", +"\n", +"//variable initialization\n", +"p1 = 3*(10^5) // initial pressure in pascal\n", +"v1 = .1 // initial volume in m3\n", +"v2 = .2 // initial volume in m3\n", +"m = 4 //mass of the gas in kg\n", +"deltau = -4.6 // change in specific internal energy in KJ/Kg\n", +"\n", +"\n", +"funcprot(0);\n", +"function [constant] = f1(n)\n", +" constant = p1*(v1^n); //p*(v^n) = constant\n", +"endfunction;\n", +"\n", +"function [p] = f2(v,n) \n", +" p = f1(n)/(v^n); //expressing pressure as function of volume \n", +"endfunction;\n", +"\n", +"function [work] = f3(n)\n", +" work = intg(v1,v2,f2); //integrating pdv from initial to final volume \n", +"endfunction;\n", +"\n", +"w = f3(1.5)/1000; // divided by 1000 to convert to KJ\n", +"\n", +"deltaU = m*deltau; // change in internal energy in KJ\n", +"Q = deltaU + w; // neglecting kinetic and potential energy changes\n", +"\n", +"disp(Q,'net heat transfer for the process in KJ')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(2.3) Air is contained in a vertical piston–cylinder assembly fitted with an electrical resistor. The atmosphere exerts a pressure of 1 bar on the top of the piston, which has a mass of 45 kg and a face area of .09 m2. Electric current passes through the resistor, and the volume of the air slowly increases by .045 m3 while its pressure remains constant. The mass of the air is .27 kg, and its specific internal energy increases by 42 kJ/kg. The air and piston are at rest initially and finally. The piston–cylinder material is a ceramic composite and thus a good insulator. Friction between the piston and cylinder wall canbe ignored, and the local acceleration of gravity is g = 9.81 m/s2. Determine the heat transfer from the resistor to the air, in kJ, for a system consisting of (a) the air alone, (b) the air and the piston.\n", +"//solution\n", +"// variable initialization\n", +"patm = 10^5 // atmospheric pressure in pascal.\n", +"mp = 45 // mass of piston in Kg\n", +"A = .09 // face area of piston in m2\n", +"deltaV = .045 // increment of the volume of air in m3\n", +"m = .27 // mass of air in kg\n", +"deltau = 42 // 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", +"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", +"printf('the answer given in book is incorrect.They have miscalculated deltaU.The correct heat transfer from resistor to air in KJ for air alone as system is:\n\n\tQ=%f',Q);\n", +"// the answer given in book is incorrect. deltaU is incorrect in book. \n", +"//part(b) i.e. (air+piston) is system\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", +"printf('\n\nthe answer given in book is incorrect.They have miscalculated deltaU.The correct heat transfer from resistor to air in KJ for air + piston as system is:\n\n\tQt=%f',Qt);\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(2.4) During steady-state operation, a gearbox receives 60 kW through the input shaft and delivers power through the output shaft.For the gearbox as the system, the rate of energy transfer by convection is Qdot = -hA(tb-tf) where h = 0.171 kW/m2.k is the heat transfer coefficient, A= 1.0 m2 is the outer surface area of the gearbox, Tb = 300k is the temperature at the outer surface, and Tf 293k is the temperature of the surrounding air away from the immediate vicinity of the gearbox. For the gearbox, evaluate the heat transfer rate and the power delivered through the output shaft, each in kW.\n", +"\n", +"//solution\n", +"\n", +"// initializing variables\n", +"w1dot = -60 // input work rate in KW\n", +"h = .171 // heat transfer coefficient,unit in KW/m2 .K\n", +"A = 1 // outer surface area of gearbox, unit in m2\n", +"Tb = 300 // outer surface temperature in kelvin\n", +"Tf = 293 // temperature of the sorrounding\n", +"\n", +"Qdot = -h*A*(Tb-Tf); // rate of energy transfer by heat\n", +"wdot = Qdot; // steady state energy equation\n", +"w2dot = wdot-w1dot;\n", +"\n", +"printf('the heat transfer rate in KW is:\n\tQdot = %f',Qdot);\n", +"printf('\n\nthe power delivered through output shaft in KW is:\n\tw2dot = %f',w2dot);\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(2.5) A silicon chip measuring 5 mm on a side and 1 mm in thickness is embedded in a ceramic substrate. At steady state, the chip has an electrical power input of 0.225 W. The top surface of the chip is exposed to a coolant whose temperature is 20 degree Celcius . The heat transfer coefficient for convection between the chip and the coolant is 150 W/m2 K. If heat transfer by conduction between the chip and the substrate is negligible, determine the surface temperature of the chip, in degree Celcius.\n", +"\n", +"// solution\n", +"\n", +"//variable initialization\n", +"\n", +"s=5*(10^-3); //measurement on a side in meter\n", +"wdot = -.225 //power input in watt\n", +"Tf = 293 //coolant temprature in kelvin\n", +"h = 150 //heat transfer coefficient in w/m2 k\n", +"\n", +"A = s^2; //surface area\n", +"Tb = ((-wdot/(h*A)) + Tf - 273) ; //surface temperature in degree\n", +"\n", +"printf('the surface temperature of the chip in degree celcius is:\n\t Tb = %f',Tb);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(2.6) The rate of heat transfer between a certain electric motor and its surroundings varies with time as Qdot = -.2[1-e^(-.05t)] where t is in seconds and Qdot in KW.The shaft of the motor rotates at a constant speed of omega = 100 rad/s and applies a constant torque of tau = 18 N.m to an external load. The motor draws a constant electric power input equal to 2.0 kW. For the motor, plot Qdot and Wdot,each in kW, and the change in energy deltaE in kJ, as functions of time from t =0 to t = 120s.\n", +"\n", +"//solution\n", +"\n", +"//initializing variables\n", +"omega = 100; // motor rotation speed in rad/s\n", +"tau = 18; //torque applied by shaft in N.m\n", +"Welecdot = -2; // electric power input in KW\n", +"\n", +"funcprot(0);\n", +"Wshaftdot = (tau*omega)/1000; //shaft work rate in KW\n", +"Wdot = Welecdot + Wshaftdot; //net work rate in KW\n", +"\n", +"function [Qdot]=f(t)\n", +" Qdot = (-.2)* [1-%e^(-.05*t)];\n", +"endfunction\n", +"\n", +"function [Edot]=f1(t) //function for rate of change of energy\n", +" Edot =(-.2)* [1-%e^(-.05*t)] - Wdot ;\n", +"endfunction;\n", +"\n", +"function [deltaE] =f2(t) //function for change in energy \n", +" deltaE = intg(0,t,f1); \n", +"endfunction;\n", +"\n", +"t = linspace(0,120,100);\n", +"for i = 1:100\n", +" Qdt(1,i)= f((120/99)*(i-1));\n", +" Wdt(1,i)= Wdot;\n", +" dltaE(1,i)= f2((120/99)*(i-1));\n", +"end\n", +"plot2d(t,Qdt,rect=[0,-.25,120,0]);\n", +"plot2d(t,Wdt,style=5,rect=[0,-.25,120,0]);\n", +"xtitle('','time,s','Qdot,Wdot,KW');\n", +"legend('Qdot','Wdot');\n", +"xset('window',1);\n", +"plot2d(t,dltaE);\n", +"xtitle('deltaE versus time','Time, s','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_Engineering_Thermodynamics_by_M_J_Moran/3-Evaluating_properties.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/3-Evaluating_properties.ipynb new file mode 100644 index 0000000..670d500 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/3-Evaluating_properties.ipynb @@ -0,0 +1,480 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Evaluating properties" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.10) One kmol of carbon dioxide gas (CO2) in a piston–cylinder assembly undergoes a constant-pressure process at 1 bar from T1 = 300 K to T2. Plot the heat transfer to the gas, in kJ, versus T2 ranging from 300 to 1500 K. Assume the ideal gas model, and determine the specific internal energy change of the gas using. (a)Ubar data from IT.(b) a constant Cv bar evaluated at T1 from IT.\n", +"\n", +"printf('This is solved by the referred software ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.11) Air undergoes a polytropic compression in a piston–cylinder assembly from p1 = 1 bar, T1 = 22C to p2 = 5 bars. Employing the ideal gas model, determine the work and heat transfer per unit mass, in kJ/kg, if n = 1.3.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 1 //initial pressure in bar\n", +"T1 = 295 //initial temperature in kelvin \n", +"p2 = 5 //final pressure in bar\n", +"n=1.3 //polytropic constant\n", +"R = 8314/28.97 // gas constant for air in SI units\n", +"\n", +"T2 = T1*(p2/p1)^((n-1)/n)\n", +"w = R*(T2-T1)/(1-n)\n", +"printf('the work done per unit mass in KJ/Kg is :\n\tW = %f',w/1000)\n", +"\n", +"//from table A-22\n", +"u2 = 306.53\n", +"u1 = 210.49\n", +"Q = u2-u1+w/1000\n", +"\n", +"printf('\n\nthe heat transfer per unit mass in KJ/Kg is:\n\t Q = %f',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (3.1) A closed, rigid container of volume 0.5 m3 is placed on a hot plate. Initially, the container holds a two-phase mixture of saturated liquid water and saturated water vapor at p1 = 1 bar with a quality of 0.5. After heating, the pressure in the container is p2= 1.5 bar. Indicate the initial and final states on a T–v diagram, and determine (a) the temperature, in degree Celcius, at each state.(b) the mass of vapor present at each state, in kg.(c) If heating continues, determine the pressure, in bar, when the container holds only saturated vapor.\n", +"// solution \n", +"//initializing variables\n", +"p1 = 10^5 // initial pressure in pascal \n", +"x1 = .5 // initial quality\n", +"p2 = 1.5*10^5 // pressure after heating in pascal\n", +"v = .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", +"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", +"vf2 = 1.0582*10^(-3) // specific volume of fluid in state 2 in m3/Kg(from table A-3)\n", +"vg2 = 1.159 // specific volume of gas in state 2 in m3/Kg(from table A-3) \n", +"// part (a)\n", +"T1 = 99.63 // temperature in degree celcius in state 1, from table A-3\n", +"T2 = 111.4 // temperature in degree celcius in state 2, from table A-3\n", +"printf('the temperature in degree celcius in state 1 is:\n\t T1 = %f',T1);\n", +"printf('\nthe temperature in degree celcius in state 2 is:\n\t T2 = %f',T2);\n", +"// part (b)\n", +"m = v/v1 // total mass in Kg\n", +"mg1 = x1*m // mass of vapour in state 1 in Kg\n", +"printf('\nthe mass of vapor in state 1 in Kg is:\n\t mg1 = %f',mg1 );\n", +"x2 = (v1-vf2)/(vg2-vf2) // quality in state 2\n", +"mg2 = x2*m // mass of vapor in state 2 in Kg \n", +"printf('\nthe mass of vapor in state 2 in Kg is:\n\t mg2 = %f',mg2 );\n", +"//part(c)\n", +"p3 = 2.11 // pressure in state 3 from table A-3\n", +"printf('\nthe pressure corresponding to state 3 in bar is:\n\t p3 = %f',p3 );" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.2) A vertical piston–cylinder assembly containing 0.05 kg of ammonia, initially a saturated vapor, is placed on a hot plate. Due to the weight of the piston and the surrounding atmospheric pressure, the pressure of the ammonia is 1.5 bars. Heating occurs slowly, and the ammonia expands at constant pressure until the final temperature is 25C. Show the initial and final states on T–v and p–v diagrams, and determine(a) the volume occupied by the ammonia at each state, in m3.(b) the work for the process, in kJ.\n", +"\n", +"// solution\n", +"\n", +"// variable initialization\n", +"\n", +"m = .05 // mass of ammonia in kg \n", +"p1 = 1.5*10^5 // initial pressure of ammonia in pascal\n", +"T2 = 25 // final temperature in degree celcius\n", +"\n", +"//part (a)\n", +"v1 = .7787 // specific volume in state 1 in m3/kg from table A-14\n", +"V1 = m*v1 // volume occupied by ammonia in state 1 in m3\n", +"v2 = .9553 // specific volume in state 2 in m3/kg from table A-15\n", +"V2 = m*v2 // volume occupied by ammonia in state 2 in m3\n", +"\n", +"printf('the volume occupied by ammonia in state 1 in m3 is:\n\t V1 = %f',V1);\n", +"printf('\nthe volume occupied by ammonia in state 2 in m3 is:\n\t V2 = %f',V2);\n", +"\n", +"// part (b)\n", +"w = (p1*(V2-V1))/1000 // work in KJ\n", +"printf('\nthe work done for the process in KJ is:\n\t W = %f',w)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (3.3) A well-insulated rigid tank having a volume of .25 m3 contains saturated water vapor at 100C. The water is rapidly stirred until the pressure is 1.5 bars. Determine the temperature at the final state, in C, and the work during the process, in kJ.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"V = .25 // volume of tank in m3\n", +"T1 = 100 // initial temperature in degree celcius\n", +"p2 = 1.5 // final pressure in bars\n", +"\n", +"v = 1.673 // specific volume in m3/kg obtained using table A-2\n", +"u1 = 2506.5 // specific internal energy in state 1 in KJ/Kg obtained from table A-2\n", +"T2 = 273 // 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", +"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", +"printf('the temperature at the final state in degree celcius is:\n T2 = %f',T2);\n", +"printf('\nthe work during the process in KJ is:\n\tW = %f',W); " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (3.4) Water contained in a piston–cylinder assembly undergoes two processes in series from an initial state where the pressure is 10 bar and the temperature is 400C.Process 1–2: The water is cooled as it is compressed at a constant pressure of 10 bar to the saturated vapor state. Process 2–3: The water is cooled at constant volume to 150C.(a) Sketch both processes on T–v and p–v diagrams.(b) For the overall process determine the work, in kJ/kg. (c) For the overall process determine the heat transfer, in kJ/kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 10*(10^5) //initial pressure in pascal\n", +"T1 = 400 // initial temperature in degree celcius\n", +"\n", +"v1 = .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", +"v2 = .1944 // specific volume in state 2 in m3/kg obtained from table A-3\n", +"w1to2 = (P1*(v2-v1))/1000 // work in KJ/Kg in process 1-2\n", +"w2to3 = 0 // work in process 2-3\n", +"W = w1to2 + w2to3 // net work in KJ/kg\n", +"\n", +"v3 = v2\n", +"vf3 = 1.0905*10^(-3) // specific volume of fluid in state 3 from table A-2\n", +"vg3 = .3928 // specific volume of gas in state 3 from table A-2\n", +"x3 = (v3-vf3)/(vg3-vf3)\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", +"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", +"printf(' the work done in the overall process in KJ/Kg is:\n\t W = %f',W);\n", +"printf(' \nthe heat transfer in the overall process in KJ/Kg is:\n\t Q = %f',q);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.5) For the system of Example 3.1, plot the heat transfer, in kJ, and the mass of saturated vapor present, in kg, each versus pressure at state 2 ranging from 1 to 2 bar. Discuss the results.\n", +" printf('The problem is solved by using the software referred to in the book. The data can be retrieved from that software');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (3.6) A closed, rigid tank filled with water vapor, initially at 20 MPa, 520C, is cooled until its temperature reaches 400C. Using the compressibility chart, determine. (a) the specific volume of the water vapor in m3/kg at the initial state.(b) the pressure in MPa at the final state.Compare the results of parts (a) and (b) with the values obtained from the superheated vapor table, Table A-4.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 20 //initial pressure in MPa\n", +"T1 = 520 // initial temperature in degree celcius\n", +"T2 = 400 // final temperature in degree celcius\n", +"\n", +"//part(a)\n", +"//from table A-1\n", +"Tc = 647.3 //critical temperature in kelvin\n", +"pc = 22.09 //critical pressure in MPa\n", +"\n", +"Tr = (T1+273)/Tc //reduced temperature\n", +"Pr = p1/pc //reduced pressure \n", +"Z1 = .83 //compressibility factor\n", +"R = 8.314 //universal gas constant in SI unit \n", +"n = 1000/18.02 //number of moles in a kg of water\n", +"v1 = (Z1*n*R*(T1+273))/(p1*10^6)\n", +"printf('the specific volume in state1 in m3/Kg is:\n\t v1 = %f',v1)\n", +"printf('\n and the corresponding value obtained from table A-4 is .01551 m^3/Kg')\n", +"\n", +"//part(b)\n", +"vr = v1*(pc*10^6)/(n*R*Tc)\n", +"Tr2 = (T2+273)/Tc\n", +"//at above vr and Tr2\n", +"PR = .69\n", +"P2 = pc*PR\n", +"printf('\n\n the pressure in MPa in the final state is: \n\t P2 = %f',P2)\n", +"printf('\n and the corresponding value from the table is 15.16Mpa')\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.7) One pound of air undergoes a thermodynamic cycle consisting of three processes.Process 1–2: constant specific volume Process 2–3: constant-temperature expansion Process 3–1: constant-pressure compression. At state 1, the temperature is 300K, and the pressure is 1 bar. At state 2, the pressure is 2 bars. Employing the ideal gas equation of state, (a) sketch the cycle on p–v coordinates. (b) determine the temperature at state 2, in K; (c) determine the specific volume at state 3, in m3/kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //temperature in state 1 in kelvin\n", +"P1 = 1 //pressure in state 1 in bar\n", +"P2 = 2 //pressure in state 2 in bar\n", +"\n", +"R = 287 //gas constant of air in SI units\n", +"v1 = (R*T1)/(P1*10^5) //specific volume in state 1\n", +"P = linspace(1,2,100)\n", +"for i = 1:100\n", +" v(1,i) = v1\n", +"end\n", +"\n", +"plot2d(v,P,rect=[0,0,5,2.5]);\n", +"\n", +"T2 = (P2*10^5*v1)/R\n", +"v3 = (R*T2)/(P1*10^5)\n", +"vv = linspace(v1,v3,100)\n", +"plot(vv,P1)\n", +"\n", +"function[out]= f(inp)\n", +" out = (R*T2)/inp\n", +"endfunction\n", +"\n", +"VV = linspace(v1,v3,100)\n", +"for j = 1:100\n", +" pp(1,j) = f(VV(1,j))/(10^5)\n", +"end\n", +"plot2d(VV,pp)\n", +"xtitle('','v','p(bar)')\n", +"\n", +"printf('the temperature in kelvin in state 2 is:\n\t T2 = %f',T2)\n", +"printf('\n\nthe specific volume in state 3 in m^3/kg is \n\t v = %f',v3)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(3.8) A piston–cylinder assembly contains 0.9 kg of air at a temperature of 300K and a pressure of 1 bar. The air is compressed to a state where the temperature is 470K and the pressure is 6 bars. During the compression, there is a heat transfer from the air to the surroundings equal to 20 kJ. Using the ideal gas model for air, determine the work during the process, in kJ.\n", +"\n", +"//solutiion\n", +"\n", +"//variable initialization\n", +"m = .9 // mass of air in kg\n", +"T1 = 300 // initial temperature in kelvin\n", +"P1 = 1 // initial pressure in bar\n", +"T2 = 470 // final temperature in kelvin\n", +"P2 = 6 // final pressure in bar\n", +"Q = -20 // heat transfer in kj\n", +"\n", +"//from table A-22 \n", +"u1 = 214.07 // in KJ/kg\n", +"u2 = 337.32 // in KJ/Kg\n", +"deltaU = m*(u2-u1) // change in internal energy in kj\n", +"W = Q - deltaU // in KJ/kg\n", +"printf('the work during the process in KJ is \n\t W = %f',W)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (3.9) Two tanks are connected by a valve. One tank contains 2 kg of carbon monoxide gas at 77C and 0.7 bar. The other tank holds 8 kg of the same gas at 27C and 1.2 bar. The valve is opened and the gases are allowed to mix while receiving energy byheat transfer from the surroundings. The final equilibrium temperature is 42C. Using the ideal gas model, determine (a) the final equilibrium pressure, in bar (b) the heat transfer for the process, in kJ.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"\n", +"m1 = 2 //initial mass of gas in tank 1 in kg\n", +"T1 = 350 //initial temperature in kelvin in tank1\n", +"p1 = .7 //initial pressure in bar in tank 1\n", +"m2 = 8 //initial mass of gas in tank 2 in kg\n", +"T2 = 300 //initial temperature in kelvin in tank 2\n", +"p2 = 1.2 //initial pressure in bar in tank 2\n", +"Tf = 315 //final equilibrium temperature in kelvin\n", +"\n", +"pf = ((m1+m2)*Tf)/((m1*T1/p1)+(m2*T2/p2)) \n", +"\n", +"printf('the final equilibrium pressure in bar is: \n\t pf = %f',pf)\n", +"\n", +"//from table A-20\n", +"Cv = .745 //in KJ/Kg.k\n", +"Ui = (m1*Cv*T1)+(m2*Cv*T2)\n", +"Uf = (m1+m2)*Cv*Tf\n", +"deltaU = Uf-Ui\n", +"Q = deltaU\n", +"printf('\n\nthe heat transfer for the process in KJ is :\n\t Q = %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_Engineering_Thermodynamics_by_M_J_Moran/4-Control_volume_analysis_using_energy.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/4-Control_volume_analysis_using_energy.ipynb new file mode 100644 index 0000000..d33e59e --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/4-Control_volume_analysis_using_energy.ipynb @@ -0,0 +1,664 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Control volume analysis using energy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.10) An industrial process discharges gaseous combustion products at 478K, 1 bar with a mass flow rate of 69.78 kg/s. As shown in Fig. E 4.10, a proposed system for utilizing the combustion products combines a heat-recovery steam generator with a turbine. At steady state, combustion products exit the steam generator at 400K, 1 bar and a separate stream of water enters at .275 MPa, 38.9C with a mass flow rate of 2.079 kg/s. At the exit of the turbine, the pressure is 0.07 bars and the quality is 93%. Heat transfer from the outer surfaces of the steam generator and turbine can be ignored, as can the changes in kinetic and potential energies of the flowing streams. There is no significant pressure drop for the water flowing through the steam generator. The combustion products can be modeled as air as an ideal gas. (a) Determine the power developed by the turbine, in kJ/s. (b) Determine the turbine inlet temperature, in C.\n", +"\n", +"//solution \n", +"\n", +"//variable initialization\n", +"P1 = 1 //pressure of industrial discharge in bar\n", +"T1 = 478 //temperature of industrial discharge in kelvin\n", +"m1dot = 69.78 //mass flow rate of industrial discharge in kg/s\n", +"T2 = 400 //temperature of exit products from steam generator in kelvin\n", +"P2 = 1 //pressure of exit products from steam generator in bar\n", +"P3 = .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 = .07 //exit pressure of the turbine in bars\n", +"x5 = .93 //quality of turbine exit\n", +"\n", +"//part (a)\n", +"m2dot = m1dot //since gas and water streams do not mix\n", +"m5dot = m3dot //--DO\n", +"\n", +"//from table A-22,\n", +"h1 = 480.3 //in kj/kg\n", +"h2 = 400.98 //in Kj/kg\n", +"\n", +"//from table A-2,\n", +"h3 = 162.9 //assumption: h3 = hf(T3), units in Kj/kg\n", +"\n", +"//from table A-3\n", +"hf5 = 161 //in kj/kg\n", +"hg5 = 2571.72 //in kj/kg\n", +"\n", +"h5 = hf5 + x5*(hg5-hf5)\n", +"Wcvdot = m1dot*h1 + m3dot*h3 - m2dot*h2 - m5dot*h5\n", +"\n", +"printf('the power developed by the turbine in kj/s is: \n\t Wcvdot = %f',Wcvdot)\n", +"\n", +"//part(b)\n", +"P4 = P3 //from the assumption that there is no pressure drop for water flowing through the steam generator\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", +"T4 = 180 //in degree celcius\n", +"printf('\n\nturbine inlet temperature in degree celcius is :\n\t T4 = %f',T4)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.11) A tank having a volume of 0.85 m3 initially contains water as a two-phase liquid—vapor mixture at 260C and a quality of 0.7. Saturated water vapor at 260C is slowly withdrawn through a pressure-regulating valve at the top of the tank as energy is transferred by heat to maintain the pressure constant in the tank. This continues until the tank is filled with saturated vapor at 260C. Determine the amount of heat transfer, in kJ. Neglect all kinetic and potential energy effects.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"V = .85 //volume of tank in m^3\n", +"T1 = 260 //initial temperature of the tank in degree celcius\n", +"X1 = .7 //initial quality\n", +"\n", +"//from table A-2\n", +"uf1 = 1128.4 //in kg/kg\n", +"ug1 = 2599 //in kg/kg\n", +"\n", +"vf1 = 1.2755e-3 //in m^3/kg\n", +"vg1 = .04221 //in m^3/kg\n", +"\n", +"u1 = uf1 + X1*(ug1-uf1) //in kj/kg\n", +"v1 = vf1 + X1*(vg1-vf1) //in m^3/kg\n", +"\n", +"m1 = V/v1 //initial mass in kg\n", +"\n", +"//for final state, from table A-2,\n", +"u2 = 2599 // units in KJ/kg \n", +"v2 = 42.21e-3 //units in m^3/Kg\n", +"he = 2796.6 //units in KJ/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", +"printf('the amount of heat transfer in KJ is : \n\t Qcv = %f',Qcv)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.12) Steam at a pressure of 15 bar and a temperature of 320C is contained in a large vessel. Connected to the vessel through a valve is a turbine followed by a small initially evacuated tank with a volume of 0.6 m3. When emergency power is required, the valve is opened and the tank fills with steam until the pressure is 15 bar. The temperature in the tank is then 400C. The filling process takes place adiabatically and kinetic and potential energy effects are negligible. Determine the amount of work developed by the turbine, in kJ.\n", +"\n", +"\n", +"// solution\n", +"\n", +"//variable initialization\n", +"Pv = 15 //pressure in the vessel in bar\n", +"Tv = 320 //temperature in the vessel in degree celcius\n", +"Vt = .6 //volume of a tank in m^3\n", +"Tt = 400 //temperature in the tank in degree celcius when the tank is full\n", +"\n", +"//since the tank is initially empty\n", +"m1 = 0\n", +"u1 = 0\n", +"\n", +"//from table A-4, at 15bar and 400 degree celcius\n", +"v2 = .203 //in m^3/kg\n", +"m2 = Vt/v2 //mass within the tank at the end of the process in kg\n", +"//from table A-4,\n", +"hi = 3081.9 //in kj/kg\n", +"u2 = 2951.3 //in kj/kg\n", +"deltaUcv = m2*u2-m1*u1\n", +"Wcv = hi*(m2-m1)-deltaUcv\n", +"printf('the amount of work developed by the turbine in kj is:\n\t Wcv = %f ',Wcv)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.13) An air compressor rapidly fills a .28m3 tank, initially containing air at 21C, 1 bar, with air drawn from the atmosphere at 21C, 1 bar. During filling, the relationship between the pressure and specific volume of the air in the tank is pv^1.4 = constant. The ideal gas model applies for the air, and kinetic and potential energy effects are negligible. Plot the pressure, in atm, and the temperature, in F, of the air within the tank, each versus the ratio m/m1, where m1 is the initial mass in the tank and m is the mass in the tank at time t > 0. Also, plot the compressor work input, in kJ, versus m/m1. Let m/m1 vary from 1 to 3.\n", +"\n", +"\n", +"\n", +"//solution\n", +"printf('its an IT software problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.14) A tank containing 45 kg of liquid water initially at 45C has one inlet and one exit with equal mass flow rates. Liquid water enters at 45C and a mass flow rate of 270 kg/h. A cooling coil immersed in the water removes energy at a rate of 7.6 kW. The water is well mixed by a paddle wheel so that the water temperature is uniform throughout. The power input to the water from the paddle wheel is 0.6 kW. The pressures at the inlet and exit are equal and all kinetic and potential energy effects can be ignored. Plot the variation of water temperature with time.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"\n", +"funcprot(0)\n", +"mcv = 45 //initial mass of water in kg \n", +"Ti = 318 //initial temperature of water in kelvin\n", +"mdot = 270/3600 //mass flow rate in kg/s\n", +"Qcvdot = -7.6*10^3 //rate of energy removal by coil in Watt\n", +"Wcvdot = -.6*10^3 //power input from the paddle in Watt\n", +"\n", +"c = 4.2*10^3 //specific heat for liquid water in J/Kg.k\n", +"\n", +"function Tdot= f(t,T)\n", +" Tdot = (Qcvdot-Wcvdot+mdot*c*(Ti-T))/(mcv*c) \n", +"endfunction\n", +"\n", +"t = 0:.1:3600\n", +"T = ode(Ti,0,t,f)\n", +"plot2d(t/3600,T)\n", +"xtitle('','time(h)','water temperature(kelvin)')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.1) A feedwater heater operating at steady state has two inlets and one exit. At inlet 1, water vapor enters at p1 = 7 bar, T1= 200C with a mass flow rate of 40 kg/s. At inlet 2, liquid water at p2 = 7 bar, T2 = 40C enters through an area A2 = 25 cm2. Saturated liquid at 7 bar exits at 3 with a volumetric flow rate of 0.06 m3/s. Determine the mass flow rates at inlet 2 and at the exit, in kg/s, and the velocity at inlet 2, in m/s.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 7 //pressure at inlet 1 in bar\n", +"T1 = 200 //temperature at inlet 1 in degree celcius\n", +"m1dot = 40 //mass flow rate in Kg/s at inlet 1\n", +"P2 = 7 //pressure in bar at inlet 2\n", +"T2 = 40 //temperature at inlet 2 in degree celcius\n", +"A2 = 25 //area of inlet 2 in cm^2\n", +"P3 = 7 //exit pressure in bar \n", +"AV3 = .06 //volumetric flow rate through exit in m^3/s\n", +"\n", +"//from table A-3\n", +"v3 = 1.108*10^(-3) //specific volume at the exit in m^3/Kg\n", +"m3dot = AV3/v3 //mass flow rate at the exit\n", +"m2dot = m3dot-m1dot //mass flow rate at inlet 2\n", +"//from table A-2\n", +"v2 = 1.0078*10^(-3) //specific volume in state 2 in m^3/kg\n", +"V2 =m2dot*v2/(A2*10^(-4))\n", +"printf('the mass flow rate at the inlet 2 in kg/s is \n\t m2dot = %f',m2dot)\n", +"printf('\n the mass flow rate at the exit in kg/s is \n\t m3dot =%f',m3dot)\n", +"printf('\n\nthe velocity at inlet 2 in m/s is \n\t V2 = %f',V2)\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.2) Water flows into the top of an open barrel at a constant mass flow rate of 7 kg/s. Water exits through a pipe near the base with a mass flow rate proportional to the height of liquid inside:medot = 1.4L, where L is the instantaneous liquid height, in m. The area of the base is 0.2 m2, and the density of water is 1000 kg/m3. If the barrel is initially empty, plot the variation of liquid height with time and comment on the result.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"midot = 7 //inlet mass flow rate in kg/s\n", +"A = .2 //area of base in m^2\n", +"d = 1000 //density of water in kg/m^3\n", +"\n", +"function Ldot = f(t,L)\n", +" Ldot = (midot/(d*A))-((1.4*L)/(d*A)) \n", +"endfunction\n", +"\n", +"t=0:.01:1000\n", +"L = ode(0,0,t,f)\n", +"plot2d(t,L)\n", +"xtitle('','time','height')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.3) Steam enters a converging–diverging nozzle operating at steady state with p1 = 40 bar, T1= 400C, and a velocity of 10 m/s. The steam flows through the nozzle with negligible heat transfer and no significant change in potential energy. At the exit, p2 = 15 bar, and the velocity is 665 m/s. The mass flow rate is 2 kg/s. Determine the exit area of the nozzle, in m2.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 40 //entry pressure in bar\n", +"T1 = 400 //entry temperature in degree celcius\n", +"V1 = 10 //entry velocity in m/s\n", +"P2 = 15 //exit pressure in bar\n", +"V2 =665 //exit velocity in m/s\n", +"mdot = 2 //mass flow rate in kg/s\n", +"\n", +"//from table A-4\n", +"h1 = 3213.6 //specific enthalpy in in kj/kg\n", +"\n", +"h2 = h1+((V1^2-V2^2)/2)/1000\n", +"\n", +"//from table A-4\n", +"v2 = .1627 //specific volume at the exit in m^3/kg\n", +"A2 = mdot*v2/V2\n", +"printf('the exit area of the nozzle in m^2 is \n\t A2 = %e',A2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.4) Steam enters a turbine operating at steady state with a mass flow rate of 4600 kg/h. The turbine develops a power output of 1000 kW. At the inlet, the pressure is 60 bar, the temperature is 400C, and the velocity is 10 m/s. At the exit, the pressure is 0.1 bar, the quality is 0.9 (90%), and the velocity is 50 m/s. Calculate the rate of heat transfer between the turbine and surroundings, in kW.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m1dot = 4600 //mass flow rate in Kg/h\n", +"Wcvdot = 1000 //turbine power output in kw\n", +"P1 = 60 //inlet pressure in bar\n", +"T1 = 400 //inlet temperature in degree celcius\n", +"V1 = 10 //inlet velocity in m/s\n", +"P2 = .1 //exit pressure in bar\n", +"x2 = .9 //the quality at the exit\n", +"V2 = 50 //exit velocity in m/s\n", +"\n", +"//from table A-4\n", +"h1 = 3177.2 //specific enthalpy at the inlet in kj/kg\n", +"//from table A-3\n", +"hf2 = 191.83\n", +"hg2 = 2584.63\n", +"\n", +"h2 = hf2+x2*(hg2-hf2) //specific enthalpy at the exit in kj/kg\n", +"Qcvdot = Wcvdot + m1dot*((h2-h1)+(V2^2-V1^2)/(2*1000))/3600\n", +"printf('the rate of heat transfer between the turbine and surroundings in kw is:\n\t Qcvdot = %f',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(4.5) Air enters a compressor operating at steady state at a pressure of 1 bar, a temperature of 290 K, and a velocity of 6 m/s through an inlet with an area of 0.1 m2. At the exit, the pressure is 7 bar, the temperature is 450 K, and the velocity is 2 m/s. Heat transfer from the compressor to its surroundings occurs at a rate of 180 kJ/min. Employing the ideal gas model, calculate the power input to the compressor, in kW.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //entry pressure in bar\n", +"T1 = 290 //entry temperature in kelvin \n", +"V1 = 6 //entry velocity in m/s\n", +"A1 = .1 //inlet area in m^2\n", +"P2 = 7 //exit pressure in bar\n", +"T2 = 450 //exit temperature in kelvin\n", +"V2 = 2 //exit velocity in m/s\n", +"Qcvdot = -180 //heat transfer rate in KJ/min\n", +"\n", +"R = 8.314 //univsersal gas constant in SI units\n", +"v1 = (R*1000*T1)/(28.97*P1*10^5) //specific volume \n", +"mdot = (A1*V1)/v1 //mass flow rate \n", +"\n", +"//from table A-22\n", +"h1 = 290.16 //specific enthalpy in KJ/kg\n", +"h2 = 451.8 //specific enthalpy in Kj/Kg\n", +"Wcvdot = Qcvdot/60 + mdot*((h1-h2)+(v1^2-V2^2)/(2*1000));\n", +"printf('the power input to the compressor in kw is :\n\tWcvdot = %f',Wcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.6) A power washer is being used to clean the siding of a house. Water enters at 20C, 1 atm, with a volumetric flow rate of 0.1 liter/s through a 2.5-cm-diameter hose. A jet of water exits at 23C, 1 atm, with a velocity of 50 m/s at an elevation of 5 m. At steady state, the magnitude of the heat transfer rate from the power unit to the surroundings is 10% of the power input. The water can be considered incompressible, and g = 9.81 m/s2. Determine the power input to the motor, in kW.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 20 //entry temperature in degree celcius\n", +"P1 = 1 //entry pressure in atm\n", +"AV1 = .1 //entry volumetric flow rate in litre/s\n", +"D1 = 2.5 //diameter of the hose in cm\n", +"T2 = 23 //exit temperature in degree celcius\n", +"P2 = 1 //exit pressure in atm\n", +"V2 =50 //exit velocity in m/s\n", +"Z2 = 5 //elevation in m\n", +"g = 9.81 //acceleration due to gravity in m/s^2\n", +"\n", +"//from table A-2\n", +"v = 1.0018*10^(-3) //specific volume in m^3/kg\n", +"\n", +"mdot = (AV1/1000)/v //mass flow rate in kg/s\n", +"V1 = (AV1/1000)/(%pi*(D1/(2*100))^2) //entry velocity in m/s\n", +"c = 4.18 //from table A-19\n", +"deltah = c*(T2-T1)+v*(P2-P1)\n", +"Wcvdot = (mdot/.9)*[-deltah+(V1^2-V2^2)/(2*1000)+g*(0-Z2)/1000]\n", +"printf('the power input to the motor in KW is :\n\t = %f',Wcvdot)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.7) Steam enters the condenser of a vapor power plant at 0.1 bar with a quality of 0.95 and condensate exits at 0.1 bar and 45C. Cooling water enters the condenser in a separate stream as a liquid at 20C and exits as a liquid at 35C with no change in pressure. Heat transfer from the outside of the condenser and changes in the kinetic and potential energies of the flowing streams can be ignored. For steady-state operation, determine (a) the ratio of the mass flow rate of the cooling water to the mass flow rate of the condensing stream. (b) the rate of energy transfer from the condensing steam to the cooling water, in kJ per kg of steam passing through the condenser.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = .1 //pressure of steam entering in bar\n", +"x1 = .95 //quality of steam entering\n", +"P2 = .1 //pressure of exiting condensate in bar\n", +"T2 = 45 //temperature of exiting condensate in degree celcius\n", +"T3 = 20 //temperature of cooling entry water in degree celcius\n", +"T4 = 35 //temperature of cooling exit water in degree celcius\n", +"\n", +"//part (a)\n", +"//from table A-3\n", +"hf = 191.83 //in KJ/kg\n", +"hg = 2584.7 //in Kj/kg\n", +"h1 = hf + x1*(hg-hf) //in kj/kg\n", +"\n", +"h2 = 188.45 //by assumption At states 2, 3, and 4, h is approximately equal to hf(T), in kj/kg\n", +"deltah4_3= 62.7 //by assumption 4,in kj/kg\n", +"ratio = (h1-h2)/(deltah4_3)\n", +"printf('the ratio of the mass flow rate of the cooling water to the mass flow rate of the condensing stream is :\n\t m3dot/m1dot = %f',ratio)\n", +"\n", +"//part(b)\n", +"Qrate = (h2-h1)\n", +"printf('\n\nthe rate of energy transfer from the condensing steam to the cooling water, in kJ per kg of steam passing through the condenser is :\n\t Qrate = %f',Qrate)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.8) The electronic components of a computer are cooled by air flowing through a fan mounted at the inlet of the electronics enclosure. At steady state, air enters at 20C, 1 atm. For noise control, the velocity of the entering air cannot exceed 1.3 m/s. For temperature control, the temperature of the air at the exit cannot exceed 32C. The electronic components and fan receive, respectively, 80 W and 18 W of electric power. Determine the smallest fan inlet diameter, in cm, for which the limits on the entering air velocity and exit air temperature are met.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 293 //temperature of entering air in kelvin\n", +"P1 = 1.01325*(10^5) //pressure of entering air in pascal\n", +"V1max = 1.3 //maximum velocity of entering air in m/s\n", +"T2max = 305 //maximum temperature at the exit in kelvin \n", +"Pec = -80 //power received by elecrtonic components in watt\n", +"Pf = -18 //power received by fan in watt\n", +"\n", +"R = 8.314 //universal gas constant in SI units\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", +"\n", +"Wcvdot = Pec + Pf //total electric power provided to the 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 = sqrt(4*A1min/(%pi))\n", +"printf('the smallest fan inlet diameter in cm is:\n\t D1min = %f',D1min*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (4.9) A supply line carries a two-phase liquid–vapor mixture of steam at 20 bars. A small fraction of the flow in the line is diverted through a throttling calorimeter and exhausted to the atmosphere at 1 bar. The temperature of the exhaust steam is measured as 120C. Determine the quality of the steam in the supply line.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 20 //pressure in supply line in bars\n", +"P2 = 1 //exhaust pressure in bar\n", +"T2 = 120 //exhaust temperature in degree celcius\n", +"\n", +"//from table A-3 at 20 bars\n", +"hf1 = 908.79 //in kj/kg\n", +"hg1 = 2799.5 //in kj/kg\n", +"\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", +"x1 = (h1-hf1)/(hg1-hf1)\n", +"printf('the quality of the steam in the supply line is:\n\tx1 = %f',x1)\n", +"" + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/5-The_second_law_of_thermodynamics.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/5-The_second_law_of_thermodynamics.ipynb new file mode 100644 index 0000000..148929e --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/5-The_second_law_of_thermodynamics.ipynb @@ -0,0 +1,125 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: The second law of thermodynamics" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (5.1) An inventor claims to have developed a power cycle capable of delivering a net work output of 410 kJ for an energy input by heat transfer of 1000 kJ. The system undergoing the cycle receives the heat transfer from hot gases at a temperature of 500 K and discharges energy by heat transfer to the atmosphere at 300 K. Evaluate this claim.\n", +"//solution\n", +"//variable initialization\n", +"W = 410 //net work output in kj claimed \n", +"Q = 1000 //energy input by heat transfer in kj\n", +"Tc = 300 //temperature of cold reservoir in kelvin\n", +"TH = 500 //temperature of hot reservoir in kelvin\n", +"eta = W/Q //thermal efficiency\n", +"etamax = 1-Tc/TH\n", +"printf('eta = %f',eta)\n", +"printf('\n etamax = %f',etamax)\n", +"printf('\n since eta is more than etamax, the claim is not authentic')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (5.2) By steadily circulating a refrigerant at low temperature through passages in the walls of the freezer compartment, a refrigerator maintains the freezer compartment at 5C when the air surrounding the refrigerator is at 22C. The rate of heat transfer from the freezer compartment to the refrigerant is 8000 kJ/h and the power input required to operate the refrigerator is 3200 kJ/h. Determine the coefficient of performance of the refrigerator and compare with the coefficient of performance of a reversible refrigeration cycle operating between reservoirs at the same two temperatures.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"funcprot(0)\n", +"Qcdot = 8000 //in kj/h\n", +"Wcycledot = 3200 //in kj/h\n", +"Tc = 268 //temperature of compartment in kelvin\n", +"TH = 295 //temperature of the surrounding air in kelvin\n", +"\n", +"beta = Qcdot/Wcycledot //coefficient of performance\n", +"betamax = Tc/(TH-Tc) //reversible coefficient of performance\n", +"printf('coefficient of performance is : \n\t beta = %f',beta)\n", +"printf('\n\n coefficient of performance of a reversible cycle is :\n\t betamax = %f',betamax) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(5.3) A dwelling requires 5 * 10^5 kJ per day to maintain its temperature at 22C when the outside temperature is 10C. (a) If an electric heat pump is used to supply this energy, determine the minimum theoretical work input for one day of operation, in kJ.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Tc = 283 //in kelvin\n", +"TH = 295 //in kelvin\n", +"QH = 5*10^5 //in kj per day\n", +"\n", +"Wcyclemin = (1-Tc/TH)*QH\n", +"printf('minimum theoretical work input for one day of operation in kj is:\n\tWmin = %e',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_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb new file mode 100644 index 0000000..1612880 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb @@ -0,0 +1,695 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Using entropy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.10) A rigid, well-insulated tank is filled initially with 5 kg of air at a pressure of 5 bar and a temperature of 500 K. A leak develops, and air slowly escapes until the pressure of the air remaining in the tank is 1 bar. Employing the ideal gas model, determine the amount of mass remaining in the tank and its temperature.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m1 = 5 //initial mass in kg\n", +"P1 = 5 //initial pressure in bar\n", +"T1 = 500 //initial temperature in kelvin\n", +"P2 = 1 //final pressure in bar\n", +"\n", +"//from table A-22\n", +"pr1 = 8.411\n", +"\n", +"pr2 = (P2/P1)*pr1\n", +"\n", +"//using this value of pr2 and interpolation in table A-22\n", +"T2 = 317 //in kelvin\n", +"\n", +"m2 = (P2/P1)*(T1/T2)*m1\n", +"printf('the amount of mass remaining in the tank in kg is :\n \t m2 = %f',m2)\n", +"printf('\n and its temperature in kelvin is : \n\t T = %f',T2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.11) A steam turbine operates at steady state with inlet conditions of p1 = 5 bar, T1= 320C. Steam leaves the turbine at a pressure of 1 bar. There is no significant heat transfer between the turbine and its surroundings, and kinetic and potential energy changes between inlet and exit are negligible. If the isentropic turbine efficiency is 75%, determine the work developed per unit mass of steam flowing through the turbine, in kJ/kg.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //inlet pressure in bar\n", +"T1 = 593 //inlet temperature in kelvin\n", +"P2 = 1 //exit pressure in bar\n", +"eta = .75 //turbine efficiency\n", +"\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 //in kj/kg\n", +"w = eta*(h1 - h2s)\n", +"printf('the work developed per unit mass of steam flowing through in kj/kg is : \n\t w = %f',w)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.12) A turbine operating at steady state receives air at a pressure of p1 = 3.0 bar and a temperature of T1= 390 K. Air exits the turbine at a pressure of p2 = 1.0 bar. The work developed is measured as 74 kJ per kg of air flowing through the turbine. The turbine operates adiabatically, and changes in kinetic and potential energy between inlet and exit can be neglected. Using the ideal gas model for air, determine the turbine efficiency.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 3 //pressure of air entering in bar\n", +"T1 = 390 //temperature of air entering in kelvin\n", +"P2 = 1 //pressure of exit air\n", +"Wcvdot = 74 //work developed in kj/kg\n", +"\n", +"//from table A-22,at 390k\n", +"h1 = 390.88 //in kj/kg\n", +"pr1 = 3.481\n", +"\n", +"pr2 = (P2/P1)*pr1\n", +"\n", +"//from interpolation table A-22\n", +"h2s = 285.27 //in kj/kg\n", +"\n", +"Wcvdots = h1 - h2s\n", +"\n", +"eta = Wcvdot/Wcvdots\n", +"\n", +"printf('the turbine efficiency is : \n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.13) Steam enters a nozzle operating at steady state at p1 = 1.0 MPa and T1= 320C with a velocity of 30 m/s. The pressure and temperature at the exit are p2 = 0.3 MPa and T2 = 180C. There is no significant heat transfer between the nozzle and its surroundings, and changes in potential energy between inlet and exit can be neglected. Determine the nozzle efficiency.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //pressure of entering steam in Mpa\n", +"T1 = 593 //temperature of entering steam in kelvin\n", +"V1 = 30 //velocity of entering steam in m/s\n", +"P2 = .3 //pressure of exit steam in Mpa\n", +"T2 = 453 //temperature of exit steam in kelvin\n", +"\n", +"//from table A-4, at T1 = 593 kelvin and P1 = 1 Mpa;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", +"V2squareby2 = h1 - h2 + (V1^2)/2000\n", +"\n", +"//interpolating in table A-4\n", +"h2s = 2813.3 //in kj/kg\n", +"V2squareby2s = h1 - h2s + (V1^2)/2000\n", +"eta = V2squareby2/V2squareby2s\n", +"printf('the nozzle efficiency is :\n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.14) For the compressor of the heat pump system in Example 6.8, determine the power, in kW, and the isentropic efficiency using (a) data from property tables, (b) Interactive Thermodynamics: IT.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"//from table A-9\n", +"h1 = 249.75 //in kj/kg\n", +"h2 = 294.17 //in kj/kg\n", +"\n", +"mdot = .07 //in kg/s\n", +"\n", +"wcvdot = mdot*(h1-h2)\n", +"//from table A-9\n", +"s1 = .9572 //in Kj/Kg.k\n", +"h2s = 285.58 //in kj/kg\n", +"\n", +"eta = (h2s-h1)/(h2-h1) \n", +"\n", +"printf('the power in KW is: \n\t p = %f',wcvdot)\n", +"printf('\n the isentropic efficiency is : \n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.15: Example_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.15) An air compressor operates at steady state with air entering at p1 = 1 bar, T1= 20C, and exiting at =p2 5 bar. Determine the work and heat transfer per unit of mass passing through the device, in kJ/kg, if the air undergoes a polytropic process with n = 1.3. Neglect changes in kinetic and potential energy between the inlet and the exit. Use the ideal gas model for air.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //pressure of entering air in bar\n", +"T1 = 293 //temperature of entering air in kelvin\n", +"P2 = 5 //pressure of exit air in bar\n", +"n = 1.3\n", +"\n", +"T2 = T1*((P2/P1)^((n-1)/n)) //in kelvin\n", +"R = 8.314/28.97\n", +"wcvdot=((n*R)/(n-1))*(T1-T2) //in kj/kg\n", +"\n", +"//from table A-22\n", +"h1 = 293.17 //in kj/kg\n", +"h2 = 426.35 // in kj/kg\n", +"\n", +"Qcvdot= wcvdot + (h2-h1) //in kj/kg\n", +"printf('the work per unit mass passing through the device in kj/kg is: w = %f',wcvdot)\n", +"printf('\nthe heat transfer per unit mass in Kj/kg is : q = %f ',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (6.1) Water, initially a saturated liquid at 100C, is contained in a piston–cylinder assembly. The water undergoes a process to the corresponding saturated vapor state, during which the piston moves freely in the cylinder. If the change of state is brought about by heating the water as it undergoes an internally reversible process at constant pressure and temperature, determine the work and heat transfer per unit of mass, each in kJ/kg.\n", +"//solution\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", +"w = p*(vg-vf)*10^(-3)\n", +"Q = T*(sg-sf)\n", +"printf('the work per unit mass in kj/kg is\n\t w = %f',w)\n", +"printf('\nthe heat transfer per unit mass in kj/kg is \n\t Q = %f',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.2) Water initially a saturated liquid at 100C is contained within a piston–cylinder assembly. The water undergoes a process to the corresponding saturated vapor state, during which the piston moves freely in the cylinder. There is no heat transfer with the surroundings. If the change of state is brought about by the action of a paddle wheel, determine the net work per unit mass, in kJ/kg, and the amount of entropy produced per unit mass,in Kj/kg.k\n", +"\n", +"//solution\n", +"\n", +"//Assumptions:\n", +"//1. The water in the piston–cylinder assembly is a closed system.\n", +"//2. There is no heat transfer with the surroundings.\n", +"//3. The system is at an equilibrium state initially and finally. There is no change in kinetic or potential energy between these\n", +"//two states.\n", +"\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", +"\n", +"//from energy balance,\n", +"W = -(ug-uf)\n", +"printf('the net work per unit mass in kj/kg is:\n\t w = %f ',W)\n", +"\n", +"//from entropy balance\n", +"sigmabym = (sg-sf)\n", +"printf('\n\nthe amount of entropy produced per unit mass in kj/kg.k is :\n\t sigmabym =%f',sigmabym)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.3) Refrigerant 134a is compressed adiabatically in a piston–cylinder assembly from saturated vapor at 0C to a final pressure of 0.7 MPa. Determine the minimum theoretical work input required per unit mass of refrigerant, in kJ/kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 273 //initial temperature of saturated vapor in kelvin\n", +"P2 = .7*10^6 //final pressure in pascal\n", +"\n", +"//from table A-10,\n", +"u1 = 227.06 //in kj/kg\n", +"\n", +"//minimum theoretical work corresponds to state of isentropic compression\n", +"//from table A-12,\n", +"u2s = 244.32 //in kj/kg\n", +"Wmin = u2s-u1\n", +"printf('the minimum theoretical work input required per unit mass of refrigerant in kj/kg is:\n\t Wmin = %f',Wmin)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.4) Referring to Example 2.4, evaluate the rate of entropy production sigmadot in kW/K, for (a) the gearbox as the system and (b) an enlarged system consisting of the gearbox and enough of its surroundings that heat transfer occurs at the temperature of the surroundings away from the immediate vicinity of the gearbox, Tf = 293 K (20C).\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Qdot = -1.2 //in kilo watt\n", +"Tb = 300 //in kelvin\n", +"Tf = 293 //in kelvin\n", +"\n", +"\n", +"//part (a)\n", +"//from entropy balance \n", +"sigmadot = -Qdot/Tb\n", +"printf('the rate of entropy production in kw/k with gearbox as system is:\n\t sigmadot = %e',sigmadot)\n", +"\n", +"//part(b)\n", +"//from entropy balance \n", +"sigmadt = -Qdot/Tf\n", +"printf('\n\nthe rate of entropy production in kw/k with gearbox + sorrounding as system is:\n\t sigmadot = %e',sigmadt)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.5) A 0.3 kg metal bar initially at 1200K is removed from an oven and quenched by immersing it in a closed tank containing 9 kg of water initially at 300K. Each substance can be modeled as incompressible. An appropriate constant specific heat value for the water is cw = 4.2 kJ/kg. K, and an appropriate value for the metal is cm = 0.42 kJ/kg K. Heat transfer from the tank contents can be neglected. Determine (a) the final equilibrium temperature of the metal bar and the water, in K, and (b) the amount of entropy produced, in kJ/k.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Tmi = 1200 //initial temperature of metal in kelvin\n", +"cm = .42 //specific heat of metal in KJ/kg.k\n", +"mm = .3 //mass of metal in kg\n", +"Twi = 300 //initial temperature of water in kelvin\n", +"cw = 4.2 //specific heat of water in KJ/Kg.k\n", +"mw = 9 //mass of water in kg\n", +"\n", +"\n", +"//part(a)\n", +"//solving energy balance equation yields\n", +"Tf = (mw*(cw/cm)*Twi+mm*Tmi)/(mw*(cw/cm)+mm)\n", +"\n", +"//part (b)\n", +"//solving entropy balance equation yields\n", +"sigma = mw*cw*log(Tf/Twi)+mm*cm*log(Tf/Tmi)\n", +"\n", +"printf('the final equilibrium temperature of the metal bar and the water in kelvin is :\n\t Tf = %f',Tf)\n", +"printf('\n\n the amount of entropy produced in kj/k is: \n\tsigma = %f ',sigma)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.6) Steam enters a turbine with a pressure of 30 bar, a temperature of 400C, and a velocity of 160 m/s. Saturated vapor at 100C exits with a velocity of 100 m /s. At steady state, the turbine develops work equal to 540 kJ per kg of steam flowing through the turbine. Heat transfer between the turbine and its surroundings occurs at an average outer surface temperature of 350 K. Determine the rate at which entropy is produced within the turbine per kg of steam flowing, in kJ/kg.k. Neglect the change in potential energy between inlet and exit\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 30 //pressure of steam entering the turbine in bar\n", +"T1 = 400 //temperature of steam entering the turbine in degree celcius\n", +"V1 = 160 //velocity of steam entering the turbine in m/s\n", +"T2 = 100 //temperature of steam exiting in degree celcius\n", +"V2 = 100 //velocity of steam exiting in m/s\n", +"Wcvdot = 540 //work produced by turbine in kJ/kg of steam\n", +"Tb = 350 //temperature of the boundary in kelvin\n", +"\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", +"\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", +"\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", +"\n", +"//from entropy and mass balance equations\n", +"sigmadot = -(Qcvdot/Tb) + (s2-s1)\n", +"\n", +"printf('the rate at which entropy is produced within the turbine per kg of steam flowing, in kJ/kg.k is:\n\t entropyrate = %f',sigmadot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.7) An inventor claims to have developed a device requiring no energy transfer by work or heat transfer, yet able to produce hot and cold streams of air from a single stream of air at an intermediate temperature. The inventor provides steady-state test data indicating that when air enters at a temperature of 21C and a pressure of 5.1 bars, separate streams of air exit at temperatures of -18C and 79C, respectively, and each at a pressure of 1 bar. Sixty percent of the mass entering the device exits at the lower temperature. Evaluate the inventor’s claim, employing the ideal gas model for air and ignoring changes in the kinetic and potential energies of the streams from inlet to exit.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 294 //entry temperature of air in kelvin\n", +"P1 = 5.1 //entry pressure of air in bars\n", +"T2 = 352 //exit temperature of hot stream in kelvin\n", +"P2 = 1 //exit pressure of hot stream in bars\n", +"T3 = 255 //exit temperature of cold stream in kelvin\n", +"P3 = 1 //exit pressure of cold stream in bars\n", +"\n", +"cp = 1 //in kj/kg.k\n", +"R = 8.314/28.97\n", +"se = .4*(cp*log((T2)/(T1))-R*log(P2/P1)) + .6*(cp*log((T3)/(T1))-R*log(P3/P1)) //specific entropy in kj/kg.k\n", +"\n", +"printf('specific entropy in kj/kg.k = %f',se)\n", +"printf('\n\nsince se > 0, the claim of the writer is true')\n", +"\n", +"\n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.8) Components of a heat pump for supplying heated air to a dwelling are shown in the schematic below. At steady state, Refrigerant 22 enters the compressor at -5C, 3.5 bar and is compressed adiabatically to 75C, 14 bar. From the compressor, the refrigerant passes through the condenser, where it condenses to liquid at 28C, 14 bar. The refrigerant then expands through a throttling valve to 3.5 bar. The states of the refrigerant are shown on the accompanying T–s diagram. Return air from the dwelling enters the condenser at 20C, 1 bar with a volumetric flow rate of 0.42 m3/s and exits at 50C with a negligible change in pressure. Using the ideal gas model for the air and neglecting kinetic and potential energy effects, (a) determine the rates of entropy production, in kW/K, for control volumes enclosing the condenser, compressor, and expansion valve, respectively. (b) Discuss the sources of irreversibility in the components considered in part (a).\n", +"\n", +"\n", +"//solution\n", +"\n", +"\n", +"//variable initialization\n", +"P1 = 3.5 //pressure of refrigerant entering the compressor in bars\n", +"T1 = 268 //temperature of refrigerant entering the compressor in kelvin\n", +"P2 = 14 //pressure of refrigerant entering the condenser in bars\n", +"T2 = 348 //temperature of refrigerant entering the condenser in kelvin\n", +"P3 = 14 //pressure of refrigerant exiting the condenser in bars\n", +"T3 = 301 //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 //pressure of indoor return air entering the condenser in bars\n", +"T5 = 293 //temperature of indoor return air entering the condenser in kelvin\n", +"AV5 = .42 //volumetric flow rate of indoor return air entering the condenser in m^3/s\n", +"P6 = 1 //pressure of return air exiting the condenser in bar\n", +"T6 = 323 //temperature of return air exiting the condenser in kelvin\n", +"\n", +"//part(a)\n", +"\n", +"//from table A-9\n", +"s1 = .9572 //in kj/kg.k\n", +"//interpolating in table A-9\n", +"s2 = .98225 //in kj/kg.k\n", +"h2 = 294.17 //in kj/kg\n", +"//from table A-7\n", +"s3 = .2936 //in kj/kg.k\n", +"h3 = 79.05 //in kj/kg\n", +"\n", +"h4 = h3 //since expansion through valve is throttling process\n", +"\n", +"//from table A-8\n", +"hf4 = 33.09 //in kj/kg\n", +"hg4 = 246 //in kj/kg\n", +"sf4 = .1328 //in kj/kg.k\n", +"sg4 = .9431 //in kj/kg.k\n", +"\n", +"x4 = (h4-hf4)/(hg4-hf4) //quality at state 4\n", +"s4 = sf4 + x4*(sg4-sf4) //specific entropy at state 4\n", +"\n", +"/////condenser!!\n", +"v5 = ((8314/28.97)*T5)/(P5*10^5) //specific volume at state 5\n", +"mairdot = AV5/v5 \n", +"cp = 1.005 //in kj/kg.k\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", +"\n", +"/////compressor!!\n", +"sigmacomp = mrefdot*(s2-s1)\n", +"\n", +"\n", +"////valve!!\n", +"sigmavalve = mrefdot *(s4-s3)\n", +"\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the condenser is \n\t R1 = %e ',sigmacond)\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the compressor is \n\t R2 = %e ',sigmacomp)\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the expansion valve is \n\t R3 = %e ',sigmavalve)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (6.9) Air undergoes an isentropic process from p1 = 1 bar, T1= 300K to a final state where the temperature is T2= 650K.,Employing the ideal gas model, determine the final pressure p2, in atm. Solve using (a) pr data from Table A-22 (b) Interactive Thermodynamics: IT, and (c) a constant specific heat ratio k evaluated at the mean temperature, 475K, from Table A-20.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //initial pressure in bar\n", +"T1 = 300 //initial temperature in kelvin\n", +"T2 = 650 //final temperature in kelvin\n", +"\n", +"//part(a)\n", +"//from table A-22\n", +"pr2 = 21.86 \n", +"pr1 = 1.3860\n", +"p2 = P1*(pr2/pr1)\n", +"printf('part(a) P2 in bar = %f ',p2)\n", +"//part(b)\n", +"printf('\n part(b) IT software problem')\n", +"//part(c)\n", +"k = 1.39 //from table A-20\n", +"p2a = P1*((T2/T1)^(k/(k-1)))\n", +"printf('\n part(c) P2a in bar = %f',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_Engineering_Thermodynamics_by_M_J_Moran/7-Exergy_analysis.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/7-Exergy_analysis.ipynb new file mode 100644 index 0000000..44f9d12 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/7-Exergy_analysis.ipynb @@ -0,0 +1,661 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Exergy analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.10) A cogeneration system consists of a natural gas-fueled boiler and a steam turbine that develops power and provides steam for an industrial process. At steady state, fuel enters the boiler with an exergy rate of 100 MW. Steam exits the boiler at 50 bar, 466C with an exergy rate of 35 MW. Steam exits the turbine at 5 bar, 205C and a mass flow rate of 26.15 kg/s. The unit cost of the fuel is 1.44 cents per kw.h of exergy. The costs of owning and operating the boiler and turbine are, respectively, dollar 1080/h and dollar 92/h. The feedwater and combustion air enter with negligible exergy and cost. The combustion products are discharged directly to the surroundings with negligible cost. Heat transfer with the surroundings and kinetic and potential energy effects are negligible. Let T0 = 298 K. (a) For the turbine, determine the power and the rate exergy exits with the steam, each in MW. (b) Determine the unit costs of the steam exiting the boiler, the steam exiting the turbine, and the power, each in cents per kw.h of exergy. (c) Determine the cost rates of the steam exiting the turbine and the power, each in $/h.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"EfFdot = 100 //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 //the cost of owning and operating boiler in dollars per hour\n", +"Ef1dot = 35 //exergy rate of exiting steam from the boiler in MW\n", +"p1 = 50 //pressure of exiting steam from the boiler in bar\n", +"T1 = 466 //temperature of exiting steam from the boiler in degree celcius\n", +"Ztdot = 92 //the cost of owning and operating turbine in dollars per hour\n", +"p2 = 5 //pressure of exiting steam from the turbine in bars\n", +"T2 = 205 //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 //in kelvin \n", +"\n", +"\n", +"//part(a)\n", +"//from table A-4,\n", +"h1 = 3353.54 //in kj/kg\n", +"h2 = 2865.96 //in kj/kg\n", +"//from assumption,For each control volume,Qcvdot = 0 and kinetic and potential energy effects are negligible,the mass and energy rate balances for a control volume enclosing the turbine reduce at steady state to give\n", +"Wedot = m2dot *(h1-h2)/1000 //power in MW\n", +"\n", +"//from table A-4\n", +"s1 = 6.8773 //in kj/kg.k\n", +"s2 = 7.0806 //in kj/kg.k\n", +"\n", +"Ef2dot = Ef1dot+m2dot*(h2-h1-T0*(s2-s1))/1000 //the rate exergy exits with the steam in MW\n", +"printf('for the turbine,the power in MW is:\t%f',Wedot)\n", +"printf('\nfor the turbine,the rate exergy exits with the steam in MW is:\t%f',Ef2dot)\n", +"\n", +"//part(b)\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", +"\n", +"printf('\n\nthe unit costs of the steam exiting the boiler in cents per kw.h of exergy is:\t%f',c1)\n", +"printf('\nthe unit costs of the steam exiting the turbine in cents per kw.h of exergy is:\t%f',c2)\n", +"printf('\nunit cost of power in cents per kw.h is:\t%f',ce)\n", +"\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", +"\n", +"printf('\n\nthe cost rate of the steam exiting the turbine in dollars per hour is: %f',C2dot)\n", +"printf('\nthe cost rate of the power in dollars per hour is: %f',Cedot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (7.1) A cylinder of an internal combustion engine contains 2450 cm3 of gaseous combustion products at a pressure of 7 bar and a temperature of 867C just before the exhaust valve opens. Determine the specific exergy of the gas, in kJ/kg. Ignore the effects of motion and gravity, and model the combustion products as air as an ideal gas. Take T0 = 300 K (27C) and p0= 1.013 bar.\n", +"\n", +"\n", +"//solution\n", +"\n", +"\n", +"//variable initialization\n", +"v = 2450 //volume of gaseous products in cm^3\n", +"P = 7 //pressure of gaseous product in bar\n", +"T = 867 //temperature of gaseous product in degree celcius\n", +"T0 = 300 //in kelvin\n", +"P0 = 1.013 //in bar\n", +"\n", +"//from table A-22\n", +"u = 880.35 //in kj/kg\n", +"u0 = 214.07 //in kj/kg\n", +"s0(T) = 3.11883 //in kj/kg.k\n", +"s0(T0) = 1.70203 //in kj/kg.k\n", +"\n", +"e = (u-u0) + (P0*(8.314/28.97)*[((T+273)/P)-(T0/P0)]) - T0*[s0(T)-s0(T0)-(8.314/28.97)*log(P/P0)] //in kj/kg\n", +"printf('the specific exergy of the gas, in kJ/kg is \n\t e = %f',e)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.2) Refrigerant 134a, initially a saturated vapor at -28C, is contained in a rigid, insulated vessel. The vessel is fitted with a paddle wheel connected to a pulley from which a mass is suspended. As the mass descends a certain distance, the refrigerant is stirred until it attains a state where the pressure is 1.4 bar. The only significant changes of state are experienced by the suspended mass and the refrigerant. The mass of refrigerant is 1.11 kg. Determine (a) the initial exergy, final exergy, and change in exergy of the refrigerant, each in kJ. (b) the change in exergy of the suspended mass, in kJ. (c) the change in exergy of an isolated system of the vessel and pulley–mass assembly, in kJ. Discuss the results obtained, and compare with the respective energy changes. Let T0 = 293 K (20C), p0 = 1 bar.\n", +"\n", +"//solution \n", +"\n", +"//variable initialization\n", +"mR = 1.11 //mass of the refrigerant in kg\n", +"T1 = -28 //initial temperature of the saturated vapor in degree celcius\n", +"P2 = 1.4 //final pressure of the refrigerant in bar\n", +"T0 = 293 //in kelvin\n", +"P0 = 1 //in bar\n", +"\n", +"//part (a)\n", +"//from table A-10\n", +"u1 = 211.29 //in kj/kg\n", +"v1 = .2052 //in m^3/kg\n", +"s1 = .9411 //in kj/kg.k\n", +"//from table A-12\n", +"u0 = 246.67 //in kj/kg\n", +"v0 = .23349 //in m^3/kg\n", +"s0 = 1.0829 //in kj/kg.k\n", +"\n", +"E1 = mR*[(u1-u0) + P0*10^5*(v1-v0)*10^(-3)-T0*(s1-s0)]\n", +"\n", +"//from table A-12\n", +"u2 = 300.16 //in kj/kg\n", +"s2 = 1.2369 //in kj/kg.k\n", +"v2 = v1\n", +"\n", +"E2 = mR*[(u2-u0) + P0*10^5*(v2-v0)*10^(-3)-T0*(s2-s0)]\n", +"\n", +"printf('part(a)the initial exergy in kj is :\n\t E1 = %f',E1)\n", +"printf('\nthe final exergy in kj is :\n\t E2 = %f',E2)\n", +"printf('\nthe change in exergy of the refrigerant in kj is \n\tdeltaE = %f',E2-E1)\n", +"\n", +"\n", +"//part (b)\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, there is no change in kinetic or potential energy. For the suspended mass, there is no change in kinetic or internal energy. Elevation is the only intensive property of the suspended mass that changes\n", +"deltaE = deltaPE\n", +"printf('\n\n\npart(b)the change in exergy of the suspended mass, in kJ is :\n\t deltaE = %f',deltaE)\n", +"\n", +"\n", +"//part(c)\n", +"deltaEiso = (E2-E1) + deltaE\n", +"printf('\n\n\npart(c)the change in exergy of an isolated system of the vessel and pulley–mass assembly, in kJ is :\n\t deltaEiso = %f',deltaEiso)\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.3) Water initially a saturated liquid at 100C is contained in a piston–cylinder assembly. The water undergoes a process to the corresponding saturated vapor state, during which the piston moves freely in the cylinder. For each of the two processes described below, determine on a unit of mass basis the change in exergy, the exergy transfer accompanying work, the exergy transfer accompanying heat, and the exergy destruction, each in kJ/kg. Let T0 = 20C, p0 = 1.014 bar. (a) The change in state is brought about by heating the water as it undergoes an internally reversible process at constant temperature and pressure. (b) The change in state is brought about adiabatically by the stirring action of a paddle wheel.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T = 373.15 //initial temperature of saturated liquid in kelvin\n", +"T0 = 293.15 //in kelvin\n", +"P0 = 1.014 //in bar\n", +"\n", +"\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", +"\n", +"deltae = ug-uf + P0*10^5*(vg-vf)/(10^3)-T0*(sg-sf)\n", +"\n", +"//exergy transfer accompanying work\n", +"etaw = 0 //since p = p0\n", +"\n", +"//exergy transfer accompanying heat\n", +"Q = 2257 //in kj/kg,obtained from example 6.1\n", +"etah = (1-(T0/T))*Q\n", +"\n", +"//exergy destruction\n", +"ed = 0 //since the process is accomplished without any irreversibilities\n", +"\n", +"printf('part(a)the change in exergy in kj/kg is:\n\t deltae = %f ',deltae)\n", +"printf('\nthe exergy transfer accompanying work in kj/kg is:\n\t etaw = %f',etaw)\n", +"printf('\nthe exergy transfer accompanying heat in kj/kg is:\n\t etah = %f',etah)\n", +"printf('\nthe exergy destruction in kj/kg is:\n\t ed = %f',ed)\n", +"\n", +"\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", +"\n", +"printf('\n\n\npart(b)the change in exergy in kj/kg is:\n\t Deltae = %f ',Deltae)\n", +"printf('\nthe exergy transfer accompanying work in kj/kg is:\n\t Etaw = %f',Etaw)\n", +"printf('\nthe exergy transfer accompanying heat in kj/kg is:\n\t Etah = %f',Etah)\n", +"printf('\nthe exergy destruction in kj/kg is:\n\t Ed = %f',Ed)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.4) For the gearbox of Examples 2.4 and 6.4(a), develop a full exergy accounting of the power input. Let T0 = 293 K.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//Since the gearbox volume is constant, the rate of exergy transfer accompanying power reduces to the power itself. Accordingly, exergy is transferred into the gearbox via the high-speed shaft at a rate equal to the power input, 60 kW, and exergy is transferred out via the low-speed shaft at a rate equal to the power output, 58.8 kW. Additionally, exergy is transferred out accompanying heat transfer and destroyed by irreversibilities within the gearbox.\n", +"\n", +"T0 = 293 //in kelvin\n", +"Qdot = -1.2 //in KW, from example 6.4a\n", +"Tb = 300 //temperature at the outer surface of the gearbox in kelvin from example 6.4a\n", +"sigmadot = 4e-3 //rate of entropy production in KW/k from example 6.4a\n", +"\n", +"R = (1-T0/Tb)*Qdot //time rate of exergy transfer accompanying heat\n", +"Eddot = T0*sigmadot //rate of exergy destruction\n", +"\n", +"printf('balance sheet')\n", +"printf('\nrate of exergy in:\n high speed shaft\t\t 60Kw') \n", +"printf('\nDisposition of the exergy:\n• Rate of exergy out\nlow-speed shaft\t\t 58.8Kw') \n", +"printf('\nheat transfer in kw\t\t%f',norm(R))\n", +"printf('\n• Rate of exergy destruction in kw\t\t%f',Eddot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Superheated water vapor enters a valve at 3.0 MPa, 320C and exits at a pressure of 0.5 MPa. The expansion is a throttling process. Determine the specific flow exergy at the inlet and exit and the exergy destruction per unit of mass flowing, each in kJ/kg. Let T0 = 25C, p0= 1 atm.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 3 //entry pressure in Mpa\n", +"p2 = .5 //exit pressure in Mpa\n", +"T1 = 320 //entry temperature in degree celcius\n", +"T0 = 25 //in degree celcius\n", +"p0 = 1 //in atm\n", +"\n", +"\n", +"//from table A-4\n", +"h1 = 3043.4 //in kj/kg\n", +"s1 = 6.6245 //in kj/kg.k\n", +"\n", +"h2 = h1 //from reduction of the steady-state mass and energy rate balances\n", +"\n", +"s2 = 7.4223 //Interpolating at a pressure of 0.5 MPa with h2 = h1, units in kj/kg.k\n", +"\n", +"//from table A-2\n", +"h0 = 104.89 //in kj/kg\n", +"s0 = 0.3674 //in kj/kg.k\n", +"\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", +"\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", +"\n", +"printf(' the specific flow exergy at the inlet in kj/kg is :\n\t ef1 =%f',ef1)\n", +"printf('\nthe specific flow exergy at the exit in kj/kg is:\n\t ef2 = %f', ef2)\n", +"printf('\nthe exergy destruction per unit of mass flowing in kj/kg is:\n\t = %f',Ed)\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Compressed air enters a counterflow heat exchanger operating at steady state at 610 K, 10 bar and exits at 860 K, 9.7 bar. Hot combustion gas enters as a separate stream at 1020 K, 1.1 bar and exits at 1 bar. Each stream has a mass flow rate of 90 kg/s. Heat transfer between the outer surface of the heat exchanger and the surroundings can be ignored. Kinetic and potential energy effects are negligible. Assuming the combustion gas stream has the properties of air, and using the ideal gas model for both streams, determine for the heat exchanger(a) the exit temperature of the combustion gas, in K. (b) the net change in the flow exergy rate from inlet to exit of each stream, in MW. (c) the rate exergy is destroyed, in MW. Let T0 = 300 K, p0 = 1 bar.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 610 //temperature of the air entering heat exchanger in kelvin\n", +"p1 = 10 //pressure of the air entering heat exchanger in bar\n", +"T2 = 860 //temperature of the air exiting the heat exchanger in kelvin\n", +"p2 = 9.7 //pressure of the air exiting the heat exchanger in bar\n", +"T3 = 1020 //temperature of entering hot combustion gas in kelvin\n", +"p3 = 1.1 //pressure of entering hot combustion gas in bar\n", +"p4 = 1 //pressure of exiting hot combustion gas in bar\n", +"mdot = 90 //mass flow rate in kg/s\n", +"T0 = 300 //in kelvin\n", +"p0 = 1 //in bar\n", +"\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", +"\n", +"//from reduction of mass and energy rate balances for the control volume at steady state \n", +"h4 = h3+h1-h2\n", +"\n", +"//using interpolation in table A-22 gives\n", +"T4 = 778 //in kelvin\n", +"printf('the exit temperature of the combustion gas in kelvin is:\n\tT4 = %f',T4)\n", +"\n", +"\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", +"\n", +"deltaR = (mdot*((h2-h1)-T0*(s2-s1-(8.314/28.97)*log(p2/p1))))/1000\n", +"\n", +"//from table A-22\n", +"s4 = 2.68769 //in kj/kg.k\n", +"s3 = 2.99034 //in kj/kg.k\n", +"\n", +"deltRc = mdot*((h4-h3)-T0*(s4-s3-(8.314/28.97)*log(p4/p3)))/1000\n", +"\n", +"printf('\nthe net change in the flow exergy rate from inlet to exit of compressed gas in MW is:\n\t deltaR = %f',deltaR)\n", +"printf('\nthe net change in the flow exergy rate from inlet to exit of hot combustion gas in MW is:\n\tdeltRc =%f ',deltRc)\n", +"\n", +"//part(c)\n", +"//from an exergy rate balance\n", +"Eddot = -deltaR-deltRc\n", +"\n", +"printf('\nthe rate exergy destroyed, in MW is:Eddot = %f',Eddot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Steam enters a turbine with a pressure of 30 bar, a temperature of 400C, a velocity of 160 m/s. Steam exits as saturated vapor at 100C with a velocity of 100 m/s. At steady state, the turbine develops work at a rate of 540 kJ per kg of steam flowing through the turbine. Heat transfer between the turbine and its surroundings occurs at an average outer surface temperature of 350 K. Develop a full accounting of the net exergy carried in by the steam, per unit mass of steam flowing. Neglect the change in potential energy between inlet and exit. Let T0 = 25C, p0= 1 atm.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 30 //pressure of entering steam in bar\n", +"t1 = 400 //temperature of entering steam in degree celcius\n", +"v1 = 160 //velocity of entering steam in m/s\n", +"t2 = 100 //temperature of exiting saturated vapor in degree celcius\n", +"v2 = 100 //velocity of exiting saturated vapor in m/s\n", +"W = 540 //rate of work developed in kj per kg of steam\n", +"Tb = 350 //the temperature on the boundary where heat transfer occurs in kelvin\n", +"T0 = 25 //in degree celcius\n", +"p0 = 1 //in atm\n", +"\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", +"\n", +"DELTAef = (h1-h2)-(T0+273)*(s1-s2)+(v1^2-v2^2)/(2*1000) //The net exergy carried in per unit mass of steam flowing in kj/kg\n", +"\n", +"//from example 6.6\n", +"Q = -22.6 //in kj/kg\n", +"Eq = (1-(T0+273)/Tb)*(Q) //exergy transfer accompanying heat in kj/kg\n", +"\n", +"Ed = (1-(T0+273)/Tb)*(Q)-W+(DELTAef) //The exergy destruction determined by rearranging the steady-state form of the exergy rate balanceff\n", +"\n", +"printf('balance sheet')\n", +"printf('\nNet rate of exergy in:\t%f',DELTAef)\n", +"printf('\nDisposition of the exergy:')\n", +"printf('\n• Rate of exergy out')\n", +"printf('\nwork\t%f',W)\n", +"printf('\nheat transfer\t%f',-Eq)\n", +"printf('\n• Rate of exergy destruction\t%f',Ed)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.8) Suppose the system of Example 4.10 is one option under consideration for utilizing the combustion products discharged from an industrial process. (a) Develop a full accounting of the net exergy carried in by the combustion products. (b) Discuss the design implications of the results.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m1dot = 69.78 //in kg/s\n", +"p1 = 1 //in bar\n", +"T1 = 478 //in kelvin\n", +"T2 = 400 //in kelvin\n", +"p2 = 1 //in bar\n", +"p3 = .275 //in Mpa\n", +"T3 = 38.9 //in degree celcius\n", +"m3dot = 2.08 //in kg/s\n", +"T4 = 180 //in degree celcius\n", +"p4 = .275 //in Mpa\n", +"p5 = .07 //in bar\n", +"x5 = .93\n", +"Wcvdot = 876.8 //in kW\n", +"T0 = 298 //in kelvin\n", +"\n", +"\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", +"\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", +"\n", +"\n", +"//from table A-2E\n", +"h3 = 162.82 //in kj/kg\n", +"s3 = .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", +"\n", +"netREout = m3dot*(h5-h3-T0*(s5-s3)) //the net rate exergy carried out by the water stream\n", +"\n", +"//from table A-4\n", +"h4 = 2825 //in kj/kg\n", +"s4 = 7.2196 //in kj/kg.k\n", +"\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", +"\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", +"\n", +"\n", +"printf('balance sheet')\n", +"printf('\nNet rate of exergy in:\t%f',netRE)\n", +"printf('\nDisposition of the exergy:')\n", +"printf('\n• Rate of exergy out')\n", +"printf('\npower developed\t%f',1772.8-netREout-Eddot-EdDot)\n", +"printf('\nwater stream\t%f',netREout)\n", +"printf('\n• Rate of exergy destruction')\n", +"printf('\nheat-recovery steam generator\t%f',Eddot)\n", +"printf('\nturbine\t%f',EdDot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(7.9) For the heat pump of Examples 6.8 and 6.14, determine the exergy destruction rates, each in kW, for the compressor, condenser, and throttling valve. If exergy is valued at $0.08 per kw.h, determine the daily cost of electricity to operate the compressor and the daily cost of exergy destruction in each component. Let T0 = 273 K (0C), which corresponds to the temperature of the outside ai. \n", +"\n", +"\n", +"//solution\n", +"\n", +"T0 = 273 //in kelvin\n", +"pricerate = .08 //exergy value at $0.08 per kw.h\n", +"\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", +"\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", +"\n", +"mCP = 3.11 //From the solution to Example 6.14, the magnitude of the compressor power in kW\n", +"\n", +"printf('Daily cost in dollars of exergy destruction due to compressor irreversibilities =\t %f',EddotComp*pricerate*24)\n", +"printf('\naDaily cost in dollars of exergy destruction due to irreversibilities in the throttling valve =\t %f',EddotValve*pricerate*24)\n", +"printf('\naDaily cost in dollars of exergy destruction due to irreversibilities in the condenser =\t %f',Eddotcond*pricerate*24)\n", +"printf('\naDaily cost in dollars of electricity to operate compressor =\t %f',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_Engineering_Thermodynamics_by_M_J_Moran/8-Vapor_power_systems.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/8-Vapor_power_systems.ipynb new file mode 100644 index 0000000..2fb9cd8 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/8-Vapor_power_systems.ipynb @@ -0,0 +1,763 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Vapor power systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.1)...Steam is the working fluid in an ideal Rankine cycle. Saturated vapor enters the turbine at 8.0 MPa and saturated liquid exits the condenser at a pressure of 0.008 MPa. The net power output of the cycle is 100 MW. Determine for the cycle (a) the thermal efficiency, (b) the back work ratio, (c) the mass flow rate of the steam, in kg/h, (d) the rate of heat transfer,Qindot , into the working fluid as it passes through the boiler, in MW, (e) the rate of heat transfer,Qoutdot from the condensing steam as it passes through the condenser, in MW, (f) the mass flow rate of the condenser cooling water, in kg/ h, if cooling water enters the condenser at 15C and exits at 35C.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"p1 = 8 //pressure of saturated vapor entering the turbine in MPa\n", +"p3 = .008 //pressure of saturated liquid exiting the condenser in MPa\n", +"Wcycledot = 100 //the net power output of the cycle in MW\n", +"\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 = .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", +"\n", +"x2 = (s2-sf)/(sg-sf) //quality at state 2\n", +"h2 = hf + x2*hfg\n", +"//State 3 is saturated liquid at 0.008 MPa, so\n", +"h3 = 173.88 //in kj/kg\n", +"\n", +"p4 = p1\n", +"h4 = h3 + v3*(p4-p3)*10^6*10^-3 //in kj/kg\n", +"\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", +"\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", +"\n", +"eta = (wtdot-wpdot)/qindot //thermal efficiency)\n", +"printf('the thermal efficiency for the cycle is: %f',eta)\n", +"\n", +"//part(b)\n", +"bwr = wpdot/wtdot //back work ratio\n", +"printf('\n\nthe back work ratio is: %e',bwr)\n", +"\n", +"//part(c)\n", +"mdot = (Wcycledot*10^3*3600)/((h1-h2)-(h4-h3)) //mass flow rate in kg/h\n", +"printf('\n\nthe mass flow rate of the steam in kg/h is: %e',mdot)\n", +" \n", +"//part(d)\n", +"Qindot = mdot*qindot/(3600*10^3) //in MW\n", +"printf('\n\nthe rate of heat transfer,Qindot , into the working fluid as it passes through the boiler, in MW is: %f',Qindot)\n", +"\n", +"//part(e)\n", +"Qoutdot = mdot*(h2-h3)/(3600*10^3) //in MW\n", +"printf('\n\nthe rate of heat transfer,Qoutdot from the condensing steam as it passes through the condenser, in MW is: %f',Qoutdot)\n", +"\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", +"printf('\n\nthe mass flow rate of the condenser cooling water, in kg/ h is: %e',mcwdot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.2) Reconsider the vapor power cycle of Example 8.1, but include in the analysis that the turbine and the pump each have an isentropic efficiency of 85%. Determine for the modified cycle (a) the thermal efficiency, (b) the mass flow rate of steam, in kg/h, for a net power output of 100 MW, (c) the rate of heat transfer Qindot into the working fluid as it passes through the boiler, in MW, (d) the rate of heat transfer Qoutdotfrom the condensing steam as it passes through the condenser, in MW, (e) the mass flow rate of the condenser cooling water, in kg/h, if cooling water enters the condenser at 15C and exits as 35C. Discuss the effects on the vapor cycle of irreversibilities within the turbine and pump.\n", +"\n", +"\n", +"//solution\n", +"\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", +"\n", +"//from example 8.1\n", +"h1 = 2758 //in kj/kg\n", +"h2s = 1794.8 //in kj/kg\n", +"\n", +"h2 = h1 - etat*(h1-h2s) //in kj/kg\n", +"//State 3 is the same as in Example 8.1, so\n", +"h3 = 173.88 //in kj/kg\n", +"\n", +"//from solution to example 8.1\n", +"wpdot = 8.06/etat //where the value 8.06 is obtained from example 8.1\n", +"\n", +"h4 = h3 + wpdot\n", +"\n", +"//part(a)\n", +"eta = ((h1-h2)-(h4-h3))/(h1-h4) //thermal efficiency\n", +"printf('thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"Wcycledot = 100 //given,a net power output of 100 MW\n", +"mdot = (Wcycledot*10^3*3600)/((h1-h2)-(h4-h3))\n", +"printf('\n\nthe mass flow rate of steam, in kg/h, for a net power output of 100 MW is: %e',mdot)\n", +"\n", +"//part(c)\n", +"Qindot = mdot*(h1-h4)/(3600 * 10^3)\n", +"printf('\n\nthe rate of heat transfer Qindot into the working fluid as it passes through the boiler, in MW is: %f',Qindot)\n", +"\n", +"//part(d)\n", +"Qoutdot = mdot*(h2-h3)/(3600*10^3)\n", +"printf('\n\nthe rate of heat transfer Qoutdotfrom the condensing steam as it passes through the condenser, in MW is: %f',Qoutdot)\n", +"\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", +"printf('\n\nthe mass flow rate of the condenser cooling water, in kg/h is: %e',mcwdot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.3) Steam is the working fluid in an ideal Rankine cycle with superheat and reheat. Steam enters the first-stage turbine at 8.0 MPa, 480C, and expands to 0.7 MPa. It is then reheated to 440C before entering the second-stage turbine, where it expands to the condenser pressure of 0.008 MPa. The net power output is 100 MW. Determine (a) the thermal efficiency of the cycle, (b) the mass flow rate of steam, in kg/h, (c) the rate of heat transfer Qoutdot from the condensing steam as it passes through the condenser, in MW. Discuss the effects of reheat on the vapor power cycle.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 480 //temperature of steam entering the first stage turbine in degree celcius\n", +"p1 = 8 //pressure of steam entering the first stage turbine in MPa\n", +"p2 = .7 //pressure of steam exiting the first stage turbine in MPa\n", +"T3 = 440 //temperature of steam before entering the second stage turbine \n", +"Pcond = .008 //condenser pressure in MPa\n", +"Wcycledot = 100 //the net power output in MW\n", +"\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", +"\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", +"\n", +"x4 = (s4-sf)/(sg-sf)\n", +"h4 = hf + x4*hfg\n", +"\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", +"\n", +"//part(a)\n", +"eta = ((h1-h2)+(h3-h4)-(h6-h5))/((h1-h6)+(h3-h2))\n", +"printf('the thermal efficiency of the cycle is: %f',eta)\n", +"\n", +"//part(b)\n", +"mdot = (Wcycledot*3600*10^3)/((h1-h2)+(h3-h4)-(h6-h5))\n", +"printf('\n\nthe mass flow rate of steam, in kg/h is: %e',mdot)\n", +"\n", +"//part(c)\n", +"Qoutdot = (mdot*(h4-h5))/(3600*10^3)\n", +"printf('\n\nthe rate of heat transfer Qoutdot from the condensing steam as it passes through the condenser, in MW is: %f',Qoutdot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.4) Reconsider the reheat cycle of Example 8.3, but include in the analysis that each turbine stage has the same isentropic efficiency. (a) If etat = 85%, determine the thermal efficiency. (b) Plot the thermal efficiency versus turbine stage efficiency ranging from 85 to 100%.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//part (a)\n", +"etat = .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", +"\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", +"\n", +"eta = ((h1-h2)+(h3-h4)-(h6-h5))/((h1-h6)+(h3-h2)) \n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"\n", +"//part (b)\n", +"x = linspace(.85,1,50);\n", +"for i = 1: 50\n", +" h2(1,i) = h1 - x(1,i)*(h1 - h2s) //The specific enthalpy at the exit of the first-stage turbine in kj/kg\n", +"h4(1,i) = h3 - x(1,i)*(h3-h4s) //The specific enthalpy at the exit of the second-stage turbine in kj/kg\n", +"end\n", +"\n", +"for i = 1:50\n", +" y(1,i) = ((h1-h2(1,i))+(h3-h4(1,i))-(h6-h5))/((h1-h6)+(h3-h2(1,i))) \n", +"end\n", +"plot2d(x,y)\n", +"xtitle('','isentropic turbine efficiency','cycle thermal efficiency')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Consider a regenerative vapor power cycle with one open feedwater heater. Steam enters the turbine at 8.0 MPa, 480C and expands to 0.7 MPa, where some of the steam is extracted and diverted to the open feedwater heater operating at 0.7 MPa. The remaining steam expands through the second-stage turbine to the condenser pressure of 0.008 MPa. Saturated liquid exits the open feedwater heater at 0.7 MPa. The isentropic efficiency of each turbine stage is 85% and each pump operates isentropically. If the net power output of the cycle is 100 MW, determine (a) the thermal efficiency and (b) the mass flow rate of steam entering the first turbine stage, in kg/h.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 480 //temperature of steam entering the turbine in degree celcius\n", +"p1 = 8 //pressure of steam entering the turbine in MPa\n", +"Pcond = .008 //condenser pressure in MPa\n", +"etat = .85 //turbine efficiency\n", +"Wcycledot = 100 //net power output of the cycle\n", +"\n", +"\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", +"//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 = .7 //in MPa\n", +"p4 = .008 //in MPa\n", +"p7 = 8 //in MPa\n", +"p6 = .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", +"\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", +"\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", +"\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", +"\n", +"eta = (wtdot-wpdot)/qindot\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"m1dot = (Wcycledot*3600*10^3)/(wtdot-wpdot)\n", +"printf('\nthe mass flow rate of steam entering the first turbine stage, in kg/h is: %e',m1dot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.6) Consider a reheat–regenerative vapor power cycle with two feedwater heaters, a closed feedwater heater and an open feedwater heater. Steam enters the first turbine at 8.0 MPa, 480C and expands to 0.7 MPa. The steam is reheated to 440C before entering the second turbine, where it expands to the condenser pressure of 0.008 MPa. Steam is extracted from the first turbine at 2 MPa and fed to the closed feedwater heater. Feedwater leaves the closed heater at 205C and 8.0 MPa, and condensate exits as saturated liquid at 2 MPa. The condensate is trapped into the open feedwater heater. Steam extracted from the second turbine at 0.3 MPa is also fed into the open feedwater heater, which operates at 0.3 MPa. The stream exiting the open feedwater heater is saturated liquid at 0.3 MPa. The net power output of the cycle is 100 MW. There is no stray heat transfer from any component to its surroundings. If the working fluid experiences no irreversibilities as it passes through the turbines, pumps, steam generator, reheater, and condenser, determine (a) the thermal efficiency, (b) the mass flow rate of the steam entering the first turbine, in kg/h.\n", +"\n", +"\n", +"//solution\n", +"\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 = .9382\n", +"//using steam tables, for state 6\n", +"hf = 173.88 //in kj/kg\n", +"hfg = 2403.1 //in kj/kg\n", +"\n", +"h6 = hf + x6*hfg\n", +"\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 = .3 //in MPa\n", +"p7 = .008 //in MPa\n", +"\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", +"\n", +"//for the exit of the second pump,\n", +"v9 = 1.0732e-3 //in m^3/kg\n", +"p10 = 8 //in MPa\n", +"p9 = .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 //in MPa\n", +"psat = 1.73 //in MPa\n", +"h11 = hf + vf*(p11-psat)*10^6*10^-3 //in kj/kg\n", +"\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", +"\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 turbine\n", +"\n", +"eta = (wt1dot+wt2dot-wp1dot-wp2dot)/qindot //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"Wcycledot = 100 //the net power output of the cycle in MW\n", +"m1dot = (Wcycledot*3600*10^3)/(wt1dot+wt2dot-wp1dot-wp2dot)\n", +"printf('\nthe mass flow rate of the steam entering the first turbine, in kg/h is: %e',m1dot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.7) The heat exchanger unit of the boiler of Example 8.2 has a stream of water entering as a liquid at 8.0 MPa and exiting as a saturated vapor at 8.0 MPa. In a separate stream, gaseous products of combustion cool at a constant pressure of 1 atm from 1107 to 547C. The gaseous stream can be modeled as air as an ideal gas. Let T0 = 22C, p0 = 1 atm. Determine (a) the net rate at which exergy is carried into the heat exchanger unit by the gas stream, in MW, (b) the net rate at which exergy is carried from the heat exchanger by the water stream, in MW, (c) the rate of exergy destruction, in MW, (d) the exergetic efficiency given by Eq. 7.45.\n", +"\n", +"\n", +"//solution\n", +"\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", +"\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", +"Rin = madot*(hi-he-T0*(si-se))/(3600*10^3) //The net rate at which exergy is carried into the heat exchanger unit by the gaseous stream \n", +"printf(' the net rate at which exergy is carried into the heat exchanger unit by the gas stream, in MW is: %f',Rin)\n", +"\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 = .5957 //in kj/kg.k\n", +"Rout = mdot*(h1-h4-T0*(s1-s4))/(3600*10^3) //in MW\n", +"printf('\n\n the net rate at which exergy is carried from the heat exchanger by the water stream, in MW is: %f',Rout)\n", +"\n", +"//part(c)\n", +"Eddot = Rin-Rout //in MW\n", +"printf('\n\nthe rate of exergy destruction, in MW is: %f',Eddot)\n", +"\n", +"//part(d)\n", +"epsilon = Rout/Rin\n", +"printf('\n\nthe exergetic efficiency is: %f',epsilon)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.8) Reconsider the turbine and pump of Example 8.2. Determine for each of these components the rate at which exergy is destroyed, in MW. Express each result as a percentage of the exergy entering the plant with the fuel. Let T0 = 22C, p0 = 1 atm\n", +"\n", +"//solution\n", +"\n", +"T0 = 295 //in kelvin\n", +"P0 = 1 //in atm\n", +"\n", +"//analysis\n", +"//from table A-3\n", +"s1 = 5.7432 //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", +"\n", +"mdot = 4.449e5 //in kg/h\n", +"Eddot = mdot*T0*(s2-s1)/(3600*10^3) //the rate of exergy destruction for the turbine in MW\n", +"printf('the rate of exergy destruction for the turbine in MW is: %f',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('\nThe 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, it can be concluded that\n", +"printf('\npercentage of the exergy entering the plant with the fuel destroyed within the turbine is: %f',.69*(Eddot/231.28)*100)\n", +"\n", +"//from table A-3\n", +"s3 =.5926 //in kj/kg.k\n", +"//from solution of example 8.7\n", +"s4 = .5957 //in kj/kg.k\n", +"EddotP = mdot*T0*(s4-s3)/(3600*10^3) //the exergy destruction rate for the pump\n", +"printf('\n\nthe exergy destruction rate for the pump in MW is: %f',EddotP)\n", +"printf(' and expressing this as a percentage of the exergy entering the plant as calculated above, we have %f',(EddotP/231.28)*69 )\n", +"\n", +"printf('\n\nThe 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 carried into the plant with the fuel, %f',(100/231.28)*69)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(8.9) The condenser of Example 8.2 involves two separate water streams. In one stream a two-phase liquid–vapor mixture enters at 0.008 MPa and exits as a saturated liquid at 0.008 MPa. In the other stream, cooling water enters at 15C and exits at 35C. (a) Determine the net rate at which exergy is carried from the condenser by the cooling water, in MW. Express this result as a percentage of the exergy entering the plant with the fuel. (b) Determine for the condenser the rate of exergy destruction, in MW. Express this result as a percentage of the exergy entering the plant with the fuel. Let T0 = 22C and p0 = 1 atm.\n", +"\n", +"\n", +"//solution\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", +"\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 = .5053 //in kj/kg.k\n", +"si = .2245 //in kj/kg.k\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", +"printf(' the net rate at which exergy is carried from the condenser by the cooling water, in MW is: %f',Rout)\n", +"printf('. Expressing this as a percentage of the exergy entering the plant with the fuel, we get %f',(Rout/231.28)*69)\n", +"printf('percent')\n", +"\n", +"//part(b)\n", +"//from table \n", +"s3 = .5926 //in kj/kg.k\n", +"s2 = 6.2021 //in kg/kg.k\n", +"mdot = 4.449e5 //in kg/h\n", +"Eddot = T0*(mdot*(s3-s2)+mcwdot*(se-si))/(3600*10^3) //the rate of exergy destruction for the condenser in MW\n", +"printf('\n\nthe rate of exergy destruction for the condenser in MW is: %f',Eddot)\n", +"printf('. Expressing this as a percentage of the exergy entering the plant with the fuel, we get, %f',(Eddot/231.28)*69)\n", +"printf('percent')\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" " + ] + } +], +"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_Engineering_Thermodynamics_by_M_J_Moran/9-Gas_power_systems.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/9-Gas_power_systems.ipynb new file mode 100644 index 0000000..b914bab --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/9-Gas_power_systems.ipynb @@ -0,0 +1,1265 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Gas power systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('theoretical problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.11) A regenerative gas turbine with intercooling and reheat operates at steady state. Air enters the compressor at 100 kPa, 300 K with a mass flow rate of 5.807 kg/s. The pressure ratio across the two-stage compressor is 10. The pressure ratio across the two-stage turbine is also 10. The intercooler and reheater each operate at 300 kPa. At the inlets to the turbine stages, the temperature is 1400 K. The temperature at the inlet to the second compressor stage is 300 K. The isentropic efficiency of each compressor and turbine stage is 80%. The regenerator effectiveness is 80%. Determine (a) the thermal efficiency, (b) the back work ratio, (c) the net power developed, in kW.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //in kelvin\n", +"p1 = 100 //in kpa\n", +"mdot = 5.807 //in kg/s\n", +"p2 = 300 //in kpa\n", +"p3 = p2\n", +"p4 = 1000 //in kpa\n", +"p5 = p4\n", +"p6 = p4\n", +"T6 = 1400 //in kelvin\n", +"T8 = T6\n", +"p7 = 300 //in kpa\n", +"p8 = p7\n", +"etac = .8 //isentropic efficiency of compressor\n", +"etat = .8 //isentropic efficiency of turbine\n", +"etareg = .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", +"\n", +"h4 = h3 + (h4s-h3)/etac //in kj/kg\n", +"h2 = h1 + (h2s-h1)/etac //in kj/kg\n", +"\n", +"h9 = h8-etat*(h8-h9s) //in kj/kg\n", +"h7 = h6-etat*(h6-h7s) //in kj/kg\n", +"\n", +"h5 = h4+etareg*(h9-h4) //in kj/kg\n", +"\n", +"//part(a)\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", +"\n", +"eta = (wtdot-wcdot)/qindot //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"bwr = wcdot/wtdot //back work ratio\n", +"printf('\nthe back work ratio is: %f',bwr)\n", +"\n", +"//part(c)\n", +"Wcycledot = mdot*(wtdot-wcdot) //net power developed in kw\n", +"printf('\nthe net power developed, in kW is: %f',Wcycledot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.12) Air enters a turbojet engine at 0.8 bar, 240K, and an inlet velocity of 1000 km/h (278 m/s). The pressure ratio across the compressor is 8. The turbine inlet temperature is 1200K and the pressure at the nozzle exit is 0.8 bar. The work developed by the turbine equals the compressor work input. The diffuser, compressor, turbine, and nozzle processes are isentropic, and there is no pressure drop for flow through the combustor. For operation at steady state, determine the velocity at the nozzle exit and the pressure at each principal state. Neglect kinetic energy at the exit of all components except the nozzle and neglect potential energy throughout.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Ta = 240 //in kelvin\n", +"pa = .8 //in bar\n", +"Va = 278 //in m/s\n", +"PR = 8 //pressure ratio across the compressor\n", +"T3 = 1200 //in kelvin\n", +"p5 = .8 //in bar\n", +"\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", +"p1 = (pr1/pra)*pa //in bars\n", +"\n", +"p2 = PR*p1 //in bars\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", +"//using assumption 'There is no pressure drop for flow through the combustor', \n", +"p3 = p2\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", +"//Interpolating in Table A-22 with h4, gives\n", +"pr4 = 116.8\n", +"//pr data from table A-22 gives\n", +"pr4 = 116\n", +"pr3 = 238\n", +"\n", +"p4 = p3*(pr4/pr3) //in bars\n", +"\n", +"//The expansion through the nozzle is isentropic to\n", +"p5 = .8 //in bars\n", +"pr5 = pr4*(p5/p4)\n", +"//from table A-22\n", +"h5 = 621.3 //in kj/kg\n", +"\n", +"V5 = sqrt(2*(h4-h5)*10^3) //the velocity at the nozzle exit in m/s\n", +"\n", +"printf('the velocity at the nozzle exit in m/s is: %f',V5)\n", +"printf('\npa in bars = %f',pa)\n", +"printf('\np1 in bars = %f',p1)\n", +"printf('\np2 in bars = %f',p2)\n", +"printf('\np3 in bars = %f',p3)\n", +"printf('\np4 in bars = %f',p4)\n", +"printf('\np5 in bars = %f',p5)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.13) A combined gas turbine–vapor power plant has a net power output of 45 MW. Air enters the compressor of the gas turbine at 100 kPa, 300 K, and is compressed to 1200 kPa. The isentropic efficiency of the compressor is 84%. The condition at the inlet to the turbine is 1200 kPa, 1400 K. Air expands through the turbine, which has an isentropic efficiency of 88%, to a pressure of 100 kPa. The air then passes through the interconnecting heat exchanger and is finally discharged at 400 K. Steam enters the turbine of the vapor power cycle at 8 MPa, 400C, and expands to the condenser pressure of 8 kPa. Water enters the pump as saturated liquid at 8 kPa. The turbine and pump of the vapor cycle have isentropic efficiencies of 90 and 80%, respectively. (a) Determine the mass flow rates of the air and the steam, each in kg/s, and the net power developed by the gas turbine and vapor power cycle, each in MW. (b) Develop a full accounting of the net rate of exergy increase as the air passes through the gas turbine combustor. Discuss. Let T0 = 300 K, p0 = 100 kPa.\n", +"\n", +"//solution\n", +"Wnetdot = 45 //in MW\n", +"T1 = 300 //in kelvin\n", +"p1 = 100 //in kpa\n", +"etac = .84 //The isentropic efficiency of the compressor\n", +"T3 = 1400 //in kelvin\n", +"p2 = 1200 //in kpa\n", +"p3 = p2\n", +"etat = .88 //isentropic efficiency of the turbine\n", +"T5 = 400 //in kelvin\n", +"p4 = 100 //in kpa\n", +"p5 = p4\n", +"T7 = 400 //in degree celcius\n", +"p7 = 8 //in MPa\n", +"etatw =.9 //isentropic efficiency of turbine of the vapor cycle\n", +"p8 = 8 //in kpa\n", +"p9 = p8\n", +"etap = .8 //isentropic efficiency of pump of the vapor cycle\n", +"T0 = 300 //in kelvin\n", +"p0 = 100 //in kpa\n", +"\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", +"\n", +"//part(a)\n", +"//by applying mass and energy rate balances\n", +"mvdotbymgdot = (h4-h5)/(h7-h6) //ratio of mass flow rates of vapor and air\n", +"\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", +"\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", +"\n", +"printf('mass flow rate of air in kg/s is: %f',mgdot)\n", +"printf('\nmass flow rate of vapor in kg/s is: %f',mvdot)\n", +"printf('\nnet power developed by gas turbine in MW is: %f',Wgasdot)\n", +"printf('\nnet power developed by vapor cycle in MW is: %f',Wvapdot)\n", +"\n", +"\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", +"\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", +"\n", +"printf('\n\nbalance sheet')\n", +"printf('\nNet exergy increase of the gas passing')\n", +"printf('\nthrough the combustor:\t%f',Edotf32)\n", +"printf('\nDisposition of the exergy:')\n", +"printf('\n• Net power developed')\n", +"printf('\ngas turbine cycle\t%f',Wgasdot)\n", +"printf('\nvapor cycle\t%f',Wvapdot)\n", +"printf('\n• Net exergy lost')\n", +"printf('\nwith exhaust gas at state 5\t%f',Edotf51)\n", +"printf('\nfrom water passing through condenser\t%f',Edotf89)\n", +"printf('\n• Exergy destruction')\n", +"printf('\nair turbine\t%f',Eddott)\n", +"printf('\ncompressor\t%f',Eddotc)\n", +"printf('\nsteam turbine\t%f',Eddotst)\n", +"printf('\npump\t%f',Eddotp)\n", +"printf('\nheat exchanger\t%f',EddotHE)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.14) A converging nozzle has an exit area of 0.001 m2. Air enters the nozzle with negligible velocity at a pressure of 1.0 MPa and a temperature of 360 K. For isentropic flow of an ideal gas with k = 1.4, determine the mass flow rate, in kg/s, and the exit Mach number for back pressures of (a) 500 kPa and (b) 784 kPa.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Tnot = 360 //in kelvin\n", +"pnot = 1 //in MPa\n", +"A2 = .001 //in m^2\n", +"k = 1.4\n", +"\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\n", +"p2 = pstar //in MPa\n", +"printf('the exit mach number for back pressure of 500kpa is: %f',M)\n", +"T2 = Tnot/(1+((k-1)/2)*(M^2)) //exit temperature in kelvin\n", +"R = 8.314 //universal gas constant, in SI units\n", +"M = 28.97 //molar mass of air in grams\n", +"V2 = sqrt(k*(R/M)*T2*10^3) //exit velocity in m/s\n", +"mdot = (p2/((R/M)*T2))*A2*V2*10^3 //mass flow rate in kg/s\n", +"printf('\nthe mass flow rate in kg/s for back pressure of 500kpa is: %f',mdot)\n", +"\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 //exit pressure in kpa\n", +"M2 = {(2/(k-1))*[(pnot*10^3/p2)^((k-1)/k)-1]}^.5 //exit mach number\n", +"T2 = Tnot/(1+((k-1)/2)*(M2^2)) //exit temperature in kelvin\n", +"V2 = M2*sqrt(k*(R/M)*10^3*T2) //exit velocity in m/s\n", +"mdot2 = (p2/((R/M)*T2))*A2*V2 //mass flow rate in kg/s\n", +"printf('\n\nthe mass flow rate at the exit in kg/s for back pressure of 784kpa is: %f',mdot2)\n", +"printf('\nthe exit mach number for back pressure of 784 kpa is: %f',M2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.15: Example_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.15) A converging–diverging nozzle operating at steady state has a throat area of 6.25 cm2 and an exit area of 15 cm2. Air enters the nozzle with a negligible velocity at a pressure of 6.8 bars and a temperature of 280 K. For air as an ideal gas with k = 1.4, determine the mass flow rate, in kg/s, the exit pressure, in bars, and exit Mach number for each of the five following cases. (a) Isentropic flow with M = 0.7 at the throat. (b) Isentropic flow with M = 1 at the throat and the diverging portion acting as a diffuser. (c) Isentropic flow with M = 1 at the throat and the diverging portion acting as a nozzle. (d) Isentropic flow through the nozzle with a normal shock standing at the exit. (e) A normal shock stands in the diverging section at a location where the area is 12.5 cm2. Elsewhere in the nozzle, the flow is isentropic.\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"Mt = .7 //mach mumber at the throat\n", +"At = 6.25 //throat area in cm^2\n", +"Ae = 15 //exit area in cm^2\n", +"//With Mt = 0.7, Table 9.1 gives\n", +"AtbyAstar = 1.09437\n", +"\n", +"A2byAstar = (Ae/At)*AtbyAstar\n", +"//The flow throughout the nozzle, including the exit, is subsonic. Accordingly, with this value for A2byAstar, Table 9.1 gives\n", +"M2 = .24\n", +"//For M2 = 0.24,\n", +"T2byTnot = .988\n", +"p2bypnot = .959\n", +"k = 1.4\n", +"T0 = 280 //in kelvin\n", +"pnot = 6.8 //in bars\n", +"\n", +"T2 = T2byTnot*T0 //in kelvin\n", +"p2 = p2bypnot*pnot //in bars\n", +"\n", +"V2 = M2*sqrt((k*(8.314/28.97)*T2*10^3)) //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", +"printf('part(a) the mass flow rate in kg/s is: %f',mdot)\n", +"printf('\nthe exit pressure in bars is: %f',p2)\n", +"printf('\nthe exit mach number is: %f',M2)\n", +"\n", +"//part(b)\n", +"Mt = 1 //mach number at the throat\n", +"//from table 9.1\n", +"M2 = .26\n", +"T2byTnot = .986 \n", +"p2bypnot = .953\n", +"\n", +"T0 = 280 //in kelvin\n", +"pnot = 6.8 //in bars\n", +"\n", +"T2 = T2byTnot*T0 //in kelvin\n", +"p2 = p2bypnot*pnot //in bars\n", +"k = 1.4\n", +"V2 = M2*sqrt(k*(8314/28.97)*T2) //exit velocity in m/s\n", +"mdot = (p2/((8.314/28.97)*T2))*Ae*V2*10^-2 //mass flow rate in kg/s\n", +"\n", +"printf('\n\n\npart(b) the mass flow rate in kg/s is: %f',mdot)\n", +"printf('\nthe exit pressure in bars is: %f',p2)\n", +"printf('\nthe exit mach number is: %f',M2)\n", +"\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 = .0684\n", +"\n", +"pnot = 6.8 //in bars\n", +"\n", +"p2 = p2bypnot*pnot //in bars\n", +"//Since the nozzle is choked, the mass flow rate is the same as found in part (b).\n", +"printf('\n\n\npart(c) the mass flow rate in kg/s is: %f',mdot)\n", +"printf('\nthe exit pressure in bars is: %f',p2)\n", +"printf('\nthe exit mach number is: %f',M2)\n", +"\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 = .465 //in bars\n", +"//Then, from Table 9.2\n", +"My = .52\n", +"pybypx = 6.5533\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", +"\n", +"printf('\n\n\npart(d) the mass flow rate in kg/s is: %f',mdot)\n", +"printf('\nthe exit pressure in bars is: %f',3.047)\n", +"printf('\nthe exit mach number is: %f',My)\n", +"\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", +"//With Mx = 2.2, the ratio of stagnation pressures is obtained from Table 9.2 as\n", +"pnotybypnotx = .62812\n", +"\n", +"A2byAystar = (Ae/Axstar)*pnotybypnotx\n", +"//Using this ratio and noting that the flow is subsonic after the shock, Table 9.1 gives\n", +"M2 = .43\n", +"//for M2 = .43,\n", +"p2bypnoty = .88\n", +"\n", +"p2 = p2bypnoty*pnotybypnotx*pnot //in bars\n", +"//Since the flow is choked, the mass flow rate is the same as that found in part (b).\n", +"printf('\n\n\npart(e) the mass flow rate in kg/s is: %f',mdot)\n", +"printf('\nthe exit pressure in bars is: %f',p2)\n", +"printf('\nthe exit mach number is: %f',M2)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.1) The temperature at the beginning of the compression process of an air-standard Otto cycle with a compression ratio of 8 is 300K, the pressure is 1 bar, a d the cylinder volume is 560 cm3. The maximum temperature during the cycle is 2000K. Determine (a) the temperature and pressure at the end of each process of the cycle, (b) the thermal efficiency, and (c) the mean effective pressure, in atm.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //The temperature at the beginning of the compression process in kelvin\n", +"p1 = 1 //the pressure at the beginning of the compression process in bar\n", +"r = 8 //compression ratio\n", +"V1 = 560 //the volume at the beginning of the compression process in cm^3\n", +"T3 = 2000 //maximum temperature during the cycle in kelvin\n", +"\n", +"//part(a)\n", +"//at T1 = 300k,table A-22 gives\n", +"u1 = 214.07 //in kj/kg\n", +"vr1 = 621.2 \n", +"//For the isentropic compression Process 1–2\n", +"vr2 = vr1/r\n", +"//Interpolating with vr2 in Table A-22, we get\n", +"T2 = 673 //in kelvin\n", +"u2 = 491.2 //in kj/kg\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", +"//At T3 = 2000 K, Table A-22 gives\n", +"u3 = 1678.7 //in kj/kg\n", +"vr3 = 2.776\n", +"//For the isentropic expansion process 3–4\n", +"vr4 = vr3*(r)\n", +"//Interpolating in Table A-22 with vr4 gives\n", +"T4 = 1043 //in kelvin\n", +"u4 = 795.8 //in kj/kg\n", +"//the ideal gas equation of state applied at states 1 and 4 gives\n", +"p4 = p1*(T4/T1) //in bars\n", +"printf('at state1, the pressure in bar is: %f',p1)\n", +"printf('\natstate1, the temperature in kelvin is %f',T1)\n", +"printf('\n\nat state2, the pressure in bar is: %f',p2)\n", +"printf('\natstate2, the temperature in kelvin is %f',T2)\n", +"printf('\n\nat state3, the pressure in bar is: %f',p3)\n", +"printf('\natstate3, the temperature in kelvin is %f',T3)\n", +"printf('\n\nat state4, the pressure in bar is: %f',p4)\n", +"printf('\natstate4, the temperature in kelvin is %f',T4)\n", +"\n", +"//part(b)\n", +"eta = 1-(u4-u1)/(u3-u2) //thermal efficiency\n", +"printf('\n\n\nthe thermal efficiency is: %f',eta)\n", +"\n", +"//part(c)\n", +"R = 8.314 //universal gas constant, in SI units\n", +"M = 28.97 //molar mass of air in grams\n", +"m = ((p1*V1)/((R/M)*T1))*10^-6*10^5*10^-3 //mass of the air in kg\n", +"\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", +"printf('\n\n\nthe mean effective pressure, in atm. is: %f',mep/1.01325)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.2) At the beginning of the compression process of an air-standard Diesel cycle operating with a compression ratio of 18, the temperature is 300 K and the pressure is 0.1 MPa. The cutoff ratio for the cycle is 2. Determine (a) the temperature and pressure at the end of each process of the cycle, (b) the thermal efficiency, (c) the mean effective pressure, in MPa.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"r = 18 //compression ratio\n", +"T1 = 300 //temperature at the beginning of the compression process in kelvin\n", +"p1 = .1 //pressure at the beginning of the compression process in MPa\n", +"rc = 2 //cutoff ratio\n", +"\n", +"//part(a)\n", +"//With T1 = 300 K, Table A-22 gives\n", +"u1 = 214.07 //in kj/kg\n", +"vr1 = 621.2 \n", +"//For the isentropic compression process 1–2\n", +"vr2 = vr1/r\n", +"//Interpolating in Table A-22, we get\n", +"T2 = 898.3 //in kelvin \n", +"h2 = 930.98 //in kj/kg\n", +"//With the ideal gas equation of state\n", +"p2 = p1*(T2/T1)*(r) //in MPa\n", +"//Since Process 2–3 occurs at constant pressure, the ideal gas equation of state gives\n", +"T3 = rc*T2 //in kelvin\n", +"//From Table A-22,\n", +"h3 = 1999.1 //in kj/kg\n", +"vr3 = 3.97\n", +"\n", +"p3 = p2\n", +"//For the isentropic expansion process 3–4\n", +"vr4 = (r/rc)*vr3\n", +"//Interpolating in Table A-22 with vr4, we get\n", +"u4 = 664.3 //in kj/kg\n", +"T4 = 887.7 //in kelvin\n", +"//the ideal gas equation of state applied at states 1 and 4 gives\n", +"p4 = p1*(T4/T1) //in MPa\n", +"printf('at state1, the pressure in bar is: %f',p1)\n", +"printf('\natstate1, the temperature in kelvin is %f',T1)\n", +"printf('\n\nat state2, the pressure in bar is: %f',p2)\n", +"printf('\natstate2, the temperature in kelvin is %f',T2)\n", +"printf('\n\nat state3, the pressure in bar is: %f',p3)\n", +"printf('\natstate3, the temperature in kelvin is %f',T3)\n", +"printf('\n\nat state4, the pressure in bar is: %f',p4)\n", +"printf('\natstate4, the temperature in kelvin is %f',T4)\n", +"\n", +"//part(b)\n", +"eta = 1- (u4-u1)/(h3-h2)\n", +"printf('\n\n\nthe thermal efficiency is: %f',eta)\n", +"\n", +"//part(c)\n", +"wcycle = (h3-h2)-(u4-u1) //The net work of the cycle in kj/kg\n", +"R = 8.314 //universal gas constant, in SI units\n", +"M = 28.97 //molar mass of air in grams\n", +"v1 = ((R/M)*T1/p1)/10^3 //The specific volume at state 1 in m^3/kg\n", +"\n", +"mep = (wcycle/(v1*(1-1/r)))*10^3*10^-6 //in MPa\n", +"printf('\n\n\nthe mean effective pressure, in MPa is: %f',mep)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.3) At the beginning of the compression process of an air-standard dual cycle with a compression ratio of 18, the temperature is 300 K and the pressure is 0.1 MPa. The pressure ratio for the constant volume part of the heating process is 1.5:1. The volume ratio for the constant pressure part of the heating process is 1.2:1. Determine (a) the thermal efficiency and (b) the mean effective pressure, in MPa.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //beginning temperature in kelvin\n", +"p1 = .1 //beginning pressure in MPa\n", +"r = 18 //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", +"\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", +"//Since Process 2–3 occurs at constant volume, the ideal gas equation of state reduces to give\n", +"T3 = pr*T2 //in kelvin\n", +"//Interpolating in Table A-22, we get\n", +"h3 = 1452.6 //in kj/kg\n", +"u3 = 1065.8 //in kj/kg\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", +"//From Table A-22,\n", +"h4 = 1778.3 //in kj/kg\n", +"vr4 = 5.609\n", +"//Process 4–5 is an isentropic expansion, so\n", +"vr5 = vr4*r/vr\n", +"//Interpolating in Table A-22, we get\n", +"u5 = 475.96 //in kj/kg\n", +"\n", +"//part(a)\n", +"eta = 1-(u5-u1)/((u3-u2)+(h4-h3))\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"//The specific volume at state 1 is evaluated in Example 9.2 as\n", +"v1 = .861 //in m^3/kg\n", +"mep = (((u3-u2)+(h4-h3)-(u5-u1))/(v1*(1-1/r)))*10^3*10^-6 //in MPa\n", +"printf('\nthe mean effective pressure, in MPa is: %f',mep)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.4) Air enters the compressor of an ideal air-standard Brayton cycle at 100 kPa, 300 K, with a volumetric flow rate of 5 m3/s. The compressor pressure ratio is 10. The turbine inlet temperature is 1400 K. Determine (a) the thermal efficiency of the cycle, (b) the back work ratio, (c) the net power developed, in kW.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //in kelvin\n", +"AV = 5 //volumetric flow rate in m^3/s\n", +"p1 = 100 //in kpa\n", +"pr = 10 //compressor pressure ratio\n", +"T3 = 1400 //turbine inlet temperature in kelvin\n", +"\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", +"\n", +"pr2 = pr*pr1\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", +"\n", +"pr4 = pr3*1/pr\n", +"//Interpolating in Table A-22, we get\n", +"h4 = 808.5 //in kj/kg\n", +"\n", +"//part(a)\n", +"eta = ((h3-h4)-(h2-h1))/(h3-h2) //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"bwr = (h2-h1)/(h3-h4) //back work ratio\n", +"printf('\nthe back work ratio is: %f',bwr)\n", +"\n", +"//part(c)\n", +"R = 8.314 //universal gas constant, in SI units\n", +"M = 28.97 //molar mass of air in grams\n", +"mdot = AV*p1/((R/M)*T1) //mass flow rate in kg/s\n", +"\n", +"Wcycledot = mdot*((h3-h4)-(h2-h1)) //The net power developed\n", +"printf('\n the net power developed, in kW is: %f',Wcycledot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"printf('theoretical problem')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.6) Reconsider Example 9.4, but include in the analysis that the turbine and compressor each have an isentropic efficiency of 80%. Determine for the modified cycle (a) the thermal efficiency of the cycle, (b) the back work ratio, (c) the net power developed, in kW. \n", +"\n", +"//solution\n", +"\n", +"\n", +"etat = .8 //turbine efficiency\n", +"etac = .8 //compressor efficiency\n", +"//part(a)\n", +"wtdots = 706.9 //The value of wtdots is determined in the solution to Example 9.4 as 706.9 kJ/kg\n", +"//The turbine work per unit of mass is\n", +"wtdot = etat*wtdots //in kj/kg\n", +"\n", +"wcdots = 279.7 //The value of wcdots is determined in the solution to Example 9.4 as 279.7 kJ/kg\n", +"//For the compressor, the work per unit of mass is\n", +"wcdot = wcdots/etac //in kj/kg\n", +"\n", +"h1 = 300.19 //h1 is from the solution to Example 9.4, in kj/kg\n", +"h2 = h1 + wcdot //in kj/kg\n", +"\n", +"h3 = 1515.4 //h3 is from the solution to Example 9.4, in kj/kg\n", +"qindot = h3-h2 //The heat transfer to the working fluid per unit of mass flow in kj/kg\n", +"eta = (wtdot-wcdot)/qindot //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"bwr = wcdot/wtdot //back work ratio\n", +"printf('\nthe back work ratio is: %f',bwr)\n", +"\n", +"//part(c)\n", +"mdot = 5.807 //in kg/s, from example 9.4\n", +"Wcycledot = mdot*(wtdot-wcdot) //The net power developed by the cycle in kw\n", +"printf('\nthe net power developed, in kW. is: %f',Wcycledot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.7) A regenerator is incorporated in the cycle of Example 9.4. (a) Determine the thermal efficiency for a regenerator effectiveness of 80%. (b) Plot the thermal efficiency versus regenerator effectiveness ranging from 0 to 80%.\n", +"\n", +"//solution\n", +"\n", +"\n", +"//part(a)\n", +"etareg = .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", +"\n", +"hx = etareg*(h4-h2)+h2 //in kj/kg\n", +"eta = ((h3-h4)- (h2-h1))/(h3-hx) //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"//part(b)\n", +"etareg = linspace(0,.8,50)\n", +"for i= 1:50\n", +" hx(1,i) = etareg(1,i)*(h4-h2)+h2 \n", +"end\n", +"for i = 1:50\n", +" eta(1,i) = ((h3-h4)- (h2-h1))/(h3-hx(1,i))\n", +"end\n", +"plot(etareg,eta)\n", +"xtitle('','Regenerator effectiveness','Thermal efficiency')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.8) Consider a modification of the cycle of Example 9.4 involving reheat and regeneration. Air enters the compressor at 100 kPa, 300 K and is compressed to 1000 kPa. The temperature at the inlet to the first turbine stage is 1400 K. The expansion takes place isentropically in two stages, with reheat to 1400 K between the stages at a constant pressure of 300 kPa. A regenerator having an effectiveness of 100% is also incorporated in the cycle. Determine the thermal efficiency.\n", +"\n", +"\n", +"//solution\n", +"\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", +"\n", +"pa = 300 //in kpa\n", +"p3 = 1000 //in kpa\n", +"//from table A-22\n", +"pr3 = 450.5\n", +"pra = pr3*(pa/p3)\n", +"//Interpolating in Table A-22, we get\n", +"ha = 1095.9 //in kj/kg\n", +"\n", +"p4 = 100 //in kpa\n", +"pb = 300 //in kpa\n", +"prb = pra\n", +"pr4 = prb*(p4/pb)\n", +"//Interpolating in Table A-22, we obtain\n", +"h4 = 1127.6 //in kj/kg\n", +"//Since the regenerator effectiveness is 100%,\n", +"hx = h4\n", +"\n", +"eta = ((h3-ha)+(hb-h4)-(h2-h1))/((h3-hx)+(hb-ha)) //thermal efficiency\n", +"printf('the thermal efficiency is: %f',eta)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(9.9) Air is compressed from 100 kPa, 300 K to 1000 kPa in a two-stage compressor with intercooling between stages. The intercooler pressure is 300 kPa. The air is cooled back to 300 K in the intercooler before entering the second compressor stage. Each compressor stage is isentropic. For steady-state operation and negligible changes in kinetic and potential energy from inlet to exit, determine (a) the temperature at the exit of the second compressor stage and (b) the total compressor work input per unit of mass flow. (c) Repeat for a single stage of compression from the given inlet state to the final pressure\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 300 //in kelvin\n", +"p1 = 100 //in kpa\n", +"p2 = 1000 //in kpa\n", +"p3 = p2\n", +"pc = 300 //in kpa\n", +"pd = 300 //in kpa\n", +"Td = 300 //in kelvin\n", +"\n", +"\n", +"//part(a)\n", +"//from table A-22\n", +"prd = 1.386\n", +"pr2 = prd*(p2/pd)\n", +"//Interpolating in Table A-22, we get\n", +"T2 = 422 //in kelvin\n", +"h2 = 423.8 //in kj/kg\n", +"printf('the temperature at the exit of the second compressor stage is: %f',T2)\n", +"\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", +"prc = pr1*(pc/p1)\n", +"//Interpolating in Table A-22, we obtain\n", +"hc = 411.3 //in kj/kg\n", +"\n", +"wcdot = (hc-h1)+(h2-hd) //the total compressor work per unit of mass in kj/kg\n", +"printf('\n\nthe total compressor work input per unit of mass flow is: %f',wcdot)\n", +"\n", +"//part(c)\n", +"pr3 = pr1*(p3/p1)\n", +"//Interpolating in Table A-22, we get\n", +"T3 = 574 //in kelvin\n", +"h3 = 579.9 //in kj/kg\n", +"\n", +"wcdot = h3-h1 //The work input for a single stage of compression in kj/kg\n", +"printf('\n\nfor a single stage of compression, the temperature at the exit state is: %f ',T3)\n", +"printf('\nfor a single stage of compression, the work input is: %f',wcdot)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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 +} |