{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 12 Non steady flow friction and availibility" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.1 Pg:482" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Work done in case 1 = 572 Btu\n" ] } ], "source": [ "#Initialization of variables\n", "p1=100 #psia\n", "p2=14.7 #psia\n", "k=1.4\n", "T1=700 #R\n", "R=10.73/29\n", "V=50\n", "cv=0.171\n", "cp=0.24\n", "R2=1.986/29\n", "#calculations\n", "T2=T1/ (p1/p2)**((k-1)/k)\n", "m1=p1*V/(R*T1)\n", "m2=p2*V/(R*T2)\n", "Wrev= cv*(m1*T1 - m2*T2) - (m1-m2)*(T2)*cp\n", "#results\n", "print \"Work done in case 1 = %d Btu\"%(Wrev)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.2 Pg:482" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The friction of the process per pound of air = 18.6 Btu/lbm\n", "\n", " Loss of available energy = -16.20 Btu/lbm\n" ] } ], "source": [ "from __future__ import division\n", "from scipy import log\n", "#Initialization of variables\n", "p1=100 #psia\n", "p2=10 #psia\n", "n=1.3\n", "T1=800 #R\n", "cv=0.172\n", "R=1.986/29\n", "T0=537 #R\n", "cp=0.24\n", "#calculations\n", "T2=T1*(p2/p1)**((n-1)/n)\n", "dwir=cv*(T1-T2)\n", "dwr=R*(T2-T1)/(1-n)\n", "dq=dwr-dwir\n", "dI=-T0*(cp*log(T2/T1) - R*log(p2/p1))\n", "#results\n", "print \"The friction of the process per pound of air = %.1f Btu/lbm\"%(dq)\n", "print \"\\n Loss of available energy = %.2f Btu/lbm\"%(dI)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.3 Pg:483" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Friction = 72.9 ft-lbf/lbm\n", "\n", " Available energy loss in case a = -72.9 ft-lbf/lbm\n", "\n", " Available energy loss in case b = -145.9 ft-lbf/lbm\n" ] } ], "source": [ "#Initialization of variables\n", "ms=10 #lbm\n", "den=62.3 #lbm/ft**3\n", "A1=0.0218 #ft**2\n", "A2=0.00545 #ft**2\n", "p2=50 #psia\n", "p1=100 #psia\n", "gc=32.2 #ft/s**2\n", "dz=30 #ft\n", "T0=537 #R\n", "T1=620 #R\n", "T2=420 #R\n", "#calculations\n", "V1=ms/(A1*den)\n", "V2=ms/(A2*den)\n", "df=-144/den*(p2-p1) - (V2**2 -V1**2)/(2*gc) - dz\n", "dI=-T0/T1 *df\n", "dI2= -T0/T2 *df\n", "#results\n", "print \"Friction = %.1f ft-lbf/lbm\"%(df)\n", "print \"\\n Available energy loss in case a = %.1f ft-lbf/lbm\"%(dI)\n", "print \"\\n Available energy loss in case b = %.1f ft-lbf/lbm\"%(dI2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.4 Pg:484" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "From fig 12.4,\n", "Pressure drop = 0.00 lbf/ft**2 100 ft\n", "The answer in the textbook is wrong. Please use a calculator to verify it.\n" ] } ], "source": [ "#Initialization of variables\n", "r=2.5 #in\n", "mf=160 #cfm\n", "rho=1/14\n", "mu=0.0000121\n", "v=14 #ft**3/lbm\n", "g=32.2 #ft/s**2\n", "z=100 #ft\n", "#calculations\n", "A=3.14*(r/12)**2\n", "V=mf/A /60\n", "Re=(2*r/12)*V*rho/mu\n", "print \"From fig 12.4,\"\n", "f=0.0225/4\n", "dp=4*f*(rho)*(V/v)**2 /(2*g*(2*r/12)) *z\n", "#dp=2.32\n", "#results\n", "print \"Pressure drop = %.2f lbf/ft**2 100 ft\"%(dp)\n", "print \"The answer in the textbook is wrong. Please use a calculator to verify it.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.5 Pg:485" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass rate of air flow = 161 cfm\n", "The answer is a bit different due to rounding off error in textbook\n" ] } ], "source": [ "from math import pi,sqrt\n", "#Initialization of variables\n", "D=0.0724 #ft\n", "gc=32.2 #ft/s**2\n", "rho=1.0/14\n", "L=100 #ft\n", "mu2=1.46*10**(-10)\n", "dp=2.32\n", "dia=5.0 #in\n", "rho2=48500.0\n", "vol=14.0 #ft**3/lbm\n", "#calculations\n", "ref=D**3 *2*dp*gc*rho/(mu2*L)\n", "mf=rho2*pi/4 *(dia/12) *sqrt(mu2)\n", "mfr=mf*vol*60\n", "#results\n", "print \"Mass rate of air flow = %d cfm\"%(mfr)\n", "print \"The answer is a bit different due to rounding off error in textbook\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.6 Pg:486" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Loss of available energy = -725 Btu/lbm mixture \n", "\n", " Effectiveness of combustion = 0.409 \n" ] } ], "source": [ "from math import log\n", "#Initialization of variables\n", "cp=0.25\n", "T=3460 #R\n", "T0=520 #R\n", "dG=1228 #Btu/lbm\n", "#calculations\n", "hf=cp*(T-T0)-T0*cp*log(T/T0)\n", "dC=hf-dG\n", "Ec=hf/dG\n", "#results\n", "print \"Loss of available energy = %d Btu/lbm mixture \"%(dC)\n", "print \"\\n Effectiveness of combustion = %.3f \"%(Ec)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.7 Pg:487" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Loss of available energy = -219.3 Btu/lbm mixture \n", "\n", " Efficiency of cycle = 0.563 \n", "\n", " Effectiveness of overall cycle = 0.23\n", "The answer is a bit different due to rounding off error in textbook\n" ] } ], "source": [ "#Initialization of variables\n", "cp1=0.25\n", "T=3460 #R\n", "T0=946.2 #R\n", "T00=520 #R\n", "dG=1228 #Btu/lbm\n", "cp=0.45\n", "#calculations\n", "dqa=cp1*(T-T0)\n", "w=cp*dqa\n", "hf=cp1*(T-T00)-T00*cp1*log(T/T00)\n", "heat=w-hf\n", "eff=w/hf\n", "epower=w/dG\n", "#results\n", "print \"Loss of available energy = %.1f Btu/lbm mixture \"%(heat)\n", "print \"\\n Efficiency of cycle = %.3f \"%(eff)\n", "print \"\\n Effectiveness of overall cycle = %.2f\"%(epower)\n", "print \"The answer is a bit different due to rounding off error in textbook\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Ex:12.8 Pg:487" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "All the values are obtained from Mollier chart,\n", "Engine efficiency = 74.3 percent\n", "\n", " Effectiveness = 80.8 percent\n", "\n", " Loss of available energy = -32.6 Btu/lbm\n" ] } ], "source": [ "#Initialization of variables\n", "p1=400 #psia\n", "t1=600 #F\n", "h1=1306.9 #Btu/lbm\n", "b1=480.9 #Btu/lbm\n", "p2=50 #psia\n", "h2=1122 #Btu/lbm\n", "h3=1169.5 #Btu/lbm\n", "b3=310.9 #Btu/lbm\n", "#calculations\n", "print \"All the values are obtained from Mollier chart,\"\n", "dw13=h1-h3\n", "dw12=h1-h2\n", "dasf=b3-b1\n", "etae=dw13/dw12\n", "eta=abs(dw13/dasf)\n", "dq=dw13+dasf\n", "#results\n", "print \"Engine efficiency = %.1f percent\"%(etae*100)\n", "print \"\\n Effectiveness = %.1f percent\"%(eta*100)\n", "print \"\\n Loss of available energy = %.1f Btu/lbm\"%(dq)" ] } ], "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 }