{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 13 Fluid flow" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.1 Pg:583" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "velocity in ft/s are:\n", "0.000000 \t1118.735268 \t1663.871913 \t1791.374302 \t2179.668416 \t2779.331106 \t\n", "\n", "Area in ft**2 are:\n", "0.000000 \t0.006600 \t0.005534 \t0.005495 \t0.005760 \t0.007656 \t\n", "\n", "The initial values of velocity and area are 0 and infinity respectively. Since, Infinity in calculations stops the code to display an error. It has been mentioned separately.\n" ] } ], "source": [ "from numpy import nditer\n", "from math import sqrt\n", "#Initialization of variables\n", "h1=1329.1 #Btu/lbm\n", "v1=6.218 #ft**3/lbm\n", "J=778\n", "g=32.174\n", "m=1\n", "#calculations\n", "p=[80, 60 ,54.6, 40, 20]\n", "h=[ 1304.1, 1273.8, 1265 ,1234.2, 1174.8]\n", "v=[ 7.384, 9.208, 9.844 ,12.554, 21.279]\n", "Fc=1\n", "V2=[Fc*sqrt(2*J*g*(h1-hh)) for hh in h]\n", "A=[m*v1/V21 for v1,V21 in nditer([v,V2])]\n", "V2=[0]+V2\n", "A=[0]+A\n", "#results\n", "print 'velocity in ft/s are:'\n", "for vv in V2:\n", " print '%.6f'%vv,'\\t', \n", "print '\\n\\nArea in ft**2 are:'\n", "for aa in A:\n", " print '%.6f'%aa,'\\t',\n", "print '\\n\\nThe initial values of velocity and area are 0 and infinity respectively. Since, Infinity in calculations stops the code to display an error. It has been mentioned separately.'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.2 Pg:584" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Area required = 0.00464 ft**2\n", "\n", " Area in case 2 at the exit= 0.00379 ft**2\n" ] } ], "source": [ "from math import sqrt\n", "#Initialization of variables\n", "n=1.4\n", "p1=50 #psia\n", "J=778\n", "cp=0.24\n", "T1=520 #R\n", "k=n\n", "R=1545/29\n", "m=1\n", "p2=10 #psia\n", "#calculations\n", "rpt=(2/(n+1))**(n/(n-1))\n", "pt=p1*rpt\n", "Vtrev=223.77*sqrt(cp*T1*(1- rpt**((k-1)/k)))\n", "v1=R*T1/p1/144\n", "vt=v1*(p1/pt)**(1/k)\n", "At=m*vt/Vtrev\n", "V2rev=223.77*sqrt(cp*T1*(1-(p2/p1)**((k-1)/k)))\n", "v2=v1*(p1/p2)**(1/k)\n", "A2=m*v2/V2rev\n", "#results\n", "print \"Area required = %.5f ft**2\"%(At)\n", "print \"\\n Area in case 2 at the exit= %.5f ft**2\"%(A2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.3 Pg:585" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Throat area= 0.0056 ft**2\n" ] } ], "source": [ "#Initialization of variables\n", "J=778\n", "g=32.2\n", "pc=54.6 #psia\n", "h1=1329.1 #Btu/lbm\n", "h2=1265 #btu/lbm\n", "V2rev=1790 #ft/s\n", "cv=0.99\n", "m=1 #lbm\n", "cv2=0.96\n", "#calculations\n", "V2d=cv*V2rev\n", "hd=cv**2 *(h1-h2)\n", "h2d=h1-hd\n", "v2d=9.946\n", "A2d=m*v2d/V2d\n", "#results\n", "print \"Throat area= %.4f ft**2\"%(A2d)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.4 Pg:585" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "average velocity = 31.3 ft/sec\n", "\n", " mass flow rate = 29.0 lbm/sec\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "zm=0.216\n", "pm=62.3 #lbm/ft**2\n", "p1=0.0736 #lbm/ft**2\n", "g=32.2\n", "d=4\n", "#calculations\n", "H=zm*(pm-p1)/12/p1\n", "V=sqrt(2*g*H)\n", "m=pi/4 *d**2 *V*p1\n", "#results\n", "print \"average velocity = %.1f ft/sec\"%(V)\n", "print \"\\n mass flow rate = %.1f lbm/sec\"%(m)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.5 Pg:586" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "From table B-17,\n", "Area of throat = 0.00596 ft**2\n", "\n", " Area of exit = 0.00805 ft**2\n" ] } ], "source": [ "from math import sqrt\n", "#Initialization of variables\n", "p0=50 #psia\n", "T0=520 #R\n", "rho0=0.259 #lbm/ft**3\n", "p2=10 #psia\n", "mf=1 #lbm\n", "#calculations\n", "print \"From table B-17,\"\n", "pr=0.528\n", "Tr=0.833\n", "rhor=0.634\n", "ps=pr*p0\n", "Ts=Tr*T0\n", "rhos=rho0*rhor\n", "Vs=49.1*sqrt(Ts)\n", "As=mf/(Vs*rhos)\n", "p2r=p2/p0\n", "M2=1.71\n", "V2=1.487*Vs\n", "T2=0.632*Ts\n", "A2=As*1.35\n", "rho2=rhos*0.317\n", "#results\n", "print \"Area of throat = %.5f ft**2\"%(As)\n", "print \"\\n Area of exit = %.5f ft**2\"%(A2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.6 Pg:587" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Length of pipe = 406.3 ft\n" ] } ], "source": [ "#Initialization of variables\n", "M1=0.2\n", "M2=0.4\n", "D=0.5 #ft\n", "f=0.015\n", "#calculations\n", "f1=14.5\n", "f2=2.31\n", "dl=(f1-f2)*D/f\n", "#results\n", "print \"Length of pipe = %.1f ft\"%(dl)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.7 Pg:588" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "from table B-19\n", "Change in entropy = 0.0224 Btu/lbm R\n" ] } ], "source": [ "from math import log\n", "#Initialization of variables\n", "py=20 #psia\n", "px=3.55 #psia\n", "R=1.986/29\n", "#calculations\n", "pr=py/px\n", "print \"from table B-19\"\n", "Mx=2\n", "My=0.577\n", "pr2=0.721\n", "ds=R*log(1/pr2)\n", "#results\n", "print \"Change in entropy = %.4f Btu/lbm R\"%(ds)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.8 Pg:588" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "From table B-18 and B-17,\n", "Mach numbers before and after are 1.64 and 0.658 respectively\n", "\n", " Pressure before and after are 11.0 psia and 32.9 psia\n", "\n", " Exhaust pressure = 32.3 psia\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "pi=50 #psia\n", "pe=34.6 #psia\n", "#calculations\n", "print \"From table B-18 and B-17,\"\n", "pr1=1.35\n", "p0f=pi/pr1\n", "pfs=0.528*p0f\n", "per=pe/pfs\n", "Me=0.6\n", "p0e=1.19\n", "pyx=p0e/pr1\n", "Mx=1.64\n", "My=0.658\n", "px=0.22*pi\n", "py=32.9 #psia\n", "p2yx=0.852\n", "pe2=1.65*pfs\n", "#results\n", "print \"Mach numbers before and after are %.2f and %.3f respectively\"%(Mx,My)\n", "print \"\\n Pressure before and after are %.1f psia and %.1f psia\"%(px,py)\n", "print \"\\n Exhaust pressure = %.1f psia\"%(pe2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.9 Pg:589" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "From table B-20\n", "Heat required = 272 Btu/lbm\n" ] } ], "source": [ "#Initialization of variables\n", "T1=550 #R\n", "T2=2660 #R\n", "ts1=0.207\n", "ts2=0.833\n", "cp=0.24\n", "#calculations\n", "Ts=T1/ts1\n", "Ts0=T2/ts2\n", "print \"From table B-20\"\n", "tr1=0.529\n", "tr2=0.174\n", "dq=cp*Ts0*(tr1-tr2)\n", "#results\n", "print \"Heat required = %d Btu/lbm\"%(dq)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.10 Pg:590" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Internal thrust = 3651 lbf\n", "\n", " Net thrust = 2593 lbf\n", "The answers are a bit different due to rounding off error in textbook\n" ] } ], "source": [ "#Initialization of variables\n", "M1=0.5\n", "M2=1\n", "A1=0.5 #ft**2\n", "A2=1 #ft**2\n", "p1=14.7 #psia\n", "p2=14.7 #psia\n", "k=1.4\n", "#calculations\n", "thru=p2*144*A2*(1+k*M2**2)-p1*144*A1*(1+k*M1**2)\n", "net=thru-p1*144*(A2-A1)\n", "#results\n", "print \"Internal thrust = %d lbf\"%(thru)\n", "print \"\\n Net thrust = %d lbf\"%(net)\n", "print \"The answers are a bit different due to rounding off error in textbook\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.11 Pg:590" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "mass flow rate = 0.572 lbm/sec\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "p1=50 #psia\n", "pr=0.58\n", "#calculations\n", "p=p1*pr\n", "s1=1.6585\n", "h1=1174.1 #Btu/lbm\n", "sf=0.3680\n", "sfg=1.3313\n", "hfg=945.3\n", "vg=13.746\n", "hf=218.82\n", "x= (s1-sf)/sfg\n", "v2=vg*x\n", "h2=hf+x*hfg\n", "V2rev=223.77*sqrt(h1-h2)\n", "m=pi/4 *1/144 *V2rev/v2\n", "#results\n", "print \"mass flow rate = %.3f lbm/sec\"%(m)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.12 Pg:591" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass flow rate = 0.597 lbm/sec\n", "\n", " Meta stable under cooling = 52 F\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "k=1.31\n", "p1=7200 #lbf/ft**2\n", "v1=8.515 #ft**3/lbm\n", "pr=0.6\n", "m1=0.574\n", "T1=741 #R\n", "#calculations\n", "V2rev=8.02*sqrt(k/(k-1) *p1*v1*(1- (pr)**((k-1)/k)))\n", "v2=v1*(1/pr)**(1/k)\n", "m=pi/4 *1/144 *V2rev/v2\n", "C=m/m1\n", "T2=T1*(0.887)\n", "t=250+460 #R\n", "dt=t-T2\n", "#results\n", "print \"Mass flow rate = %.3f lbm/sec\"%(m)\n", "print \"\\n Meta stable under cooling = %d F\"%(dt)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.13 Pg:592" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Area = 1.344 in**2\n", "\n", " diameter = 1.31 in\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "C=0.98\n", "m=1\n", "v=12.55 #ft**3/lbm\n", "V=1372 #ft/s\n", "#calculations\n", "A=m*v/(C*V) *144\n", "D=sqrt(A*4/pi)\n", "#results\n", "print \"Area = %.3f in**2\"%(A)\n", "print \"\\n diameter = %.2f in\"%(D)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.14 Pg:593" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Area = 0.92 in**2\n", "\n", " diameter = 1.080 in\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "nn=0.95\n", "p1=50 #psia\n", "p2=30 #psia\n", "v1=8.515\n", "m=1 #lbm\n", "#calculations\n", "cv=sqrt(nn)\n", "V2rev=1372\n", "V2act=cv*V2rev\n", "n=1.283\n", "v2=v1*(p1/p2)**(1/n)\n", "A=m*v2/V2act *144\n", "D=sqrt(A*4/pi)\n", "#results\n", "print \"Area = %.2f in**2\"%(A)\n", "print \"\\n diameter = %.3f in\"%(D)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.15 Pg:593" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Coefficient of discharge = 0.991 \n" ] } ], "source": [ "#Initialization of variables\n", "dFf=110.5 #ft-lbf/lbm\n", "Vd=1028 #ft/s\n", "gc=32.2 #ft/s**2\n", "p0=100 #psia\n", "k=1.4\n", "v0=2.08\n", "p1=55 #psia\n", "p2=99.2 #psia\n", "#calculations\n", "dFe=0.01*Vd**2 /(2*gc)\n", "dF=dFf+dFe\n", "V2ig=(p0*144)**(1/k) *v0/(1-1/k) *((p1*144)**(1-1/k) -(p2*144)**(1-1/k))\n", "C2=(V2ig+dF)/V2ig\n", "C=sqrt(C2)\n", "#results\n", "print \"Coefficient of discharge = %.3f \"%(C)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.16 Pg:594" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Pressure drop in the nozzle = 3.60 lbf/ft**2\n", "\n", " Coefficient of discharge = 0.982 \n" ] } ], "source": [ "from __future__ import division\n", "from math import pi,sqrt\n", "#Initialization of variables\n", "dL=1/6 #ft\n", "mf=0.430 #lbm/sec\n", "rho=62.4 \n", "gc=32.2 #ft/s**2\n", "d=0.81/12 #ft\n", "#calculations\n", "V=mf*4/(rho*pi)\n", "VD=V/dL**2\n", "Vd=1.92 #ft/s\n", "dFf=0.031/(2*gc) *2.31\n", "dFe=0.04*Vd**2 /(2*gc)\n", "dF=dFf+dFe\n", "dp=rho*(3.5/(2*gc) +dF)\n", "vd22=(2*gc)/rho *dp /(1-(d/dL)**4)\n", "vd2=sqrt(vd22)\n", "C=Vd/vd2\n", "#results\n", "print \"Pressure drop in the nozzle = %.2f lbf/ft**2\"%(dp)\n", "print \"\\n Coefficient of discharge = %.3f \"%(C)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:13.17 Pg:595" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "mass flow rate = 1.176 lbm/sec\n", "\n", " Coefficient of discharge = 0.598\n" ] } ], "source": [ "#Initialization of variables\n", "K=0.6003\n", "Y1=0.91\n", "D1=6.065\n", "D2=1.820\n", "rho1=0.156\n", "p1=30\n", "p2=20.18\n", "#calculations\n", "bet=D2/D1\n", "m=0.525*K*Y1 *D2**2 *sqrt(rho1*(p1-p2))\n", "C=K*sqrt(1-bet**4)\n", "#results\n", "print \"mass flow rate = %.3f lbm/sec\"%(m)\n", "print \"\\n Coefficient of discharge = %.3f\"%(C)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }