diff options
author | hardythe1 | 2015-04-07 15:58:05 +0530 |
---|---|---|
committer | hardythe1 | 2015-04-07 15:58:05 +0530 |
commit | 92cca121f959c6616e3da431c1e2d23c4fa5e886 (patch) | |
tree | 205e68d0ce598ac5caca7de839a2934d746cce86 /Thermodynamics_An_Engineering_Approach/Chapter17.ipynb | |
parent | b14c13fcc6bb6d01c468805d612acb353ec168ac (diff) | |
download | Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.gz Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.bz2 Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.zip |
added books
Diffstat (limited to 'Thermodynamics_An_Engineering_Approach/Chapter17.ipynb')
-rwxr-xr-x | Thermodynamics_An_Engineering_Approach/Chapter17.ipynb | 812 |
1 files changed, 812 insertions, 0 deletions
diff --git a/Thermodynamics_An_Engineering_Approach/Chapter17.ipynb b/Thermodynamics_An_Engineering_Approach/Chapter17.ipynb new file mode 100755 index 00000000..5b1b7ade --- /dev/null +++ b/Thermodynamics_An_Engineering_Approach/Chapter17.ipynb @@ -0,0 +1,812 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17: Compressible Flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-1 ,Page No.826"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "V1=250.0;#velocity of aircraft in m/s\n",
+ "T1=255.07;#ambient air temperature in K\n",
+ "P1=54.05;#atmospheric pressure in kPa\n",
+ "h=5000.0;#altitude in m\n",
+ "\n",
+ "#from Table A-2a\n",
+ "cp=1.005;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "T01=T1+V1**2/(2*cp*1000);#factor of 1000 to convert kJ to J\n",
+ "P01=P1*(T01/T1)**(k/(k-1));\n",
+ "#given pressure ratio in compressor *\n",
+ "# T02 = T01*(P02/P01)^((k-1)/k)\n",
+ "T02 = T01*(8)**((k-1)/k);\n",
+ "win=cp*(T02-T01);\n",
+ "print'the stagnation pressure at the compressor inlet %f kPa'%round(P01,2);\n",
+ "print'the required compressor work per unit mass %f kJ/kg'%round(win,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the stagnation pressure at the compressor inlet 80.840000 kPa\n",
+ "the required compressor work per unit mass 233.400000 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-2 ,Page No.829"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt\n",
+ "\n",
+ "#given data\n",
+ "V=200.0;#air velocity in m/s\n",
+ "T=30+273.0;#air temperature in K\n",
+ "\n",
+ "#from Table A-2a\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "c=sqrt(k*R*T*1000);#factor of 1000 to convert kJ to J\n",
+ "print'the speed of sound %i m/s'%round(c);\n",
+ "Ma=V/c;\n",
+ "print'the Mach number at the diffuser inlet is %f'%round(Ma,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the speed of sound 349 m/s\n",
+ "the Mach number at the diffuser inlet is 0.573000\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-3 ,Page No.829"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt\n",
+ "\n",
+ "#given data\n",
+ "T0=200+273.0;#intial temperature in K\n",
+ "P0=1400.0;#intial pressure in kPa\n",
+ "#stagnant temp. & pressure is same as inlet due to small inlet velocity\n",
+ "P=1200.0;#pressure corresponding to a pressure drop of 200 kPa\n",
+ "m=3.0;#mass flow rate in kg/s\n",
+ "\n",
+ "#from Table A-2a\n",
+ "cp=0.846;#in kJ/kg-K\n",
+ "R=0.1889;#in kJ/kg-K\n",
+ "k=1.289;\n",
+ "\n",
+ "#calculations\n",
+ "T=T0*(P/P0)**((k-1)/k);\n",
+ "V=sqrt(2*cp*(T0-T)*1000);#factor of 1000 to convert kJ to J\n",
+ "p=P/(R*T);\n",
+ "A=m/(p*V);\n",
+ "c=sqrt(k*R*T*1000);#factor of 1000 to convert kJ to J\n",
+ "Ma=V/c;\n",
+ "print'velocity %f m/s'%round(V,1);\n",
+ "print'density %f kg/m^3'%round(p,1);\n",
+ "print'flow area %f cm^2'%round((A*10000),1);\n",
+ "print'Mach number is %f'%round(Ma,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity 164.900000 m/s\n",
+ "density 13.900000 kg/m^3\n",
+ "flow area 13.100000 cm^2\n",
+ "Mach number is 0.494000\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-4 ,Page No.836"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T0=200+273.0;#intial temperature in K\n",
+ "P0=1400.0;#intial pressure in kPa\n",
+ "\n",
+ "#from Table A-2a\n",
+ "k=1.289;\n",
+ "\n",
+ "#calculations\n",
+ "#Tc & Tr stands for critical temp and ratio respectively\n",
+ "#Pc & Pr stands for critical temp and ratio respectively\n",
+ "Tr=2/(k+1);\n",
+ "Pr=(2/(k+1))**(k/(k-1));\n",
+ "Tc=Tr*T0;\n",
+ "Pc=Pr*P0;\n",
+ "print'critical temperature %i K'%round(Tc);\n",
+ "print'critical pressure %i kPa'%round(Pc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "critical temperature 413 K\n",
+ "critical pressure 767 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-5 ,Page No.839"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt\n",
+ "\n",
+ "#given data\n",
+ "Vi=150.0;#air velocity in m/s\n",
+ "Ti=600+273.0;#air temperature in K\n",
+ "Pi=1.0;#air pressure in MPa\n",
+ "At=50.0/10000.0;#nozzle throat area in m^2\n",
+ "\n",
+ "#from Table A-2a\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "cp=1.005;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "Toi=Ti+Vi**2/(2*cp*1000);#factor of 1000 to convert kJ to J\n",
+ "Poi=Pi*(Toi/Ti)**(k/(k-1));\n",
+ "#flow is isentropic \n",
+ "#stagnation temp. and pressure values remain constant\n",
+ "To=Toi;\n",
+ "Po=Poi;\n",
+ "#from Table 17\u20132\n",
+ "#The critical-pressure ratio is 0.5283\n",
+ "\n",
+ "#Part a\n",
+ "Pb=0.7;\n",
+ "Pca=Pb/Po;\n",
+ "# Pca > 0.5283\n",
+ "#exit plane pressure is equal to the back pressure\n",
+ "Pt=Pb;\n",
+ "#from Table A\u201332\n",
+ "Mat=0.778;\n",
+ "#Tt/To = 0.892\n",
+ "Tt=0.892*To;\n",
+ "pt=Pt*1000/(R*Tt);#factor of 1000 to convert MPa to kPa\n",
+ "Vt=Mat*sqrt(k*R*Tt*1000);#factor of 1000 to convert kJ to J\n",
+ "ma=pt*At*Vt;\n",
+ "print'the mass flow rate through the nozzle when the back pressure is 0.7 MPa %f kg/s'%round(ma,2);\n",
+ "\n",
+ "#Part b\n",
+ "Pb=0.4;\n",
+ "Pca=Pb/Po;\n",
+ "# Pca < 0.5283\n",
+ "#sonic conditions exists at the exit\n",
+ "Ma=1;\n",
+ "mb=At*(Po*1000)*(sqrt(k*1000/(R*To)))*(2/(k+1))**((k+1)/(2*(k-1)));#factor of 1000 to convert MPa to kPa and kJ to J\n",
+ "print'the mass flow rate through the nozzle when the back pressure is 0.4 MPa %f kg/s'%round(mb,2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the mass flow rate through the nozzle when the back pressure is 0.7 MPa 6.770000 kg/s\n",
+ "the mass flow rate through the nozzle when the back pressure is 0.4 MPa 7.110000 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-6 ,Page No.840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T1=400;#intial temperature in K\n",
+ "P1=100;#intial pressure in kPa\n",
+ "Ma1=0.3;#intial mach no\n",
+ "A21=0.8;#A2/A1 as flow area has been reduced by 20 percent\n",
+ "\n",
+ "#assumption\n",
+ "k=1.4;\n",
+ "\n",
+ "#from Table A\u201332\n",
+ "#at Ma1=0.3\n",
+ "#s stands for * symbol\n",
+ "A1s = 2.0351;#A1/As\n",
+ "T10 = 0.9823;#T1/T0\n",
+ "P10 = 0.9305;#P1/P0\n",
+ "A2s = A21*A1s;#A2/As\n",
+ "#at this value of A2/As\n",
+ "T20=0.9701;#T2/T0\n",
+ "P20=0.8993;#P2/P0\n",
+ "Ma2=0.391;\n",
+ "\n",
+ "#calculations\n",
+ "T2=T1*T20/T10;\n",
+ "P2=P1*P20/P10;\n",
+ "print'Ma2 is %f'%round(Ma2,3);\n",
+ "print'T2 %i K is'%round(T2);\n",
+ "print'P2 %f kPa is'%round(P2,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ma2 is 0.391000\n",
+ "T2 395 K is\n",
+ "P2 96.600000 kPa is\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-7 ,Page No.844"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data \n",
+ "T0=800;#intial temperature in K\n",
+ "P0=1;#intial pressure in MPa\n",
+ "Vi=0;#negligible intial velcity\n",
+ "At=20;#throat area in cm^2\n",
+ "Mae=2;#exit Mach number\n",
+ "\n",
+ "#from Table A-2a\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "#part - a\n",
+ "# Mach no. at exit is 2 hence sonic conditions at throat\n",
+ "p0=P0*1000/(R*T0);#factor of 1000 to convert MPa to kPa\n",
+ "#from Table A-32 at Mat=1\n",
+ "#s stands for * symbol\n",
+ "Ps0 = 0.5283;#Ts/T0\n",
+ "Ts0 = 0.8333;#Ps/P0\n",
+ "ps0=0.6339;#ps/p0\n",
+ "Ps=Ps0*P0;\n",
+ "Ts=Ts0*T0;\n",
+ "ps=ps0*p0;\n",
+ "As=At;\n",
+ "Vs=sqrt(k*R*Ts*1000);#factor of 1000 to convert kJ to J\n",
+ "print('the throat conditions');\n",
+ "print'Presssure %f MPa'%round(Ps,4);\n",
+ "print'Temperature %f K'%round(Ts,1);\n",
+ "print'density %f kg/m^3'%round(ps,3);\n",
+ "print'area %f cm^2'%round(As);\n",
+ "print'velocity %f m/s'%round(Vs,1);\n",
+ "\n",
+ "#part - b\n",
+ "#from Table A-32\n",
+ "#at Mae=2\n",
+ "Te0 = 0.5556;#Te/T0\n",
+ "Pe0 = 0.1278;#Pe/P0\n",
+ "pe0= 0.2300;#pe/p0\n",
+ "Ae0= 1.6875;#Ae/Ao\n",
+ "Pe=Pe0*P0;\n",
+ "Te=Te0*T0;\n",
+ "pe=pe0*p0;\n",
+ "Ae=Ae0*At;\n",
+ "Ve=Mae*sqrt(k*R*Te*1000);#factor of 1000 to convert kJ to J\n",
+ "print('the exit plane conditions, including the exit area');\n",
+ "print'Presssure %f MPa'%round(Pe,4);\n",
+ "print'Temperature %f K'%round(Te,1);\n",
+ "print'density %f kg/m^3'%round(pe,3);\n",
+ "print'area %f cm^2'%round(Ae,2);\n",
+ "print'velocity %f m/s'%round(Ve,1);\n",
+ "#part - c\n",
+ "m=ps*As*Vs/10000;#factor of 10000 to convert cm^2 to m^2\n",
+ "print'the mass flow rate through the nozzle %f kg/s'%round(m,2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the throat conditions\n",
+ "Presssure 0.528300 MPa\n",
+ "Temperature 666.600000 K\n",
+ "density 2.761000 kg/m^3\n",
+ "area 20.000000 cm^2\n",
+ "velocity 517.500000 m/s\n",
+ "the exit plane conditions, including the exit area\n",
+ "Presssure 0.127800 MPa\n",
+ "Temperature 444.500000 K\n",
+ "density 1.002000 kg/m^3\n",
+ "area 33.750000 cm^2\n",
+ "velocity 845.200000 m/s\n",
+ "the mass flow rate through the nozzle 2.860000 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-9 ,Page No.850"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log,sqrt\n",
+ "\n",
+ "#data from Ex - 17.7\n",
+ "m=2.86;\n",
+ "Ma1=2;\n",
+ "P01=1;\n",
+ "P1=0.1278;\n",
+ "T1=444.5;\n",
+ "p1=1.002;\n",
+ "\n",
+ "#from Table A-2a\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "cp=1.005;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "#part - a\n",
+ "#from Table A-33 at Ma1=2.0\n",
+ "Ma2=0.5774;\n",
+ "P0201=0.7209;#P02/P01\n",
+ "P21=4.5;#P2/P1;\n",
+ "T21=1.6875;#T2/T1\n",
+ "p21=2.6667;#p2/p1\n",
+ "P02=P0201*P01;\n",
+ "P2=P21*P1;\n",
+ "T2=T21*T1;\n",
+ "p2=p21*p1;\n",
+ "print'the stagnation pressure %f MPa'%round(P02,3);\n",
+ "print'the static pressure %f MPa'%round(P2,3);\n",
+ "print'static temperature %f K'%round(T2);\n",
+ "print'static density %f kg/m^3'%round(p2,2);\n",
+ "\n",
+ "#part - b\n",
+ "#s21 = s2 - s1\n",
+ "s21=cp*log(T2/T1)-R*log(P2/P1);\n",
+ "print'the entropy change across the shock %fkJ/kg-K'%round(s21,4);\n",
+ "\n",
+ "#part - c\n",
+ "V2=Ma2*sqrt(k*R*T2*1000);#factor of 1000 to convert kJ to J\n",
+ "print'the exit velocity %f m/s'%round(V2);\n",
+ "\n",
+ "#part - d\n",
+ "print('flow rate is not affected by presence of shock waves amd remains 2.86 kg/sec')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the stagnation pressure 0.721000 MPa\n",
+ "the static pressure 0.575000 MPa\n",
+ "static temperature 750.000000 K\n",
+ "static density 2.670000 kg/m^3\n",
+ "the entropy change across the shock 0.094200kJ/kg-K\n",
+ "the exit velocity 317.000000 m/s\n",
+ "flow rate is not affected by presence of shock waves amd remains 2.86 kg/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-10 ,Page No.858"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sin,pi\n",
+ "\n",
+ "#given data\n",
+ "#using protactor frpm Fig 17-36\n",
+ "u=19;#u stands for angle of the mach lines\n",
+ "\n",
+ "#calculations\n",
+ "#by Eq. 17-47\n",
+ "#i.e u= asin(1/Ma)\n",
+ "Ma=1/sin(u*pi/180);#converting to radians\n",
+ "print'The Mach number is %f'%round(Ma,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Mach number is 3.070000\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-11 ,Page No.858"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sin,pi\n",
+ "\n",
+ "#given data\n",
+ "Ma1=2;#Supersonic air mach no\n",
+ "P1=75;#Supersonic air at pressure in kPa\n",
+ "O=10*pi/180;#converting to radians & angle b/w shock wave and normal\n",
+ "\n",
+ "#constants used\n",
+ "k=1.4;\n",
+ "\n",
+ "#calcualtions\n",
+ "#with given values of Ma1 and O from Eq 17-46\n",
+ "Bweak=39.3*pi/180;#converting to radians\n",
+ "Bstrong=83.7*pi/180;#converting to radians\n",
+ "#Weak shock\n",
+ "Ma1w=Ma1*sin(Bweak);\n",
+ "#Strong shock\n",
+ "Ma1s=Ma1*sin(Bstrong);\n",
+ "#from second part Eq 17-40\n",
+ "Ma2w=0.8032;\n",
+ "Ma2s=0.5794;\n",
+ "#pressure ratio = (2*k*Ma^2 - k + 1)/(k + 1 )\n",
+ "#Weak shock\n",
+ "P2w=P1*(2*k*Ma1w**2 - k + 1)/(k + 1 );\n",
+ "print'pressure for weak shock %i kPa'%round(P2w);\n",
+ "#Strong shock\n",
+ "P2s=P1*(2*k*Ma1s**2 - k + 1)/(k + 1 );\n",
+ "print'pressure for strong shock %i kPa'%round(P2s);\n",
+ "#Weak shock\n",
+ "Ma2=Ma2w/sin(Bweak-O);\n",
+ "print'Mach number downstream for weak shock is %f'%round(Ma2,2);\n",
+ "#Strong shock\n",
+ "Ma2=Ma2s/sin(Bstrong-O);\n",
+ "print'Mach number downstream for strong shock is %f'%round(Ma2,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "pressure for weak shock 128 kPa\n",
+ "pressure for strong shock 333 kPa\n",
+ "Mach number downstream for weak shock is 1.640000\n",
+ "Mach number downstream for strong shock is 0.604000\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 17-12 ,Page No.859"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt,pi,atan\n",
+ "\n",
+ "#given data\n",
+ "Ma1=2;#Supersonic air mach no\n",
+ "P1=230;#Supersonic air pressure in kPa\n",
+ "O=10*pi/180;#converting to radians & O stands for angle of the mach lines\n",
+ "\n",
+ "#constants used\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "#Eq. 17\u201349 for the upstream Prandtl\u2013Meyer function\n",
+ "vMa1=sqrt((k+1)/(k-1))*atan(sqrt((k-1)*(Ma1**2-1)/(k+1))*pi/180)-atan(sqrt(Ma1**2-1)*pi/180);#converting to radians\n",
+ "#Eq. 17\u201348 to calculate the downstream Prandtl\u2013Meyer function\n",
+ "vMa2=O+vMa1;\n",
+ "#using equation solver as implict nature of Eq 17-49\n",
+ "Ma2=2.385;\n",
+ "print'downstream Mach number Ma2 is %f'%round(Ma2,3);\n",
+ "#P2 = (P2/P0)/(P1/P0) * P1\n",
+ "P2= (1 + (k-1)*Ma2**2/2 )**(-k/(k-1)) / (1 + (k-1)*Ma1**2/2 )**(-k/(k-1)) * P1;\n",
+ "print'downstream pressure %i kPa'%round(P2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "downstream Mach number Ma2 is 2.385000\n",
+ "downstream pressure 126 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-15 ,Page No.868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi,sqrt\n",
+ "\n",
+ "#given data\n",
+ "P1=480.0;#intial pressure in kPa\n",
+ "T1=550.0;#intial temperature in K\n",
+ "V1=80.0;#intial velocity in m/s\n",
+ "d1=15.0/100.0;#diameter in m\n",
+ "AF=40.0;#air to fuel ratio\n",
+ "HV=40000.0;#heating value in kJ/kg\n",
+ "\n",
+ "#from Table A-2a\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "cp=1.005;#in kJ/kg-K\n",
+ "k=1.4;\n",
+ "\n",
+ "#calculations\n",
+ "p1=P1/(R*T1);\n",
+ "A1=pi*d1**2/4;\n",
+ "mair=p1*A1*V1;\n",
+ "mfuel=mair/AF;\n",
+ "Q=mfuel*HV;\n",
+ "q=Q/mair;\n",
+ "T01=T1+V1**2/(2*cp);\n",
+ "c1=sqrt(k*R*T1*1000);#factor of 1000 to convert kJ to J\n",
+ "Ma1=V1/c1;\n",
+ "#exit stagnation energy equation q= Cp (T02 - T01)\n",
+ "T02=T01+q/cp;\n",
+ "#from Table A\u201334\n",
+ "#at Ma1\n",
+ "#s stands for * symbol\n",
+ "T0s=0.1291;#T0/Ts\n",
+ "Ts0=T01/T0s;\n",
+ "T2s=T02/Ts0;#T02/T*0\n",
+ "#from Table A\u201334 at this ratio\n",
+ "Ma2=0.3142;\n",
+ "#Rayleigh flow relations corresponding to the inlet and exit Mach no\n",
+ "#at Ma1\n",
+ "T1s=0.1541;#T1/Ts\n",
+ "P1s=2.3065;#P1/Ps\n",
+ "V1s=0.0668;#V1/Vs\n",
+ "#at Ma2\n",
+ "T2s=0.4389;#T2/Ts\n",
+ "P2s=2.1086;#P2/Ps\n",
+ "V2s=0.2082;#V2/Vs\n",
+ "T2=T2s/T1s*T1;\n",
+ "P2=P2s/P1s*P1;\n",
+ "V2=V2s/V1s*V1; \n",
+ "print'Mach Number at exit is %f'%round(Ma2,4);\n",
+ "print'Presssure %i MPa'%round(P2);\n",
+ "print'Temperature %i K'%round(T2);\n",
+ "print'velocity %i m/s'%round(V2);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mach Number at exit is 0.314200\n",
+ "Presssure 439 MPa\n",
+ "Temperature 1566 K\n",
+ "velocity 249 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17-16 ,Page No.870"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt\n",
+ "\n",
+ "#given data\n",
+ "P01=2000;#entry pressure in kPa\n",
+ "T1=400;#entry temperature in C\n",
+ "V1=0;#negligible velocity at entry\n",
+ "nN=0.93;#overall nozzle efficiency\n",
+ "m=2.5;#mass flow rate in kg/s\n",
+ "P2=300;#exit pressure in kPa\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "#part - a\n",
+ "P201=P2/P01;\n",
+ "#critical pressure ratio at this values is 0.546\n",
+ "Pt=0.546*P01;\n",
+ "#at inlet\n",
+ "h1=3248.4;\n",
+ "h01=h1;\n",
+ "s1=7.1292;\n",
+ "#at throat\n",
+ "st=s1;\n",
+ "ht=3076.8;\n",
+ "vt=0.24196;\n",
+ "Vt=sqrt(2*(h01-ht)*1000);#factor of 1000 to convert kJ to J\n",
+ "At=m*vt/Vt;\n",
+ "#at state 2s\n",
+ "s2s=s1;\n",
+ "h2s=2783.6;\n",
+ "#nN = (h01 - h2)/ (h01 - h2s)\n",
+ "h2=h01-nN*(h01-h2s);\n",
+ "#at P2 and h2\n",
+ "v2=0.67723;\n",
+ "s2=7.2019;\n",
+ "V2=sqrt(2*(h01-h2)*1000);#factor of 1000 to convert kJ to J\n",
+ "A2=m*v2/V2;\n",
+ "print'throat area %f cm^2'%round((At*10000),2);\n",
+ "print'exit area %f cm^2'%round((A2*10000),2);\n",
+ "\n",
+ "#part - b\n",
+ "# at st=7.1292\n",
+ "#pressures of 1.115 and 1.065 MPa\n",
+ "#c calculated using tables\n",
+ "c=sqrt((1115-1065)/(1/0.23776 - 1/0.24633)*1000);#factor of 1000 to convert kPa to Pa\n",
+ "Ma=Vt/c;\n",
+ "print'the Mach number at the throat is %f'%round(Ma,2);\n",
+ "# at s2=7.2019\n",
+ "#pressures of 325 and 275 kPa\n",
+ "c=sqrt((325-276)/(1/0.63596 - 1/0.72245)*1000);#factor of 1000 to convert kPa to Pa\n",
+ "Ma=V2/c;\n",
+ "print'the Mach number at the nozzle exit is %f'%round(Ma,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "throat area 10.330000 cm^2\n",
+ "exit area 18.210000 cm^2\n",
+ "the Mach number at the throat is 1.000000\n",
+ "the Mach number at the nozzle exit is 1.820000\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |