diff options
Diffstat (limited to 'Thermodynamics_by_Gaggioli_and_Obert/16-Combustion.ipynb')
-rw-r--r-- | Thermodynamics_by_Gaggioli_and_Obert/16-Combustion.ipynb | 680 |
1 files changed, 680 insertions, 0 deletions
diff --git a/Thermodynamics_by_Gaggioli_and_Obert/16-Combustion.ipynb b/Thermodynamics_by_Gaggioli_and_Obert/16-Combustion.ipynb new file mode 100644 index 0000000..1238c2b --- /dev/null +++ b/Thermodynamics_by_Gaggioli_and_Obert/16-Combustion.ipynb @@ -0,0 +1,680 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Combustion" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.10: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"N2=78.1 //Moles of Nitrogen\n", +"M=29 //Molar mass of Air\n", +"ba=2.12 //Basis\n", +"x4=0.3 //Moles of Ch4\n", +"x5=3.7 //Moles of H2\n", +"x6=14.7 //moles of H2o\n", +"//calculations\n", +"O2=N2/3.76\n", +"c=14.7\n", +"b= x4*4 + x5*2 + x6*2\n", +"a=b/ba\n", +"AF=(O2+N2)*M/(a*12 + b)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lbm air/lbm fuel',AF)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.11: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"co2=8.7 //Moles of CO2\n", +"co=8.9 //Moles of CO\n", +"N2=78.1 //Moles of Nitrogen\n", +"M=29 //Molar mass of Air\n", +"ba=2.12 //Basis\n", +"x4=0.3 //Moles of Ch4\n", +"x5=3.7 //Moles of H2\n", +"x6=14.7 //moles of H2o\n", +"//calculations\n", +"O2=N2/3.76\n", +"c=14.7\n", +"Z=2.238\n", +"X=(Z*17-x4*4-x5*2)/2\n", +"a=co2+co/2+x4+x6/2\n", +"b=3.764*a\n", +"AF=(O2+N2)*M/(Z*113)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lbm air/lbm fuel',AF)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.12: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x1=8.7 //Moles of Co2\n", +"x2=8.9 //Moles of CO\n", +"x3=0.3 //Moles of O2\n", +"N=78.1 //Moles of N2\n", +"z=113 //Af factor\n", +"M=29 //Molar mass of air\n", +"//calculations\n", +"co2=(x1+x2+x3)*100/(N+x1+x2+x3)\n", +"a=2.325\n", +"AF=103*M/(a*z)\n", +"//results\n", +"printf('Air fuel ratio = %.2f',AF)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.13: Equation_formulation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"co=1.2 //Moles of CO\n", +"co2=10.8 //Moles of CO2\n", +"//calculations\n", +"H2=co/2\n", +"ch4=0.3\n", +"N2=88-H2-ch4\n", +"//results\n", +"printf('Nitrogen = %.1f percent',N2)\n", +"printf('\n Equation is a(96 CH4 + 3 H2+ 1 CO) + %.1f/3.76 O2 + %.1f N2 = %.1f CO2 + %.1f CO + %.1f H2 + %.1f CH4 + %.1f N2',N2,N2,co2,co,H2,ch4,N2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.14: Higher_heating_value.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"dH=-2369859 //Btu\n", +"r=1.986 //Gas constant\n", +"dn=5.5 //Change in number of moles\n", +"T=536.7 //R\n", +"//calculations\n", +"dQ=dH+dn*r*T\n", +"//results\n", +"printf('Higher heating value = %d Btu',dQ)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.15: Lower_heating_value.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"M2=18 //Molar mass of water\n", +"M=170 //Molar mass of octane\n", +"p=0.4593 //Pressure of octane //psia\n", +"disp('from steam tables,')\n", +"vfg=694.9 \n", +"J=778.2\n", +"m=9*18 //Mass of water\n", +"u1=-2363996 //Btu\n", +"//calculations\n", +"hfg=1050.4 //Btu/lbm\n", +"ufg= hfg- p*vfg*144/J\n", +"dU=ufg*m \n", +"Lhv=u1+dU\n", +"//results\n", +"printf('Lower heating value = %d Btu/lbm',Lhv)\n", +"disp('The answers are a bit different due to rounding off error in textbook.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.16: Heat_of_reactio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"n1=8 //Moles of CO2\n", +"n2=9 //Moles of H2O\n", +"n3=1 //Moles of Octane\n", +"n4=12.5 //Moles of Oxygen\n", +"disp('From Table B-10,')\n", +"U11=3852 //Internal energy at 1000 R of CO2\n", +"U12=115 //Internal energy at 537 R of CO2\n", +"U21=3009 //Internal energy at 1000 R of H2O\n", +"U22=101 //Internal energy at 537 R of H2O\n", +"U31=24773 //Internal energy at 1000 R of Octane\n", +"U32=640 //Internal energy at 537 R of Octane\n", +"U41=2539 //Internal energy at 1000 R of Oxygen\n", +"U42=83 //Internal energy at 537 R of Oxygen\n", +"H=-2203389 //heat Btu\n", +"//calculations\n", +"dU1=n1*(U11-U12)+n2*(U21-U22)\n", +"dU2=n3*(U31-U32)+n4*(U41-U42)\n", +"Q=H+dU1-dU2\n", +"//results\n", +"printf('Heat of reaction = %d Btu',Q)\n", +"disp('The answers are a bit different due to rounding off error in textbook.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.17: Temperature_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"n1=8 //Moles of CO2\n", +"n2=9 //Moles of H2O\n", +"n3=47 //Moles of N2\n", +"disp('from table B-10,')\n", +"h1=118 //Enthalpy of CO2\n", +"h2=104 //Enthalpy of H2O\n", +"h3=82.5 //Enthalpy of N2\n", +"Q=2203279 //Btu\n", +"//calculations\n", +"U11=n1*h1+n2*h2+n3*h3\n", +"U12=U11+Q\n", +"T2=5271 //R\n", +"//results\n", +"printf('Upon interpolating, T2 = %d R',T2)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.18: Equilibrium_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"n1=0.95\n", +"n2=0.05\n", +"n3=0.025\n", +"P=147 //psia\n", +"pa=14.7 //psia\n", +"//calculations\n", +"n=n1+n2+n3\n", +"p1=n1/n *P/pa\n", +"p2=n2/n *P/pa\n", +"p3=n3/n *P/pa\n", +"Kp1= p1/(p2*p3^0.5)\n", +"Kp2= p1^2 /(p2^2 *p3)\n", +"//results\n", +"printf('In case 1, Equilibrium constant = %.1f ',Kp1)\n", +"printf('\n In case 2, Equilibrium constant = %.1f ',Kp2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.19: Dissociation_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"kp=5 \n", +"//calculations\n", +"x=poly(0,'x')\n", +"vec=roots(24*x^3 + 3*x-2)\n", +"x=vec(3)\n", +"y=poly(0,'y')\n", +"vec2=roots(249*y^3 +3*y-2)\n", +"y=vec2(3)\n", +"//results\n", +"printf('percentage of dissociation = %.1f percent',x*100)\n", +"printf('\n If pressure =10 . degree of dissociation = %d percent',y*100)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1: Molecule_formulatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"per=85\n", +"//calculations\n", +"a=per/12\n", +"b=100-per\n", +"ad=1.13*a\n", +"bd=1.13*b\n", +"//results\n", +"printf('Molecule is C %d H %d',ad,bd+1)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.20: Extent_of_reaction.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x=poly(0,'x')\n", +"vec=roots(24*x^3 +48*x^2 + 7*x -4)\n", +"x=vec(3) *100\n", +"//results\n", +"printf('Extent of reaction= %d percent',100-x)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2: Molecule_formulatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"per=0.071 //mass fraction of nitrogen\n", +"//calculations\n", +"O2=8.74\n", +"N2=per/2 + 3.76*O2\n", +"Nin=32.85\n", +"CO2=7.333\n", +"H2o=3\n", +"So2=0.0312\n", +"//results\n", +"printf('Oxygen = %.2f and Nitrogen = %.2f',O2,N2)\n", +"printf('\n Equation is C %.3f H %d + %.2f O2 + %.2f N2 = %.3f CO2 + %d H2O + %.5f SO2 + %.2f N2',CO2,2*H2o,O2,Nin,CO2,H2o,So2,N2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"M=29\n", +"m1=8.74\n", +"m2=32.85\n", +"fuel=100 //lbm\n", +"//calculations\n", +"mass=M*(m1+m2)\n", +"AF=mass/fuel\n", +"a2=9.75\n", +"b2=12.19\n", +"AF2=mass/(fuel+a2+b2)\n", +"//results\n", +"printf('Air fuel ratio = %.2f lbm air/lbm fuel',AF)\n", +"printf('\n In dry air, Air-fuel ratio = %.1f lbm air/lbm fuel as fired',AF2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4: Mass_and_energy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"m1=322.3 //Mass of Co2\n", +"m2=2 //Mass of SO2\n", +"m3=926 //Mass of N2\n", +"basis=121.94 //Basis taken\n", +"//calculations\n", +"m=m1+m2+m3\n", +"ratio=m/basis\n", +"dh=5777 //Btu/mol\n", +"h1=dh*7.364\n", +"h2=14037\n", +"h3=130501\n", +"H=h1+h2+h3\n", +"hrat=H/basis\n", +"//results\n", +"printf('Mass of dry flue gases = %.2f lbm dry flue gas/lbm fuel ash and moisture free',m/100)\n", +"printf('\n Mass of dry flue gases = %.2f lbm dry flue gas/lbm fuel as fired ',ratio)\n", +"printf('\n Energy carried away = %.1f btu/mol coal as fired which is same as = %.1f Btu/lbm mol coal ',H, hrat)\n", +"disp('The answers are a bit different due to rounding off errors in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.6: Percentage_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p=14.7 //psia\n", +"ps=0.363 //psia\n", +"n2=7.52 //moles\n", +"n1=1 //moles\n", +"//calculations\n", +"x= (n1+n2)*ps/p /(1-ps/p)\n", +"n=n1+n2+x\n", +"y1=n1/n\n", +"y2=n1/(n1+n2)\n", +"//results\n", +"printf('Final orsat composition is %d CO2 + %.2f H20 + %.2f N2',n1, x, n2)\n", +"printf('\n Percentage of co2 on a wet basis = %.1f percent',y1*100)\n", +"printf('\n percentage of co2 on a dry basis = %.2f percent',y2*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.7: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"N2=78.1\n", +"M=29\n", +"co2=8.7\n", +"co=8.9\n", +"x4=0.3\n", +"x5=3.7\n", +"x6=14.7\n", +"//calculations\n", +"O2=N2/3.76\n", +"Z=(co2+co+x4)/8\n", +"AF=(O2+N2)*M/(Z*113)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lbm air/lbm fuel',AF)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.8: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"basis=100 //lbm\n", +"x1=0.6\n", +"ash=12 //lbm\n", +"N2=79.7\n", +"M=29\n", +"//calculations\n", +"x=ash/x1\n", +"C=(1-x1)*x\n", +"O2=N2/3.76\n", +"a= (14.6+0.2)/(5.83-0.66)\n", +"AF=(O2+N2)*M/(a*100)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lbm air/lbm fuel as fired',AF)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.9: Air_fuel_ratio_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"N2=78.1 //Moles of Nitrogen\n", +"M=29 //Molar mass of Air\n", +"ba=2.12 //Basis\n", +"x4=0.3 //Moles of Ch4\n", +"x5=3.7 //Moles of H2\n", +"x6=14.7 //moles of H2o\n", +"//calculations\n", +"O2=N2/3.76\n", +"O2=N2/3.76\n", +"Z=(x4*4+x5*2+x6*2)/17\n", +"AF=(O2+N2)*M/(Z*113)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lbm air/lbm fuel',AF)\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 +} |