{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 8 : One dimentional high velocity gas flow" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.1 page no : 297\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the speed of sound in water amd steel at 20 C\n", " \n", "# Variable \n", "#for steel\n", "K_steel=1.94*10**11 #Pa\n", "rho_steel=7800. #Kg.m^3\n", "\n", "# Calculation and Result\n", "c_steel=(K_steel/rho_steel)**0.5/1000 # Km/s\n", "print \"the speed of sound in steel at 20 C is %f km/s\"%c_steel\n", "\n", "#for water\n", "K_water=3.14*10**5 #lbf/in^2\n", "rho_water=62.3 #lbm/ft^3\n", "\n", "#1 ft =12 in\n", "#1 lbf.s^2 = 32.2 lbm.ft\n", "c_water=(K_water/rho_water*144*32.2)**0.5 #ft/s\n", "print \"the speed of sound in water at 20 C is %f ft/s\"%c_water" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the speed of sound in steel at 20 C is 4.987163 km/s\n", "the speed of sound in water at 20 C is 4834.259759 ft/s\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "\n", "Example 8.2 page no : 300\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the speed of sound in air at 20 C\n", "\n", "# Variable \n", "R=10.73 #lbf.ft^3/in^2/lbmol/R\n", "#1 ft = 12 in\n", "#1 lbf.s^2 = 32.2 lbm.ft\n", "R1=(R*144*32.2)**0.5 #ft/s*(lbm/lbmol/R)^0.5\n", "k=1.4 #dimentionless\n", "T=528. #R (Rankine temperature scale)\n", "M=29. #lbm/lbmol\n", "\n", "# Calculation \n", "c=R1*(k*T/M)**0.5 #ft/s\n", "\n", "# Result\n", "print \"the speed of sound in air at 20 C is %d ft/s\"%c" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the speed of sound in air at 20 C is 1126 ft/s\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.3 page no : 302\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the temperature of the gas where is mach number is 2\n", "\n", "# Variable \n", "Ma=2. #dimentionless (Mach number)\n", "k=1.4 #dimentionless\n", "T1=528. #R (Rankine temperature scale)\n", "\n", "# Calculation \n", "T2=T1/((Ma**2*(k-1)/2)+1) #R (Rankine temperature scale)\n", "\n", "# Result\n", "print \"The temperature of the gas when mach number is 2 is %d R\"%T2" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature of the gas when mach number is 2 is 293 R\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.4 page no : 302\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the speed of sound in air at 20 C\n", "\n", "# Variable \n", "R=10.73 #lbf.ft^3/(in^2.lbmol.R)\n", "\n", "#1 ft = 12 in\n", "##1 lbf.s^2 = 32.2 lbm.ft\n", "R_root=(R*144*32.2)**0.5 #ft/s*(lbm/lbmol.R)^0.5\n", "Ma=2 #dimentionless (Mach number)\n", "k=1.4 #dimentionless\n", "T=298. #R (Rankine temperature scale)\n", "M=29. #lbm/lbmol\n", "\n", "# Calculation \n", "c=R_root*(k*T/M)**0.5 #ft/s\n", "v=c*Ma #ft/s\n", "\n", "# Result\n", "print \"%f\"%c\n", "print \"The speed of sound in air at 20 C is %f ft/s\"%v" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "846.023046\n", "The speed of sound in air at 20 C is 1692.046093 ft/s\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.5 page no : 303\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the pressure and density at a pt where temperature ratio is 1.8 and initial pressure and density are given\n", "\n", "# Variable \n", "ratio_T=1.8 #dimentionless\n", "P1=2. #bar\n", "k=1.4 #dimentionless\n", "\n", "# Calculation \n", "P2=P1/ratio_T**(k/(k-1)) #bar\n", "rho1=2.39 #Kg/m^3\n", "rho2=rho1/ratio_T**(1/(k-1)) #Kg/m^3\n", "\n", "# Result\n", "print \"The pressure where temperature ratio is 1.8 and initial pressure is 2 bar is %f bar\"%P2\n", "print \"The density where temperature ratio is 1.8 and initial density is 2.39 Kg/m^3 is %f Kg/m^3\"%rho2" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The pressure where temperature ratio is 1.8 and initial pressure is 2 bar is 0.255609 bar\n", "The density where temperature ratio is 1.8 and initial density is 2.39 Kg/m^3 is 0.549815 Kg/m^3\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.6 page no : 306\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n", "\n", "# Variable \n", "P1=30. #psia\n", "T1=660. #R (Rankine temperature scale)\n", "m=10. #lbm/s mass flow rate\n", "v1=1400. #ft/s\n", "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n", "k=1.4 #dimentionless\n", "M=29. #lbm/lbmol\n", "\n", "# Calculation and Result\n", "T2=T1-v1**2*((k-1)/k)*M/2/R # R (Rankine temperature scale)\n", "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n", "\n", "c=223*(k*T2/M)**0.5 #ft/s\n", "Ma=v1/c #dimentionless (Mach number)\n", "print \"The mach number at the pt in the duct where air velocity is 1400 ft/s is %f\"%Ma\n", "\n", "P2=P1/(T1/T2)**(k/(k-1)) #psia\n", "print \"The pressure at the pt in the duct where air velocity is 1400 ft/s is %f psia\"%P2\n", "\n", "#1 lbf.s^2 = 32.2 lbm.ft\n", "A0=m/(P1*(M*k)**0.5*32.2/223/(T1)**0.5/((k-1)/2+1)**((k+1)/2/(k-1))) #in^2\n", "ratio_A=((Ma**2*(k-1)/2+1)/((k-1)/2+1))**((k+1)/2/(k-1))/Ma #dimentionless\n", "A=ratio_A*A0 #in^2\n", "print \"The cross sectional at the pt in the duct where air velocity is 1400 ft/s is %f in^2\"%A" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature at the pt in the duct where air velocity is 1400 ft/s is 496.947791 R\n", "The mach number at the pt in the duct where air velocity is 1400 ft/s is 1.281748\n", "The pressure at the pt in the duct where air velocity is 1400 ft/s is 11.112331 psia\n", "The cross sectional at the pt in the duct where air velocity is 1400 ft/s is 17.029147 in^2\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.7 page no : 307\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n", "\n", "# Variable \n", "P1=30. #psia\n", "T1=660. #R (Rankine temperature scale)\n", "ratio_T=0.83333 #dimentionless\n", "m=10. #lbm/s mass flow rate\n", "v1=1400. #ft/s\n", "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n", "k=1.4 #dimentionless\n", "M=29. #lbm/lbmol\n", "\n", "# Calculation and Result\n", "T2=T1*ratio_T #R (Rankine temperature scale)\n", "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n", "\n", "c=223*(k*T2/M)**0.5 #ft/s\n", "Ma=v1/c #dimentionless (Mach number)\n", "print \"The mach number at the pt in the duct where air velocity is 1400 ft/s is %f\"%Ma\n", "\n", "ratio_t=0.7528 #dimentionless\n", "ratio_P=0.3701 #dimentionless\n", "ratio_A=1.0587 #dimentionless\n", "T=T1*ratio_t #R (Rankine temperature scale)\n", "print \"T=%f\"%T\n", "P=P1*ratio_P#psia\n", "print \"P=%f\"%P" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature at the pt in the duct where air velocity is 1400 ft/s is 549.997800 R\n", "The mach number at the pt in the duct where air velocity is 1400 ft/s is 1.218366\n", "T=496.848000\n", "P=11.103000\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.8 page no : 308\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n", "\n", "# Variable \n", "P1=30. #psia\n", "T1=660. #R (Rankine temperature scale)\n", "m=10. #lbm/s mass flow rate\n", "v1=4000. #ft/s\n", "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n", "k=1.4 #dimentionless\n", "M=29. #lbm/lbmol\n", "\n", "# Calculation and Result\n", "T2=T1-v1**2*((k-1)/k)*M/2./R #R (Rankine temperature scale)\n", "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n", "T2 = -T2\n", "c=223.*(k*T2/M)**0.5 #ft/s\n", "Ma=v1/c #dimentionless (Mach number)\n", "P2=P1/(T1/T2)**(k/(k-1)) #psia\n", "\n", "#1 lbf.s^2 = 32.2 lbm.ft\n", "A0=m/(P1*(M*k)**0.5*32.2/223/(T1)**0.5/((k-1)/2+1)**((k+1)/2/(k-1))) #in^2\n", "ratio_A=((Ma**2*(k-1)/2+1)/((k-1)/2+1))**((k+1)/2/(k-1))/Ma #dimentionless\n", "A=ratio_A*A0 #in^2\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature at the pt in the duct where air velocity is 1400 ft/s is -671.038439 R\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.9 page no : 309\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the temperatures at different pts in a duct with different mach numbers\n", "\n", "# Variable \n", "#for mach number=0.5\n", "ratio_T=0.9524 #dimentionless\n", "T1=293.15 #K\n", "\n", "# Calculation \n", "T2=T1/ratio_T #K\n", "\n", "# Result\n", "print \"The temperature at the pt in the duct where mach number is 0.5 is %f K\"%T2\n", "#for mach number 2\n", "ratio_t=0.5556 #dimentionless\n", "t2=293.15 #K\n", "t1=t2*ratio_t #K\n", "print \"The temperature initially at the start of the nozzle is %f K\"%t1" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature at the pt in the duct where mach number is 0.5 is 307.801344 K\n", "The temperature initially at the start of the nozzle is 162.874140 K\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.12 page no : 324\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the reservoir temperature and the pressure of air around the aircraft\n", "\n", "# Variable \n", "gama=1.4 #dimentionless\n", "Ma=2. #dimentionless (Mach number)\n", "To=273.15 #K\n", "\n", "# Calculation \n", "Tr=To*(Ma**2*(gama-1)/2.+1) # K\n", "P1=50. #KPa\n", "Pr=P1*(Tr/To)**(gama*5/2) #KPa\n", "\n", "# Result\n", "print \"the reservoir temperature of air around the aircraft is %f K\"%Tr\n", "print \"The pressure of air around the aircraft is %f KPa\"%Pr" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the reservoir temperature of air around the aircraft is 491.670000 K\n", "The pressure of air around the aircraft is 391.222453 KPa\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.13 page no : 325\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate temperature and the velocity of air inside the shock wave\n", "\n", "# Variable \n", "#Let subscript y denote air inside the shock wave and x denote the air outside the shock wave\n", "ratio_T=1.2309 #dimentionless\n", "Tx=528. #R (Rankine temperature scale)\n", "My=0.7558 #dimentionless\n", "cy=1249. #ft/s\n", "\n", "#Calculations\n", "Ty=ratio_T*Tx #R (Rankine temperature scale)\n", "Vy=My*cy #ft/s\n", "\n", "#Results\n", "print \"temperature of air inside the shock wave is %f R\"%Ty\n", "print \"the velocity of air inside the shock wave is %f ft/s\"%Vy" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "temperature of air inside the shock wave is 649.915200 R\n", "the velocity of air inside the shock wave is 943.994200 ft/s\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 8.14 page no : 328\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the ratio of area of throat to area of a certain point\n", "\n", "# Variable \n", "A_throat=1. #in^2\n", "A_exit=1.5 #in^2\n", "ratio_A=2.2385 #dimentionless\n", "\n", "# Calculation \n", "ratio_A1=ratio_A*(A_throat/A_exit) #dimentionless\n", "\n", "# Result\n", "print \"the ratio of area of throat to area of a certain point is %f\"%ratio_A1" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the ratio of area of throat to area of a certain point is 1.492333\n" ] } ], "prompt_number": 15 } ], "metadata": {} } ] }