{ "metadata": { "name": "", "signature": "sha256:061d7e4b577b807ec47d62ccaff69c19b6ddf8c7eb248995f153a6b3c9a73f96" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 1 : Compressible Flow-Fundamentals" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.1 page : 18" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "\n", "import math \n", "from numpy import linspace\n", "from matplotlib.pyplot import plot,legend,suptitle,xlabel,ylabel\n", "\t\t\t\t\n", "#Input data\n", "m = 0.75 \t\t\t\t#Mass of air in kg \n", "T1 = 800. \t\t\t\t#Intial Temperature in K\n", "P1 = 400. \t\t\t\t#Initial Pressure in kPa\n", "P2 = 150. \t\t\t\t#Final Pressure in kPa\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "R = 0.287 \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "p1 = P2/P1 \t\t\t\t#pressure ratio of process\n", "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", "W = ((m*R*(T1-T2))/(k-1)) \t\t\t\t#Workdone in kJ\n", "\n", "\t\t\t\t\n", "#P-V Diagram\n", "\n", "V1 = (((m*R*T1)/P1)**(1/k))*10**3 \t\t\t\t#Inlet volume in cc\n", "V2 = (((m*R*T2)/P2)**(1/k))*10**3 \t\t\t\t#Final volume in cc\n", "V = linspace(V1,V2,101) \t\t\t\t#Representing volume on graph, adiabatic expansion\n", "P = P1*V1**k/V**k \t\t\t\t#Representing pressure on graph\n", "plot(V, P) \t\t\t\t\t\t\t#Plotting \n", "legend('P*V**k = C') \t\t\t\t#Defining curve\n", "suptitle(\"PV Diagram\")\n", "xlabel(\"V (cc)\")\n", "ylabel(\"P (kPa)\") \t\t\t\t#Titles of axes\n", "\t\t\t\t\n", "#Output\n", "print 'Workdone is %3.2f kJ'%(W)\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Workdone is 105.21 kJ\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEhCAYAAACOZ4wDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2cjXX+x/HXMG5zN6p1tzRiZVEroZKY5LaHqHYrupfS\n3U+qbQubNdX+IqFt26gk6YZSKBRCJtVPUshdNt0ooyhSoSRmfn98rtMc48ycubvO9zrnvJ+Px3mc\na65z93E9xvnM9+7zBRERERERERERERERERERERERERERERGJI4eA1cA6YAZQBVgKdM/3vFuACYW8\nfj2wBrgNSPEeOwV4qOxDFhGRWNsTdvwscCtwLfBkvuctBzpGef2xwCIgswzjCynnw3uKiEgRhX/Z\nXw88AqQBO4BU73w68EURXg/QGNjpHWcAc73j9sD/AauAd4Bm3vmqWItmAzALeBdo4z22FxiLtVjO\nAEYA72GtoMfCPjMLGA+sBD4C2gGzgY+BewuIW0REiiH0ZZ8KvAJc5/08F+jjHQ8FxkR5fbjdWCsj\ng7xkUR0o7x13BV7yjm8HJnrHLYFfyUsWOcBfwt43Lez4aaC3d7wUGOUd3wx8BdQBKgJb871OJKbU\nJJZEUQUbc1gJbAEme+enA/2844u9n0ujFpYg1mGtgBbe+TOA573jDcDasNccAmaG/dwFa3ms9Y5b\nhD02x7tf7912AAeAz4BGpYxdpMRSoz9FJC78DJwc4fwc4EHvsapYQimK47Ev+W/znb8XWAKcj3Vr\nLQ17LIXI9gO53nFlrIvsFGAbMNI7F/KLd58Tdhz6uTwijqhlIYluL/aFPgWYVsTXHAs8Cjwc4bEa\nWPcQwFVh598BLvKOWwAnFvDeocSwC6gGXFjEmEScUrKQRJFbyGPTsS/vwrqgQt1Y67GZUAuAu8Pe\nO/T+Y7BxhVXYX/qh8xOwJLMBa31sAH6IENv3wCTvcxYAKwr59xT2bx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2vSmu54g8FiIiIgmmIrbxTHEX5f0OeLXswxERERERERERERERERERERER\nERERERGREvp/sG5+0yvB71cAAAAASUVORK5CYII=\n", "text": [ "" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.2 page : 18" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "\n", "import math \n", "from numpy import linspace\n", "from matplotlib.pyplot import plot,legend,suptitle,xlabel,ylabel\n", "\n", "\n", "#Input data\n", "V1 = 0.35 \t\t\t\t#Volume of gas in m**3\n", "P1 = 110. \t\t\t\t#Initial Pressure in kPa\n", "T1 = 300. \t\t\t\t#Intial Temperature in K\n", "P2 = 600. \t\t\t\t#Final Pressure in kPa,mismath.sing data\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "Cv = 718. \t\t\t\t#Specific heat at consmath.tant volume in J/kg-K\n", "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "dQ = 0 \t\t\t\t#Heat transfer in J, Since Adiabatic process\n", "m = (P1*10**3*V1)/(R*T1) \t\t\t\t#Mass of air in kg \n", "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", "dU = (m*Cv*(T2-T1))*10**-3 \t\t\t\t#Change in internal energy in kJ\n", "dW = -dU \t\t\t\t#Workdone in kJ, Since dQ = 0\n", "\n", "\t\t\t\t\n", "#P-V Diagram\n", "\n", "V1cc = V1*10**3 \t\t\t\t#Inlet volume in cc\n", "V2cc = V1cc*(T2/T1)**(1/(k-1)) \t\t\t\t#Final volume in cc\n", "V = linspace(V1cc,V2cc,101) \t\t\t\t#Representing volume on graph, adiabatic expansion\n", "P = P2*V1cc**k/V**k \t\t\t\t#Representing pressure on graph\n", "plot(V, P) \t\t\t\t#Plotting \n", "legend('P*V**k = C') \t\t\t\t#Defining curve\n", "suptitle(\"PV Diagram\")\n", "xlabel(\"V (cc)\")\n", "ylabel(\"P (kPa)\") \t\t\t\t#Titles of axes\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Heat transfer is %3i J \\nB)Change in internal energy is %3.3f kJ \\nC)Workdone is %3.3f kJ'%(dQ,dU,dW)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Heat transfer is 0 J \n", "B)Change in internal energy is 60.072 kJ \n", "C)Workdone is -60.072 kJ\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEhCAYAAACDefxEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VPXZ//F32EHWIAJBIYgggqAQFq2AI1WLCqKogIiy\naC1Fi9VWEWuF59dWkUd/Lm2pVlGpCmpREbBsAlFwYd8DsgtBiUrFggsCyfPHfaYZQ1Yyc75nZj6v\n6zrXnHPmzJmbJMw93x1EREREREREREREREREREREREREREREJAkcA1YD64HXgOrAIuDSAtf9GphY\nzOs3AGuAu4AU77kM4InohywiIq4cjNh/CbgT+DnwXIHrPgS6lfD6BsB8YFwU4wurEIN7iohIGUV+\n6I8A/grUA3KASt75dOCTUrweoDnwpbcfAmZ6+12AD4BVwPtAK+98DayEsxF4A/gI6Og9dwh4BCvB\nXAD8HliGlYqejnjPTOD/A8uBTUBn4E1gC/CHIuIWEZETEP7QrwS8BfzCO54JXOnt3wtMKOH1kb7C\nSh0h8pNGLaCit38xMM3b/y3wN2+/LXCE/KSRC1wbcd96Efv/AHp7+4uAh7z9UcCnQEOgCrCnwOtE\nnFBRWRJFdaxNYjmwC5jknZ8KDPT2B3jH5VEXSxTrsVJBG+/8BcAr3v5GYF3Ea44Br0cc98RKIuu8\n/TYRz83wHjd4Ww7wA7ADaFrO2EXKrVLJl4jEhe+ADoWcnwE85j1XA0sspXE69mH/RYHzfwAWAFdj\n1V2LIp5LoXDfA3nef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TsAHwH7gKNZgeT7uf07PebFdiM0Zt4Vg/J1TxjiyvfOn+hhfJNcxDcVKijcE\nKKaYOZn8XhHVgfeAnxKcAYEXkt+m4TqmGkAtb/8k4H2szt51XO9hjYMA47x4XMcE8ArW2BzmMqZz\nsOqg6t69J2MlRdc/p1O8x6ZYPXe4E4OLmNIp/6DgpVjvvRSi08BbMKawRdiX2zCXMfXCqvRPLnCd\nnzH5qh1WF74G60p6t3c+KAMCLyS/95TrmJpjP6c12AfQmIDEdQ5W0ojs8uc6ppOAL8lPsgQgpnvI\n73I7GevV4jqm97yY1pBfLewipmgNCg53Jd0GPBnlmIZjM3TvAb7DSomzAxDTVuAT8ruYT/Q5JhER\nERERERERERERERERERERERERERGRwizk+Om+f82P+72HVQXepeyD2xqSPzeQSFwI8jQiIi5NxSY4\njDSAwufyuQGYRdnnQ8rBpusouBaDiIjEmVTsQ72Sd5yOjbQtzHzyp04Bm+5iHTayOryQ2BnYiOY1\n2BxYzb3zA7CFc0REJM7NxCarBJvvaEIh11Qkf+JIsIkR38cWM4L86S6WAn29/SrYvFNgyWNplOIV\nERGHBpFfHbUam4a+oIbYfEhhjwA3F7imFjY3UGGqkb9OhEjgqU1DpGgzsFmWO2CzCq8u4rqCDeBl\naRBPQWtDSBxR0hAp2iFs2uvnKXoxmy+xRZTC5mOzsoarn+oBB7G1C8LVU1Ujnm9M0W0lIiISZ/pi\nK9i1Kuaa+cCZEcejsSnGVwN/9M6dASzApoxfgTWsg/XQUkO4iEgSGUr+AkFl9TKFt5WIiEiCqoIt\nYFTWwX2nYEsai4iIiIiIiIiIiIiIiIiIiIiIiIiIiEhi+D+m6ixUxfDpowAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.3 page : 21" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\t\t\t\n", "#Input data\n", "P1 = 3.2 \t\t\t\t#Initial Pressure in bar\n", "P2 = 1. \t\t\t\t#Final Pressure in bar\n", "T1 = 475. \t\t\t\t#Initial temperature in K\n", "Mol = 44. \t\t\t\t#Molecular weight of carbondioxide in kg/mol\n", "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "Cv = Cp/k \t\t\t\t#Specific heat capacity at consmath.tant volume in J/kg-K\n", "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final Temperature\n", "dh = Cp*(T1-T2)*10**-3 \t\t\t\t#Enthalpy drop in kJ/kg\n", "dU = Cv*(T2-T1)*10**-3 \t\t\t\t#Change in internal energy in kJ/kg, -ve sign indicates loss\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Temperature is %3.3f K \\nB)Enthalpy drop is %3.3f kJ/kg \\\n", "\\nC)Change in internal energy is %3.2f kJ/kg i.e. %3.2f kJ/kgloss'%(T2,dh,dU,abs(dU))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Temperature is 363.179 K \n", "B)Enthalpy drop is 91.560 kJ/kg \n", "C)Change in internal energy is -70.43 kJ/kg i.e. 70.43 kJ/kgloss\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.4 page : 25" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "P1 = 0.5 \t\t\t\t#Initial Pressure in bar\n", "T1 = 50.+273 \t\t\t\t#Intial Temperature in K\n", "C1 = 240. \t\t\t\t#Inlet velocity in m/s\n", "C2 = 120. \t\t\t\t#Outlet velocity in m/s, mismath.sing data\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "\n", "\t\t\t\t\n", "#Calculation\n", "T2 = T1+((C1**2-C2**2)/(2*Cp)) \t\t\t\t#Final Temperature in K\n", "t1 = T2/T1 \t\t\t\t#Temperature ratio\n", "P2 = P1*t1**(k/(k-1)) \t\t\t\t#Final Pressure in bar\n", "ar = (P1*T2*C1)/(P2*T1*C2) \t\t\t\t#Ratio of outlet to inlet area\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)At outlet: Temperature is %3.2f K \\\n", "\\nPressure is %3.4f bar \\\n", "\\nB)Ratio of outlet to inlet area is %3.4f'%(T2,P2,ar)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)At outlet: Temperature is 344.49 K \n", "Pressure is 0.6265 bar \n", "B)Ratio of outlet to inlet area is 1.7025\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.5 page : 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "m = 25. \t\t\t\t#Mass flow rate of air in kg/s\n", "C2 = 115. \t\t\t\t#Outlet velocity in m/s\n", "P1 = 100. \t\t\t\t#\t\t\t\t#Initial Pressure in kPa\n", "T1 = 300. \t\t\t\t#Intial Temperature in K\n", "C1 = 40. \t\t\t\t#Inlet velocity in m/s\n", "R = 0.287 \t\t\t\t#Specific gas consmath.tant in kJ/kg-K\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "\n", "\t\t\t\t\n", "#Calculation\n", "T2 = T1+((C1**2-C2**2)/(2*Cp)) \t\t\t\t#Final Temperature in K\n", "t1 = T2/T1 \t\t\t\t#Temperature ratio\n", "P2 = P1*t1**(k/(k-1)) \t\t\t\t#Final Pressure in bar\n", "A1 = (m*R*T1)/(P1*C1) \t\t\t\t#Area at inlet in m**2\n", "A2 = (m*R*T2)/(P2*C2) \t\t\t\t#Area at outlet in m**2\n", "F = ((P1*A1)-(P2*A2))+(m*(C1-C2))*10**-3 \t\t\t\t#Axial force on mouthpiece resulting from acceleration of air in kN\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Static pressure at intake face is %3.3f kPa \\\n", "\\nB)Magnitude of axial force on mouthpiece resulting from acceleration of air is %3.3f kN'%(P2,F)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Static pressure at intake face is 93.414 kPa \n", "B)Magnitude of axial force on mouthpiece resulting from acceleration of air is 33.581 kN\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.6 page : 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\t\t\t\n", "#Input data\n", "P = 200. \t\t\t\t#Pressure in kPa\n", "C = 50. \t\t\t\t#Velocity of air in m/s\n", "d = 2.9 \t\t\t\t#Density in kg/m**3\n", "Mol = 32. \t\t\t\t#Molecular weight of oxygen in kg/mol\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "\n", "#Calculation\n", "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "T = P*10**3/(R*d) \t\t\t\t#Temperature in K\n", "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s \n", "M = C/a \t\t\t\t#Mach number \n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Mach number is %3.2f'%(M)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Mach number is 0.16\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.7 page : 32" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "Pa = 1.3 \t\t\t\t#Pressure at section-A in bar\n", "Ta = 50.+273 \t\t\t\t#Temperature at section-A in K\n", "Pb = 1. \t\t\t\t#Pressure at section-B in bar\n", "Tb = 13.+273 \t\t\t\t#Temperature at section-B in K\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "ds = ((Cp*math.log(Tb/Ta))-(R*math.log(Pb/Pa)))*10**-3 \t\t\t\t#The change in the entropy is kJ/kg\n", "#+ve sign indicates A to B\n", "#-ve sign indicates B to A\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'The change in the entropy is %3.4f kJ/kg Since value is -ve, process must takes place from B to A'%(ds)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The change in the entropy is -0.0470 kJ/kg Since value is -ve, process must takes place from B to A\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.8 page : 34" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "V1 = 8. \t\t\t\t#Intial volume in litre\n", "V2 = 7.8 \t\t\t\t#Final volume in litre\n", "P1 = 0.7 \t\t\t\t#Intial Pressure in MPa\n", "P2 = 2.7 \t\t\t\t#Final Pressure in MPa\n", "\n", "\t\t\t\t\n", "#Calculations\n", "K = (P2-P1)/(math.log(V1/V2)) \t\t\t\t#Bulk modulus of liquid in kPa\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Bulk modulus of liquid is %3.3f kPa'%(K)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Bulk modulus of liquid is 78.996 kPa\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.9 page : 35" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "V1 = 0.5 \t\t\t\t#Voume of Water required to fill pressure vessel in m**3\n", "P = 3000. \t\t\t\t#Test pressure in bar\n", "dv = 0.6 \t\t\t\t#Change of empty volume of container due to pressurisation in percentage \n", "K = 20000. \t\t\t\t#Bulk modulus of water in MPa\n", "\n", "\t\t\t\t\n", "#Calculation\n", "m1 = V1*10**3 \t\t\t\t#Mass of water required to fill pressure vessel in kg\n", "Vr = (P*V1)/K \t\t\t\t#Reduced volume of water due to compression in m**3\n", "Vi = dv*V1/100 \t\t\t\t#Increased volume of container in m**3\n", "V = Vr+Vi \t\t\t\t#Volume of additional water required in m**3\n", "m = V*10**3 \t\t\t\t#Mass of additional water required in kg\n", "mt = m1+m \t\t\t\t#Total mass of water required in litre, Since 1kg = 1Lit\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Mass of water to be pumped into the vesel to obtain the desired pressure is %3i lit'%(mt)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Mass of water to be pumped into the vesel to obtain the desired pressure is 578 lit\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.10 page : 35" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "SG_oil = 0.8 \t\t\t\t#Specific gravity of crude oil \n", "K_oil = 153036.*10**4 \t\t\t\t#Bulk modulus of Oil in N/m**2\n", "K_hg = 2648700.*10**4 \t\t\t\t#Bulk modulus of Mercury in N/m**2\n", "d_steel = 7860. \t\t\t\t#Density of steel in kg/m**3\n", "E_steel = 200.*10**9 \t\t\t\t#Modulus of elasticity in Pa\n", "d_hg = 13600. \t\t\t\t#Density of mercury in kg/m**3\n", "d_water = 1000. \t\t\t\t#Density of water in kg/m**3\n", "\n", "\t\t\t\t\n", "#Calculation\n", "d_oil = SG_oil*d_water \t\t\t\t#Density of oil in kg/m**3\n", "a_oil = math.sqrt(K_oil/d_oil) \t\t\t\t#Sonic velocity of crude oil in m/s\n", "a_hg = math.sqrt(K_hg/d_hg) \t\t\t\t#Sonic velocity of mercury in m/s\n", "a_steel = math.sqrt(E_steel/d_steel) \t\t\t\t#Sonic velocity of steel in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Sonic velocity of crude oil is %3.2f m/s \\\n", "\\nB)Sonic velocity of mercury is %3.2f m/s \\\n", "\\nA)Sonic velocity of steel is %3.1f m/s'%(a_oil,a_hg,a_steel)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Sonic velocity of crude oil is 1383.09 m/s \n", "B)Sonic velocity of mercury is 1395.55 m/s \n", "A)Sonic velocity of steel is 5044.3 m/s\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.11 page : 36" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "T = 20.+273 \t\t\t\t#Temperarture of medium in K\n", "Cp_fr = 678. \t\t\t\t#Specific heat capacity at consmath.tant pressure of freon in J/kg-K\n", "Cv_fr = 543. \t\t\t\t#Specific heat capacity at consmath.tant volime of freon in J/kg-K\n", "T_air = 0.+273 \t\t\t\t#Temperature of air in K\n", "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "mol_h = 2. \t\t\t\t#Molecular weight of Hydrogen in kg/mol\n", "mol_water = 18. \t\t\t\t#Molecular weight of water in kg/mol\n", "R_air = 287. \t\t\t\t#Specific gas consmath.tant of air in J/kg-K\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant of hydrogen\n", "k_water = 1.3 \t\t\t\t#Adiabatic consmath.tant of water\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R_h = Ri/mol_h \t\t\t\t#Specific gas consmath.tant of hydrogen in J/kg-K\n", "a_h = math.sqrt(k*R_h*T) \t\t\t\t#Velocity of sound in hydrogen in m/s\n", "R_water = Ri/mol_water \t\t\t\t#Specific gas consmath.tant of water in J/kg-K\n", "a_water = math.sqrt(k_water*R_water*T) \t\t\t\t#Velocity of sound in water vapour in m/s\n", "k_fr = Cp_fr/Cv_fr \t\t\t\t#Adiabatic consmath.tant of feoan\n", "R_fr = Cp_fr-Cv_fr \t\t\t\t#Specific gas consmath.tant of freon in J/kg-K\n", "a_fr = math.sqrt(k_fr*R_fr*T) \t\t\t\t#Velocity of sound in freon in m/s\n", "a_air = math.sqrt(k*R_air*T_air) \t\t\t\t#Sonic Velocity of air at in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Velocity of sound in hydrogen is %3.2f m/s \\\n", "\\nB)Velocity of sound in water vapour is %3.2f m/s \\\n", "\\nC)Velocity of sound in freon is %3.2f m/s \\\n", "\\nD)Sonic Velocity of air at %3i K is %3.4f m/s'%(a_h,a_water,a_fr,T_air,a_air)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Velocity of sound in hydrogen is 1305.83 m/s \n", "B)Velocity of sound in water vapour is 419.44 m/s \n", "C)Velocity of sound in freon is 222.24 m/s \n", "D)Sonic Velocity of air at 273 K is 331.1969 m/s\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.12 page : 41" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "M = 0.85 \t\t\t\t#Mach number\n", "P = 80. \t\t\t\t#Pressure in kPa\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "\n", "\t\t\t\t\n", "#Calculation\n", "Po = P*(1+(((k-1)/2)*M**2))**(k/(k-1)) \t\t\t\t#Pressure acting on the surface of the body in kPa\n", "\n", "\t\t\t\t\n", "#Output \n", "print 'The highest pressure acting on the surface of the body is %3.1f kPa'%(Po)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The highest pressure acting on the surface of the body is 128.3 kPa\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.13 page : 41" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\t\t\t\n", "#Input data\n", "P = 96. \t\t\t\t#Pressure in kPa\n", "T = 27.+273 \t\t\t\t#Temperature in K\n", "dP = 32. \t\t\t\t#Difference between pivot and static pressure\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "d = (P*10**3)/(R*T) \t\t\t\t#Density in kg/m**3\n", "Ci = math.sqrt((2*(dP*10**3))/d) \t\t\t\t#Velocity of incompressible flow in m/s\n", "pr = (dP)/P \t\t\t\t#Pressure ratio\n", "p1 = pr+1 \t\t\t\t#Stagnation to static pressure ratio\n", "M = math.sqrt(((p1**((k-1)/k)-1)*2)/(k-1)) \t\t\t\t#Mach number\n", "Cc = M*math.sqrt(k*R*T) \t\t\t\t#Velocity of compressible flow in m/s\n", "\n", "#Output\n", "print 'A)Air velocity in incompressible flow is %3.1f m/s \\\n", "\\nB)Air velocity if flow is compressible is %3.3f m/s'%(Ci,Cc)\n", "\n", "# note : rounding off error." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Air velocity in incompressible flow is 239.6 m/s \n", "B)Air velocity if flow is compressible is 227.226 m/s\n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.14 page : 42" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "T1 = 200.+273 \t\t\t\t#Intial Temperature in K\n", "P1 = 1.7 \t\t\t\t#Initial Pressure in bar\n", "P2 = 1. \t\t\t\t#Final Pressure in bar\n", "C1 = 30. \t\t\t\t#Inlet velocity in m/s\n", "m = 1. \t\t\t\t#Mass flow rate in kg/s\n", "D = 0.025 \t\t\t\t#Nozzle diameter in m\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "R = 287. \t\t\t\t#Specific Gas consmath.tant in J/kg-K\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "p1 = P2/P1 \t\t\t\t#Pressure ratio\n", "T2 = T1*p1**((k-1)/k) \t\t\t\t#Final temperature in K\n", "E1 = T1+(C1**2/(2*Cp)) \t\t\t\t#LHS of Steady flow energy equation\n", "C2 = math.sqrt((E1-T2)*2*Cp) \t\t\t\t#Exit velocity of the air in m/s\n", "d2 = (P2*10**5)/(R*T2) \t\t\t\t#Density at outlet in kg/m**3\n", "A2 = math.pi*D**2/4 \t\t\t\t#Area at outlet in m**2\n", "n = ceil(m/(d2*A2*C2)) \t\t\t\t#Number of nozzles to be used\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Exit velocity of the air is %3.2f m/s \\\n", "\\nB)Number of nozzles to be used are %1.0f'%(C2,n)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Exit velocity of the air is 366.94 m/s \n", "B)Number of nozzles to be used are 7\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.15 page : 44" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\t\t\t\n", "#Input data\n", "Po = 300. \t\t\t\t#Pressure in the vessel in kPa\n", "To = 50.+273 \t\t\t\t#Temperature in vessel in K\n", "M = 1. \t\t\t\t#Mach number \n", "k = 1.667 \t\t\t\t#Adiabatic consmath.tant\n", "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "Mol = 4. \t\t\t\t#Molecular weight of helium in kg/mol\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "Cp = (k*R)/(k-1) \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "p1 = (2/(k+1))**(k/(k-1)) \t\t\t\t#Pressure ratio\n", "Pt = Po*p1 \t\t\t\t#Pressure at test condition in kPa\n", "t1 = (2/(k+1)) \t\t\t\t#Temperature ratio \n", "Tt = To*t1 \t\t\t\t#Temperature at test condition in K\n", "at = math.sqrt(k*R*Tt) \t\t\t\t#Velocity of sound in m/s\n", "Ct = at \t\t\t\t#Velocity of gas at test condition in m/s\n", "Cmax = math.sqrt(2*Cp*To) \t\t\t\t#Maximum velocity due to expanding of gases through nozzle system in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)At test point: \\\n", "\\nPressure is %3.2f kPa \\\n", "\\nTemperature is %3.2f K \\\n", "\\nVelocity is %3.1f m/s \\\n", "\\nB)Maximum velocity due to expanding of gases through nozzle system is %3.2f m/s'%(Pt,Tt,Ct,Cmax)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)At test point: \n", "Pressure is 146.13 kPa \n", "Temperature is 242.22 K \n", "Velocity is 916.1 m/s \n", "B)Maximum velocity due to expanding of gases through nozzle system is 1831.88 m/s\n" ] } ], "prompt_number": 25 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.16 page :43" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "T = 40+273 \t\t\t\t#Temperature in K\n", "p1 = 0.5 \t\t\t\t#Static to Stagnation pressure ratio\n", "k = 1.67 \t\t\t\t#Adiabatic consmath.tant\n", "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "Mol = 39.94 \t\t\t\t#Molecular weight of argon in kg/mol\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R = Ri/Mol \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "p2 = 1/p1 \t\t\t\t#Pressure ratio\n", "M = math.sqrt(((p2**((k-1)/k)-1)*2)/(k-1)) \t\t\t\t#Mach number \n", "C = M*math.sqrt(k*R*T) \t\t\t\t#Velocity in the flow in m/s\n", "\n", "\t\t\t\t\n", "#Output \n", "print 'A)Mach number is %3.3f \\\n", "\\nB)Velocity in the flow is %3.1f m/s'%(M,C)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Mach number is 0.978 \n", "B)Velocity in the flow is 322.7 m/s\n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.17 page : 46" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "M = 2.5 \t\t\t\t#Mach number \n", "h = 10 \t\t\t\t#Height in km\n", "\n", "\t\t\t\t\n", "#Calculation\n", "alp = math.asin((1/M)) \t\t\t\t#Mach cone angle in degree\n", "d = 10/math.tan((alp)) \t\t\t\t#Distance the jet would cover before a sonic boom is heard on ground in km\n", "\t\t\t\t\n", "#Output\n", "print 'Distance the jet would cover before a sonic boom is heard on ground is %3.2f km'%(d)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Distance the jet would cover before a sonic boom is heard on ground is 22.91 km\n" ] } ], "prompt_number": 37 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.18 page : 46" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "h = 1100 \t\t\t\t#Height in m\n", "M1 = 2.5 \t\t\t\t#Mach number of aircraft @h\n", "T = 280 \t\t\t\t#Temperature @h\n", "M2 = 0.5 \t\t\t\t#Mach number of observer\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "alp = math.sin((1/M1)) \t\t\t\t#Mach cone angle in degree\n", "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s\n", "C1 = M1*a \t\t\t\t#Velocity of aircraft when the observer is stationary in m/s\n", "t1 = h/(C1*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is stationary in sec\n", "C2 = (M1-M2)*a \t\t\t\t#Velocity of aircraft when the observer is moving in the direction of aircraft in m/s\n", "t2 = h/(C2*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is moving in the direction of aircraft in sec\n", "C3 = (M1+M2)*a \t\t\t\t#Velocity of aircraft when the observer is moving in the opposite direction in m/s\n", "t3 = h/(C3*(math.tan(alp))) \t\t\t\t#Time elapsed when the observer is moving in the opposite direction in sec\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Time elapsed when the observer is stationary is %3.3f sec \\\n", "\\nB)Time elapsed when the observer is moving in the direction of aircraft with M = %3.1f is %3.2f sec \\\n", "\\nC)Time elapsed when the observer is moving in the opposite direction is %3.2f sec'%(t1,M2,t2,t3)\n", "\n", "# note : rounding off error ." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Time elapsed when the observer is stationary is 3.197 sec \n", "B)Time elapsed when the observer is moving in the direction of aircraft with M = 0.5 is 4.00 sec \n", "C)Time elapsed when the observer is moving in the opposite direction is 2.66 sec\n" ] } ], "prompt_number": 43 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.19 page : 55" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "P = 200. \t\t\t\t#Pressure in kPa\n", "d = 2.9 \t\t\t\t#Density in kg/m**3\n", "C = 50. \t\t\t\t#Velocity in m/s\n", "mol = 32. \t\t\t\t#Molecular weight of oxygen in kg/mol\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "Ri = 8314. \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R = Ri/mol \t\t\t\t#Specific gas Consmath.tant in J/kg-k\n", "T = (P*10**3)/(R*d) \t\t\t\t#Temperature in K\n", "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s \n", "M = C/a \t\t\t\t#Mach number\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Mach number is %3.4f'%(M)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Mach number is 0.1609\n" ] } ], "prompt_number": 45 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.20 page : 55" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "C = 200 \t\t\t\t#Velocity of object in m/s\n", "mol = 4 \t\t\t\t#Molecular weight of helium in kg/mol\n", "k = 1.67 \t\t\t\t#Adiabatic consmath.tant\n", "Ri = 8314 \t\t\t\t#Ideal gas consmath.tant in J/mol-K\n", "T = 288 \t\t\t\t#Temperature in K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "R = Ri/mol \t\t\t\t#Specific gas Consmath.tant in J/kg-k\n", "a = math.sqrt(k*R*T) \t\t\t\t#Velocity of sound in m/s\n", "M = C/a \t\t\t\t#Mach number \n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Mach number is %3.1f'%(M)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Mach number is 0.2\n" ] } ], "prompt_number": 46 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.21 page : 56" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "Z1 = 0. \t\t\t\t#Height from sea level in m\n", "Z2 = 11. \t\t\t\t#Height from sea level in m\n", "T1 = 288. \t\t\t\t#Temperature @Z1 in K, from gas tables\n", "T2 = 216.5 \t\t\t\t#Temperature @Z2 in K, from gas tables\n", "C = 1000.*(5./18) \t\t\t\t#Velocity in m/s\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity @Z1 in m/s\n", "M1 = C/a1 \t\t\t\t#Mach number @Z1\n", "a2 = math.sqrt(k*R*T2) \t\t\t\t#Sound velocity @Z2 in m/s\n", "M2 = C/a2 \t\t\t\t#Mach number @Z2\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Speed of sound at: \\\n", "\\nsea level is %3.2f and altitude of %3i km is %3.2f m/s \\\n", "\\nB)Mach numbeer at: sea level is %3.2f an altitude of %3i km is %3.2f'%(a1,Z2,a2,M1,Z2,M2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Speed of sound at: \n", "sea level is 340.17 and altitude of 11 km is 294.94 m/s \n", "B)Mach numbeer at: sea level is 0.82 an altitude of 11 km is 0.94\n" ] } ], "prompt_number": 50 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.22 page : 56" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "T = 300+273 \t\t\t\t#Static Temperature in K\n", "C = 200 \t\t\t\t#Velocity in m/s\n", "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation Temperature in K\n", "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum possible velocity obtained by air in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Maximum possible velocity obtained by air is %3.f m/s'%(C_max)\n", "\n", "# rounding off error." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Maximum possible velocity obtained by air is 1091 m/s\n" ] } ], "prompt_number": 52 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.23 page : 57" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "dT = 37 \t\t\t\t#Temperature difference between air inside the tyre and nozzle exit\n", "Cp = 1005 \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "C = math.sqrt(2*Cp*dT) \t\t\t\t#Exit velocity of air in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Exit velocity of air is %3.1f m/s'%(C)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Exit velocity of air is 272.7 m/s\n" ] } ], "prompt_number": 53 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.24 page : 57" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "C = 800*(5./18) \t\t\t\t#Velocity in m/s\n", "Po = 105. \t\t\t\t#Stagnation pressure in kPa\n", "To = 35.+273 \t\t\t\t#Stagnation temperature in K\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "T = To-(C**2/(2*Cp)) \t\t\t\t#Static temperature in K\n", "P = Po*(T/To)**(k/(k-1)) \t\t\t\t#Static pressure in kPa\n", "a = math.sqrt(k*R*T) \t\t\t\t#Sound Velocity in m/s \n", "M = C/a \t\t\t\t#Mach number\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Static conditions: \\\n", "\\nPressure is %3.2f kPa \\\n", "\\nTemperature is %3.2f K \\\n", "\\nSound Velocity is %3.2f m/s \\\n", "\\nB)Mach number is %3.2f'%(P,T,a,M)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Static conditions: \n", "Pressure is 78.49 kPa \n", "Temperature is 283.43 K \n", "Sound Velocity is 337.47 m/s \n", "B)Mach number is 0.66\n" ] } ], "prompt_number": 54 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.25 page : 57" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "C = 215 \t\t\t\t#Velocity in m/s\n", "T = 30+273 \t\t\t\t#Static temperature in K\n", "P = 5 \t\t\t\t#Static pressure in bar\n", "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "\n", "\t\t\t\t\n", "#Calculations\n", "a = math.sqrt(k*R*T) \t\t\t\t#Sound Velocity in m/s \n", "M = C/a \t\t\t\t#Mach number\n", "To = T*(1+(((k-1)/2)*M**2)) \t\t\t\t#Stagnation temperature in K\n", "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Stagnation Pressure is %3.4f bar \\\n", "\\nB)Mach number is %3.3f'%(Po,M)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Stagnation Pressure is 6.4599 bar \n", "B)Mach number is 0.616\n" ] } ], "prompt_number": 55 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.26 page : 58" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "T = 400. \t\t\t\t#Static temperature in K\n", "k = 1.4 \t\t\t\t#Adiabatic Consmath.tant\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", "C = a \t\t\t\t#Velocity of jet in m/s, Since jet has sonic velocity\n", "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", "ao = math.sqrt(k*R*To) \t\t\t\t#Sound velocity at Stagnation condition in m/s \n", "ho = (Cp*To)*10**-3 \t\t\t\t#Stagnation enthalpy in kJ/kg\n", "C_max = math.sqrt(2*Cp*To) \t\t\t\t#Maximum velocity of jet in m/s\n", "cr = C/C_max \t\t\t\t#Crocco number\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Velocity of sound at %3i K is %3.3f m/s \\\n", "\\nB)Velocity of sound at stagnation condition is %3.3f m/s \\\n", "\\nC)Maximum velocity of jet is %3.3f m/s \\\n", "\\nD)Stagnation enthalpy is %3.3f kJ/kg \\\n", "\\nE)Crocco number is %3.4f'%(T,C,ao,C_max,ho,cr)\n", "\n", "# rounding off error." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Velocity of sound at 400 K is 400.899 m/s \n", "B)Velocity of sound at stagnation condition is 439.145 m/s \n", "C)Maximum velocity of jet is 982.202 m/s \n", "D)Stagnation enthalpy is 482.360 kJ/kg \n", "E)Crocco number is 0.4082\n" ] } ], "prompt_number": 57 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.27 page : 59" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "C = 250. \t\t\t\t#Velocity of air in m/s \n", "D = 10. \t\t\t\t#Diameter in duct in cm\n", "T = 5.+273 \t\t\t\t#Static temperature in K\n", "P = 40. \t\t\t\t#Static pressure in kPa\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", "d = (P*10**3)/(R*T) \t\t\t\t#Density in kg/m**3\n", "A = (math.pi*D**2/4)*10**-4 \t\t\t\t#Area in m**2\n", "m = d*A*C \t\t\t\t#Mass flow rate in kg/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Stagnation pressure is %3.2f kPa \\\n", "\\nB)Stagnation temperature is %3.2f K \\\n", "\\nC)Mass flow rate is %3.4f kg/s'%(Po,To,m)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Stagnation pressure is 57.97 kPa \n", "B)Stagnation temperature is 309.09 K \n", "C)Mass flow rate is 0.9844 kg/s\n" ] } ], "prompt_number": 58 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.28 page : 59" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "C = 300. \t\t\t\t#Velocity of air in m/s \n", "P = 1. \t\t\t\t#Static pressure in kPa\n", "T = 290. \t\t\t\t#Static temperature in K\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "To = T+(C**2/(2*Cp)) \t\t\t\t#Stagnation temperature in K\n", "Po = P*(To/T)**(k/(k-1)) \t\t\t\t#Stagnation pressure in kPa\n", "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", "Co = math.sqrt(k*R*To) \t\t\t\t#Sound velocity at Stagnation condition in m/s \n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Stagnation pressure and temperature are %3.4f bar and %3.2f K \\\n", "\\nB)Velocity of sound in the dynamic and stagnation conditions are %3.2f m/s and %3.2f m/s'%(Po,To,a,Co)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Stagnation pressure and temperature are 1.6529 bar and 334.78 K \n", "B)Velocity of sound in the dynamic and stagnation conditions are 341.35 m/s and 366.76 m/s\n" ] } ], "prompt_number": 59 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.29 page : 60" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data \n", "dP = 490*(1.01325/760) \t\t\t\t#Pressure in pivot tube in bar\n", "P = 0.3546+1.01325 \t\t\t\t#Static pressure(absolute) in bar \n", "To = 25.+273 \t\t\t\t#Stagnation temperature in K\n", "k = 1.4 \t\t\t\t#Adiabaatic consmath.tant\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "\n", "\t\t\t\t\n", "#Calculation\n", "Po = dP+P \t\t\t\t#Stagnation pressure in bar\n", "T = To*(P/Po)**((k-1)/k) \t\t\t\t#Static temperature\n", "C1 = math.sqrt(2*Cp*(To-T)) \t\t\t\t#Flow velocity for Compressible flow in m/s\n", "di = Po/(R*To) \t\t\t\t#Density in kg/m**3\n", "C2 = math.sqrt((2*dP)/di) \t\t\t\t#Flow velocity for incompressible flow in m/s\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'Flow velocity for: A)Compressible flow is %3.2f m/s \\\n", "\\nB)Incompressible flow is %3.2f m/s'%(C1,C2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Flow velocity for: A)Compressible flow is 251.44 m/s \n", "B)Incompressible flow is 235.13 m/s\n" ] } ], "prompt_number": 60 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.30 page : 61" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "To = 27.+273 \t\t\t\t#Stagnation temperature in K\n", "Po = 8. \t\t\t\t#Stagnation Pressure in bar\n", "P = 5.6 \t\t\t\t#Static pressure in bar, taken from diagram given\n", "m = 2. \t\t\t\t#Mass flow rate in kg/s\n", "k = 1.4 \t\t\t\t#Adiabaatic consmath.tant\n", "Cp = 1005. \t\t\t\t#Specific heat capacity at consmath.tant pressure in J/kg-K\n", "R = 287. \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "T = To*(P/Po)**((k-1)/k) \t\t\t\t#Static temperature in K\n", "a = math.sqrt(k*R*T) \t\t\t\t#Sound velocity in m/s\n", "C = math.sqrt(2*Cp*(To-T)) \t\t\t\t#Velocity in m/s\n", "M = C/a \t\t\t\t#Mach number\n", "A = ((m*R*T)/(P*10**5*C))*10**4 \t\t\t\t#Area at a point in the channal in cm**2\n", "\n", "\t\t\t\t\n", "#Output\n", "print 'A)Mach number is %3.4f \\\n", "\\nB)Velocity is %3.1f m/s \\\n", "\\nC)Area at a point in the channal is %3.3f cm**2'%(M,C,A)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "A)Mach number is 0.7326 \n", "B)Velocity is 241.7 m/s \n", "C)Area at a point in the channal is 11.489 cm**2\n" ] } ], "prompt_number": 61 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.31 page : 61" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "\t\t\t\t\n", "#Input data\n", "Po = 1.8 \t\t\t\t#Stagnation pressure in atm\n", "To = 20+273 \t\t\t\t#Stagnation temperature in K\n", "P = 1 \t\t\t\t#Surrounding pressure in atm\n", "k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n", "R = 287 \t\t\t\t#Specific gas consmath.tant in J/kg-k\n", "\n", "\t\t\t\t\n", "#Calculation\n", "p1 = 0.528 \t\t\t\t#Static to Stagnation pressure ratio @Mach number = 1, from gas tables\n", "Pt = p1*Po \t\t\t\t#Critical pressure in atm, Since Pt