diff options
Diffstat (limited to 'Thermodynamics_for_Engineers_by_J_S_Doolittle')
17 files changed, 5075 insertions, 0 deletions
diff --git a/Thermodynamics_for_Engineers_by_J_S_Doolittle/10-Vapors.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/10-Vapors.ipynb new file mode 100644 index 0000000..54358be --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/10-Vapors.ipynb @@ -0,0 +1,465 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Vapors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.10: Enthalpy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"in=440000 //lb/hr\n", +"out=255000 //lb/hr\n", +"p1=400 //psia\n", +"t1=700 //F\n", +"p2=35 //psia\n", +"t2=290 //F\n", +"vel=500 //ft/s\n", +"hp=44000 //hp\n", +"ent=1362.7 //Btu/lb\n", +"//calculations\n", +"ein=ent*in\n", +"eout=hp*2544 + out*1183 + 925000\n", +"h2= (ein-eout)/185000\n", +"//results\n", +"printf('Specific enthalpy of exhaust steam = %d Btu/lb',h2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.11: Loss_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"h1=1351.1 //Btu/lb\n", +"p1=600 //psia\n", +"t1=700 //F\n", +"p2=234 //psia\n", +"h2=1.6865\n", +"h1=1.5875\n", +"t3=101.74\n", +"//calculations\n", +"t2=660 //F\n", +"loss= (h2-h1)*(t3+459.69)\n", +"//results\n", +"printf('Final state of steam is %d psia and %d F',p2,t2)\n", +"printf('\n Loss of available energy = %.1f Btu/lb',loss)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.12: State_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 2 of keenan and keynes,')\n", +"p1=98.87 //psia\n", +"p2=31.78 //psia\n", +"t1=80 //F\n", +"h2=26.365 //btu/lb\n", +"h1=11.554 //btu/lb\n", +"hfg=67.203 //btu/lb\n", +"//calculations\n", +"x=(h2-h1)/hfg\n", +"//results\n", +"printf('The state of vapor leaving is %.2f psia with a quality of %.2f percent',p2,x*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.13: Mean_state_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"ps=216 //psig\n", +"pb=29.12 //in of Hg\n", +"p2=0.4 //in\n", +"t2=244 //F\n", +"//calculations\n", +"pa=0.491*pb\n", +"pabs=pa + p2*0.491\n", +"plb=pa+ ps\n", +"hcal=1166.5 //Btu/lb\n", +"h2=1200.1 //Btu/lb\n", +"h3=831.9 //Btu/lb\n", +"y=-(hcal-h2)/h3\n", +"//results\n", +"printf('Mean state in the line is %.1f psia with a moisture content of %.2f percent',plb,y*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.1: Enthalpy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p=3000 //psia\n", +"T=250 //F\n", +"//calculations\n", +"disp('From table 1, keenan and keynes,')\n", +"vf=0.01700\n", +"disp('From table 4,')\n", +"dvf=-18.3*10^-5 \n", +"v=vf+dvf\n", +"disp('From table 1,')\n", +"hf=218.48\n", +"disp('From table 4,')\n", +"dhf=6.13\n", +"h=hf+dhf\n", +"sf=0.3675\n", +"dsf=-4.34*10^-3\n", +"s=sf+dsf\n", +"//results\n", +"printf('Specific volume = %.5f cu ft/lb',v)\n", +"printf('\n Enthalpy = %.2f Btu/lb',h)\n", +"printf('\n Entropy = %.4f Btu/lb per deg R',s)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.2: Moisture_content_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"h=1100 //Btu/lb\n", +"P=100 //psia\n", +"//calculations\n", +"disp('From table 2 of keenan and keynes,')\n", +"hg=1187.2 //Btu/lb\n", +"hfg=888.8 //Btu/lb\n", +"y=-(h-hg)/hfg\n", +"//results\n", +"printf('The state is %d psia with a moisture content of %.2f percent',P,y*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3: State_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"v1=0.2688\n", +"//calculations\n", +"v2=3.060\n", +"p2=200 //psia\n", +"t2=600 //F\n", +"//results\n", +"printf('State of steam is %d psia and %d F',p2,t2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: State_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 2 of keenan and keynes,')\n", +"t1=439.60 //F\n", +"u1=1118.4 //Btu/lb\n", +"//calculations\n", +"p2=380 //psia\n", +"//results\n", +"printf('The state of steam is saturated at %d psia and %.2f F',p2,t1)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.5: State_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 2 of keenan and keynes,')\n", +"p1=1 //in of Hg\n", +"s=1.9812 \n", +"//calculations\n", +"sf=2.0387\n", +"sfg=1.9473\n", +"y=-(s-sf)/sfg\n", +"//results\n", +"printf('The state is %d in of Hg with a moisture content of %.2f percent',p1,y*100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.6: State_Enthalpy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"h1=1204.8 //Btu/lb\n", +"q=174 //Btu/lb\n", +"//calculations\n", +"h2=h1+q\n", +"p2=30 //psia\n", +"t2=720 //F\n", +"//results\n", +"printf('Final state of steam is %d psia and %d F',p2,t2)\n", +"printf('\n Final enthalpy is %.1f Btu/lb',h2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.7: volume_state_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"p=70 //psia\n", +"x=0.1\n", +"p2=198 //psia\n", +"//calculations\n", +"v1=6.206\n", +"v2=0.017\n", +"vx=v1-x*(v1-v2)\n", +"t2=1400 //F\n", +"//results\n", +"printf('Final specific volume = %.3f cu ft',vx)\n", +"printf('\n Final state is %d psia and %d F',p2,t2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.8: State_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"disp('From table 1 of keenan and keynes,')\n", +"p=400 //psia\n", +"t1=700 //F\n", +"p2=85 //psia\n", +"//calculations\n", +"s2=1.6398 //units/lb\n", +"t2=350 //F\n", +"//results\n", +"printf('Final state of steam is %d psia and %d F',p2,t2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.9: Work_and_heat_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=20 //psia\n", +"p2=140 //psia\n", +"J=778\n", +"t2=150 //F\n", +"t1=30 //F\n", +"//calculations\n", +"disp('From Table A-3,')\n", +"v1=2.0884 //cu ft/lb\n", +"v2=0.33350 //cu ft/lb\n", +"h2=95.709\n", +"h1=81.842\n", +"n=log(p2/p1) /log(v1/v2)\n", +"W=(p2*v2-p1*v1)*144/(1-n)\n", +"du=h2-h1 + (p1*v1-p2*v2)*144/J\n", +"Q=du+W/J\n", +"s2=0.17718\n", +"s1=0.18126\n", +"Q2=((t2+t1)/2 +460) *(s2-s1)\n", +"//results\n", +"printf('Work of compression = %d ft-lb',W)\n", +"printf('\n Heat removed per pound of refrigerant = %.3f Btu/lb',Q)\n", +"printf('\n Heat removed in case 2 = %.4f Btu',Q2)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/11-Thermodynamics_of_Fluid_flow.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/11-Thermodynamics_of_Fluid_flow.ipynb new file mode 100644 index 0000000..d149fb7 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/11-Thermodynamics_of_Fluid_flow.ipynb @@ -0,0 +1,461 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Thermodynamics of Fluid flow" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.10: Pressure_and_velocity_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"R=53.35\n", +"v=300 //ft/s\n", +"p=100 //psia\n", +"t1=200 //F\n", +"q=500 //Btu/s\n", +"gc=32.2 //ft/s^2\n", +"J=778\n", +"//calculations\n", +"rho1=p*144/(R*(460+t1))\n", +"x=poly(0,'x')\n", +"s=x^2 -0.206*x+0.00535\n", +"vec=roots(s)\n", +"rho2=vec(1)\n", +"t2=(236.6 - 0.301/rho2^2)/0.248\n", +"P2=rho2*R*(t2+462) /144\n", +"v2=sqrt(2*gc*J*(236.6-0.248*t2))\n", +"v22=rho1*v/rho2\n", +"//results\n", +"printf('Final temperature = %.1f F',t2)\n", +"printf('\n Final pressure = %.1f psia',P2)\n", +"printf('\n Exit velocity in case 1 = %.1f ft/s',v2)\n", +"printf('\n Exit velocity in case 2 = %.1f ft/s',v22)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: Reynolds_Number.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"d=2.067 //in\n", +"P=20 //psia\n", +"R=53.35 \n", +"T=600 //R\n", +"mu=0.0486 //lb /ft.hr\n", +"v=50 //ft/s\n", +"//calculations\n", +"rho=P*144/(R*T)\n", +"Re=d*v*rho*3600/(12*mu)\n", +"//results\n", +"printf('Reynolds number = %d ',Re)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2: Pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"eps=0.00015 \n", +"D=2.067/12 //ft\n", +"l=100 //ft\n", +"P=20 //psia\n", +"R=53.35 \n", +"T=600 //R\n", +"mu=0.0486 //lb /ft.hr\n", +"v=50 //ft/s\n", +"g=32.17 //ft/s^2\n", +"//calculations\n", +"rho=P*144/(R*T)\n", +"Re=D*v*rho*3600/(mu)\n", +"ed=eps/D\n", +"disp('From figure 11.5')\n", +"f=0.0235\n", +"dp=f*l*rho*v^2 /(2*D*g) /144\n", +"change=dp/P *100\n", +"//results\n", +"printf('Change in pressure = %.2f psi',dp)\n", +"printf('\n Percentage change in pressure = %.2f percent',change)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: Final_pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"v1=60 //ft/s\n", +"d1=10 //in\n", +"d2=15 //in\n", +"P=15 //psia\n", +"R=53.35\n", +"T=540 //R\n", +"g=32.17 //ft/s^2\n", +"v1=60 //ft/s\n", +"//calculations\n", +"v2=v1*d1^2 /d2^2\n", +"rho=P*144/(R*T)\n", +"dp=rho*(v2^2 -v1^2)/(2*g) /144\n", +"p2=P-dp\n", +"//results\n", +"printf('Final pressure = %.3f psia',p2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: Change_in_Entropy.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"J=778 //ft.lb/Btu\n", +"D=2.067/12 //ft\n", +"l=100 //ft\n", +"P=20 //psia\n", +"R=53.35 \n", +"T=600 //R\n", +"mu=0.0486 //lb /ft.hr\n", +"v=50 //ft/s\n", +"g=32.17 //ft/s^2\n", +"//calculations\n", +"f=0.0235\n", +"ds=f*v^2 *l /(J*2*D*g*T)\n", +"//results\n", +"printf('Change in entropy = %.6f Btu/lbm R',ds)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5: Enthalpy_and_entropy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"v=210 //ft/s\n", +"g=32.17 //ft/s^2\n", +"p=200 //psia\n", +"z=5 //ft\n", +"x=2.361\n", +"h=1210.3\n", +"J=778\n", +"//calculations\n", +"P0=p + v^2 /(2*g*144*x) + z/(144*x)\n", +"h0=h + v^2 /(2*J*g) +z/J\n", +"S=1.5594 //units/lb\n", +"S0=S\n", +"t0=401.9 //F\n", +"v0=2.342 //cu ft/lb\n", +"rho0=1/v0\n", +"//results\n", +"printf('Pressure = %d psia',P0)\n", +"printf('\n Enthalpy = %.2f Btu/lb',h0)\n", +"printf('\n Entropy = %.4f units/lb',S0)\n", +"printf('\n Temperature = %.1f F',t0)\n", +"printf('\n Density = %.3f lb/cu ft',rho0)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: Temperature_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=40 //psia\n", +"t1=80 //F\n", +"p2=30 //psia\n", +"ar=0.5 //sq ft\n", +"v1=200 //ft/s\n", +"R=53.35\n", +"cp=0.24\n", +"g=32.17\n", +"J=778\n", +"//calculations\n", +"rho1=144*p1/(R*(t1+460))\n", +"G=rho1*v1\n", +"h10= cp*t1 + p1^2 /(2*g*rho1^2 *J)\n", +"t2=78 //F\n", +"h2=cp*t2\n", +"g2=h10-h2\n", +"rho2=sqrt(p1^2 /(2*g*g2*J))\n", +"P2=rho2*R*(t2+460)/144 \n", +"ds2=cp*log((t2+460)/(t1+460)) - R/J *log(P2/p1)\n", +"t3=77 //F\n", +"h3=cp*t3\n", +"g3=h10-h3\n", +"rho3=sqrt(p1^2 /(2*g*g3*J))\n", +"P3=rho3*R*(t3+460)/144 \n", +"ds3=cp*log((t3+460)/(t1+460)) - R/J *log(P3/p1)\n", +"t4=79 //F\n", +"h4=cp*t4\n", +"g4=h10-h4\n", +"rho4=sqrt(p1^2 /(2*g*g4*J))\n", +"P4=rho4*R*(t4+460)/144 \n", +"ds4=cp*log((t4+460)/(t1+460)) - R/J *log(P4/p1)\n", +"h5=18.62\n", +"t5=h5/cp\n", +"Gv=[h4 h2 h3]\n", +"Pv=[P4 P2 P3]\n", +"Sv=[ds4 ds2 ds3]\n", +"scf(1)\n", +"xtitle('Fanno line diagram , Enthalpy vs Entropy','Entropy','Enthalpy Btu/lb')\n", +"plot(Sv,Gv)\n", +"scf(2)\n", +"xtitle('Fanno line diagram , Pressure vs Entropy','Entropy','Pressure psia')\n", +"plot(Sv,Pv)\n", +"//results\n", +"printf('Temperature at exit = %.1f F',t5)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7: Velocity_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=40 //psia\n", +"t1=80 //F\n", +"p2=30 //psia\n", +"ar=0.5 //sq ft\n", +"v1=200 //ft/s\n", +"R=53.35\n", +"cp=0.24\n", +"g=32.17\n", +"J=778\n", +"t2=78 //F\n", +"//calculations\n", +"G=40 //lb/sq ft/sec\n", +"rho2=144*p2/(R*(t2+460))\n", +"v2=p1/rho2\n", +"//results\n", +"printf('Velocity = %d ft/s',v2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8: velocity_and_density_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"P2=[180 160 140 120 100 80 60 40 20]\n", +"k=1.4\n", +"p1=200 //psia\n", +"t1=240+460 //R\n", +"cp=0.24\n", +"J=778\n", +"gc=32.2\n", +"R=53.35\n", +"m=4 //lb/sec\n", +"//calculations\n", +"pr=p1./ P2\n", +"prr=pr^((k-1)/k)\n", +"T2=t1 ./prr\n", +"dt=t1 -T2\n", +"dh=dt*cp\n", +"v2=sqrt(2*gc*J*dh)\n", +"vol=(R*T2) ./(P2*144)\n", +"A2=m*vol*144 ./v2\n", +"dia=sqrt(4/ %pi *A2)\n", +"rad=dia/2\n", +"den=1 ./vol\n", +"scf(1)\n", +"xtitle ('Velocity vs pressure','Pressure in psia','velocity in ft/s')\n", +"plot(P2,v2)\n", +"scf(2)\n", +"xtitle('specific volume vs pressure','Pressure in psia','specific volume in cu ft/lb')\n", +"plot(P2,vol)\n", +"scf(3)\n", +"xtitle('Radius vs Pressure' ,'Pressure in psia','Radius in in')\n", +"plot(P2,rad)\n", +"//results\n", +"disp('Velocity in ft/s')\n", +"disp(v2)\n", +"disp('Specific volume in cu ft/lb')\n", +"disp(vol)\n", +"disp('Density in lb/cu ft')\n", +"disp(den)\n", +"disp('Diameter of nozzle in in')\n", +"disp(dia)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9: Exit_area_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=200 //psia\n", +"t1=480 //F\n", +"eff=0.95\n", +"g=32.2 //ft/s^2\n", +"J=778\n", +"mf=3.4 //lb/s\n", +"//calculations\n", +"disp('From steam tables,')\n", +"h1=1257.8 \n", +"h2=1210.5 \n", +"dh=eff*(h1-h2)\n", +"ve=sqrt(2*g*J*dh)\n", +"h3=h1-dh\n", +"vs=3.961\n", +"Ae=mf*vs/ve *144\n", +"//results\n", +"printf('Nozzle exit area = %.3f sq.in',Ae)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/12-Heat_Transfer.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/12-Heat_Transfer.ipynb new file mode 100644 index 0000000..412a303 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/12-Heat_Transfer.ipynb @@ -0,0 +1,477 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Heat Transfer" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.10: Heat_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"Do=2.375 //in\n", +"hi=1200\n", +"Di=2.067 //in\n", +"km=29.2\n", +"h0=1500\n", +"L=2.375 //in\n", +"t1=220 //F\n", +"t4=140 //F\n", +"//calculations\n", +"U0= 1/(Do/(Di*hi) + (Do/12 *log(Do/Di) /(2*km)) + 1/h0)\n", +"Q=U0*L*%pi*(t1-t4)/12\n", +"//results\n", +"printf('Heat transferred per foot length of pipe = %d btu/hr',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.11: Temperature_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"Do=2.375 //in\n", +"hi=1200\n", +"Di=2.067 //in\n", +"km=29.2\n", +"h0=1500\n", +"L=2.375 //in\n", +"t1=220 //F\n", +"t4=140 //F\n", +"//calculations\n", +"Re=Do/(Di*hi)\n", +"R0=Do/(Di*hi) + (Do/12 *log(Do/Di) /(2*km)) + 1/h0\n", +"td=Re/R0 *(t1-t4)\n", +"ti=t4+td\n", +"Req=1/h0\n", +"td2=Req/R0 *(t1-t4)\n", +"to=t1-td2\n", +"//results\n", +"printf('The temperature of the inner surface of pipe = %.1f F',ti)\n", +"printf('\n The temperature of the outer surface of pipe = %.1f F',to)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.12: LMTD_Calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"th1=800 //F\n", +"th2=300 //F\n", +"tc1=100 //F\n", +"tc2=400 //F\n", +"//calculations\n", +"lmtd= ((th1-tc2) - (th2-tc1) )/(log((th1-tc2)/(th2-tc1)))\n", +"//results\n", +"printf('Logarithmic Mean temperature difference = %d F',lmtd)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13: True_MTD_Calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"th1=200 //F\n", +"th2=100 //F\n", +"tc1=80 //F\n", +"tc2=110 //F\n", +"//calculations\n", +"disp('From the lmtd graph,')\n", +"R=(tc1-tc2)/(th2-th1)\n", +"P=(th2-th1)/(tc1-th1)\n", +"F=0.62\n", +"lmtd= F* ((th1-tc2) - (th2-tc1) )/(log((th1-tc2)/(th2-tc1)))\n", +"//results\n", +"printf('True Mean temperature difference = %.1f F',lmtd)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1: Temperature_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"km1=0.62\n", +"km2=0.16\n", +"km3=0.4\n", +"l1=8 //in\n", +"l2=4 //in\n", +"l3=4 //in\n", +"Tf=1600 //F\n", +"Tc=100 //F\n", +"//calculations\n", +"Rw=l1/12/km1 +l2/12/km2 +l3/12/km3\n", +"Rb=l1/12/km1\n", +"Ti=Tf-Rb/Rw *(Tf-Tc)\n", +"//results\n", +"printf('Interface temperature = %.1f F',Ti)\n", +"disp('The answers might differ a bit from textbook due to rounding off error.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: Heat_flow_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"th=350 //F\n", +"tc=150 //F\n", +"od1=4.5\n", +"id1=4.026\n", +"od2=6.5\n", +"id2=4.5\n", +"k1=32\n", +"k2=0.042\n", +"//calculations\n", +"Q=2*%pi*(th-tc)/(log(od1/id1) /k1 + log(od2/id2) /k2)\n", +"r1=log(od1/id1) /k1\n", +"rt=log(od1/id1) /k1 + log(od2/id2) /k2\n", +"ti=th-r1/rt*(th-tc)\n", +"//results\n", +"printf('Heat flow = %.1f Btu/hr',Q)\n", +"printf('\n Interface temperature = %.2f F',ti)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: Energy_exchange_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"Fa=0.045\n", +"l=4 //m\n", +"b=4 //m\n", +"Fe=1\n", +"Ta=540+460 //R\n", +"Tb=1540+460 //R\n", +"//calculations\n", +"A=l*b\n", +"Q=0.173*A*Fa*Fe*((Tb/100)^4 -(Ta/100)^4)\n", +"Q2=416000\n", +"//results\n", +"printf('In case 1, Net energy exchange = %d Btu/hr',Q)\n", +"printf('\n In case 2, Net energy exchange = %d Btu/hr',Q2)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: Energy_Exchange_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"ea=0.8\n", +"eb=0.7\n", +"Fa=0.045\n", +"l=4 //m\n", +"b=4 //m\n", +"Fe=1\n", +"Ta=540+460 //R\n", +"Tb=1540+460 //R\n", +"//calculations\n", +"A=l*b\n", +"ef=ea*eb\n", +"Q=0.173*A*Fa*Fe*ef*((Tb/100)^4 -(Ta/100)^4)\n", +"//results\n", +"printf('Net energy exchange = %d Btu/hr',Q)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: Inside_film_coefficient_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"den=61.995 //lb/cu ft\n", +"vel=6 //ft/s\n", +"t1=100 //F\n", +"t2=160 //F\n", +"de=2.067 //in\n", +"mu=1.238\n", +"pr=3.3\n", +"//calculations\n", +"G=den*vel*3600\n", +"tm=(t1+t2)/2\n", +"hc=0.023*0.377/(de/12) *(de/12 *G/mu)^0.8 *(pr)^0.4\n", +"//results\n", +"printf('Inside film coefficient = %d Btu/sq ft hr F',hc)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6: Inside_film_coefficient_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"d=0.5 //in\n", +"tm=1000 //F\n", +"v=5//ft/s\n", +"k=38.2\n", +"den=51.2\n", +"mu=0.3\n", +"//calculations\n", +"Nu=7+ 0.025*(d/12 *v*den*mu/k*3600)^0.8\n", +"h=Nu*k/(d/12)\n", +"//results\n", +"printf('Inside film coefficient = %d Btu/sq ft hr F',h)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.7: convective_film_coefficient_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variablesdo=2 //in\n", +"tf=120 //F\n", +"ti=80 //F\n", +"rho=0.0709\n", +"g=32.17\n", +"bet=1/560\n", +"cp=0.24\n", +"mu=0.0461\n", +"k=0.0157\n", +"d=2 //in\n", +"Cd=0.45\n", +"//calculations\n", +"GrPr=(d/12)^3 *rho^2 *g*3600^2 *bet*(tf-ti)*cp/(mu*k)\n", +"hc=Cd*k/(d/12)^(1/4) *GrPr^(1/4)\n", +"//results\n", +"printf('Convective film coefficient = %.3f Btu/sq ft hr F',hc)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8: Outer_film_coefficient_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"tf=220 //F\n", +"ti=200 //F\n", +"d=2 //in\n", +"C=103.7\n", +"k=0.394\n", +"rho=59.37\n", +"hfg=965.2\n", +"mu=0.70\n", +"//calculations\n", +"h=C*(k^3 *rho^2 *hfg/((d/12) *mu*(tf-ti)))^(1/4)\n", +"//results\n", +"printf('Outer film coefficient = %d Btu/sq ft hr F',h)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9: Boiling_film_coefficient_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"tf=225 //F\n", +"a=190\n", +"b=0.043\n", +"ti=212 //F\n", +"//calculations\n", +"hc=a/(1-b*(tf-ti))\n", +"hcti=hc*1.25\n", +"//results\n", +"printf('For a flat copper plate, boiling film coefficient = %.1f Btu/sq ft hr F',hc)\n", +"printf('\n For an inclined copper plate, boiling film coefficient = %d Btu/sq ft hr F',hcti)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/13-Non_reactive_and_reactive_gaseous_mixtures.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/13-Non_reactive_and_reactive_gaseous_mixtures.ipynb new file mode 100644 index 0000000..54eb380 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/13-Non_reactive_and_reactive_gaseous_mixtures.ipynb @@ -0,0 +1,518 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Non reactive and reactive gaseous mixtures" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.10: volumetric_analysis.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"A=[1 1; 0.5 1]\n", +"B=[1; 0.9]\n", +"x=0.9\n", +"//calculations\n", +"N2=x*79/21\n", +"C=A\B\n", +"vec= [ C(1) C(2) N2]\n", +"su=sum(vec)\n", +"vec2=vec/su *100\n", +"//results\n", +"printf('Volumetric analysis')\n", +"disp('CO CO2 N2')\n", +"disp(vec2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.11: Moles_of_dry_products_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"c=0.74\n", +"ref=0.02\n", +"co2=0.12\n", +"co=0.1/100\n", +"M=12\n", +"//calcualtions\n", +"carbon=c-ref\n", +"car2=co2+co\n", +"wt=car2*M\n", +"amount=carbon/wt\n", +"//results\n", +"printf('Moles of dry products per pound of coal = %.3f mole',amount)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.12: Moles_of_dry_products_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x1=0.128\n", +"x2=0.035\n", +"x3=0.002\n", +"M=12\n", +"N=26\n", +"//calculations\n", +"c=x1+x3\n", +"mole=12/c\n", +"wt=M*M+N\n", +"num=mole/wt\n", +"//results\n", +"printf('Number of moles of dry products per pound of fuel = %.3f mole',num)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.13: Weight_of_dry_air_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"c=0.74\n", +"ref=0.02\n", +"co2=0.12\n", +"co=0.1/100\n", +"o2=0.065\n", +"M=12\n", +"x=0.79\n", +"M=28.97\n", +"//calcualtions\n", +"n2=1-(co2+co+o2)\n", +"mol=n2/x\n", +"wt=mol*M\n", +"wt2=0.496\n", +"pou=wt2*wt\n", +"ta=10.27\n", +"EA=(pou-ta)/ta *100\n", +"//results\n", +"printf('Weight of air per pound of fuel = %.2f lb',pou)\n", +"printf('\n Excess air percentage = %.1f percent',EA)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1: Mass_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"P=70 //psia\n", +"Pt=110 //psia\n", +"V=20 //cu ft\n", +"R0=1545 //Universal gas constant\n", +"T=540 //R\n", +"M=32 //Molecular weight of Oxygen\n", +"M2=28 //Molecular weight of Nitrgoen\n", +"//calculations\n", +"N=P*V*144/(R0*T)\n", +"mo=M*N\n", +"Pn=Pt-P\n", +"N2=Pn*V*144/(R0*T)\n", +"mn=N2*M2\n", +"Vo=N*R0*T/(144*Pt)\n", +"Vn=N2*R0*T/(144*Pt)\n", +"Vn2=V-Vo\n", +"//results\n", +"printf('Mass of oxygen = %.2f lb',mo)\n", +"printf('\n Mass of nitrogen = %.2f lb',mn)\n", +"printf('\n Partial volume of oxygen = %.2f cu ft',Vo)\n", +"printf('\n Partial volume of nitrogen = %.2f cu ft',Vn)\n", +"printf('\n In case 2, Partial volume of nitrogen = %.2f cu ft',Vn2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: Change_in_Entropy_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"P=50 //psia\n", +"V=4 //cu ft\n", +"dv=3 //cu ft\n", +"J=778\n", +"T=560 //R\n", +"//calculation\n", +"ds= 144*P*V*log((V+dv)/V) /(J*T)\n", +"//results\n", +"printf('Change in entropy = %.3f unit',ds)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3: Change_in_Entropy_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=50 //psia\n", +"t1=100+460 //R\n", +"R1=48.3\n", +"R2=55.2\n", +"v1=4 //cu ft\n", +"p2=100 //psia\n", +"v2=3 //cu ft\n", +"t2=200+460 //R\n", +"cv1=0.157\n", +"cv2=0.177\n", +"cpm=0.219\n", +"J=778\n", +"//calculations\n", +"m1=144*p1*v1/(R1*t1)\n", +"m2=144*p2*v2/(R2*t2)\n", +"tf=(m1*cv1*(t1-460) + m2*cv2*(t2-460))/(m1*cv1+m2*cv2)\n", +"Po2=v1/(v1+v2) *(tf+460)/t1 *p1\n", +"ds=cpm*log((tf+460)/t1) - R1/J *log(Po2/p1)\n", +"dss=ds*m1\n", +"//results\n", +"printf('Change in entropy = %.4f unit',dss)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4: Change_in_Entropy_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"p1=30 //psia\n", +"t1=80+460 //R\n", +"R1=48.3\n", +"R2=55.2\n", +"m1=20 //lb/min\n", +"p2=50 //psia\n", +"m2=35 //lb/min\n", +"t2=160+460 //R\n", +"cp1=0.219\n", +"cp2=0.248\n", +"J=778\n", +"//calculations\n", +"tf=(m1*cp1*(t1-460) + m2*cp2*(t2-460))/(m1*cp1+m2*cp2)\n", +"Po2=m1/32/(m1/32+m2/28) *p1\n", +"ds=cp1*log((tf+460)/t1) - R1/J *log(Po2/p1)\n", +"dss=ds*m1\n", +"//results\n", +"printf('Change in entropy = %.4f units/min',dss)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5: Weight_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x=[0.15 0.08 0.77]\n", +"M=[44 32 28]\n", +"//calculations\n", +"y=x ./M\n", +"yt=sum(y)\n", +"mt=y/yt\n", +"per=mt*100\n", +"wt=1/yt\n", +"R=1545/wt\n", +"//results\n", +"printf('Volumetric analysis')\n", +"disp('percent by volume')\n", +"format('v',6);per\n", +"disp(per)\n", +"printf('Weight per mole = %.1f lb',wt)\n", +"printf('\n Gas constant = %.1f ',R)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6: Dry_analysis_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x1=0.885 //mole fraction of Ch4\n", +"x2=0.115 //mole fraction of c2h6\n", +"x3=0.4/100 //mole fraction of N2\n", +"n1=2 //Moles of Ch4\n", +"n2=3.5 //Moles of c2h6\n", +"n3=1 //moles of ch4 in case 2\n", +"n4=2 //moles of c2h6 in case 2\n", +"//calculations\n", +"y1=n1*x1\n", +"y2=n2*x2\n", +"y=y1+y2\n", +"vec2=[y1 y2]\n", +"air=y/0.21\n", +"y3=n3*x1\n", +"y4=n4*x2\n", +"yy=y3+y4\n", +"vec3=[y3 y4]\n", +"air2=y/0.21 *0.79\n", +"//results\n", +"printf('Theoretical air = %.2f moles of air per mole of fuel',air)\n", +"disp('Oxygen analysis')\n", +"disp(vec2)\n", +"printf('\n Amount of nitrogen = %.2f moles of nitrogen per mole of fuel',air2)\n", +"disp('Dry analysis')\n", +"disp(vec3)\n", +"printf('total = %.3f moles',yy)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.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", +"x=[0.74 0.06 0.01] //mole fraction of C, H and S respectively\n", +"y=[8/3 8 1] //Pounds O2 per pound substance of C,H and S respectively\n", +"oxy=0.08 //Oxygen in coal\n", +"z=0.232 //mass of coal\n", +"//calculations\n", +"pou=x.*y\n", +"tot=sum(pou)\n", +"oxy2=tot-oxy\n", +"air=oxy2/z\n", +"//results\n", +"printf('Theoretical air fuel ratio = %.2f lb of air per pound of coal',air)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.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", +"o2=12.5 //moles of O2\n", +"h20=9 //moles of H2O\n", +"x=0.21 //Mole fraction of Oxygen in air\n", +"M=28.97 //Molar mass of air\n", +"M2=56 //molar mass of C4H8\n", +"M1=8*12+18 //molecular mass of c8h18\n", +"//calculations\n", +"air=o2/x\n", +"pound=air*M\n", +"AR=pound/M1\n", +"y1=h20/M2 *100\n", +"y2=o2*(79/21) /M2 *100\n", +"//results\n", +"printf('Air fuel ratio = %.2f lb of air per pound of fuel',AR)\n", +"printf('\n Molal or volumetric analysis is %.2f percent of CO2 and %.2f percent N2',y1,y2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.9: volumetric_analysis.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"x=18.5 //Moles of O2\n", +"c=12 //Moles of CO2\n", +"vap=13 //moles of H2O\n", +"P=15 //psia\n", +"R=1545 //Universal gas constant\n", +"//calculations\n", +"excess=x*0.5\n", +"M=12*12+2*vap\n", +"n2=(x+excess)*79/21\n", +"nt=n2+excess+c\n", +"dry=[c x/2 n2]/nt *100\n", +"wet=nt+vap\n", +"fue=100/(M)\n", +"mol=wet*fue\n", +"vol=mol*R*1460/(144*P)\n", +"//results\n", +"disp('Volumetric analysis in percentage')\n", +"disp(' CO2 O2 N2')\n", +"disp(dry)\n", +"printf('Volume of wet products = %d cfm',vol)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/14-Energies_associated_with_chemical_reactions.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/14-Energies_associated_with_chemical_reactions.ipynb new file mode 100644 index 0000000..006509e --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/14-Energies_associated_with_chemical_reactions.ipynb @@ -0,0 +1,329 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Energies associated with chemical reactions" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1: Heating_value_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"lhs=8.5 //moles of reactants\n", +"rhs=6 //moles of CO2\n", +"n=3 //moles of H2O\n", +"R=1545 //Universal gas constant\n", +"R2=18.016 //molar mass of water\n", +"J=778 //Work conversion constant\n", +"T=537 //R\n", +"T2=1050.4 //R\n", +"T3=991.3 //R\n", +"Qhp=1417041 //Btu/mol\n", +"//calculations\n", +"Qhpv=(lhs-rhs)*R*T/J\n", +"Qhv=Qhp-Qhpv\n", +"hfg=(rhs-n)*R2*T2\n", +"Qlp=Qhp-hfg\n", +"Qlpv=(lhs-rhs-n)*R/J *T\n", +"Qlv=Qlp-Qlpv\n", +"Qhlv=(rhs-n)*R2*T3\n", +"Qlv3=Qhv-Qhlv\n", +"//results\n", +"printf('Higher heating value at constant volume = %d Btu/mol',Qhv)\n", +"printf('\n Lower heating value at constant pressure = %d Btu/mol',Qlp)\n", +"printf('\n In case 1,Lower heating value at constant volume = %d Btu/mol',Qlv)\n", +"printf('\n In case 2,Lower heating value at constant volume = %d Btu/mol',Qlv3)\n", +"disp('The answers might differ a bit from textbook due to rounding off error.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: Heating_value_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"disp('From table 5-4,')\n", +"no=7.5\n", +"n1=3\n", +"n2=6\n", +"Q=1360805 //Btu/mol\n", +"//calculations\n", +"Uo=337+no*85\n", +"Uf=n1*104+n2*118\n", +"del= Q-(Uo-Uf)\n", +"Uo2=1656+no*402\n", +"Uf2=n1*490+n2*570\n", +"Qv=Uo2-Uf2+del\n", +"//results\n", +"printf('Change in chemical energy during complete combustion = %d Btu/mol',del)\n", +"printf('\n Lower heating value at constant volume = %d Btu/mol',Qv)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: Heat_removed_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"disp('From table 5-4,')\n", +"a=1 //moles of C6H6\n", +"b=7.5 //moles of O2 in reactant\n", +"c=1.875 //moles of excess O2\n", +"d=35.27 //moles of N2\n", +"e=3 //moles of H2O\n", +"flow=40 //lb/min\n", +"w=1360850 //Btu/mol\n", +"//calculations\n", +"U11=a*337\n", +"U12=(b+c)*85\n", +"U13=d*82\n", +"U14=(a+b+c+d)*1066\n", +"Ua1=U11+U12+U13+U14\n", +"U21=c*2539\n", +"U22=d*2416\n", +"U23=e*3009\n", +"U24=2*e*3852\n", +"U25=(c+d+e+2*e)*1985\n", +"Ua2=U21+U22+U23+U24+U25\n", +"Q=Ua1+w-Ua2\n", +"fuel=flow/(6*12+2*e)\n", +"Q2=Q*fuel\n", +"//results\n", +"printf('Heat removed = %d Btu/min',Q2)\n", +"disp('The answers might differ a bit from textbook due to rounding off error.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: Furnace_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rate=10700 //lb/min\n", +"t2=97.90 \n", +"t1=33.05 \n", +"r1=46 //lb/min\n", +"//calculations\n", +"disp('From steam tables,')\n", +"Hv=1417041\n", +"Qw=rate*(t2-t1)\n", +"Q=r1/(12*6+6) *Hv\n", +"eff=Qw/Q*100\n", +"//results\n", +"printf('Furnace efficiency = %.1f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: Thermal_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rate=94 //lb/hr\n", +"hp=197 //hp\n", +"c=8\n", +"h=18\n", +"Lv=17730 //Btu/hr\n", +"H=2368089 //Btu/hr\n", +"//calculations\n", +"amount=rate*c/12 +h\n", +"amount=0.824\n", +"Lvv=H-Lv\n", +"eff=hp*2544/(amount*Lvv) *100\n", +"//results\n", +"printf('Thermal efficiency = %.2f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6: Thermal_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rate=94 //lb/hr\n", +"hp=197 //hp\n", +"c=8\n", +"h=18\n", +"mole=9\n", +"H=2350359 //Btu/hr\n", +"//calculations\n", +"amount=rate*c/12 +h\n", +"amount=0.824\n", +"Lvv=H-mole*18.016*1050.4\n", +"eff=hp*2544/(amount*Lvv) *100\n", +"//results\n", +"printf('Thermal efficiency = %.2f percent',eff)\n", +"disp('The answer in the textbook is a different due to rounding off error')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.7: Total_available_energy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"hv=14000 //Btu/lb\n", +"ef=0.4\n", +"tmin=80 //F\n", +"tmid=300 //F\n", +"m=13 //lb\n", +"c=0.27\n", +"tmean=2300 //F\n", +"//calculations\n", +"heat=ef*hv\n", +"Qavail=heat*(tmean-tmin)/(tmean+460)\n", +"Q=m*c*(tmean-tmid)\n", +"Q2=Q- (tmin+460)*m*c*log((tmean+460)/(tmid+460))\n", +"tot=Qavail+Q2\n", +"//results\n", +"printf('Total available energy = %d Btu/lb of fuel',tot)\n", +"disp('The answer is a bit different due to rounding off error in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.8: Max_amount_of_work_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"disp('From table 14-2,')\n", +"G1=55750 //Btu/mol\n", +"co2=-169580 //Btu/mol\n", +"h2o=-98290 //Btu/mol\n", +"//calculations\n", +"G2=6*co2+3*h2o\n", +"avail=G1-G2\n", +"//results\n", +"printf('Max. amount of work = %d Btu/mol',avail)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/15-Thermodynamics_of_chemical_reactions.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/15-Thermodynamics_of_chemical_reactions.ipynb new file mode 100644 index 0000000..c741824 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/15-Thermodynamics_of_chemical_reactions.ipynb @@ -0,0 +1,137 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15: Thermodynamics of chemical reactions" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.1: Dissociation_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"kp=10^(1.45)\n", +"//calculations\n", +"x=poly(0,'x')\n", +"s=(1-x)^2 *(2+x) -kp^2 *x^(3)\n", +"vec=roots(s)\n", +"X=vec(3)\n", +"xper=X*100\n", +"//results\n", +"printf('Amount of dissociaton = %.1f percent',xper)\n", +"printf('\n Of each original mole of CO2, there will be %.3f mole of CO , %.3f mol of Oxygen and %.3f mol of CO2',X,X/2,(1-X))" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.2: Max_temperature_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"U=121200 //Btu/mol\n", +"Uco2=51635 //Btu/mol\n", +"Un2=27589 //Btu/mol\n", +"Uco22=57875 //Btu/mol\n", +"Un22=21036 //Btu/mol\n", +"T1=5000 //R\n", +"T2=5500 //R\n", +"//calculations\n", +"Ut1=Uco2+1.88*Un2\n", +"Ut2=Uco22 + 1.88*Un22\n", +"disp('By extrapolation,')\n", +"Tx=5710 //R\n", +"//results\n", +"printf('Max. Temperature reached = %d R',Tx)\n", +"disp('The calculation for Ut2 is wrong in textbook. Please use a calculator.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.3: Max_temperature_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"disp('By trial and error,')\n", +"X=0.201\n", +"X1=0.2\n", +"R=59.3 //universal gas constant\n", +"T=5000 //R\n", +"U=121200 //Btu/mol\n", +"Uco2=51635 //Btu/mol\n", +"Un2=27907 //Btu/mol\n", +"U3=29616 //Btu/mol\n", +"U4=27589 //Btu/mol\n", +"//calculations\n", +"kp1=R*(1-X1)/X1^1.5 /T^0.5\n", +"kp2=R*(1-X)/X^1.5 /T^0.5\n", +"q=(1-X)*Uco2 + X*Un2+ X/2 *U3 +1.88*U4 + X*U\n", +"disp('Interpolating between T=4500 R and T=5000 R, we get')\n", +"T2=4907 //R\n", +"//results\n", +"printf('Max. obtainable temperature = %d R',T2)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/16-Gas_cycles.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/16-Gas_cycles.ipynb new file mode 100644 index 0000000..bb7a4c4 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/16-Gas_cycles.ipynb @@ -0,0 +1,211 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Gas cycles" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1: Temperature_and_pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"cr=9\n", +"p1=14 //psia\n", +"t1=80+460 //R\n", +"n=1.4\n", +"heat=800 //Btu\n", +"c=0.1715\n", +"R=53.35\n", +"J=778\n", +"//calculations\n", +"p2=p1*(cr)^n\n", +"t2=t1*cr^(n-1)\n", +"t3=heat/c +t2\n", +"p3=p2*t3/t2\n", +"eff=(1-1/cr^(n-1))*100\n", +"t4=t3/cr^(n-1)\n", +"Qr=c*(t4-t1)\n", +"cyclework=heat-Qr\n", +"eff2= cyclework/heat *100\n", +"V1=R*t1/(144*p1)\n", +"pd=(1-1/cr)*V1\n", +"mep=cyclework*J/(pd*144)\n", +"//results\n", +"printf('Max. temperature = %d R',t3)\n", +"printf('\n Max. pressure = %d psia',p3)\n", +"printf('\n In method 1,Thermal efficiency = %.1f percent',eff)\n", +"printf('\n In method 2,Thermal efficiency = %.1f percent',eff2)\n", +"printf('\n Mean effective pressure mep = %.1f psia',mep)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2: Temperature_and_pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"t1=80+460 //R\n", +"p1=14 //psia\n", +"n=1.4\n", +"cr=16\n", +"heat=800 //Btu\n", +"cp=0.24\n", +"c=0.1715\n", +"//calculations\n", +"t2=t1*cr^(n-1)\n", +"p2=p1*(cr)^n\n", +"t3=t2 +heat/cp\n", +"v32=t3/t2\n", +"v43=cr/v32\n", +"t4=t3/v43^(n-1)\n", +"Qr=c*(t4-t1)\n", +"etat=(heat-Qr)/heat *100\n", +"//results\n", +"printf('Max. Temperature = %d R',t3)\n", +"printf('\n Max. Pressure = %d psia',p2)\n", +"printf('\n Thermal efficiency = %.1f percent',etat)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3: mep_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"eff=0.585\n", +"heat=800 //Btu\n", +"t1=80+460 //R\n", +"p1=14 //psia\n", +"n=1.4\n", +"R=53.35\n", +"cr=9\n", +"cp=0.24\n", +"J=778\n", +"//calculations\n", +"W=eff*heat\n", +"v1=R*t1/(144*p1)\n", +"v2=v1/cr\n", +"t2=1301 //R\n", +"t3=t2+ heat/cp\n", +"v3=v2*t3/t2\n", +"v4=cr*v3\n", +"mep=W*J/(144*(v4-v2))\n", +"//results\n", +"printf('Mean effective pressure = %.1f psia',mep)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4: mep_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"eff=0.585\n", +"heat=500 //Btu\n", +"heat1=300 //Btu\n", +"t1=80+460 //R\n", +"p1=14 //psia\n", +"n=1.4\n", +"R=53.35\n", +"cr=9\n", +"J=778\n", +"c=0.1715\n", +"cp=0.24\n", +"t2=1301 //R\n", +"p2=308 //psia\n", +"//calculations\n", +"t3=t2+ heat/c\n", +"p3=p2*t3/t2\n", +"t4=t3+ heat1/cp\n", +"v43=t4/t3\n", +"v54=cr/v43\n", +"t5=t4/(v54)^(n-1)\n", +"Qr=c*(t5-t1)\n", +"etat=(heat+heat1-Qr)/(heat+heat1) *100\n", +"mep=(heat+heat1-Qr)*J/(12.69*144)\n", +"//results\n", +"printf('Max. Temperature = %d R',t4)\n", +"printf('\n Max. Pressure = %d psia',p3)\n", +"printf('\n Thermal efficiency = %.1f percent',etat)\n", +"printf('\n Mean effective pressure = %.1f psia',mep)\n", +"disp('The calculations are a bit different due to rounding off error in textbook')" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/17-Internal_combustion_engines.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/17-Internal_combustion_engines.ipynb new file mode 100644 index 0000000..a2e733e --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/17-Internal_combustion_engines.ipynb @@ -0,0 +1,114 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 17: Internal combustion engines" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.1: Indicated_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"hp1=2000 //bhp\n", +"m=792 //lb/hr\n", +"ex=0.5\n", +"hp2=210\n", +"hv=18900 //Btu/lb\n", +"etth=51.3\n", +"//calculations\n", +"ihp=hp1+hp2\n", +"ietat= ihp*2544/(m*hv) *100\n", +"betat=ietat*hp1/ihp\n", +"betat2=hp1*2544/(m*hv) *100\n", +"ietae=ietat/etth *100\n", +"betae=betat/etth *100\n", +"brake= ietae*hp1/ihp\n", +"//results\n", +"printf('Indicated efficiency = %.1f percent',ietat)\n", +"printf('\n Brake thermal efficiency = %.1f percent',betat)\n", +"printf('\n In case 2, Brake thermal efficiency = %.1f percent',betat2)\n", +"printf('\n Indicated thermal efficiency = %.1f percent',ietae)\n", +"printf('\n Brake engine efficiency = %.1f percent',betae)\n", +"printf('\n In case 2, Brake engine efficiency = %.1f percent',brake)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 17.2: Indicated_mep_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"J=778\n", +"o2=12.5\n", +"theo=0.95\n", +"N=56.5\n", +"R0=1545\n", +"T=540 //R\n", +"p=14 //psia\n", +"LHV=2368089 //Btu/lb\n", +"ther=39.4\n", +"iep=0.78\n", +"ve=0.8\n", +"//calculations\n", +"Ar=o2/0.21 *theo\n", +"vol=N*R0*T/(144*p)\n", +"hv=(LHV -17730)/LHV\n", +"ithep=iep*ther\n", +"pd=ithep/100 *ve *100.5\n", +"mep=J*pd\n", +"//results\n", +"printf('Indicated mep = %d lb/sq ft',mep)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/18-Gas_Compressors.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/18-Gas_Compressors.ipynb new file mode 100644 index 0000000..dc79078 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/18-Gas_Compressors.ipynb @@ -0,0 +1,279 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: Gas Compressors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1: Horsepower_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"q=200 //cfm\n", +"p2=90 //psia\n", +"p1=14.5 //psia\n", +"n=1.36\n", +"//calculations\n", +"hpp=n/(n-1) *144*p1*q/33000 *(1- (p2/p1))^((n-1)/n)\n", +"//results\n", +"printf('Theoretical horse power required = %.1f hp',hpp)\n", +"disp('The answer given in textbook is wrong. Please verify with a calculator')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.2: Horsepower_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"q=350 //cfm\n", +"eff=0.78\n", +"x=0.95\n", +"p2=120 //psia\n", +"p1=14.3 //psia\n", +"//calculations\n", +"cal=p1*144*q/550 *log(p2/p1) /100\n", +"ihp= cal/eff\n", +"shp=ihp/x\n", +"//results\n", +"printf('Indicated hp = %.1f hp',ihp)\n", +"printf('\n Shaft hp = %.1f hp',shp)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.3: Piston_displacement_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.35\n", +"p1=14.2\n", +"q=400 //cfm\n", +"p2=200 //psia\n", +"p1=14.2 //psia\n", +"ve=0.75\n", +"t1=530 //R\n", +"//calculations\n", +"thp=-n/(n-1) *144 *p1*q/33000 *(1- (p2/p1)^((n-1)/n))\n", +"pd=q/ve\n", +"Tmax=t1*(p2/p1)^((n-1)/n)\n", +"//results\n", +"printf('Theoretical hp = %.1f hp',thp)\n", +"printf('\n Piston displacement = %d cfm',pd)\n", +"printf('\n Max. Temperature = %d R',Tmax)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.4: Piston_displacement_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.35\n", +"p1=14.2 //psia\n", +"p3=200 //psia\n", +"q=400 //cfm\n", +"ve=0.78\n", +"t1=530 //R\n", +"//calculations\n", +"p2=sqrt(p3*p1) //psia\n", +"thp=-2*n/(n-1) *144 *p1*q/33000 *(1- (p2/p1)^((n-1)/n))\n", +"pd=q/ve\n", +"pd2=q*p1/p2 /ve\n", +"Tmax=t1*(p2/p1)^((n-1)/n)\n", +"//results\n", +"printf('Theoretical hp = %.1f hp',thp)\n", +"printf('\n For low pressure case, Piston displacement = %.1f cfm',pd)\n", +"printf('\n For high pressure case, Piston displacement = %.1f cfm',pd2)\n", +"printf('\n Max. Temperature = %.1f R',Tmax)\n", +"disp('The answers are a bit different due to rounding off error')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.5: Pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"dia=2 //ft\n", +"rpm=6000 //rpm\n", +"p=14.2 //psia\n", +"t=75 //F\n", +"g=32.17\n", +"n=1.4\n", +"R=53.35\n", +"//calculations\n", +"v=2*%pi*rpm/60\n", +"wbym=v^2 /g\n", +"T=t+460\n", +"pr=1+ wbym*(n-1)/n /(R*T) \n", +"pr2=pr^(n/(n-1))\n", +"p2=pr2*p\n", +"//results\n", +"printf('Theoretical pressure at exit = %.1f psia',p2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.6: Pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pa=14.7 //psia\n", +"p1=12 //psia\n", +"t1=560 //R\n", +"n=1.4 //gamma\n", +"J=778 //constant conversion\n", +"g=32.2 //ft/s^2\n", +"cp=0.24 //heat capacity\n", +"eff=0.7 //efficiency\n", +"m1=1.8 \n", +"m3=1 \n", +"//calculations\n", +"t5=t1*(pa/p1)^((n-1)/n)\n", +"v4=sqrt(2*g*J*cp*(t5-t1)/eff) \n", +"v3=(m1+m3)/m1 *v4\n", +"//results\n", +"printf('Velocity of air = %.1f ft/s',v3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.7: Pressure_required.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"v2=1180 //ft/s\n", +"etan=0.95\n", +"cp=0.24\n", +"n=1.4\n", +"p2=12\n", +"//calculations\n", +"dh=v2^2 /(etan*223.8^2)\n", +"dt=dh/cp\n", +"t2d=560 //R\n", +"t1=t2d+ etan*dt\n", +"t2=554 //R\n", +"pr=(t1/t2)^(n/(n-1))\n", +"p1=p2*pr\n", +"//results\n", +"printf('Pressure required = %.2f psia',p1)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/19-Gas_turbines.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/19-Gas_turbines.ipynb new file mode 100644 index 0000000..bd042a0 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/19-Gas_turbines.ipynb @@ -0,0 +1,510 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 19: Gas turbines" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.10: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"cp=0.24\n", +"h=138.8\n", +"t3=1960 //R\n", +"//calculations\n", +"t4d=t3-h/cp\n", +"Qs=cp*(t3-t4d)\n", +"work=43.9 //Btu/lb\n", +"etat=work/Qs *100\n", +"//results\n", +"printf('Thermal efficiency of the unit = %.1f percent',etat)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.11: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.4\n", +"t1=540 //R\n", +"tmax=1500 //F\n", +"pr=5\n", +"cp=0.24\n", +"p1=14 //psia\n", +"p3=70 //psia\n", +"//calculations\n", +"pint=p1*sqrt(pr)\n", +"t2=t1*(pint/p1)^((n-1)/n)\n", +"t4=t1*(p3/pint)^((n-1)/n)\n", +"w=cp*(t4-t1)\n", +"w2=2*w\n", +"t6=(tmax+460)/(p3/pint)^((n-1)/n)\n", +"t8=(tmax+460)/(pint/p1)^((n-1)/n)\n", +"work=cp*(tmax+460-t6)\n", +"w22=2*work\n", +"net=w22-w2\n", +"Qa=cp*(tmax+460-t2)\n", +"Qb=cp*(tmax+460-t6)\n", +"Qt=Qa+Qb\n", +"eta=net/Qt*100\n", +"//results\n", +"printf('Thermal efficiency = %.2f percent',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.12: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.4\n", +"t1=540 //R\n", +"tmax=1500 //F\n", +"pr=5\n", +"cp=0.24\n", +"p1=14 //psia\n", +"p3=70 //psia\n", +"w2=75.9 //Btu/lb\n", +"Qa=265 //Btu/lb\n", +"//calculations\n", +"pint=p1*sqrt(pr)\n", +"t6=(tmax+460)/(p3/pint)^((n-1)/n)\n", +"t8=(tmax+460)/(pint/p1)^((n-1)/n)\n", +"work=cp*(tmax+460-t6)\n", +"w22=2*work\n", +"net=w22-w2\n", +"Qb=cp*(tmax+460-t6)\n", +"Qt=Qa+Qb\n", +"eta=net/Qt*100\n", +"//results\n", +"printf('Thermal efficiency = %.1f percent',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.13: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.4\n", +"t1=540 //R\n", +"tmax=1500 //F\n", +"pr=5\n", +"cp=0.24\n", +"t3=1558 //R\n", +"net=125.8 //Btu/lb\n", +"//calculations\n", +"Q=cp*(tmax+460-t3)\n", +"Qt=2*Q\n", +"eta=net/Qt*100\n", +"//results \n", +"printf('Thermal efficiency = %.1f percent',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.1: Efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"n=1.4\n", +"t1=540 //R\n", +"tmax=1200 //F\n", +"tmax2=1500 //F\n", +"pr=5\n", +"cp=0.24\n", +"//calculations\n", +"t2=t1*(pr)^((n-1)/n)\n", +"work=cp*(t2-t1)\n", +"t4=(tmax+460) /pr^((n-1)/n)\n", +"twork=cp*(tmax+460-t4)\n", +"net=twork-work\n", +"eff=1- 1/pr^((n-1)/n)\n", +"Qs=cp*(tmax+460-t2)\n", +"ett=net/Qs *100\n", +"t42=(tmax2+460)/pr^((n-1)/n)\n", +"twork2=cp*(tmax2+460-t42)\n", +"net2=twork2-work\n", +"Qs2=cp*(tmax2+460-t2)\n", +"eff3=net2/Qs2 *100\n", +"//results\n", +"printf('Compressor work = %.1f Btu/lb',work)\n", +"printf('\n Turbine work = %.1f Btu/lb',twork)\n", +"printf('\n Net work = %.1f Btu/lb',net)\n", +"printf('\n Thermal efficiency = %.1f percent',eff*100)\n", +"printf('\n In case 2, Thermal efficiency = %.1f percent',ett)\n", +"printf('\n In case 2, Turbine work = %.1f Btu/lb',twork2)\n", +"printf('\n In case 2, Net work = %.1f Btu/lb',net2)\n", +"printf('\n In case 3, Thermal efficiency = %.1f percent,',eff3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.2: Work_and_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"work=75.9 //Btu/lb\n", +"twork=173.5 //Btu/lb\n", +"eta=0.8\n", +"t2=856 //R\n", +"t1=540 //R\n", +"t4=1960 //R\n", +"cp=0.24\n", +"//calculations\n", +"cwork=work/eta\n", +"internal=twork*eta\n", +"net=-cwork+internal\n", +"t2d=(t2-t1)/eta + t1\n", +"Qs=cp*(t4-t2d)\n", +"eff=net/Qs *100\n", +"//results\n", +"printf('Indicated compressor work = %.1f Btu/lb',cwork)\n", +"printf('\n Internal work = %.1f Btu/lb',internal)\n", +"printf('\n Net work = %.1f Btu/lb',net)\n", +"printf('\n Thermal efficiency = %.2f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.3: Work_and_efficiency_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"eff=0.97\n", +"c1=94.9 //Btu/lb\n", +"c2=138.8 //Btu/lb\n", +"ntee=246 //Btu/lb\n", +"//calculations\n", +"cwork=c1/eff\n", +"twork=c2*eff\n", +"net=twork-cwork\n", +"etat=net/ntee *100\n", +"//results\n", +"printf('Compressor work = %.1f Btu/lb',cwork)\n", +"printf('\n Turbine work = %.1f Btu/lb',twork)\n", +"printf('\n Net work = %.1f Btu/lb',net)\n", +"printf('\n Thermal efficiency = %.1f percent',etat)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.4: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pr=5\n", +"p1=14 //psia\n", +"pd=3 //psi\n", +"pen=70 //psia\n", +"tin=1960 //R\n", +"n=1.4\n", +"cp=0.24\n", +"Qs=265 //Btu/lb\n", +"//calculations\n", +"p2=p1*pr\n", +"pe=pen-pd\n", +"prt=pe/p1\n", +"tex=tin/prt^((n-1)/n)\n", +"twork=cp*(tin-tex)\n", +"net=twork-75.9\n", +"eff=net/Qs *100\n", +"//results\n", +"printf('Thermal efficiency = %.1f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.5: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pr=5\n", +"p1=14 //psia\n", +"pd=3 //psi\n", +"pen=70 //psia\n", +"tin=1960 //R\n", +"n=1.4\n", +"cp=0.24\n", +"Qs=265\n", +"ef=0.95\n", +"//calculations\n", +"p2=p1*pr\n", +"pe=pen-pd\n", +"prt=pe/p1\n", +"tex=tin/prt^((n-1)/n)\n", +"twork=cp*(tin-tex)\n", +"net=twork-75.9\n", +"Qs2=Qs/ef\n", +"eff=net/Qs2 *100\n", +"//results\n", +"printf('Thermal efficiency = %.1f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.6: Pressure_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pr1=1.0590\n", +"pr2=4.396\n", +"p1=14 //psia\n", +"//calculations\n", +"prr=pr2/pr1\n", +"p2=p1*prr\n", +"//results\n", +"printf('Final pressure = %.1f psia',p2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.7: Compressor_work.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"t1=540 //R\n", +"h1=129.06\n", +"pr1=1.386\n", +"cr=5\n", +"//calculations\n", +"pr2=pr1*cr\n", +"disp('From air tables,')\n", +"h2=204.63\n", +"cwork=h2-h1\n", +"//results\n", +"printf('Compressor work = %.2f Btu/lb',cwork)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.8: Turbine_work.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"cr=5\n", +"pr3=176.73 //psia\n", +"h3=14580.3 //Btu/mol\n", +"M=28.9\n", +"//calculations\n", +"pr4=pr3/cr\n", +"h4=9409\n", +"twork=h3-h4\n", +"turb=twork/M\n", +"//results\n", +"printf('Turbine work = %.1f Btu/lb',turb)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.9: Air_fuel_ratio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"chem=19000 //Btu/lb\n", +"m1=204.63 //Btu/lb\n", +"M=28.9\n", +"w=14580.3\n", +"//calculations\n", +"ma=(chem-w/M)/(w/M -m1)\n", +"//results\n", +"printf('Air fuel ratio = %.1f lb air/lb fuel',ma)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/20-Vapor_power_cycles.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/20-Vapor_power_cycles.ipynb new file mode 100644 index 0000000..5369d94 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/20-Vapor_power_cycles.ipynb @@ -0,0 +1,276 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 20: Vapor power cycles" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.1: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"Qs=825.1 //Btu/lb\n", +"ds=0.9588\n", +"t1=101.74 //F\n", +"th=400.95 //F\n", +"//calculations\n", +"Qr=ds*(t1+459.69)\n", +"work=Qs-Qr\n", +"eta=work/Qs*100\n", +"eta2=(th-t1)/(th+459.69) *100\n", +"//results\n", +"printf('In case 1, Thermal efficiency = %.2f percent',eta)\n", +"printf('\n In case 2, Thermal efficiency = %.2f percent',eta2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.2: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"s2=1.5263\n", +"sfg=1.8456\n", +"sf=1.9782 \n", +"h2=1201.1 //Btu/lb\n", +"hf=1106 //Btu/lb\n", +"hfg=1036.3 //Btu/lb\n", +"v=0.01616 //m^3/kg\n", +"p2=250 //psia\n", +"p1=1//psia\n", +"J=778\n", +"//calculations\n", +"x3=1+ (s2-sf)/sfg\n", +"h3=hf-(1-x3)*hfg\n", +"h4=69.7\n", +"Wp=v*144*(p2-p1)/J\n", +"h1=h4+Wp\n", +"etat=((h2-h3)-Wp)/(h2-h1) *100\n", +"eta2=(h2-h3)/(h2-h4)*100\n", +"//results\n", +"printf('\n In case 1, Efficieny = %.2f percent',etat)\n", +"printf('\n In case 2, Efficieny = %.2f percent',eta2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.3: Enthalpy_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"p=40000 //kW\n", +"ef=0.98\n", +"rate=302000 //lb\n", +"s3=1.6001\n", +"h2=1490.1\n", +"loss=600\n", +"v=400 //ft/s\n", +"g=32.2 //ft/s^2\n", +"J=778\n", +"//calculations\n", +"out=p/(0.746*ef)\n", +"srate=rate/out\n", +"X=-(s3-1.9782)/1.8456\n", +"h3=1106 - X*1036.3\n", +"theoturb=h2-h3\n", +"intturb=(out+loss)*2544/rate\n", +"Ie=intturb/theoturb *100\n", +"h3d=h2-intturb-v^2 /(2*g*J)\n", +"hex=h3d+ v^2 /(2*g*J)\n", +"excess=rate*(hex-h3)\n", +"//results\n", +"printf('Steam rate = %.2f lb/shaft hp-hr',srate)\n", +"printf('\n Internal engine efficiency = %.1f percent',Ie)\n", +"printf('\n Enthalpy of exhaust steam = %.1f Btu/lb',h3d)\n", +"printf('\n Excess heat to be removed = %d Btu/hr',excess)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.4: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"s2=1.5263\n", +"sf=1.6993\n", +"sfg=1.3313\n", +"hf=1164.1 //Btu/lb\n", +"hfg=945.3 //Btu/lb\n", +"h2=1201.1 //Btu/lb\n", +"h1=852.3 //Btu/lb\n", +"//calculations\n", +"X3=-(s2-sf)/sfg\n", +"h3=hf-X3*hfg\n", +"h4=218.82\n", +"h6=h4\n", +"h5=69.7\n", +"x=(h4-h5)/(h3-h5)\n", +"W= h2-h3+ (1-x)*(h3-h1)\n", +"Qs=h2-h4\n", +"eff=W/Qs *100\n", +"//results\n", +"printf('Thermal efficiency = %.2f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.5: Thermal_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h6=157.933 //Btu/lb\n", +"s2=0.11626\n", +"sf=0.16594\n", +"sfg=0.14755\n", +"hf=139.095 //Btu/lb\n", +"hfg=126.98 //Btu/lb\n", +"h5=12.016 //Btu/lb\n", +"h2=1201.1 //Btu/lb\n", +"h1=69.7 //Btu/lb\n", +"w=348.8 //Btu/lb\n", +"m=0.0745 //lb\n", +"//calculations\n", +"x7=-(s2-sf)/sfg\n", +"h7=hf-x7*hfg\n", +"dh6=h6-h7\n", +"mr=(h7-h5)/(h2-h1)\n", +"work=w*m\n", +"tw=work+dh6\n", +"dh65=h6-h5\n", +"eff=tw/dh65 *100\n", +"//results\n", +"printf('Thermal efficiency = %.2f percent',eff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.6: Heat_transferred.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"m=1 //lb\n", +"cp=0.26\n", +"t2=1800+460 //R\n", +"t1=400.95+460 //R\n", +"x=0.6\n", +"sink=100+460 //R\n", +"tm=2600+460 //R\n", +"//calculations\n", +"Q=m*cp*(t2-t1)\n", +"ds=m*cp*log((t2/t1))\n", +"tds=ds*(sink)\n", +"avail=Q-tds\n", +"hf=Q*x/(1-x)\n", +"av2=hf*(tm-sink)/(tm)\n", +"Qt=Q+hf\n", +"av=avail+av2\n", +"per=av/Qt *100\n", +"//results\n", +"printf('Available portion of heat transferred = %.1f percent',per)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/21-Steam_turbines.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/21-Steam_turbines.ipynb new file mode 100644 index 0000000..90462d6 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/21-Steam_turbines.ipynb @@ -0,0 +1,360 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 21: Steam turbines" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.1: Rate_of_flow_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"p2=190 //psia\n", +"p1=110 //psia\n", +"v1=2.456 \n", +"k=1.3\n", +"J=778\n", +"A2=1.2 //in^2\n", +"//calculations\n", +"v2=v1*(p2/p1)^(1/k)\n", +"dh=k/(k-1) *144/J *(p2*v1-p1*v2)\n", +"Vex=223.8*sqrt(dh)\n", +"m=A2*Vex/(144*v2)\n", +"//results\n", +"printf('Rate of flow = %.2f lb/sec',m)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.2: Rate_of_flow_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h1=1205.8 //Btu/lb\n", +"s2=1.5594\n", +"sf=1.5948\n", +"sfg=1.1117\n", +"hf=1188.9 //Btu/lb\n", +"hfg=883.2 //Btu/lb\n", +"vf=4.049\n", +"vfg=vf-0.018\n", +"k=1.3\n", +"J=778\n", +"A2=1.2 //in^2\n", +"//calculations\n", +"x2=-(s2-sf)/sfg\n", +"h2=hf-x2*hfg\n", +"v2=vf-x2*vfg\n", +"dh=h1-h2\n", +"Vex=223.8*sqrt(dh)\n", +"m=A2*Vex/(144*v2)\n", +"//results\n", +"printf('Rate of flow = %.2f lb/sec',m)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.3: Blade_work_and_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"alp=14 //degrees\n", +"vb=900 //ft/s\n", +"v1=2200 //ft/s\n", +"g=32.17 //ft/s^2\n", +"//calculations\n", +"vrc=v1*cosd(alp) - vb\n", +"W=(2*vrc)/g *vb\n", +"eta=W/(v1^2/ (2*g)) *100\n", +"bet=atand(v1*sind(alp) /vrc)\n", +"//results\n", +"printf('Blade work = %d ft-lb/lb',W)\n", +"printf('\n Efficiency = %.1f percent',eta)\n", +"printf('\n Blade angle = %.1f degrees',bet)\n", +"disp('The answers are a bit different due to rounding off error')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.4: Blade_work_and_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"v1=1234 //ft/s\n", +"v2=532 //ft/s \n", +"kb=0.92\n", +"alp=20 //degrees\n", +"ve=900 //ft/s\n", +"r=2200 //ft/s\n", +"g=32.17 //ft/s^2\n", +"//calculations\n", +"vr=sqrt(v1^2 +v2^2)\n", +"vr2=vr*kb\n", +"vrc=vr2*cosd(alp)\n", +"W=(v1+vrc)*ve/g\n", +"eta=W/(r^2 /(2*g)) *100\n", +"//results\n", +"printf('Blade work = %d ft-lb/lb',W)\n", +"printf('\n Efficiency = %.1f percent',eta)\n", +"disp('The answers are a bit different due to rounding off error')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.5: Blade_reheat_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"v1=1234\n", +"v2=532\n", +"kb=0.92\n", +"alp=20 //degrees\n", +"ve=900\n", +"r=2200 //ft/s\n", +"g=32.17 //ft/s^2\n", +"J=778\n", +"w=67000\n", +"//calculations\n", +"vr=sqrt(v1^2 +v2^2)\n", +"vr2=vr*kb\n", +"vrc=vr2*cosd(alp)\n", +"reheat=(vr^2 - vr2^2 )/(2*g*J)\n", +"v22=sqrt((vrc-ve)^2 +(vr2*sind(alp))^2)\n", +"ein=r^2 /(2*g*J)\n", +"eout=w/J + v22^2 /(2*g*J)\n", +"re2=ein-eout\n", +"//results\n", +"printf('\n In case 1, Blade reheat = %.2f Btu/lb',reheat)\n", +"printf('\n In case 2, Blade reheat = %.1f Btu/lb',re2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.6: Pressure_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h1=1416.4\n", +"s1=1.6842\n", +"sf=1.7319\n", +"sfg=1.3962\n", +"fac=1.05\n", +"x2=0.7\n", +"//calculations\n", +"x6=-(s1-sf)/sfg\n", +"h6=1156.3 - x6*960.1\n", +"dh6=h1-h6\n", +"drop= fac*h6/2\n", +"h2=h1-drop\n", +"first=(1-x2)*drop\n", +"h3=1264.1 +first\n", +"h4=1157 //Btu/lb\n", +"fac2=(drop+153)/dh6\n", +"disp('From air charts,')\n", +"p2=107 //psia\n", +"//results\n", +"printf('Intermediate pressure = %d psia',p2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.7: Shaft_output_and_efficiency_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"reh=1.047\n", +"dh6=292.8\n", +"x2=0.7\n", +"flow=98000 //lb/hr\n", +"loss=200 //hp\n", +"//calculations\n", +"intwork=reh*dh6*x2\n", +"inthp=intwork*flow/2544\n", +"sout=inthp-loss\n", +"swork=sout*2544/flow\n", +"seff=swork/290.1 *100\n", +"//results\n", +"printf('Shaft output = %d hp',sout)\n", +"printf('\n Shaft engine efficiency = %.1f percent',seff)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.8: Pressure_at_Exit_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h1=1416.4 //Btu/lb\n", +"h2=214.5 //Btu/lb\n", +"//calculations\n", +"hex=h1-h2\n", +"disp('From Air tables,')\n", +"pe=20 //psia\n", +"te=321.5 //F\n", +"//results\n", +"printf('Exit Pressure = %d psia',pe)\n", +"printf('\n Exit temperature = %.1f F',te)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.9: Steam_rate_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"flow=98000 //lb/hr\n", +"loss=200 //hp\n", +"x= 0.11 //percent\n", +"shp=3000 //hp\n", +"//calculations\n", +"sflow = x*flow\n", +"sflow2= sflow + (flow-sflow)*shp/8060\n", +"srate=sflow2/shp\n", +"//results\n", +"printf('Steam rate required = %.2f lb/hp-hr',srate)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/22-Refrigeration.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/22-Refrigeration.ipynb new file mode 100644 index 0000000..9b4e86d --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/22-Refrigeration.ipynb @@ -0,0 +1,277 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 22: Refrigeration" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.1: cop_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"t1=45+460 //R\n", +"th=70+460 //R\n", +"t2=-200+460 //R\n", +"th2=100+460 //R\n", +"//calculations\n", +"cp1=t1/(th-t1)\n", +"cp2=th/(th-t1)\n", +"cp3=t2/(th2-t2)\n", +"cp4=th2/(th2-t2)\n", +"//results\n", +"printf('In case 1, Refrigerator cp = %.1f',cp1)\n", +"printf('\n In case 1, Heat pump cp = %.1f',cp2)\n", +"printf('\n In case 2, Refrigerator cp = %.3f',cp3)\n", +"printf('\n In case 2, Heat pump cp = %.3f',cp4)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.2: cop_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h3=85.282 //Btu/lb\n", +"s2=0.16392\n", +"sf=0.16798\n", +"//calculations\n", +"sfg=sf-0.023954\n", +"x3=-(s2-sf)/sfg\n", +"h2=78.335 - x3*67.651\n", +"h4=26.365 //Btu/lb\n", +"h1=h4\n", +"ref=h2-h1\n", +"work=h3-h2\n", +"cp1=ref/work\n", +"h2d=78.355\n", +"h1d=26.365 //Btu/lb\n", +"h3d=87.495 //Btu/lb\n", +"ref2=h2d-h1d\n", +"work2=h3d-h2d\n", +"cp2=ref2/work2\n", +"//results\n", +"printf('\n Coefficient of performance in wet compression = %.3f',cp1)\n", +"printf('\n Coefficient of performance in dry compression = %.3f',cp2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.3: Tonnage_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h1=24.973 //Btu/lb\n", +"h2=81.436 //Btu/lb\n", +"cfm=200 //cfm\n", +"v2=0.77357\n", +"v3=3.8750\n", +"h4=72.913\n", +"//calculations\n", +"mass=cfm/v2\n", +"ref=h2-h1\n", +"tonnage=mass*ref/cfm\n", +"mass2=cfm/v3\n", +"ref2=h4-h1\n", +"tonnage2=mass2*ref2/cfm\n", +"//results\n", +"printf('In case 1,Tonnage = %.1f tons',tonnage)\n", +"printf('\n In case 2,Tonnage = %.2f tons',tonnage2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.4: Refrigeration_and_cop_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"h2d=93.410 //Btu/lb\n", +"h1=80.740 //Btu/lb\n", +"x=0.75\n", +"PD=160\n", +"vol=0.82\n", +"v1=1.7213\n", +"w2=80.156\n", +"w1=27.3\n", +"//calculations\n", +"twork=h2d-h1\n", +"swork=twork/x\n", +"flow=PD*vol/v1\n", +"ref=flow*(w2-w1)/200\n", +"shp= flow*swork/42.4\n", +"cop=(w2-w1)/swork\n", +"//results\n", +"printf('Refrigeration = %.1f tons',ref)\n", +"printf('\n Shaft hp= %.1f hp',shp)\n", +"printf('\n Coefficient of performance = %.2f ',cop)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.5: cop_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"mc=3000 //lb\n", +"hv=1080.2 //Btu/lb\n", +"hfe=26.06 //Btu/lb\n", +"hfp=10.05 //Btu/lb\n", +"x=0.7\n", +"//calculations\n", +"mv=(mc*hfp-mc*hfe)/(hfe-hv)\n", +"dh=145.4 //Btu/lb\n", +"chp=dh*mv/(x*42.4)\n", +"cop=mc*(hfe-hfp)/(chp*42.4)\n", +"//results\n", +"printf('Coefficient of performace = %.2f ',cop)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.6: Power_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"loss=80000 //Btu/lb\n", +"t=560 //R\n", +"//calculations\n", +"ratio=t/68\n", +"power=loss/(ratio*2544)\n", +"//results\n", +"printf('Power = %.2f hp',power)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.7: Power_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"loss=2*80000 //Btu/lb\n", +"tb=72 //F\n", +"to=12 //F\n", +"to2=42 //F\n", +"tf=104+460 //R\n", +"//calculations\n", +"ratio=tf/(tf-460)\n", +"power=loss/(2544*ratio)\n", +"//results\n", +"printf('Power = %.1f hp',power)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/23-Gas_vapor_mixtures.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/23-Gas_vapor_mixtures.ipynb new file mode 100644 index 0000000..5571515 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/23-Gas_vapor_mixtures.ipynb @@ -0,0 +1,319 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 23: Gas vapor mixtures" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.1: Specific_humidity_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pv=0.3631 //psia\n", +"pa=14.7 //psia\n", +"cp=0.24\n", +"tw=70 //F\n", +"td=80 //F\n", +"hv1=1096.6 //Btu/lb\n", +"hfb=38.06 //Btu/lb\n", +"//calculations\n", +"sh=0.622*pv/(pa-pv)\n", +"sh1=(cp*tw -cp*td + sh*1054.3)/(hv1-hfb)\n", +"//results\n", +"printf('Specific humidity = %.5f lb/lb',sh1)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.2: RH_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rel=0.9\n", +"p1=0.0396 //psia\n", +"p2=0.3631 //psia\n", +"//calculations\n", +"act=rel*p1\n", +"RH=act/p2 *100\n", +"//results\n", +"printf('Relative humidity = %.1f percent',RH)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.3: Temperature_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pa=14.2\n", +"rel=0.9\n", +"sh=0.012 //lb/lb\n", +"//calculations\n", +"pv=(pa*sh)/(0.622-sh)\n", +"sat=pv/rel\n", +"tf=64.34 //F\n", +"//results\n", +"printf('From steam tables, by interpolation, Final temperature = %.2f F',tf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.4: Heat_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"pa=14.7\n", +"pv=0.0356\n", +"pv2=0.04\n", +"cp=0.24\n", +"t1=70 //F\n", +"t2=15 //F\n", +"R=53.35\n", +"V=8000 //ft^3\n", +"//calculations\n", +"sh=0.622*pv/(pa-pv2)\n", +"hm2=cp*t1+ sh*1092.3\n", +"hm1=cp*t2+sh*1068.4\n", +"Q=hm2-hm1\n", +"m=144*(pa-pv2)*V/(R*(t2+460))\n", +"Q2=Q*m\n", +"//results\n", +"printf('Heat added per min = %d Btu/min',Q2)\n", +"disp('The answer is a bit different due to rounding off error in the textbook')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.5: Temperature_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rel=0.45\n", +"p1=0.4747 //psia\n", +"disp('From steam table data,')\n", +"//calculations\n", +"act=rel*p1\n", +"t2=54.94 //F\n", +"//results\n", +"printf('Temperature = %.2f F',t2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.6: Tonnage_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"rel=0.6\n", +"p1=0.6982 //psia\n", +"pa=14.7 //psia\n", +"t1=90 //F\n", +"t2=54.94 //F\n", +"cp=0.24\n", +"p2=0.2136 //psia\n", +"vol=4000 //ft\n", +"t3=538 //R\n", +"R=53.35\n", +"//calculations\n", +"act1=rel*p1\n", +"sh1=0.622*act1/(pa-act1)\n", +"hm1=cp*t1+sh1*1100.9\n", +"sh2=0.622*p2/(pa-p2)\n", +"hm2=cp*t2+sh2*1085.8\n", +"con=sh1-sh2\n", +"enth=con*23.01\n", +"heat=hm1-hm2-enth\n", +"mass=144*(pa-p2)*vol/(R*(t3))\n", +"tonnage=mass*heat/200\n", +"//results\n", +"printf('Tonnage = %.1f tons ',tonnage)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.7: Tonnage_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"p1=0.541 //psia\n", +"rel=0.48\n", +"pa=14.7 //psia\n", +"t1=82 //F\n", +"cp=0.24\n", +"m1=0.75 //lb\n", +"m2=0.25 //lb\n", +"hm4=23.15 //Btu/lb\n", +"mass=291 //lb\n", +"//calculations\n", +"p2=rel*p1\n", +"sh=0.622*p2/(pa-p2)\n", +"hm1=cp*t1 + sh*1097.5\n", +"hm2=m1*hm1\n", +"hm3=m2*41.67\n", +"heat=hm2+hm3-hm4\n", +"tonnage=heat*mass/200\n", +"//results\n", +"printf('Tonnage = %.2f tons',tonnage)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.8: Volume_calculatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initalization of variables\n", +"ce=0.8\n", +"t1=115 //F\n", +"tc=75 //F\n", +"td=85 //F\n", +"pa=14.7 //psia\n", +"p1=0.43 //psia\n", +"p2=0.9492 //psia\n", +"m1=159600\n", +"m2=31.65\n", +"R=53.35\n", +"T=545 //R\n", +"//calculations\n", +"t2=t1-ce*(t1-tc)\n", +"Pv=0.4298- (pa-p1)*(td-tc)/(2800- 1.3*tc) \n", +"sh1=0.622*Pv/(pa-Pv)\n", +"sh2=0.622 *p2/(pa-p2)\n", +"mda=m1/m2\n", +"V=mda*R*T/(144*(pa-Pv))\n", +"amount=mda*(sh2-sh1)\n", +"//results\n", +"printf('Volume of entering air = %d cfm',V)\n", +"printf('\n Amount of make up water = %.1f lb/min',amount)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/5-Actual_Gases.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/5-Actual_Gases.ipynb new file mode 100644 index 0000000..32085c9 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/5-Actual_Gases.ipynb @@ -0,0 +1,167 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Actual Gases" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Volume_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"m=20 //lbm\n", +"P=1000 //psia\n", +"T=580 //R\n", +"R=35.12\n", +"//calculations\n", +"disp('From table 5-2,')\n", +"z=0.667\n", +"V=z*m*R*T/(P*144)\n", +"vt=0.0935\n", +"vtt=vt*m\n", +"//results\n", +"printf('Volume occupied = %.3f cu ft',V)\n", +"printf('\n Tablulated value for volume = %.2f cu ft',vtt)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: Pressure_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"m=90 //lbm\n", +"T=200+459.7 //R\n", +"Tc=232.7+459.7 //R\n", +"R0=1545\n", +"M=120.9\n", +"V=30 //cu ft\n", +"//calculations\n", +"R=R0/M\n", +"disp('From fig 5.5')\n", +"z=0.883\n", +"P=z*R*m*T/V/144\n", +"vc=V/m\n", +"P2=156.1 //psia\n", +"//results\n", +"printf('Pressure obtained = %.2f psia',P)\n", +"printf('\n Theoretical pressure = %.1f psia',P2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Heat_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"T1=140+460 //R\n", +"T2=240 +460 //R\n", +"N=1\n", +"//calculations\n", +"Q=N*(9.47*(T2-T1)-3.47*10^3 *log(T2/T1) -1.16*10^6 *(1/T2-1/T1))\n", +"Tm=(T1+T2)/2\n", +"Cp=9.47-3.47*10^3 /Tm +1.16*10^6 /Tm^2\n", +"Q2=N*Cp*(T2-T1)\n", +"//results\n", +"printf('Heat added in case 1 = %d Btu',Q)\n", +"printf('\n Heat added in case 2 = %.1f Btu',Q2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: Heat_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"Rj=1.985\n", +"N=1\n", +"T1=540+460 //R\n", +"T2=3540+460 //R\n", +"//calculations\n", +"Q=N*(14.215*(T2-T1)-6.53*10^3 *log(T2/T1) -1.41*10^6 *(1/T2-1/T1))\n", +"Tm=(T1+T2)/2\n", +"Cv=14.215-6.53*10^3 /Tm +1.41*10^6 /Tm^2\n", +"Q2=N*Cv*(T2-T1)\n", +"//results\n", +"printf('Heat added in case 1 = %.1f Btu',Q)\n", +"printf('\n Heat added in case 2 = %.1f Btu',Q2)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/7-Entropy.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/7-Entropy.ipynb new file mode 100644 index 0000000..4958a29 --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/7-Entropy.ipynb @@ -0,0 +1,67 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Entropy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Change_in_Entropy.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"T2=920 //R\n", +"T1=520 //R\n", +"P1=14 //psia\n", +"P2=84 //psia\n", +"J=778\n", +"R=53.35\n", +"cv=0.1715\n", +"N=1\n", +"//calculations\n", +"k= log(T2/T1) /log(P2/P1)\n", +"n=1/(1-k)\n", +"cx=cv+R/(J*(1-n))\n", +"dS=N*cx*log(T2/T1)\n", +"//results\n", +"printf('Change in entropy = %.5f unit of entropy',dS)" + ] + } +], +"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/Thermodynamics_for_Engineers_by_J_S_Doolittle/8-Availability_of_Energy.ipynb b/Thermodynamics_for_Engineers_by_J_S_Doolittle/8-Availability_of_Energy.ipynb new file mode 100644 index 0000000..f41176a --- /dev/null +++ b/Thermodynamics_for_Engineers_by_J_S_Doolittle/8-Availability_of_Energy.ipynb @@ -0,0 +1,108 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Availability of Energy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: Energy_loss_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"q=1000 //Btu\n", +"th=1140 //F\n", +"tl=40 //F\n", +"ts=940 //F\n", +"//calculations\n", +"Q1=q*(th-tl)/(th+460)\n", +"Q2=q*(ts-tl)/(ts+460)\n", +"dif=Q1-Q2\n", +"//results\n", +"printf('Available energy loss = %d Btu',dif)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Energy_loss_calculations.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"clear\n", +"//Initialization of variables\n", +"ma=200000 //lb\n", +"cpa=0.26\n", +"T2g=1200 //F\n", +"T1g=300 //F\n", +"T1w=200 //F\n", +"mw=250000 //lb\n", +"cpw=1.02\n", +"Tl=560 //R\n", +"cx=1.01\n", +"//calculations\n", +"T2w=T1w+ ma*cpa*(T2g-T1g)/(mw*cpw)\n", +"Qun=Tl*ma*cpa*log((T2g+460)/(T1g+460))\n", +"Qtr=ma*cpa*(T2g-T1g)\n", +"Qav=Qtr-Qun\n", +"Qun2=Tl*mw*cx*log((T2w+460)/(T1w+460))\n", +"Qav2=Qtr-Qun2\n", +"ht1=Qav-Qav2\n", +"//results\n", +"printf('For gas, Untransferred energy = %d Btu/hr',Qun)\n", +"printf('\n For gas, transferred energy = %d Btu/hr',Qtr)\n", +"printf('\n For gas, available energy = %d Btu/hr',Qav)\n", +"printf('\n For water, Untransferred energy = %d Btu/hr',Qun2)\n", +"printf('\n For water, available energy = %d Btu/hr',Qav2)\n", +"printf('\n Loss of available energy = %d Btu/hr',ht1)\n", +"disp('The answers are a bit different due to rounding off error in textbook')" + ] + } +], +"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 +} |