summaryrefslogtreecommitdiff
path: root/backup/mechanics_of_fluid_version_backup/Chapter11.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'backup/mechanics_of_fluid_version_backup/Chapter11.ipynb')
-rwxr-xr-xbackup/mechanics_of_fluid_version_backup/Chapter11.ipynb433
1 files changed, 433 insertions, 0 deletions
diff --git a/backup/mechanics_of_fluid_version_backup/Chapter11.ipynb b/backup/mechanics_of_fluid_version_backup/Chapter11.ipynb
new file mode 100755
index 00000000..fd043621
--- /dev/null
+++ b/backup/mechanics_of_fluid_version_backup/Chapter11.ipynb
@@ -0,0 +1,433 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a7351edf5e2fdcb0afd4d02f998ad2152ac8acdf9928739e63efa7de906e2b49"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Compressible Flow of Gases"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate \"Density at plane 1 and tagnation temperature and temperautre and density\n",
+ "p1=1.5*10**5; ## N/m^2\n",
+ "R=287.; ## J/kg.K\n",
+ "T1=271.; ## K\n",
+ "\n",
+ "rho1=p1/R/T1; \n",
+ "print'%s %.1f %s'%(\"Density at plane 1 =\",rho1,\"kg/m^3\")\n",
+ "\n",
+ "\n",
+ "print(\"the stagnation temperature\")\n",
+ "\n",
+ "u1=270.; ## m/s\n",
+ "cp=1005.; ## J/Kg.K\n",
+ "\n",
+ "T0=T1+u1**2./(2.*cp);\n",
+ "print'%s %.1f %s'%(\"The stagnation temperature =\",T0,\"K\")\n",
+ "\n",
+ "\n",
+ "print(\"the temperature and density at plane 2\")\n",
+ "\n",
+ "u2=320; ## m/s\n",
+ "p2=1.2*10**5; ## N/m^2\n",
+ "\n",
+ "T2=T0-u2**2/(2*cp);\n",
+ "print'%s %.1f %s'%(\"Temperature = \",T2,\"K\")\n",
+ "\n",
+ "\n",
+ "rho2=p2/(R*T2);\n",
+ "print'%s %.2f %s'%(\"density =\",rho2,\"kg/m^3\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density at plane 1 = 1.9 kg/m^3\n",
+ "the stagnation temperature\n",
+ "The stagnation temperature = 307.3 K\n",
+ "the temperature and density at plane 2\n",
+ "Temperature = 256.3 K\n",
+ "density = 1.63 kg/m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Deflection angle and the final Mach number and the pressure ratio across the wave\n",
+ "y=1.4;\n",
+ "R=287.; ## J/kg.K\n",
+ "T1=238.; ## K\n",
+ "u1=773.; ## m/s\n",
+ "beta1=38.; ## degrees\n",
+ "cp=1005.; ## J/kg.K\n",
+ "\n",
+ "a1=math.sqrt(y*R*T1);\n",
+ "M1=u1/a1;\n",
+ "\n",
+ "beta2=math.atan(math.tan(beta1)*((2.+(y-1.)*M1**2.*(math.sin(beta1))**2.)/((y+1.)*M1**2.*(math.sin(beta1))**2.)));\n",
+ "\n",
+ "deflection_angle=beta1-beta2;\n",
+ "print'%s %.1f %s'%(\"Deflection angle =\",deflection_angle,\"degrees\")\n",
+ "\n",
+ "\n",
+ "print(\"the final Mach number\")\n",
+ "\n",
+ "u2=u1*math.cos(beta1)/math.cos(beta2);\n",
+ "\n",
+ "T2=T1+1./(2.*cp)*(u1**2.-u2**2.);\n",
+ "a2=math.sqrt(y*R*T2);\n",
+ "\n",
+ "M2=u2/a2;\n",
+ "\n",
+ "print'%s %.2f %s'%(\"Final Mach number =\",M2,\"\")\n",
+ "\n",
+ "\n",
+ "print(\" the pressure ratio across the wave.\")\n",
+ "ratio=T2/T1*(math.tan(beta1)/math.tan(beta2));\n",
+ "print'%s %.2f %s'%(\"Pressure ratio =\",ratio,\"\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Deflection angle = 37.5 degrees\n",
+ "the final Mach number\n",
+ "Final Mach number = 3.02 \n",
+ " the pressure ratio across the wave.\n",
+ "Pressure ratio = 0.47 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Pressure after the bend\n",
+ "M1=1.8;\n",
+ "theta1=20.73; ## degrees\n",
+ "theta2=30.73; ## degrees\n",
+ "M2=2.162;\n",
+ "p1=50; ## kPa\n",
+ "y=1.4;\n",
+ "\n",
+ "p2=p1*((1.+(y-1.)/2.*M1**2.)/(1.+(y-1.)/2.*M2**2.))**(y/(y-1.));\n",
+ "\n",
+ "print'%s %.1f %s'%(\"Pressure after the bend =\",p2,\"kPa\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure after the bend = 28.5 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg525"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the pressures in the reservoir and at the nozzle throat and Pressure in the reservoir and Pressure at the nozzle throat and the temperature and velocity of the air at the exit \n",
+ "p=28*10**3; ## N/m^2 \n",
+ "y=1.4;\n",
+ "M1=2.4;\n",
+ "M2=1.;\n",
+ "T0=291.; ## K\n",
+ "R=287.; ## J/kg.K\n",
+ "\n",
+ "print(\"the pressures in the reservoir and at the nozzle throat\")\n",
+ "\n",
+ "p0=p*(1+(y-1)/2*M1**2)**(y/(y-1));\n",
+ "pc=p0*(1+(y-1)/2*M2**2)**(-y/(y-1));\n",
+ "\n",
+ "print'%s %.2f %s'%(\"Pressure in the reservoir =\",p0,\"N/m^2\")\n",
+ "\n",
+ "print'%s %.2f %s'%(\"Pressure at the nozzle throat =\",pc,\"N/m^2\")\n",
+ "\n",
+ "\n",
+ "print(\"the temperature and velocity of the air at the exit.\")\n",
+ "\n",
+ "T=T0*(1+(y-1)/2*M1**2)**(-1);\n",
+ "\n",
+ "print'%s %.1f %s'%(\"Temperature =\",T,\"K\")\n",
+ "\n",
+ "\n",
+ "a=math.sqrt(y*R*T)\n",
+ "\n",
+ "u=M1*a;\n",
+ "\n",
+ "print'%s %.1f %s'%(\"Velocity =\",u,\"m/s\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the pressures in the reservoir and at the nozzle throat\n",
+ "Pressure in the reservoir = 409360.53 N/m^2\n",
+ "Pressure at the nozzle throat = 216257.71 N/m^2\n",
+ "the temperature and velocity of the air at the exit.\n",
+ "Temperature = 135.2 K\n",
+ "Velocity = 559.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Mach number before the shock and Stagnation Pressure\n",
+ "M_He=1.8;\n",
+ "y_He=5/3;\n",
+ "y_air=1.4;\n",
+ "p2=30; ## kPa\n",
+ "\n",
+ "## (A/At)=(1+(y-1)/2*M^2)^((y+1)/(y-1))/M^2*(2/(y+1))^((y+1)/(y-1))\n",
+ "\n",
+ "## = (1+1/3*1.8^2)^(4)/1.8^(2)*(3/4)^(4) = 1.828 for helium\n",
+ "\n",
+ "## = (1+0.2*M^2)^6/M^2*1/1.2^6 for air\n",
+ "## Hence by trial \n",
+ "\n",
+ "M1=1.715;\n",
+ "print'%s %.3f %s'%(\"Mach number before the shock =\",M1,\"\")\n",
+ "\n",
+ "\n",
+ "p1=p2/((2*y_air*M1**2-(y_air-1))/(y_air+1));\n",
+ "\n",
+ "p0_1=p1*(1+(y_air-1)/2*M1**2)**(y_air/(y_air-1));\n",
+ "\n",
+ "print'%s %.1f %s'%(\"Stagnation Pressure =\",p0_1,\"kPa\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mach number before the shock = 1.715 \n",
+ "Stagnation Pressure = 46.4 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg538"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the value of the friction factor for the pipe and friction factor and the overall length of the pipe, L, if the flow exhausts to atmosphere\n",
+ "p0=510.; ## kPa\n",
+ "pA=500.; ## kPa\n",
+ "pB=280.; ## kPa\n",
+ "d=0.02; ## m\n",
+ "l_max=12.; ## m\n",
+ "\n",
+ "print(\" the value of the friction factor for the pipe\");\n",
+ "\n",
+ "## At A, pA/p0 = 500/510 = 0.980. From the Isentropic Flow Tables (Appendix 3), M_A = 0.17.\n",
+ "\n",
+ "pC=pA*0.1556;\n",
+ "\n",
+ "## From the Fanno Tables at pc/pB = 0.278,M_B = 0.302 and (fl_maxP/A)B = 5.21. For a circular pipe P/A=4/d\n",
+ "M_B=0.302;\n",
+ "f=(21.37-5.21)/l_max/4*d;\n",
+ "\n",
+ "print'%s %.3f %s'%(\"friction factor =\",f,\"\")\n",
+ "\n",
+ "\n",
+ "print(\" the overall length of the pipe, L, if the flow exhausts to atmosphere\")\n",
+ "\n",
+ "p=100; ## kPa\n",
+ "\n",
+ "## At exit, pc/p = 77.8/100 = 0.778. From the Fanno Tables, (fl_maxP/A) = 0.07\n",
+ "L=l_max*(21.37-0.07)/(21.37-5.21);\n",
+ "\n",
+ "print'%s %.1f %s'%(\"Overall Length =\",L,\"m\")\n",
+ "\n",
+ "print(\" the mass flow rate if the reservoir temperature is 294 K.\")\n",
+ "T0=294.; ## K\n",
+ "R=287.; ## J/kg.K\n",
+ "y=1.4;\n",
+ "M=0.302;\n",
+ "\n",
+ "m=math.pi/4.*d**2.*pB*10.**3.*M_B*(y*(1.+(y-1.)*M**2./2.)/R/T0)**(1/2.);\n",
+ "print'%s %.3f %s'%(\"mass flow rate =\",m,\"kg/s\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the value of the friction factor for the pipe\n",
+ "friction factor = 0.007 \n",
+ " the overall length of the pipe, L, if the flow exhausts to atmosphere\n",
+ "Overall Length = 15.8 m\n",
+ " the mass flow rate if the reservoir temperature is 294 K.\n",
+ "mass flow rate = 0.109 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg542"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate Diameter of pipe and Entry and Exit Mach number and at various points\n",
+ "p1=8.*10.**5.; ## N/m**2\n",
+ "p2=5.*10.**5.; ## N/m**2\n",
+ "f=0.006;\n",
+ "l=145.; ## m\n",
+ "m=0.32; ## kg/s\n",
+ "R=287.; ## J/kg.K\n",
+ "T=288.; ## K\n",
+ "y=1.4;\n",
+ "\n",
+ "d=(4.*f*l*m**2.*R*T/(math.pi/4.)**2./(p1**2.-p2**2.))**(1/5.);\n",
+ "print'%s %.3f %s'%(\" Diameter of pipe =\",d,\"m\")\n",
+ "\n",
+ "rho=p1/R/T;\n",
+ "A=math.pi/4.*d**2.;\n",
+ "u=m/rho/A;\n",
+ "\n",
+ "a=math.sqrt(y*R*T);\n",
+ "\n",
+ "M1=u/a;\n",
+ "M2=p1/p2*M1;\n",
+ "\n",
+ "print(\" Entry and Exit Mach number =\")\n",
+ "\n",
+ "print'%s %.3f %s'%(\"Entry Mach number =\",M1,\"\")\n",
+ "\n",
+ "\n",
+ "print'%s %.2f %s'%(\"Exit Mach number =\",M2,\"\")\n",
+ "\n",
+ "print(\" Determine the pressure halfway along the pipe.\")\n",
+ "px=math.sqrt((p1**2.+p2**2.)/2.);\n",
+ "print'%s %.1f %s'%(\"Pressure =\",px,\"N/m**2\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Diameter of pipe = 0.041 m\n",
+ " Entry and Exit Mach number =\n",
+ "Entry Mach number = 0.072 \n",
+ "Exit Mach number = 0.12 \n",
+ " Determine the pressure halfway along the pipe.\n",
+ "Pressure = 667083.2 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file