{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 10: Mixtures of gases and vapors" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.10: Example_10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "ps=0.5069 //psia\n", "p=20 //psia\n", "m1=0.01\n", "m2=1\n", "M1=18\n", "M2=29\n", "//calculations\n", "xw= (m1/M1)/(m1/M1+m2/M2)\n", "pw=xw*p\n", "//results\n", "printf('partial pressure of water vapor = %.3f psia',pw)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.11: Example_11.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "t1=80+460 //R\n", "ps=0.5069 //psia\n", "disp('from steam tables,')\n", "vs=633.1 //ft^3/lbm\n", "phi=0.3\n", "R=85.6\n", "Ra=53.3\n", "p=14.696\n", "//calculations\n", "tdew=46 //F\n", "pw=phi*ps\n", "rhos=1/vs\n", "rhow=phi*rhos\n", "rhow2= pw*144/(R*t1)\n", "pa=p-pw\n", "rhoa= pa*144/(Ra*t1)\n", "w=rhow/rhoa\n", "//results\n", "disp('part a')\n", "printf('partial pressure of water = %.5f psia',pw)\n", "printf('\n dew temperature = %d F',tdew)\n", "disp('part b')\n", "printf('density of water = %.6f lbm/ft^3',rhow)\n", "printf('\n in case 2, density of water = %.6f lbm/ft^3',rhow2)\n", "printf('\n density of air = %.6f lbm/ft^3',rhoa)\n", "disp('part c')\n", "printf('specific humidity = %.4f lbm steam/lbm air',w)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.12: Example_12.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "p=14.696 //psia\n", "ps=0.0505 //psia\n", "ps2=0.5067 //psia\n", "phi2=0.5\n", "phi=0.6\n", "grain=7000\n", "//calculations\n", "pw=phi*ps\n", "w1=0.622*pw/(p-pw)\n", "pw2=phi2*ps2\n", "w2=0.622*pw2/(p-pw2)\n", "dw=w2-w1\n", "dwg=dw*grain\n", "//results\n", "printf('change in moisture content = %.6f lbm water/lbm dry air',dw)\n", "printf('\n in grains, change = %.3f grains water/lbm dry air',dwg)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.13: Example_13.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "t1=80 //F\n", "t2=60 //F\n", "p=14.696 //psia\n", "ps=0.5069 //psia\n", "pss=0.2563 //psia\n", "cp=0.24\n", "//calculations\n", "pw= pss- (p-pss)*(t1-t2)/(2830- 1.44*t2)\n", "phi=pw/ps\n", "w=0.622*pw/(p-pw)\n", "ws=0.0111\n", "hfg=1059.9\n", "hw=1096.5\n", "hf=28\n", "w2= (cp*(t2-t1)+ ws*hfg)/(hw-hf)\n", "//results\n", "printf('relative humidity = %d percent',phi*100)\n", "printf('\n humidity ratio = %.5f',w)\n", "printf('\n in case 2, humidity ratio = %.4f ',w2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.14: Example_14.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "pw=0.15//psia\n", "disp('using psychrometric charts,')\n", "tdew=46 //F\n", "//calculations\n", "va=13.74 //ft^3/lbm dry air\n", "rhoa=1/va\n", "V=13.74\n", "mw=45/7000\n", "rhow=mw/V\n", "w=0.00643\n", "//results\n", "disp('part a')\n", "printf('partial pressure of water = %.2f psia',pw)\n", "printf('\n dew temperature = %d F',tdew)\n", "disp('part b')\n", "printf('density of water = %.6f lbm/ft^3',rhow)\n", "printf('\n density of air = %.4f lbm/ft^3',rhoa)\n", "disp('part c')\n", "printf('specific humidity = %.5f lbm steam/lbm air',w)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.15: Example_15.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "t=80 //F\n", "phi=0.3\n", "w=0.00643\n", "//calculations\n", "H=0.24*t+ w*(1061+0.444*t)\n", "//results\n", "printf('enthalpy = %.2f Btu/lbm dry air',H)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.16: Example_16.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "disp('From psychrometric charts,')\n", "va1=13 //ft^3/lbm dry air\n", "va2=13.88 //ft^3/lbm dry air\n", "flow=2000 //cfm\n", "//calculations\n", "ma1= flow/va1\n", "ma2=flow/va2\n", "t=71// F\n", "phi=t //percent\n", "//results\n", "printf('humidity = %d percent',phi)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.17: Example_17.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "t=90 //F\n", "ts=67.2 //F\n", "phi=0.3\n", "per=0.8\n", "//calculations\n", "dep=t-ts\n", "dt=dep*per\n", "tf=t-dt\n", "disp('from psychrometric charts,')\n", "phi2=0.8\n", "//results\n", "printf('Dry bulb temperature = %.2f F',tf)\n", "printf('\n percent humidity = %.2f',phi2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.18: Example_18.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m=1 //lbm\n", "disp('From psychrometric charts,')\n", "t1=82 //F\n", "phi1=0.4\n", "H1=30 //Btu/lbm dry air\n", "w1=65 //grains/lbm dry air\n", "w2=250 //grains/lbm dry air\n", "//calculations\n", "dmf3=(w2-w1)*0.0001427\n", "hf3=68\n", "hf4=43\n", "H2=62.2\n", "H1=30\n", "mf4= (H1-H2+ dmf3*hf3)/(hf4-hf3)\n", "per=dmf3/(dmf3+mf4)\n", "//results\n", "printf('amount of water cooled per pound of dry air = %.3f lbm dry air/lbm dry air',mf4)\n", "printf('\n percentage of water lost by evaporation = %.2f percent',per*100)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.19: Example_19.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "R0=0.73 //atm ft^3/mol R\n", "a1=578.9\n", "a2=3675\n", "b1=0.684\n", "b2=1.944\n", "n1=0.396 //mol\n", "n2=0.604 //mol\n", "V=8.518 //ft^3\n", "T=460+460 //R\n", "//calculations\n", "p1=R0*n1*T/(V-n1*b1) - a1*n1^2 /V^2\n", "p2= R0*n2*T/(V-n2*b2) -a2*n2^2 /V^2\n", "p=p1+p2\n", "pa=(n1+n2)*R0*T/V\n", "err=(pa-p)/p\n", "pb=58.7 //atm\n", "err2= (p-pb)/p\n", "//results\n", "printf('Pressure = %.1f atm',p)\n", "printf('\n error in ideal case = %.1f percent',err*100)\n", "printf('\n error in case 2 = %.1f percent',err2*100)\n", "//The answer is a bit different due to rounding off error in textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.1: Example_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m1=10 //lbm\n", "m2=15 //lnm\n", "p=50 //psia\n", "t=60+460 //R\n", "M1=32\n", "M2=28.02\n", "R0=10.73 \n", "//calculations\n", "n1=m1/M1\n", "n2=m2/M2\n", "x1=n1/(n1+n2)\n", "x2=n2/(n1+n2)\n", "M=x1*M1+x2*M2\n", "R=R0/M\n", "V=(n1+n2)*R0*t/p\n", "rho=p/(R0*t)\n", "rho2=M*rho\n", "p1=x1*p\n", "p2=x2*p\n", "v1=x1*V\n", "v2=x2*V\n", "//results\n", "disp('part a')\n", "printf('Mole fractions of oxygen and nitrogen are %.3f and %.3f respectively',x1,x2)\n", "disp('part b')\n", "printf('Average molecular weight = %.1f ',M)\n", "disp('part c')\n", "printf('specific gas constant = %.4f psia ft^3/lbm R',R)\n", "disp('part d')\n", "printf('volume of mixture = %.1f ft^3',V)\n", "printf('density of mixture is %.5f mole/ft^3 and %.2f lbm/ft^3',rho,rho2)\n", "disp('part e')\n", "printf('partial pressures of oxygen and nitrogen are %.2f psia and %.2f psia respectively' ,p1,p2)\n", "printf('\n partial volumes of oxygen and nitrogen are %.2f ft^3 and %.2f ft^3 respectively',v1,v2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.20: Example_20.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "p1=45.8 //atm\n", "p2=36 //atm\n", "t1=343.3 //R\n", "t2=766.8 //R\n", "n1=0.396 //mol\n", "n2=0.604 //mol\n", "V=8.518 //ft^3\n", "R0=0.73\n", "T=920 //R\n", "//calcualtions\n", "vr1=p1*(V/n1)/(R0*t1)\n", "vr2=p2*(V/n2)/(R0*t2)\n", "tr1=T/t1\n", "tr2=T/t2\n", "disp('From compressibility charts,')\n", "z1=1\n", "z2=0.79\n", "Z=n1*z1+n2*z2\n", "p=Z*R0*T/V\n", "p2=62 //atm\n", "err=(p-p2)/p\n", "//results\n", "printf('In case 1, pressure = %.1f atm',p)\n", "printf('\n In case 2, pressure using trail and error method = %d atm',p2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.21: Example_21.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "t1=343.3 //R\n", "t2=766.8 //R\n", "n1=0.396 //mol\n", "n2=0.604 //mol\n", "V=8.518 //ft^3\n", "p1=45.8 //atm\n", "p2=36 //atm\n", "R0=0.73\n", "T=920 //R\n", "//calculations\n", "tcd=n1*t1+n2*t2\n", "pcd=n1*p1+n2*p2\n", "Tr=T/tcd\n", "Vr=pcd*V/(R0*tcd)\n", "Z=0.87\n", "p=Z*R0*T/V\n", "//results\n", "printf('Pressure = %.1f atm',p)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.2: Example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m1=5.28\n", "m2=1.28\n", "m3=23.52\n", "//calculations\n", "m=m1+m2+m3\n", "x1=m1/m\n", "x2=m2/m\n", "x3=m3/m\n", "C=12/44 *m1/ m\n", "O=(32/44 *m1 + m2)/m\n", "N=m3/m\n", "//results\n", "printf('From gravimetric analysis, co2 = %.1f percent , o2 = %.1f percent and n2 = %.1f percent',x1*100,x2*100,x3*100)\n", "printf('\n From ultimate analysis, co2 = %.2f percent , o2 = %.2f percent and n2 = %.2f percent',C*100,O*100,N*100)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.3: Example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "x1=1/3\n", "n1=1\n", "n2=2\n", "x2=2/3\n", "p=12.7 //psia\n", "cp1=7.01 //Btu/mole R\n", "cp2=6.94 //Btu/mole R\n", "R0=1.986\n", "T2=460+86.6 //R\n", "T1=460 //R\n", "p0=14.7 //psia\n", "//calculations\n", "p1=x1*p\n", "p2=x2*p\n", "ds1= cp1*log(T2/T1) - R0*log(p1/p0)\n", "ds2= cp2*log(T2/T1) - R0*log(p2/p0)\n", "S=n1*ds1+n2*ds2\n", "//results\n", "printf('Entropy of mixture = %.2f Btu/R',S)\n", "printf('the answer given in textbook is wrong. please check using a calculator')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.4: Example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "c1=4.97 //Btu/mol R\n", "c2=5.02 //Btu/mol R\n", "n1=2\n", "n2=1\n", "T1=86.6+460 //R\n", "T2=50+460 //R\n", "//calculations\n", "du=(n1*c1+n2*c2)*(T2-T1)\n", "ds=(n1*c1+n2*c2)*log(T2/T1)\n", "//results\n", "printf('Change in internal energy = %d Btu',du)\n", "printf('\n Change in entropy = %.3f Btu/R',ds)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.5: Example_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "n1=1\n", "n2=2\n", "c1=5.02\n", "c2=4.97\n", "t1=60 //F\n", "t2=100 //F\n", "R0=10.73\n", "p1=30 //psia\n", "p2=10 //psia\n", "//calcualtions\n", "t=(n1*c1*t1+n2*c2*t2)/(n1*c1+n2*c2)\n", "V1= n1*R0*(t1+460)/p1\n", "V2=n2*R0*(t2+460)/p2\n", "V=V1+V2\n", "pm=(n1+n2)*R0*(t+460)/V\n", "//results\n", "printf('Pressure of mixture = %.1f psia',pm)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.6: Example_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "T2=546.6 //R\n", "T1=520 //R\n", "T3=560 //R\n", "v2=1389.2\n", "v1=186.2\n", "R0=1.986\n", "c1=5.02\n", "c2=4.97\n", "n1=1\n", "n2=2\n", "v3=1203\n", "//calculations\n", "ds1=n1*c1*log(T2/T1) + n1*R0*log(v2/v1)\n", "ds2=n2*c2*log(T2/T3)+n2*R0*log(v2/v3)\n", "ds=ds1+ds2\n", "//results\n", "printf('Net change in entropy = %.3f Btu/R',ds)\n", "//The answer is a bit different due to rounding off error in the textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.7: Example_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m1=1 //lbm\n", "m2=0.94 //lbm\n", "M1=29\n", "M2=18\n", "p1=50 //psia\n", "p2=100 //psia\n", "t1=250 +460 //R\n", "R0=1.986\n", "cpa=6.96\n", "cpb=8.01\n", "//calculations\n", "xa = (m1/M1)/((m1/M1)+ m2/M2)\n", "xb=1-xa\n", "t2=t1*(p2/p1)^(R0/(xa*cpa+xb*cpb))\n", "d=R0/(xa*cpa+xb*cpb)\n", "k=1/(1-d)\n", "dsa=cpa*log(t2/t1) -R0*log(p2/p1)\n", "dSa=(m1/M1)*dsa\n", "dSw=-dSa\n", "dsw=dSw*M2/m2\n", "//results\n", "printf('Final remperature = %d R',t2)\n", "printf('\n Change in entropy of air = %.3f btu/mole R and %.5f Btu/R',dsa,dSa)\n", "printf('\n Change in entropy of water = %.4f btu/mole R and %.5f Btu/R',dsw,dSw)\n", "//The answers are a bit different due to rounding off error in textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.8: Example_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "T=250 + 460 //R\n", "p=29.825 //psia\n", "pt=50 //psia\n", "vg=13.821 //ft^3/lbm\n", "M=29\n", "R=10.73\n", "//calculations\n", "pa=pt-p\n", "V=1/M *R*T/pa\n", "ma=V/vg\n", "xa=p/pt\n", "mb=xa/M *18/(1-xa)\n", "//results\n", "printf('In case 1, volume occupied = %.2f ft^3',V)\n", "printf('\n In case 1, mass of steam = %.2f lbm steam',ma)\n", "printf('\n In case 2, mass of steam = %.3f lbm steam',mb)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 10.9: Example_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "ps=0.64 //psia\n", "p=14.7 //psia\n", "M=29\n", "M2=46\n", "//calculations\n", "xa=ps/p\n", "mb=xa*9/M *M2/(1-xa)\n", "//results\n", "printf('percentage = %d percent',mb*100)" ] } ], "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 }