{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Appendix E" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Stagnation Temperature: 319.9 K\n", "Stagnation Pressure: 187.9 KPa\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 17.1\n", "'''Air flows in a duct at a pressure of 150 kPa with a velocity of 200 m/s. The temperature\n", "of the air is 300 K. Determine the isentropic stagnation pressure and temperature.'''\n", "\n", "#Variable Declaration: \n", "T = 300\t\t\t\t\t#Temperature of air in K\n", "P = 150\t\t\t\t\t#Pressure of air in kPa\n", "v = 200\t\t\t\t\t#velocity of air flow n m/s\n", "Cp = 1.004\t\t\t\t#specific heat at constant pressure in kJ/kg\n", "\n", "#Calculations:\n", "To = v**2/(2000*Cp)+T\t#stagnation temperature in K\n", "k = 1.4\t\t \t\t#constant\n", "Po = P*(To/T)**(k/(k-1))#stagnation pressure in kPa\n", "\n", "#Results:\n", "print 'Stagnation Temperature: ',round(To,1),'K'\n", "print 'Stagnation Pressure:',round(Po,1),'KPa'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Thrust acting in x direction: 10.68 KN\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 17.3\n", "'''A jet engine is being tested on a test stand (Fig. 17.5). The inlet area to the compressor is\n", "0.2 m2, and air enters the compressor at 95 kPa, 100 m/s. The pressure of the atmosphere\n", "is 100 kPa. The exit area of the engine is 0.1 m2, and the products of combustion leave the\n", "exit plane at a pressure of 125 kPa and a velocity of 450 m/s. The air–fuel ratio is 50 kg\n", "air/kg fuel, and the fuel enters with a low velocity. The rate of air flow entering the engine\n", "is 20 kg/s. Determine the thrust, Rx, on the engine.'''\n", "\n", "#Keys\n", "#i = inlet\n", "#e = exit\n", "\n", "#Variable Declaration: \n", "#using momentum equation on control surface in x direction\n", "me = 20.4\t\t#mass exiting in kg\n", "mi = 20\t\t\t#mass entering in kg\n", "ve = 450\t\t#exit velocity in m/s\n", "vi = 100\t\t#exit velocity in m/s\n", "Pi = 95\t\t\t#Pressure at inlet in kPa\n", "Pe = 125\t\t#Pressure at exit in kPa\n", "Po = 100\t\t#surrounding pressure in kPa\n", "Ai = 0.2\t\t#inlet area in m**2\n", "Ae = 0.1\t\t#exit area in m**2\n", "\n", "#Calculations:\n", "Rx = (me*ve-mi*vi)/1000-(Pi-Po)*Ai+(Pe-Po)*Ae\t\t#thrust in x direction in kN\n", "\n", "#Results:\n", "print 'Thrust acting in x direction: ',Rx,'KN' " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Speed of sound at 300K: 347.2 m/s\n", "Speed of sound at 1000K: 633.9 m/s\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "from math import sqrt\n", "#Example: 17.5\n", "'''Determine the velocity of sound in air at 300 K and at 1000 K.'''\n", "\n", "#Variable Declaration: \n", "k = 1.4\t\t\t#constant\n", "R = 0.287\t\t#gas constant\n", "#At 300K\n", "T1 = 300\t\t#K\n", "T2 = 1000\t\t#K\n", "\n", "#Calculations:\n", "c1 = sqrt(k*R*T1*1000)\n", "c2 = sqrt(k*R*T2*1000)\n", "\n", "#Results:\n", "print 'Speed of sound at 300K: ',round(c1,1),'m/s'\n", "print 'Speed of sound at 1000K: ',round(c2,1),'m/s'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass flow rate at the throat section: 1.0646 Kg/s\n", "Mass flow rate at the exit section: 0.8711 Kg/s\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "from math import sqrt\n", "#Example: 17.6\n", "'''A convergent nozzle has an exit area of 500 mm2. Air enters the nozzle with a stagnation\n", "pressure of 1000 kPa and a stagnation temperature of 360 K. Determine the mass rate of\n", "flow for back pressures of 800 kPa, 528 kPa, and 300 kPa, assuming isentropic flow'''\n", "\n", "#Variable Declaration: \n", "k = 1.4\t\t\t\t#constant\n", "R = 0.287\t\t\t#gas constant\n", "To = 360\t\t\t#stagnation Temperature in K \n", "P = 528\t\t\t\t#stagnation pressure in kPa\n", "A = 500*10**-6\t\t#area in m**2\n", "Me = 0.573\t\t\t#Mach number\n", "Pe = 800\t\t\t#exit pressure in kPa\n", "\n", "#Calculations:\n", "T = To*0.8333\t\t#Temperature of air in K, 0.8333 stagnation ratio from table\n", "v = sqrt(k*R*T*1000)#velocity in m/s\n", "d = P/(R*T)\t\t\t#stagnation density in kg/m**3\n", "ms = d*A*v\t\t\t#mass flow rate in kg/s\n", "Te = To*0.9381\t\t#exit temperature in K, ratio from table\n", "ce = sqrt(k*R*Te*1000)#exit velocity of sound in m/s\n", "ve = Me*ce\n", "de = Pe/R/Te\n", "mse = de*A*ve\n", "\n", "#Results:\n", "print 'Mass flow rate at the throat section: ',round(ms,4),'Kg/s'\n", "print 'Mass flow rate at the exit section: ',round(mse,4),'Kg/s'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "__When diverging section act as a nozzle__\n", "Exit pressure: 93.9 Kpa\n", "Exit Temperature: 183.2 K\n", "Exit velocity: 596.1 m/s\n", "__When diverging section act as a diffuser__\n", "Exit pressure: 93.6 Kpa\n", "Exit Temperature: 353.2 K\n", "Exit velocity: 116.0 m/s\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "from math import sqrt\n", "#Example: 17.7\n", "'''A converging-diverging nozzle has an exit area to throat area ratio of 2. Air enters this\n", "nozzle with a stagnation pressure of 1000 kPa and a stagnation temperature of 360 K. The\n", "throat area is 500 mm2. Determine the mass rate of flow, exit pressure, exit temperature,\n", "exit Mach number, and exit velocity for the following conditions:\n", "a. Sonic velocity at the throat, diverging section acting as a nozzle.\n", "(Corresponds to point d in Fig. 17.13.)\n", "b. Sonic velocity at the throat, diverging section acting as a diffuser.\n", "(Corresponds to point c in Fig. 17.13.)'''\n", "\n", "#Variable Declaration: \n", "Po = 1000\t\t \t#stagnation pressure in kPa\n", "To = 360\t\t \t#stagnation temperature in K\n", "#when diverging section acting as nozzle\n", "Pe1 = 0.0939*Po\t\t\t#exit pressure of air in kPa\n", "Te1 = 0.5089*To\t\t\t#exit temperature in K\n", "k = 1.4\t\t \t\t#constant\n", "R = 0.287\t\t \t#gas constant for air\n", "Me = 2.197\t\t \t#mach number from table\n", "#when diverging section act as diffuser\n", "Me2 = 0.308\n", "Pe2 = 0.0936*Po\t\t#exit pressure of air in kPa\n", "Te2 = 0.9812*To\t\t#exit temperature in K\n", "\n", "#Calculations:\n", "ce = sqrt(k*R*Te1*1000)\t#velocity of sound in exit section in m/s\n", "ve1 = Me*ce\t\t\t\t#velocity of air at exit section in m/s\n", "ce = sqrt(k*R*Te2*1000)\t\t#velocity of sound in exit section in m/s\n", "ve2 = Me2*ce\n", "\n", "#Results:\n", "print '__When diverging section act as a nozzle__'\n", "print 'Exit pressure: ',round(Pe1,1),\"Kpa\"\n", "print 'Exit Temperature: ',round(Te1,1),\"K\"\n", "print 'Exit velocity: ',round(ve1,1),\"m/s\"\n", "print '__When diverging section act as a diffuser__'\n", "print 'Exit pressure: ',round(Pe2,1),\"Kpa\"\n", "print 'Exit Temperature: ',round(Te2,1),\"K\"\n", "print 'Exit velocity: ',round(ve2,1),\"m/s\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Static Pressure in downstream: 512.7 Kpa\n", "Static Temperature in downstream: 339.7 K\n", "Stagnation Pressure in downstream: 630.0 Kpa\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 17.8\n", "'''Consider the convergent-divergent nozzle of Example 17.7, in which the diverging section\n", "acts as a supersonic nozzle (Fig. 17.16). Assume that a normal shock stands in the exit\n", "plane of the nozzle. Determine the static pressure and temperature and the stagnation\n", "pressure just downstream of the normal shock.'''\n", "\n", "#Variable Declaration:\n", "Px = 93.9 \t\t\t#Static Pressure in Upstream(Kpa)\n", "Tx = 183.2 \t\t\t#Static Temperature in Upstream(K)\n", "Pox = 1000\t\t\t#Total Pressure in Upstream(Kpa)\n", "Mx = 2.197\t\t\t#X-direction Mach No (Using table A.13)\n", "My = 0.547\t\t\t#Y-direction Mach No (Using table A.13)\n", "rP = 5.46\t\t\t#Py/Px (Using table A.13)\n", "rT = 1.854\t\t\t#Ty/Tx (Using table A.13)\n", "rPo = 0.63\t\t\t#Poy/Pox (Using table A.13)\n", "\n", "#Calculations:\n", "Py = rP*Px\n", "Ty = rT*Tx\n", "Poy = rPo*Pox\n", "\n", "#Results:\n", "print 'Static Pressure in downstream: ',round(Py,1),'Kpa'\n", "print 'Static Temperature in downstream: ',round(Ty,1),'K'\n", "print 'Stagnation Pressure in downstream: ',round(Poy,1),'Kpa'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exit pressure: 669.6 Kpa\n", "Exit temperature: 327.8 K\n", "Exit stagnation pressure: 929.8 Kpa\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 17.9\n", "'''Consider the convergent-divergent nozzle of Examples 17.7 and 17.8. Assume that there\n", "is a normal shock wave standing at the point where M = 1.5. Determine the exit-plane\n", "pressure, temperature, and Mach number. Assume isentropic flow except for the normal\n", "shock (Fig. 17.18).'''\n", "\n", "#Key\n", "#x = inlet\n", "#y = exit\n", "\n", "#Variable Declaration: \n", "Mx = 1.5\t\t\t\t#mach number for inlet\n", "My = 0.7011\t\t\t\t#mach number for exit\n", "Px = 272.4\t\t\t\t#inlet pressure in kPa\n", "Tx = 248.3\t\t\t\t#inlet temperature in K\n", "Pox = 1000\t\t\t\t#stagnation pressure for inlet\n", "\n", "#Calculations:\n", "Py = 2.4583*Px\t\t\t#Exit Pressure in kPa\n", "Ty = 1.320*Tx\t\t\t#Exit temperature in K\n", "Poy = 0.9298*Pox\t\t#Exit pressure in kPa\n", "\n", "#Results:\n", "print 'Exit pressure: ',round(Py,1),\"Kpa\"\n", "print 'Exit temperature: ',round(Ty,1),\"K\"\n", "print 'Exit stagnation pressure: ',round(Poy,1),\"Kpa\"" ] } ], "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.6" } }, "nbformat": 4, "nbformat_minor": 0 }