{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 7 : Integral methods of analysis" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.2 - Page No :273\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "from scipy.integrate import quad \n", "\n", "\n", "# Variables\n", "# given\n", "id_ = 4.; \t\t\t #[m] - insid_e diameter\n", "h = 2.; \t\t\t #[m] - water level\n", "ro = 0.03; \t\t\t #[m] - radius of exit hole\n", "rt = id_/2.; \t\t\t #[m] - insid_e radius\n", "g = 9.80665; \t\t\t #[m/sec**2] - gravitational acceleration\n", "\n", "# Calculations\n", "# using the equation dh/h**(1/2) = -((ro**2)/(rt**2))*(2*g)**(1/2)dt and integrating between h = 2 and h = 1\n", "def f6(h): \n", "\t return (1./h**(1./2))*(1./(-((ro**2)/(rt**2))*(2*g)**(1./2)))\n", "\n", "t1 = quad(f6,2,1)[0]\n", "\n", "# Results\n", "print \" Time required to remove half of the contents of the tank is t = %.2f sec = %.2f min\"%(t1,t1/60);\n", "\t\t\t #integrating between h = 2 and h = 0\n", "\n", "def f7(h): \n", "\t return (1./h**(1./2))*(1./(-((ro**2)/(rt**2))*(2*g)**(1./2)))\n", "\n", "t2 = quad(f7,2,0)[0]\n", "\n", "print \" Time required to empty the tank fully is t = %.1f sec = %.1f min\"%(t2,t2/60);\n", "\n", "ro2 = (h**2)*math.sqrt(h*h/g)/(10*60)\n", "print \" Ro**2 = %.6f m**2\"%ro2\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Time required to remove half of the contents of the tank is t = 831.37 sec = 13.86 min\n", " Time required to empty the tank fully is t = 2838.5 sec = 47.3 min\n", " Ro**2 = 0.004258 m**2\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.3 - Page No :274\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "# composition of fuel gas\n", "nH2 = 24.;\n", "nN2 = 0.5;\n", "nCO = 5.9;\n", "nH2S = 1.5;\n", "nC2H4 = 0.1;\n", "nC2H6 = 1;\n", "nCH4 = 64;\n", "nCO2 = 3.0;\n", "\n", "# Calculations\n", "# calculating the theoritical amount of O2 required\n", "nO2theoreq = 12+2.95+2.25+0.30+3.50+128;\n", "# since fuel gas is burned with 40% excess O2,then O2 required is\n", "nO2req = 1.4*nO2theoreq;\n", "nair = nO2req/0.21; \t\t\t # as amount of O2 in air is 21%\n", "nN2air = nair*(0.79); \t\t\t # as amount of N2 in air is 79%\n", "nN2 = nN2+nN2air;\n", "nO2 = nO2req-nO2theoreq;\n", "nH2O = 24+1.5+0.2+3.0+128;\n", "nCO2formed = 72.1;\n", "nCO2 = nCO2+nCO2formed;\n", "nSO2 = 1.5;\n", "ntotal = nSO2+nCO2+nO2+nN2+nH2O;\n", "mpSO2 = (nSO2/ntotal)*100;\n", "mpCO2 = (nCO2/ntotal)*100;\n", "mpO2 = (nO2/ntotal)*100;\n", "mpN2 = (nN2/ntotal)*100;\n", "mpH2O = (nH2O/ntotal)*100;\n", "\n", "\n", "# Results\n", "print \" gas N2 O2 H2O CO2 SO2\";\n", "print \" moles %.1f %.1f %.1f %.1f %.1f\"%(nN2,nO2,nH2O,nCO2,nSO2);\n", "print \" mole percent %.1f %.1f %.1f %.1f %.1f\"%(mpN2,mpO2,mpH2O,mpCO2,mpSO2);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " gas N2 O2 H2O CO2 SO2\n", " moles 785.2 59.6 156.7 75.1 1.5\n", " mole percent 72.8 5.5 14.5 7.0 0.1\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.4 - Page No :280\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "# Variables\n", "# given\n", "id_ = 6.; \t\t\t #[inch] - inlet diameter\n", "od = 4.; \t\t\t #[inch] - outlet diameter\n", "Q = 10.; \t\t\t #[ft**3/sec] - water flow rate\n", "alpha2 = math.pi/3; #[radians] - angle of reduction of elbow\n", "alpha1 = 0.;\n", "p1 = 100.; \t\t #[psi] - absolute inlet pressure\n", "p2 = 29.; \t\t\t #[psi] - absolute outlet pressure\n", "\n", "# Calculations\n", "S1 = (math.pi*((id_/12)**2))/4.;\n", "S2 = (math.pi*((od/12)**2))/4.;\n", "U1 = Q/S1;\n", "U2 = Q/S2;\n", "mu = 6.72*10**-4; \t #[lb*ft**-1*sec**-1]\n", "p = 62.4; \t\t\t #[lb/ft**3]\n", "Nrei = ((id_/12.)*U1*p)/(mu);\n", "\n", "# Results\n", "print \"Nre(inlet) = %.1e\"%Nrei\n", "Nreo = round(((od/12)*U2*p)/(mu),-4);\n", "print \"Nre(outlet) = %.1e \"%Nreo\n", "\n", "# thus\n", "b = 1.;\n", "w1 = p*Q; \t\t\t #[lb/sec] - mass flow rate\n", "w2 = w1;\n", "gc = 32.174;\n", "\n", "# using the equation (w/gc)*((U1)*(math.cos(alpha1))-(U2)*(math.cos(alpha2)))+p1*S1*math.cos(alpha1)-p2*S2*math.cos(alpha2)+Fextx = 0;\n", "Fextx = -(w1/gc)*((U1)*(math.cos(alpha1))-(U2)*(math.cos(alpha2)))-p1*144*S1*math.cos(alpha1)+p2*144*S2*math.cos(alpha2);\n", "print \"Fext,x = %.0f lb\"%Fextx\n", "Fexty = -(w1/gc)*((U1)*(math.sin(alpha1))-(U2)*(math.sin(alpha2)))-p1*144*S1*math.sin(alpha1)+p2*144*S2*math.sin(alpha2);\n", "print \"Fext,y = %.0f lb \"%Fexty\n", "print \"The forces Fext,x and Fext,y are the forces exerted on the fluid_ by the elbow.\\\n", "\\nFext,x acts to the left and Fext,y acts in the positive y direction.\\\n", "\\nNote that the elbow is horizantal,and gravity acts in the z direction\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Nre(inlet) = 2.4e+06\n", "Nre(outlet) = 3.6e+06 \n", "Fext,x = -2522 lb\n", "Fext,y = 2240 lb \n", "The forces Fext,x and Fext,y are the forces exerted on the fluid_ by the elbow.\n", "Fext,x acts to the left and Fext,y acts in the positive y direction.\n", "Note that the elbow is horizantal,and gravity acts in the z direction\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.5 - Page No : 282\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import numpy\n", "\n", "# Variables\n", "Fextx = -2522.; \t\t\t #[lb] - force in x direction\n", "Fexty = 2240.; \t\t\t #[lb] - force in y direction\n", "\n", "# Calculations\n", "# the force exerted by the elbow on the fluid is the resolution of Fext,x and Fext,y , therefore\n", "Fext = ((Fextx)**2+(Fexty)**2)**(1./2);\n", "alpha = 180. - 41.6\n", "\n", "# Results\n", "print \" the force has a magnitude of %.0f lb and a direction of %.1f from \\\n", "\\nthe positive x directionin the second quadrant\"%(Fext,alpha);\n", "\n", "# Note : answers in book is wrong. they have used wrong values everywhere. Please check it manually." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the force has a magnitude of 3373 lb and a direction of 138.4 from \n", "the positive x directionin the second quadrant\n" ] } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.6 - Page No :283\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "id_ = 6.; \t\t\t #[inch] - inlet diameter\n", "od = 4.; \t\t\t #[inch] - outlet diameter\n", "Q = 10.; \t\t\t #[ft**3/sec] - water flow rate\n", "alpha2 = math.pi/3; #[radians] - angle of reduction of elbow\n", "alpha1 = 0.;\n", "p1 = 100.; \t\t #[psi] - absolute inlet pressure\n", "p2 = 29.; \t\t\t #[psi] - absolute outlet pressure\n", "patm = 14.7; \t\t #[psi] - atmospheric pressure\n", "p1gauge = p1-patm;\n", "p2gauge = p2-patm;\n", "S1 = (math.pi*((id_/12.)**2))/4.;\n", "S2 = (math.pi*((od/12.)**2))/4.;\n", "U1 = Q/S1;\n", "U2 = Q/S2;\n", "p = 62.4; \t\t\t #[lb/ft**3]\n", "b = 1.;\n", "w1 = p*Q; \t\t\t #[lb/sec] - mass flow rate\n", "w2 = w1;\n", "gc = 32.174;\n", "\n", "# Calculations\n", "# using the equation Fpress = p1gauge*S1-p2gauge*S2*math.cos(alpha2);\n", "Fpressx = p1gauge*144*S1-p2gauge*144*S2*math.cos(alpha2);\n", "Fpressy = p1gauge*144*S1*math.sin(alpha1)-p2gauge*144*S2*math.sin(alpha2);\n", "wdeltaUx = (w1/gc)*((U2)*(math.cos(alpha2))-(U1)*(math.cos(alpha1)));\n", "wdeltaUy = (w1/gc)*((U2)*(math.sin(alpha2))-(U1)*(math.sin(alpha1)));\n", "Fextx = wdeltaUx-Fpressx;\n", "Fexty = wdeltaUy-Fpressy;\n", "Fext = ((Fextx)**2+(Fexty)**2)**(1./2);\n", "alpha = 180 - 43.4\n", "\n", "# Results\n", "print \" The force has a magnitude of %.0f lb and a direction of %.1f from the positive x directionin the second \\\n", "quadrant\"%(round(Fext,-1),alpha);\n", "print \" Also there is a force on the elbow in the z direction owing to the weight of the elbow \\\n", " plus the weight of the fluid inside\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The force has a magnitude of 3030 lb and a direction of 136.6 from the positive x directionin the second quadrant\n", " Also there is a force on the elbow in the z direction owing to the weight of the elbow plus the weight of the fluid inside\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.7 - Page No :293\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "from scipy.integrate import quad \n", "# Variables\n", "Uo = 1.; \t\t\t #[m/sec]\n", "# using Ux/Uo = y/yo\n", "# assuming any particular value of yo will not change the answer,therefore\n", "yo = 1;\n", "\n", "# Calculations\n", "def f2(y): \n", "\t return (Uo*y)/yo\n", "\n", "Uxavg = quad(f2,0,yo)[0]\n", "\n", "\n", "def f3(y): \n", "\t return ((Uo*y)/yo)**3\n", "\n", "Ux3avg = quad(f3,0,yo)[0]\n", "\n", "# using the formula alpha = (Uxavg)**3/Ux3avg\n", "alpha = (Uxavg)**3/Ux3avg;\n", "\n", "# Results\n", "print \"alpha = \",alpha\n", "print \" Note that the kinetic correction factor alpha has the same final value for \\\n", " laminar pipe flow as it has for laminar flow \\nbetween parallel plates.\"\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "alpha = 0.5\n", " Note that the kinetic correction factor alpha has the same final value for laminar pipe flow as it has for laminar flow \n", "between parallel plates.\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.8 - Page No :293\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Q = 0.03; \t\t\t #[m**3/sec] - volumetric flow rate\n", "id_ = 7.; \t\t\t #[cm] - insid_e diameter\n", "deltaz = -7.; \t\t #[m] - length of pipe\n", "T1 = 25.; \t\t\t #[degC] - lowere sid_e temperature\n", "T2 = 45.; \t\t\t #[degC] - higher sid_e temperature\n", "g = 9.81; \t\t\t #[m/sec**2] - acceleration due to gravity\n", "deltaP = 4.*10**4; #[N/m**2] - pressure loss due to friction\n", "p = 1000.; \t\t #[kg/m**3] - density of water \n", "w = Q*p;\n", "C = 4184.; \t\t #[J/kg*K) - heat capacity of water\n", "\n", "# Calculations\n", "deltaH = w*C*(T2-T1);\n", "# using the formula Qh = deltaH+w*g*deltaz\n", "Qh = deltaH+w*g*deltaz;\n", "\n", "# Results\n", "print \" the duty on heat exchanger is Q = %.2e J/sec\"%(Qh);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the duty on heat exchanger is Q = 2.51e+06 J/sec\n" ] } ], "prompt_number": 56 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.10 - Page No :298\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "d = 0.03; \t\t\t #[m] - diameter\n", "g = 9.784; \t\t #[m/sec] - acceleration due to gravity\n", "deltaz = -1.;\n", "\n", "# using the equation (1/2)*(U3**2/alpha3-U1**2/alpha1)+g*deltaz = 0\n", "# assuming\n", "alpha1 = 1.;\n", "alpha3 = 1.;\n", "\n", "U1 = 0.;\n", "\n", "# Calculations\n", "U3 = (-2*g*deltaz+(U1**2)/alpha1)**(1/2.);\n", "p = 1000.; \t\t\t #[kg/m**3] - density of water\n", "S3 = (math.pi/4)*(d)**2\n", "w = p*U3*S3;\n", "\n", "# Results\n", "print \" the mass flow rate is w = %.2f kg/sec\"%(w);\n", "\n", "\n", "# using deltap = p*((U3**2)/2+g*deltaz)\n", "deltap = p*((U3**2)/2+g*deltaz);\n", "p1 = 1.01325*10**5; \t\t\t #[N/m**2] - is equal to atmospheric pressure\n", "p2 = p1+deltap;\n", "vp = 0.02336*10**5;\n", "if p2>vp:\n", " print \" the siphon can operate since the pressure at point 2 is greater than the value at which the liquid boils\";\n", "else:\n", " print \" the siphon cant operate since the pressuer at point 2 is less than \\\n", " the value at which the liquid_ boils\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the mass flow rate is w = 3.13 kg/sec\n", " the siphon can operate since the pressure at point 2 is greater than the value at which the liquid boils\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.11 - Page No :300\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "sp = 1.45; \t\t\t # specific gravity of trichloroethylene\n", "pwater = 62.4; \t\t\t #[lb/ft**3] - density of water\n", "p = sp*pwater;\n", "d1 = 1.049; \t\t\t #[inch] - density of pipe at point 1\n", "d2 = 0.6; \t\t\t #[inch] - density of pipe at point 2\n", "d3 = 1.049; \t\t\t #[inch] - density of pipe at point 3\n", "\n", "# Calculations\n", "# using the formula U1*S1 = U2*S2; we get U1 = U2*(d2/d1);\n", "# then using the bernoulli equation deltap/p = (1/2)*(U2**2-U1**2);\n", "deltap = 4.2*(144); \t\t\t #[lb/ft**2] - pressure difference\n", "U2 = ((2*(deltap/p)*(1./(1.-(d2/d1)**4)))**(1./2))*(32.174)**(1./2);\n", "\n", "# umath.sing the formula w = p*U2*S\n", "w = p*U2*((math.pi/4)*(0.6/12)**2);\n", "w1 = w/(2.20462);\n", "\n", "# Results\n", "print \" the mass flow rate is w = %.1f lb/sec or in SI units w = %.2f kg/sec\"%(w,w1);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the mass flow rate is w = 3.9 lb/sec or in SI units w = 1.77 kg/sec\n" ] } ], "prompt_number": 60 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.12 - Page No :301\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Q = 50/(7.48*60); \t #[ft/sec] - volumetric flow rate of water\n", "d1 = 1.; \t\t\t #[inch] - diameter of pipe\n", "deltaz = -5; \t\t #[ft] - distance between end of pipe and math.tank\n", "g = 32.1; \t\t\t #[ft/sec] - acceleration due to gravity\n", "Cp = 1.; \t\t\t #[Btu/lb*F] - heat capacity of water\n", "p = 62.4; \t\t\t #[lb/ft**3] - density of water\n", "S1 = (math.pi/4)*(d1/12.)**2;\n", "U1 = Q/S1;\n", "w = p*Q;\n", "U2 = 0.;\n", "gc = 32.174;\n", "\n", "# Calculations\n", "# using the formula deltaH = (w/2)*((U2)**2-(U1)**2)+w*g*deltaz\n", "deltaH = -(w/(2*gc))*((U2)**2-(U1)**2)-w*(g/gc)*deltaz;\n", "deltaH = deltaH/778; \t\t\t # converting from ftlb/sec to Btu/sec\n", "deltaT = deltaH/(w*Cp);\n", "\n", "# Results\n", "print \" The rise in temperature is %.5f degF\"%(deltaT);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The rise in temperature is 0.01475 degF\n" ] } ], "prompt_number": 62 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.13 - Page No :303\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "deltaz = 30.; \t\t #[ft] - distance between process and the holding math.tank\n", "Q = 100.; \t\t\t #[gpm] - volumetric flow rate of water\n", "p1 = 100.; \t\t #[psig]\n", "p2 = 0.; \t\t\t #[psig]\n", "g = 32.1; \t\t\t #[ft/sec] - acceleration due to gravity\n", "sv = 0.0161; \t\t #[ft**3/lb] - specific volume of water\n", "p = 1./sv; \t\t #[lb/ft**3] - density of water\n", "e = 0.77; \t\t\t # efficiency of centrifugal pump\n", "deltap = (p1-p2)*(144); \t\t\t #[lbf/ft**2]\n", "gc = 32.174;\n", "\n", "# Calculations\n", "# using the equation deltap/p+g*(deltaz)+Ws = 0;\n", "Wst = -deltap/p-(g/gc)*(deltaz);\n", "# using the formula for efficiency e = Ws(theoritical)/Ws(actual)\n", "# therefore\n", "Wsa = Wst/e;\n", "# the calulated shaft work is for a unit mass flow rate of water,therfore for given flow rate multiply it by the flow rate\n", "w = (Q*p)/(7.48*60);\n", "Wsactual = Wsa*w;\n", "power = -Wsactual/(778*0.7070);\n", "\n", "# Results\n", "print \" the required horsepower is %.2f hp\"%(power);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the required horsepower is 8.55 hp\n" ] } ], "prompt_number": 64 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.14 - Page No :304\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "p1 = 5.; \t\t\t #[atm] - initial pressure\n", "p2 = 0.75; \t\t #[atm] - final pressure after expansion through turbine\n", "T = 450.; \t\t\t #[K] - temperature\n", "y = 1.4; \t\t\t # cp/cv for nitrogen\n", "# using the equation Ws = -(y/(y-1))*(p1/density1)*((p2/p1)**((y-1)/y)-1)\n", "R = 8314.; \t\t # gas constant\n", "\n", "# Calculations\n", "p1bydensity = R*T;\n", "Ws = -(y/(y-1))*(p1bydensity)*((p2/p1)**((y-1)/y)-1);\n", "\n", "# Results\n", "print \" the shaft work of the gas as it expands through the turbine and transmits its molecular \\\n", " energy to the rotating blades is \\n Ws = %.2e J/kmol\"%(Ws);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the shaft work of the gas as it expands through the turbine and transmits its molecular energy to the rotating blades is \n", " Ws = 5.48e+06 J/kmol\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.15 - Page No :311\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T = 273.15+25; \t\t #[K] - temperature\n", "R = 8.314; \t\t\t #[kPa*m**3/kmol*K] - gas constant\n", "p = 101.325; \t\t\t #[kPa] - pressure\n", "M = 29.; \t\t\t # molecular weight of gas\n", "pa = (p*M)/(R*T);\n", "sg = 13.45; \t\t\t # specific gravity\n", "pm = sg*1000;\n", "g = 9.807; \t\t\t #[m/sec**2] - acceleration due to gravity\n", "deltaz = 15./100; \t\t #[m]\n", "\n", "# Calculations\n", "# using the equation p2-p1 = deltap = (pm-pa)*g*deltaz\n", "deltap = -(pm-pa)*g*deltaz;\n", "\n", "# Results\n", "print \" the pressure drop is %.2e N/m**2\"%(deltap);\n", "print \" the minus sign means the upstream pressure p1 is greater than p2, i.e ther is a pressure drop.\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " the pressure drop is -1.98e+04 N/m**2\n", " the minus sign means the upstream pressure p1 is greater than p2, i.e ther is a pressure drop.\n" ] } ], "prompt_number": 68 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.16 - Page No :312\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T = 536.67; \t\t\t #[degR]; - temperature\n", "R = 10.73; \t\t\t #[(lbf/in**2*ft**3)*lb*mol**-1*degR] - gas constant\n", "p = 14.696; \t\t\t #[lbf/in**2];\n", "g = 9.807*3.2808; \t\t #[ft/sec**2] - acceleration due to gravity\n", "M = 29.; \t\t\t # molecular weight of gas\n", "\n", "# Calculations\n", "pa = (p*M)/(R*T);\n", "sg = 13.45; \t\t\t # specific gravity\n", "pm = sg*62.4;\n", "deltaz = 15/(2.54*12); #[ft]\n", "gc = 32.174;\n", "\n", "# Results\n", "# using the equation p2-p1 = deltap = (pm-pa)*g*deltaz\n", "deltap = (pm-pa)*(g/gc)*deltaz;\n", "print \"the pressure drop is %.0f lbf/ft**2\"%(deltap);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the pressure drop is 413 lbf/ft**2\n" ] } ], "prompt_number": 71 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.18 - Page No :315\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "at = 0.049; \t\t\t #[in**2] - cross sectional area of the manometer tubing\n", "aw = 15.5; \t\t\t #[in**2] - cross sectional area of the well\n", "g = 32.174; \t\t\t #[ft/sec**2] - acceleration due to gravity\n", "gc = 32.174;\n", "sg = 13.45; \t\t\t #[ specific garvity of mercury\n", "p = 62.4; \t\t\t #[lb/ft**3] - density of water;\n", "pm = sg*p;\n", "deltaz_waterleg = 45.2213;\n", "\n", "# Calculations\n", "# using the equation A(well)*deltaz(well) = A(tube)*deltaz(tube)\n", "deltazt = 70.; \t\t\t #[cm]\n", "deltazw = deltazt*(at/aw);\n", "deltaz = deltazt+deltazw;\n", "deltap_Hg = -pm*(g/gc)*(deltaz/(2.54*12));\n", "\n", "# Results\n", "deltazw = 45.2213; \t\t\t #[cm]\n", "deltap_tap = deltap_Hg+p*(g/gc)*(deltazw/(12*2.54));\n", "print \"deltap_tap = %.0f lbf/ft**2\"%(deltap_tap);\n", "print \"deltap is negative and therefore p1 is greater than p2\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "deltap_tap = -1841 lbf/ft**2\n", "deltap is negative and therefore p1 is greater than p2\n" ] } ], "prompt_number": 73 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.19 - Page No :317\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "p = 749./760; \t\t\t #[atm]\n", "T = 21.+273.15; \t\t #[K]\n", "R = 82.06; \t\t\t #[atm*cm**3/K] - gas constant\n", "v = (R*T)/p; \t\t\t #[cm**3/mole] - molar volume\n", "M = 29.; \t\t\t #[g/mole] - molecular weight\n", "pair = M/v;\n", "m_air = 53.32; \t\t\t #[g]\n", "m_h2o = 50.22; \t\t\t #[g]\n", "ph2o = 0.998; \t\t\t #[g/cm**3] - density of water\n", "\n", "# Calculations\n", "V = (m_air-m_h2o)/(ph2o-pair); \t\t\t #[cm**3]\n", "density = m_air/V;\n", "\n", "# Results\n", "print \" The density of coin is density = %.2f g/cm**3\"%(density);\n", "print \" Consulting a handbook it is seen that this result is correct density for gold\";\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The density of coin is density = 17.15 g/cm**3\n", " Consulting a handbook it is seen that this result is correct density for gold\n" ] } ], "prompt_number": 75 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.20 - Page No :318\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "P = 749./760; \t\t\t #[atm] - pressure\n", "T = 21+273.15; \t\t #[K] - temperature\n", "poak = 38*(1./62.4); \t #[g/cm**3] - density of oak\n", "pbrass = 534/62.4; \t #[g/cm**3] - density of brass\n", "m_brass = 6.7348; \t\t #[g]\n", "pair = 0.001184; \t\t #[g/cm**3] - density of air\n", "\n", "# Calculations\n", "# using the formula m_oak = m_brass*((1-(pair/pbrass))/(1-(pair/poak)))\n", "m_oak = m_brass*((1-(pair/pbrass))/(1-(pair/poak)));\n", "\n", "# Results\n", "print \" True mass of wood = %.3f g\"%(m_oak);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " True mass of wood = 6.747 g\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.21 - Page No :320\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T = 545.67; \t\t\t #[degR] - temperature\n", "R = 1545.; \t\t\t #[Torr*ft**3/degR*mole] - gas constant\n", "M = 29.; \t\t\t #[g/mole] - molecular weight\n", "g = 9.807; \t\t\t #[m/sec**2] - acceleration due to gravity\n", "gc = 9.807; \n", "po = 760.; \t\t\t #[Torr] - pressure\n", "deltaz = 50.; \t\t\t #[ft]\n", "\n", "# Calculations\n", "# using the equation p = po*exp(-(g/gc)*M*(deltaz/R*T))\n", "p = po*math.e**(-(g/gc)*M*(deltaz/(R*T)));\n", "\n", "# Results\n", "print \" p = %.1f Torr \\nThus, the pressure decrease for an elevation of 50ft is very small\"%(p);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " p = 758.7 Torr \n", "Thus, the pressure decrease for an elevation of 50ft is very small\n" ] } ], "prompt_number": 78 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 7.22 - Page No :321\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "To = 545.67; \t\t\t #[degR] - air temperature at beach level\n", "betaa = -0.00357; \t\t #[degR/ft] - constant\n", "R = 1545.; \t\t\t #[Torr*ft**3/degR*mole] - gas constant\n", "M = 29.;\n", "deltaz = 25000.; \t\t #[ft]\n", "po = 760. \n", "\n", "# Calculations\n", "# using the equation ln(p/po) = ((M)/(R*betaa))*ln(To/(To+betaa*deltaz)\n", "p = po*math.exp(((M)/(R*betaa))*math.log(To/(To+betaa*deltaz)));\n", "\n", "# Results\n", "print \" Pressure = %.2f Torr\"%(p);\n", "# using the equation T = To+betaa*deltaz\n", "T = To+betaa*deltaz;\n", "print \" Temperature = %.2f degR\"%(T);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Pressure = 297.16 Torr\n", " Temperature = 456.42 degR\n" ] } ], "prompt_number": 19 } ], "metadata": {} } ] }