{
"metadata": {
"name": "",
"signature": "sha256:3dc843b6fccc3bd8da777a50fc56121df05dd48df905590c5824b3d32e8ee94a"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4 : Flow through constant area ducts rayleigh flow"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.1 page : 9"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"Pa = 1*10**5 \t\t\t\t#Pressure of dry air in Pa\n",
"To1 = 288 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"M1 = 1 \t\t\t\t#Mach number at inlet of pipe\n",
"M2 = 0.8 \t\t\t\t#Mach number at exit o pipe\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K \n",
" \n",
"\t\t\t\t\n",
"#Calculation\n",
"t1 = 0.834 \t\t\t\t#Temperature ratio at entry, i.e.entry static temperature to total temperature from gas tables at isentropic,M1 = 1 & adiabatic consmath.tant = 1.4\n",
"T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n",
"t2 = 0.964 \t\t\t\t#Temperature ratio at critical state, i.e. exit stagnation temperature to critical state temperature from gas tables at Rayleigh, M2 = 0.8 & adiabatic consmath.tant = 1.4\n",
"To2 = t2*To1 \t\t\t\t#Total stagnation temperature at exit in K\n",
"t3 = 1.025 \t\t\t\t#Temperature ratio at exit, i.e. exit static temperature to total temperature from gas tables at isentropic,M1 = 1 & adiabatic consmath.tant = 1.4\n",
"T2 = t3*T1 \t\t\t\t#Static temperature at exit in Kelvin\n",
"q = Cp*(To1-To2) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"dT = To1-T2 \t\t\t\t#Change in temperature in K\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)The heat transferred per unit mass flow is %3.3f kJ/kg rejected \\\n",
"\\nB)Change in temperature is %3.3f K'%(q,dT)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)The heat transferred per unit mass flow is 10.420 kJ/kg rejected \n",
"B)Change in temperature is 41.803 K\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.2 page : 10"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M1 = 3. \t\t\t\t#Mach number at entry\n",
"P1 = 1. \t\t\t\t#Static Pressure at entry in atm\n",
"T1 = 300. \t\t\t\t#Static Temperature at entry in K\n",
"q = 300. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t1 = 2.8 \t\t\t\t#Temperature ratio at entry from gas tables (M = 3,k = 1.4,isentropinC)\n",
"To1 = t1*T1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 0.0272 \t\t\t\t#Pressure ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n",
"Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in atm\n",
"p2 = 0.176 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Pt = P1/p2 \t\t\t\t#Static critical pressure in atm \n",
"p3 = 3.424 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in atm\n",
"t2 = 0.281 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3) \n",
"Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n",
"t3 = 0.654 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n",
"t4 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n",
"M2 = 1.6 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t4)\n",
"p4 = 0.524 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n",
"P2 = p4*Pt \t\t\t\t#Static Pressure at exit in atm\n",
"p5 = 1.176 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n",
"Po2 = p5*Pot \t\t\t\t#Stagnation Pressure at exit in atm\n",
"t5 = 0.702 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4 = 0.866,M = 1.6)\n",
"T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n",
"d2 = P2*101325/(R*T2) \t\t\t\t#density of air at exit in kg/m**3, P2 in N/m**2\n",
"\n",
"\t\t\t\t#outpur\n",
"print 'A)The Mach numer at exit is %3.1f \\\n",
"\\nB)Static Pressure at exit is %3.3f atm \\\n",
"\\nC)Static exit temperature is %3.2f K \\\n",
"\\nD)density of air at exit is %3.4f kg/m**3 \\\n",
"\\nE)Stagnation exit temperation is %3.2f K \\\n",
"\\nF)Stagnation Pressure at exit is %3.2f atm'%(M2,P2,T2,d2,To2,Po2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)The Mach numer at exit is 1.6 \n",
"B)Static Pressure at exit is 2.977 atm \n",
"C)Static exit temperature is 749.47 K \n",
"D)density of air at exit is 1.4025 kg/m**3 \n",
"E)Stagnation exit temperation is 1138.51 K \n",
"F)Stagnation Pressure at exit is 12.63 atm\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.3 page : 11"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M1 = 2 \t\t\t\t#Mach number at entry\n",
"P1 = 1.4 \t\t\t\t#Static Pressure at entry in bar\n",
"T1 = 323 \t\t\t\t#Static Temperature at entry in K\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n",
"R = 287 \t\t\t\t#Gas consmath.tant in J/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t1 = 0.555 \t\t\t\t#Temperature ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n",
"To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 0.364 \t\t\t\t#Pressure ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n",
"Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n",
"t2 = 0.529 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2) \n",
"Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n",
"t3 = 0.793 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"To2 = Tot \t\t\t\t#Stagnation exit temperation in K\n",
"q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n",
"C1 = M1*a1 \t\t\t\t#Air velocity in m/s\n",
"d1 = (P1*10**5)/(R*T1) \t\t\t\t#density of air in kg/m**3\n",
"ma = d1*C1 \t\t\t\t#Mass flow rate per unit area in kg/s-m**3\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Mass flow rate per unit area is %3.2f kg/s-m**2 \\\n",
"\\nB)Final temperarure is %3.3f K \\\n",
"\\nC)Heat added is %3.2f kJ/kg'%(ma,Tt,q)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Mass flow rate per unit area is 1088.13 kg/s-m**2 \n",
"B)Final temperarure is 610.586 K \n",
"C)Heat added is 152.68 kJ/kg\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.4 page : 11"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"C1 = 100. \t\t\t\t#Air velocity into combustion chamber in m/s\n",
"P1 = 3. \t\t\t\t#Static Pressure at entry in bar\n",
"T1 = 318. \t\t\t\t#Static Temperature at entry in K\n",
"q = 630. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n",
"R = 287. \t\t\t\t#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 in m/s\n",
"M1 = C1/a1 \t\t\t\t#Mach number at entry\n",
"t1 = 0.985 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n",
"To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 0.947 \t\t\t\t#Pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n",
"Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n",
"To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n",
"p2 = 2.163 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n",
"Pt = P1/p2 \t\t\t\t#Static critical pressure in bar \n",
"p3 = 2.206 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n",
"Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n",
"t2 = 0.310 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.28)\n",
"Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n",
"t3 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n",
"M2 = 0.7 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t3)\n",
"p4 = 1.423 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t3,M2)\n",
"P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar\n",
"\n",
"\t\t\t\t\n",
"#Output \n",
"print 'A)Pressure after combustion is %3.3f bar \\\n",
"\\nB)Mach number after combustion is %3.1f'%(P2,M2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Pressure after combustion is 1.974 bar \n",
"B)Mach number after combustion is 0.7\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.5 page : 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M1 = 3. \t\t\t\t#Mach number at entry\n",
"To1 = 295. \t\t\t\t#Total stagnation temperature at inlet in K\n",
"P1 = 0.5 \t\t\t\t#Static Pressure at entry in bar\n",
"M2 = 1.5 \t\t\t\t#Mack number at exit\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"p1 = 0.0272 \t\t\t\t#Pressure ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n",
"Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n",
"t1 = 0.357 \t\t\t\t#Temperature ratio at entry from gas tables (M = 3,k = 1.4,isentropiC)\n",
"T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n",
"p2 = 0.176 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Pt = P1/p2 \t\t\t\t#Static critical pressure in bar \n",
"p3 = 3.424 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n",
"t2 = 0.654 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n",
"t3 = 0.280 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 3)\n",
"Tt = T1/t3 \t\t\t\t#Static critical temperature in K\n",
"p4 = 0.578 \t\t\t\t#\t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,M = 1.5)\n",
"P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar\n",
"p5 = 1.122 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,M = 1.5)\n",
"Po2 = p5*Pot \t\t\t\t#Stagnation Pressure at exit in bar\n",
"t4 = 0.753 \t\t\t\t#\t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,M = 1.5)\n",
"T2 = t4*Tt \t\t\t\t#Static exit temperature in K\n",
"t5 = 0.909 \t\t\t\t#Stagnation temperature ratio at exit from gas tables (Rayleigh,M = 1.5)\n",
"To2 = t5*Tot \t\t\t\t#Total stagnation temperature at exit in K\n",
"q = Cp*(To1-To2) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"SPC = Po1-Po2 \t\t\t\t#Change in stagnation pressure in bar\n",
"n = math.log(Po1/Po2)/(math.log(Po1/Po2)-math.log(To1/To2)) \t\t\t\t#Exponent of polytropic equation\n",
"qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg\n",
"ds = Cp*math.log(T2/T1)-(R*math.log(P2/P1)) \t\t\t\t#Change in entropy in kJ/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Total temperature at exit is %3.2f K \\\n",
"\\nB)Static pressure at exit is %3.3f bar \\\n",
"\\nC)Change in stagnation pressure is %3.2f bar \\\n",
"\\nD)Exponent of polytropic equation is %3.2f'%(To2,P2,SPC,n)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Total temperature at exit is 410.02 K \n",
"B)Static pressure at exit is 1.642 bar \n",
"C)Change in stagnation pressure is 12.36 bar \n",
"D)Exponent of polytropic equation is 0.77\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.6 page : 14"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M2 = 0.9 \t\t\t\t#Mack number at exit\n",
"P2 = 2.5 \t\t\t\t#Static Pressure at exit in bar\n",
"T2 = 1273. \t\t\t\t#Static exit temperature in K\n",
"t1 = 3.74 \t\t\t\t#ratio of stagnation temperatures at and exit entry\n",
"Cp = 1.218 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t2 = 0.892 \t\t\t\t#Temperauture ratio at exit from gas tables (isentropic,k = 1.3,M = 0.9)\n",
"To2 = T2/t2 \t\t\t\t#Total stagnation temperature at exit in K\n",
"To1 = To2/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 1.12 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n",
"Pt = P2/p1 \t\t\t\t#Static critical pressure in bar\n",
"t3 = 1.017 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n",
"Tt = T2/t3 \t\t\t\t#Static critical temperature in K\n",
"t4 = 0.991 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M = 1.5)\n",
"Tot = To2/t4 \t\t\t\t#Stagnation critical temperature in K\n",
"t5 = To1/Tot \t\t\t\t#Ratio of stagnation temperature at entry and critical state \n",
"M1 = 0.26 \t\t\t\t#Mach number at entry from gas tables (Rayleigh,t5,k = 1.3)\n",
"p2 = 2.114 \t\t\t\t#Static Pressure ratio at entry from gas tables (Rayleigh,t5,k = 1.3)\n",
"P1 = Pt*p2 \t\t\t\t#Static Pressure at entry in bar\n",
"t6 = 0.302 \t\t\t\t#Static temperature ratio at entry from gas tables (Rayleigh,t5,k = 1.3)\n",
"T1 = Tt*t6 \t\t\t\t#Static temperature at entry in Kelvin\n",
"q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg \n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Mach number at entry is %3.2f \\\n",
"\\nB)Pressure at entry is %3.3f bar \\\n",
"\\nC)Temperature of gas is %3i K \\\n",
"\\nD)Amount of heat added is %3.2f kJ/kg \\\n",
"\\nE)Maximum heat that can be heated is %3.3f kJ/kg'%(M1,P1,T1,q,qmax)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Mach number at entry is 0.26 \n",
"B)Pressure at entry is 4.719 bar \n",
"C)Temperature of gas is 378 K \n",
"D)Amount of heat added is 1273.47 kJ/kg \n",
"E)Maximum heat that can be heated is 1289.259 kJ/kg\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.7 page : 15"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"#input\n",
"P1 = 0.343 \t\t\t\t#Static Pressure at entry in bar\n",
"T1 = 310. \t\t\t\t#Static temperature at entry in Kelvin\n",
"C1 = 60. \t\t\t\t#Velocity at entrance in m/s\n",
"q = 1172.5 \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n",
"R = 287. \t\t\t\t#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 in m/s\n",
"M1 = C1/a1 \t\t\t\t#Mach number at entry\n",
"t1 = 0.9943 \t\t\t\t#Temperature ratio at entry from gas tables (M = 0.17,k = 1.4,isentropic)\n",
"To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 2.306 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n",
"Pt = P1/p1 \t\t\t\t#Static critical pressure in bar\n",
"t2 = 0.154 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17) \n",
"Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n",
"t3 = 0.129 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"c1 = 0.0665 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 0.17)\n",
"Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n",
"To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n",
"t4 = To2/Tot \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n",
"M2 = 0.45 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"p2 = 1.87 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"P2 = p2*Pt \t\t\t\t#Static Pressure at exit in bar \n",
"t5 = 0.7075 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n",
"c2 = 0.378 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,t4)\n",
"C2 = Ct*c2 \t\t\t\t#exit velocity in m/s\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'At exit conditions : A)Mach number is %3.2f \\\n",
"\\nB)Pressure is %3.3f bar \\\n",
"\\nC)Temperature is %3.2f K \\\n",
"\\nD)Exit velocity is %3.2f m/s'%(M2,P2,T2,C2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"At exit conditions : A)Mach number is 0.45 \n",
"B)Pressure is 0.278 bar \n",
"C)Temperature is 1424.19 K \n",
"D)Exit velocity is 341.05 m/s\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.8 page : 16"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M1 = 2. \t\t\t\t#Mach number at entry\n",
"To1 = 523. \t\t\t\t#Total stagnation temperature at inlet in K\n",
"Po1 = 6. \t\t\t\t#Stagnation Pressure at entry in bar\n",
"To2 = 423. \t\t\t\t#Stagnation exit temperation in K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t1 = 0.555 \t\t\t\t#Temperature ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n",
"T1 = t1*To1 \t\t\t\t#Static temperature at entry in Kelvin\n",
"p1 = 0.128 \t\t\t\t#Pressure ratio at entry from gas tables (M = 2,k = 1.4,isentropiC)\n",
"P1 = Po1*p1 \t\t\t\t#Static Pressure at entry in bar\n",
"p2 = 0.364 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n",
"p3 = 1.503 \t\t\t\t#\t\t\t\t#Stagnation pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2), printing mistake in textbook\n",
"t2 = 0.529 \t\t\t\t#Static Temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n",
"t3 = 0.793 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M = 2)\n",
"t4 = (To2/To1)*t3 \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n",
"M2 = 3.15 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"p4 = 0.161 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4), printing mistake in textbook\n",
"t5 = 0.258 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"P2 = (p4/p2)*P1 \t\t\t\t#Static Pressure at exit in bar \n",
"T2 = (t5/t2)*T1 \t\t\t\t#Static exit temperature in K\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'After Cooling : A)Mach number is %3.2f \\\n",
"\\nB)Pressure is %3.4f bar \\\n",
"\\nC)Temperature is %3.2f K'%(M2,P2,T2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"After Cooling : A)Mach number is 3.15 \n",
"B)Pressure is 0.3397 bar \n",
"C)Temperature is 141.57 K\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.9 page : 17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"M2 = 0.8 \t\t\t\t#Mack number at exit\n",
"t1 = 4. \t\t\t\t#Ratio of stagnation temperature at exit and entry\n",
"T1 = 288. \t\t\t\t#Atmospheric temperature in K\n",
"P1 = 1. \t\t\t\t#Atmospheric Pressure in atm\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t2 = 0.964 \t\t\t\t#Ratio of stagnation temperature at exit and critical state from gas tables\n",
"t3 = t2/t1 \t\t\t\t#Ratio of stagnation temperature at entry and critical state\n",
"M1 = 0.24 \t\t\t\t#\t\t\t\t#Mach number at entry from gas tables (Rayleigh,t3,k = 1.4)\n",
"t5 = 0.988 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n",
"To1 = T1/t5 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"To2 = t1*To1 \t\t\t\t#Stagnation exit temperation in K\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"q = Cp*(To2-To1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"qmax = Cp*(Tot-To1) \t\t\t\t#Maximum possible heat transfer in kJ/kg \n",
"t6 = 0.9775 \t\t\t\t#Ratio of stagnation temperature for maximum static temperature (M = 1/math.sqrt(k),Rayleigh)\n",
"To3 = Tot*t6 \t\t\t\t#maximum stagnation temperature in K\n",
"q_req = Cp*(To3-To1) \t\t\t\t#Heat transfer required to get maximum static temperature in kJ/kg\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Heat added per kg of air flow is %3.2f kJ/kg \\\n",
"\\nB)Maximum possible heat transfer is %3.2f kJ/kg \\\n",
"\\nC)Heat transfer required to get maximum static temperature is %3.1f kJ/kg'%(q,qmax,q_req)\n",
"\n",
"# note : rounding off error"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Heat added per kg of air flow is 878.87 kJ/kg \n",
"B)Maximum possible heat transfer is 922.63 kJ/kg \n",
"C)Heat transfer required to get maximum static temperature is 895.3 kJ/kg\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.10 page : 17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\t\t\t\t\n",
"#Input data\n",
"T1 = 560. \t\t\t\t#Static Temperature at entry in K\n",
"P1 = 0.6 \t\t\t\t#Static Pressure at entry in bar\n",
"C1 = 75. \t\t\t\t#Air velocity into combustion chamber in m/s\n",
"mp = 30. \t\t\t\t#air fuel ratio\n",
"CV = 92000. \t\t\t\t#Calorific value of fuel in kJ/kg\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"k = 1.4 \t\t\t\t#Adiabatic consmath.tant\n",
"R = 287. \t\t\t\t#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 in m/s\n",
"M1 = C1/a1 \t\t\t\t#Mach number at entry\n",
"t1 = 0.9949 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n",
"To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 0.982 \t\t\t\t#Pressure ratio at entry from gas tables (M1,k = 1.4,isentropiC)\n",
"Po1 = P1/p1 \t\t\t\t#Stagnation Pressure at entry in bar\n",
"q = CV/(mp+1) \t\t\t\t#The heat transferred per unit mass flow in kJ/kg of gas, mp+1 = total amount of fuel = mf+ma\n",
"p2 = 2.317 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"Pt = P1/p2 \t\t\t\t#Static critical pressure in bar\n",
"p3 = 1.246 \t\t\t\t#Stagnation Pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"Pot = Po1/p3 \t\t\t\t#Stagnation critical pressure in bar\n",
"t2 = 0.137 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1) \n",
"Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n",
"t3 = 0.115 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n",
"t4 = To2/Tot \t\t\t\t#Ratio of stagnation temperature at exit and critical state \n",
"M2 = 0.33 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"p4 = 2.0825 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"P2 = p4*Pt \t\t\t\t#Static Pressure at exit in bar, miscalculation in textbook\n",
"p5 = 1.186 \t\t\t\t#Stagnation Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"Po2 = Pot*p5 \t\t\t\t#Stagnation Pressure at exit in bar\n",
"t5 = 0.472 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n",
"C2 = M2*math.sqrt(k*R*T2) \t\t\t\t#exit velocity in m/s\n",
"SPL = ((Po1-Po2)/Po1)*100 \t\t\t\t#Percentage of pressure loss in combustion chamber in %\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)At exit: \\\n",
"\\nPressure is %3.5f bar \\\n",
"\\nTemperature is %3i K \\\n",
"\\nVelocity is %3.2f m/s \\\n",
"\\nMach number is %3.2f \\\n",
"\\nB)Maximum stagnation temperature available is %3.2f K \\\n",
"\\nC)Percentage of pressure loss in combustion chamber is %3.1f percent \\\n",
"\\nD)Intial Mach number is %3.2f '%(P2,T2,C2,M2,Tot,SPL,M1)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)At exit: \n",
"Pressure is 0.53927 bar \n",
"Temperature is 1929 K \n",
"Velocity is 290.55 m/s \n",
"Mach number is 0.33 \n",
"B)Maximum stagnation temperature available is 4894.53 K \n",
"C)Percentage of pressure loss in combustion chamber is 4.8 percent \n",
"D)Intial Mach number is 0.16 \n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.11 page : 19"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\t\t\t\t\n",
"#Input data\n",
"To1 = 473. \t\t\t\t#Total stagnation temperature at inlet in K\n",
"To2 = 673. \t\t\t\t#Stagnation exit temperation in K\n",
"M1 = 0.5 \t\t\t\t#Mach number at entry\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t1 = 0.6914 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"p1 = 1.7778 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"t2 = (To2/To1)*t1 \t\t\t\t#Stagnation temperature ratio at exit \n",
"M2 = 0.867 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t2,k = 1.4)\n",
"p2 = 1.16 \t\t\t\t#Static pressure ratio at exit from gas tables (Rayleigh,k = 1.4,M2)\n",
"p = p2/p1 \t\t\t\t#ratio of static pressures at oulet and inlet\n",
"PL = (1-p)*100 \t\t\t\t#pressure loss in %\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Mach number is %3.3f \\\n",
"\\nB)Percentage drop in pressure is %3.1f percent'%(M2,PL) \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Mach number is 0.867 \n",
"B)Percentage drop in pressure is 34.8 percent\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.12 page : 19"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\t\t\t\t\n",
"#Input data\n",
"t1 = 3. \t\t\t\t#Stagnation temperature ratio\n",
"M2 = 0.8 \t\t\t\t#Mach number at exit\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"t2 = 0.964 \t\t\t\t#Ratio of stagnation temperature at exit and critical state (Rayleigh,M2,k = 1.4) \n",
"p1 = 1.266 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,M2,k = 1.4)\n",
"t3 = t2/t1 \t\t\t\t#Stagnation temperature ratio at critical state \n",
"M1 = 0.29 \t\t\t\t#Mach number at entry from gas tables (Rayleigh,t3,k = 1.4)\n",
"p2 = 2.147 \t\t\t\t#Static pressure ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"p = p1/p2 \t\t\t\t#ratio of static pressures at exit and entry\n",
"PL = (1-p)*100 \t\t\t\t#Percentage loss in static pressure in %\n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Mach number at entry is %3.2f \\\n",
"\\nB)Percentage loss in static pressure is %3i percent'%(M1,PL)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Mach number at entry is 0.29 \n",
"B)Percentage loss in static pressure is 41 percent\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.13 page : 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\t\t\t\t\n",
"#Input data\n",
"To1 = 300. \t\t\t\t#Total stagnation temperature at inlet in K\n",
"To2 = 310. \t\t\t\t#Stagnation exit temperation in K\n",
"G = 1300. \t\t\t\t#Mass velocity in kg/m**2-s\n",
"P1 = 105.*10**3 \t\t\t\t#Static Pressure at entry in Pa\n",
"Cp = 1.005 \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"R = 287. \t\t\t\t#Gas consmath.tant in J/kg-K\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"T1 = (((-2*P1**2*Cp)+math.sqrt(((-2*P1**2*Cp)**2)+(8*G**2*R**2*P1**2*Cp*To1)))/(2*G**2*R**2)) \t\t\t\t#Static temperature in K\n",
"t1 = T1/To1 \t\t\t\t#Temperature ratio at entry\n",
"M1 = 1.4 \t\t\t\t#Mach number at entry from gas tables (isentropic,t1,k = 1.4)\n",
"t2 = 0.934 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.4,M1)\n",
"Tot = To1/t2 \t\t\t\t#Stagnation critical temperature in K\n",
"t3 = To2/Tot \t\t\t\t#Stagnation temperature ratio at exit from gas tables (Rayleigh,k = 1.4,M1)\n",
"M2 = 1.26 \t\t\t\t#Mach number at exit from gas tables (Rayleigh,t3,k = 1.4)\n",
"\n",
"\t\t\t\t\n",
"#Output \n",
"print 'A)The inlet mach number is %3.2f \\\n",
"\\nB)The exit mach number is %3.2f'%(M1,M2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)The inlet mach number is 1.40 \n",
"B)The exit mach number is 1.26\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.14 page : 21"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"\t\t\t\t\n",
"#Input data\n",
"k = 1.3 \t\t\t\t#Adiabatic consmath.tant\n",
"R = 466. \t\t\t\t#Gas consmath.tant in J/kg-K\n",
"P1 = 0.345 \t\t\t\t#Static Pressure at entry in Pa\n",
"T1 = 312. \t\t\t\t#Static Temperature at entry in K\n",
"C1 = 65.5 \t\t\t\t#Entry velocity in m/s\n",
"q = 4592. \t\t\t\t#The heat transferred per unit mass flow in kJ/kg\n",
"\n",
"\t\t\t\t\n",
"#Calculation\n",
"a1 = math.sqrt(k*R*T1) \t\t\t\t#Sound velocity in m/s\n",
"M1 = C1/a1 \t\t\t\t#Mach number at entry\n",
"t1 = 0.9965 \t\t\t\t#Temperature ratio at entry from gas tables (M1,k = 1.3,isentropiC)\n",
"To1 = T1/t1 \t\t\t\t#Total stagnation temperature at inlet in K\n",
"p1 = 2.235 \t\t\t\t#Static Pressure ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n",
"Pt = P1/p1 \t\t\t\t#Static critical pressure in bar \n",
"c1 = 0.051 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n",
"Ct = C1/c1 \t\t\t\t#Critical velocity in m/s\n",
"t2 = 0.112 \t\t\t\t#Static temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M1) \n",
"Tt = T1/t2 \t\t\t\t#Static critical temperature in K\n",
"t3 = 0.098 \t\t\t\t#Stagnation temperature ratio at critical state from gas tables (Rayleigh,k = 1.3,M1)\n",
"Tot = To1/t3 \t\t\t\t#Stagnation critical temperature in K\n",
"Cp = (k*R)/(k-1) \t\t\t\t#Specific heat of dry air in kJ/kg-K\n",
"To2 = (q/Cp)+To1 \t\t\t\t#Stagnation exit temperation in K\n",
"t4 = (To2/Tot) \t\t\t\t#Stagnation Temperature ratio at exit\n",
"M2 = 0.60 \t\t\t\t#Mack number at exit from gas tables (Rayleigh,t4)\n",
"p2 = 1.567 \t\t\t\t#Static Pressure ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"P2 = p2*Pt \t\t\t\t#Static Pressure at exit in bar \n",
"t5 = 0.884 \t\t\t\t#Static temperature ratio at exit from gas tables (Rayleigh,t4,k = 1.4)\n",
"T2 = t5*Tt \t\t\t\t#Static exit temperature in K\n",
"c2 = 0.564 \t\t\t\t#Velocity ratio at critical state from gas tables (Rayleigh,k = 1.4,t4)\n",
"C2 = Ct*c2 \t\t\t\t#exit velocity in m/s\n",
"qmax = Cp*(Tot-To1)/10**3 \t\t\t\t#Maximum possible heat transfer in kJ/kg \n",
"\n",
"\t\t\t\t\n",
"#Output\n",
"print 'A)Heat required to accelerate the gas from the inlet condition to sonic condition is %3.2f kJ/kg \\\n",
"\\nB)The pressure and temperature at sonic condition are %3.3f bar and %3.2f K respectively \\\n",
"\\nC)The properties at exit are: \\\n",
"\\nPressure is %3.3f bar \\\n",
"\\nTemperature is %3.2f K \\\n",
"\\nVelocity is %3i m/s'%(qmax,Pt,Tt,P2,T2,C2)\n",
"\n",
"# note : rounding off error."
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"A)Heat required to accelerate the gas from the inlet condition to sonic condition is 5819.23 kJ/kg \n",
"B)The pressure and temperature at sonic condition are 0.154 bar and 2785.71 K respectively \n",
"C)The properties at exit are: \n",
"Pressure is 0.242 bar \n",
"Temperature is 2462.57 K \n",
"Velocity is 724 m/s\n"
]
}
],
"prompt_number": 19
}
],
"metadata": {}
}
]
}