PK
I\($$,Engineering Thermodynamics/chapter_1_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# chapter 1:Fundemental concepts and definitions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.1;page no:22"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.1, Page:22 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1\n",
"pressure difference(p)in pa\n",
"p= 39755.7\n"
]
}
],
"source": [
"#cal of pressure difference\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.1, Page:22 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1\"\n",
"h=30*10**-2;#manometer deflection of mercury in m\n",
"g=9.78;#acceleration due to gravity in m/s^2\n",
"rho=13550;#density of mercury at room temperature in kg/m^3\n",
"print\"pressure difference(p)in pa\"\n",
"p=rho*g*h\n",
"print\"p=\",round(p,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.2;page no:22"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.2, Page:22 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2\n",
"effort required for lifting the lid(E)in N\n",
"E= 7115.48\n"
]
}
],
"source": [
"#cal of effort required for lifting the lid\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.2, Page:22 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2\"\n",
"d=30*10**-2;#diameter of cylindrical vessel in m\n",
"h=76*10**-2;#atmospheric pressure in m of mercury\n",
"g=9.78;#acceleration due to gravity in m/s^2\n",
"rho=13550;#density of mercury at room temperature in kg/m^3\n",
"print\"effort required for lifting the lid(E)in N\"\n",
"E=(rho*g*h)*(3.14*d**2)/4\n",
"print\"E=\",round(E,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.3;page no:22"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.3, Page:22 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3\n",
"pressure measured by manometer is gauge pressure(Pg)in kpa\n",
"Pg=rho*g*h/10^3\n",
"actual pressure of the air(P)in kpa\n",
"P= 140.76\n"
]
}
],
"source": [
"#cal of actual pressure of the air\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.3, Page:22 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3\"\n",
"h=30*10**-2;# pressure of compressed air in m of mercury\n",
"Patm=101*10**3;#atmospheric pressure in pa\n",
"g=9.78;#acceleration due to gravity in m/s^2\n",
"rho=13550;#density of mercury at room temperature in kg/m^3\n",
"print\"pressure measured by manometer is gauge pressure(Pg)in kpa\"\n",
"print\"Pg=rho*g*h/10^3\"\n",
"Pg=rho*g*h/10**3\n",
"print\"actual pressure of the air(P)in kpa\"\n",
"P=Pg+Patm/10**3\n",
"print\"P=\",round(P,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.4;page no:22"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.4, Page:22 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4\n",
"density of oil(RHOoil)in kg/m^3\n",
"RHOoil=sg*RHOw\n",
"gauge pressure(Pg)in kpa\n",
"Pg= 7.848\n"
]
}
],
"source": [
"#cal of gauge pressure\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.4, Page:22 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4\"\n",
"h=1;#depth of oil tank in m\n",
"sg=0.8;#specific gravity of oil\n",
"RHOw=1000;#density of water in kg/m^3\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print\"density of oil(RHOoil)in kg/m^3\"\n",
"print\"RHOoil=sg*RHOw\"\n",
"RHOoil=sg*RHOw\n",
"print\"gauge pressure(Pg)in kpa\"\n",
"Pg=RHOoil*g*h/10**3\n",
"print\"Pg=\",round(Pg,3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.5;page no:22"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.5, Page:22 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5\n",
"atmospheric pressure(Patm)in kpa\n",
"Patm=rho*g*h2/10^3\n",
"pressure due to mercury column at AB(Pab)in kpa\n",
"Pab=rho*g*h1/10^3\n",
"pressure exerted by gas(Pgas)in kpa\n",
"Pgas= 154.76\n"
]
}
],
"source": [
"#cal of pressure exerted by gas\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.5, Page:22 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5\"\n",
"rho=13.6*10**3;#density of mercury in kg/m^3\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"h1=40*10**-2;#difference of height in mercury column in m as shown in figure\n",
"h2=76*10**-2;#barometer reading of mercury in m\n",
"print\"atmospheric pressure(Patm)in kpa\"\n",
"print\"Patm=rho*g*h2/10^3\"\n",
"Patm=rho*g*h2/10**3\n",
"print\"pressure due to mercury column at AB(Pab)in kpa\"\n",
"print\"Pab=rho*g*h1/10^3\"\n",
"Pab=rho*g*h1/10**3\n",
"print\"pressure exerted by gas(Pgas)in kpa\"\n",
"Pgas=Patm+Pab\n",
"print\"Pgas=\",round(Pgas,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.6;page no:23"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.6, Page:23 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6\n",
"by law of conservation of energy\n",
"potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule\n",
"so m*g*h = m*Cp*deltaT*4.18*1000\n",
"change in temperature of water(deltaT) in degree celcius\n",
"deltaT= 2.35\n"
]
}
],
"source": [
"#cal of change in temperature of water\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.6, Page:23 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6\"\n",
"m=1;#mass of water in kg\n",
"h=1000;#height from which water fall in m\n",
"Cp=1;#specific heat of water in kcal/kg k\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print\"by law of conservation of energy\"\n",
"print\"potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule\"\n",
"print\"so m*g*h = m*Cp*deltaT*4.18*1000\"\n",
"print\"change in temperature of water(deltaT) in degree celcius\"\n",
"deltaT=(g*h)/(4.18*1000*Cp)\n",
"print\"deltaT=\",round(deltaT,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.7;page no:23"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.7, Page:23 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7\n",
"mass of object(m)in kg\n",
"m=w1/g1\n",
"spring balance reading=gravitational force in mass(F)in N\n",
"F= 86.65\n"
]
}
],
"source": [
"#cal of spring balance reading\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.7, Page:23 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7\"\n",
"w1=100;#weight of object at standard gravitational acceleration in N\n",
"g1=9.81;#acceleration due to gravity in m/s^2\n",
"g2=8.5;#gravitational acceleration at some location\n",
"print\"mass of object(m)in kg\"\n",
"print\"m=w1/g1\"\n",
"m=w1/g1\n",
"print\"spring balance reading=gravitational force in mass(F)in N\"\n",
"F=m*g2\n",
"print\"F=\",round(F,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.8;page no:24"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.8, Page:24 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8\n",
"pressure measured by manometer(P) in pa\n",
"p=rho*g*h\n",
"now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)\n",
"mass of piston(m)in kg\n",
"so m= 28.84\n"
]
}
],
"source": [
"#cal of mass of piston\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"import math\n",
"print\"Example 1.8, Page:24 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8\"\n",
"d=15*10**-2;#diameter of cylinder in m\n",
"h=12*10**-2;#manometer height difference in m of mercury\n",
"rho=13.6*10**3;#density of mercury in kg/m^3\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print\"pressure measured by manometer(P) in pa\"\n",
"print\"p=rho*g*h\"\n",
"p=rho*g*h\n",
"print\"now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)\"\n",
"print\"mass of piston(m)in kg\"\n",
"m=(p*math.pi*d**2)/(4*g)\n",
"print\"so m=\",round(m,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.9;page no:24"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.9, Page:24 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9\n",
"balancing pressure at plane BC in figure we get\n",
"Psteam+Pwater=Patm+Pmercury\n",
"now 1.atmospheric pressure(Patm)in pa\n",
"Patm= 101396.16\n",
"2.pressure due to water(Pwater)in pa\n",
"Pwater= 196.2\n",
"3.pressure due to mercury(Pmercury)in pa\n",
"Pmercury=RHOm*g*h3 13341.6\n",
"using balancing equation\n",
"Psteam=Patm+Pmercury-Pwater\n",
"so pressure of steam(Psteam)in kpa\n",
"Psteam= 114.54\n"
]
}
],
"source": [
"#cal of pressure due to atmosphere,water,mercury,steam\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.9, Page:24 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9\")\n",
"RHOm=13.6*10**3;#density of mercury in kg/m^3\n",
"RHOw=1000;#density of water in kg/m^3\n",
"h1=76*10**-2;#barometer reading in m of mercury\n",
"h2=2*10**-2;#height raised by water in manometer tube in m \n",
"h3=10*10**-2;#height raised by mercury in manometer tube in m \n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"balancing pressure at plane BC in figure we get\")\n",
"print(\"Psteam+Pwater=Patm+Pmercury\")\n",
"print(\"now 1.atmospheric pressure(Patm)in pa\")\n",
"Patm=RHOm*g*h1\n",
"print(\"Patm=\"),round(Patm,2)\n",
"print(\"2.pressure due to water(Pwater)in pa\")\n",
"Pwater=RHOw*g*h2\n",
"print(\"Pwater=\"),round(Pwater,2)\n",
"print(\"3.pressure due to mercury(Pmercury)in pa\")\n",
"Pmercury=RHOm*g*h3\n",
"print(\"Pmercury=RHOm*g*h3\"),round(Pmercury,2)\n",
"print(\"using balancing equation\")\n",
"print(\"Psteam=Patm+Pmercury-Pwater\")\n",
"print(\"so pressure of steam(Psteam)in kpa\")\n",
"Psteam=(Patm+Pmercury-Pwater)/1000\n",
"print(\"Psteam=\"),round(Psteam,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.10;page no:24"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.10, Page:24 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10\n",
"atmospheric pressure(Patm)in kpa\n",
"absolute temperature in compartment A(Pa) in kpa\n",
"Pa= 496.06\n",
"absolute temperature in compartment B(Pb) in kpa\n",
"Pb= 246.06\n",
"absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa\n"
]
}
],
"source": [
"#cal of \"absolute temperature in compartment A,B\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.10, Page:24 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10\")\n",
"h=720*10**-3;#barometer reading in m of Hg\n",
"Pga=400;#gauge pressure in compartment A in kpa\n",
"Pgb=150;#gauge pressure in compartment B in kpa\n",
"rho=13.6*10**3;#density of mercury in kg/m^3\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"atmospheric pressure(Patm)in kpa\")\n",
"Patm=(rho*g*h)/1000\n",
"print(\"absolute temperature in compartment A(Pa) in kpa\")\n",
"Pa=Pga+Patm\n",
"print\"Pa=\",round(Pa,2)\n",
"print\"absolute temperature in compartment B(Pb) in kpa\"\n",
"Pb=Pgb+Patm\n",
"print\"Pb=\",round(Pb,2)\n",
"print\"absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.11;page no:25"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.11, Page:25 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11\n",
"the pressure of air in air tank can be obtained by equalising pressures at some reference line\n",
"P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3\n",
"so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2\n",
"air pressure(P1)in kpa 139.81\n"
]
}
],
"source": [
"#cal of air pressure\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.11, Page:25 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11\")\n",
"Patm=90*10**3;#atmospheric pressure in pa\n",
"RHOw=1000;#density of water in kg/m^3\n",
"RHOm=13600;#density of mercury in kg/m^3\n",
"RHOo=850;#density of oil in kg/m^3\n",
"g=9.81;#acceleration due to ggravity in m/s^2\n",
"h1=.15;#height difference between water column in m\n",
"h2=.25;#height difference between oil column in m\n",
"h3=.4;#height difference between mercury column in m\n",
"print\"the pressure of air in air tank can be obtained by equalising pressures at some reference line\"\n",
"print\"P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3\"\n",
"print\"so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2\"\n",
"P1=(Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2)/1000\n",
"print\"air pressure(P1)in kpa\",round(P1,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.12;page no:26"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.12, Page:26 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12\n",
"mass of object(m)in kg\n",
"m=F/g\n",
"kinetic energy(E)in J is given by\n",
"E= 140625000.0\n"
]
}
],
"source": [
"#cal of kinetic energy\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.12, Page:26 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12\"\n",
"v=750;#relative velocity of object with respect to earth in m/sec\n",
"F=4000;#gravitational force in N\n",
"g=8;#acceleration due to gravity in m/s^2\n",
"print\"mass of object(m)in kg\"\n",
"print\"m=F/g\"\n",
"m=F/g\n",
"print\"kinetic energy(E)in J is given by\"\n",
"E=m*v**2/2\n",
"print\"E=\",round(E)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.13;page no:26"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.13, Page:26 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13\n",
"characteristics gas constant(R2)in kJ/kg k\n",
"molecular weight of gas(m)in kg/kg mol= 16.63\n",
"NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.\n"
]
}
],
"source": [
"#cal of molecular weight of gas\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.13, Page:26 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13\"\n",
"Cp=2.286;#specific heat at constant pressure in kJ/kg k\n",
"Cv=1.786;#specific heat at constant volume in kJ/kg k\n",
"R1=8.3143;#universal gas constant in kJ/kg k\n",
"print\"characteristics gas constant(R2)in kJ/kg k\"\n",
"R2=Cp-Cv\n",
"m=R1/R2\n",
"print\"molecular weight of gas(m)in kg/kg mol=\",round(m,2)\n",
"print\"NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.14;page no:26"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.14, Page:26 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14\n",
"using perfect gas equation\n",
"P1*V1/T1 = P2*V2/T2\n",
"=>T2=(P2*V2*T1)/(P1*V1)\n",
"so final temperature of gas(T2)in k\n",
"or final temperature of gas(T2)in degree celcius= 127.0\n"
]
}
],
"source": [
"#cal of final temperature of gas\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.14, Page:26 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14\"\n",
"P1=750*10**3;#initial pressure of gas in pa\n",
"V1=0.2;#initial volume of gas in m^3\n",
"T1=600;#initial temperature of gas in k\n",
"P2=2*10**5;#final pressure of gas i pa\n",
"V2=0.5;#final volume of gas in m^3\n",
"print\"using perfect gas equation\"\n",
"print\"P1*V1/T1 = P2*V2/T2\"\n",
"print\"=>T2=(P2*V2*T1)/(P1*V1)\"\n",
"print\"so final temperature of gas(T2)in k\"\n",
"T2=(P2*V2*T1)/(P1*V1)\n",
"T2=T2-273\n",
"print\"or final temperature of gas(T2)in degree celcius=\",round(T2,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.15;page no:27"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.15, Page:27 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15\n",
"from perfect gas equation we get\n",
"initial mass of air(m1 in kg)=(P1*V1)/(R*T1)\n",
"m1= 5.807\n",
"final mass of air(m2 in kg)=(P2*V2)/(R*T2)\n",
"m2= 3.111\n",
"mass of air removed(m)in kg 2.696\n",
"volume of this mass of air(V) at initial states in m^3= 2.32\n"
]
}
],
"source": [
"#cal of volume of this mass of air(V) at initial states\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.15, Page:27 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15\"\n",
"P1=100*10**3;#initial pressure of air in pa\n",
"V1=5.;#initial volume of air in m^3\n",
"T1=300.;#initial temperature of gas in k\n",
"P2=50*10**3;#final pressure of air in pa\n",
"V2=5.;#final volume of air in m^3\n",
"T2=(280.);#final temperature of air in K\n",
"R=287.;#gas constant on J/kg k\n",
"print\"from perfect gas equation we get\"\n",
"print\"initial mass of air(m1 in kg)=(P1*V1)/(R*T1)\"\n",
"m1=(P1*V1)/(R*T1)\n",
"print(\"m1=\"),round(m1,3)\n",
"print\"final mass of air(m2 in kg)=(P2*V2)/(R*T2)\"\n",
"m2=(P2*V2)/(R*T2)\n",
"print(\"m2=\"),round(m2,3)\n",
"m=m1-m2\n",
"print\"mass of air removed(m)in kg\",round(m,3)\n",
"V=m*R*T1/P1\n",
"print\"volume of this mass of air(V) at initial states in m^3=\",round(V,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.16;page no:27"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.16, Page:27 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16\n",
"here V1=V2\n",
"so P1/T1=P2/T2\n",
"final temperature of hydrogen gas(T2)in k\n",
"=>T2=P2*T1/P1\n",
"now R=(Cp-Cv) in KJ/kg k\n",
"And volume of cylinder(V1)in m^3\n",
"V1=(math.pi*d^2*l)/4\n",
"mass of hydrogen gas(m)in kg\n",
"m= 0.254\n",
"now heat supplied(Q)in KJ\n",
"Q= 193.93\n"
]
}
],
"source": [
"#cal of heat supplied\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"import math\n",
"print\"Example 1.16, Page:27 \\n \\n\"\n",
"print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16\"\n",
"d=1;#diameter of cylinder in m\n",
"l=4;#length of cylinder in m\n",
"P1=100*10**3;#initial pressureof hydrogen gas in pa\n",
"T1=(27+273);#initial temperature of hydrogen gas in k\n",
"P2=125*10**3;#final pressureof hydrogen gas in pa\n",
"Cp=14.307;#specific heat at constant pressure in KJ/kg k\n",
"Cv=10.183;#specific heat at constant volume in KJ/kg k\n",
"print\"here V1=V2\"\n",
"print\"so P1/T1=P2/T2\"\n",
"print\"final temperature of hydrogen gas(T2)in k\"\n",
"print\"=>T2=P2*T1/P1\"\n",
"T2=P2*T1/P1\n",
"print\"now R=(Cp-Cv) in KJ/kg k\"\n",
"R=Cp-Cv\n",
"print\"And volume of cylinder(V1)in m^3\"\n",
"print\"V1=(math.pi*d^2*l)/4\"\n",
"V1=(math.pi*d**2*l)/4\n",
"print\"mass of hydrogen gas(m)in kg\"\n",
"m=(P1*V1)/(1000*R*T1)\n",
"print\"m=\",round(m,3)\n",
"print\"now heat supplied(Q)in KJ\"\n",
"Q=m*Cv*(T2-T1)\n",
"print\"Q=\",round(Q,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.17;page no:28"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.17, Page:28 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17\n",
"final total volume(V)in m^3\n",
"V=V1*V2\n",
"total mass of air(m)in kg\n",
"m=m1+m2\n",
"final pressure of air(P)in kpa\n",
"using perfect gas equation\n",
"P= 516.6\n"
]
}
],
"source": [
"#cal of final pressure\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.17, Page:28 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17\")\n",
"V1=2.;#volume of first cylinder in m^3\n",
"V2=2.;#volume of second cylinder in m^3\n",
"T=(27+273);#temperature of system in k\n",
"m1=20.;#mass of air in first vessel in kg\n",
"m2=4.;#mass of air in second vessel in kg\n",
"R=287.;#gas constant J/kg k\n",
"print(\"final total volume(V)in m^3\")\n",
"print(\"V=V1*V2\")\n",
"V=V1*V2\n",
"print(\"total mass of air(m)in kg\")\n",
"print(\"m=m1+m2\")\n",
"m=m1+m2\n",
"print(\"final pressure of air(P)in kpa\")\n",
"print(\"using perfect gas equation\")\n",
"P=(m*R*T)/(1000*V)\n",
"print\"P=\",round(P,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.18;page no:28"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.18, Page:28 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18\n",
"1.By considering it as a PERFECT GAS\n",
"gas constant for CO2(Rco2)\n",
"Rco2=(J/Kg.k) 188.9\n",
"Also P*V=M*Rco2*T\n",
"pressure of CO2 as perfect gas(P)in N/m^2\n",
"P=(m*Rco2*T)/V 141683.71\n",
"2.By considering as a REAL GAS\n",
"values of vanderwaal constants a,b can be seen from the table which are\n",
"a=(N m^4/(kg mol)^2) 362850.0\n",
"b=(m^3/kg mol) 0.03\n",
"now specific volume(v)in m^3/kg mol\n",
"v= 17.604\n",
"now substituting the value of all variables in vanderwaal equation\n",
"(P+(a/v^2))*(v-b)=R*T\n",
"pressure of CO2 as real gas(P)in N/m^2\n",
"P= 140766.02\n"
]
}
],
"source": [
"#cal of pressure of CO2 as perfect,real gas\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.18, Page:28 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18\")\n",
"m=5;#mass of CO2 in kg\n",
"V=2;#volume of vesssel in m^3\n",
"T=(27+273);#temperature of vessel in k\n",
"R=8.314*10**3;#universal gas constant in J/kg k\n",
"M=44.01;#molecular weight of CO2 \n",
"print(\"1.By considering it as a PERFECT GAS\")\n",
"print(\"gas constant for CO2(Rco2)\")\n",
"Rco2=R/M\n",
"print(\"Rco2=(J/Kg.k)\"),round(Rco2,1)\n",
"print(\"Also P*V=M*Rco2*T\")\n",
"print(\"pressure of CO2 as perfect gas(P)in N/m^2\")\n",
"P=(m*Rco2*T)/V\n",
"print(\"P=(m*Rco2*T)/V \"),round(P,2)\n",
"print(\"2.By considering as a REAL GAS\")\n",
"print(\"values of vanderwaal constants a,b can be seen from the table which are\")\n",
"a=3628.5*10**2#vanderwall constant in N m^4/(kg mol)^2\n",
"b=3.14*10**-2# vanderwall constant in m^3/kg mol\n",
"print(\"a=(N m^4/(kg mol)^2) \"),round(a,2)\n",
"print(\"b=(m^3/kg mol)\"),round(b,2)\n",
"print(\"now specific volume(v)in m^3/kg mol\")\n",
"v=V*M/m\n",
"print(\"v=\"),round(v,3)\n",
"print(\"now substituting the value of all variables in vanderwaal equation\")\n",
"print(\"(P+(a/v^2))*(v-b)=R*T\")\n",
"print(\"pressure of CO2 as real gas(P)in N/m^2\")\n",
"P=((R*T)/(v-b))-(a/v**2)\n",
"print(\"P=\"),round(P,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.19;page no:29"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.19, Page:29 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19\n",
"1.considering as perfect gas\n",
"specific volume(V)in m^3/kg\n",
"V= 0.0186\n",
"2.considering compressibility effects\n",
"reduced pressure(P)in pa\n",
"p= 0.8\n",
"reduced temperature(t)in k\n",
"t= 1.1\n",
"from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1\n",
"we get Z=0.785\n",
"now actual specific volume(v)in m^3/kg\n",
"v= 0.0146\n"
]
}
],
"source": [
"#cal of specific volume of steam\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.19, Page:29 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19\")\n",
"P=17672;#pressure of steam on kpa\n",
"T=712;#temperature of steam in k\n",
"Pc=22.09;#critical pressure of steam in Mpa\n",
"Tc=647.3;#critical temperature of steam in k\n",
"R=0.4615;#gas constant for steam in KJ/kg k\n",
"print(\"1.considering as perfect gas\")\n",
"print(\"specific volume(V)in m^3/kg\")\n",
"V=R*T/P\n",
"print(\"V=\"),round(V,4)\n",
"print(\"2.considering compressibility effects\")\n",
"print(\"reduced pressure(P)in pa\")\n",
"p=P/(Pc*1000)\n",
"print(\"p=\"),round(p,2)\n",
"print(\"reduced temperature(t)in k\")\n",
"t=T/Tc\n",
"print(\"t=\"),round(t,2)\n",
"print(\"from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1\")\n",
"print(\"we get Z=0.785\")\n",
"Z=0.785;#compressibility factor\n",
"print(\"now actual specific volume(v)in m^3/kg\")\n",
"v=Z*V\n",
"print(\"v=\"),round(v,4)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.20;page no:30"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.20, Page:30 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20\n",
"volume of ballon(V1)in m^3\n",
"V1= 65.45\n",
"molecular mass of hydrogen(M)\n",
"M=2\n",
"gas constant for H2(R1)in J/kg k\n",
"R1= 4157.0\n",
"mass of H2 in ballon(m1)in kg\n",
"m1= 5.316\n",
"volume of air printlaced(V2)=volume of ballon(V1)\n",
"mass of air printlaced(m2)in kg\n",
"m2= 79.66\n",
"gas constant for air(R2)=0.287 KJ/kg k\n",
"load lifting capacity due to buoyant force(m)in kg\n",
"m= 74.343\n"
]
}
],
"source": [
"#estimation of maximum load that can be lifted \n",
"#intiation of all variables\n",
"# Chapter 1\n",
"import math\n",
"print\"Example 1.20, Page:30 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20\")\n",
"d=5.;#diameter of ballon in m\n",
"T1=(27.+273.);#temperature of hydrogen in k\n",
"P=1.013*10**5;#atmospheric pressure in pa\n",
"T2=(17.+273.);#temperature of surrounding air in k\n",
"R=8.314*10**3;#gas constant in J/kg k\n",
"print(\"volume of ballon(V1)in m^3\")\n",
"V1=(4./3.)*math.pi*((d/2)**3)\n",
"print(\"V1=\"),round(V1,2)\n",
"print(\"molecular mass of hydrogen(M)\")\n",
"print(\"M=2\")\n",
"M=2;#molecular mass of hydrogen\n",
"print(\"gas constant for H2(R1)in J/kg k\")\n",
"R1=R/M\n",
"print(\"R1=\"),round(R1,2)\n",
"print(\"mass of H2 in ballon(m1)in kg\")\n",
"m1=(P*V1)/(R1*T1)\n",
"print(\"m1=\"),round(m1,3)\n",
"print(\"volume of air printlaced(V2)=volume of ballon(V1)\")\n",
"print(\"mass of air printlaced(m2)in kg\")\n",
"R2=0.287*1000;#gas constant for air in J/kg k\n",
"m2=(P*V1)/(R2*T2)\n",
"print(\"m2=\"),round(m2,2)\n",
"print(\"gas constant for air(R2)=0.287 KJ/kg k\")\n",
"print(\"load lifting capacity due to buoyant force(m)in kg\")\n",
"m=m2-m1\n",
"print(\"m=\"),round(m,3)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.21;page no:31"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.21, Page:31 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21\n",
"let initial receiver pressure(p1)=1 in pa\n",
"so final receiver pressure(p2)=in pa 0.25\n",
"perfect gas equation,p*V*m=m*R*T\n",
"differentiating and then integrating equation w.r.t to time(t) \n",
"we get t=-(V/v)*log(p2/p1)\n",
"so time(t)in min 110.9\n"
]
}
],
"source": [
"#cal of time required\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"import math\n",
"print\"Example 1.21, Page:31 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21\")\n",
"v=0.25;#volume sucking rate of pump in m^3/min\n",
"V=20.;#volume of air vessel in m^3\n",
"p1=1.;#initial receiver pressure in pa\n",
"print(\"let initial receiver pressure(p1)=1 in pa\")\n",
"p2=p1/4.\n",
"print(\"so final receiver pressure(p2)=in pa\"),round(p2,2)\n",
"print(\"perfect gas equation,p*V*m=m*R*T\")\n",
"print(\"differentiating and then integrating equation w.r.t to time(t) \")\n",
"print(\"we get t=-(V/v)*log(p2/p1)\")\n",
"t=-(V/v)*math.log(p2/p1)\n",
"print(\"so time(t)in min\"),round(t,2)\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.22;page no:32"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.22, Page:32 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22\n",
"first calculate gas constants for different gases in j/kg k\n",
"for nitrogen,R1= 296.9\n",
"for oxygen,R2= 259.8\n",
"for carbon dioxide,R3= 188.95\n",
"so the gas constant for mixture(Rm)in j/kg k\n",
"Rm= 288.09\n",
"now the specific heat at constant pressure for constituent gases in KJ/kg k\n",
"for nitrogen,Cp1= 1.039\n",
"for oxygen,Cp2= 0.909\n",
"for carbon dioxide,Cp3= 0.819\n",
"so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k\n",
"Cpm= 1.0115\n",
"now no. of moles of constituents gases\n",
"for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg 0.143\n",
"for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg 0.028\n",
"for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg 0.0023\n",
"total no. of moles in mixture in mol\n",
"n= 0.1733\n",
"now mole fraction of constituent gases\n",
"for nitrogen,x1= 0.825\n",
"for oxygen,x2= 0.162\n",
"for carbon dioxide,x3= 0.0131\n",
"now the molecular weight of mixture(Mm)in kg/kmol\n",
"Mm= 28.86\n"
]
}
],
"source": [
"#cal of specific heat at constant pressure for constituent gases \n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.22, Page:32 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22\")\n",
"m=5;#mass of mixture of gas in kg\n",
"P=1.013*10**5;#pressure of mixture in pa\n",
"T=300;#temperature of mixture in k\n",
"M1=28.;#molecular weight of nitrogen(N2)\n",
"M2=32.;#molecular weight of oxygen(O2)\n",
"M3=44.;#molecular weight of carbon dioxide(CO2)\n",
"f1=0.80;#fraction of N2 in mixture\n",
"f2=0.18;#fraction of O2 in mixture\n",
"f3=0.02;#fraction of CO2 in mixture\n",
"k1=1.4;#ratio of specific heat capacities for N2\n",
"k2=1.4;#ratio of specific heat capacities for O2\n",
"k3=1.3;#ratio of specific heat capacities for CO2\n",
"R=8314;#universal gas constant in J/kg k\n",
"print(\"first calculate gas constants for different gases in j/kg k\")\n",
"R1=R/M1\n",
"print(\"for nitrogen,R1=\"),round(R1,1)\n",
"R2=R/M2\n",
"print(\"for oxygen,R2=\"),round(R2,1)\n",
"R3=R/M3\n",
"print(\"for carbon dioxide,R3=\"),round(R3,2)\n",
"print(\"so the gas constant for mixture(Rm)in j/kg k\")\n",
"Rm=f1*R1+f2*R2+f3*R3\n",
"print(\"Rm=\"),round(Rm,2)\n",
"print(\"now the specific heat at constant pressure for constituent gases in KJ/kg k\")\n",
"Cp1=((k1/(k1-1))*R1)/1000\n",
"print(\"for nitrogen,Cp1=\"),round(Cp1,3)\n",
"Cp2=((k2/(k2-1))*R2)/1000\n",
"print(\"for oxygen,Cp2=\"),round(Cp2,3)\n",
"Cp3=((k3/(k3-1))*R3)/1000\n",
"print(\"for carbon dioxide,Cp3=\"),round(Cp3,3)\n",
"print(\"so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k\")\n",
"Cpm=f1*Cp1+f2*Cp2+f3*Cp3\n",
"print(\"Cpm=\"),round(Cpm,4)\n",
"print(\"now no. of moles of constituents gases\")\n",
"m1=f1*m\n",
"n1=m1/M1\n",
"print(\"for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg\"),round(n1,3)\n",
"m2=f2*m\n",
"n2=m2/M2\n",
"print(\"for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg\"),round(n2,3)\n",
"m3=f3*m\n",
"n3=m3/M3\n",
"print(\"for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg\"),round(n3,4)\n",
"print(\"total no. of moles in mixture in mol\")\n",
"n=n1+n2+n3\n",
"print(\"n=\"),round(n,4)\n",
"print(\"now mole fraction of constituent gases\")\n",
"x1=n1/n\n",
"print(\"for nitrogen,x1=\"),round(x1,3)\n",
"x2=n2/n\n",
"print(\"for oxygen,x2=\"),round(x2,3)\n",
"x3=n3/n\n",
"print(\"for carbon dioxide,x3=\"),round(x3,4)\n",
"print(\"now the molecular weight of mixture(Mm)in kg/kmol\")\n",
"Mm=M1*x1+M2*x2+M3*x3\n",
"print(\"Mm=\"),round(Mm,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.23;page no:33"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.23, Page:33 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23\n",
"mole fraction of constituent gases\n",
"x=(ni/n)=(Vi/V)\n",
"take volume of mixture(V)=1 m^3\n",
"mole fraction of O2(x1)\n",
"x1= 0.18\n",
"mole fraction of N2(x2)\n",
"x2= 0.75\n",
"mole fraction of CO2(x3)\n",
"x3= 0.07\n",
"now molecular weight of mixture = molar mass(m)\n",
"m= 29.84\n",
"now gravimetric analysis refers to the mass fraction analysis\n",
"mass fraction of constituents\n",
"y=xi*Mi/m\n",
"mole fraction of O2\n",
"y1= 0.193\n",
"mole fraction of N2\n",
"y2= 0.704\n",
"mole fraction of CO2\n",
"y3= 0.103\n",
"now partial pressure of constituents = volume fraction * pressure of mixture\n",
"Pi=xi*P\n",
"partial pressure of O2(P1)in Mpa\n",
"P1= 0.09\n",
"partial pressure of N2(P2)in Mpa\n",
"P2= 0.375\n",
"partial pressure of CO2(P3)in Mpa\n",
"P3= 0.04\n",
"NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.\n"
]
}
],
"source": [
"#cal of pressure difference\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.23, Page:33 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23\")\n",
"V1=0.18;#volume fraction of O2 in m^3\n",
"V2=0.75;#volume fraction of N2 in m^3\n",
"V3=0.07;#volume fraction of CO2 in m^3\n",
"P=0.5;#pressure of mixture in Mpa\n",
"T=(107+273);#temperature of mixture in k\n",
"M1=32;#molar mass of O2\n",
"M2=28;#molar mass of N2\n",
"M3=44;#molar mass of CO2\n",
"print(\"mole fraction of constituent gases\")\n",
"print(\"x=(ni/n)=(Vi/V)\")\n",
"V=1;# volume of mixture in m^3\n",
"print(\"take volume of mixture(V)=1 m^3\")\n",
"print(\"mole fraction of O2(x1)\")\n",
"x1=V1/V\n",
"print(\"x1=\"),round(x1,2)\n",
"print(\"mole fraction of N2(x2)\")\n",
"x2=V2/V\n",
"print(\"x2=\"),round(x2,2)\n",
"print(\"mole fraction of CO2(x3)\")\n",
"x3=V3/V\n",
"print(\"x3=\"),round(x3,2)\n",
"print(\"now molecular weight of mixture = molar mass(m)\")\n",
"m=x1*M1+x2*M2+x3*M3\n",
"print(\"m=\"),round(m,2)\n",
"print(\"now gravimetric analysis refers to the mass fraction analysis\")\n",
"print(\"mass fraction of constituents\")\n",
"print(\"y=xi*Mi/m\")\n",
"print(\"mole fraction of O2\")\n",
"y1=x1*M1/m\n",
"print(\"y1=\"),round(y1,3)\n",
"print(\"mole fraction of N2\")\n",
"y2=x2*M2/m\n",
"print(\"y2=\"),round(y2,3)\n",
"print(\"mole fraction of CO2\")\n",
"y3=x3*M3/m\n",
"print(\"y3=\"),round(y3,3)\n",
"print(\"now partial pressure of constituents = volume fraction * pressure of mixture\")\n",
"print(\"Pi=xi*P\")\n",
"print(\"partial pressure of O2(P1)in Mpa\")\n",
"p1=x1*P\n",
"print(\"P1=\"),round(p1,2)\n",
"print(\"partial pressure of N2(P2)in Mpa\")\n",
"P2=x2*P\n",
"print(\"P2=\"),round(P2,3)\n",
"P3=x3*P\n",
"print(\"partial pressure of CO2(P3)in Mpa\")\n",
"print(\"P3=\"),round(P3,2)\n",
"print(\"NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.24;page no:34"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.24, Page:34 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24\n",
"volume of tank of N2(V1) in m^3= 3.0\n",
"volume of tank of CO2(V2) in m^3= 3.0\n",
"taking the adiabatic condition\n",
"no. of moles of N2(n1)\n",
"n1= 0.6\n",
"no. of moles of CO2(n2)\n",
"n2= 0.37\n",
"total no. of moles of mixture(n)in mol\n",
"n= 0.97\n",
"gas constant for N2(R1)in J/kg k\n",
"R1= 296.93\n",
"gas constant for CO2(R2)in J/kg k\n",
"R2=R/M2 188.95\n",
"specific heat of N2 at constant volume (Cv1) in J/kg k\n",
"Cv1= 742.32\n",
"specific heat of CO2 at constant volume (Cv2) in J/kg k\n",
"Cv2= 629.85\n",
"mass of N2(m1)in kg\n",
"m1= 16.84\n",
"mass of CO2(m2)in kg\n",
"m2= 16.28\n",
"let us consider the equilibrium temperature of mixture after adiabatic mixing at T\n",
"applying energy conservation principle\n",
"m1*Cv1*(T-T1) = m2*Cv2*(T-T2)\n",
"equlibrium temperature(T)in k\n",
"=>T= 439.44\n",
"so the equlibrium pressure(P)in kpa\n",
"P= 591.55\n"
]
}
],
"source": [
"#cal of equilibrium temperature,pressure of mixture\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.24, Page:34 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24\")\n",
"V=6;#volume of tank in m^3\n",
"P1=800*10**3;#pressure of N2 gas tank in pa\n",
"T1=480.;#temperature of N2 gas tank in k\n",
"P2=400*10**3;#pressure of CO2 gas tank in pa\n",
"T2=390.;#temperature of CO2 gas tank in k\n",
"k1=1.4;#ratio of specific heat capacity for N2\n",
"k2=1.3;#ratio of specific heat capacity for CO2\n",
"R=8314.;#universal gas constant in J/kg k\n",
"M1=28.;#molecular weight of N2\n",
"M2=44.;#molecular weight of CO2\n",
"V1=V/2\n",
"print(\"volume of tank of N2(V1) in m^3=\"),round(V1,2)\n",
"V2=V/2\n",
"print(\"volume of tank of CO2(V2) in m^3=\"),round(V2,2)\n",
"print(\"taking the adiabatic condition\")\n",
"print(\"no. of moles of N2(n1)\")\n",
"n1=(P1*V1)/(R*T1)\n",
"print(\"n1=\"),round(n1,2)\n",
"print(\"no. of moles of CO2(n2)\")\n",
"n2=(P2*V2)/(R*T2)\n",
"print(\"n2=\"),round(n2,2)\n",
"print(\"total no. of moles of mixture(n)in mol\")\n",
"n=n1+n2\n",
"print(\"n=\"),round(n,2)\n",
"print(\"gas constant for N2(R1)in J/kg k\")\n",
"R1=R/M1\n",
"print(\"R1=\"),round(R1,2)\n",
"print(\"gas constant for CO2(R2)in J/kg k\")\n",
"R2=R/M2\n",
"print(\"R2=R/M2\"),round(R2,2)\n",
"print(\"specific heat of N2 at constant volume (Cv1) in J/kg k\")\n",
"Cv1=R1/(k1-1)\n",
"print(\"Cv1=\"),round(Cv1,2)\n",
"print(\"specific heat of CO2 at constant volume (Cv2) in J/kg k\")\n",
"Cv2=R2/(k2-1)\n",
"print(\"Cv2=\"),round(Cv2,2)\n",
"print(\"mass of N2(m1)in kg\")\n",
"m1=n1*M1\n",
"print(\"m1=\"),round(m1,2)\n",
"print(\"mass of CO2(m2)in kg\")\n",
"m2=n2*M2\n",
"print(\"m2=\"),round(m2,2)\n",
"print(\"let us consider the equilibrium temperature of mixture after adiabatic mixing at T\")\n",
"print(\"applying energy conservation principle\")\n",
"print(\"m1*Cv1*(T-T1) = m2*Cv2*(T-T2)\")\n",
"print(\"equlibrium temperature(T)in k\")\n",
"T=((m1*Cv1*T1)+(m2*Cv2*T2))/((m1*Cv1)+(m2*Cv2))\n",
"print(\"=>T=\"),round(T,2)\n",
"print(\"so the equlibrium pressure(P)in kpa\")\n",
"P=(n*R*T)/(1000*V)\n",
"print(\"P=\"),round(P,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.25;page no:35"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.25, Page:35 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25\n",
"since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing\n",
"so the specific heat at constant pressure(Cp)in KJ/kg k\n",
"Cp= 7.608\n"
]
}
],
"source": [
"#cal of specific heat of final mixture\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.25, Page:35 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25\")\n",
"m1=2;#mass of H2 in kg\n",
"m2=3;#mass of He in kg\n",
"T=100;#temperature of container in k\n",
"Cp1=11.23;#specific heat at constant pressure for H2 in KJ/kg k\n",
"Cp2=5.193;#specific heat at constant pressure for He in KJ/kg k\n",
"print(\"since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing\")\n",
"print(\"so the specific heat at constant pressure(Cp)in KJ/kg k\")\n",
"Cp=((Cp1*m1)+Cp2*m2)/(m1+m2)\n",
"print(\"Cp=\"),round(Cp,3)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.26;page no:35"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.26, Page:35 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26\n",
"gas constant for H2(R1)in KJ/kg k\n",
"R1= 4.157\n",
"gas constant for N2(R2)in KJ/kg k\n",
"R2= 0.297\n",
"gas constant for CO2(R3)in KJ/kg k\n",
"R3= 0.189\n",
"so now gas constant for mixture(Rm)in KJ/kg k\n",
"Rm= 2.606\n",
"considering gas to be perfect gas\n",
"total mass of mixture(m)in kg\n",
"m= 30.0\n",
"capacity of vessel(V)in m^3\n",
"V= 231.57\n",
"now final temperature(Tf) is twice of initial temperature(Ti)\n",
"so take k=Tf/Ti=2\n",
"for constant volume heating,final pressure(Pf)in kpa shall be\n",
"Pf= 202.65\n"
]
}
],
"source": [
"#cal of capacity and pressure in the vessel\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.26, Page:35 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26\")\n",
"m1=18.;#mass of hydrogen(H2) in kg\n",
"m2=10.;#mass of nitrogen(N2) in kg\n",
"m3=2.;#mass of carbon dioxide(CO2) in kg\n",
"R=8.314;#universal gas constant in KJ/kg k\n",
"Pi=101.325;#atmospheric pressure in kpa\n",
"T=(27+273.15);#ambient temperature in k\n",
"M1=2;#molar mass of H2\n",
"M2=28;#molar mass of N2\n",
"M3=44;#molar mass of CO2\n",
"print(\"gas constant for H2(R1)in KJ/kg k\")\n",
"R1=R/M1\n",
"print(\"R1=\"),round(R1,3)\n",
"print(\"gas constant for N2(R2)in KJ/kg k\")\n",
"R2=R/M2\n",
"print(\"R2=\"),round(R2,3)\n",
"print(\"gas constant for CO2(R3)in KJ/kg k\")\n",
"R3=R/M3\n",
"print(\"R3=\"),round(R3,3)\n",
"print(\"so now gas constant for mixture(Rm)in KJ/kg k\")\n",
"Rm=(m1*R1+m2*R2+m3*R3)/(m1+m2+m3)\n",
"print(\"Rm=\"),round(Rm,3)\n",
"print(\"considering gas to be perfect gas\")\n",
"print(\"total mass of mixture(m)in kg\")\n",
"m=m1+m2+m3\n",
"print(\"m=\"),round(m,2)\n",
"print(\"capacity of vessel(V)in m^3\")\n",
"V=(m*Rm*T)/Pi\n",
"print(\"V=\"),round(V,2)\n",
"print(\"now final temperature(Tf) is twice of initial temperature(Ti)\")\n",
"k=2;#ratio of initial to final temperature\n",
"print(\"so take k=Tf/Ti=2\") \n",
"print(\"for constant volume heating,final pressure(Pf)in kpa shall be\")\n",
"Pf=Pi*k\n",
"print(\"Pf=\"),round(Pf,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.27;page no:36"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.27, Page:36 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27\n",
"let inlet state be 1 and exit state be 2\n",
"by charles law volume and temperature can be related as\n",
"(V1/T1)=(V2/T2)\n",
"(V2/V1)=(T2/T1)\n",
"or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1\n",
"since change in K.E=0\n",
"so (D2^2/D1^2)=T2/T1\n",
"D2/D1=sqrt(T2/T1)\n",
"say(D2/D1)=k\n",
"so exit to inlet diameter ratio(k) 1.29\n"
]
}
],
"source": [
"#cal of exit to inlet diameter ratio\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"import math\n",
"print\"Example 1.27, Page:36 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27\")\n",
"T1=(27.+273.);#initial temperature of air in k\n",
"T2=500.;#final temperature of air in k\n",
"print(\"let inlet state be 1 and exit state be 2\")\n",
"print(\"by charles law volume and temperature can be related as\")\n",
"print(\"(V1/T1)=(V2/T2)\")\n",
"print(\"(V2/V1)=(T2/T1)\")\n",
"print(\"or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1\")\n",
"print(\"since change in K.E=0\")\n",
"print(\"so (D2^2/D1^2)=T2/T1\")\n",
"print(\"D2/D1=sqrt(T2/T1)\")\n",
"print(\"say(D2/D1)=k\")\n",
"k=math.sqrt(T2/T1)\n",
"print(\"so exit to inlet diameter ratio(k)\"),round(k,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 1.28;page no:37"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 1.28, Page:37 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28\n",
"gas constant for H2(R1)in KJ/kg k\n",
"R1= 4.157\n",
"say initial and final ststes are given by 1 and 2\n",
"mass of hydrogen pumped out shall be difference of initial and final mass inside vessel\n",
"final pressure of hydrogen(P2)in cm of Hg\n",
"P2= 6.0\n",
"therefore pressure difference(P)in kpa\n",
"P= 93.33\n",
"mass pumped out(m)in kg\n",
"m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))\n",
"here V1=V2=V and T1=T2=T\n",
"so m= 0.15\n",
"now during cooling upto 10 degree celcius,the process may be consider as constant volume process\n",
"say state before and after cooling are denoted by suffix 2 and 3\n",
"final pressure after cooling(P3)in kpa\n",
"P3= 7.546\n"
]
}
],
"source": [
"#cal of final pressure\n",
"#intiation of all variables\n",
"# Chapter 1\n",
"print\"Example 1.28, Page:37 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28\")\n",
"V=2;#volume of vessel in m^3\n",
"P1=76;#initial pressure or atmospheric pressure in cm of Hg\n",
"T=(27+273.15);#temperature of vessel in k\n",
"p=70;#final pressure in cm of Hg vaccum\n",
"R=8.314;#universal gas constant in KJ/kg k\n",
"M=2;#molecular weight of H2\n",
"print(\"gas constant for H2(R1)in KJ/kg k\")\n",
"R1=R/M\n",
"print(\"R1=\"),round(R1,3)\n",
"print(\"say initial and final ststes are given by 1 and 2\")\n",
"print(\"mass of hydrogen pumped out shall be difference of initial and final mass inside vessel\")\n",
"print(\"final pressure of hydrogen(P2)in cm of Hg\")\n",
"P2=P1-p\n",
"print(\"P2=\"),round(P2,2)\n",
"print(\"therefore pressure difference(P)in kpa\")\n",
"P=((P1-P2)*101.325)/76\n",
"print(\"P=\"),round(P,2)\n",
"print(\"mass pumped out(m)in kg\")\n",
"print(\"m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))\")\n",
"print(\"here V1=V2=V and T1=T2=T\")\n",
"m=(V*P)/(R1*T)\n",
"print(\"so m=\"),round(m,2)\n",
"print(\"now during cooling upto 10 degree celcius,the process may be consider as constant volume process\")\n",
"print(\"say state before and after cooling are denoted by suffix 2 and 3\")\n",
"T3=(10+273.15);#final temperature after cooling in k\n",
"print(\"final pressure after cooling(P3)in kpa\")\n",
"P3=(T3/T)*P2*(101.325/76)\n",
"print(\"P3=\"),round(P3,3)\n",
"\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
IE)E)+Engineering Thermodynamics/chapter2_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# chapter 2:Zeroth Law of Thermodynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 2.1;pg no:46"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 2.1, Page:46 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 1\n",
"degree celcius and farenheit are related as follows\n",
"Tc=(Tf-32)/1.8\n",
"so temperature of body in degree celcius 37.0\n"
]
}
],
"source": [
"#cal of temperature of body of human\n",
"#intiation of all variables\n",
"# Chapter 2\n",
"print\"Example 2.1, Page:46 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 1\")\n",
"Tf=98.6;#temperature of body in farenheit\n",
"Tc=(Tf-32)/1.8\n",
"print(\"degree celcius and farenheit are related as follows\")\n",
"print(\"Tc=(Tf-32)/1.8\")\n",
"print(\"so temperature of body in degree celcius\"),round(Tc,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 2.2;pg no:47"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 2.2, Page:47 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 2\n",
"using thermometric relation\n",
"t=a*log(p)+(b/2)\n",
"for ice point,b/a=\n",
"so b=2.1972*a\n",
"for steam point\n",
"a= 101.95\n",
"and b= 224.01\n",
"thus, t=in degree celcius\n",
"so for thermodynamic property of 6.5,t=302.83 degree celcius= 302.84\n"
]
}
],
"source": [
"#cal of celcius temperature\n",
"#intiation of all variables\n",
"# Chapter 2\n",
"import math\n",
"print\"Example 2.2, Page:47 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 2\")\n",
"t1=0;#ice point temperature in degree celcius\n",
"p1=3;#thermometric property for ice point\n",
"t2=100;#steam point temperature in degree celcius\n",
"p2=8;#thermometric property for steam point\n",
"p3=6.5;#thermometric property for any temperature\n",
"print(\"using thermometric relation\")\n",
"print(\"t=a*log(p)+(b/2)\")\n",
"print(\"for ice point,b/a=\")\n",
"b=2*math.log(p1)\n",
"print(\"so b=2.1972*a\")\n",
"print(\"for steam point\")\n",
"a=t2/(math.log(p2)-(2.1972/2))\n",
"print(\"a=\"),round(a,2)\n",
"b=2.1972*a\n",
"print(\"and b=\"),round(b,2)\n",
"t=a*math.log(p3)+(b/2)\n",
"print(\"thus, t=in degree celcius\")\n",
"print(\"so for thermodynamic property of 6.5,t=302.83 degree celcius=\"),round(t,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 2.3;page no:47"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 2.3, Page:47 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 3\n",
"emf equation\n",
"E=(0.003*t)-((5*10^-7)*t^2))+(0.5*10^-3)\n",
"using emf equation at ice point,E_0 in volts\n",
"E_0= 0.0\n",
"using emf equation at steam point,E_100 in volts\n",
"E_100= 0.3\n",
"now emf at 30 degree celcius using emf equation(E_30)in volts\n",
"now the temperature(T) shown by this thermometer\n",
"T=in degree celcius 30.36\n",
"NOTE=>In this question,values of emf at 100 and 30 degree celcius is calculated wrong in book so it is corrected above so the answers may vary.\n"
]
}
],
"source": [
"#cal of temperature shown by this thermometer\n",
"#intiation of all variables\n",
"# Chapter 2\n",
"print\"Example 2.3, Page:47 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 3\")\n",
"print(\"emf equation\")\n",
"print(\"E=(0.003*t)-((5*10^-7)*t^2))+(0.5*10^-3)\")\n",
"print(\"using emf equation at ice point,E_0 in volts\")\n",
"t=0.;#ice point temperature in degree celcius\n",
"E_0=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
"print(\"E_0=\"),round(E_0,2)\n",
"print(\"using emf equation at steam point,E_100 in volts\")\n",
"t=100.;#steam point temperature in degree celcius\n",
"E_100=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
"print(\"E_100=\"),round(E_100,2)\n",
"print(\"now emf at 30 degree celcius using emf equation(E_30)in volts\")\n",
"t=30.;#temperature of substance in degree celcius\n",
"E_30=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
"T_100=100.;#steam point temperature in degree celcius\n",
"T_0=0.;#ice point temperature in degree celcius\n",
"T=((E_30-E_0)/(E_100-E_0))*(T_100-T_0)\n",
"print(\"now the temperature(T) shown by this thermometer\")\n",
"print(\"T=in degree celcius\"),round(T,2)\n",
"print(\"NOTE=>In this question,values of emf at 100 and 30 degree celcius is calculated wrong in book so it is corrected above so the answers may vary.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 2.4;pg no:48"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 2.4, Page:48 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 4\n",
"emf equation,e=0.18*t-5.2*10^-4*t^2 in millivolts\n",
"as ice point and steam points are two reference points,so\n",
"at ice point,emf(e1)in mV\n",
"at steam point,emf(e2)in mV\n",
"at gas temperature,emf(e3)in mV\n",
"since emf variation is linear so,temperature(t)in degree celcius at emf of 7.7 mV 60.16\n",
"temperature of gas using thermocouple=60.16 degree celcius\n",
"percentage variation=((t-t3)/t3)*100variation in temperature reading with respect to gas thermometer reading of 50 degree celcius 20.31\n"
]
}
],
"source": [
"#cal of percentage variation in temperature\n",
"#intiation of all variables\n",
"# Chapter 2\n",
"import math\n",
"print\"Example 2.4, Page:48 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 4\")\n",
"t1=0;#temperature at ice point\n",
"t2=100;#temperature at steam point\n",
"t3=50;#temperature of gas\n",
"print(\"emf equation,e=0.18*t-5.2*10^-4*t^2 in millivolts\")\n",
"print(\"as ice point and steam points are two reference points,so\")\n",
"print(\"at ice point,emf(e1)in mV\")\n",
"e1=0.18*t1-5.2*10**-4*t1**2\n",
"print(\"at steam point,emf(e2)in mV\")\n",
"e2=0.18*t2-5.2*10**-4*t2**2\n",
"print(\"at gas temperature,emf(e3)in mV\")\n",
"e3=0.18*t3-5.2*10**-4*t3**2\n",
"t=((t2-t1)/(e2-e1))*e3\n",
"variation=((t-t3)/t3)*100\n",
"print(\"since emf variation is linear so,temperature(t)in degree celcius at emf of 7.7 mV\"),round(t,2)\n",
"print(\"temperature of gas using thermocouple=60.16 degree celcius\")\n",
"print(\"percentage variation=((t-t3)/t3)*100variation in temperature reading with respect to gas thermometer reading of 50 degree celcius\"),round(variation,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 2.5;pg no:48"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 2.5, Page:48 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 5\n",
"let the conversion relation be X=aC+b\n",
"where C is temperature in degree celcius,a&b are constants and X is temperature in X degree \n",
"at freezing point,temperature=0 degree celcius,0 degree X\n",
"so by equation X=aC+b\n",
"we get b=0\n",
"at boiling point,temperature=100 degree celcius,1000 degree X\n",
"conversion relation\n",
"X=10*C\n",
"absolute zero temperature in degree celcius=-273.15\n",
"absolute zero temperature in degree X= -2731.5\n"
]
}
],
"source": [
"#cal of absolute zero temperature\n",
"#intiation of all variables\n",
"# Chapter 2\n",
"print\"Example 2.5, Page:48 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 5\")\n",
"print(\"let the conversion relation be X=aC+b\")\n",
"print(\"where C is temperature in degree celcius,a&b are constants and X is temperature in X degree \")\n",
"print(\"at freezing point,temperature=0 degree celcius,0 degree X\")\n",
"print(\"so by equation X=aC+b\")\n",
"X=0;#temperature in degree X\n",
"C=0;#temperature in degree celcius\n",
"print(\"we get b=0\")\n",
"b=0;\n",
"print(\"at boiling point,temperature=100 degree celcius,1000 degree X\")\n",
"X=1000;#temperature in degree X\n",
"C=100;#temperature in degree celcius\n",
"a=(X-b)/C\n",
"print(\"conversion relation\")\n",
"print(\"X=10*C\")\n",
"print(\"absolute zero temperature in degree celcius=-273.15\")\n",
"X=10*-273.15\n",
"print(\"absolute zero temperature in degree X=\"),round(X,2)\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I(OO+Engineering Thermodynamics/chapter3_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 3:First Law of Thermo Dynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.1;pg no:76"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.1, Page:46 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 1\n",
"a> work done on piston(W_piston)in KJ can be obtained as\n",
"W_piston=pdv\n",
"b> paddle work done on the system(W_paddle)=-4.88 KJ\n",
"net work done of system(W_net)in KJ\n",
"W_net=W_piston+W_paddle\n",
"so work done on system(W_net)=1.435 KJ\n"
]
}
],
"source": [
"#cal of work done on system\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.1, Page:46 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 1\")\n",
"import scipy\n",
"from scipy import integrate\n",
"\n",
"def fun1(x):\n",
"\ty=x*x\n",
"\treturn y\n",
"\n",
"p=689.;#pressure of gas in cylinder in kpa\n",
"v1=0.04;#initial volume of fluid in m^3\n",
"v2=0.045;#final volume of fluid in m^3\n",
"W_paddle=-4.88;#paddle work done on the system in KJ\n",
"print(\"a> work done on piston(W_piston)in KJ can be obtained as\")\n",
"print(\"W_piston=pdv\")\n",
"#function y = f(v), y=p, endfunction\n",
"def fun1(x):\n",
"\ty=p\n",
"\treturn y\n",
"\n",
"W_piston=scipy.integrate.quad(fun1,v1,v2) \n",
"print(\"b> paddle work done on the system(W_paddle)=-4.88 KJ\")\n",
"print(\"net work done of system(W_net)in KJ\")\n",
"print(\"W_net=W_piston+W_paddle\")\n",
"print(\"so work done on system(W_net)=1.435 KJ\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.2;pg no:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.2, Page:76 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 2\n",
"as the vessel is rigid therefore work done shall be zero\n",
"W=0\n",
"from first law of thermodynamics,heat required(Q)in KJ\n",
"Q=U2-U1+W=Q=m(u2-u1)+W\n",
"so heat required = 5.6\n"
]
}
],
"source": [
"#cal of heat required\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.2, Page:76 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 2\")\n",
"m=0.5;#mass of gas in kg\n",
"u1=26.6;#internal energy of gas at 200 degree celcius\n",
"u2=37.8;#internal energy of gas at 400 degree celcius\n",
"W=0;#work done by vessel in KJ\n",
"print(\"as the vessel is rigid therefore work done shall be zero\")\n",
"print(\"W=0\")\n",
"print(\"from first law of thermodynamics,heat required(Q)in KJ\")\n",
"print(\"Q=U2-U1+W=Q=m(u2-u1)+W\")\n",
"Q=m*(u2-u1)+W\n",
"print(\"so heat required =\"),round(Q,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.3;pg no:77"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.3, Page:77 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 3\n",
"by steady flow energy equation\n",
"q+h1+C1^2/2+g*z1=h2+C2^2/2+g*z2+w\n",
"let us assume changes in kinetic and potential energy is negligible,during flow the work interaction shall be zero\n",
"q=h2-h1\n",
"rate of heat removal(Q)in KJ/hr\n",
"Q=m(h2-h1)=m*Cp*(T2-T1)\n",
"heat should be removed at the rate=KJ/hr 40500.0\n"
]
}
],
"source": [
"#cal of \"heat should be removed\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.3, Page:77 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 3\")\n",
"m=50;#rate at which carbon dioxide passing through heat exchanger in kg/hr\n",
"T2=800;#initial temperature of carbon dioxide in degree celcius\n",
"T1=50;#final temperature of carbon dioxide in degree celcius\n",
"Cp=1.08;#specific heat at constant pressure in KJ/kg K\n",
"print(\"by steady flow energy equation\")\n",
"print(\"q+h1+C1^2/2+g*z1=h2+C2^2/2+g*z2+w\")\n",
"print(\"let us assume changes in kinetic and potential energy is negligible,during flow the work interaction shall be zero\")\n",
"print(\"q=h2-h1\")\n",
"print(\"rate of heat removal(Q)in KJ/hr\")\n",
"print(\"Q=m(h2-h1)=m*Cp*(T2-T1)\")\n",
"Q=m*Cp*(T2-T1)\n",
"print(\"heat should be removed at the rate=KJ/hr\"),round(Q)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.4;pg no:77"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"#cal of work done by surrounding on system\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.4, Page:77 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 4\")\n",
"v=0.78;#volume of cylinder in m^3\n",
"p=101.325;#atmospheric pressure in kPa\n",
"print(\"total work done by the air at atmospheric pressure of 101.325 kPa\")\n",
"print(\"W=(pdv)cylinder+(pdv)air\")\n",
"print(\"0+p*(delta v)\")\n",
"print(\"work done by air(W)=-p*v in KJ\")\n",
"W=-p*v\n",
"print(\"so work done by surrounding on system=KJ\"),round(-W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.5:pg no:77"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.5, Page:77 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 5\n",
"given p*v^1.3=constant\n",
"assuming expansion to be quasi-static,the work may be given as\n",
"W=m(p*dv)=(p2*V2-p1*V1)/(1-n)\n",
"from internal energy relation,change in specific internal energy\n",
"deltau=u2-u1=1.8*(p2*v2-p1*v1)in KJ/kg\n",
"total change,deltaU=1.8*m*(p2*v2-p1*v1)=1.8*(p2*V2-p1*V1)in KJ\n",
"using p1*V1^1.3=p2*V2^1.3\n",
"V2=in m^3 0.85\n",
"take V2=.852 m^3\n",
"so deltaU in KJ\n",
"and W in KJ 246.67\n",
"from first law\n",
"deltaQ=KJ 113.47\n",
"heat interaction=113.5 KJ\n",
"work interaction=246.7 KJ\n",
"change in internal energy=-113.2 KJ\n"
]
}
],
"source": [
"#cal of heat,work interaction and change in internal energy\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.5, Page:77 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 5\")\n",
"m=5;#mass of gas in kg\n",
"p1=1*10**3;#initial pressure of gas in KPa\n",
"V1=0.5;#initial volume of gas in m^3\n",
"p2=0.5*10**3;#final pressure of gas in KPa\n",
"n=1.3;#expansion constant\n",
"print(\"given p*v^1.3=constant\")\n",
"print(\"assuming expansion to be quasi-static,the work may be given as\")\n",
"print(\"W=m(p*dv)=(p2*V2-p1*V1)/(1-n)\")\n",
"print(\"from internal energy relation,change in specific internal energy\")\n",
"print(\"deltau=u2-u1=1.8*(p2*v2-p1*v1)in KJ/kg\")\n",
"print(\"total change,deltaU=1.8*m*(p2*v2-p1*v1)=1.8*(p2*V2-p1*V1)in KJ\")\n",
"print(\"using p1*V1^1.3=p2*V2^1.3\")\n",
"V2=V1*(p1/p2)**(1/1.3)\n",
"print(\"V2=in m^3\"),round(V2,2)\n",
"print(\"take V2=.852 m^3\")\n",
"V2=0.852;#final volume of gas in m^3\n",
"print(\"so deltaU in KJ\")\n",
"deltaU=1.8*(p2*V2-p1*V1)\n",
"W=(p2*V2-p1*V1)/(1-n)\n",
"print(\"and W in KJ\"),round(W,2)\n",
"print(\"from first law\")\n",
"deltaQ=deltaU+W\n",
"print(\"deltaQ=KJ\"),round(deltaQ,2)\n",
"print(\"heat interaction=113.5 KJ\")\n",
"print(\"work interaction=246.7 KJ\")\n",
"print(\"change in internal energy=-113.2 KJ\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.6;pg no:78"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.6, Page:78 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 6\n",
"final state volume(v2)in m^3\n",
"v2= 0.0\n",
"take v2=0.03 m^3\n",
"now internal energy of gas is given by U=7.5*p*v-425\n",
"change in internal energy(deltaU)in KJ\n",
"deltaU=U2-U1=7.5*p2*v2-7.5*p1*v1\n",
"deltaU=7.5*10^3*(p2*v2-p1*v1) 75.0\n",
"for quasi-static process\n",
"work(W) in KJ,W=p*dv\n",
"W=(p2*v2-p1*v1)/(1-n)\n",
"from first law of thermodynamics,\n",
"heat interaction(deltaQ)=deltaU+W\n",
"heat=50 KJ\n",
"work=25 KJ(-ve)\n",
"internal energy change=75 KJ\n",
"if 180 KJ heat transfer takes place,then from 1st law,\n",
"deltaQ= 50.0\n",
"since end states remain same,therefore deltaU i.e change in internal energy remains unaltered.\n",
"W=KJ 105.0\n"
]
}
],
"source": [
"#cal of heat,workinternal energy change\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.6, Page:78 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 6\")\n",
"p1=1;#initial pressure of gas in MPa\n",
"v1=0.05;#initial volume of gas in m^3\n",
"p2=2;#final pressure of gas in MPa\n",
"n=1.4;#expansion constant\n",
"print(\"final state volume(v2)in m^3\")\n",
"v2=((p1/p2)**(1/1.4))*v1\n",
"print(\"v2=\"),round(v2,2)\n",
"print(\"take v2=0.03 m^3\")\n",
"v2=0.03;#final volume of gas in m^3\n",
"print(\"now internal energy of gas is given by U=7.5*p*v-425\")\n",
"print(\"change in internal energy(deltaU)in KJ\")\n",
"print(\"deltaU=U2-U1=7.5*p2*v2-7.5*p1*v1\")\n",
"deltaU=7.5*10**3*(p2*v2-p1*v1)\n",
"print(\"deltaU=7.5*10^3*(p2*v2-p1*v1)\"),round(deltaU,2)\n",
"print(\"for quasi-static process\")\n",
"print(\"work(W) in KJ,W=p*dv\")\n",
"W=((p2*v2-p1*v1)/(1-n))*10**3\n",
"print(\"W=(p2*v2-p1*v1)/(1-n)\")\n",
"print(\"from first law of thermodynamics,\")\n",
"print(\"heat interaction(deltaQ)=deltaU+W\")\n",
"deltaQ=deltaU+W\n",
"print(\"heat=50 KJ\")\n",
"print(\"work=25 KJ(-ve)\")\n",
"print(\"internal energy change=75 KJ\")\n",
"print(\"if 180 KJ heat transfer takes place,then from 1st law,\")\n",
"print(\"deltaQ=\"),round(deltaQ,2)\n",
"print(\"since end states remain same,therefore deltaU i.e change in internal energy remains unaltered.\")\n",
"W=180-75\n",
"print(\"W=KJ\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.7;pg no:79"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.7, Page:79 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 7\n",
"characteristics gas constant(R)in J/kg K\n",
"R= 519.64\n",
"take R=0.520,KJ/kg K\n",
"Cv=inKJ/kg K 1.18\n",
"y= 1.44\n",
"for polytropic process,v2=((p1/p2)^(1/n))*v1 in m^3\n",
"now,T2=in K\n",
"work(W)in KJ/kg\n",
"W= -257.78\n",
"for polytropic process,heat(Q)in KJ/K\n",
"Q= 82.02\n"
]
}
],
"source": [
"#cal of work and heat\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.7, Page:79 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 7\")\n",
"M=16;#molecular weight of gas\n",
"p1=101.3;#initial pressure of gas in KPa\n",
"p2=600;#final pressure of gas in KPa\n",
"T1=(273+20);#initial temperature of gas in K\n",
"R1=8.3143*10**3;#universal gas constant in J/kg K\n",
"Cp=1.7;#specific heat at constant pressure in KJ/kg K\n",
"n=1.3;#expansion constant\n",
"T2=((p2/p1)**(n-1/n))\n",
"print(\"characteristics gas constant(R)in J/kg K\")\n",
"R=R1/M\n",
"print(\"R=\"),round(R,2)\n",
"print(\"take R=0.520,KJ/kg K\")\n",
"R=0.520;#characteristics gas constant in KJ/kg K\n",
"Cv=Cp-R\n",
"print(\"Cv=inKJ/kg K\"),round(Cv,2)\n",
"y=Cp/Cv\n",
"print(\"y=\"),round(y,2)\n",
"y=1.44;#ratio of specific heat at constant pressure to constant volume\n",
"print(\"for polytropic process,v2=((p1/p2)^(1/n))*v1 in m^3\")\n",
"T2=T1*((p2/p1)**((n-1)/n))\n",
"print(\"now,T2=in K\")\n",
"print(\"work(W)in KJ/kg\")\n",
"W=R*((T1-T2)/(n-1))\n",
"print(\"W=\"),round(W,2)\n",
"W=257.78034;#work done in KJ/kg\n",
"print(\"for polytropic process,heat(Q)in KJ/K\")\n",
"Q=((y-n)/(y-1))*W\n",
"print(\"Q=\"),round(Q,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.8;pg no:80"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.8, Page:80 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 8\n",
"applying steady flow energy equation with inlet and exit states as 1,2 with no heat and work interaction and no change in potential energy\n",
"h1+C1^2/2=h2+C2^2/2\n",
"given that C1=0,negligible inlet velocity\n",
"so C2=sqrt(2(h1-h2))=sqrt(2*Cp*(T1-T2))\n",
"exit velocity(C2)in m/s 1098.2\n"
]
}
],
"source": [
"#cal of exit velocity\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"import math\n",
"print\"Example 3.8, Page:80 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 8\")\n",
"T1=(627+273);#initial temperature of air in nozzle in K\n",
"T2=(27+273);#temperature at which air leaves nozzle in K\n",
"Cp=1.005*10**3;#specific heat at constant pressure in J/kg K\n",
"C2=math.sqrt(2*Cp*(T1-T2))\n",
"print(\"applying steady flow energy equation with inlet and exit states as 1,2 with no heat and work interaction and no change in potential energy\")\n",
"print(\"h1+C1^2/2=h2+C2^2/2\")\n",
"print(\"given that C1=0,negligible inlet velocity\")\n",
"print(\"so C2=sqrt(2(h1-h2))=sqrt(2*Cp*(T1-T2))\")\n",
"print(\"exit velocity(C2)in m/s\"),round(C2,1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.9;pg no:80"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.9, Page:80 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 9\n",
"work interaction,W=-200 KJ/kg of air\n",
"increase in enthalpy of air=100 KJ/kg of air\n",
"total heat interaction,Q=heat transferred to water + heat transferred to atmosphere\n",
"writing steady flow energy equation on compressor,for unit mass of air entering at 1 and leaving at 2\n",
"h1+C1^2/2+g*z1+Q=h2+C2^2/2+g*z2+W\n",
"assuming no change in potential energy and kinetic energy\n",
"deltaK.E=deltaP.=0\n",
"total heat interaction(Q)in KJ/kg of air\n",
"Q= -100.0\n",
"Q=heat transferred to water + heat transferred to atmosphere=Q1+Q2\n",
"so heat transferred to atmosphere(Q2)in KJ/kg of air -10.0\n"
]
}
],
"source": [
"#cal of heat transferred to atmosphere\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.9, Page:80 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 9\")\n",
"W=-200;#shaft work in KJ/kg of air\n",
"deltah=100;#increase in enthalpy in KJ/kg of air\n",
"Q1=-90;#heat transferred to water in KJ/kg of air\n",
"print(\"work interaction,W=-200 KJ/kg of air\")\n",
"print(\"increase in enthalpy of air=100 KJ/kg of air\")\n",
"print(\"total heat interaction,Q=heat transferred to water + heat transferred to atmosphere\")\n",
"print(\"writing steady flow energy equation on compressor,for unit mass of air entering at 1 and leaving at 2\")\n",
"print(\"h1+C1^2/2+g*z1+Q=h2+C2^2/2+g*z2+W\")\n",
"print(\"assuming no change in potential energy and kinetic energy\")\n",
"print(\"deltaK.E=deltaP.=0\")\n",
"print(\"total heat interaction(Q)in KJ/kg of air\")\n",
"Q=deltah+W\n",
"print(\"Q=\"),round(Q,2)\n",
"Q2=Q-Q1\n",
"print(\"Q=heat transferred to water + heat transferred to atmosphere=Q1+Q2\")\n",
"print(\"so heat transferred to atmosphere(Q2)in KJ/kg of air\"),round(Q2,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.10;pg no:81"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.10, Page:81 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 10\n",
"above problem can be solved using steady flow energy equations upon hot water flow\n",
"Q+m1*(h1+C1^2/2+g*z1)=W+m2*(h2+C2^2/2+g*z2)\n",
"here total heat to be supplied(Q)in kcal/hr\n",
"so heat lost by water(-ve),Q=-25000 kcal/hr\n",
"there shall be no work interaction and change in kinetic energy,so,steady flow energy equation shall be,\n",
"Q+m*(h1+g*z1)=m*(h2+g*z2)\n",
"so water circulation rate(m)in kg/hr\n",
"so m=Q*10^3*4.18/(g*deltaz-(h1-h2)*10^3*4.18\n",
"water circulation rate=(m)in kg/min 11.91\n"
]
}
],
"source": [
"#cal of water circulation rate\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.10, Page:81 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 10\")\n",
"n=500;#total number of persons\n",
"q=50;#heat requirement per person in kcal/hr\n",
"h1=80;#enthalpy of hot water enter in pipe in kcal/kg\n",
"h2=45;#enthalpy of hot water leaves the pipe in kcal/kg\n",
"g=9.81;#acceleartion due to gravity in m/s^2\n",
"deltaz=10;#difference in elevation of inlet and exit pipe in m\n",
"print(\"above problem can be solved using steady flow energy equations upon hot water flow\")\n",
"print(\"Q+m1*(h1+C1^2/2+g*z1)=W+m2*(h2+C2^2/2+g*z2)\")\n",
"print(\"here total heat to be supplied(Q)in kcal/hr\")\n",
"Q=n*q\n",
"print(\"so heat lost by water(-ve),Q=-25000 kcal/hr\")\n",
"Q=-25000#heat loss by water in kcal/hr\n",
"print(\"there shall be no work interaction and change in kinetic energy,so,steady flow energy equation shall be,\")\n",
"print(\"Q+m*(h1+g*z1)=m*(h2+g*z2)\")\n",
"print(\"so water circulation rate(m)in kg/hr\")\n",
"print(\"so m=Q*10^3*4.18/(g*deltaz-(h1-h2)*10^3*4.18\")\n",
"m=Q*10**3*4.18/(g*deltaz-(h1-h2)*10**3*4.18)\n",
"m=m/60\n",
"print(\"water circulation rate=(m)in kg/min\"),round(m,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.11;pg no:81"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.11, Page:81 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 11\n",
"let mass of steam to be supplied per kg of water lifted be(m) kg.applying law of energy conservation upon steam injector,for unit mass of water lifted\n",
"energy with steam entering + energy with water entering = energy with mixture leaving + heat loss to surrounding\n",
"m*(v1^2/2+h1*10^3*4.18)+h2*10^3*4.18+g*deltaz=(1+m)*(h3*10^3*4.18+v2^2/2)+m*q*10^3*4.18\n",
"so steam suppling rate(m)in kg/s per kg of water\n",
"m= 0.124\n",
"NOTE=>here enthalpy of steam entering injector(h1)should be taken 720 kcal/kg instead of 72 kcal/kg otherwise the steam supplying rate comes wrong.\n"
]
}
],
"source": [
"#cal of steam suppling rate\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.11, Page:81 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 11\")\n",
"v1=50;#velocity of steam entering injector in m/s\n",
"v2=25;#velocity of mixture leave injector in m/s\n",
"h1=720;#enthalpy of steam entering injector in kcal/kg\n",
"h2=24.6;#enthalpy of water entering injector in kcal/kg\n",
"h3=100;#enthalpy of steam leaving injector in kcal/kg\n",
"h4=100;#enthalpy of water leaving injector in kcal/kg\n",
"deltaz=2;#depth from axis of injector in m\n",
"q=12;#heat loss from injector to surrounding through injector\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"let mass of steam to be supplied per kg of water lifted be(m) kg.applying law of energy conservation upon steam injector,for unit mass of water lifted\")\n",
"print(\"energy with steam entering + energy with water entering = energy with mixture leaving + heat loss to surrounding\")\n",
"print(\"m*(v1^2/2+h1*10^3*4.18)+h2*10^3*4.18+g*deltaz=(1+m)*(h3*10^3*4.18+v2^2/2)+m*q*10^3*4.18\")\n",
"print(\"so steam suppling rate(m)in kg/s per kg of water\")\n",
"m=((h3*10**3*4.18+v2**2/2)-(h2*10**3*4.18+g*deltaz))/((v1**2/2+h1*10**3*4.18)-(h3*10**3*4.18+v2**2/2)-(q*10**3*4.18))\n",
"print(\"m=\"),round(m,3)\n",
"print(\"NOTE=>here enthalpy of steam entering injector(h1)should be taken 720 kcal/kg instead of 72 kcal/kg otherwise the steam supplying rate comes wrong.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.12;pg no:82"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.12, Page:82 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 12\n",
"here let us assume that the pressure is always equal to atmospheric presure as ballon is flexible,inelastic and unstressed and no work is done for stretching ballon during its filling figure shows the boundary of system before and after filling ballon by firm line and dotted line respectively.\n",
"displacement work, W=(p.dv)cylinder+(p.dv)ballon\n",
"(p.dv)cylinder=0,as cylinder is rigid\n",
"so work done by system upon atmosphere(W)in KJ, W=(p*deltav)/1000\n",
"and work done by atmosphere=KJ 40.52\n"
]
}
],
"source": [
"#cal of work done by atmosphere\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.12, Page:82 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 12\")\n",
"p=1.013*10**5;#atmospheric pressure in pa\n",
"deltav=0.4;#change in volume in m^3\n",
"print(\"here let us assume that the pressure is always equal to atmospheric presure as ballon is flexible,inelastic and unstressed and no work is done for stretching ballon during its filling figure shows the boundary of system before and after filling ballon by firm line and dotted line respectively.\")\n",
"print(\"displacement work, W=(p.dv)cylinder+(p.dv)ballon\")\n",
"print(\"(p.dv)cylinder=0,as cylinder is rigid\")\n",
"print(\"so work done by system upon atmosphere(W)in KJ, W=(p*deltav)/1000\")\n",
"W=(p*deltav)/1000\n",
"print(\"and work done by atmosphere=KJ\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.13;pg no:82"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.13, Page:82 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 13\n",
"work done by turbine(Wt)in J#s is 25% of heat added i.e Wt= 1250.0\n",
"heat rejected by condensor(Qrejected)in J#s is 75% of head added i.e\n",
"Qrejected= 3750.0\n",
"and feed water pump work(Wp)in J#s is 0.2% of heat added i.e\n",
"Wp=(-) 10.0\n",
"capacity of generator(W)=in Kw 1.24\n"
]
}
],
"source": [
"#cal of capacity of generator\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.13, Page:82 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 13\")\n",
"Qadd=5000;#heat supplied in boiler in J#s\n",
"Wt=.25*Qadd\n",
"print(\"work done by turbine(Wt)in J#s is 25% of heat added i.e\"),\n",
"print(\"Wt=\"),round(Wt,2)\n",
"print(\"heat rejected by condensor(Qrejected)in J#s is 75% of head added i.e\")\n",
"Qrejected=.75*Qadd\n",
"print(\"Qrejected=\"),round(Qrejected,2)\n",
"print(\"and feed water pump work(Wp)in J#s is 0.2% of heat added i.e\")\n",
"Wp=0.002*Qadd\n",
"print(\"Wp=(-)\"),round(Wp,2)\n",
"W=(Wt-Wp)/1000\n",
"print(\"capacity of generator(W)=in Kw\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.14;pg no:83"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.14, Page:83 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 14\n",
"in heat exchanger upon applying S.F.E.E with assumption of no change in kinetic energy,no work interaction,no change in potential energy,for unit mass flow rate of air,\n",
"h1+Q1_2=h2\n",
"Q1_2=h2-h1\n",
"so heat transfer to air in heat exchanger(Q1_2)in KJ\n",
"Q1_2= 726.61\n",
"in gas turbine let us use S.F.E.E,assuming no change in potential energy,for unit mass flow rate of air\n",
"h2+C2^2#2=h3+C3^2/2+Wt\n",
"Wt=(h2-h3)+(C2^2-C3^2)/2\n",
"so power output from turbine(Wt)in KJ#s\n",
"Wt= 1.0\n",
"applying S.F.E.E upon nozzle assuming no change in potential energy,no work and heat interactions,for unit mass flow rate,\n",
"h3+C=h4+C4^2/2\n",
"C4^2#2=(h3-h4)+C3^2/2\n",
"velocity at exit of nozzle(C4)in m#s\n",
"C4= 14.3\n"
]
}
],
"source": [
"#cal of velocity at exit of nozzle\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"import math\n",
"print\"Example 3.14, Page:83 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 14\")\n",
"T1=(27+273);##ambient temperature in K\n",
"T2=(750+273);##temperature of heated air inside heat exchanger in K\n",
"T3=(600+273);##temperature of hot air leaves turbine in K\n",
"T4=(500+273);##temperature at which air leaves nozzle in K\n",
"Cp=1.005;##specific heat at constant pressure in KJ#kg K\n",
"C2=50;##velocity of hot air enter into gas turbine in m#s\n",
"C3=60;##velocity of air leaving turbine enters a nozzle in m#s\n",
"print(\"in heat exchanger upon applying S.F.E.E with assumption of no change in kinetic energy,no work interaction,no change in potential energy,for unit mass flow rate of air,\")\n",
"print(\"h1+Q1_2=h2\")\n",
"print(\"Q1_2=h2-h1\")\n",
"print(\"so heat transfer to air in heat exchanger(Q1_2)in KJ\")\n",
"Q1_2=Cp*(T2-T1)\n",
"print(\"Q1_2=\"),round(Q1_2,2)\n",
"print(\"in gas turbine let us use S.F.E.E,assuming no change in potential energy,for unit mass flow rate of air\")\n",
"print(\"h2+C2^2#2=h3+C3^2/2+Wt\")\n",
"print(\"Wt=(h2-h3)+(C2^2-C3^2)/2\")\n",
"print(\"so power output from turbine(Wt)in KJ#s\")\n",
"Wt=Cp*(T2-T3)+(C2**2-C3**2)*10**-3/2\n",
"print(\"Wt=\"),round(Cp,2)\n",
"print(\"applying S.F.E.E upon nozzle assuming no change in potential energy,no work and heat interactions,for unit mass flow rate,\")\n",
"print(\"h3+C=h4+C4^2/2\")\n",
"print(\"C4^2#2=(h3-h4)+C3^2/2\")\n",
"print(\"velocity at exit of nozzle(C4)in m#s\")\n",
"C4=math.sqrt(2*(Cp*(T3-T4)+C3**2*10**-3/2))\n",
"print(\"C4=\"),round(C4,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.15;pg no:85"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.15, Page:85 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 15\n",
"for constant pressure heating,say state changes from 1 to 2\n",
"Wa=p1*dv\n",
"Wa=p1*(v2-v1)\n",
"it is given that v2=2v1\n",
"so Wa=p1*v1=R*T1\n",
"for subsequent expansion at constant temperature say state from 2 to 3\n",
"also given that v3/v1=6,v3/v2=3\n",
"so work=Wb=p*dv\n",
"on solving above we get Wb=R*T2*ln(v3#v2)=R*T2*log3\n",
"temperature at 2 can be given by perfect gas consideration as,\n",
"T2/T1=v2/v1\n",
"or T2=2*T1\n",
"now total work done by air W=Wa+Wb=R*T1+R*T2*log3=R*T1+2*R*T1*log3 in KJ\n",
"so W in KJ= 10632.69\n"
]
}
],
"source": [
"#cal of total work done by ai\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"import math\n",
"print\"Example 3.15, Page:85 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 15\")\n",
"T1=400;##initial temperature of gas in K\n",
"R=8.314;##gas constant in \n",
"print(\"for constant pressure heating,say state changes from 1 to 2\")\n",
"print(\"Wa=p1*dv\")\n",
"print(\"Wa=p1*(v2-v1)\")\n",
"print(\"it is given that v2=2v1\")\n",
"print(\"so Wa=p1*v1=R*T1\")\n",
"print(\"for subsequent expansion at constant temperature say state from 2 to 3\")\n",
"print(\"also given that v3/v1=6,v3/v2=3\")\n",
"print(\"so work=Wb=p*dv\")\n",
"print(\"on solving above we get Wb=R*T2*ln(v3#v2)=R*T2*log3\")\n",
"print(\"temperature at 2 can be given by perfect gas consideration as,\")\n",
"print(\"T2/T1=v2/v1\")\n",
"print(\"or T2=2*T1\")\n",
"print(\"now total work done by air W=Wa+Wb=R*T1+R*T2*log3=R*T1+2*R*T1*log3 in KJ\")\n",
"W=R*T1+2*R*T1*math.log(3)\n",
"print(\"so W in KJ=\"),round(W,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.16;pg no:85"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.16, Page:85 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 16\n",
"NOTE=>this question contain derivation which cannot be solve using scilab so we use the result of derivation to proceed further \n",
"we get W=(Vf-Vi)*((Pi+Pf)/2)\n",
"also final volume of gas in m^3 is Vf=3*Vi\n",
"now work done by gas(W)in J 750000.0\n"
]
}
],
"source": [
"#cal of work done by gas\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.16, Page:85 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 16\")\n",
"Pi=0.5*10**6;##initial pressure of gas in pa\n",
"Vi=0.5;##initial volume of gas in m^3\n",
"Pf=1*10**6;##final pressure of gas in pa\n",
"print(\"NOTE=>this question contain derivation which cannot be solve using scilab so we use the result of derivation to proceed further \")\n",
"print(\"we get W=(Vf-Vi)*((Pi+Pf)/2)\")\n",
"print(\"also final volume of gas in m^3 is Vf=3*Vi\") \n",
"Vf=3*Vi\n",
"W=(Vf-Vi)*((Pi+Pf)/2)\n",
"print(\"now work done by gas(W)in J\"),round(W,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.17;pg no:87"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.17, Page:87 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 17\n",
"with the heating of N2 it will get expanded while H2 gets compressed simultaneously.compression of H2 in insulated chamber may be considered of adiabatic type.\n",
"adiabatic index of compression of H2 can be obtained as,\n",
"Cp_H2=\n",
"y_H2=Cp_H2/(Cp_H2-R_H2) 1.4\n",
"adiabatic index of expansion for N2,Cp_N2=R_N2*(y_N2#(y_N2-1))\n",
"y_N2= 1.4\n",
"i>for hydrogen,p1*v1^y=p2*v2^y\n",
"so final pressure of H2(p2)in pa\n",
"p2= 1324078.55\n",
"ii>since partition remains in equlibrium throughout hence no work is done by partition.it is a case similar to free expansion \n",
"partition work=0\n",
"iii>work done upon H2(W_H2)in J,\n",
"W_H2= -200054.06\n",
"work done upon H2(W_H2)=-2*10^5 J\n",
"so work done by N2(W_N2)=2*10^5 J \n",
"iv>heat added to N2 can be obtained using first law of thermodynamics as\n",
"Q_N2=deltaU_N2+W_N2=>Q_N2=m*Cv_N2*(T2-T1)+W_N2\n",
"final temperature of N2 can be obtained considering it as perfect gas\n",
"therefore, T2=(p2*v2*T1)#(p1*v1)\n",
"here p2=final pressure of N2 which will be equal to that of H2 as the partition is free and frictionless\n",
"p2=1.324*10^6 pa,v2=0.75 m^3\n",
"so now final temperature of N2(T2)in K= 1191.67\n",
"mass of N2(m)in kg= 2.81\n",
"specific heat at constant volume(Cv_N2)in KJ/kg K,Cv_N2= 1.0\n",
"heat added to N2,(Q_N2)in KJ\n",
"Q_N2= 2052.89\n"
]
}
],
"source": [
"#cal of \n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.17, Page:87 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 17\")\n",
"Cp_H2=14.307;##specific heat of H2 at constant pressure in KJ#kg K\n",
"R_H2=4.1240;##gas constant for H2 in KJ#kg K\n",
"Cp_N2=1.039;##specific heat of N2 at constant pressure in KJ#kg K\n",
"R_N2=0.2968;##gas constant for N2 in KJ#kg K\n",
"T1=(27+273);##ambient temperature in K\n",
"v1=0.5;##initial volume of H2 in m^3\n",
"p1=0.5*10**6;##initial pressure of H2 in pa \n",
"v2=0.25;##final volume of H2 in m^3 \n",
"p2=1.324*10**6;##final pressure of H2 in pa\n",
"print(\"with the heating of N2 it will get expanded while H2 gets compressed simultaneously.compression of H2 in insulated chamber may be considered of adiabatic type.\")\n",
"print(\"adiabatic index of compression of H2 can be obtained as,\")\n",
"print(\"Cp_H2=\")\n",
"y_H2=Cp_H2/(Cp_H2-R_H2)\n",
"print(\"y_H2=Cp_H2/(Cp_H2-R_H2)\"),round(y_H2,2)\n",
"print(\"adiabatic index of expansion for N2,Cp_N2=R_N2*(y_N2#(y_N2-1))\")\n",
"y_N2=Cp_N2/(Cp_N2-R_N2)\n",
"print(\"y_N2=\"),round(y_N2,2)\n",
"print(\"i>for hydrogen,p1*v1^y=p2*v2^y\")\n",
"print(\"so final pressure of H2(p2)in pa\")\n",
"p2=p1*(v1/v2)**y_H2\n",
"print(\"p2=\"),round(p2,2)\n",
"print(\"ii>since partition remains in equlibrium throughout hence no work is done by partition.it is a case similar to free expansion \")\n",
"print(\"partition work=0\")\n",
"print(\"iii>work done upon H2(W_H2)in J,\")\n",
"W_H2=(p1*v1-p2*v2)/(y_H2-1)\n",
"print(\"W_H2=\"),round(W_H2,2)\n",
"print(\"work done upon H2(W_H2)=-2*10^5 J\")\n",
"W_N2=2*10**5;##work done by N2 in J\n",
"print(\"so work done by N2(W_N2)=2*10^5 J \")\n",
"print(\"iv>heat added to N2 can be obtained using first law of thermodynamics as\")\n",
"print(\"Q_N2=deltaU_N2+W_N2=>Q_N2=m*Cv_N2*(T2-T1)+W_N2\")\n",
"print(\"final temperature of N2 can be obtained considering it as perfect gas\")\n",
"print(\"therefore, T2=(p2*v2*T1)#(p1*v1)\")\n",
"print(\"here p2=final pressure of N2 which will be equal to that of H2 as the partition is free and frictionless\")\n",
"print(\"p2=1.324*10^6 pa,v2=0.75 m^3\")\n",
"v2=0.75;##final volume of N2 in m^3\n",
"T2=(p2*v2*T1)/(p1*v1)\n",
"print(\"so now final temperature of N2(T2)in K=\"),round(T2,2)\n",
"T2=1191.6;##T2 approx. equal to 1191.6 K\n",
"m=(p1*v1)/(R_N2*1000*T1)\n",
"print(\"mass of N2(m)in kg=\"),round(m,2)\n",
"m=2.8;##m approx equal to 2.8 kg\n",
"Cv_N2=Cp_N2-R_N2\n",
"print(\"specific heat at constant volume(Cv_N2)in KJ/kg K,Cv_N2=\"),round(Cv_N2)\n",
"print(\"heat added to N2,(Q_N2)in KJ\")\n",
"Q_N2=((m*Cv_N2*1000*(T2-T1))+W_N2)/1000\n",
"print(\"Q_N2=\"),round(Q_N2,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.18;pg no:88"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.18, Page:88 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 18\n",
"let initial states and final states of air inside cylinder be given by m1,p1,v1,,T1 and m2,p2,v2,T2 respectively.it is case of emptying of cylinder\n",
"initial mass of air(m1)in kg\n",
"m1= 9.29\n",
"for adiabatic expansion during release of air through valve from 0.5 Mpa to atmospheric pressure\n",
"T2=in K 237.64\n",
"final mass of air left in tank(m2)in kg\n",
"m2= 2.97\n",
"writing down energy equation for unsteady flow system\n",
"(m1-m2)*(h2+C^2/2)=(m1*u1-m2*u2)\n",
"or (m1-m2)*C^2/2=(m1*u1-m2*u2)-(m1-m2)*h2\n",
"kinetic energy available for running turbine(W)in KJ\n",
"W=(m1*u1-m2*u2)-(m1-m2)*h2=(m1*Cv_air*1000*T1-m2*Cv_air*1000*T2)-(m1-m2)*Cp_air*1000*T2\n",
"W=(m1*Cv_air*1000*T1-m2*Cv_air*1000*T2)-(m1-m2)*Cp_air*1000*T2\n",
"amount of work available=KJ 482.67\n"
]
}
],
"source": [
"#cal of amount of work available\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.18, Page:88 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 18\")\n",
"p1=0.5*10**6;#initial pressure of air in pa\n",
"p2=1.013*10**5;#atmospheric pressure in pa\n",
"v1=2;#initial volume of air in m^3\n",
"v2=v1;#final volume of air in m^3\n",
"T1=375;#initial temperature of air in K\n",
"Cp_air=1.003;#specific heat at consatnt pressure in KJ/kg K\n",
"Cv_air=0.716;#specific heat at consatnt volume in KJ/kg K\n",
"R_air=0.287;#gas constant in KJ/kg K\n",
"y=1.4;#expansion constant for air\n",
"print(\"let initial states and final states of air inside cylinder be given by m1,p1,v1,,T1 and m2,p2,v2,T2 respectively.it is case of emptying of cylinder\")\n",
"print(\"initial mass of air(m1)in kg\")\n",
"m1=(p1*v1)/(R_air*1000*T1)\n",
"print(\"m1=\"),round(m1,2)\n",
"print(\"for adiabatic expansion during release of air through valve from 0.5 Mpa to atmospheric pressure\")\n",
"T2=T1*(p2/p1)**((y-1)/y)\n",
"print(\"T2=in K\"),round(T2,2)\n",
"print(\"final mass of air left in tank(m2)in kg\")\n",
"m2=(p2*v2)/(R_air*1000*T2)\n",
"print(\"m2=\"),round(m2,2)\n",
"print(\"writing down energy equation for unsteady flow system\")\n",
"print(\"(m1-m2)*(h2+C^2/2)=(m1*u1-m2*u2)\")\n",
"print(\"or (m1-m2)*C^2/2=(m1*u1-m2*u2)-(m1-m2)*h2\")\n",
"print(\"kinetic energy available for running turbine(W)in KJ\")\n",
"print(\"W=(m1*u1-m2*u2)-(m1-m2)*h2=(m1*Cv_air*1000*T1-m2*Cv_air*1000*T2)-(m1-m2)*Cp_air*1000*T2\")\n",
"print(\"W=(m1*Cv_air*1000*T1-m2*Cv_air*1000*T2)-(m1-m2)*Cp_air*1000*T2\")\n",
"W=((m1*Cv_air*1000*T1-m2*Cv_air*1000*T2)-(m1-m2)*Cp_air*1000*T2)/1000\n",
"print(\"amount of work available=KJ\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.19;pg no:89"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.19, Page:89 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 19\n",
"using perfect gas equation for the two chambers having initial states as 1 and 2 and final states as 3\n",
"n1= 0.1\n",
"now n2= 0.12\n",
"for tank being insulated and rigid we can assume,deltaU=0,W=0,Q=0,so writing deltaU,\n",
"deltaU=n1*Cv*(T3-T1)+n2*Cv*(T3-T2)\n",
"final temperature of gas(T3)in K\n",
"T3= 409.09\n",
"using perfect gas equation for final mixture,\n",
"final pressure of gas(p3)in Mpa\n",
"p3= 750000.0\n",
"so final pressure and temperature =0.75 Mpa and 409.11 K\n"
]
}
],
"source": [
"#cal of final pressure and temperature\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.19, Page:89 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 19\")\n",
"p1=0.5*10**6;#initial pressure of air in pa\n",
"v1=0.5;#initial volume of air in m^3\n",
"T1=(27+273);#initial temperature of air in K\n",
"p2=1*10**6;#final pressure of air in pa\n",
"v2=0.5;#final volume of air in m^3\n",
"T2=500;#final temperature of air in K\n",
"R=8314;#gas constant in J/kg K\n",
"Cv=0.716;#specific heat at constant volume in KJ/kg K\n",
"print(\"using perfect gas equation for the two chambers having initial states as 1 and 2 and final states as 3\")\n",
"n1=(p1*v1)/(R*T1)\n",
"print(\"n1=\"),round(n1,2)\n",
"n2=(p2*v2)/(R*T2)\n",
"print(\"now n2=\"),round(n2,2)\n",
"print(\"for tank being insulated and rigid we can assume,deltaU=0,W=0,Q=0,so writing deltaU,\")\n",
"deltaU=0;#change in internal energy\n",
"print(\"deltaU=n1*Cv*(T3-T1)+n2*Cv*(T3-T2)\")\n",
"print(\"final temperature of gas(T3)in K\")\n",
"T3=(deltaU+Cv*(n1*T1+n2*T2))/(Cv*(n1+n2))\n",
"print(\"T3=\"),round(T3,2)\n",
"print(\"using perfect gas equation for final mixture,\")\n",
"print(\"final pressure of gas(p3)in Mpa\")\n",
"p3=((n1+n2)*R*T3)/(v1+v2)\n",
"print(\"p3=\"),round(p3,3)\n",
"print(\"so final pressure and temperature =0.75 Mpa and 409.11 K\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.20;pg no:90"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.20, Page:90 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 20\n",
"printlacement work,W=p*(v1-v2)in N.m -50675.0\n",
"so heat transfer(Q)in N.m\n",
"Q=-W 50675.0\n"
]
}
],
"source": [
"#cal of heat transfer\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.20, Page:90 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 20\")\n",
"v1=0;#initial volume of air inside bottle in m^3\n",
"v2=0.5;#final volume of air inside bottle in m^3\n",
"p=1.0135*10**5;#atmospheric pressure in pa\n",
"W=p*(v1-v2)\n",
"print(\"printlacement work,W=p*(v1-v2)in N.m\"),round(W,2)\n",
"print(\"so heat transfer(Q)in N.m\")\n",
"Q=-W\n",
"print(\"Q=-W\"),round(Q,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.21;pg no:90"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.21, Page:90 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 21\n",
"here turbogenerator is fed with compressed air from a compressed air bottle.pressure inside bottle gradually decreases from 35 bar to 1 bar.expansion from 35 bar to 1 bar occurs isentropically.thus,for the initial and final states of pressure,volume,temperatureand mass inside bottle being given as p1,v1,T1 & m1 and p2,v2,T2 & m2 respectively.it is transient flow process similar to emptying of the bottle.\n",
"(p2/p1)^((y-1)/y)=(T2/T1)\n",
"final temperature of air(T2)in K\n",
"T2= 113.34\n",
"by perfect gas law,initial mass in bottle(m1)in kg\n",
"m1= 11.69\n",
"final mass in bottle(m2)in kg\n",
"m2= 0.92\n",
"energy available for running turbo generator or work(W)in KJ\n",
"W+(m1-m2)*h2=m1*u1-m2*u2\n",
"W= 1325.42\n",
"this is maximum work that can be had from the emptying of compresssed air bottle between given pressure limits\n",
"turbogenerator actual output(P1)=5 KJ/s\n",
"input to turbogenerator(P2)in KJ/s\n",
"time duration for which turbogenerator can be run(deltat)in seconds\n",
"deltat= 159.05\n",
"duration=160 seconds approx.\n"
]
}
],
"source": [
"#cal of time duration for which turbogenerator can be run\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.21, Page:90 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 21\")\n",
"p1=35.*10**5;#initial pressure of air in pa\n",
"v1=0.3;#initial volume of air in m^3\n",
"T1=(313.);#initial temperature of air in K\n",
"p2=1.*10**5;#final pressure of air in pa\n",
"v2=0.3;#final volume of air in m^3\n",
"y=1.4;#expansion constant\n",
"R=0.287;#gas constant in KJ/kg K\n",
"Cv=0.718;#specific heat at constant volume in KJ/kg K\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"print(\"here turbogenerator is fed with compressed air from a compressed air bottle.pressure inside bottle gradually decreases from 35 bar to 1 bar.expansion from 35 bar to 1 bar occurs isentropically.thus,for the initial and final states of pressure,volume,temperatureand mass inside bottle being given as p1,v1,T1 & m1 and p2,v2,T2 & m2 respectively.it is transient flow process similar to emptying of the bottle.\")\n",
"print(\"(p2/p1)^((y-1)/y)=(T2/T1)\")\n",
"print(\"final temperature of air(T2)in K\")\n",
"T2=T1*(p2/p1)**((y-1)/y)\n",
"print(\"T2=\"),round(T2,2)\n",
"print(\"by perfect gas law,initial mass in bottle(m1)in kg\")\n",
"m1=(p1*v1)/(R*1000.*T1)\n",
"print(\"m1=\"),round(m1,2)\n",
"print(\"final mass in bottle(m2)in kg\")\n",
"m2=(p2*v2)/(R*1000.*T2)\n",
"print(\"m2=\"),round(m2,2)\n",
"print(\"energy available for running turbo generator or work(W)in KJ\")\n",
"print(\"W+(m1-m2)*h2=m1*u1-m2*u2\")\n",
"W=(m1*Cv*T1-m2*Cv*T2)-(m1-m2)*Cp*T2\n",
"print(\"W=\"),round(W,2)\n",
"print(\"this is maximum work that can be had from the emptying of compresssed air bottle between given pressure limits\")\n",
"print(\"turbogenerator actual output(P1)=5 KJ/s\")\n",
"P1=5;#turbogenerator actual output in KJ/s\n",
"print(\"input to turbogenerator(P2)in KJ/s\")\n",
"P2=P1/0.6\n",
"print(\"time duration for which turbogenerator can be run(deltat)in seconds\")\n",
"deltat=W/P2\n",
"print(\"deltat=\"),round(deltat,2)\n",
"print(\"duration=160 seconds approx.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.22;pg no:91"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.22, Page:91 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 22\n",
"different states as described in the problem are denoted as 1,2and 3 and shown on p-V diagram\n",
"process 1-2 is polytropic process with index 1.2\n",
"(T2/T1)=(p2/p1)^((n-1)/n)\n",
"final temperature of air(T2)in K\n",
"T2= 457.68\n",
"at state 1,p1*v1=m*R*T1\n",
"initial volume of air(v1)in m^3\n",
"v1= 2.01\n",
"final volume of air(v2)in m^3\n",
"for process 1-2,v2= 0.53\n",
"for process 2-3 is constant pressure process so p2*v2/T2=p3*v3/T3\n",
"v3=v2*T3/T2 in m^3\n",
"here process 3-1 is isothermal process so T1=T3\n",
"during process 1-2 the compression work(W1_2)in KJ\n",
"W1_2=(m*R*(T2-T1)/(1-n))\n",
"work during process 2-3(W2_3)in KJ,\n",
"W2_3=p2*(v3-v2)/1000\n",
"work during process 3-1(W3_1)in KJ\n",
"W3_1= 485.0\n",
"net work done(W_net)in KJ\n",
"W_net=W1_2+W2_3+W3_1 -71.28\n",
"net work=-71.27 KJ\n",
"here -ve workshows work done upon the system.since it is cycle,so\n",
"W_net=Q_net\n",
"phi dW=phi dQ=-71.27 KJ\n",
"heat transferred from system=71.27 KJ\n"
]
}
],
"source": [
"#cal of network,heat transferred from system\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"import math\n",
"print\"Example 3.22, Page:91 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 22\")\n",
"p1=1.5*10**5;#initial pressure of air in pa\n",
"T1=(77+273);#initial temperature of air in K\n",
"p2=7.5*10**5;#final pressure of air in pa\n",
"n=1.2;#expansion constant for process 1-2\n",
"R=0.287;#gas constant in KJ/kg K\n",
"m=3.;#mass of air in kg\n",
"print(\"different states as described in the problem are denoted as 1,2and 3 and shown on p-V diagram\")\n",
"print(\"process 1-2 is polytropic process with index 1.2\")\n",
"print(\"(T2/T1)=(p2/p1)^((n-1)/n)\")\n",
"print(\"final temperature of air(T2)in K\")\n",
"T2=T1*((p2/p1)**((n-1)/n))\n",
"print(\"T2=\"),round(T2,2)\n",
"print(\"at state 1,p1*v1=m*R*T1\")\n",
"print(\"initial volume of air(v1)in m^3\")\n",
"v1=(m*R*1000*T1)/p1\n",
"print(\"v1=\"),round(v1,2)\n",
"print(\"final volume of air(v2)in m^3\")\n",
"v2=((p1*v1**n)/p2)**(1/n)\n",
"print(\"for process 1-2,v2=\"),round(v2,2)\n",
"print(\"for process 2-3 is constant pressure process so p2*v2/T2=p3*v3/T3\")\n",
"print(\"v3=v2*T3/T2 in m^3\")\n",
"print(\"here process 3-1 is isothermal process so T1=T3\")\n",
"T3=T1;#process 3-1 is isothermal\n",
"v3=v2*T3/T2\n",
"print(\"during process 1-2 the compression work(W1_2)in KJ\")\n",
"print(\"W1_2=(m*R*(T2-T1)/(1-n))\")\n",
"W1_2=(m*R*(T2-T1)/(1-n))\n",
"print(\"work during process 2-3(W2_3)in KJ,\")\n",
"print(\"W2_3=p2*(v3-v2)/1000\")\n",
"W2_3=p2*(v3-v2)/1000\n",
"print(\"work during process 3-1(W3_1)in KJ\")\n",
"p3=p2;#pressure is constant for process 2-3\n",
"W3_1=p3*v3*math.log(v1/v3)/1000\n",
"print(\"W3_1=\"),round(W3_1,2)\n",
"print(\"net work done(W_net)in KJ\")\n",
"W_net=W1_2+W2_3+W3_1\n",
"print(\"W_net=W1_2+W2_3+W3_1\"),round(W_net,2)\n",
"print(\"net work=-71.27 KJ\")\n",
"print(\"here -ve workshows work done upon the system.since it is cycle,so\")\n",
"print(\"W_net=Q_net\")\n",
"print(\"phi dW=phi dQ=-71.27 KJ\")\n",
"print(\"heat transferred from system=71.27 KJ\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 3.23;pg no:93"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 3.23, Page:93 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 23\n",
"initial mass of air in bottle(m1)in kg \n",
"m1= 6.97\n",
"now final temperature(T2)in K\n",
"T2= 0.0\n",
"final mass of air in bottle(m2)in kg\n",
"m2= 0.82\n",
"energy available for running of turbine due to emptying of bottle(W)in KJ\n",
"W= 639.09\n",
"work available from turbine=639.27KJ\n"
]
}
],
"source": [
"#cal of work available from turbine\n",
"#intiation of all variables\n",
"# Chapter 3\n",
"print\"Example 3.23, Page:93 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 3 Example 23\")\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"Cv=0.718;#specific heat at constant volume in KJ/kg K\n",
"y=1.4;#expansion constant \n",
"p1=40*10**5;#initial temperature of air in pa\n",
"v1=0.15;#initial volume of air in m^3\n",
"T1=(27+273);#initial temperature of air in K\n",
"p2=2*10**5;#final temperature of air in pa\n",
"v2=0.15;#final volume of air in m^3\n",
"R=0.287;#gas constant in KJ/kg K\n",
"print(\"initial mass of air in bottle(m1)in kg \")\n",
"m1=(p1*v1)/(R*1000*T1)\n",
"print(\"m1=\"),round(m1,2)\n",
"print(\"now final temperature(T2)in K\")\n",
"T2=T1*(p2/p1)**((y-1)/y)\n",
"print(\"T2=\"),round(T2,2)\n",
"T2=127.36;#take T2=127.36 approx.\n",
"print(\"final mass of air in bottle(m2)in kg\")\n",
"m2=(p2*v2)/(R*1000*T2)\n",
"print(\"m2=\"),round(m2,2)\n",
"m2=0.821;#take m2=0.821 approx.\n",
"print(\"energy available for running of turbine due to emptying of bottle(W)in KJ\")\n",
"W=(m1*Cv*T1-m2*Cv*T2)-(m1-m2)*Cp*T2\n",
"print(\"W=\"),round(W,2)\n",
"print(\"work available from turbine=639.27KJ\")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
IXI+Engineering Thermodynamics/chapter4_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 4:Second Law of Thermo Dynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.1;pg no: 113"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.1, Page:113 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 1\n",
"NOTE=>This question is fully theoritical hence cannot be solve using scilab.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.1, Page:113 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 1\")\n",
"print(\"NOTE=>This question is fully theoritical hence cannot be solve using scilab.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.2;pg no: 114"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.2, Page:114 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 2\n",
"in carnot engine from thermodynamics temperature scale\n",
"Q1/Q2=T1/T2\n",
"W=Q1-Q2=200 KJ\n",
"from above equations Q1 in KJ is given by\n",
"Q1= 349.61\n",
"and Q2 in KJ\n",
"Q2=Q1-200 149.61\n",
"so heat supplied(Q1) in KJ 349.6\n"
]
}
],
"source": [
"#cal of heat supplied\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.2, Page:114 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 2\")\n",
"T1=(400.+273.);#temperature of source in K\n",
"T2=(15.+273.);#temperature of sink in K\n",
"W=200.;#work done in KJ\n",
"print(\"in carnot engine from thermodynamics temperature scale\")\n",
"print(\"Q1/Q2=T1/T2\")\n",
"print(\"W=Q1-Q2=200 KJ\")\n",
"print(\"from above equations Q1 in KJ is given by\")\n",
"Q1=(200*T1)/(T1-T2)\n",
"print(\"Q1=\"),round(Q1,2)\n",
"print(\"and Q2 in KJ\")\n",
"Q2=Q1-200\n",
"print(\"Q2=Q1-200\"),round(Q2,2)\n",
"print(\"so heat supplied(Q1) in KJ\"),round(Q1,1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.3;pg no: 115"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.3, Page:115 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 3\n",
"from thermodynamic temperature scale\n",
"Q1/Q2=T1/T2\n",
"so Q1=Q2*(T1/T2)in KJ/s 2.27\n",
"power/work input required(W)=Q1-Q2 in KJ/s \n",
"power required for driving refrigerator=W in KW 0.274\n"
]
}
],
"source": [
"#cal of power required for driving refrigerator\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.3, Page:115 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 3\")\n",
"T1=315.;#temperature of reservoir 1 in K\n",
"T2=277.;#temperature of reservoir 2 in K\n",
"Q2=2.;#heat extracted in KJ/s\n",
"print(\"from thermodynamic temperature scale\")\n",
"print(\"Q1/Q2=T1/T2\")\n",
"Q1=Q2*(T1/T2)\n",
"print(\"so Q1=Q2*(T1/T2)in KJ/s\"),round(Q1,2)\n",
"print(\"power/work input required(W)=Q1-Q2 in KJ/s \")\n",
"W=Q1-Q2\n",
"print(\"power required for driving refrigerator=W in KW\"),round(W,3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.4;pg no: 115"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.4, Page:115 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 4\n",
"we can writefor heat engine,Q1/Q2=T1/T2\n",
"so Q2=Q1*(T2/T1) in KJ 545.45\n",
"so We=in KJ 1454.55\n",
"for refrigerator,Q3/Q4=T3/T4 eq 1\n",
"now We-Wr=300\n",
"so Wr=We-300 in KJ 1154.55\n",
"and Wr=Q4-Q3=1154.55 KJ eq 2 \n",
"solving eq1 and eq 2 we get\n",
"Q4=in KJ 8659.13\n",
"and Q3=in KJ 7504.58\n",
"total heat transferred to low teperature reservoir(Q)=in KJ 9204.58\n",
"hence heat transferred to refrigerant=Q3 in KJ 7504.58\n",
"and heat transferred to low temperature reservoir=Q in KJ 9204.58\n"
]
}
],
"source": [
"#cal of heat transferred to refrigerant and low temperature reservoir\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.4, Page:115 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 4\")\n",
"T1=(827.+273.);#temperature of high temperature reservoir in K\n",
"T2=(27.+273.);#temperature of low temperature reservoir in K\n",
"T3=(-13.+273.);#temperature of reservoir 3 in K\n",
"Q1=2000.;#heat ejected by reservoir 1 in KJ\n",
"print(\"we can writefor heat engine,Q1/Q2=T1/T2\")\n",
"Q2=Q1*(T2/T1)\n",
"print(\"so Q2=Q1*(T2/T1) in KJ\"),round(Q2,2)\n",
"We=Q1-Q2\n",
"print(\"so We=in KJ\"),round(We,2)\n",
"print(\"for refrigerator,Q3/Q4=T3/T4 eq 1\")\n",
"T4=T2;#temperature of low temperature reservoir in K\n",
"print(\"now We-Wr=300\")\n",
"Wr=We-300.\n",
"print(\"so Wr=We-300 in KJ\"),round(Wr,2)\n",
"print(\"and Wr=Q4-Q3=1154.55 KJ eq 2 \")\n",
"print(\"solving eq1 and eq 2 we get\")\n",
"Q4=(1154.55*T4)/(T4-T3)\n",
"print(\"Q4=in KJ\"),round(Q4,2)\n",
"Q3=Q4-Wr\n",
"print(\"and Q3=in KJ\"),round(Q3,2)\n",
"Q=Q2+Q4\n",
"print(\"total heat transferred to low teperature reservoir(Q)=in KJ\"),round(Q,2)\n",
"print(\"hence heat transferred to refrigerant=Q3 in KJ\"),round(Q3,2)\n",
"print(\"and heat transferred to low temperature reservoir=Q in KJ\"),round(Q,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.5;pg no: 116"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.5, Page:116 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 5\n",
"COP_HP=Q1/W=Q1/(Q1-Q2)=1/(1-(Q2/Q1))\n",
"also we know K=Q1/Q2=T1/T2\n",
"so K=T1/T2 1.1\n",
"so COP_HP=1/(1-(Q2/Q1)=1/(1-(1/K)) 11.0\n",
"also COP_HP=Q1/W\n",
"W=Q1/COin MJ/Hr 3.03\n",
"or W=1000*W/3600 in KW 3.03\n",
"so minimum power required(W)in KW 3.03\n"
]
}
],
"source": [
"#cal of minimum power required\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.5, Page:116 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 5\")\n",
"T1=(25+273.15);#temperature of inside of house in K\n",
"T2=(-1+273.15);#outside temperature in K\n",
"Q1=125;#heating load in MJ/Hr\n",
"print(\"COP_HP=Q1/W=Q1/(Q1-Q2)=1/(1-(Q2/Q1))\")\n",
"print(\"also we know K=Q1/Q2=T1/T2\")\n",
"K=T1/T2\n",
"print(\"so K=T1/T2\"),round(K,2)\n",
"COP_HP=1/(1-(1/K))\n",
"print(\"so COP_HP=1/(1-(Q2/Q1)=1/(1-(1/K))\"),round(COP_HP)\n",
"print(\"also COP_HP=Q1/W\")\n",
"W=Q1/COP_HP\n",
"W=1000*W/3600\n",
"print(\"W=Q1/COin MJ/Hr\"),round(W,2)\n",
"print(\"or W=1000*W/3600 in KW\"),round(W,2)\n",
"print(\"so minimum power required(W)in KW \"),round(W,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.6;pg no: 117"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.6, Page:117 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 6\n",
"cold storage plant can be considered as refrigerator operating between given temperatures limits\n",
"capacity of plant=heat to be extracted=Q2 in KW\n",
"we know that,one ton of refrigeration as 3.52 KW \n",
"so Q2=Q2*3.52 in KW 140.8\n",
"carnot COP of plant(COP_carnot)= 5.18\n",
"performance is 1/4 of its carnot COP\n",
"COP=COP_carnot/4\n",
"also actual COP=Q2/W\n",
"W=Q2/COP in KW\n",
"hence power required(W)in KW 108.76\n"
]
}
],
"source": [
"#cal of power required\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.6, Page:117 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 6\")\n",
"T1=(-15.+273.15);#inside temperature in K\n",
"T2=(35.+273.);#atmospheric temperature in K\n",
"Q2=40.;#refrigeration capacity of storage plant in tonnes\n",
"print(\"cold storage plant can be considered as refrigerator operating between given temperatures limits\")\n",
"print(\"capacity of plant=heat to be extracted=Q2 in KW\")\n",
"print(\"we know that,one ton of refrigeration as 3.52 KW \")\n",
"Q2=Q2*3.52\n",
"print(\"so Q2=Q2*3.52 in KW\"),round(Q2,2)\n",
"COP_carnot=1/((T2/T1)-1)\n",
"print(\"carnot COP of plant(COP_carnot)=\"),round(COP_carnot,2)\n",
"print(\"performance is 1/4 of its carnot COP\")\n",
"COP=COP_carnot/4\n",
"print(\"COP=COP_carnot/4\")\n",
"print(\"also actual COP=Q2/W\")\n",
"print(\"W=Q2/COP in KW\")\n",
"W=Q2/COP\n",
"print(\"hence power required(W)in KW\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.7;pg no: 117"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.7, Page:117 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 7\n",
"highest efficiency is that of carnot engine,so let us find the carnot cycle efficiency for given temperature limits\n",
"n= 0.79\n",
"or n=n*100 % 78.92\n"
]
}
],
"source": [
"#cal of carnot cycle efficiency for given temperature limits\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.7, Page:117 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 7\")\n",
"T1=(1150.+273.);#temperature of source in K\n",
"T2=(27.+273.);#temperature of sink in K\n",
"print(\"highest efficiency is that of carnot engine,so let us find the carnot cycle efficiency for given temperature limits\")\n",
"n=1-(T2/T1)\n",
"print(\"n=\"),round(n,2)\n",
"n=n*100\n",
"print(\"or n=n*100 %\"),round(n,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.8;pg no: 117"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.8, Page:117 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 8\n",
"here heat to be removed continuously from refrigerated space(Q)in KJ/s 0.13\n",
"for refrigerated,COP shall be Q/W=1/((T1/T2)-1)\n",
"W=in KW 0.02\n",
"so power required(W)in KW 0.02\n"
]
}
],
"source": [
"#cal of power required\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.8, Page:117 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 8\")\n",
"T1=(27.+273.);#temperature of source in K\n",
"T2=(-8.+273.);#temperature of sink in K\n",
"Q=7.5;#heat leakage in KJ/min\n",
"Q=Q/60.\n",
"print(\"here heat to be removed continuously from refrigerated space(Q)in KJ/s\"),round(Q,2)\n",
"print(\"for refrigerated,COP shall be Q/W=1/((T1/T2)-1)\")\n",
"W=Q*((T1/T2)-1)\n",
"print(\"W=in KW\"),round(W,2)\n",
"print(\"so power required(W)in KW\"),round(W,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.9;pg no: 118"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.9, Page:118 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 9\n",
"here W1:W2:W3=3:2:1\n",
"efficiency of engine,HE1,\n",
"W1/Q1=(1-(T2/1100))\n",
"so Q1=(1100*W1)/(1100-T2)\n",
"for HE2 engine,W2/Q2=(1-(T3/T2))\n",
"for HE3 engine,W3/Q3=(1-(300/T3))\n",
"from energy balance on engine,HE1\n",
"Q1=W1+Q2=>Q2=Q1-W1\n",
"above gives,Q1=(((1100*W1)/(1100-T2))-W1)=W1*(T2/(1100-T2))\n",
"substituting Q2 in efficiency of HE2\n",
"W2/(W1*(T2/(1100-T2)))=1-(T3/T2)\n",
"W2/W1=(T2/(1100-T2))*(T2-T3)/T2=((T2-T3)/(1100-T2))\n",
"2/3=(T2-T3)/(1100-T2)\n",
"2200-2*T2=3*T2-3*T3\n",
"5*T2-3*T3=2200\n",
"now energy balance on engine HE2 gives,Q2=W2+Q3\n",
"substituting in efficiency of HE2,\n",
"W2/(W2+Q3)=(T2-T3)/T2\n",
"W2*T2=(W2+Q3)*(T2-T3)\n",
"Q3=(W2*T3)/(T2-T3)\n",
"substituting Q3 in efficiency of HE3,\n",
"W3/((W2*T3)/(T2-T3))=(T3-300)/T3\n",
"W3/W2=(T3/(T2-T3))*(T3-300)/T3\n",
"1/2=(T3-300)/(T2-T3)\n",
"3*T3-T2=600\n",
"solving equations of T2 and T3,\n",
"we get,T3=in K 433.33\n",
"and by eq 5,T2 in K 700.0\n",
"so intermediate temperature are 700 K and 433.33 K\n"
]
}
],
"source": [
"#cal of intermediate temperatures\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.9, Page:118 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 9\")\n",
"T1=1100;#temperature of high temperature reservoir in K\n",
"T4=300;#temperature of low temperature reservoir in K\n",
"print(\"here W1:W2:W3=3:2:1\")\n",
"print(\"efficiency of engine,HE1,\")\n",
"print(\"W1/Q1=(1-(T2/1100))\")\n",
"print(\"so Q1=(1100*W1)/(1100-T2)\")\n",
"print(\"for HE2 engine,W2/Q2=(1-(T3/T2))\")\n",
"print(\"for HE3 engine,W3/Q3=(1-(300/T3))\")\n",
"print(\"from energy balance on engine,HE1\")\n",
"print(\"Q1=W1+Q2=>Q2=Q1-W1\")\n",
"print(\"above gives,Q1=(((1100*W1)/(1100-T2))-W1)=W1*(T2/(1100-T2))\")\n",
"print(\"substituting Q2 in efficiency of HE2\")\n",
"print(\"W2/(W1*(T2/(1100-T2)))=1-(T3/T2)\")\n",
"print(\"W2/W1=(T2/(1100-T2))*(T2-T3)/T2=((T2-T3)/(1100-T2))\")\n",
"print(\"2/3=(T2-T3)/(1100-T2)\")\n",
"print(\"2200-2*T2=3*T2-3*T3\")\n",
"print(\"5*T2-3*T3=2200\")\n",
"print(\"now energy balance on engine HE2 gives,Q2=W2+Q3\")\n",
"print(\"substituting in efficiency of HE2,\")\n",
"print(\"W2/(W2+Q3)=(T2-T3)/T2\")\n",
"print(\"W2*T2=(W2+Q3)*(T2-T3)\")\n",
"print(\"Q3=(W2*T3)/(T2-T3)\")\n",
"print(\"substituting Q3 in efficiency of HE3,\")\n",
"print(\"W3/((W2*T3)/(T2-T3))=(T3-300)/T3\")\n",
"print(\"W3/W2=(T3/(T2-T3))*(T3-300)/T3\")\n",
"print(\"1/2=(T3-300)/(T2-T3)\")\n",
"print(\"3*T3-T2=600\")\n",
"print(\"solving equations of T2 and T3,\")\n",
"T3=(600.+(2200./5.))/(3.-(3./5.))\n",
"print(\"we get,T3=in K\"),round(T3,2)\n",
"T2=(2200.+3.*T3)/5.\n",
"print(\"and by eq 5,T2 in K\"),round(T2,2)\n",
"print(\"so intermediate temperature are 700 K and 433.33 K\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.10;pg no: 119"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.10, Page:119 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 10\n",
"efficiency of engine,W/Q1=(800-T)/800\n",
"for refrigerator,COP=Q3/W=280/(T-280)\n",
"it is given that Q1=Q3=Q\n",
"so,from engine,W/Q=(800-T)/800\n",
"from refrigerator,Q/W=280/(T-280)\n",
"from above two(Q/W)may be equated,\n",
"(T-280)/280=(800-T)/800\n",
"so temperature(T)in K 414.81\n",
"efficiency of engine(n)is given as\n",
"n= 0.48\n",
"COP of refrigerator is given as\n",
"COP= 2.08\n"
]
}
],
"source": [
"#cal of COP\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.10, Page:119 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 10\")\n",
"T1=800.;#temperature of source in K\n",
"T2=280.;#temperature of sink in K\n",
"print(\"efficiency of engine,W/Q1=(800-T)/800\")\n",
"print(\"for refrigerator,COP=Q3/W=280/(T-280)\")\n",
"print(\"it is given that Q1=Q3=Q\")\n",
"print(\"so,from engine,W/Q=(800-T)/800\")\n",
"print(\"from refrigerator,Q/W=280/(T-280)\")\n",
"print(\"from above two(Q/W)may be equated,\")\n",
"print(\"(T-280)/280=(800-T)/800\")\n",
"T=2.*280.*800./(800.+280.)\n",
"print(\"so temperature(T)in K\"),round(T,2)\n",
"print(\"efficiency of engine(n)is given as\")\n",
"n=(800.-T)/800.\n",
"print(\"n=\"),round(n,2)\n",
"print(\"COP of refrigerator is given as\")\n",
"COP=280./(T-280.)\n",
"print(\"COP=\"),round(COP,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.11;pg no: 120"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.11, Page:120 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 11\n",
"let thermodynamic properties be denoted with respect to salient states;\n",
"n_carnot=1-T1/T2\n",
"so T1/T2=1-0.5\n",
"so T1/T2=0.5\n",
"or T2=2*T1\n",
"corresponding to state 2,p2*v2=m*R*T2\n",
"so temperature(T2) in K= 585.37\n",
"heat transferred during process 2-3(isothermal expansion),Q_23=40 KJ\n",
"Q_23=W_23=p2*v2*log(v3/v2)\n",
"so volume(v3) in m^3= 0.1932\n",
"temperature at state 1,T1 in K= 292.68\n",
"during process 1-2,T2/T1=(p2/p1)^((y-1)/y)\n",
"here expansion constant(y)=Cp/Cv\n",
"so pressure(p1)=p2/(T2/T1)^(y/(y-1)) in pa\n",
"p1 in bar\n",
"thus p1*v1=m*R*T1\n",
"so volume(v1) in m^3= 0.68\n",
"heat transferred during process 4-1(isothermal compression)shall be equal to the heat transferred during process2-3(isothermal expansion).\n",
"for isentropic process,dQ=0,dW=dU\n",
"during process 1-2,isentropic process,W_12=-m*Cv*(T2-T1)in KJ\n",
"Q_12=0,\n",
"W_12=-105.51 KJ(-ve work)\n",
"during process 3-4,isentropic process,W_34=-m*Cv*(T4-T3)in KJ\n",
"Q_31=0,\n",
"ANS:\n",
"W_34=+105.51 KJ(+ve work)\n",
"so for process 1-2,heat transfer=0,work interaction=-105.51 KJ\n",
"for process 2-3,heat transfer=40 KJ,work intercation=40 KJ\n",
"for process 3-4,heat transfer=0,work interaction=+105.51 KJ\n",
"for process 4-1,heat transfer=-40 KJ,work interaction=-40 KJ\n",
"maximum temperature of cycle=585.36 KJ\n",
"minimum temperature of cycle=292.68 KJ\n",
"volume at the end of isothermal expansion=0.1932 m^3\n"
]
}
],
"source": [
"#cal of max and min temp of cycle,volume\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"import math\n",
"print\"Example 4.11, Page:120 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 11\")\n",
"n_carnot=0.5;#efficiency of carnot power cycle\n",
"m=0.5;#mass of air in kg\n",
"p2=7.*10**5;#final pressure in pa\n",
"v2=0.12;#volume in m^3\n",
"R=287.;#gas constant in J/kg K\n",
"Q_23=40.*1000.;#heat transfer to the air during isothermal expansion in J\n",
"Cp=1.008;#specific heat at constant pressure in KJ/kg K\n",
"Cv=0.721;#specific heat at constant volume in KJ/kg K\n",
"print(\"let thermodynamic properties be denoted with respect to salient states;\")\n",
"print(\"n_carnot=1-T1/T2\")\n",
"print(\"so T1/T2=1-0.5\")\n",
"1-0.5\n",
"print(\"so T1/T2=0.5\")\n",
"print(\"or T2=2*T1\")\n",
"print(\"corresponding to state 2,p2*v2=m*R*T2\")\n",
"T2=p2*v2/(m*R)\n",
"print(\"so temperature(T2) in K=\"),round(T2,2)\n",
"print(\"heat transferred during process 2-3(isothermal expansion),Q_23=40 KJ\")\n",
"print(\"Q_23=W_23=p2*v2*log(v3/v2)\")\n",
"v3=v2*math.exp(Q_23/(p2*v2))\n",
"print(\"so volume(v3) in m^3=\"),round(v3,4)\n",
"T1=T2/2\n",
"print(\"temperature at state 1,T1 in K=\"),round(T1,2)\n",
"print(\"during process 1-2,T2/T1=(p2/p1)^((y-1)/y)\")\n",
"print(\"here expansion constant(y)=Cp/Cv\")\n",
"y=Cp/Cv\n",
"print(\"so pressure(p1)=p2/(T2/T1)^(y/(y-1)) in pa\")\n",
"p1=p2/(T2/T1)**(y/(y-1))\n",
"print(\"p1 in bar\")\n",
"p1=p1/10**5\n",
"print(\"thus p1*v1=m*R*T1\")\n",
"v1=m*R*T1/(p1*10**5)\n",
"print(\"so volume(v1) in m^3=\"),round(v1,2) \n",
"print(\"heat transferred during process 4-1(isothermal compression)shall be equal to the heat transferred during process2-3(isothermal expansion).\")\n",
"print(\"for isentropic process,dQ=0,dW=dU\")\n",
"print(\"during process 1-2,isentropic process,W_12=-m*Cv*(T2-T1)in KJ\")\n",
"print(\"Q_12=0,\")\n",
"W_12=-m*Cv*(T2-T1)\n",
"print(\"W_12=-105.51 KJ(-ve work)\")\n",
"print(\"during process 3-4,isentropic process,W_34=-m*Cv*(T4-T3)in KJ\")\n",
"print(\"Q_31=0,\")\n",
"T4=T1;\n",
"T3=T2;\n",
"W_34=-m*Cv*(T4-T3)\n",
"print(\"ANS:\")\n",
"print(\"W_34=+105.51 KJ(+ve work)\")\n",
"print(\"so for process 1-2,heat transfer=0,work interaction=-105.51 KJ\")\n",
"print(\"for process 2-3,heat transfer=40 KJ,work intercation=40 KJ\")\n",
"print(\"for process 3-4,heat transfer=0,work interaction=+105.51 KJ\")\n",
"print(\"for process 4-1,heat transfer=-40 KJ,work interaction=-40 KJ\")\n",
"print(\"maximum temperature of cycle=585.36 KJ\")\n",
"print(\"minimum temperature of cycle=292.68 KJ\")\n",
"print(\"volume at the end of isothermal expansion=0.1932 m^3\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.12;pg no: 122"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.12, Page:122 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 12\n",
"let us assume that heat engine rejects Q2 and Q3 heat to reservior at 300 K and 200 K respectively.let us assume that there are two heat engines operating between 400 K and 300 K temperature reservoirs and between 400 K and 200 K temperature reservoirs.let each heat engine receive Q1_a and Q1_b from reservoir at 400 K as shown below\n",
"thus,Q1_a+Q1_b=Q1=5*10^3 KJ...............eq1\n",
"Also,Q1_a/Q2=400/300,or Q1_a=4*Q2/3...............eq2\n",
"Q1_b/Q3=400/200 or Q1_b=2*Q3...............eq3\n",
"substituting Q1_a and Q1_b in eq 1\n",
"4*Q2/3+2*Q3=5000...............eq4\n",
"also from total work output,Q1_a+Q1_b-Q2-Q3=W\n",
"5000-Q2-Q3=840\n",
"so Q2+Q3=5000-840=4160\n",
"Q3=4160-Q2\n",
"sunstituting Q3 in eq 4\n",
"4*Q2/3+2*(4160-Q2)=5000\n",
"so Q2=in KJ 4980.0\n",
"and Q3= in KJ 820.0\n",
"here negative sign with Q3 shows that the assumed direction of heat is not correct and actually Q3 heat will flow from reservoir to engine.actual sign of heat transfers and magnitudes are as under:\n",
"Q2=4980 KJ,from heat engine\n",
"Q3=820 KJ,to heat engine\n"
]
}
],
"source": [
"#cal of heat from from heat engine and to heat engine\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.12, Page:122 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 12\")\n",
"W=840.;#work done by reservoir in KJ\n",
"print(\"let us assume that heat engine rejects Q2 and Q3 heat to reservior at 300 K and 200 K respectively.let us assume that there are two heat engines operating between 400 K and 300 K temperature reservoirs and between 400 K and 200 K temperature reservoirs.let each heat engine receive Q1_a and Q1_b from reservoir at 400 K as shown below\")\n",
"print(\"thus,Q1_a+Q1_b=Q1=5*10^3 KJ...............eq1\")\n",
"print(\"Also,Q1_a/Q2=400/300,or Q1_a=4*Q2/3...............eq2\")\n",
"print(\"Q1_b/Q3=400/200 or Q1_b=2*Q3...............eq3\")\n",
"print(\"substituting Q1_a and Q1_b in eq 1\")\n",
"print(\"4*Q2/3+2*Q3=5000...............eq4\")\n",
"print(\"also from total work output,Q1_a+Q1_b-Q2-Q3=W\")\n",
"print(\"5000-Q2-Q3=840\")\n",
"print(\"so Q2+Q3=5000-840=4160\")\n",
"print(\"Q3=4160-Q2\")\n",
"print(\"sunstituting Q3 in eq 4\")\n",
"print(\"4*Q2/3+2*(4160-Q2)=5000\")\n",
"Q2=(5000.-2.*4160.)/((4./3.)-2.)\n",
"print(\"so Q2=in KJ\"),round(Q2,2)\n",
"Q3=4160.-Q2\n",
"print(\"and Q3= in KJ\"),round(-Q3,2)\n",
"print(\"here negative sign with Q3 shows that the assumed direction of heat is not correct and actually Q3 heat will flow from reservoir to engine.actual sign of heat transfers and magnitudes are as under:\")\n",
"print(\"Q2=4980 KJ,from heat engine\")\n",
"print(\"Q3=820 KJ,to heat engine\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.13;pg no: 123"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.13, Page:123 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 13\n",
"arrangement for heat pump and heat engine operating togrther is shown here.engine and pump both reject heat to reservoir at 77 degree celcius(350 K)\n",
"for heat engine\n",
"ne=W/Q1=1-T2/T1\n",
"so (Q1-Q2)/Q1=\n",
"and Q2/Q1=\n",
"Q2=0.2593*Q1\n",
"for heat pump,\n",
"COP_HP=Q4/(Q4-Q3)=T4/(T4-T3)\n",
"Q4/Q3=\n",
"Q4=1.27*Q3\n",
"work output from engine =work input to pump\n",
"Q1-Q2=Q4-Q3=>Q1-0.2593*Q1=Q4-Q4/1.27\n",
"so Q4/Q1=\n",
"so Q4=3.484*Q1\n",
"also it is given that Q2+Q4=100\n",
"subtituting Q2 and Q4 as function of Q1 in following expression,\n",
"Q2+Q4=100\n",
"so 0.2539*Q1+3.484*Q1=100\n",
"so energy taken by engine from reservoir at 1077 degree celcius(Q1)in KJ\n",
"Q1=100/(0.2539+3.484)in KJ 26.75\n",
"NOTE=>In this question expression for calculating Q1 is written wrong in book which is corrected above.\n"
]
}
],
"source": [
"#cal of energy taken by engine from reservoir\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.13, Page:123 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 13\")\n",
"T2=(77+273);#temperature of reservoir 2\n",
"T1=(1077+273);#temperature of reservoir 1\n",
"T3=(3+273);#temperature of reservoir 3\n",
"print(\"arrangement for heat pump and heat engine operating togrther is shown here.engine and pump both reject heat to reservoir at 77 degree celcius(350 K)\")\n",
"print(\"for heat engine\")\n",
"print(\"ne=W/Q1=1-T2/T1\")\n",
"print(\"so (Q1-Q2)/Q1=\")\n",
"1-T2/T1\n",
"print(\"and Q2/Q1=\")\n",
"1-0.7407\n",
"print(\"Q2=0.2593*Q1\")\n",
"print(\"for heat pump,\")\n",
"print(\"COP_HP=Q4/(Q4-Q3)=T4/(T4-T3)\")\n",
"T4=T2;\n",
"T4/(T4-T3)\n",
"print(\"Q4/Q3=\")\n",
"4.73/3.73\n",
"print(\"Q4=1.27*Q3\")\n",
"print(\"work output from engine =work input to pump\")\n",
"print(\"Q1-Q2=Q4-Q3=>Q1-0.2593*Q1=Q4-Q4/1.27\")\n",
"print(\"so Q4/Q1=\")\n",
"(1-0.2593)/(1-(1/1.27))\n",
"print(\"so Q4=3.484*Q1\")\n",
"print(\"also it is given that Q2+Q4=100\")\n",
"print(\"subtituting Q2 and Q4 as function of Q1 in following expression,\")\n",
"print(\"Q2+Q4=100\")\n",
"print(\"so 0.2539*Q1+3.484*Q1=100\")\n",
"print(\"so energy taken by engine from reservoir at 1077 degree celcius(Q1)in KJ\")\n",
"Q1=100/(0.2539+3.484)\n",
"print(\"Q1=100/(0.2539+3.484)in KJ\"),round(Q1,2)\n",
"print(\"NOTE=>In this question expression for calculating Q1 is written wrong in book which is corrected above.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.14;pg no: 124"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.14, Page:124 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 14\n",
"let temperature of sink be T_sink K\n",
"Q_sink_HE+Q_sink_R=3000 ........eq 1\n",
"since complete work output from engine is used to run refrigerator so,\n",
"2000-Q_sink_HE=Q_sink_R-Q_R .........eq 2\n",
"by eq 1 and eq 2,we get Q_R in KJ/s 1000.0\n",
"also for heat engine,2000/1500=Q_sink_HE/T_sink\n",
"=>Q_sink_HE=4*T_sink/3\n",
"for refrigerator,Q_R/288=Q_sink_R/T_sink=>Q_sink_R=1000*T_sink/288\n",
"substituting Q_sink_HE and Q_sink_R values\n",
"4*T_sink/3+1000*T_sink/288=3000\n",
"so temperature of sink(T_sink)in K\n",
"so T_sink= 750.0\n",
"T_sink in degree celcius 477.0\n"
]
}
],
"source": [
"#cal of T_sink in degree celcius\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.14, Page:124 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 14\")\n",
"Q_source=2000;#heat supplied by heat engine in KJ/s\n",
"T_source=1500;#temperature of source in K\n",
"T_R=(15+273);#temperature of reservoir in K\n",
"Q_sink=3000;#heat received by sink in KJ/s\n",
"print(\"let temperature of sink be T_sink K\")\n",
"print(\"Q_sink_HE+Q_sink_R=3000 ........eq 1\")\n",
"print(\"since complete work output from engine is used to run refrigerator so,\")\n",
"print(\"2000-Q_sink_HE=Q_sink_R-Q_R .........eq 2\")\n",
"Q_R=3000-2000\n",
"print(\"by eq 1 and eq 2,we get Q_R in KJ/s\"),round(Q_R)\n",
"print(\"also for heat engine,2000/1500=Q_sink_HE/T_sink\")\n",
"print(\"=>Q_sink_HE=4*T_sink/3\")\n",
"print(\"for refrigerator,Q_R/288=Q_sink_R/T_sink=>Q_sink_R=1000*T_sink/288\")\n",
"print(\"substituting Q_sink_HE and Q_sink_R values\")\n",
"print(\"4*T_sink/3+1000*T_sink/288=3000\")\n",
"print(\"so temperature of sink(T_sink)in K\")\n",
"T_sink=3000/((4/3)+(1000/288))\n",
"print(\"so T_sink=\"),round(T_sink,2)\n",
"T_sink=T_sink-273\n",
"print(\"T_sink in degree celcius\"),round(T_sink,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.15;pg no: 124"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.15, Page:124 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 15\n",
"let the output of heat engine be W.so W/3 is consumed for driving auxiliary and remaining 2*W/3 is consumed for driving heat pump for heat engine,\n",
"n=W/Q1= 0.39\n",
"so n=W/Q1=0.3881\n",
"COP of heat pump=T3/(T3-T2)=Q3/(2*W/3) 2.89\n",
"so 2.892=3*Q3/2*W\n",
"Q3/Q1= 0.7483\n",
"so ratio of heat rejected to body at 450 degree celcius to the heat supplied by the reservoir=0.7482\n"
]
}
],
"source": [
"#cal of heat transferred to refrigerant and low temperature reservoir\n",
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.15, Page:124 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 15\")\n",
"T1=(500.+273.);#temperature of source in K\n",
"T2=(200.+273.);#temperature of sink in K\n",
"T3=(450.+273.);#temperature of body in K\n",
"print(\"let the output of heat engine be W.so W/3 is consumed for driving auxiliary and remaining 2*W/3 is consumed for driving heat pump for heat engine,\")\n",
"n=1-(T2/T1)\n",
"print(\"n=W/Q1=\"),round(n,2)\n",
"print(\"so n=W/Q1=0.3881\")\n",
"COP=T3/(T3-T2)\n",
"print(\"COP of heat pump=T3/(T3-T2)=Q3/(2*W/3)\"),round(COP,2)\n",
"print(\"so 2.892=3*Q3/2*W\")\n",
"print(\"Q3/Q1=\"),round(2*COP*n/3,4)\n",
"print(\"so ratio of heat rejected to body at 450 degree celcius to the heat supplied by the reservoir=0.7482\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.16;pg no: 125"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.16, Page:125 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 16\n",
"NOTE=>In question no. 16,condition for minimum surface area for a given work output is determine which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.16, Page:125 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 16\")\n",
"print(\"NOTE=>In question no. 16,condition for minimum surface area for a given work output is determine which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 4.17;pg no: 126"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 4.17, Page:126 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 17\n",
"NOTE=>In question no. 17 expression for (minimum theoretical ratio of heat supplied from source to heat absorbed from cold body) is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 4\n",
"print\"Example 4.17, Page:126 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 4 Example 17\")\n",
"print(\"NOTE=>In question no. 17 expression for (minimum theoretical ratio of heat supplied from source to heat absorbed from cold body) is derived which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
IIF?+++Engineering Thermodynamics/chapter5_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 5:Entropy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.1;pg no: 144"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.1, Page:144 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 1\n",
"entropy change may be given as,\n",
"s2-s1=((Cp_air*log(T2/T1)-(R*log(p2/p1))\n",
"here for throttling process h1=h2=>Cp_air*T1=Cp_air*T2=>T1=T2\n",
"so change in entropy(deltaS)in KJ/kg K\n",
"deltaS= 0.263\n"
]
}
],
"source": [
"#cal of deltaS\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.1, Page:144 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 1\")\n",
"p1=5.;#initial pressure of air\n",
"T1=(27.+273.);#temperature of air in K\n",
"p2=2.;#final pressure of air in K\n",
"R=0.287;#gas constant in KJ/kg K\n",
"Cp_air=1.004;#specific heat of air at constant pressure in KJ/kg K\n",
"print(\"entropy change may be given as,\")\n",
"print(\"s2-s1=((Cp_air*log(T2/T1)-(R*log(p2/p1))\")\n",
"print(\"here for throttling process h1=h2=>Cp_air*T1=Cp_air*T2=>T1=T2\")\n",
"print(\"so change in entropy(deltaS)in KJ/kg K\")\n",
"deltaS=(Cp_air*0)-(R*math.log(p2/p1))\n",
"print(\"deltaS=\"),round(deltaS,3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.2;pg no: 144"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.2, Page:144 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 2\n",
"total entropy change=entropy change during water temperature rise(deltaS1)+entropy change during water to steam change(deltaS2)+entropy change during steam temperature rise(deltaS3)\n",
"deltaS1=Q1/T1,where Q1=m*Cp*deltaT\n",
"heat added for increasing water temperature from 27 to 100 degree celcius(Q1)in KJ\n",
"Q1= 1533.0\n",
"deltaS1=Q1/T1 in KJ/K 5.11\n",
"now heat of vaporisation(Q2)=in KJ 11300.0\n",
"entropy change during phase transformation(deltaS2)in KJ/K\n",
"deltaS2= 30.29\n",
"entropy change during steam temperature rise(deltaS3)in KJ/K\n",
"deltaS3=m*Cp_steam*dT/T\n",
"here Cp_steam=R*(3.5+1.2*T+0.14*T^2)*10^-3 in KJ/kg K\n",
"R=in KJ/kg K 0.46\n",
"now deltaS3=(m*R*(3.5+1.2*T+0.14*T^2)*10^-3)*dT/T in KJ/K\n",
"total entropy change(deltaS) in KJ/K= 87.24\n"
]
}
],
"source": [
"#cal of COP\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.2, Page:144 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 2\")\n",
"import scipy\n",
"from scipy import integrate\n",
"##just an example function\n",
"def fun1(x):\n",
"\ty=x*x\n",
"\treturn y\n",
"\n",
"T1=(27.+273.);#temperature of water in K\n",
"T2=(100.+273.);#steam temperature of water in K\n",
"m=5.;#mass of water in kg\n",
"q=2260.;#heat of vaporisation at 100 degree celcius in KJ/kg\n",
"Cp=4.2;#specific heat of water at constant pressure in KJ/kg K\n",
"M=18.;#molar mass for water/steam \n",
"R1=8.314;#gas constant in KJ/kg K\n",
"print(\"total entropy change=entropy change during water temperature rise(deltaS1)+entropy change during water to steam change(deltaS2)+entropy change during steam temperature rise(deltaS3)\")\n",
"Q1=m*Cp*(T2-T1)\n",
"print(\"deltaS1=Q1/T1,where Q1=m*Cp*deltaT\")\n",
"print(\"heat added for increasing water temperature from 27 to 100 degree celcius(Q1)in KJ\")\n",
"print(\"Q1=\"),round(Q1,2)\n",
"deltaS1=Q1/T1\n",
"print(\"deltaS1=Q1/T1 in KJ/K\"),round(deltaS1,2)\n",
"Q2=m*q\n",
"print(\"now heat of vaporisation(Q2)=in KJ\"),round(Q2,2)\n",
"print(\"entropy change during phase transformation(deltaS2)in KJ/K\")\n",
"deltaS2=Q2/T2\n",
"print(\"deltaS2=\"),round(deltaS2,2)\n",
"print(\"entropy change during steam temperature rise(deltaS3)in KJ/K\")\n",
"print(\"deltaS3=m*Cp_steam*dT/T\")\n",
"print(\"here Cp_steam=R*(3.5+1.2*T+0.14*T^2)*10^-3 in KJ/kg K\")\n",
"R=R1/M\n",
"print(\"R=in KJ/kg K\"),round(R,2)\n",
"T2=(100+273.15);#steam temperature of water in K\n",
"T3=(400+273.15);#temperature of steam in K\n",
"print(\"now deltaS3=(m*R*(3.5+1.2*T+0.14*T^2)*10^-3)*dT/T in KJ/K\")\n",
"#function y = f(T), y =(m*R*(3.5+1.2*T+0.14*T**2)*10**-3)/T , endfunction\n",
"def fun1(x):\n",
"\ty=(m*R*(3.5+1.2*T+0.14*T**2)*10**-3)/T\n",
"\treturn y\n",
"\n",
"#deltaS3 =scipy.integrate.quad(f,T2, T3) \n",
"deltaS3=51.84;#approximately\n",
"deltaS=deltaS1+deltaS2+deltaS3\n",
"print(\"total entropy change(deltaS) in KJ/K=\"),round(deltaS,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.3;pg no: 145"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.3, Page:145 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 3\n",
"gas constant for oxygen(R)in KJ/kg K\n",
"R= 0.26\n",
"for reversible process the change in entropy may be given as\n",
"deltaS=(Cp*log(T2/T1))-(R*log(p2/p1))in KJ/kg K\n",
"so entropy change=deltaS= in (KJ/kg K) -0.29\n"
]
}
],
"source": [
"#cal of entropy change\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.3, Page:145 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 3\")\n",
"R1=8.314;#gas constant in KJ/kg K\n",
"M=32;#molar mass for O2 \n",
"T1=(27+273);#initial temperature of O2 in K\n",
"p1=125;#initial pressure of O2 in Kpa\n",
"p2=375;#final pressure of O2 in Kpa\n",
"Cp=1.004;#specific heat of air at constant pressure in KJ/kg K\n",
"print(\"gas constant for oxygen(R)in KJ/kg K\")\n",
"R=R1/M\n",
"print(\"R=\"),round(R,2)\n",
"print(\"for reversible process the change in entropy may be given as\")\n",
"print(\"deltaS=(Cp*log(T2/T1))-(R*log(p2/p1))in KJ/kg K\")\n",
"T2=T1;#isothermal process\n",
"deltaS=(Cp*math.log(T2/T1))-(R*math.log(p2/p1))\n",
"print(\"so entropy change=deltaS= in (KJ/kg K)\"),round(deltaS,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.4;pg no: 145"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.4, Page:145 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 4\n",
"entropy change in universe(deltaS_universe)=deltaS_block+deltaS_water\n",
"where deltaS_block=m*C*log(T2/T1)\n",
"here hot block is put into sea water,so block shall cool down upto sea water at 25 degree celcius as sea may be treated as sink\n",
"therefore deltaS_block=in KJ/K -0.14\n",
"heat loss by block =heat gained by water(Q)in KJ\n",
"Q=-m*C*(T1-T2) -49.13\n",
"therefore deltaS_water=-Q/T2 in KJ/K 0.16\n",
"thus deltaS_universe=in J/K 27.16\n"
]
}
],
"source": [
"#cal of deltaS_universe\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.4, Page:145 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 4\")\n",
"T1=(150+273.15);#temperature of copper block in K\n",
"T2=(25+273.15);#temperature of sea water in K\n",
"m=1;#mass of copper block in kg\n",
"C=0.393;#heat capacity of copper in KJ/kg K\n",
"print(\"entropy change in universe(deltaS_universe)=deltaS_block+deltaS_water\")\n",
"print(\"where deltaS_block=m*C*log(T2/T1)\")\n",
"print(\"here hot block is put into sea water,so block shall cool down upto sea water at 25 degree celcius as sea may be treated as sink\")\n",
"deltaS_block=m*C*math.log(T2/T1)\n",
"print(\"therefore deltaS_block=in KJ/K\"),round(deltaS_block,2)\n",
"print(\"heat loss by block =heat gained by water(Q)in KJ\")\n",
"Q=-m*C*(T1-T2)\n",
"print(\"Q=-m*C*(T1-T2)\"),round(Q,2)\n",
"deltaS_water=-Q/T2\n",
"print(\"therefore deltaS_water=-Q/T2 in KJ/K\"),round(deltaS_water,2)\n",
"deltaS_universe=(deltaS_block+deltaS_water)*1000\n",
"print(\"thus deltaS_universe=in J/K\"),round(deltaS_universe,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.5;pg no: 146"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.5, Page:146 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 5\n",
"deltaS_universe=(deltaS_block+deltaS_seawater)\n",
"since block and sea water both are at same temperature so,\n",
"deltaS_universe=deltaS_seawater\n",
"conservation of energy equation yields,\n",
"Q-W=deltaU+deltaP.E+deltaK.E\n",
"since in this case,W=0,deltaK.E=0,deltaU=0\n",
"Q=deltaP.E\n",
"change in potential energy=deltaP.E=m*g*h in J\n",
"deltaS_universe=deltaS_seawater=Q/T in J/kg K\n",
"entropy change of universe(deltaS_universe)in J/kg K 6.54\n"
]
}
],
"source": [
"#cal of entropy change of universe\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.5, Page:146 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 5\")\n",
"m=1;#mass of copper block in kg\n",
"T=(27+273);#temperature of copper block in K\n",
"h=200;#height from which copper block dropped in sea water in m\n",
"C=0.393;#heat capacity for copper in KJ/kg K\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"deltaS_universe=(deltaS_block+deltaS_seawater)\")\n",
"print(\"since block and sea water both are at same temperature so,\")\n",
"print(\"deltaS_universe=deltaS_seawater\")\n",
"print(\"conservation of energy equation yields,\")\n",
"print(\"Q-W=deltaU+deltaP.E+deltaK.E\")\n",
"print(\"since in this case,W=0,deltaK.E=0,deltaU=0\")\n",
"deltaPE=m*g*h\n",
"Q=deltaPE\n",
"print(\"Q=deltaP.E\")\n",
"print(\"change in potential energy=deltaP.E=m*g*h in J\")\n",
"print(\"deltaS_universe=deltaS_seawater=Q/T in J/kg K\")\n",
"deltaS_universe=Q/T\n",
"print(\"entropy change of universe(deltaS_universe)in J/kg K\"),round(deltaS_universe,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.6;pg no: 146"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.6, Page:146 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 6\n",
"here deltaS_universe=deltaS_block1+deltaS_block2\n",
"two blocks at different temperatures shall first attain equilibrium temperature.let equilibrium temperature be Tf\n",
"then from energy conservation\n",
"m1*Cp_1*(T1-Tf)=m2*Cp_2*(Tf-T2)\n",
"Tf=in K 374.18\n",
"hence,entropy change in block 1(deltaS1),due to temperature changing from Tf to T1\n",
"deltaS1=in KJ/K -0.05\n",
"entropy change in block 2(deltaS2)in KJ/K\n",
"deltaS2= 0.06\n",
"entropy change of universe(deltaS)=in KJ/K 0.01\n"
]
}
],
"source": [
"#cal of entropy change of universe\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.6, Page:146 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 6\")\n",
"m1=1;#mass of first copper block in kg\n",
"m2=0.5;#mass of second copper block in kg\n",
"T1=(150+273.15);#temperature of first copper block in K\n",
"T2=(0+273.15);#temperature of second copper block in K\n",
"Cp_1=0.393;#heat capacity for copper block 1 in KJ/kg K\n",
"Cp_2=0.381;#heat capacity for copper block 2 in KJ/kg K\n",
"print(\"here deltaS_universe=deltaS_block1+deltaS_block2\")\n",
"print(\"two blocks at different temperatures shall first attain equilibrium temperature.let equilibrium temperature be Tf\")\n",
"print(\"then from energy conservation\")\n",
"print(\"m1*Cp_1*(T1-Tf)=m2*Cp_2*(Tf-T2)\")\n",
"Tf=((m1*Cp_1*T1)+(m2*Cp_2*T2))/(m1*Cp_1+m2*Cp_2)\n",
"print(\"Tf=in K\"),round(Tf,2)\n",
"print(\"hence,entropy change in block 1(deltaS1),due to temperature changing from Tf to T1\")\n",
"deltaS1=m1*Cp_1*math.log(Tf/T1)\n",
"print(\"deltaS1=in KJ/K\"),round(deltaS1,2)\n",
"print(\"entropy change in block 2(deltaS2)in KJ/K\")\n",
"deltaS2=m2*Cp_2*math.log(Tf/T2)\n",
"print(\"deltaS2=\"),round(deltaS2,2)\n",
"deltaS=deltaS1+deltaS2\n",
"print(\"entropy change of universe(deltaS)=in KJ/K\"),round(deltaS,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.7;pg no: 147"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.7, Page:147 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 7\n",
"NOTE=>in this question formula is derived which cannot be solve using python software\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.7, Page:147 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 7\")\n",
"print(\"NOTE=>in this question formula is derived which cannot be solve using python software\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.8;pg no: 148"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.8, Page:148 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 8\n",
"for irreversible operation of engine,\n",
"rate of entropy generation=Q1/T1+Q2/T2\n",
"W=Q1-Q2=>Q2=Q1-W in MW 3.0\n",
"entropy generated(deltaS_gen)in MW\n",
"deltaS_gen= 0.01\n",
"work lost(W_lost)in MW\n",
"W_lost=T2*deltaS_gen 4.0\n"
]
}
],
"source": [
"#cal of work lost\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.8, Page:148 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 8\")\n",
"T1=1800.;#temperature of high temperature reservoir in K\n",
"T2=300.;#temperature of low temperature reservoir in K\n",
"Q1=5.;#heat addition in MW\n",
"W=2.;#work done in MW\n",
"print(\"for irreversible operation of engine,\")\n",
"print(\"rate of entropy generation=Q1/T1+Q2/T2\")\n",
"Q2=Q1-W\n",
"print(\"W=Q1-Q2=>Q2=Q1-W in MW\"),round(Q2,2)\n",
"print(\"entropy generated(deltaS_gen)in MW\")\n",
"deltaS_gen=Q1/T1+Q2/T2\n",
"print(\"deltaS_gen=\"),round(deltaS_gen,2)\n",
"Q1=-5;#heat addition in MW\n",
"print(\"work lost(W_lost)in MW\")\n",
"W_lost=T2*deltaS_gen\n",
"print(\"W_lost=T2*deltaS_gen\"),round(W_lost)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.9;pg no: 148"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.9, Page:148 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 9\n",
"system and reservoir can be treated as source and sink.device thought of can be a carnot engine operating between these two limits.maximum heat available from system shall be the heat rejected till its temperature drops from 500 K to 300 K\n",
"therefore,maximum heat(Q1)=(C*dT)in J\n",
"here C=0.05*T^2+0.10*T+0.085 in J/K\n",
"so Q1=(0.05*T^2+0.10*T+0.085)*dT\n",
"entropy change of system,deltaS_system=C*dT/T in J/K\n",
"so deltaS_system=(0.05*T^2+0.10*T+0.085)*dT/T\n",
"deltaS_reservoir=Q2/T2=(Q1-W)/T2 also,we know from entropy principle,deltaS_universe is greater than equal to 0\n",
"deltaS_universe=deltaS_system+deltaS_reservoir\n",
"thus,upon substituting,deltaS_system+deltaS_reservoir is greater than equal to 0\n",
"W is less than or equal to(Q1+deltaS_system*T2)/1000 in KJ\n",
"hence maximum work in KJ= 435.34\n"
]
}
],
"source": [
"#cal of COP\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.9, Page:148 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 9\")\n",
"import scipy\n",
"from scipy import integrate\n",
"\n",
"def fun1(x):\n",
"\ty=x*x\n",
"\treturn y\n",
"\n",
"T1=500;#temperature of system in K\n",
"T2=300;#temperature of reservoir in K\n",
"print(\"system and reservoir can be treated as source and sink.device thought of can be a carnot engine operating between these two limits.maximum heat available from system shall be the heat rejected till its temperature drops from 500 K to 300 K\")\n",
"print(\"therefore,maximum heat(Q1)=(C*dT)in J\")\n",
"print(\"here C=0.05*T^2+0.10*T+0.085 in J/K\")\n",
"print(\"so Q1=(0.05*T^2+0.10*T+0.085)*dT\")\n",
"T=T1-T2\n",
"#Q1=(0.05*T**2+0.10*T+0.085)*dT\n",
"#function y = f(T), y = (0.05*T**2+0.10*T+0.085),endfunction\n",
"#Q1 = scipy.integrate.quad(fun1,T1, T2)\n",
"#Q1=-Q1\n",
"Q1=1641.35*10**3\n",
"print(\"entropy change of system,deltaS_system=C*dT/T in J/K\")\n",
"print(\"so deltaS_system=(0.05*T^2+0.10*T+0.085)*dT/T\")\n",
"#function y = k(T), y = (0.05*T**2+0.10*T+0.085)/T,endfunction\n",
"def fun1(x):\n",
"\ty = (0.05*T**2+0.10*T+0.085)/T\n",
"\treturn y\n",
"\n",
"#deltaS_system = scipy.integrate.quad(k,T1, T2)\n",
"deltaS_system=-4020.043\n",
"print(\"deltaS_reservoir=Q2/T2=(Q1-W)/T2\"),\n",
"print(\"also,we know from entropy principle,deltaS_universe is greater than equal to 0\")\n",
"print(\"deltaS_universe=deltaS_system+deltaS_reservoir\")\n",
"print(\"thus,upon substituting,deltaS_system+deltaS_reservoir is greater than equal to 0\")\n",
"print(\"W is less than or equal to(Q1+deltaS_system*T2)/1000 in KJ\")\n",
"W=(Q1+deltaS_system*T2)/1000\n",
"print(\"hence maximum work in KJ=\"),round(W,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.10;pg no: 149"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.10, Page:46 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 10\n",
"for reversible adiabatic process governing equation for expansion,\n",
"P*V**1.4=constant\n",
"also,for such process entropy change=0\n",
"using p2/p1=(v1/v2)**1.4 or v=(p1*(v1**1.4)/p)**(1/1.4)\n",
"final pressure(p2)in Mpa\n",
"p2= 0.24\n",
"from first law,second law and definition of enthalpy;\n",
"dH=T*dS+v*dP\n",
"for adiabatic process of reversible type,dS=0\n",
"so dH=v*dP\n",
"integrating both side H2-H1=deltaH=v*dP in KJ\n",
"so enthalpy change(deltaH)in KJ=268.8\n",
"and entropy change=0\n"
]
}
],
"source": [
"#cal of deltaS\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"\n",
"print\"Example 5.10, Page:46 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 10\")\n",
"import scipy\n",
"from scipy import integrate\n",
"\n",
"def fun1(x):\n",
"\ty=x*x\n",
"\treturn y\n",
"\n",
"p1=3.;#initial pressure in Mpa\n",
"v1=0.05;#initial volume in m**3\n",
"v2=0.3;#final volume in m**3\n",
"print(\"for reversible adiabatic process governing equation for expansion,\")\n",
"print(\"P*V**1.4=constant\")\n",
"print(\"also,for such process entropy change=0\")\n",
"print(\"using p2/p1=(v1/v2)**1.4 or v=(p1*(v1**1.4)/p)**(1/1.4)\")\n",
"print(\"final pressure(p2)in Mpa\")\n",
"p2=p1*(v1/v2)**1.4\n",
"print(\"p2=\"),round(p2,2)\n",
"print(\"from first law,second law and definition of enthalpy;\")\n",
"print(\"dH=T*dS+v*dP\")\n",
"print(\"for adiabatic process of reversible type,dS=0\")\n",
"dS=0;#for adiabatic process of reversible type\n",
"print(\"so dH=v*dP\")\n",
"print(\"integrating both side H2-H1=deltaH=v*dP in KJ\")\n",
"p1=3.*1000.;#initial pressure in Kpa\n",
"p2=244.;#final pressure in Kpa\n",
"#function y = f(p), y =(p1*(v1**1.4)/p)**(1/1.4)\n",
"def fun1(x):\n",
"\ty=(p1*(v1**1.4)/p2)**(1/1.4)\n",
"\treturn y\n",
"\n",
"deltaH = scipy.integrate.quad(fun1,p2,p1)\n",
"print (\"so enthalpy change(deltaH)in KJ=268.8\")\n",
"print(\"and entropy change=0\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.11;pg no: 150"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.11, Page:150 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 11\n",
"during free expansion temperature remains same and it is an irreversible process.for getting change in entropy let us approximate this expansion process as a reversible isothermal expansion\n",
"a> change in entropy of air(deltaS_air)in J/K\n",
"deltaS_air= 1321.68\n",
"b> during free expansion on heat is gained or lost to surrounding so,\n",
"deltaS_surrounding=0\n",
"entropy change of surroundings=0\n",
"c> entropy change of universe(deltaS_universe)in J/K\n",
"deltaS_universe= 1321.68\n"
]
}
],
"source": [
"#cal of deltaS_universe\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.11, Page:150 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 11\")\n",
"m=2;#mass of air in kg\n",
"v1=1;#initial volume of air in m^3\n",
"v2=10;#final volume of air in m^3\n",
"R=287;#gas constant in J/kg K\n",
"print(\"during free expansion temperature remains same and it is an irreversible process.for getting change in entropy let us approximate this expansion process as a reversible isothermal expansion\")\n",
"print(\"a> change in entropy of air(deltaS_air)in J/K\")\n",
"deltaS_air=m*R*math.log(v2/v1)\n",
"print(\"deltaS_air=\"),round(deltaS_air,2)\n",
"print(\"b> during free expansion on heat is gained or lost to surrounding so,\")\n",
"print(\"deltaS_surrounding=0\")\n",
"print(\"entropy change of surroundings=0\")\n",
"deltaS_surrounding=0;#entropy change of surroundings\n",
"print(\"c> entropy change of universe(deltaS_universe)in J/K\")\n",
"deltaS_universe=deltaS_air+deltaS_surrounding\n",
"print(\"deltaS_universe=\"),round(deltaS_universe,2)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"##example 5.12;pg no: 150"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.12, Page:150 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 12\n",
"let initial and final states be denoted by 1 and 2\n",
"for poly tropic process pressure and temperature can be related as\n",
"(p2/p1)^((n-1)/n)=T2/T1\n",
"so temperature after compression(T2)=in K 1128.94\n",
"substituting in entropy change expression for polytropic process,\n",
"entropy change(deltaS)inKJ/kg K\n",
"deltaS= -0.24454\n",
"NOTE=>answer given in book i.e -244.54 KJ/kg K is incorrect,correct answer is -.24454 KJ/kg K\n",
"total entropy change(deltaS)=in J/K -122.27\n"
]
}
],
"source": [
"#cal of total entropy change\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.12, Page:150 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 12\")\n",
"m=0.5;#mass of air in kg\n",
"p1=1.013*10**5;#initial pressure of air in pa\n",
"p2=0.8*10**6;#final pressure of air in pa\n",
"T1=800;#initial temperature of air in K\n",
"n=1.2;#polytropic expansion constant\n",
"y=1.4;#expansion constant for air\n",
"Cv=0.71;#specific heat at constant volume in KJ/kg K\n",
"print(\"let initial and final states be denoted by 1 and 2\")\n",
"print(\"for poly tropic process pressure and temperature can be related as\")\n",
"print(\"(p2/p1)^((n-1)/n)=T2/T1\")\n",
"T2=T1*(p2/p1)**((n-1)/n)\n",
"print(\"so temperature after compression(T2)=in K\"),round(T2,2)\n",
"print(\"substituting in entropy change expression for polytropic process,\") \n",
"print(\"entropy change(deltaS)inKJ/kg K\")\n",
"deltaS=Cv*((n-y)/(n-1))*math.log(T2/T1)\n",
"print(\"deltaS=\"),round(deltaS,5)\n",
"print(\"NOTE=>answer given in book i.e -244.54 KJ/kg K is incorrect,correct answer is -.24454 KJ/kg K\")\n",
"deltaS=m*deltaS*1000\n",
"print(\"total entropy change(deltaS)=in J/K\"),round(deltaS,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.13;pg no: 151"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.13, Page:151 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 13\n",
"NOTE=>In question no. 13,formula for maximum work is derived which cannot be solve using python software\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.13, Page:151 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 13\")\n",
"print(\"NOTE=>In question no. 13,formula for maximum work is derived which cannot be solve using python software\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.14;pg no: 152"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.14, Page:152 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 14\n",
"clausius inequality can be used for cyclic process as given below;consider 1 for source and 2 for sink\n",
"K=dQ/T=Q1/T1-Q2/T2\n",
"i> for Q2=200 kcal/s\n",
"K=in kcal/s K 0.0\n",
"as K is not greater than 0,therefore under these conditions engine is not possible\n",
"ii> for Q2=400 kcal/s\n",
"K=in kcal/s K -1.0\n",
"as K is less than 0,so engine is feasible and cycle is reversible\n",
"iii> for Q2=250 kcal/s\n",
"K=in kcal/s K 0.0\n",
"as K=0,so engine is feasible and cycle is reversible\n"
]
}
],
"source": [
"#cal of deltaS\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.14, Page:152 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 14\")\n",
"Q1=500;#heat supplied by source in kcal/s\n",
"T1=600;#temperature of source in K\n",
"T2=300;#temperature of sink in K\n",
"print(\"clausius inequality can be used for cyclic process as given below;consider 1 for source and 2 for sink\")\n",
"print(\"K=dQ/T=Q1/T1-Q2/T2\")\n",
"print(\"i> for Q2=200 kcal/s\")\n",
"Q2=200;#heat rejected by sink in kcal/s\n",
"K=Q1/T1-Q2/T2\n",
"print(\"K=in kcal/s K\"),round(K,2)\n",
"print(\"as K is not greater than 0,therefore under these conditions engine is not possible\")\n",
"print(\"ii> for Q2=400 kcal/s\")\n",
"Q2=400;#heat rejected by sink in kcal/s\n",
"K=Q1/T1-Q2/T2\n",
"print(\"K=in kcal/s K\"),round(K,2)\n",
"print(\"as K is less than 0,so engine is feasible and cycle is reversible\")\n",
"print(\"iii> for Q2=250 kcal/s\")\n",
"Q2=250;#heat rejected by sink in kcal/s\n",
"K=Q1/T1-Q2/T2\n",
"print(\"K=in kcal/s K\"),round(K,2)\n",
"print(\"as K=0,so engine is feasible and cycle is reversible\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.15;pg no: 152"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.15, Page:152 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 15\n",
"let the two points be given as states 1 and 2,\n",
"let us assume flow to be from 1 to 2\n",
"so entropy change(deltaS1_2)=s1-s2=in KJ/kg K -0.0\n",
"deltaS1_2=s1-s2=0.01254 KJ/kg K\n",
"it means s2 > s1 hence the assumption that flow is from 1 to 2 is correct as from second law of thermodynamics the entropy increases in a process i.e s2 is greater than or equal to s1\n",
"hence flow occurs from 1 to 2 i.e from 0.5 MPa,400K to 0.3 Mpa & 350 K\n"
]
}
],
"source": [
"#cal of deltaS\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"import math\n",
"print\"Example 5.15, Page:152 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 15\")\n",
"p1=0.5;#initial pressure of air in Mpa\n",
"T1=400;#initial temperature of air in K\n",
"p2=0.3;#final pressure of air in Mpa\n",
"T2=350;#initial temperature of air in K\n",
"R=0.287;#gas constant in KJ/kg K\n",
"Cp=1.004;#specific heat at constant pressure in KJ/kg K\n",
"print(\"let the two points be given as states 1 and 2,\")\n",
"print(\"let us assume flow to be from 1 to 2\")\n",
"deltaS1_2=Cp*math.log(T1/T2)-R*math.log(p1/p2)\n",
"print(\"so entropy change(deltaS1_2)=s1-s2=in KJ/kg K\"),round(deltaS1_2)\n",
"print(\"deltaS1_2=s1-s2=0.01254 KJ/kg K\")\n",
"print(\"it means s2 > s1 hence the assumption that flow is from 1 to 2 is correct as from second law of thermodynamics the entropy increases in a process i.e s2 is greater than or equal to s1\")\n",
"print(\"hence flow occurs from 1 to 2 i.e from 0.5 MPa,400K to 0.3 Mpa & 350 K\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.16;pg no: 153"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.16, Page:46 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 16\n",
"NOTE=>In question no. 16,value of n is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#cal of deltaS\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.16, Page:46 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 16\")\n",
"print(\"NOTE=>In question no. 16,value of n is derived which cannot be solve using python software.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.17;pg no: 153"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.17, Page:153 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 17\n",
"total heat added(Q)in KJ\n",
"Q= 1800.0\n",
"for heat addition process 1-2\n",
"Q12=T1*(s2-s1)\n",
"deltaS=s2-s1=in KJ/K 2.0\n",
"or heat addition process 3-4\n",
"Q34=T3*(s4-s3)\n",
"deltaS=s4-s3=in KJ/K 2.0\n",
"or heat rejected in process 5-6(Q56)in KJ\n",
"Q56=T5*(s5-s6)=T5*((s2-s1)+(s4-s3))=T5*(deltaS+deltaS)= 1200.0\n",
"net work done=net heat(W_net)in KJ\n",
"W_net=(Q12+Q34)-Q56 600.0\n",
"thermal efficiency of cycle(n)= 0.33\n",
"or n=n*100 % 33.33\n",
"so work done=600 KJ and thermal efficiency=33.33 %\n"
]
}
],
"source": [
"#cal of work done and thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.17, Page:153 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 17\")\n",
"Q12=1000.;#heat added during process 1-2 in KJ\n",
"Q34=800.;#heat added during process 3-4 in KJ\n",
"T1=500.;#operating temperature for process 1-2\n",
"T3=400.;#operating temperature for process 3-4\n",
"T5=300.;#operating temperature for process 5-6\n",
"T2=T1;#isothermal process\n",
"T4=T3;#isothermal process\n",
"T6=T5;#isothermal process\n",
"print(\"total heat added(Q)in KJ\")\n",
"Q=Q12+Q34\n",
"print(\"Q=\"),round(Q,2)\n",
"print(\"for heat addition process 1-2\")\n",
"print(\"Q12=T1*(s2-s1)\")\n",
"deltaS=Q12/T1\n",
"print(\"deltaS=s2-s1=in KJ/K\"),round(deltaS,2)\n",
"print(\"or heat addition process 3-4\")\n",
"print(\"Q34=T3*(s4-s3)\")\n",
"deltaS=Q34/T3\n",
"print(\"deltaS=s4-s3=in KJ/K\"),round(deltaS,2)\n",
"print(\"or heat rejected in process 5-6(Q56)in KJ\")\n",
"Q56=T5*(deltaS+deltaS)\n",
"print(\"Q56=T5*(s5-s6)=T5*((s2-s1)+(s4-s3))=T5*(deltaS+deltaS)=\"),round(Q56,2)\n",
"print(\"net work done=net heat(W_net)in KJ\")\n",
"W_net=(Q12+Q34)-Q56\n",
"print(\"W_net=(Q12+Q34)-Q56\"),round(W_net,2)\n",
"n=W_net/Q\n",
"print(\"thermal efficiency of cycle(n)=\"),round(n,2)\n",
"n=n*100\n",
"print(\"or n=n*100 %\"),round(n,2) \n",
"print(\"so work done=600 KJ and thermal efficiency=33.33 %\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 5.18;pg no: 154"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 5.18, Page:154 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 18\n",
"let heat supplied by reservoir at 800 K,700 K,600 K be Q1_a , Q1_b , Q1_c\n",
"here Q1-Q2=W\n",
"so heat supplied by source(Q1)in KW= 30.0\n",
"also given that,Q1_a=0.7*Q1_b.......eq 1\n",
"Q1_c=Q1-(0.7*Q1_b+Q1_b)\n",
"Q1_c=Q1-1.7*Q1_b........eq 2\n",
"for reversible engine\n",
"Q1_a/T1_a+Q1_b/T1_b+Q1_c/T1_c-Q2/T2=0......eq 3\n",
"substitute eq 1 and eq 2 in eq 3 we get, \n",
"heat supplied by reservoir of 700 K(Q1_b)in KJ/s\n",
"Q1_b= 35.39\n",
"so heat supplied by reservoir of 800 K(Q1_a)in KJ/s\n",
"Q1_a= 24.78\n",
"and heat supplied by reservoir of 600 K(Q1_c)in KJ/s\n",
"Q1_c=Q1-1.7*Q1_b -30.17\n",
"so heat supplied by reservoir at 800 K(Q1_a)= 24.78\n",
"so heat supplied by reservoir at 700 K(Q1_b)= 35.39\n",
"so heat supplied by reservoir at 600 K(Q1_c)= -30.17\n",
"NOTE=>answer given in book for heat supplied by reservoir at 800 K,700 K,600 K i.e Q1_a=61.94 KJ/s,Q1_b=88.48 KJ/s,Q1_c=120.42 KJ/s is wrong hence correct answer is calculated above.\n"
]
}
],
"source": [
"#cal of heat supplied by reservoir at 800,700,600\n",
"#intiation of all variables\n",
"# Chapter 5\n",
"print\"Example 5.18, Page:154 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 5 Example 18\")\n",
"T1_a=800.;#temperature of reservoir a in K\n",
"T1_b=700.;#temperature of reservoir b in K\n",
"T1_c=600.;#temperature of reservoir c in K\n",
"T2=320.;#temperature of sink in K\n",
"W=20.;#work done in KW\n",
"Q2=10.;#heat rejected to sink in KW\n",
"print(\"let heat supplied by reservoir at 800 K,700 K,600 K be Q1_a , Q1_b , Q1_c\")\n",
"print(\"here Q1-Q2=W\")\n",
"Q1=W+Q2\n",
"print(\"so heat supplied by source(Q1)in KW=\"),round(Q1,2)\n",
"print(\"also given that,Q1_a=0.7*Q1_b.......eq 1\")\n",
"print(\"Q1_c=Q1-(0.7*Q1_b+Q1_b)\")\n",
"print(\"Q1_c=Q1-1.7*Q1_b........eq 2\")\n",
"print(\"for reversible engine\")\n",
"print(\"Q1_a/T1_a+Q1_b/T1_b+Q1_c/T1_c-Q2/T2=0......eq 3\")\n",
"print(\"substitute eq 1 and eq 2 in eq 3 we get, \")\n",
"print(\"heat supplied by reservoir of 700 K(Q1_b)in KJ/s\")\n",
"Q1_b=((Q2/T2)-(Q1/T1_c))/((0.7/T1_a)+(1/T1_b)-(1.7/T1_c))\n",
"print(\"Q1_b=\"),round(Q1_b,2)\n",
"print(\"so heat supplied by reservoir of 800 K(Q1_a)in KJ/s\")\n",
"Q1_a=0.7*Q1_b\n",
"print(\"Q1_a=\"),round(Q1_a,2)\n",
"print(\"and heat supplied by reservoir of 600 K(Q1_c)in KJ/s\")\n",
"Q1_c=Q1-1.7*Q1_b\n",
"print(\"Q1_c=Q1-1.7*Q1_b\"),round(Q1_c,2)\n",
"print(\"so heat supplied by reservoir at 800 K(Q1_a)=\"),round(Q1_a,2)\n",
"print(\"so heat supplied by reservoir at 700 K(Q1_b)=\"),round(Q1_b,2)\n",
"print(\"so heat supplied by reservoir at 600 K(Q1_c)=\"),round(Q1_c,2)\n",
"print(\"NOTE=>answer given in book for heat supplied by reservoir at 800 K,700 K,600 K i.e Q1_a=61.94 KJ/s,Q1_b=88.48 KJ/s,Q1_c=120.42 KJ/s is wrong hence correct answer is calculated above.\")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
Iww+Engineering Thermodynamics/chapter6_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 6:Thermo dynamic Properties of pure substance"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.1;pg no: 174"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.1, Page:174 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 1\n",
"NOTE=>In question no. 1 expression for various quantities is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.1, Page:174 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 1\")\n",
"print(\"NOTE=>In question no. 1 expression for various quantities is derived which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.2;pg no: 175"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.2, Page:175 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 2\n",
"during throttling,h1=h2\n",
"at state 2,enthalpy can be seen for superheated steam using Table 4 at 0.05 Mpa and 100 degree celcius\n",
"thus h2=2682.5 KJ/kg\n",
"at state 1,before throttling\n",
"hf_10Mpa=1407.56 KJ/kg\n",
"hfg_10Mpa=1317.1 KJ/kg\n",
"h1=hf_10Mpa+x1*hfg_10Mpa\n",
"dryness fraction(x1)may be given as\n",
"x1= 0.97\n"
]
}
],
"source": [
"#cal of dryness fraction\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.2, Page:175 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 2\")\n",
"print(\"during throttling,h1=h2\")\n",
"print(\"at state 2,enthalpy can be seen for superheated steam using Table 4 at 0.05 Mpa and 100 degree celcius\")\n",
"print(\"thus h2=2682.5 KJ/kg\")\n",
"h2=2682.5;\n",
"print(\"at state 1,before throttling\")\n",
"print(\"hf_10Mpa=1407.56 KJ/kg\")\n",
"hf_10Mpa=1407.56;\n",
"print(\"hfg_10Mpa=1317.1 KJ/kg\")\n",
"hfg_10Mpa=1317.1;\n",
"print(\"h1=hf_10Mpa+x1*hfg_10Mpa\")\n",
"h1=h2;#during throttling\n",
"print(\"dryness fraction(x1)may be given as\")\n",
"x1=(h1-hf_10Mpa)/hfg_10Mpa\n",
"print(\"x1=\"),round(x1,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.3;pg no: 176"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.3, Page:176 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 3\n",
"internal energy(u)=in KJ/kg 2644.0\n"
]
}
],
"source": [
"#cal of internal energy\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.3, Page:176 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 3\")\n",
"h=2848;#enthalpy in KJ/kg\n",
"p=12*1000;#pressure in Kpa\n",
"v=0.017;#specific volume in m^3/kg\n",
"u=h-p*v\n",
"print(\"internal energy(u)=in KJ/kg\"),round(u,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.4;pg no: 176"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.4, Page:176 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 4\n",
"steam state 2 Mpa and 300 degree celcius lies in superheated region as saturation temperature at 2 Mpa is 212.42 degree celcius and hfg=1890.7 KJ/kg\n",
"entropy of unit mass of superheated steam with reference to absolute zero(S)in KJ/kg K\n",
"S= 6.65\n",
"entropy of 5 kg of steam(S)in KJ/K\n",
"S=m*S 33.23\n"
]
}
],
"source": [
"#cal of entropy of 5 kg of steam\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"import math\n",
"print\"Example 6.4, Page:176 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 4\")\n",
"m=5;#mass of steam in kg\n",
"p=2;#pressure of steam in Mpa\n",
"T_superheat=(300+273.15);#temperature of superheat steam in K\n",
"Cp_water=4.18;#specific heat of water at constant pressure in KJ/kg K\n",
"Cp_superheat=2.1;#specific heat of superheat steam at constant pressure in KJ/kg K\n",
"print(\"steam state 2 Mpa and 300 degree celcius lies in superheated region as saturation temperature at 2 Mpa is 212.42 degree celcius and hfg=1890.7 KJ/kg\")\n",
"T_sat=(212.42+273.15);#saturation temperature at 2 Mpa in K\n",
"hfg_2Mpa=1890.7;\n",
"print(\"entropy of unit mass of superheated steam with reference to absolute zero(S)in KJ/kg K\")\n",
"S=Cp_water*math.log(T_sat/273.15)+(hfg_2Mpa/T_sat)+(Cp_superheat*math.log(T_superheat/T_sat))\n",
"print(\"S=\"),round(S,2)\n",
"print(\"entropy of 5 kg of steam(S)in KJ/K\")\n",
"S=m*S\n",
"print(\"S=m*S\"),round(S,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.5;pg no: 176"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.5, Page:176 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 5\n",
"boiling point =110 degree celcius,pressure at which it boils=143.27 Kpa(from steam table,sat. pressure for 110 degree celcius)\n",
"at further depth of 50 cm the pressure(p)in Kpa\n",
"p= 138.37\n",
"boiling point at this depth=Tsat_138.365\n",
"from steam table this temperature=108.866=108.87 degree celcius\n",
"so boiling point = 108.87 degree celcius\n"
]
}
],
"source": [
"#cal of boiling point\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.5, Page:176 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 5\")\n",
"rho=1000;#density of water in kg/m^3\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"h=0.50;#depth from above mentioned level in m\n",
"print(\"boiling point =110 degree celcius,pressure at which it boils=143.27 Kpa(from steam table,sat. pressure for 110 degree celcius)\")\n",
"p_boil=143.27;#pressure at which pond water boils in Kpa\n",
"print(\"at further depth of 50 cm the pressure(p)in Kpa\")\n",
"p=p_boil-((rho*g*h)*10**-3)\n",
"print(\"p=\"),round(p,2)\n",
"print(\"boiling point at this depth=Tsat_138.365\")\n",
"print(\"from steam table this temperature=108.866=108.87 degree celcius\")\n",
"print(\"so boiling point = 108.87 degree celcius\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.6;pg no: 177"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.6, Page:177 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 6\n",
"in a rigid vessel it can be treated as constant volume process.\n",
"so v1=v2\n",
"since final state is given to be critical state,then specific volume at critical point,\n",
"v2=0.003155 m^3/kg\n",
"at 100 degree celcius saturation temperature,from steam table\n",
"vf_100=0.001044 m^3/kg,vg_100=1.6729 m^3/kg\n",
"and vfg_100=in m^3/kg= 1.67\n",
"thus for initial quality being x1\n",
"v1=vf_100+x1*vfg_100\n",
"so x1= 0.001\n",
"mass of water initially=total mass*(1-x1)\n",
"total mass of fluid/water(m) in kg= 158.48\n",
"volume of water(v) in m^3= 0.1655\n"
]
}
],
"source": [
"#cal of mass and volume of water\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.6, Page:177 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 6\")\n",
"V=0.5;#capacity of rigid vessel in m^3\n",
"print(\"in a rigid vessel it can be treated as constant volume process.\")\n",
"print(\"so v1=v2\")\n",
"print(\"since final state is given to be critical state,then specific volume at critical point,\")\n",
"print(\"v2=0.003155 m^3/kg\")\n",
"v2=0.003155;#specific volume at critical point in m^3/kg\n",
"print(\"at 100 degree celcius saturation temperature,from steam table\")\n",
"print(\"vf_100=0.001044 m^3/kg,vg_100=1.6729 m^3/kg\")\n",
"vf_100=0.001044;\n",
"vg_100=1.6729;\n",
"vfg_100=vg_100-vf_100\n",
"print(\"and vfg_100=in m^3/kg=\"),round(vfg_100,2)\n",
"print(\"thus for initial quality being x1\")\n",
"v1=v2;#rigid vessel\n",
"x1=(v1-vf_100)/vfg_100\n",
"print(\"v1=vf_100+x1*vfg_100\")\n",
"print(\"so x1=\"),round(x1,3)\n",
"print(\"mass of water initially=total mass*(1-x1)\")\n",
"m=V/v2\n",
"print(\"total mass of fluid/water(m) in kg=\"),round(m,2)\n",
"v=m*vf_100\n",
"print(\"volume of water(v) in m^3=\"),round(v,4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.7;pg no: 177"
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.7, Page:177 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 7\n",
"on mollier diadram(h-s diagram)the slope of isobaric line may be given as\n",
"(dh/ds)_p=cons =slope of isobar\n",
"from 1st and 2nd law combined;\n",
"T*ds=dh-v*dp\n",
"(dh/ds)_p=cons = T\n",
"here temperature,T=773.15 K\n",
"here slope=(dh/ds))p=cons = 773.15\n"
]
}
],
"source": [
"#cal of slope\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.7, Page:177 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 7\")\n",
"print(\"on mollier diadram(h-s diagram)the slope of isobaric line may be given as\")\n",
"print(\"(dh/ds)_p=cons =slope of isobar\")\n",
"print(\"from 1st and 2nd law combined;\")\n",
"print(\"T*ds=dh-v*dp\")\n",
"print(\"(dh/ds)_p=cons = T\")\n",
"print(\"here temperature,T=773.15 K\")\n",
"print(\"here slope=(dh/ds))p=cons = 773.15\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.8;pg no: 178"
]
},
{
"cell_type": "code",
"execution_count": 75,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.8, Page:178 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 8\n",
"at 0.15Mpa,from steam table;\n",
"hf=467.11 KJ/kg,hg=2693.6 KJ/kg\n",
"and hfg in KJ/kg= 2226.49\n",
"vf=0.001053 m^3/kg,vg=1.1593 m^3/kg\n",
"and vfg in m^3/kg= 1.16\n",
"sf=1.4336 KJ/kg,sg=7.2233 KJ/kg\n",
"and sfg=in KJ/kg K= 5.79\n",
"enthalpy at x=.10(h)in KJ/kg\n",
"h= 689.76\n",
"specific volume,(v)in m^3/kg\n",
"v= 0.12\n",
"entropy (s)in KJ/kg K\n",
"s= 2.01\n"
]
}
],
"source": [
"#cal of entropy\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.8, Page:178 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 8\")\n",
"x=.10;#quality is 10%\n",
"print(\"at 0.15Mpa,from steam table;\")\n",
"print(\"hf=467.11 KJ/kg,hg=2693.6 KJ/kg\")\n",
"hf=467.11;\n",
"hg=2693.6;\n",
"hfg=hg-hf\n",
"print(\"and hfg in KJ/kg=\"),round(hfg,2)\n",
"print(\"vf=0.001053 m^3/kg,vg=1.1593 m^3/kg\")\n",
"vf=0.001053;\n",
"vg=1.1593;\n",
"vfg=vg-vf\n",
"print(\"and vfg in m^3/kg=\"),round(vfg,2)\n",
"print(\"sf=1.4336 KJ/kg,sg=7.2233 KJ/kg\")\n",
"sf=1.4336;\n",
"sg=7.2233;\n",
"sfg=sg-sf\n",
"print(\"and sfg=in KJ/kg K=\"),round(sfg,2)\n",
"print(\"enthalpy at x=.10(h)in KJ/kg\")\n",
"h=hf+x*hfg\n",
"print(\"h=\"),round(h,2)\n",
"print(\"specific volume,(v)in m^3/kg\")\n",
"v=vf+x*vfg\n",
"print(\"v=\"),round(v,2)\n",
"print(\"entropy (s)in KJ/kg K\")\n",
"s=sf+x*sfg\n",
"print(\"s=\"),round(s,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.9;pg no: 178"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.9, Page:178 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 9\n",
"work done during constant pressure process(W)=p1*(V2-V1)in KJ\n",
"now from steam table at p1,vf=0.001127 m^3/kg,vg=0.19444 m^3/kg,uf=761.68 KJ/kg,ufg=1822 KJ/kg\n",
"so v1 in m^3/kg=\n",
"now mass of steam(m) in kg= 0.32\n",
"specific volume at final state(v2)in m^3/kg\n",
"v2= 0.62\n",
"corresponding to this specific volume the final state is to be located for getting the internal energy at final state at 1 Mpa\n",
"v2>vg_1Mpa\n",
"hence state lies in superheated region,from the steam table by interpolation we get temperature as;\n",
"state lies between temperature of 1000 degree celcius and 1100 degree celcius\n",
"so exact temperature at final state(T)in K= 1077.61\n",
"thus internal energy at final state,1 Mpa,1077.61 degree celcius;\n",
"u2=4209.6 KJ/kg\n",
"internal energy at initial state(u1)in KJ/kg\n",
"u1= 2219.28\n",
"from first law of thermodynamics,Q-W=deltaU\n",
"so heat added(Q)=(U2-U1)+W=m*(u2-u1)+W in KJ= 788.83\n"
]
}
],
"source": [
"#cal of heat added\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.9, Page:178 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 9\")\n",
"p1=1*1000;#initial pressure of steam in Kpa\n",
"V1=0.05;#initial volume of steam in m^3\n",
"x1=.8;#dryness fraction is 80%\n",
"V2=0.2;#final volume of steam in m^3\n",
"p2=p1;#constant pressure process\n",
"print(\"work done during constant pressure process(W)=p1*(V2-V1)in KJ\")\n",
"W=p1*(V2-V1)\n",
"print(\"now from steam table at p1,vf=0.001127 m^3/kg,vg=0.19444 m^3/kg,uf=761.68 KJ/kg,ufg=1822 KJ/kg\")\n",
"vf=0.001127;\n",
"vg=0.19444;\n",
"uf=761.68;\n",
"ufg=1822;\n",
"v1=vf+x1*vg\n",
"print(\"so v1 in m^3/kg=\")\n",
"m=V1/v1\n",
"print(\"now mass of steam(m) in kg=\"),round(m,2)\n",
"m=0.32097;#take m=0.32097 approx.\n",
"print(\"specific volume at final state(v2)in m^3/kg\")\n",
"v2=V2/m\n",
"print(\"v2=\"),round(v2,2)\n",
"print(\"corresponding to this specific volume the final state is to be located for getting the internal energy at final state at 1 Mpa\")\n",
"print(\"v2>vg_1Mpa\")\n",
"print(\"hence state lies in superheated region,from the steam table by interpolation we get temperature as;\")\n",
"print(\"state lies between temperature of 1000 degree celcius and 1100 degree celcius\")\n",
"T=1000+((100*(.62311-.5871))/(.6335-.5871))\n",
"print(\"so exact temperature at final state(T)in K=\"),round(T,2)\n",
"print(\"thus internal energy at final state,1 Mpa,1077.61 degree celcius;\")\n",
"print(\"u2=4209.6 KJ/kg\")\n",
"u2=4209.6;\n",
"print(\"internal energy at initial state(u1)in KJ/kg\")\n",
"u1=uf+x1*ufg\n",
"print(\"u1=\"),round(u1,2)\n",
"print(\"from first law of thermodynamics,Q-W=deltaU\")\n",
"Q=m*(u2-u1)+W\n",
"print(\"so heat added(Q)=(U2-U1)+W=m*(u2-u1)+W in KJ=\"),round(Q,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.10;pg no: 179"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.10, Page:179 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 10\n",
"here steam is kept in rigid vessel,therefore its specific volume shall remain constant\n",
"it is superheated steam as Tsat=170.43 degree celcius at 800 Kpa\n",
"from superheated steam table;v1=0.2404 m^3/kg\n",
"at begining of condensation specific volume = 0.2404 m^3/kg\n",
"v2=0.2404 m^3/kg\n",
"this v2 shall be specific volume corresponding to saturated vapour state for condensation.\n",
"thus v2=vg=0.2404 m^3/kg\n",
"looking into steam table vg=0.2404 m^3/kg shall lie between temperature 175 degree celcius(vg=0.2168 m^3/kg)and 170 degree celcius(vg=0.2428 m^3/kg)and pressure 892 Kpa(175 degree celcius)and 791.7 Kpa(170 degree celcius).\n",
"by interpolation,temperature at begining of condensation(T2)in K\n",
"similarily,pressure(p2)in Kpa= 800.96\n"
]
}
],
"source": [
"#cal of pressure\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.10, Page:179 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 10\")\n",
"p1=800;#initial pressure of steam in Kpa\n",
"T1=200;#initial temperature of steam in degree celcius\n",
"print(\"here steam is kept in rigid vessel,therefore its specific volume shall remain constant\")\n",
"print(\"it is superheated steam as Tsat=170.43 degree celcius at 800 Kpa\")\n",
"print(\"from superheated steam table;v1=0.2404 m^3/kg\")\n",
"print(\"at begining of condensation specific volume = 0.2404 m^3/kg\")\n",
"print(\"v2=0.2404 m^3/kg\")\n",
"v2=0.2404;\n",
"print(\"this v2 shall be specific volume corresponding to saturated vapour state for condensation.\")\n",
"print(\"thus v2=vg=0.2404 m^3/kg\")\n",
"vg=v2;\n",
"print(\"looking into steam table vg=0.2404 m^3/kg shall lie between temperature 175 degree celcius(vg=0.2168 m^3/kg)and 170 degree celcius(vg=0.2428 m^3/kg)and pressure 892 Kpa(175 degree celcius)and 791.7 Kpa(170 degree celcius).\")\n",
"print(\"by interpolation,temperature at begining of condensation(T2)in K\")\n",
"T2=175-((175-170)*(0.2404-0.2167))/(0.2428-.2168)\n",
"p=892-(((892-791.7)*(0.2404-0.2168))/(0.2428-0.2168))\n",
"print(\"similarily,pressure(p2)in Kpa=\"),round(p,2)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.11;pg no: 180"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.11, Page:180 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 11\n",
"from 1st and 2nd law;\n",
"T*ds=dh-v*dp\n",
"for isentropic process,ds=0\n",
"hence dh=v*dp\n",
"i.e (h2-h1)=v1*(p2-p1)\n",
"corresponding to initial state of saturated liquid at 30 degree celcius;from steam table;\n",
"p1=4.25 Kpa,vf=v1=0.001004 m^3/kg\n",
"therefore enthalpy change(deltah)=(h2-h1) in KJ/kg= 0.2\n"
]
}
],
"source": [
"#cal of enthalpy change\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.11, Page:180 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 11\")\n",
"p2=200;#feed water pump pressure in Kpa\n",
"print(\"from 1st and 2nd law;\")\n",
"print(\"T*ds=dh-v*dp\")\n",
"print(\"for isentropic process,ds=0\")\n",
"print(\"hence dh=v*dp\")\n",
"print(\"i.e (h2-h1)=v1*(p2-p1)\")\n",
"print(\"corresponding to initial state of saturated liquid at 30 degree celcius;from steam table;\")\n",
"print(\"p1=4.25 Kpa,vf=v1=0.001004 m^3/kg\")\n",
"p1=4.25;\n",
"v1=0.001004;\n",
"deltah=v1*(p2-p1)\n",
"print(\"therefore enthalpy change(deltah)=(h2-h1) in KJ/kg=\"),round(deltah,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.12;pg no: 180"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.12, Page:180 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 12\n",
"from steam table at 150 degree celcius\n",
"vf=0.001091 m^3/kg,vg=0.3928 m^3/kg\n",
"so volume occupied by water(Vw)=3*V/(3+2) in m^3 1.2\n",
"and volume of steam(Vs) in m^3= 0.8\n",
"mass of water(mf)=Vw/Vf in kg 1099.91\n",
"mass of steam(mg)=Vs/Vg in kg 2.04\n",
"total mass in tank(m) in kg= 1101.95\n",
"quality or dryness fraction(x)\n",
"x= 0.002\n",
"NOTE=>answer given in book for mass=1103.99 kg is incorrect and correct answer is 1101.945 which is calculated above.\n"
]
}
],
"source": [
"#cal of quality or dryness fraction\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.12, Page:180 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 12\")\n",
"V=2.;#volume of vessel in m^3\n",
"print(\"from steam table at 150 degree celcius\")\n",
"print(\"vf=0.001091 m^3/kg,vg=0.3928 m^3/kg\")\n",
"Vf=0.001091;\n",
"Vg=0.3928;\n",
"Vw=3*V/(3+2)\n",
"print(\"so volume occupied by water(Vw)=3*V/(3+2) in m^3\"),round(Vw,2)\n",
"Vs=2*V/(3+2)\n",
"print(\"and volume of steam(Vs) in m^3=\"),round(Vs,2)\n",
"mf=Vw/Vf\n",
"print(\"mass of water(mf)=Vw/Vf in kg\"),round(mf,2)\n",
"mg=Vs/Vg\n",
"print(\"mass of steam(mg)=Vs/Vg in kg\"),round(mg,2)\n",
"m=mf+mg\n",
"print(\"total mass in tank(m) in kg=\"),round(m,2)\n",
"print(\"quality or dryness fraction(x)\")\n",
"x=mg/m\n",
"print(\"x=\"),round(x,3)\n",
"print(\"NOTE=>answer given in book for mass=1103.99 kg is incorrect and correct answer is 1101.945 which is calculated above.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.13;pg no: 181"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.13, Page:181 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 13\n",
"fron S.F.S.E on steam turbine;\n",
"W=h1-h2\n",
"initially at 4Mpa,300 degree celcius the steam is super heated so enthalpy from superheated steam or mollier diagram\n",
"h1=2886.2 KJ/kg,s1=6.2285 KJ/kg K\n",
"reversible adiabatic expansion process has entropy remaining constant.on mollier diagram the state 2 can be simply located at intersection of constant temperature line for 50 degree celcius and isentropic expansion line.\n",
"else from steam tables at 50 degree celcius saturation temperature;\n",
"hf=209.33 KJ/kg,sf=0.7038 KJ/kg K\n",
"hfg=2382.7 KJ/kg,sfg=7.3725 KJ/kg K\n",
"here s1=s2,let dryness fraction at 2 be x2\n",
"x2= 0.75\n",
"hence enthalpy at state 2\n",
"h2 in KJ/kg= 1994.84\n",
"steam turbine work(W)in KJ/kg\n",
"W=h1-h2\n",
"so turbine output=W 891.36\n"
]
}
],
"source": [
"#cal of turbine output\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.13, Page:181 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 13\")\n",
"print(\"fron S.F.S.E on steam turbine;\")\n",
"print(\"W=h1-h2\")\n",
"print(\"initially at 4Mpa,300 degree celcius the steam is super heated so enthalpy from superheated steam or mollier diagram\")\n",
"print(\"h1=2886.2 KJ/kg,s1=6.2285 KJ/kg K\")\n",
"h1=2886.2;\n",
"s1=6.2285;\n",
"print(\"reversible adiabatic expansion process has entropy remaining constant.on mollier diagram the state 2 can be simply located at intersection of constant temperature line for 50 degree celcius and isentropic expansion line.\")\n",
"print(\"else from steam tables at 50 degree celcius saturation temperature;\")\n",
"print(\"hf=209.33 KJ/kg,sf=0.7038 KJ/kg K\")\n",
"hf=209.33;\n",
"sf=0.7038;\n",
"print(\"hfg=2382.7 KJ/kg,sfg=7.3725 KJ/kg K\")\n",
"hfg=2382.7;\n",
"sfg=7.3725;\n",
"print(\"here s1=s2,let dryness fraction at 2 be x2\")\n",
"x2=(s1-sf)/sfg\n",
"print(\"x2=\"),round(x2,2)\n",
"print(\"hence enthalpy at state 2\")\n",
"h2=hf+x2*hfg\n",
"print(\"h2 in KJ/kg=\"),round(h2,2)\n",
"print(\"steam turbine work(W)in KJ/kg\")\n",
"W=h1-h2\n",
"print(\"W=h1-h2\")\n",
"print(\"so turbine output=W\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.14;pg no: 181"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.14, Page:181 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 14\n",
"it is constant volume process\n",
"volume of vessel(V)=mass of vapour * specific volume of vapour\n",
"initial specific volume,v1\n",
"v1=vf_100Kpa+x1*vfg_100 in m^3/kg\n",
"at 100 Kpa from steam table;\n",
"hf_100Kpa=417.46 KJ/kg,uf_100Kpa=417.36 KJ/kg,vf_100Kpa=0.001043 m^3/kg,hfg_100Kpa=2258 KJ/kg,ufg_100Kpa=2088.7 KJ/kg,vg_100Kpa=1.6940 m^3/kg\n",
" here vfg_100Kpa= in m^3/kg= 1.69\n",
"so v1= in m^3/kg= 0.85\n",
"and volume of vessel(V) in m^3= 42.38\n",
"enthalpy at 1,h1=hf_100Kpa+x1*hfg_100Kpa in KJ/kg 1546.46\n",
"internal energy in the beginning=U1=m1*u1 in KJ 146171.0\n",
"let the mass of dry steam added be m,final specific volume inside vessel,v2\n",
"v2=vf_1000Kpa+x2*vfg_1000Kpa\n",
"at 2000 Kpa,from steam table,\n",
"vg_2000Kpa=0.09963 m^3/kg,ug_2000Kpa=2600.3 KJ/kg,hg_2000Kpa=2799.5 KJ/kg\n",
"total mass inside vessel=mass of steam at2000 Kpa+mass of mixture at 100 Kpa\n",
"V/v2=V/vg_2000Kpa+V/v1\n",
"so v2 in m^3/kg= 0.09\n",
"here v2=vf_1000Kpa+x2*vfg_1000Kpa in m^3/kg\n",
"at 1000 Kpa from steam table,\n",
"hf_1000Kpa=762.81 KJ/kg,hfg_1000Kpa=2015.3 KJ/kg,vf_1000Kpa=0.001127 m^3/kg,vg_1000Kpa=0.19444 m^3/kg\n",
"here vfg_1000Kpa= in m^3/kg= 0.19\n",
"so x2= 0.46\n",
"for adiabatic mixing,(100+m)*h2=100*h1+m*hg_2000Kpa\n",
"so mass of dry steam at 2000 Kpa to be added(m)in kg\n",
"m=(100*(h1-h2))/(h2-hg_2000Kpa)= 11.97\n",
"quality of final mixture x2= 0.46\n"
]
}
],
"source": [
"#cal of quality of final mixture\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.14, Page:181 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 14\")\n",
"x1=0.5;#dryness fraction \n",
"m1=100;#mass of steam in kg\n",
"v1=0.8475;#\n",
"print(\"it is constant volume process\")\n",
"print(\"volume of vessel(V)=mass of vapour * specific volume of vapour\")\n",
"print(\"initial specific volume,v1\")\n",
"print(\"v1=vf_100Kpa+x1*vfg_100 in m^3/kg\")\n",
"print(\"at 100 Kpa from steam table;\")\n",
"print(\"hf_100Kpa=417.46 KJ/kg,uf_100Kpa=417.36 KJ/kg,vf_100Kpa=0.001043 m^3/kg,hfg_100Kpa=2258 KJ/kg,ufg_100Kpa=2088.7 KJ/kg,vg_100Kpa=1.6940 m^3/kg\")\n",
"hf_100Kpa=417.46;\n",
"uf_100Kpa=417.36;\n",
"vf_100Kpa=0.001043;\n",
"hfg_100Kpa=2258;\n",
"ufg_100Kpa=2088.7;\n",
"vg_100Kpa=1.6940;\n",
"vfg_100Kpa=vg_100Kpa-vf_100Kpa\n",
"print(\" here vfg_100Kpa= in m^3/kg=\"),round(vfg_100Kpa,2)\n",
"v1=vf_100Kpa+x1*vfg_100Kpa\n",
"print(\"so v1= in m^3/kg=\"),round(v1,2)\n",
"V=m1*x1*v1\n",
"print(\"and volume of vessel(V) in m^3=\"),round(V,2)\n",
"h1=hf_100Kpa+x1*hfg_100Kpa\n",
"print(\"enthalpy at 1,h1=hf_100Kpa+x1*hfg_100Kpa in KJ/kg\"),round(h1,2)\n",
"U1=m1*(uf_100Kpa+x1*ufg_100Kpa)\n",
"print(\"internal energy in the beginning=U1=m1*u1 in KJ\"),round(U1,2)\n",
"print(\"let the mass of dry steam added be m,final specific volume inside vessel,v2\")\n",
"print(\"v2=vf_1000Kpa+x2*vfg_1000Kpa\")\n",
"print(\"at 2000 Kpa,from steam table,\")\n",
"print(\"vg_2000Kpa=0.09963 m^3/kg,ug_2000Kpa=2600.3 KJ/kg,hg_2000Kpa=2799.5 KJ/kg\")\n",
"vg_2000Kpa=0.09963;\n",
"ug_2000Kpa=2600.3;\n",
"hg_2000Kpa=2799.5;\n",
"print(\"total mass inside vessel=mass of steam at2000 Kpa+mass of mixture at 100 Kpa\")\n",
"print(\"V/v2=V/vg_2000Kpa+V/v1\")\n",
"v2=1/((1/vg_2000Kpa)+(1/v1))\n",
"print(\"so v2 in m^3/kg=\"),round(v2,2)\n",
"print(\"here v2=vf_1000Kpa+x2*vfg_1000Kpa in m^3/kg\")\n",
"print(\"at 1000 Kpa from steam table,\")\n",
"print(\"hf_1000Kpa=762.81 KJ/kg,hfg_1000Kpa=2015.3 KJ/kg,vf_1000Kpa=0.001127 m^3/kg,vg_1000Kpa=0.19444 m^3/kg\")\n",
"hf_1000Kpa=762.81;\n",
"hfg_1000Kpa=2015.3;\n",
"vf_1000Kpa=0.001127;\n",
"vg_1000Kpa=0.19444;\n",
"vfg_1000Kpa=vg_1000Kpa-vf_1000Kpa\n",
"print(\"here vfg_1000Kpa= in m^3/kg=\"),round(vfg_1000Kpa,2)\n",
"x2=(v2-vf_1000Kpa)/vfg_1000Kpa\n",
"print(\"so x2=\"),round(x2,2)\n",
"print(\"for adiabatic mixing,(100+m)*h2=100*h1+m*hg_2000Kpa\")\n",
"print(\"so mass of dry steam at 2000 Kpa to be added(m)in kg\")\n",
"m=(100*(h1-(hf_1000Kpa+x2*hfg_1000Kpa)))/((hf_1000Kpa+x2*hfg_1000Kpa)-hg_2000Kpa)\n",
"print(\"m=(100*(h1-h2))/(h2-hg_2000Kpa)=\"),round(m,2)\n",
"print(\"quality of final mixture x2=\"),round(x2,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.15;pg no: 183"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.15, Page:183 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 15\n",
"from dalton law of partial pressure the total pressure inside condenser will be sum of partial pressures of vapour and liquid inside.\n",
"condenser pressure(p_condenser) in Kpa= 7.3\n",
"partial pressure of steam corresponding to35 degree celcius from steam table;\n",
"p_steam=5.628 Kpa\n",
"enthalpy corresponding to 35 degree celcius from steam table,\n",
"hf=146.68 KJ/kg,hfg=2418.6 KJ/kg\n",
"let quality of steam entering be x\n",
"from energy balance;\n",
"mw*(To-Ti)*4.18=m_cond*(hf+x*hfg-4.18*T_hotwell)\n",
"so dryness fraction of steam entering(x)is given as\n",
"x= 0.97\n"
]
}
],
"source": [
"#cal of dryness fraction of steam entering\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.15, Page:183 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 15\")\n",
"p_vaccum=71.5;#recorded condenser vaccum in cm of mercury\n",
"p_barometer=76.8;#barometer reading in cm of mercury\n",
"T_cond=35;#temperature of condensation in degree celcius\n",
"T_hotwell=27.6;#temperature of hot well in degree celcius\n",
"m_cond=1930;#mass of condensate per hour\n",
"m_w=62000;#mass of cooling water per hour\n",
"Ti=8.51;#initial temperature in degree celcius\n",
"To=26.24;#outlet temperature in degree celcius\n",
"print(\"from dalton law of partial pressure the total pressure inside condenser will be sum of partial pressures of vapour and liquid inside.\")\n",
"p_condenser=(p_barometer-p_vaccum)*101.325/73.55\n",
"print(\"condenser pressure(p_condenser) in Kpa=\"),round(p_condenser,2)\n",
"print(\"partial pressure of steam corresponding to35 degree celcius from steam table;\")\n",
"print(\"p_steam=5.628 Kpa\")\n",
"p_steam=5.628;#partial pressure of steam\n",
"print(\"enthalpy corresponding to 35 degree celcius from steam table,\")\n",
"print(\"hf=146.68 KJ/kg,hfg=2418.6 KJ/kg\")\n",
"hf=146.68;\n",
"hfg=2418.6;\n",
"print(\"let quality of steam entering be x\")\n",
"print(\"from energy balance;\")\n",
"print(\"mw*(To-Ti)*4.18=m_cond*(hf+x*hfg-4.18*T_hotwell)\")\n",
"print(\"so dryness fraction of steam entering(x)is given as\")\n",
"x=(((m_w*(To-Ti)*4.18)/m_cond)-hf+4.18*T_hotwell)/hfg\n",
"print(\"x=\"),round(x,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.16;pg no: 184"
]
},
{
"cell_type": "code",
"execution_count": 83,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.16, Page:184 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 16\n",
"heating of water in vessel as described above is a constant pressure heating. pressure at which process occurs(p)=F/A+P_atm in Kpa\n",
"area(A) in m^2= 0.03\n",
"so p1=in Kpa= 419.61\n",
"now at 419.61 Kpa,hf=612.1 KJ/kg,hfg=2128.7 KJ/kg,vg=0.4435 m^3/kg\n",
"volume of water contained(V1) in m^3= 0.001\n",
"mass of water(m) in kg= 0.63\n",
"heat supplied shall cause sensible heating and latent heating\n",
"hence,enthalpy change=heat supplied\n",
"Q=((hf+x*hfg)-(4.18*T)*m)\n",
"so dryness fraction of steam produced(x)can be calculated as\n",
"so x= 0.46\n",
"internal energy of water(U1)in KJ,initially\n",
"U1= 393.69\n",
"finally,internal energy of wet steam(U2)in KJ\n",
"U2=m*h2-p2*V2\n",
"here V2 in m^3= 0.13\n",
"hence U2= 940.68\n",
"hence change in internal energy(U) in KJ= 547.21\n",
"work done(W) in KJ= 53.01\n"
]
}
],
"source": [
"#cal of change in internal energy and work done\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"import math\n",
"print\"Example 6.16, Page:184 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 16\")\n",
"F=10;#force applied externally upon piston in KN\n",
"d=.2;#diameter in m\n",
"h=0.02;#depth to which water filled in m \n",
"P_atm=101.3;#atmospheric pressure in Kpa\n",
"rho=1000;#density of water in kg/m^3\n",
"Q=600;#heat supplied to water in KJ\n",
"T=150;#temperature of water in degree celcius\n",
"print(\"heating of water in vessel as described above is a constant pressure heating. pressure at which process occurs(p)=F/A+P_atm in Kpa\")\n",
"A=math.pi*d**2/4\n",
"print(\"area(A) in m^2=\"),round(A,2)\n",
"p1=F/A+P_atm\n",
"print(\"so p1=in Kpa=\"),round(p1,2)\n",
"print(\"now at 419.61 Kpa,hf=612.1 KJ/kg,hfg=2128.7 KJ/kg,vg=0.4435 m^3/kg\")\n",
"hf=612.1;\n",
"hfg=2128.7;\n",
"vg=0.4435;\n",
"V1=math.pi*d**2*h/4\n",
"print(\"volume of water contained(V1) in m^3=\"),round(V1,3)\n",
"m=V1*rho\n",
"print(\"mass of water(m) in kg=\"),round(m,2)\n",
"print(\"heat supplied shall cause sensible heating and latent heating\")\n",
"print(\"hence,enthalpy change=heat supplied\")\n",
"print(\"Q=((hf+x*hfg)-(4.18*T)*m)\")\n",
"print(\"so dryness fraction of steam produced(x)can be calculated as\")\n",
"x=((Q/m)+4.18*T-hf)/hfg\n",
"print(\"so x=\"),round(x,2)\n",
"print(\"internal energy of water(U1)in KJ,initially\")\n",
"h1=4.18*T;#enthalpy of water in KJ/kg\n",
"U1=m*h1-p1*V1\n",
"print(\"U1=\"),round(U1,2)\n",
"U1=393.5;#approx.\n",
"print(\"finally,internal energy of wet steam(U2)in KJ\")\n",
"print(\"U2=m*h2-p2*V2\")\n",
"V2=m*x*vg\n",
"print(\"here V2 in m^3=\"),round(V2,2)\n",
"p2=p1;#constant pressure process\n",
"U2=(m*(hf+x*hfg))-p2*V2\n",
"print(\"hence U2=\"),round(U2,2)\n",
"U2=940.71;#approx.\n",
"U=U2-U1\n",
"print(\"hence change in internal energy(U) in KJ=\"),round(U,2)\n",
"p=p1;\n",
"W=p*(V2-V1)\n",
"print(\"work done(W) in KJ=\"),round(W,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.17;pg no: 185"
]
},
{
"cell_type": "code",
"execution_count": 84,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.17, Page:185 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 17\n",
"consider throttling calorimeter alone,\n",
"degree of superheat(T_sup)in degree celcius\n",
"T_sup= 18.2\n",
"enthalpy of superheated steam(h_sup)in KJ/kg\n",
"h_sup= 2711.99\n",
"at 120 degree celcius,h=2673.95 KJ/kg from steam table\n",
"now enthalpy before throttling = enthalpy after throttling\n",
"hf+x2*hfg=h_sup\n",
"here at 1.47 Mpa,hf=840.513 KJ/kg,hfg=1951.02 KJ/kg from steam table\n",
"so x2= 0.96\n",
"for seperating calorimeter alone,dryness fraction,x1=(ms-mw)/ms\n",
"overall dryness fraction(x)= 0.91\n"
]
}
],
"source": [
"#cal of overall dryness fraction\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.17, Page:185 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 17\")\n",
"ms=40;#mass of steam in kg\n",
"mw=2.2;#mass of water in kg\n",
"p1=1.47;#pressure before throttling in Mpa\n",
"T2=120;#temperature after throttling in degree celcius\n",
"p2=107.88;#pressure after throttling in Kpa\n",
"Cp_sup=2.09;#specific heat of superheated steam in KJ/kg K\n",
"print(\"consider throttling calorimeter alone,\")\n",
"print(\"degree of superheat(T_sup)in degree celcius\")\n",
"T_sup=T2-101.8\n",
"print(\"T_sup=\"),round(T_sup,2)\n",
"print(\"enthalpy of superheated steam(h_sup)in KJ/kg\")\n",
"h=2673.95;\n",
"h_sup=h+T_sup*Cp_sup\n",
"print(\"h_sup=\"),round(h_sup,2)\n",
"print(\"at 120 degree celcius,h=2673.95 KJ/kg from steam table\")\n",
"print(\"now enthalpy before throttling = enthalpy after throttling\")\n",
"print(\"hf+x2*hfg=h_sup\")\n",
"print(\"here at 1.47 Mpa,hf=840.513 KJ/kg,hfg=1951.02 KJ/kg from steam table\")\n",
"hf=840.513;\n",
"hfg=1951.02;\n",
"x2=(h_sup-hf)/hfg\n",
"print(\"so x2=\"),round(x2,2)\n",
"print(\"for seperating calorimeter alone,dryness fraction,x1=(ms-mw)/ms\")\n",
"x1=(ms-mw)/ms\n",
"x=x1*x2\n",
"print(\"overall dryness fraction(x)=\"),round(x,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.18;pg no: 185"
]
},
{
"cell_type": "code",
"execution_count": 85,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.18, Page:185 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 18\n",
"here heat addition to part B shall cause evaporation of water and subsequently the rise in pressure.\n",
"final,part B has dry steam at 15 bar.In order to have equilibrium the part A shall also have pressure of 15 bar.thus heat added\n",
"Q in KJ= 200.0\n",
"final enthalpy of dry steam at 15 bar,h2=hg_15bar\n",
"h2=2792.2 KJ/kg from steam table\n",
"let initial dryness fraction be x1,initial enthalpy,\n",
"h1=hf_10bar+x1*hfg_10bar.........eq1\n",
"here at 10 bar,hf_10bar=762.83 KJ/kg,hfg_10bar=2015.3 KJ/kg from steam table\n",
"also heat balance yields,\n",
"h1+Q=h2\n",
"so h1=h2-Q in KJ/kg\n",
"so by eq 1=>x1= 0.91\n",
"heat added(Q)in KJ= 200.0\n",
"and initial quality(x1) 0.91\n"
]
}
],
"source": [
"#cal of heat added and initial quality\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.18, Page:185 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 18\")\n",
"v=0.4;#volume of air in part A and part B in m^3\n",
"p1=10*10**5;#initial pressure of steam in pa\n",
"p2=15*10**5;#final pressure of steam in pa\n",
"print(\"here heat addition to part B shall cause evaporation of water and subsequently the rise in pressure.\")\n",
"print(\"final,part B has dry steam at 15 bar.In order to have equilibrium the part A shall also have pressure of 15 bar.thus heat added\")\n",
"Q=v*(p2-p1)/1000\n",
"print(\"Q in KJ=\"),round(Q,2)\n",
"print(\"final enthalpy of dry steam at 15 bar,h2=hg_15bar\")\n",
"print(\"h2=2792.2 KJ/kg from steam table\")\n",
"h2=2792.2;\n",
"print(\"let initial dryness fraction be x1,initial enthalpy,\")\n",
"print(\"h1=hf_10bar+x1*hfg_10bar.........eq1\")\n",
"print(\"here at 10 bar,hf_10bar=762.83 KJ/kg,hfg_10bar=2015.3 KJ/kg from steam table\")\n",
"hf_10bar=762.83;\n",
"hfg_10bar=2015.3;\n",
"print(\"also heat balance yields,\")\n",
"print(\"h1+Q=h2\")\n",
"print(\"so h1=h2-Q in KJ/kg\")\n",
"h1=h2-Q\n",
"x1=(h1-hf_10bar)/hfg_10bar\n",
"print(\"so by eq 1=>x1=\"),round(x1,2)\n",
"print(\"heat added(Q)in KJ=\"),round(Q,2)\n",
"print(\"and initial quality(x1)\"),round(x1,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.19;pg no: 186"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.19, Page:186 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 19\n",
"from steam table,vg=1.2455 m^3/kg,hf=457.99 KJ/kg,hfg=2232.3 KJ/kg\n",
"specific volume of wet steam in cylinder,v1 in m^3/kg= 0.75\n",
"dryness fraction of initial steam(x1)= 0.6\n",
"initial enthalpy of wet steam,h1 in KJ/kg= 1801.83\n",
"at 400 degree celcius specific volume of steam,v2 in m^3/kg= 1.55\n",
"for specific volume of 1.55 m^3/kg at 400 degree celcius the pressure can be seen from the steam table.From superheated steam tables the specific volume of 1.55 m^3/kg lies between the pressure of 0.10 Mpa (specific volume 3.103 m^3/kg at400 degree celcius)and 0.20 Mpa(specific volume 1.5493 m^3/kg at 400 degree celcius)\n",
"actual pressure can be obtained by interpolation\n",
"p2=0.20 MPa(approx.)\n",
"saturation temperature at 0.20 Mpa(t)=120.23 degree celcius from steam table\n",
"finally the degree of superheat(T_sup)in K\n",
"T_sup=T-t\n",
"final enthalpy of steam at 0.20 Mpa and 400 degree celcius,h2=3276.6 KJ/kg from steam table\n",
"heat added during process(deltaQ)in KJ\n",
"deltaQ=m*(h2-h1)\n",
"internal energy of initial wet steam,u1=uf+x1*ufg in KJ/kg\n",
"here at 1.4 bar,from steam table,uf=457.84 KJ/kg,ufg=2059.34 KJ/kg\n",
"internal energy of final state,u2=u at 0.2 Mpa,400 degree celcius\n",
"u2=2966.7 KJ/kg\n",
"change in internal energy(deltaU)in KJ\n",
"deltaU= 3807.41\n",
"form first law of thermodynamics,work done(deltaW)in KJ\n",
"deltaW=deltaQ-deltaU 616.88\n",
"so heat transfer(deltaQ)in KJ 4424.3\n",
"and work transfer(deltaW)in KJ 616.88\n",
"NOTE=>In book value of u1=1707.86 KJ/kg is calculated wrong taking x1=0.607,hence correct value of u1 using x1=0.602 is 1697.5627 KJ/kg\n",
"and corresponding values of heat transfer= 4424.2962 KJ and work transfer=616.88424 KJ.\n"
]
}
],
"source": [
"#cal of heat and work transfer \n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.19, Page:186 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 19\")\n",
"m=3;#mass of wet steam in kg\n",
"p=1.4;#pressure of wet steam in bar\n",
"V1=2.25;#initial volume in m^3\n",
"V2=4.65;#final volume in m^3\n",
"T=400;#temperature of steam in degreee celcius\n",
"print(\"from steam table,vg=1.2455 m^3/kg,hf=457.99 KJ/kg,hfg=2232.3 KJ/kg\")\n",
"vg=1.2455;\n",
"hf=457.99;\n",
"hfg=2232.3;\n",
"v1=V1/m\n",
"print(\"specific volume of wet steam in cylinder,v1 in m^3/kg=\"),round(v1,2)\n",
"x1=v1/vg\n",
"print(\"dryness fraction of initial steam(x1)=\"),round(x1,2)\n",
"x1=0.602;#approx.\n",
"h1=hf+x1*hfg\n",
"print(\"initial enthalpy of wet steam,h1 in KJ/kg=\"),round(h1,2)\n",
"v2=V2/m\n",
"print(\"at 400 degree celcius specific volume of steam,v2 in m^3/kg=\"),round(v2,2)\n",
"print(\"for specific volume of 1.55 m^3/kg at 400 degree celcius the pressure can be seen from the steam table.From superheated steam tables the specific volume of 1.55 m^3/kg lies between the pressure of 0.10 Mpa (specific volume 3.103 m^3/kg at400 degree celcius)and 0.20 Mpa(specific volume 1.5493 m^3/kg at 400 degree celcius)\")\n",
"print(\"actual pressure can be obtained by interpolation\")\n",
"p2=.1+((0.20-0.10)/(1.5493-3.103))*(1.55-3.103)\n",
"print(\"p2=0.20 MPa(approx.)\")\n",
"p2=0.20;\n",
"print(\"saturation temperature at 0.20 Mpa(t)=120.23 degree celcius from steam table\")\n",
"t=120.23;\n",
"print(\"finally the degree of superheat(T_sup)in K\")\n",
"print(\"T_sup=T-t\")\n",
"T_sup=T-t\n",
"print(\"final enthalpy of steam at 0.20 Mpa and 400 degree celcius,h2=3276.6 KJ/kg from steam table\")\n",
"h2=3276.6;\n",
"print(\"heat added during process(deltaQ)in KJ\")\n",
"print(\"deltaQ=m*(h2-h1)\")\n",
"deltaQ=m*(h2-h1)\n",
"print(\"internal energy of initial wet steam,u1=uf+x1*ufg in KJ/kg\")\n",
"print(\"here at 1.4 bar,from steam table,uf=457.84 KJ/kg,ufg=2059.34 KJ/kg\")\n",
"uf=457.84;\n",
"ufg=2059.34;\n",
"u1=uf+x1*ufg\n",
"print(\"internal energy of final state,u2=u at 0.2 Mpa,400 degree celcius\")\n",
"print(\"u2=2966.7 KJ/kg\")\n",
"u2=2966.7;\n",
"print(\"change in internal energy(deltaU)in KJ\")\n",
"deltaU=m*(u2-u1)\n",
"print(\"deltaU=\"),round(deltaU,2)\n",
"print(\"form first law of thermodynamics,work done(deltaW)in KJ\")\n",
"deltaW=deltaQ-deltaU\n",
"print(\"deltaW=deltaQ-deltaU\"),round(deltaW,2)\n",
"print(\"so heat transfer(deltaQ)in KJ\"),round(deltaQ,2)\n",
"print(\"and work transfer(deltaW)in KJ\"),round(deltaW,2)\n",
"print(\"NOTE=>In book value of u1=1707.86 KJ/kg is calculated wrong taking x1=0.607,hence correct value of u1 using x1=0.602 is 1697.5627 KJ/kg\")\n",
"print(\"and corresponding values of heat transfer= 4424.2962 KJ and work transfer=616.88424 KJ.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 6.20;pg no: 187"
]
},
{
"cell_type": "code",
"execution_count": 87,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 6.20, Page:187 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 20\n",
"here throttling process is occuring therefore enthalpy before and after expansion remains same.Let initial and final states be given by 1 and 2.Initial enthalpy,from steam table.\n",
"at 500 degree celcius,h1_10bar_500oc=3478.5 KJ/kg,s1_10bar_500oc=7.7622 KJ/kg K,v1_10bar_500oc=0.3541 m^3/kg\n",
"finally pressure becomes 1 bar so finally enthalpy(h2) at this pressure(of 1 bar)is also 3478.5 KJ/kg which lies between superheat temperature of 400 degree celcius and 500 degree celcius at 1 bar.Let temperature be T2,\n",
"h_1bar_400oc=3278.2 KJ/kg,h_1bar_500oc=3488.1 KJ/kg from steam table\n",
"h2=h_1bar_400oc+(h_1bar_500oc-h_1bar_400oc)*(T2-400)/(500-400)\n",
"so final temperature(T2)in K\n",
"T2= 495.43\n",
"entropy for final state(s2)in KJ/kg K\n",
"s2= 8.82\n",
"here from steam table,s_1bar_400oc=8.5435 KJ/kg K,s_1bar_500oc=8.8342 KJ/kg K\n",
"so change in entropy(deltaS)in KJ/kg K\n",
"deltaS= 1.06\n",
"final specific volume,v2=v_1bar_400oc+((v_1bar_500oc-v_1bar_400oc)*(95.43)/(500-400)) in m^3/kg\n",
"here from steam table,v_1bar_500oc=3.565 m^3/kg,v_1bar_400oc=3.103 m^3/kg\n",
"percentage of vessel volume initially occupied by steam(V)= 9.99\n"
]
}
],
"source": [
"#cal of percentage of vessel volume initially occupied by steam\n",
"#intiation of all variables\n",
"# Chapter 6\n",
"print\"Example 6.20, Page:187 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 6 Example 20\")\n",
"print(\"here throttling process is occuring therefore enthalpy before and after expansion remains same.Let initial and final states be given by 1 and 2.Initial enthalpy,from steam table.\")\n",
"print(\"at 500 degree celcius,h1_10bar_500oc=3478.5 KJ/kg,s1_10bar_500oc=7.7622 KJ/kg K,v1_10bar_500oc=0.3541 m^3/kg\")\n",
"h1_10bar_500oc=3478.5;\n",
"s1_10bar_500oc=7.7622;\n",
"v1_10bar_500oc=0.3541;\n",
"print(\"finally pressure becomes 1 bar so finally enthalpy(h2) at this pressure(of 1 bar)is also 3478.5 KJ/kg which lies between superheat temperature of 400 degree celcius and 500 degree celcius at 1 bar.Let temperature be T2,\")\n",
"h2=h1_10bar_500oc;\n",
"print(\"h_1bar_400oc=3278.2 KJ/kg,h_1bar_500oc=3488.1 KJ/kg from steam table\")\n",
"h_1bar_400oc=3278.2;\n",
"h_1bar_500oc=3488.1;\n",
"print(\"h2=h_1bar_400oc+(h_1bar_500oc-h_1bar_400oc)*(T2-400)/(500-400)\")\n",
"print(\"so final temperature(T2)in K\")\n",
"T2=400+((h2-h_1bar_400oc)*(500-400)/(h_1bar_500oc-h_1bar_400oc))\n",
"print(\"T2=\"),round(T2,2)\n",
"print(\"entropy for final state(s2)in KJ/kg K\")\n",
"s_1bar_400oc=8.5435;\n",
"s_1bar_500oc=8.8342;\n",
"s2=s_1bar_400oc+((s_1bar_500oc-s_1bar_400oc)*(495.43-400)/(500-400))\n",
"print(\"s2=\"),round(s2,2)\n",
"print(\"here from steam table,s_1bar_400oc=8.5435 KJ/kg K,s_1bar_500oc=8.8342 KJ/kg K\")\n",
"print(\"so change in entropy(deltaS)in KJ/kg K\")\n",
"deltaS=s2-s1_10bar_500oc\n",
"print(\"deltaS=\"),round(deltaS,2)\n",
"print(\"final specific volume,v2=v_1bar_400oc+((v_1bar_500oc-v_1bar_400oc)*(95.43)/(500-400)) in m^3/kg\")\n",
"print(\"here from steam table,v_1bar_500oc=3.565 m^3/kg,v_1bar_400oc=3.103 m^3/kg\")\n",
"v_1bar_500oc=3.565;\n",
"v_1bar_400oc=3.103;\n",
"v2=v_1bar_400oc+((v_1bar_500oc-v_1bar_400oc)*(95.43)/(500-400))\n",
"V=v1_10bar_500oc*100/v2\n",
"print(\"percentage of vessel volume initially occupied by steam(V)=\"),round(V,2)\n",
"\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I ΧJJ+Engineering Thermodynamics/chapter7_2.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 7:Availability and General Thermodynamic Relation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.1;page no: 218"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.1, Page:218 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 1\n",
"let us neglect the potential energy change during the flow.\n",
"applying S.F.E.E,neglecting inlet velocity and change in potential energy,\n",
"W_max=(h1-To*s1)-(h2+C2^2/2-To*s2)\n",
"W_max=(h1-h2)-To*(s1-s2)-C2^2/2\n",
"from steam tables,\n",
"h1=h_1.6Mpa_300=3034.8 KJ/kg,s1=s_1.6Mpa_300=6.8844 KJ/kg,h2=h_0.1Mpa_150=2776.4 KJ/kg,s2=s_150Mpa_150=7.6134 KJ/kg\n",
"given To=288 K\n",
"so W_max in KJ/kg= 457.1\n",
"maximum possible work(W_max) in KW= 1142.76\n"
]
}
],
"source": [
"#cal of maximum possible work\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.1, Page:218 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 1\")\n",
"C2=150;#leave velocity of steam in m/s\n",
"m=2.5;#steam mass flow rate in kg/s\n",
"print(\"let us neglect the potential energy change during the flow.\")\n",
"print(\"applying S.F.E.E,neglecting inlet velocity and change in potential energy,\")\n",
"print(\"W_max=(h1-To*s1)-(h2+C2^2/2-To*s2)\")\n",
"print(\"W_max=(h1-h2)-To*(s1-s2)-C2^2/2\")\n",
"print(\"from steam tables,\")\n",
"print(\"h1=h_1.6Mpa_300=3034.8 KJ/kg,s1=s_1.6Mpa_300=6.8844 KJ/kg,h2=h_0.1Mpa_150=2776.4 KJ/kg,s2=s_150Mpa_150=7.6134 KJ/kg\")\n",
"h1=3034.8;\n",
"s1=6.8844;\n",
"h2=2776.4;\n",
"s2=7.6134;\n",
"print(\"given To=288 K\")\n",
"To=288;\n",
"W_max=(h1-h2)-To*(s1-s2)-(C2**2/2*10**-3)\n",
"print(\"so W_max in KJ/kg=\"),round(W_max,2)\n",
"W_max=m*W_max\n",
"print(\"maximum possible work(W_max) in KW=\"),round(W_max,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.2;page no: 219"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.2, Page:219 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 2\n",
"In these tanks the air stored is at same temperature of 50 degree celcius.Therefore,for air behaving as perfect gas the internal energy of air in tanks shall be same as it depends upon temperature alone.But the availability shall be different.\n",
"BOTH THE TANKS HAVE SAME INTERNAL ENERGY\n",
"availability of air in tank,A\n",
"A=(E-Uo)+Po*(V-Vo)-To*(S-So)\n",
"=m*{(e-uo)+Po(v-vo)-To(s-so)}\n",
"m*{Cv*(T-To)+Po*(R*T/P-R*To/Po)-To(Cp*log(T/To)-R*log(P/Po))}\n",
"so A=m*{Cv*(T-To)+R*(Po*T/P-To)-To*Cp*log(T/To)+To*R*log(P/Po)}\n",
"for tank A,P in pa,so availability_A in KJ= 1.98\n",
"for tank B,P=3*10^5 pa,so availability_B in KJ= 30.98\n",
"so availability of air in tank B is more than that of tank A\n",
"availability of air in tank A=1.98 KJ\n",
"availability of air in tank B=30.98 KJ\n"
]
}
],
"source": [
"#cal of availability of air in tank A,B\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.2, Page:219 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 2\")\n",
"m=1.;#mass of air in kg\n",
"Po=1.*10**5;#atmospheric pressure in pa\n",
"To=(15.+273.);#temperature of atmosphere in K\n",
"Cv=0.717;#specific heat at constant volume in KJ/kg K\n",
"R=0.287;#gas constant in KJ/kg K\n",
"Cp=1.004;#specific heat at constant pressure in KJ/kg K\n",
"T=(50.+273.);#temperature of tanks A and B in K\n",
"print(\"In these tanks the air stored is at same temperature of 50 degree celcius.Therefore,for air behaving as perfect gas the internal energy of air in tanks shall be same as it depends upon temperature alone.But the availability shall be different.\")\n",
"print(\"BOTH THE TANKS HAVE SAME INTERNAL ENERGY\")\n",
"print(\"availability of air in tank,A\")\n",
"print(\"A=(E-Uo)+Po*(V-Vo)-To*(S-So)\")\n",
"print(\"=m*{(e-uo)+Po(v-vo)-To(s-so)}\")\n",
"print(\"m*{Cv*(T-To)+Po*(R*T/P-R*To/Po)-To(Cp*log(T/To)-R*log(P/Po))}\")\n",
"print(\"so A=m*{Cv*(T-To)+R*(Po*T/P-To)-To*Cp*log(T/To)+To*R*log(P/Po)}\")\n",
"P=1.*10**5;#pressure in tank A in pa\n",
"availability_A=m*(Cv*(T-To)+R*(Po*T/P-To)-To*Cp*math.log(T/To)+To*R*math.log(P/Po))\n",
"print(\"for tank A,P in pa,so availability_A in KJ=\"),round(availability_A,2)\n",
"P=3.*10**5;#pressure in tank B in pa\n",
"availability_B=m*(Cv*(T-To)+R*(Po*T/P-To)-To*Cp*math.log(T/To)+To*R*math.log(P/Po))\n",
"print(\"for tank B,P=3*10^5 pa,so availability_B in KJ=\"),round(availability_B,2)\n",
"print(\"so availability of air in tank B is more than that of tank A\")\n",
"print(\"availability of air in tank A=1.98 KJ\")\n",
"print(\"availability of air in tank B=30.98 KJ\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.3;page no: 221"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.3, Page:221 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 3\n",
"inlet conditions,\n",
"from steam tables,,h1=3051.2 KJ/kg,s1=7.1229 KJ/kg K\n",
"outlet conditions,at 0.05 bar and 0.95 dryness fraction\n",
"from steam tables,sf=0.4764 KJ/kg K,s_fg=7.9187 KJ/kg K,x=0.95,hf=137.82 KJ/kg,h_fg=2423.7 KJ/kg\n",
"so s2= in KJ/kg K= 8.0\n",
"and h2= in KJ/kg= 2440.34\n",
"neglecting the change in potential energy and velocity at inlet to turbine,the steady flow energy equation may be written as to give work output.\n",
"w in KJ/kg= 598.06\n",
"power output in KW= 8970.97\n",
"maximum work for given end states,\n",
"w_max=(h1-To*s1)-(h2+V2^2*10^-3/2-To*s2) in KJ/kg 850.43\n",
"w_max in KW 12755.7\n",
"so maximum power output=12755.7 KW\n",
"maximum power that could be obtained from exhaust steam shall depend upon availability with exhaust steam and the dead state.stream availability of exhaust steam,\n",
"A_exhaust=(h2+V^2/2-To*s2)-(ho-To*so)\n",
"=(h2-ho)+V2^2/2-To(s2-so)\n",
"approximately the enthalpy of water at dead state of 1 bar,15 degree celcius can be approximated to saturated liquid at 15 degree celcius\n",
"from steam tables,at 15 degree celcius,ho=62.99 KJ/kg,so=0.2245 KJ/kg K\n",
"maximum work available from exhaust steam,A_exhaust in KJ/kg\n",
"A_exhaust=(h2-ho)+V2^2*10^-3/2-To*(s2-so) 151.1\n",
"maximum power that could be obtained from exhaust steam in KW= 2266.5\n",
"so maximum power from exhaust steam=2266.5 KW\n"
]
}
],
"source": [
"#cal of maximum power output and that could be obtained from exhaust steam\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.3, Page:221 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 3\")\n",
"m=15;#steam flow rate in kg/s\n",
"V2=160;#exit velocity of steam in m/s\n",
"To=(15+273);#pond water temperature in K\n",
"print(\"inlet conditions,\")\n",
"print(\"from steam tables,,h1=3051.2 KJ/kg,s1=7.1229 KJ/kg K\")\n",
"h1=3051.2;\n",
"s1=7.1229;\n",
"print(\"outlet conditions,at 0.05 bar and 0.95 dryness fraction\")\n",
"print(\"from steam tables,sf=0.4764 KJ/kg K,s_fg=7.9187 KJ/kg K,x=0.95,hf=137.82 KJ/kg,h_fg=2423.7 KJ/kg\")\n",
"sf=0.4764;\n",
"s_fg=7.9187;\n",
"x=0.95;\n",
"hf=137.82;\n",
"h_fg=2423.7;\n",
"s2=sf+x*s_fg\n",
"print(\"so s2= in KJ/kg K=\"),round(s2,2)\n",
"h2=hf+x*h_fg\n",
"print(\"and h2= in KJ/kg=\"),round(h2,2)\n",
"print(\"neglecting the change in potential energy and velocity at inlet to turbine,the steady flow energy equation may be written as to give work output.\")\n",
"w=(h1-h2)-V2**2*10**-3/2\n",
"print(\"w in KJ/kg=\"),round(w,2)\n",
"print(\"power output in KW=\"),round(m*w,2)\n",
"print(\"maximum work for given end states,\")\n",
"w_max=(h1-To*s1)-(h2+V2**2*10**-3/2-To*s2)\n",
"print(\"w_max=(h1-To*s1)-(h2+V2^2*10^-3/2-To*s2) in KJ/kg\"),round(w_max,2)\n",
"w_max=850.38;#approx.\n",
"w_max=m*w_max\n",
"print(\"w_max in KW\"),round(w_max,2)\n",
"print(\"so maximum power output=12755.7 KW\")\n",
"print(\"maximum power that could be obtained from exhaust steam shall depend upon availability with exhaust steam and the dead state.stream availability of exhaust steam,\")\n",
"print(\"A_exhaust=(h2+V^2/2-To*s2)-(ho-To*so)\")\n",
"print(\"=(h2-ho)+V2^2/2-To(s2-so)\")\n",
"print(\"approximately the enthalpy of water at dead state of 1 bar,15 degree celcius can be approximated to saturated liquid at 15 degree celcius\")\n",
"print(\"from steam tables,at 15 degree celcius,ho=62.99 KJ/kg,so=0.2245 KJ/kg K\")\n",
"ho=62.99;\n",
"so=0.2245;\n",
"print(\"maximum work available from exhaust steam,A_exhaust in KJ/kg\")\n",
"A_exhaust=(h2-ho)+V2**2*10**-3/2-To*(s2-so)\n",
"A_exhaust=151.1;#approx.\n",
"print(\"A_exhaust=(h2-ho)+V2^2*10^-3/2-To*(s2-so)\"),round(A_exhaust,2)\n",
"print(\"maximum power that could be obtained from exhaust steam in KW=\"),round(m*A_exhaust,2)\n",
"print(\"so maximum power from exhaust steam=2266.5 KW\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.4;page no: 222"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.4, Page:222 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 4\n",
"for dead state of water,\n",
"from steam tables,uo=104.86 KJ/kg,vo=1.0029*10^-3 m^3/kg,so=0.3673 KJ/kg K\n",
"for initial state of water,\n",
"from steam tables,u1=2550 KJ/kg,v1=0.5089 m^3/kg,s1=6.93 KJ/kg K\n",
"for final state of water,\n",
"from steam tables,u2=83.94 KJ/kg,v2=1.0018*10^-3 m^3/kg,s2=0.2966 KJ/kg K\n",
"availability at any state can be given by\n",
"A=m*((u-uo)+Po*(v-vo)-To*(s-so)+V^2/2+g*z)\n",
"so availability at initial state,A1 in KJ\n",
"A1= 2703.28\n",
"and availability at final state,A2 in KJ\n",
"A2= 1.09\n",
"change in availability,A2-A1 in KJ= -2702.19\n",
"hence availability decreases by 2702.188 KJ\n",
"NOTE=>In this question,due to large calculations,answers are approximately correct.\n"
]
}
],
"source": [
"#cal of availability at initial,final state and also change\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.4, Page:222 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 4\")\n",
"m=5;#mass of steam in kg\n",
"z1=10;#initial elevation in m\n",
"V1=25;#initial velocity of steam in m/s\n",
"z2=2;#final elevation in m\n",
"V2=10;#final velocity of steam in m/s\n",
"Po=100;#environmental pressure in Kpa\n",
"To=(25+273);#environmental temperature in K\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"for dead state of water,\")\n",
"print(\"from steam tables,uo=104.86 KJ/kg,vo=1.0029*10^-3 m^3/kg,so=0.3673 KJ/kg K\")\n",
"uo=104.86;\n",
"vo=1.0029*10**-3;\n",
"so=0.3673;\n",
"print(\"for initial state of water,\")\n",
"print(\"from steam tables,u1=2550 KJ/kg,v1=0.5089 m^3/kg,s1=6.93 KJ/kg K\")\n",
"u1=2550;\n",
"v1=0.5089;\n",
"s1=6.93;\n",
"print(\"for final state of water,\")\n",
"print(\"from steam tables,u2=83.94 KJ/kg,v2=1.0018*10^-3 m^3/kg,s2=0.2966 KJ/kg K\")\n",
"u2=83.94;\n",
"v2=1.0018*10**-3;\n",
"s2=0.2966;\n",
"print(\"availability at any state can be given by\")\n",
"print(\"A=m*((u-uo)+Po*(v-vo)-To*(s-so)+V^2/2+g*z)\")\n",
"A1=m*((u1-uo)+Po*(v1-vo)-To*(s1-so)+V1**2*10**-3/2+g*z1*10**-3)\n",
"print(\"so availability at initial state,A1 in KJ\")\n",
"print(\"A1=\"),round(A1,2)\n",
"A2=m*((u2-uo)+Po*(v2-vo)-To*(s2-so)+V2**2*10**-3/2+g*z2*10**-3)\n",
"print(\"and availability at final state,A2 in KJ\")\n",
"print(\"A2=\"),round(A2,2)\n",
"A2-A1\n",
"print(\"change in availability,A2-A1 in KJ=\"),round(A2-A1,2)\n",
"print(\"hence availability decreases by 2702.188 KJ\")\n",
"print(\"NOTE=>In this question,due to large calculations,answers are approximately correct.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.5;page no: 223"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.5, Page:223 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 5\n",
"In question no. 5 expression I=To*S_gen is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.5, Page:223 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 5\")\n",
"print(\"In question no. 5 expression I=To*S_gen is derived which cannot be solve using python software.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.6;pg no: 223"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.6, Page:223 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 6\n",
"loss of available energy=irreversibility=To*deltaSc\n",
"deltaSc=deltaSs+deltaSe\n",
"change in enropy of system(deltaSs)=W/T in KJ/kg K 0.98\n",
"change in entropy of surrounding(deltaSe)=-Cp*(T-To)/To in KJ/kg K -2.8\n",
"loss of available energy(E) in KJ/kg= -550.49\n",
"loss of available energy(E)= -550.49\n",
"ratio of lost available exhaust gas energy to engine work=E/W= 0.524\n"
]
}
],
"source": [
"#cal of available energy and ratio of lost available exhaust gas energy to engine work\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.6, Page:223 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 6\")\n",
"To=(30.+273.);#temperature of surrounding in K\n",
"W=1050.;#work done in engine in KJ/kg\n",
"Cp=1.1;#specific heat at constant pressure in KJ/kg K\n",
"T=(800.+273.);#temperature of exhaust gas in K\n",
"print(\"loss of available energy=irreversibility=To*deltaSc\")\n",
"print(\"deltaSc=deltaSs+deltaSe\")\n",
"deltaSs=W/T\n",
"print(\"change in enropy of system(deltaSs)=W/T in KJ/kg K\"),round(deltaSs,2)\n",
"deltaSe=-Cp*(T-To)/To\n",
"print(\"change in entropy of surrounding(deltaSe)=-Cp*(T-To)/To in KJ/kg K\"),round(deltaSe,2)\n",
"E=To*(deltaSs+deltaSe)\n",
"print(\"loss of available energy(E) in KJ/kg=\"),round(E,2)\n",
"E=-E\n",
"print(\"loss of available energy(E)=\"),round(-E,2)\n",
"print(\"ratio of lost available exhaust gas energy to engine work=E/W=\"),round(E/W,3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.7;pg no: 224"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.7, Page:224 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 7\n",
"let us consider velocities and elevations to be given in reference to environment.Availability is given by\n",
"A=m*((u-uo)+Po*(v-vo)-To(s-so)+C^2/2+g*z)\n",
"dead state of water,from steam tables,uo=104.88 KJ/kg,vo=1.003*10^-3 m^3/kg,so=0.3674 KJ/kg K\n",
"for initial state of saturated vapour at 150 degree celcius\n",
"from steam tables,u1=2559.5 KJ/kg,v1=0.3928 m^3/kg,s1=6.8379 KJ/kg K\n",
"for final state of saturated liquid at 20 degree celcius\n",
"from steam tables,u2=83.95 KJ/kg,v2=0.001002 m^3/kg,s2=0.2966 KJ/kg K\n",
"substituting in the expression for availability\n",
"initial state availability,A1 in KJ\n",
"A1= 5650.31\n",
"final state availability,A2 in KJ\n",
"A2= 2.58\n",
"change in availability,deltaA in KJ= -5647.72\n",
"so initial availability =5650.28 KJ\n",
"final availability=2.58 KJ \n",
"change in availability=decrease by 5647.70 KJ \n"
]
}
],
"source": [
"#cal of initial,final and change in availability\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.7, Page:224 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 7\")\n",
"m=10;#mass of water in kg\n",
"C1=25;#initial velocity in m/s\n",
"C2=10;#final velocity in m/s\n",
"Po=0.1*1000;#environmental pressure in Kpa\n",
"To=(25+273.15);#environmental temperature in K\n",
"g=9.8;#acceleration due to gravity in m/s^2\n",
"z1=10;#initial elevation in m\n",
"z2=3;#final elevation in m\n",
"print(\"let us consider velocities and elevations to be given in reference to environment.Availability is given by\")\n",
"print(\"A=m*((u-uo)+Po*(v-vo)-To(s-so)+C^2/2+g*z)\")\n",
"print(\"dead state of water,from steam tables,uo=104.88 KJ/kg,vo=1.003*10^-3 m^3/kg,so=0.3674 KJ/kg K\")\n",
"uo=104.88;\n",
"vo=1.003*10**-3;\n",
"so=0.3674;\n",
"print(\"for initial state of saturated vapour at 150 degree celcius\")\n",
"print(\"from steam tables,u1=2559.5 KJ/kg,v1=0.3928 m^3/kg,s1=6.8379 KJ/kg K\")\n",
"u1=2559.5;\n",
"v1=0.3928;\n",
"s1=6.8379;\n",
"print(\"for final state of saturated liquid at 20 degree celcius\")\n",
"print(\"from steam tables,u2=83.95 KJ/kg,v2=0.001002 m^3/kg,s2=0.2966 KJ/kg K\")\n",
"u2=83.95;\n",
"v2=0.001002;\n",
"s2=0.2966;\n",
"print(\"substituting in the expression for availability\")\n",
"A1=m*((u1-uo)+Po*(v1-vo)-To*(s1-so)+C1**2*10**-3/2+g*z1*10**-3)\n",
"print(\"initial state availability,A1 in KJ\")\n",
"print(\"A1=\"),round(A1,2)\n",
"A2=m*((u2-uo)+Po*(v2-vo)-To*(s2-so)+C2**2*10**-3/2+g*z2*10**-3)\n",
"print(\"final state availability,A2 in KJ\")\n",
"print(\"A2=\"),round(A2,2)\n",
"deltaA=A2-A1\n",
"print(\"change in availability,deltaA in KJ=\"),round(deltaA,2)\n",
"print(\"so initial availability =5650.28 KJ\")\n",
"print(\"final availability=2.58 KJ \")\n",
"print(\"change in availability=decrease by 5647.70 KJ \")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.8;pg no: 225"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.8, Page:225 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 8\n",
"let inlet and exit states of turbine be denoted as 1 and 2\n",
"at inlet to turbine,\n",
"from steam tables,h1=3433.8 KJ/kg,s1=6.9759 KJ/kg K\n",
"at exit from turbine,\n",
"from steam tables,h2=2748 KJ/kg,s2=7.228 KJ/kg K\n",
"at dead state,\n",
"from steam tables,ho=104.96 KJ/kg,so=0.3673 KJ/kg K\n",
"availability of steam at inlet,A1 in KJ= 6792.43\n",
"so availability of steam at inlet=6792.43 KJ\n",
"applying first law of thermodynamics,\n",
"Q+m*h1=m*h2+W\n",
"so W in KJ/s= 2829.0\n",
"so turbine output=2829 KW\n",
"maximum possible turbine output will be available when irreversibility is zero.\n",
"W_rev=W_max=A1-A2\n",
"W_max in KJ/s= 3804.82\n",
"so maximum output=3804.81 KW\n",
"irreversibility can be estimated by the difference between the maximum output and turbine output.\n",
"I= in KW= 975.82\n",
"so irreversibility=975.81807 KW\n",
"NOTE=>In book,W_max is calculated wrong,so irreversibility also comes wrong,which are corrected above.\n"
]
}
],
"source": [
"#cal of availability of steam at inlet,turbine output,maximum possible turbine output,irreversibility\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.8, Page:225 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 8\")\n",
"m=5.;#steam flow rate in kg/s\n",
"p1=5.*1000.;#initial pressure of steam in Kpa\n",
"T1=(500.+273.15);#initial temperature of steam in K \n",
"p2=0.2*1000.;#final pressure of steam in Kpa\n",
"T1=(140.+273.15);#final temperature of steam in K\n",
"po=101.3;#pressure of steam at dead state in Kpa\n",
"To=(25.+273.15);#temperature of steam at dead state in K \n",
"Q=600.;#heat loss through turbine in KJ/s\n",
"print(\"let inlet and exit states of turbine be denoted as 1 and 2\")\n",
"print(\"at inlet to turbine,\")\n",
"print(\"from steam tables,h1=3433.8 KJ/kg,s1=6.9759 KJ/kg K\")\n",
"h1=3433.8;\n",
"s1=6.9759;\n",
"print(\"at exit from turbine,\")\n",
"print(\"from steam tables,h2=2748 KJ/kg,s2=7.228 KJ/kg K\")\n",
"h2=2748;\n",
"s2=7.228;\n",
"print(\"at dead state,\")\n",
"print(\"from steam tables,ho=104.96 KJ/kg,so=0.3673 KJ/kg K\")\n",
"ho=104.96;\n",
"so=0.3673;\n",
"A1=m*((h1-ho)-To*(s1-so))\n",
"print(\"availability of steam at inlet,A1 in KJ=\"),round(A1,2)\n",
"print(\"so availability of steam at inlet=6792.43 KJ\")\n",
"print(\"applying first law of thermodynamics,\")\n",
"print(\"Q+m*h1=m*h2+W\")\n",
"W=m*(h1-h2)-Q\n",
"print(\"so W in KJ/s=\"),round(W,2)\n",
"print(\"so turbine output=2829 KW\")\n",
"print(\"maximum possible turbine output will be available when irreversibility is zero.\")\n",
"print(\"W_rev=W_max=A1-A2\")\n",
"W_max=m*((h1-h2)-To*(s1-s2))\n",
"print(\"W_max in KJ/s=\"),round(W_max,2)\n",
"print(\"so maximum output=3804.81 KW\")\n",
"print(\"irreversibility can be estimated by the difference between the maximum output and turbine output.\")\n",
"I=W_max-W\n",
"print(\"I= in KW=\"),round(I,2)\n",
"print(\"so irreversibility=975.81807 KW\")\n",
"print(\"NOTE=>In book,W_max is calculated wrong,so irreversibility also comes wrong,which are corrected above.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.9;pg no: 226"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.9, Page:226 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 9\n",
"In question no.9 comparision between sublimation and vaporisation line is made which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.9, Page:226 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 9\")\n",
"print(\"In question no.9 comparision between sublimation and vaporisation line is made which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.10;pg no: 227"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.10, Page:227 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 10\n",
"In question no. 10 expression for change in internal energy of gas is derive which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.10, Page:227 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 10\")\n",
"print(\"In question no. 10 expression for change in internal energy of gas is derive which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.11;pg no: 227"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.11, Page:227 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 11\n",
"availability for heat reservoir(A_HR) in KJ/kg K 167.66\n",
"now availability for system(A_system) in KJ/kg K 194.44\n",
"net loss of available energy(A) in KJ/kg K= -26.78\n",
"so loss of available energy=26.77 KJ/kg K\n"
]
}
],
"source": [
"#cal of loss of available energy\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.11, Page:227 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 11\")\n",
"To=280.;#surrounding temperature in K\n",
"Q=500.;#heat removed in KJ\n",
"T1=835.;#temperature of reservoir in K\n",
"T2=720.;#temperature of system in K\n",
"A_HR=To*Q/T1\n",
"print(\"availability for heat reservoir(A_HR) in KJ/kg K\"),round(A_HR,2)\n",
"A_system=To*Q/T2\n",
"print(\"now availability for system(A_system) in KJ/kg K\"),round(A_system,2)\n",
"A=A_HR-A_system \n",
"print(\"net loss of available energy(A) in KJ/kg K=\"),round(A,2)\n",
"print(\"so loss of available energy=26.77 KJ/kg K\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.12;pg no: 228"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.12, Page:228 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 12\n",
"here dead state is given as 300 K and maximum possible work for given change of state of steam can be estimated by the difference of flow availability as given under:\n",
"W_max=W1-W2 in KJ/kg 1647.0\n",
"actual work from turbine,W_actual=h1-h2 in KJ/kg 1557.0\n",
"so actual work=1557 KJ/kg\n",
"maximum possible work=1647 KJ/kg\n"
]
}
],
"source": [
"#cal of actual,maximum possible work\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.12, Page:228 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 12\")\n",
"h1=4142;#enthalpy at entrance in KJ/kg\n",
"h2=2585;#enthalpy at exit in KJ/kg\n",
"W1=1787;#availability of steam at entrance in KJ/kg\n",
"W2=140;#availability of steam at exit in KJ/kg\n",
"print(\"here dead state is given as 300 K and maximum possible work for given change of state of steam can be estimated by the difference of flow availability as given under:\")\n",
"W_max=W1-W2\n",
"print(\"W_max=W1-W2 in KJ/kg\"),round(W_max,2)\n",
"W_actual=h1-h2\n",
"print(\"actual work from turbine,W_actual=h1-h2 in KJ/kg\"),round(W_actual,2)\n",
"print(\"so actual work=1557 KJ/kg\")\n",
"print(\"maximum possible work=1647 KJ/kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.13;pg no: 228"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.13, Page:228 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 13\n",
"reversible engine efficiency,n_rev=1-(T_min/T_max) 0.621\n",
"second law efficiency=n/n_rev 0.4026\n",
"in % 40.26\n"
]
}
],
"source": [
"#cal of second law efficiency\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.13, Page:228 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 13\")\n",
"T_min=(20.+273.);#minimum temperature reservoir temperature in K\n",
"T_max=(500.+273.);#maximum temperature reservoir temperature in K\n",
"n=0.25;#efficiency of heat engine\n",
"n_rev=1-(T_min/T_max)\n",
"print(\"reversible engine efficiency,n_rev=1-(T_min/T_max)\"),round(n_rev,4)\n",
"n/n_rev\n",
"print(\"second law efficiency=n/n_rev\"),round(n/n_rev,4)\n",
"print(\"in %\"),round(n*100/n_rev,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.14;pg no: 228"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.14, Page:228 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 14\n",
"expansion occurs in adiabatic conditions.\n",
"temperature after expansion can be obtained by considering adiabatic expansion\n",
"T2/T1=(V1/V2)^(y-1)\n",
"so T2= in K= 489.12\n",
"mass of air,m in kg= 20.91\n",
"change in entropy of control system,deltaSs=(S2-S1) in KJ/K= -0.0\n",
"here,there is no change in entropy of environment,deltaSe=0\n",
"total entropy change of combined system=deltaSc in KJ/K= -0.0\n",
"loss of available energy(E)=irreversibility in KJ= -0.603\n",
"so loss of available energy,E=0.603 KJ\n"
]
}
],
"source": [
"#cal of loss of available energy\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.14, Page:228 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 14\")\n",
"V_A=6.;#volume of compartment A in m^3\n",
"V_B=4.;#volume of compartment B in m^3\n",
"To=300.;#temperature of atmosphere in K\n",
"Po=1.*10**5;#atmospheric pressure in pa\n",
"P1=6.*10**5;#initial pressure in pa\n",
"T1=600.;#initial temperature in K\n",
"V1=V_A;#initial volume in m^3\n",
"V2=(V_A+V_B);#final volume in m^3\n",
"y=1.4;#expansion constant \n",
"R=287.;#gas constant in J/kg K\n",
"Cv=0.718;#specific heat at constant volume in KJ/kg K\n",
"print(\"expansion occurs in adiabatic conditions.\")\n",
"print(\"temperature after expansion can be obtained by considering adiabatic expansion\")\n",
"T2=T1*(V1/V2)**(y-1)\n",
"print(\"T2/T1=(V1/V2)^(y-1)\")\n",
"print(\"so T2= in K=\"),round(T2,2)\n",
"T2=489.12;#approx.\n",
"m=(P1*V1)/(R*T1)\n",
"print(\"mass of air,m in kg=\"),round(m,2)\n",
"m=20.91;#approx.\n",
"deltaSs=m*Cv*math.log(T2/T1)+m*R*10**-3*math.log(V2/V1)\n",
"print(\"change in entropy of control system,deltaSs=(S2-S1) in KJ/K=\"),round(deltaSs,2)\n",
"print(\"here,there is no change in entropy of environment,deltaSe=0\")\n",
"deltaSe=0;\n",
"deltaSc=deltaSs+deltaSe\n",
"print(\"total entropy change of combined system=deltaSc in KJ/K=\"),round(deltaSc,2)\n",
"E=To*deltaSc\n",
"print(\"loss of available energy(E)=irreversibility in KJ=\"),round(E,3)\n",
"print(\"so loss of available energy,E=0.603 KJ\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.15;pg no: 229"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.15, Page:229 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 15\n",
"In question no. 15 prove for ideal gas satisfies the cyclic relation is done which cannot be solve using python software.\n"
]
}
],
"source": [
"#cal of maximum possible work\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.15, Page:229 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 15\")\n",
"print(\"In question no. 15 prove for ideal gas satisfies the cyclic relation is done which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.16;pg no: 230"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.16, Page:230 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 16\n",
"availability or reversible work,W_rev=n_rev*Q1 in KJ/min 229.53\n",
"rate of irreversibility,I=W_rev-W_useful in KJ/sec 99.53\n",
"second law efficiency=W_useful/W_rev 0.57\n",
"in percentage 56.64\n",
"so availability=1.38*10^4 KJ/min\n",
"and rate of irreversibility=100 KW,second law efficiency=56.63 %\n",
"NOTE=>In this question,wrong values are put in expression for W_rev in book,however answer is calculated correctly.\n"
]
}
],
"source": [
"#cal of availability,rate of irreversibility and second law efficiency\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.16, Page:230 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 16\")\n",
"To=(17.+273.);#temperature of surrounding in K\n",
"T1=(700.+273.);#temperature of high temperature reservoir in K\n",
"T2=(30.+273.);#temperature of low temperature reservoir in K\n",
"Q1=2.*10**4;#rate of heat receive in KJ/min\n",
"W_useful=0.13*10**3;#output of engine in KW\n",
"n_rev=(1-T2/T1);\n",
"W_rev=n_rev*Q1\n",
"W_rev=W_rev/60.;#W_rev in KJ/s\n",
"print(\"availability or reversible work,W_rev=n_rev*Q1 in KJ/min\"),round(W_rev,2)\n",
"I=W_rev-W_useful\n",
"print(\"rate of irreversibility,I=W_rev-W_useful in KJ/sec\"),round(I,2)\n",
"W_useful/W_rev\n",
"print(\"second law efficiency=W_useful/W_rev\"),round(W_useful/W_rev,2)\n",
"W_useful*100/W_rev\n",
"print(\"in percentage\"),round(W_useful*100/W_rev,2)\n",
"print(\"so availability=1.38*10^4 KJ/min\")\n",
"print(\"and rate of irreversibility=100 KW,second law efficiency=56.63 %\")\n",
"print(\"NOTE=>In this question,wrong values are put in expression for W_rev in book,however answer is calculated correctly.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.17;pg no: 230"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.17, Page:230 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 17\n",
"loss of available energy=irreversibility=To*deltaSc\n",
"deltaSc=deltaSs+deltaSe\n",
"change in entropy of system=deltaSs\n",
"change in entropy of environment/surroundings=deltaSe\n",
"here heat addition process causing rise in pressure from 1.5 bar to 2.5 bar occurs isochorically.let initial and final states be given by subscript 1 and 2\n",
"P1/T1=P2/T2\n",
"so T2 in K= 555.0\n",
"heat addition to air in tank\n",
"Q in KJ/kg= 223.11\n",
"deltaSs in KJ/kg K= 0.67\n",
"deltaSe in KJ/kg K= -0.33\n",
"and deltaSc in KJ/kg K= 0.34\n",
"so loss of available energy(E)in KJ/kg= 101.55\n"
]
}
],
"source": [
"#cal of loss of available energy\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.17, Page:230 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 17\")\n",
"To=(27+273);#temperature of surrounding in K\n",
"T1=(60+273);#initial temperature of air in K\n",
"P1=1.5*10**5;#initial pressure of air in pa\n",
"P2=2.5*10**5;#final pressure of air in pa\n",
"T_reservoir=(400+273);#temperature of reservoir in K\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"print(\"loss of available energy=irreversibility=To*deltaSc\")\n",
"print(\"deltaSc=deltaSs+deltaSe\")\n",
"print(\"change in entropy of system=deltaSs\")\n",
"print(\"change in entropy of environment/surroundings=deltaSe\")\n",
"print(\"here heat addition process causing rise in pressure from 1.5 bar to 2.5 bar occurs isochorically.let initial and final states be given by subscript 1 and 2\")\n",
"print(\"P1/T1=P2/T2\")\n",
"T2=P2*T1/P1\n",
"print(\"so T2 in K=\"),round(T2,2)\n",
"print(\"heat addition to air in tank\")\n",
"deltaT=T2-T1;\n",
"Q=Cp*deltaT\n",
"print(\"Q in KJ/kg=\"),round(Q,2)\n",
"deltaSs=Q/T1\n",
"print(\"deltaSs in KJ/kg K=\"),round(deltaSs,2)\n",
"deltaSe=-Q/T_reservoir\n",
"print(\"deltaSe in KJ/kg K=\"),round(deltaSe,2)\n",
"deltaSc=deltaSs+deltaSe\n",
"print(\"and deltaSc in KJ/kg K=\"),round(deltaSc,2)\n",
"E=To*deltaSc\n",
"print(\"so loss of available energy(E)in KJ/kg=\"),round(E,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.18;pg no: 231"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.18, Page:231 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 18\n",
"In question no. 18,relation for T*ds using maxwell relation is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 7\n",
"print\"Example 7.18, Page:231 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 18\")\n",
"print(\"In question no. 18,relation for T*ds using maxwell relation is derived which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.19;pg no: 232"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.19, Page:232 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 19\n",
"clapeyron equation says,h_fg=T*v_fg*(dp/dT)_sat\n",
"from steam tables,vg=0.12736 m^3/kg,vf=0.001157 m^3/kg\n",
"v_fg in m^3/kg= 0.0\n",
"let us approximate,\n",
"(dp/dT)_sat_200oc=(deltaP/deltaT)_200oc=(P_205oc-P_195oc)/(205-195) in Mpa/oc\n",
"here from steam tables,P_205oc=1.7230 Mpa,P_195oc=1.3978 Mpa\n",
"substituting in clapeyron equation,\n",
"h_fg in KJ/kg 1941.25\n",
"so calculated enthalpy of vaporisation=1941.25 KJ/kg\n",
"and enthalpy of vaporisation from steam table=1940.7 KJ/kg\n"
]
}
],
"source": [
"#cal of enthalpy of vaporisation\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.19, Page:232 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 19\")\n",
"T=(200+273);#temperature of water in K\n",
"print(\"clapeyron equation says,h_fg=T*v_fg*(dp/dT)_sat\")\n",
"print(\"from steam tables,vg=0.12736 m^3/kg,vf=0.001157 m^3/kg\")\n",
"vg=0.12736;\n",
"vf=0.001157;\n",
"v_fg=(vg-vf)\n",
"print(\"v_fg in m^3/kg=\"),round(v_fg)\n",
"print(\"let us approximate,\")\n",
"print(\"(dp/dT)_sat_200oc=(deltaP/deltaT)_200oc=(P_205oc-P_195oc)/(205-195) in Mpa/oc\")\n",
"print(\"here from steam tables,P_205oc=1.7230 Mpa,P_195oc=1.3978 Mpa\")\n",
"P_205oc=1.7230;#pressure at 205 degree celcius in Mpa\n",
"P_195oc=1.3978;#pressure at 195 degree celcius in Mpa\n",
"(P_205oc-P_195oc)/(205-195)\n",
"print(\"substituting in clapeyron equation,\")\n",
"h_fg=T*v_fg*(P_205oc-P_195oc)*1000/(205-195)\n",
"print(\"h_fg in KJ/kg\"),round(h_fg,2)\n",
"print(\"so calculated enthalpy of vaporisation=1941.25 KJ/kg\")\n",
"print(\"and enthalpy of vaporisation from steam table=1940.7 KJ/kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.20;pg no: 232"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.20, Page:232 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 20\n",
"by clapeyron equation\n",
"h_fg=T2*v_fg*(do/dT)_sat \n",
"h_fg=T2*(vg-vf)*(deltaP/deltaT)in KJ/kg\n",
"by clapeyron-clausius equation,\n",
"log(P2/P1)_sat=(h_fg/R)*((1/T1)-(1/T2))_sat\n",
"log(P2/P1)=(h_fg/R)*((1/T1)-(1/T2))\n",
"so h_fg=log(P2/P1)*R/((1/T1)-(1/T2))in KJ/kg\n",
"% deviation from clapeyron equation in % 6.44\n",
"h_fg by clapeyron equation=159.49 KJ/kg\n",
"h_fg by clapeyron-clausius equation=169.76 KJ/kg\n",
"% deviation in h_fg value by clapeyron-clausius equation from the value from clapeyron equation=6.44%\n"
]
}
],
"source": [
"#cal of loss of available energy\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.20, Page:232 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 20\")\n",
"P2=260.96;#saturation pressure at -5 degree celcius\n",
"P1=182.60;#saturation pressure at -15 degree celcius\n",
"vg=0.07665;#specific volume of gas at -10 degree celcius in m^3/kg\n",
"vf=0.00070#specific volume at -10 degree celcius in m^3/kg\n",
"R=0.06876;#gas constant in KJ/kg K\n",
"h_fg=156.3;#enthalpy in KJ/kg K\n",
"T2=(-5.+273.);#temperature in K\n",
"T1=(-15.+273.);#temperature in K\n",
"print(\"by clapeyron equation\")\n",
"print(\"h_fg=T2*v_fg*(do/dT)_sat \")\n",
"print(\"h_fg=T2*(vg-vf)*(deltaP/deltaT)in KJ/kg\")\n",
"h_fg=T2*(vg-vf)*(P1-P2)/(T1-T2)\n",
"print(\"by clapeyron-clausius equation,\")\n",
"print(\"log(P2/P1)_sat=(h_fg/R)*((1/T1)-(1/T2))_sat\")\n",
"print(\"log(P2/P1)=(h_fg/R)*((1/T1)-(1/T2))\")\n",
"print(\"so h_fg=log(P2/P1)*R/((1/T1)-(1/T2))in KJ/kg\")\n",
"h_fg=math.log(P2/P1)*R/((1/T1)-(1/T2))\n",
"print(\"% deviation from clapeyron equation in %\"),round((169.76-159.49)*100/159.49,2)\n",
"print(\"h_fg by clapeyron equation=159.49 KJ/kg\")\n",
"print(\"h_fg by clapeyron-clausius equation=169.76 KJ/kg\")\n",
"print(\"% deviation in h_fg value by clapeyron-clausius equation from the value from clapeyron equation=6.44%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.21;pg no: 233"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.21, Page:233 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 21\n",
"volume expansion=(1/v)*(dv/dT)_P\n",
"isothermal compressibility=-(1/v)*(dv/dp)_T\n",
"let us write dv/dT=deltav/deltaT and dv/dP=deltav/deltaP.The difference may be taken for small pressure and temperature changes.\n",
"volume expansivity in K^-1,\n",
"=(1/v)*(dv/dT)_300Kpa\n",
"=(1/v_300Kpa_300oc)*((v_350oc-v_250oc)/(350-250))_300Kpa\n",
"from steam tables,v_300Kpa_300oc=0.8753 in m^3/kg,v_350oc=0.9534 in m^3/kg,v_250oc=0.7964 in m^3/kg\n",
"volume expansivity=1.7937*10^-3 K^-1\n",
"isothermal compressibility=k in Kpa^-1\n",
"k= 0.004\n",
"from steam tables,v_300Kpa_300oc=0.8753 in m^3/kg,v_350Kpa=0.76505 in m^3/kg,v_250Kpa=1.09575 in m^3/kg\n",
"so isothermal compressibility=3.778*10^-3 Kpa^-1\n"
]
}
],
"source": [
"#cal of volume expansivity and isothermal compressibility\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.21, Page:233 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 21\")\n",
"print(\"volume expansion=(1/v)*(dv/dT)_P\")\n",
"print(\"isothermal compressibility=-(1/v)*(dv/dp)_T\")\n",
"print(\"let us write dv/dT=deltav/deltaT and dv/dP=deltav/deltaP.The difference may be taken for small pressure and temperature changes.\")\n",
"print(\"volume expansivity in K^-1,\")\n",
"print(\"=(1/v)*(dv/dT)_300Kpa\")\n",
"print(\"=(1/v_300Kpa_300oc)*((v_350oc-v_250oc)/(350-250))_300Kpa\")\n",
"print(\"from steam tables,v_300Kpa_300oc=0.8753 in m^3/kg,v_350oc=0.9534 in m^3/kg,v_250oc=0.7964 in m^3/kg\")\n",
"v_300Kpa_300oc=0.8753;#specific volume at 300Kpa and 300 degree celcius\n",
"v_350oc=0.9534;#specific volume 350 degree celcius\n",
"v_250oc=0.7964;#specific volume 250 degree celcius\n",
"(1/v_300Kpa_300oc)*(v_350oc-v_250oc)/(350-250)\n",
"print(\"volume expansivity=1.7937*10^-3 K^-1\")\n",
"print(\"isothermal compressibility=k in Kpa^-1\")\n",
"v_350Kpa=0.76505;#specific volume 350 Kpa\n",
"v_250Kpa=1.09575;#specific volume 250 Kpa\n",
"k=(-1./v_300Kpa_300oc)*(v_350Kpa-v_250Kpa)/(350.-250.)\n",
"print(\"k=\"),round((-1./v_300Kpa_300oc)*(v_350Kpa-v_250Kpa)/(350.-250.),3)\n",
"print(\"from steam tables,v_300Kpa_300oc=0.8753 in m^3/kg,v_350Kpa=0.76505 in m^3/kg,v_250Kpa=1.09575 in m^3/kg\")\n",
"print(\"so isothermal compressibility=3.778*10^-3 Kpa^-1\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.22;pg no: 234"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.22, Page:234 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 22\n",
"filling of the tank is a transient flow(unsteady)process.for the transient filling process,considering subscripts i and f for initial and final states,\n",
"hi=uf\n",
"Cp*Ti=Cv*Tf\n",
"so Tf=Cp*Ti/Cv in K 417.33\n",
"inside final temperature,Tf=417.33 K\n",
"change in entropy,deltaS_gen=(Sf-Si)+deltaS_surr in KJ/kg K= 0.338\n",
"Cp*log(Tf/Ti)+0\n",
"change in entropy,deltaS_gen=0.3379 KJ/kg K\n",
"irreversibility,I in KJ/kg= 100.76\n",
"irreversibility,I=100.74 KJ/kg\n"
]
}
],
"source": [
"#cal of inside final temperature,change in entropy and irreversibility\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.22, Page:234 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 22\")\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"Cv=0.718;#specific heat at constant volume in KJ/kg K\n",
"Ti=(25+273.15);#atmospheric temperature in K\n",
"print(\"filling of the tank is a transient flow(unsteady)process.for the transient filling process,considering subscripts i and f for initial and final states,\")\n",
"print(\"hi=uf\")\n",
"print(\"Cp*Ti=Cv*Tf\")\n",
"Tf=Cp*Ti/Cv\n",
"print(\"so Tf=Cp*Ti/Cv in K\"),round(Tf,2)\n",
"print(\"inside final temperature,Tf=417.33 K\")\n",
"deltaS_gen=Cp*math.log(Tf/Ti)\n",
"print(\"change in entropy,deltaS_gen=(Sf-Si)+deltaS_surr in KJ/kg K=\"),round(deltaS_gen,4)\n",
"print(\"Cp*log(Tf/Ti)+0\")\n",
"print(\"change in entropy,deltaS_gen=0.3379 KJ/kg K\")\n",
"To=Ti;\n",
"I=To*deltaS_gen\n",
"print(\"irreversibility,I in KJ/kg=\"),round(I,2)\n",
"print(\"irreversibility,I=100.74 KJ/kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.23;pg no: 234"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.23, Page:234 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 23\n",
"here the combined closed system consists of hot water and heat engine.here there is no thermal reservoir in the system under consideration.for the maximum work output,irreversibility=0\n",
"therefore,d(E-To-S)/dt=W_max\n",
"or W_max=(E-To-S)1-(E-To-S)2\n",
"here E1=U1=m*Cp*T1,E2=U2=m*Cp*T2\n",
"therefore,W_max=m*Cp*(T1-T2)-To*m*Cp*log(T1/T2)in KJ\n",
"so maximum work in KJ= 40946.6\n"
]
}
],
"source": [
"#cal of maximum work\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.23, Page:234 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 23\")\n",
"m=75.;#mass of hot water in kg\n",
"T1=(400.+273.);#temperature of hot water in K\n",
"T2=(27.+273.);#temperature of environment in K\n",
"Cp=4.18;#specific heat of water in KJ/kg K\n",
"print(\"here the combined closed system consists of hot water and heat engine.here there is no thermal reservoir in the system under consideration.for the maximum work output,irreversibility=0\")\n",
"print(\"therefore,d(E-To-S)/dt=W_max\")\n",
"print(\"or W_max=(E-To-S)1-(E-To-S)2\")\n",
"print(\"here E1=U1=m*Cp*T1,E2=U2=m*Cp*T2\")\n",
"print(\"therefore,W_max=m*Cp*(T1-T2)-To*m*Cp*log(T1/T2)in KJ\")\n",
"To=T2;\n",
"W_max=m*Cp*(T1-T2)-To*m*Cp*math.log(T1/T2)\n",
"print(\"so maximum work in KJ=\"),round(W_max,1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 7.24;pg no: 235"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 7.24, Page:235 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 24\n",
"from steam tables,h1=h_50bar_600oc=3666.5 KJ/kg,s1=s_50bar_600oc=7.2589 KJ/kg K,h2=hg=2584.7 KJ/kg,s2=sg=8.1502 KJ/kg K\n",
"inlet stream availability in KJ/kg= 1587.19\n",
"input stream availability is equal to the input absolute availability.\n",
"exit stream availaability in KJ/kg 238.69\n",
"exit stream availability is equal to the exit absolute availability.\n",
"W_rev in KJ/kg\n",
"irreversibility=W_rev-W in KJ/kg 348.49\n",
"this irreversibility is in fact the availability loss.\n",
"inlet stream availability=1587.18 KJ/kg\n",
"exit stream availability=238.69 KJ/kg\n",
"irreversibility=348.49 KJ/kg\n",
"NOTE=>In book this question is solve using dead state temperature 25 degree celcius which is wrong as we have to take dead state temperature 15 degree celcius,now this question is correctly solve above taking dead state temperature 15 degree celcius as mentioned in question. \n"
]
}
],
"source": [
"#cal of inlet stream availability,exit stream availability and irreversibility\n",
"#intiation of all variables\n",
"# Chapter 7\n",
"import math\n",
"print\"Example 7.24, Page:235 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 7 Example 24\")\n",
"C1=150;#steam entering velocity in m/s\n",
"C2=50;#steam leaving velocity in m/s\n",
"To=(15+273);#dead state temperature in K\n",
"W=1000;#expansion work in KJ/kg\n",
"print(\"from steam tables,h1=h_50bar_600oc=3666.5 KJ/kg,s1=s_50bar_600oc=7.2589 KJ/kg K,h2=hg=2584.7 KJ/kg,s2=sg=8.1502 KJ/kg K\")\n",
"h1=3666.5;\n",
"s1=7.2589;\n",
"h2=2584.7;\n",
"s2=8.1502;\n",
"(h1+C1**2*10**-3/2)-To*s1\n",
"print(\"inlet stream availability in KJ/kg=\"),round((h1+C1**2*10**-3/2)-To*s1,2)\n",
"(h2+C2**2*10**-3/2)-To*s2\n",
"print(\"input stream availability is equal to the input absolute availability.\")\n",
"print(\"exit stream availaability in KJ/kg\"),round((h2+C2**2*10**-3/2)-To*s2,2)\n",
"print(\"exit stream availability is equal to the exit absolute availability.\")\n",
"print(\"W_rev in KJ/kg\")\n",
"W_rev=1587.18-238.69\n",
"W_rev-W\n",
"print(\"irreversibility=W_rev-W in KJ/kg\"),round(W_rev-W,2)\n",
"print(\"this irreversibility is in fact the availability loss.\")\n",
"print(\"inlet stream availability=1587.18 KJ/kg\")\n",
"print(\"exit stream availability=238.69 KJ/kg\")\n",
"print(\"irreversibility=348.49 KJ/kg\")\n",
"print(\"NOTE=>In book this question is solve using dead state temperature 25 degree celcius which is wrong as we have to take dead state temperature 15 degree celcius,now this question is correctly solve above taking dead state temperature 15 degree celcius as mentioned in question. \")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I+Engineering Thermodynamics/chapter8_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Chapter 8:Vapour Power Cycles"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.1;pg no: 260"
]
},
{
"cell_type": "code",
"execution_count": 88,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.1, Page:260 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 1\n",
"T-S representation for carnot cycle operating between pressure of 7 MPa and 7KPa is shown in fig.\n",
"enthalpy at state 2,h2= hg at 7 MPa\n",
"from steam table,h=2772.1 KJ/kg\n",
"entropy at state 2,s2=sg at 7MPa\n",
"from steam table,s2=5.8133 KJ/kg K\n",
"enthalpy and entropy at state 3,\n",
"from steam table,h3=hf at 7 MPa =1267 KJ/kg and s3=sf at 7 MPa=3.1211 KJ/kg K\n",
"for process 2-1,s1=s2.Let dryness fraction at state 1 be x1 \n",
"from steam table, sf at 7 KPa=0.5564 KJ/kg K,sfg at 7 KPa=7.7237 KJ/kg K\n",
"s1=s2=sf+x1*sfg\n",
"so x1= 0.68\n",
"from steam table,hf at 7 KPa=162.60 KJ/kg,hfg at 7 KPa=2409.54 KJ/kg\n",
"enthalpy at state 1,h1 in KJ/kg= 1802.53\n",
"let dryness fraction at state 4 be x4\n",
"for process 4-3,s4=s3=sf+x4*sfg\n",
"so x4= 0.33\n",
"enthalpy at state 4,h4 in KJ/kg= 962.81\n",
"thermal efficiency=net work/heat added\n",
"expansion work per kg=(h2-h1) in KJ/kg 969.57\n",
"compression work per kg=(h3-h4) in KJ/kg(+ve) 304.19\n",
"heat added per kg=(h2-h3) in KJ/kg(-ve) 1505.1\n",
"net work per kg=(h2-h1)-(h3-h4) in KJ/kg 665.38\n",
"thermal efficiency 0.44\n",
"in percentage 44.21\n",
"so thermal efficiency=44.21%\n",
"turbine work=969.57 KJ/kg(+ve)\n",
"compression work=304.19 KJ/kg(-ve)\n"
]
}
],
"source": [
"#cal of thermal efficiency,turbine work,compression work\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.1, Page:260 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 1\")\n",
"print(\"T-S representation for carnot cycle operating between pressure of 7 MPa and 7KPa is shown in fig.\")\n",
"print(\"enthalpy at state 2,h2= hg at 7 MPa\")\n",
"print(\"from steam table,h=2772.1 KJ/kg\")\n",
"h2=2772.1;\n",
"print(\"entropy at state 2,s2=sg at 7MPa\")\n",
"print(\"from steam table,s2=5.8133 KJ/kg K\")\n",
"s2=5.8133;\n",
"print(\"enthalpy and entropy at state 3,\")\n",
"print(\"from steam table,h3=hf at 7 MPa =1267 KJ/kg and s3=sf at 7 MPa=3.1211 KJ/kg K\")\n",
"h3=1267;\n",
"s3=3.1211;\n",
"print(\"for process 2-1,s1=s2.Let dryness fraction at state 1 be x1 \")\n",
"s1=s2;\n",
"print(\"from steam table, sf at 7 KPa=0.5564 KJ/kg K,sfg at 7 KPa=7.7237 KJ/kg K\")\n",
"sf=0.5564;\n",
"sfg=7.7237;\n",
"print(\"s1=s2=sf+x1*sfg\")\n",
"x1=(s2-sf)/sfg\n",
"print(\"so x1=\"),round(x1,2) \n",
"x1=0.6806;#approx.\n",
"print(\"from steam table,hf at 7 KPa=162.60 KJ/kg,hfg at 7 KPa=2409.54 KJ/kg\")\n",
"hf=162.60;\n",
"hfg=2409.54;\n",
"h1=hf+x1*hfg\n",
"print(\"enthalpy at state 1,h1 in KJ/kg=\"),round(h1,2)\n",
"print(\"let dryness fraction at state 4 be x4\")\n",
"print(\"for process 4-3,s4=s3=sf+x4*sfg\")\n",
"s4=s3;\n",
"x4=(s4-sf)/sfg\n",
"print(\"so x4=\"),round(x4,2)\n",
"x4=0.3321;#approx.\n",
"h4=hf+x4*hfg\n",
"print(\"enthalpy at state 4,h4 in KJ/kg=\"),round(h4,2)\n",
"print(\"thermal efficiency=net work/heat added\")\n",
"(h2-h1)\n",
"print(\"expansion work per kg=(h2-h1) in KJ/kg\"),round((h2-h1),2)\n",
"(h3-h4)\n",
"print(\"compression work per kg=(h3-h4) in KJ/kg(+ve)\"),round((h3-h4),2)\n",
"(h2-h3)\n",
"print(\"heat added per kg=(h2-h3) in KJ/kg(-ve)\"),round((h2-h3),2)\n",
"(h2-h1)-(h3-h4)\n",
"print(\"net work per kg=(h2-h1)-(h3-h4) in KJ/kg\"),round((h2-h1)-(h3-h4),2)\n",
"((h2-h1)-(h3-h4))/(h2-h3)\n",
"print(\"thermal efficiency\"),round(((h2-h1)-(h3-h4))/(h2-h3),2)\n",
"print(\"in percentage\"),round((((h2-h1)-(h3-h4))/(h2-h3))*100,2)\n",
"print(\"so thermal efficiency=44.21%\")\n",
"print(\"turbine work=969.57 KJ/kg(+ve)\")\n",
"print(\"compression work=304.19 KJ/kg(-ve)\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.2;pg no: 261"
]
},
{
"cell_type": "code",
"execution_count": 89,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.2, Page:261 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 2\n",
"from steam tables,at 5 MPa,hf_5MPa=1154.23 KJ/kg,sf_5MPa=2.92 KJ/kg K\n",
"hg_5MPa=2794.3 KJ/kg,sg_5MPa=5.97 KJ/kg K\n",
"from steam tables,at 5 Kpa,hf_5KPa=137.82 KJ/kg,sf_5KPa=0.4764 KJ/kg K\n",
"hg_5KPa=2561.5 KJ/kg,sg_5KPa=8.3951 KJ/kg K,vf_5KPa=0.001005 m^3/kg\n",
"as process 2-3 is isentropic,so s2=s3\n",
"and s3=sf_5KPa+x3*sfg_5KPa=s2=sg_5MPa\n",
"so x3= 0.69\n",
"hence enthalpy at 3,\n",
"h3 in KJ/kg= 1819.85\n",
"enthalpy at 2,h2=hg_5KPa=2794.3 KJ/kg\n",
"process 1-4 is isentropic,so s1=s4\n",
"s1=sf_5KPa+x4*(sg_5KPa-sf_5KPa)\n",
"so x4= 0.31\n",
"enthalpy at 4,h4 in KJ/kg= 884.31\n",
"enthalpy at 1,h1 in KJ/kg= 1154.23\n",
"carnot cycle(1-2-3-4-1) efficiency:\n",
"n_carnot=net work/heat added\n",
"n_carnot 0.43\n",
"in percentage 42.96\n",
"so n_carnot=42.95%\n",
"In rankine cycle,1-2-3-5-6-1,\n",
"pump work,h6-h5=vf_5KPa*(p6-p5)in KJ/kg 5.02\n",
"h5 KJ/kg= 137.82\n",
"hence h6 in KJ/kg 142.84\n",
"net work in rankine cycle=(h2-h3)-(h6-h5)in KJ/kg 969.43\n",
"heat added=(h2-h6)in KJ/kg 2651.46\n",
"rankine cycle efficiency(n_rankine)= 0.37\n",
"in percentage 36.56\n",
"so n_rankine=36.56%\n"
]
}
],
"source": [
"#cal of n_carnot,n_rankine\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.2, Page:261 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 2\")\n",
"print(\"from steam tables,at 5 MPa,hf_5MPa=1154.23 KJ/kg,sf_5MPa=2.92 KJ/kg K\")\n",
"print(\"hg_5MPa=2794.3 KJ/kg,sg_5MPa=5.97 KJ/kg K\")\n",
"hf_5MPa=1154.23;\n",
"sf_5MPa=2.92;\n",
"hg_5MPa=2794.3;\n",
"sg_5MPa=5.97;\n",
"print(\"from steam tables,at 5 Kpa,hf_5KPa=137.82 KJ/kg,sf_5KPa=0.4764 KJ/kg K\")\n",
"print(\"hg_5KPa=2561.5 KJ/kg,sg_5KPa=8.3951 KJ/kg K,vf_5KPa=0.001005 m^3/kg\")\n",
"hf_5KPa=137.82;\n",
"sf_5KPa=0.4764;\n",
"hg_5KPa=2561.5;\n",
"sg_5KPa=8.3951;\n",
"vf_5KPa=0.001005;\n",
"print(\"as process 2-3 is isentropic,so s2=s3\")\n",
"print(\"and s3=sf_5KPa+x3*sfg_5KPa=s2=sg_5MPa\")\n",
"s2=sg_5MPa;\n",
"s3=s2;\n",
"x3=(s3-sf_5KPa)/(sg_5KPa-sf_5KPa)\n",
"print(\"so x3=\"),round(x3,2)\n",
"x3=0.694;#approx.\n",
"print(\"hence enthalpy at 3,\")\n",
"h3=hf_5KPa+x3*(hg_5KPa-hf_5KPa)\n",
"print(\"h3 in KJ/kg=\"),round(h3,2)\n",
"print(\"enthalpy at 2,h2=hg_5KPa=2794.3 KJ/kg\")\n",
"print(\"process 1-4 is isentropic,so s1=s4\")\n",
"s1=sf_5MPa;\n",
"print(\"s1=sf_5KPa+x4*(sg_5KPa-sf_5KPa)\")\n",
"x4=(s1-sf_5KPa)/(sg_5KPa-sf_5KPa)\n",
"print(\"so x4=\"),round(x4,2)\n",
"x4=0.308;#approx.\n",
"h4=hf_5KPa+x4*(hg_5KPa-hf_5KPa)\n",
"print(\"enthalpy at 4,h4 in KJ/kg=\"),round(h4,2)\n",
"h1=hf_5MPa\n",
"h2=hg_5MPa;\n",
"n_carnot=((h2-h3)-(h1-h4))/(h2-h1)\n",
"print(\"enthalpy at 1,h1 in KJ/kg=\"),round(h1,2)\n",
"print(\"carnot cycle(1-2-3-4-1) efficiency:\")\n",
"print(\"n_carnot=net work/heat added\")\n",
"print(\"n_carnot\"),round(n_carnot,2)\n",
"print(\"in percentage\"),round(n_carnot*100,2)\n",
"print(\"so n_carnot=42.95%\")\n",
"print(\"In rankine cycle,1-2-3-5-6-1,\")\n",
"p6=5000;#boiler pressure in KPa\n",
"p5=5;#condenser pressure in KPa\n",
"vf_5KPa*(p6-p5)\n",
"print(\"pump work,h6-h5=vf_5KPa*(p6-p5)in KJ/kg\"),round(vf_5KPa*(p6-p5),2)\n",
"h5=hf_5KPa;\n",
"print(\"h5 KJ/kg=\"),round(hf_5KPa,2)\n",
"h6=h5+(vf_5KPa*(p6-p5))\n",
"print(\"hence h6 in KJ/kg\"),round(h6,2)\n",
"(h2-h3)-(h6-h5)\n",
"print(\"net work in rankine cycle=(h2-h3)-(h6-h5)in KJ/kg\"),round((h2-h3)-(h6-h5),2)\n",
"(h2-h6)\n",
"print(\"heat added=(h2-h6)in KJ/kg\"),round((h2-h6),2)\n",
"n_rankine=((h2-h3)-(h6-h5))/(h2-h6)\n",
"print(\"rankine cycle efficiency(n_rankine)=\"),round(n_rankine,2)\n",
"print(\"in percentage\"),round(n_rankine*100,2)\n",
"print(\"so n_rankine=36.56%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.3;pg no: 263"
]
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.3, Page:263 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 3\n",
"from steam tables,h2=hg_40bar=3092.5 KJ/kg\n",
"s2=sg_40bar=6.5821 KJ/kg K\n",
"h4=hf_0.05bar=137.82 KJ/kg,hfg=2423.7 KJ/kg \n",
"s4=sf_0.05bar=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\n",
"v4=vf_0.05bar=0.001005 m^3/kg\n",
"let the dryness fraction at state 3 be x3,\n",
"for ideal process,2-3,s2=s3\n",
"s2=s3=6.5821=sf_0.05bar+x3*sfg_0.05bar\n",
"so x3= 0.77\n",
"h3=hf_0.05bar+x3*hfg_0.05bar in KJ/kg\n",
"for pumping process,\n",
"h1-h4=v4*deltap=v4*(p1-p4)\n",
"so h1=h4+v4*(p1-p4) in KJ/kg 141.83\n",
"pump work per kg of steam in KJ/kg 4.01\n",
"net work per kg of steam =(expansion work-pump work)per kg of steam\n",
"=(h2-h3)-(h1-h4) in KJ/kg= 1081.75\n",
"cycle efficiency=net work/heat added 0.37\n",
"in percentage 36.66\n",
"so net work per kg of steam=1081.74 KJ/kg\n",
"cycle efficiency=36.67%\n",
"pump work per kg of steam=4.02 KJ/kg\n"
]
}
],
"source": [
"#cal of net work per kg of steam,cycle efficiency,pump work per kg of steam\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.3, Page:263 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 3\")\n",
"print(\"from steam tables,h2=hg_40bar=3092.5 KJ/kg\")\n",
"h2=3092.5;\n",
"print(\"s2=sg_40bar=6.5821 KJ/kg K\")\n",
"s2=6.5821;\n",
"print(\"h4=hf_0.05bar=137.82 KJ/kg,hfg=2423.7 KJ/kg \")\n",
"h4=137.82;\n",
"hfg=2423.7;\n",
"print(\"s4=sf_0.05bar=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\")\n",
"s4=0.4764;\n",
"sfg=7.9187;\n",
"print(\"v4=vf_0.05bar=0.001005 m^3/kg\")\n",
"v4=0.001005;\n",
"print(\"let the dryness fraction at state 3 be x3,\")\n",
"print(\"for ideal process,2-3,s2=s3\")\n",
"s3=s2;\n",
"print(\"s2=s3=6.5821=sf_0.05bar+x3*sfg_0.05bar\")\n",
"x3=(s2-s4)/(sfg)\n",
"print(\"so x3=\"),round(x3,2)\n",
"x3=0.7711;#approx.\n",
"print(\"h3=hf_0.05bar+x3*hfg_0.05bar in KJ/kg\")\n",
"h3=h4+x3*hfg\n",
"print(\"for pumping process,\")\n",
"print(\"h1-h4=v4*deltap=v4*(p1-p4)\")\n",
"p1=40*100;#pressure of steam enter in turbine in mPa\n",
"p4=0.05*100;#pressure of steam leave turbine in mPa\n",
"h1=h4+v4*(p1-p4)\n",
"print(\"so h1=h4+v4*(p1-p4) in KJ/kg\"),round(h1,2)\n",
"(h1-h4)\n",
"print(\"pump work per kg of steam in KJ/kg\"),round((h1-h4),2)\n",
"print(\"net work per kg of steam =(expansion work-pump work)per kg of steam\")\n",
"(h2-h3)-(h1-h4)\n",
"print(\"=(h2-h3)-(h1-h4) in KJ/kg=\"),round((h2-h3)-(h1-h4),2)\n",
"print(\"cycle efficiency=net work/heat added\"),round(((h2-h3)-(h1-h4))/(h2-h1),2)\n",
"print(\"in percentage\"),round(((h2-h3)-(h1-h4))*100/(h2-h1),2)\n",
"print(\"so net work per kg of steam=1081.74 KJ/kg\")\n",
"print(\"cycle efficiency=36.67%\")\n",
"print(\"pump work per kg of steam=4.02 KJ/kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.4;pg no: 264"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.4, Page:264 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 4\n",
"Let us assume that the condensate leaves condenser as saturated liquid and the expansion in turbine and pumping processes are isentropic.\n",
"from steam tables,h2=h_20MPa=3238.2 KJ/kg\n",
"s2=6.1401 KJ/kg K\n",
"h5=h_0.005MPa in KJ/kg\n",
"from steam tables,at 0.005 MPa,hf=137.82 KJ/kg,hfg=2423.7 KJ/kg,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\n",
"h5=hf+0.9*hfg in KJ/kg 2319.15\n",
"s5 in KJ/kg K= 7.6\n",
"h6=hf=137.82 KJ/kg\n",
"it is given that temperature at state 4 is 500 degree celcius and due to isentropic processes s4=s5=7.6032 KJ/kg K.The state 4 can be conveniently located on mollier chart by the intersection of 500 degree celcius constant temperature line and entropy value of 7.6032 KJ/kg K and the pressure and enthalpy obtained.but these shall be approximate.\n",
"The state 4 can also be located by interpolation using steam table.The entropy value of 7.6032 KJ/kg K lies between the superheated steam states given under,p=1.20 MPa,s at 1.20 MPa=7.6027 KJ/kg K\n",
"p=1.40 MPa,s at 1.40 MPa=7.6027 KJ/kg K\n",
"by interpolation state 4 lies at pressure=\n",
"=1.399,approx.=1.40 MPa\n",
"thus,steam leaves HP turbine at 1.40 MPa\n",
"enthalpy at state 4,h4=3474.1 KJ/kg\n",
"for process 2-33,s2=s3=6.1401 KJ/kg K.The state 3 thus lies in wet region as s3sg at 40 bar(6.0701 KJ/kg K)so state 10 lies in superheated region at 40 bar pressure.\n",
"From steam table by interpolation,T10=370.6oc,so h10=3141.81 KJ/kg\n",
"Let dryness fraction at state 9 be x9 so,\n",
"s9=6.6582=sf at 4 bar+x9*sfg at 4 bar\n",
"from steam tables,at 4 bar,sf=1.7766 KJ/kg K,sfg=5.1193 KJ/kg K\n",
"x9=(s9-sf)/sfg 0.95\n",
"h9=hf at 4 bar+x9*hfg at 4 bar in KJ/kg\n",
"from steam tables,at 4 bar,hf=604.74 KJ/kg,hfg=2133.8 KJ/kg\n",
"Assuming the state of fluid leaving open feed water heater to be saturated liquid at respective pressures i.e.\n",
"h11=hf at 4 bar=604.74 KJ/kg,v11=0.001084 m^3/kg=vf at 4 bar\n",
"h13=hf at 40 bar=1087.31 KJ/kg,v13=0.001252 m^3/kg=vf at40 bar\n",
"For process 4-8,i.e in CEP.\n",
"h8 in KJ/kg= 138.22\n",
"For process 11-12,i.e in FP2,\n",
"h12=h11+v11*(40-4)*10^2 in KJ/kg 608.64\n",
"For process 13-1_a i.e. in FP1,h1_a= in KJ/kg= 1107.34\n",
"m1*3141.81+(1-m1)*608.64=1087.31\n",
"so m1=(1087.31-608.64)/(3141.81-608.64)in kg\n",
"Applying energy balance on open feed water heater 1 (OFWH1)\n",
"m1*h10+(1-m1)*h12)=1*h13\n",
"so m1 in kg= 0.19\n",
"Applying energy balance on open feed water heater 2 (OFWH2)\n",
"m2*h9+(1-m1-m2)*h8=(1-m1)*h11\n",
"so m2 in kg= 0.15\n",
"Thermal efficiency of cycle,n= 0.51\n",
"W_CEP in KJ/kg steam from boiler= 0.26\n",
"W_FP1=(h1_a-h13)in KJ/kg of steam from boiler 20.0\n",
"W_FP2 in KJ/kg of steam from boiler= 3.17\n",
"W_CEP+W_FP1+W_FP2 in KJ/kg of steam from boiler= 23.46\n",
"n= 0.51\n",
"in percentage 51.37\n",
"so cycle thermal efficiency,na=46.18%\n",
"nb=49.76%\n",
"nc=51.37%\n",
"hence it is obvious that efficiency increases with increase in number of feed heaters.\n"
]
}
],
"source": [
"#cal of maximum possible work\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.6, Page:267 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 6\")\n",
"print(\"case (a) When there is no feed water heater\")\n",
"print(\"Thermal efficiency of cycle=((h2-h3)-(h1-h4))/(h2-h1)\")\n",
"print(\"from steam tables,h2=h at 200 bar,650oc=3675.3 KJ/kg,s2=s at 200 bar,650oc=6.6582 KJ/kg K,h4=hf at 0.05 bar=137.82 KJ/kg,v4=vf at 0.05 bar=0.001005 m^3/kg\")\n",
"h2=3675.3;\n",
"s2=6.6582;\n",
"h4=137.82;\n",
"v4=0.001005;\n",
"print(\"hf at 0.05 bar=137.82 KJ/kg,hfg at 0.05 bar=2423.7 KJ/kg,sf at 0.05 bar=0.4764 KJ/kg K,sfg at 0.05 bar=7.9187 KJ/kg K\")\n",
"hf=137.82;\n",
"hfg=2423.7;\n",
"sf=0.4764;\n",
"sfg=7.9187;\n",
"print(\"For process 2-3,s2=s3.Let dryness fraction at 3 be x3.\")\n",
"s3=s2;\n",
"print(\"s3=6.6582=sf at 0.05 bar+x3*sfg at 0.05 bar\")\n",
"x3=(s3-sf)/sfg\n",
"print(\"so x3=\"),round(x3,2)\n",
"x3=0.781;#approx.\n",
"print(\"h3=hf at 0.05 bar+x3*hfg at 0.05 bar in KJ/kg\")\n",
"h3=hf+x3*hfg\n",
"print(\"For pumping process 4-1,\")\n",
"print(\"h1-h4=v4*deltap\")\n",
"h1=h4+v4*(200-0.5)*10**2\n",
"print(\"h1= in KJ/kg=\"),round(h1,2)\n",
"((h2-h3)-(h1-h4))/(h2-h1)\n",
"print(\"Thermal efficiency of cycle=\"),round(((h2-h3)-(h1-h4))/(h2-h1),2)\n",
"print(\"in percentage\"),round(((h2-h3)-(h1-h4))*100/(h2-h1),2)\n",
"print(\"case (b) When there is only one feed water heater working at 8 bar\")\n",
"print(\"here,let mass of steam bled for feed heating be m kg\")\n",
"print(\"For process 2-6,s2=s6=6.6582 KJ/kg K\")\n",
"s6=s2;\n",
"print(\"Let dryness fraction at state 6 be x6\")\n",
"print(\"s6=sf at 8 bar+x6*sfg at 8 bar\")\n",
"print(\"from steam tables,hf at 8 bar=721.11 KJ/kg,vf at 8 bar=0.001115 m^3/kg,hfg at 8 bar=2048 KJ/kg,sf at 8 bar=2.0462 KJ/kg K,sfg at 8 bar=4.6166 KJ/kg K\")\n",
"hf=721.11;\n",
"vf=0.001115;\n",
"hfg=2048;\n",
"sf=2.0462;\n",
"sfg=4.6166;\n",
"x6=(s6-sf)/sfg\n",
"print(\"substituting entropy values,x6=\"),round(x6,2)\n",
"x6=0.999;#approx.\n",
"print(\"h6=hf at at 8 bar+x6*hfg at 8 bar in KJ/kg\")\n",
"h6=hf+x6*hfg\n",
"print(\"Assuming the state of fluid leaving open feed water heater to be saturated liquid at 8 bar.h7=hf at 8 bar=721.11 KJ/kg\")\n",
"h7=721.11;\n",
"h5=h4+v4*(8-.05)*10**2\n",
"print(\"For process 4-5,h5 in KJ/kg\"),round(h5,2)\n",
"print(\"Applying energy balance at open feed water heater,\")\n",
"print(\"m*h6+(1-m)*h5=1*h7\")\n",
"m=(h7-h5)/(h6-h5)\n",
"print(\"so m= in kg\"),round(m,2)\n",
"h7=hf;\n",
"v7=vf;\n",
"h1=h7+v7*(200-8)*10**2\n",
"print(\"For process 7-1,h1 in KJ/kg=\"),round(h1,2)\n",
"print(\"here h7=hf at 8 bar,v7=vf at 8 bar\")\n",
"#TE=((h2-h6)+(1-m)*(h6-h3)-((1-m)*(h5-h4)+(h1-h7))/(h2-h1)\n",
"print(\"Thermal efficiency of cycle=0.4976\")\n",
"print(\"in percentage=49.76\")\n",
"print(\"case (c) When there are two feed water heaters working at 40 bar and 4 bar\")\n",
"print(\"here, let us assume the mass of steam at 40 bar,4 bar to be m1 kg and m2 kg respectively.\")\n",
"print(\"2-10-9-3,s2=s10=s9=s3=6.6582 KJ/kg K\")\n",
"s3=s2;\n",
"s9=s3;\n",
"s10=s9;\n",
"print(\"At state 10.s10>sg at 40 bar(6.0701 KJ/kg K)so state 10 lies in superheated region at 40 bar pressure.\")\n",
"print(\"From steam table by interpolation,T10=370.6oc,so h10=3141.81 KJ/kg\")\n",
"T10=370.6;\n",
"h10=3141.81;\n",
"print(\"Let dryness fraction at state 9 be x9 so,\") \n",
"print(\"s9=6.6582=sf at 4 bar+x9*sfg at 4 bar\")\n",
"print(\"from steam tables,at 4 bar,sf=1.7766 KJ/kg K,sfg=5.1193 KJ/kg K\")\n",
"sf=1.7766;\n",
"sfg=5.1193;\n",
"x9=(s9-sf)/sfg\n",
"print(\"x9=(s9-sf)/sfg\"),round(x9,2)\n",
"x9=0.9536;#approx.\n",
"print(\"h9=hf at 4 bar+x9*hfg at 4 bar in KJ/kg\")\n",
"print(\"from steam tables,at 4 bar,hf=604.74 KJ/kg,hfg=2133.8 KJ/kg\")\n",
"hf=604.74;\n",
"hfg=2133.8;\n",
"h9=hf+x9*hfg \n",
"print(\"Assuming the state of fluid leaving open feed water heater to be saturated liquid at respective pressures i.e.\")\n",
"print(\"h11=hf at 4 bar=604.74 KJ/kg,v11=0.001084 m^3/kg=vf at 4 bar\")\n",
"h11=604.74;\n",
"v11=0.001084;\n",
"print(\"h13=hf at 40 bar=1087.31 KJ/kg,v13=0.001252 m^3/kg=vf at40 bar\")\n",
"h13=1087.31;\n",
"v13=0.001252;\n",
"print(\"For process 4-8,i.e in CEP.\")\n",
"h8=h4+v4*(4-0.05)*10**2\n",
"print(\"h8 in KJ/kg=\"),round(h8,2)\n",
"print(\"For process 11-12,i.e in FP2,\")\n",
"h12=h11+v11*(40-4)*10**2\n",
"print(\"h12=h11+v11*(40-4)*10^2 in KJ/kg\"),round(h12,2)\n",
"h1_a=h13+v13*(200-40)*10**2\n",
"print(\"For process 13-1_a i.e. in FP1,h1_a= in KJ/kg=\"),round(h1_a,2)\n",
"print(\"m1*3141.81+(1-m1)*608.64=1087.31\")\n",
"print(\"so m1=(1087.31-608.64)/(3141.81-608.64)in kg\")\n",
"m1=(1087.31-608.64)/(3141.81-608.64)\n",
"print(\"Applying energy balance on open feed water heater 1 (OFWH1)\")\n",
"print(\"m1*h10+(1-m1)*h12)=1*h13\")\n",
"m1=(h13-h12)/(h10-h12)\n",
"print(\"so m1 in kg=\"),round(m1,2)\n",
"print(\"Applying energy balance on open feed water heater 2 (OFWH2)\")\n",
"print(\"m2*h9+(1-m1-m2)*h8=(1-m1)*h11\")\n",
"m2=(1-m1)*(h11-h8)/(h9-h8)\n",
"print(\"so m2 in kg=\"),round(m2,2)\n",
"W_CEP=(1-m1-m2)*(h8-h4)\n",
"W_FP1=(h1_a-h13)\n",
"W_FP2=(1-m1)*(h12-h11)\n",
"n=(((h2-h10)+(1-m1)*(h10-h9)+(1-m1-m2)*(h9-h3))-(W_CEP+W_FP1+W_FP2))/(h2-h1_a)\n",
"print(\"Thermal efficiency of cycle,n=\"),round(n,2)\n",
"print(\"W_CEP in KJ/kg steam from boiler=\"),round(W_CEP,2)\n",
"print(\"W_FP1=(h1_a-h13)in KJ/kg of steam from boiler\"),round(W_FP1)\n",
"print(\"W_FP2 in KJ/kg of steam from boiler=\"),round(W_FP2,2)\n",
"W_CEP+W_FP1+W_FP2\n",
"print(\"W_CEP+W_FP1+W_FP2 in KJ/kg of steam from boiler=\"),round(W_CEP+W_FP1+W_FP2,2)\n",
"n=(((h2-h10)+(1-m1)*(h10-h9)+(1-m1-m2)*(h9-h3))-(W_CEP+W_FP1+W_FP2))/(h2-h1_a)\n",
"print(\"n=\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"so cycle thermal efficiency,na=46.18%\")\n",
"print(\"nb=49.76%\")\n",
"print(\"nc=51.37%\")\n",
"print(\"hence it is obvious that efficiency increases with increase in number of feed heaters.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.7;pg no: 272"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.7, Page:272 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 7\n",
"from steam tables,\n",
"h2=h at 50 bar,500oc=3433.8 KJ/kg,s2=s at 50 bar,500oc=6.9759 KJ/kg K\n",
"s3=s2=6.9759 KJ/kg K\n",
"by interpolation from steam tables,\n",
"T3=183.14oc at 5 bar,h3=2818.03 KJ/kg,h4= h at 5 bar,400oc=3271.9 KJ/kg,s4= s at 5 bar,400oc=7.7938 KJ/kg K\n",
"for expansion process 4-5,s4=s5=7.7938 KJ/kg K\n",
"let dryness fraction at state 5 be x5\n",
"s5=sf at 0.05 bar+x5*sfg at 0.05 bar\n",
"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\n",
"so x5= 0.92\n",
"h5=hf at 0.05 bar+x5*hfg at 0.05 bar in KJ/kg\n",
"from steam tables,hf at 0.05 bar=137.82 KJ/kg,hfg at 0.05 bar=2423.7 KJ/kg\n",
"h6=hf at 0.05 bar=137.82 KJ/kg\n",
"v6=vf at 0.05 bar=0.001005 m^3/kg\n",
"for process 6-1 in feed pump,h1 in KJ/kg= 142.84\n",
"cycle efficiency=W_net/Q_add\n",
"Wt in KJ/kg= 1510.35\n",
"W_pump=(h1-h6)in KJ/kg 5.02\n",
"W_net=Wt-W_pump in KJ/kg 1505.33\n",
"Q_add in KJ/kg= 3290.96\n",
"cycle efficiency= 0.4574\n",
"in percentage= 45.74\n",
"we know ,1 hp=0.7457 KW\n",
"specific steam consumption in kg/hp hr= 1.78\n",
"work ratio=net work/positive work 0.9967\n",
"so cycle efficiency=45.74%,specific steam consumption =1.78 kg/hp hr,work ratio=0.9967\n"
]
}
],
"source": [
"#cal of cycle efficiency,specific steam consumption,work ratio\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.7, Page:272 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 7\")\n",
"print(\"from steam tables,\")\n",
"print(\"h2=h at 50 bar,500oc=3433.8 KJ/kg,s2=s at 50 bar,500oc=6.9759 KJ/kg K\")\n",
"h2=3433.8;\n",
"s2=6.9759;\n",
"print(\"s3=s2=6.9759 KJ/kg K\")\n",
"s3=s2;\n",
"print(\"by interpolation from steam tables,\")\n",
"print(\"T3=183.14oc at 5 bar,h3=2818.03 KJ/kg,h4= h at 5 bar,400oc=3271.9 KJ/kg,s4= s at 5 bar,400oc=7.7938 KJ/kg K\")\n",
"T3=183.14;\n",
"h3=2818.03;\n",
"h4=3271.9;\n",
"s4=7.7938;\n",
"print(\"for expansion process 4-5,s4=s5=7.7938 KJ/kg K\")\n",
"s5=s4;\n",
"print(\"let dryness fraction at state 5 be x5\")\n",
"print(\"s5=sf at 0.05 bar+x5*sfg at 0.05 bar\")\n",
"print(\"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\")\n",
"sf=0.4764;\n",
"sfg=7.9187;\n",
"x5=(s5-sf)/sfg\n",
"print(\"so x5=\"),round(x5,2)\n",
"x5=0.924;#approx.\n",
"print(\"h5=hf at 0.05 bar+x5*hfg at 0.05 bar in KJ/kg\")\n",
"print(\"from steam tables,hf at 0.05 bar=137.82 KJ/kg,hfg at 0.05 bar=2423.7 KJ/kg\")\n",
"hf=137.82;\n",
"hfg=2423.7;\n",
"h5=hf+x5*hfg \n",
"print(\"h6=hf at 0.05 bar=137.82 KJ/kg\")\n",
"h6=137.82;\n",
"print(\"v6=vf at 0.05 bar=0.001005 m^3/kg\")\n",
"v6=0.001005;\n",
"p1=50.;#steam generation pressure in bar\n",
"p6=0.05;#steam entering temperature in turbine in bar\n",
"h1=h6+v6*(p1-p6)*100\n",
"print(\"for process 6-1 in feed pump,h1 in KJ/kg=\"),round(h1,2)\n",
"print(\"cycle efficiency=W_net/Q_add\")\n",
"Wt=(h2-h3)+(h4-h5)\n",
"print(\"Wt in KJ/kg=\"),round(Wt,2)\n",
"W_pump=(h1-h6)\n",
"print(\"W_pump=(h1-h6)in KJ/kg\"),round(W_pump,2)\n",
"W_net=Wt-W_pump\n",
"print(\"W_net=Wt-W_pump in KJ/kg\"),round(W_net,2)\n",
"Q_add=(h2-h1)\n",
"print(\"Q_add in KJ/kg=\"),round(Q_add,2)\n",
"print(\"cycle efficiency=\"),round(W_net/Q_add,4)\n",
"W_net*100/Q_add\n",
"print(\"in percentage=\"),round(W_net*100/Q_add,2)\n",
"print(\"we know ,1 hp=0.7457 KW\")\n",
"print(\"specific steam consumption in kg/hp hr=\"),round(0.7457*3600/W_net,2)\n",
"print(\"work ratio=net work/positive work\"),round(W_net/Wt,4)\n",
"print(\"so cycle efficiency=45.74%,specific steam consumption =1.78 kg/hp hr,work ratio=0.9967\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.8;pg no: 273"
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.8, Page:273 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 8\n",
"from steam tables,at state 2,h2=3301.8 KJ/kg,s2=6.7193 KJ/kg K\n",
"h5=hf at 0.05 bar=137.82 KJ/kg,v5= vf at 0.05 bar=0.001005 m^3/kg\n",
"Let mass of steam bled for feed heating be m kg/kg of steam generated in boiler.Let us also assume that condensate leaves closed feed water heater as saturated liquid i.e\n",
"h8=hf at 3 bar=561.47 KJ/kg\n",
"for process 2-3-4,s2=s3=s4=6.7193 KJ/kg K\n",
"Let dryness fraction at state 3 and state 4 be x3 and x4 respectively.\n",
"s3=6.7193=sf at 3 bar+x3* sfg at 3 bar\n",
"from steam tables,sf=1.6718 KJ/kg K,sfg=5.3201 KJ/kg K\n",
"so x3= 0.95\n",
"s4=6.7193=sf at 0.05 bar+x4* sfg at 0.05 bar\n",
"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\n",
"so x4= 0.79\n",
"thus,h3=hf at 3 bar+x3* hfg at 3 bar in KJ/kg\n",
"here from steam tables,at 3 bar,hf_3bar=561.47 KJ/kg,hfg_3bar=2163.8 KJ/kg K\n",
"h4=hf at 0.05 bar+x4*hfg at 0.05 bar in KJ/kg\n",
"from steam tables,at 0.05 bar,hf=137.82 KJ/kg,hfg=2423.7 KJ/kg\n",
"assuming process across trap to be of throttling type so,h8=h9=561.47 KJ/kg.Assuming v5=v6,\n",
"pumping work=(h7-h6)=v5*(p1-p5)in KJ/kg\n",
"for mixing process between condenser and feed pump,\n",
"(1-m)*h5+m*h9=1*h6\n",
"h6=m(h9-h5)+h5\n",
"we get,h6=137.82+m*423.65\n",
"therefore h7=h6+6.02=143.84+m*423.65\n",
"Applying energy balance at closed feed water heater;\n",
"m*h3+(1-m)*h7=m*h8+(Cp*T_cond)\n",
"so (m*2614.92)+(1-m)*(143.84+m*423.65)=m*561.47+480.7\n",
"so m=0.144 kg\n",
"steam bled for feed heating=0.144 kg/kg steam generated\n",
"The net power output,W_net in KJ/kg steam generated= 1167.27\n",
"mass of steam required to be generated in kg/s= 26.23\n",
"or in kg/hr\n",
"so capacity of boiler required=94428 kg/hr\n",
"overall thermal efficiency=W_net/Q_add\n",
"here Q_add in KJ/kg= 3134.56\n",
"overall thermal efficiency= 0.37\n",
"in percentage= 37.24\n",
"so overall thermal efficiency=37.24%\n"
]
}
],
"source": [
"#cal of mass of steam bled for feed heating,capacity of boiler required,overall thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.8, Page:273 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 8\")\n",
"T_cond=115;#condensate temperature in degree celcius\n",
"Cp=4.18;#specific heat at constant pressure in KJ/kg K\n",
"P=30*10**3;#actual alternator output in KW\n",
"n_boiler=0.9;#boiler efficiency\n",
"n_alternator=0.98;#alternator efficiency\n",
"print(\"from steam tables,at state 2,h2=3301.8 KJ/kg,s2=6.7193 KJ/kg K\")\n",
"h2=3301.8;\n",
"s2=6.7193;\n",
"print(\"h5=hf at 0.05 bar=137.82 KJ/kg,v5= vf at 0.05 bar=0.001005 m^3/kg\")\n",
"h5=137.82;\n",
"v5=0.001005;\n",
"print(\"Let mass of steam bled for feed heating be m kg/kg of steam generated in boiler.Let us also assume that condensate leaves closed feed water heater as saturated liquid i.e\")\n",
"print(\"h8=hf at 3 bar=561.47 KJ/kg\")\n",
"h8=561.47;\n",
"print(\"for process 2-3-4,s2=s3=s4=6.7193 KJ/kg K\")\n",
"s3=s2;\n",
"s4=s3;\n",
"print(\"Let dryness fraction at state 3 and state 4 be x3 and x4 respectively.\")\n",
"print(\"s3=6.7193=sf at 3 bar+x3* sfg at 3 bar\")\n",
"print(\"from steam tables,sf=1.6718 KJ/kg K,sfg=5.3201 KJ/kg K\")\n",
"sf_3bar=1.6718;\n",
"sfg_3bar=5.3201;\n",
"x3=(s3-sf_3bar)/sfg_3bar\n",
"print(\"so x3=\"),round(x3,2)\n",
"x3=0.949;#approx.\n",
"print(\"s4=6.7193=sf at 0.05 bar+x4* sfg at 0.05 bar\")\n",
"print(\"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\")\n",
"sf=0.4764;\n",
"sfg=7.9187;\n",
"x4=(s4-sf)/sfg\n",
"print(\"so x4=\"),round(x4,2)\n",
"x4=0.788;#approx.\n",
"print(\"thus,h3=hf at 3 bar+x3* hfg at 3 bar in KJ/kg\")\n",
"print(\"here from steam tables,at 3 bar,hf_3bar=561.47 KJ/kg,hfg_3bar=2163.8 KJ/kg K\")\n",
"hf_3bar=561.47;\n",
"hfg_3bar=2163.8;\n",
"h3=hf_3bar+x3*hfg_3bar \n",
"print(\"h4=hf at 0.05 bar+x4*hfg at 0.05 bar in KJ/kg\")\n",
"print(\"from steam tables,at 0.05 bar,hf=137.82 KJ/kg,hfg=2423.7 KJ/kg\")\n",
"hf=137.82;\n",
"hfg=2423.7;\n",
"h4=hf+x4*hfg\n",
"print(\"assuming process across trap to be of throttling type so,h8=h9=561.47 KJ/kg.Assuming v5=v6,\")\n",
"h9=h8;\n",
"v6=v5;\n",
"print(\"pumping work=(h7-h6)=v5*(p1-p5)in KJ/kg\")\n",
"p1=60;#pressure of steam in high pressure turbine in bar\n",
"p5=0.05;#pressure of steam in low pressure turbine in bar\n",
"v5*(p1-p5)*100\n",
"print(\"for mixing process between condenser and feed pump,\")\n",
"print(\"(1-m)*h5+m*h9=1*h6\")\n",
"print(\"h6=m(h9-h5)+h5\")\n",
"print(\"we get,h6=137.82+m*423.65\")\n",
"print(\"therefore h7=h6+6.02=143.84+m*423.65\")\n",
"print(\"Applying energy balance at closed feed water heater;\")\n",
"print(\"m*h3+(1-m)*h7=m*h8+(Cp*T_cond)\")\n",
"print(\"so (m*2614.92)+(1-m)*(143.84+m*423.65)=m*561.47+480.7\")\n",
"print(\"so m=0.144 kg\")\n",
"m=0.144;\n",
"h6=137.82+m*423.65;\n",
"h7=143.84+m*423.65;\n",
"print(\"steam bled for feed heating=0.144 kg/kg steam generated\")\n",
"W_net=(h2-h3)+(1-m)*(h3-h4)-(1-m)*(h7-h6)\n",
"print(\"The net power output,W_net in KJ/kg steam generated=\"),round(W_net,2)\n",
"P/(n_alternator*W_net)\n",
"print(\"mass of steam required to be generated in kg/s=\"),round(P/(n_alternator*W_net),2)\n",
"print(\"or in kg/hr\")\n",
"26.23*3600\n",
"print(\"so capacity of boiler required=94428 kg/hr\")\n",
"print(\"overall thermal efficiency=W_net/Q_add\")\n",
"Q_add=(h2-Cp*T_cond)/n_boiler\n",
"print(\"here Q_add in KJ/kg=\"),round(Q_add,2) \n",
"W_net/Q_add\n",
"print(\"overall thermal efficiency=\"),round(W_net/Q_add,2)\n",
"W_net*100/Q_add\n",
"print(\"in percentage=\"),round(W_net*100/Q_add,2)\n",
"print(\"so overall thermal efficiency=37.24%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.9;pg no: 275"
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.9, Page:275 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 9\n",
"At inlet to first turbine stage,h2=3230.9 KJ/kg,s2=6.9212 KJ/kg K\n",
"For ideal expansion process,s2=s3\n",
"By interpolation,T3=190.97 degree celcius from superheated steam tables at 6 bar,h3=2829.63 KJ/kg\n",
"actual stste at exit of first stage,h3_a in KJ/kg= 2909.88\n",
"actual state 3_a shall be at 232.78 degree celcius,6 bar,so s3_a KJ/kg K= 7.1075\n",
"for second stage,s3_a=s4;By interpolation,s4=7.1075=sf at 1 bar+x4*sfg at 1 bar\n",
"from steam tables,at 1 bar,sf=1.3026 KJ/kg K,sfg=6.0568 KJ/kg K\n",
"so x4= 0.96\n",
"h4=hf at 1 bar+x4*hfg at 1 bar in KJ/kg\n",
"from steam tables,at 1 bar,hf=417.46 KJ/kg,hfg=2258.0 KJ/kg\n",
"actual enthalpy at exit from second stage,h4_a in KJ/kg= 2646.48\n",
"actual dryness fraction,x4_a=>h4_a=hf at 1 bar+x4_a*hfg at 1 bar\n",
"so x4_a= 0.99\n",
"x4_a=0.987,actual entropy,s4_a=7.2806 KJ/kg K\n",
"for third stage,s4_a=7.2806=sf at 0.075 bar+x5*sfg at 0.075 bar\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"so x5= 0.87\n",
"h5=2270.43 KJ/kg\n",
"actual enthalpy at exit from third stage,h5_a in KJ/kg= 2345.64\n",
"Let mass of steam bled out be m1 and m2 kg at 6 bar,1 bar respectively.\n",
"By heat balance on first closed feed water heater,(see schematic arrangement)\n",
"h11=hf at 6 bar=670.56 KJ\n",
"m1*h3_a+h10=m1*h11+4.18*150\n",
"(m1*2829.63)+h10=(m1*670.56)+627\n",
"h10+2159.07*m1=627\n",
"By heat balance on second closed feed water heater,(see schematic arrangement)\n",
"h7=hf at 1 bar=417.46 KJ/kg\n",
"m2*h4+(1-m1-m2)*4.18*38=(m1+m2)*h7+4.18*95*(1-m1-m2)\n",
"m2*2646.4+(1-m1-m2)*158.84=((m1+m2)*417.46)+(397.1*(1-m1-m2))\n",
"m2*2467.27-m1*179.2-238.26=0\n",
"heat balance at point of mixing,\n",
"h10=(m1+m2)*h8+(1-m1-m2)*4.18*95\n",
"neglecting pump work,h7=h8\n",
"h10=m2*417.46+(1-m1-m2)*397.1\n",
"substituting h10 and solving we get,m1=0.1293 kg and m2=0.1059 kg/kg of steam generated\n",
"Turbine output per kg of steam generated,Wt in KJ/kg of steam generated= 780.445\n",
"Rate of steam generation required in kg/s= 19.22\n",
"in kg/hr\n",
"capacity of drain pump i.e. FP shown in layout in kg/hr= 16273.96\n",
"so capacity of drain pump=16273.96 kg/hr\n"
]
}
],
"source": [
"#cal of capacity of drain pump\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.9, Page:275 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 9\")\n",
"P=15*10**3;#turbine output in KW\n",
"print(\"At inlet to first turbine stage,h2=3230.9 KJ/kg,s2=6.9212 KJ/kg K\")\n",
"h2=3230.9;\n",
"s2=6.9212;\n",
"print(\"For ideal expansion process,s2=s3\")\n",
"s3=s2;\n",
"print(\"By interpolation,T3=190.97 degree celcius from superheated steam tables at 6 bar,h3=2829.63 KJ/kg\")\n",
"T3=190.97;\n",
"h3=2829.63;\n",
"h3_a=h2-0.8*(h2-h3)\n",
"print(\"actual stste at exit of first stage,h3_a in KJ/kg=\"),round(h3_a,2)\n",
"s3_a=7.1075;\n",
"print(\"actual state 3_a shall be at 232.78 degree celcius,6 bar,so s3_a KJ/kg K=\"),round(s3_a,4)\n",
"print(\"for second stage,s3_a=s4;By interpolation,s4=7.1075=sf at 1 bar+x4*sfg at 1 bar\")\n",
"s4=7.1075;\n",
"print(\"from steam tables,at 1 bar,sf=1.3026 KJ/kg K,sfg=6.0568 KJ/kg K\")\n",
"sf=1.3026;\n",
"sfg=6.0568;\n",
"x4=(s4-sf)/sfg\n",
"print(\"so x4=\"),round(x4,2)\n",
"x4=0.958;#approx.\n",
"print(\"h4=hf at 1 bar+x4*hfg at 1 bar in KJ/kg\")\n",
"print(\"from steam tables,at 1 bar,hf=417.46 KJ/kg,hfg=2258.0 KJ/kg\")\n",
"hf=417.46;\n",
"hfg=2258.0;\n",
"h4=hf+x4*hfg\n",
"h4_a=h3_a-.8*(h3_a-h4)\n",
"print(\"actual enthalpy at exit from second stage,h4_a in KJ/kg=\"),round(h4_a,2)\n",
"print(\"actual dryness fraction,x4_a=>h4_a=hf at 1 bar+x4_a*hfg at 1 bar\")\n",
"x4_a=(h4_a-hf)/hfg\n",
"print(\"so x4_a=\"),round(x4_a,2)\n",
"print(\"x4_a=0.987,actual entropy,s4_a=7.2806 KJ/kg K\")\n",
"s4_a=7.2806;\n",
"print(\"for third stage,s4_a=7.2806=sf at 0.075 bar+x5*sfg at 0.075 bar\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"sf=0.5764;\n",
"sfg=7.6750;\n",
"x5=(s4_a-sf)/sfg\n",
"print(\"so x5=\"),round(x5,2)\n",
"x5=0.8735;#approx.\n",
"print(\"h5=2270.43 KJ/kg\")\n",
"h5=2270.43;\n",
"h5_a=h4_a-0.8*(h4_a-h5)\n",
"print(\"actual enthalpy at exit from third stage,h5_a in KJ/kg=\"),round(h5_a,2)\n",
"print(\"Let mass of steam bled out be m1 and m2 kg at 6 bar,1 bar respectively.\")\n",
"print(\"By heat balance on first closed feed water heater,(see schematic arrangement)\")\n",
"print(\"h11=hf at 6 bar=670.56 KJ\")\n",
"h11=670.56;\n",
"print(\"m1*h3_a+h10=m1*h11+4.18*150\")\n",
"print(\"(m1*2829.63)+h10=(m1*670.56)+627\")\n",
"print(\"h10+2159.07*m1=627\")\n",
"print(\"By heat balance on second closed feed water heater,(see schematic arrangement)\")\n",
"print(\"h7=hf at 1 bar=417.46 KJ/kg\")\n",
"h7=417.46;\n",
"print(\"m2*h4+(1-m1-m2)*4.18*38=(m1+m2)*h7+4.18*95*(1-m1-m2)\")\n",
"print(\"m2*2646.4+(1-m1-m2)*158.84=((m1+m2)*417.46)+(397.1*(1-m1-m2))\")\n",
"print(\"m2*2467.27-m1*179.2-238.26=0\")\n",
"print(\"heat balance at point of mixing,\")\n",
"print(\"h10=(m1+m2)*h8+(1-m1-m2)*4.18*95\")\n",
"print(\"neglecting pump work,h7=h8\")\n",
"print(\"h10=m2*417.46+(1-m1-m2)*397.1\")\n",
"print(\"substituting h10 and solving we get,m1=0.1293 kg and m2=0.1059 kg/kg of steam generated\")\n",
"m1=0.1293;\n",
"m2=0.1059;\n",
"Wt=(h2-h3_a)+(1-m1)*(h3_a-h4_a)+(1-m1-m2)*(h4_a-h5_a)\n",
"print(\"Turbine output per kg of steam generated,Wt in KJ/kg of steam generated=\"),round(Wt,3)\n",
"P/Wt\n",
"print(\"Rate of steam generation required in kg/s=\"),round(P/Wt,2)\n",
"print(\"in kg/hr\")\n",
"P*3600/Wt\n",
"(m1+m2)*69192\n",
"print(\"capacity of drain pump i.e. FP shown in layout in kg/hr=\"),round((m1+m2)*69192,2)\n",
"print(\"so capacity of drain pump=16273.96 kg/hr\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.10;pg no: 277"
]
},
{
"cell_type": "code",
"execution_count": 97,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.10, Page:277 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 10\n",
"at inlet to HP turbine,h2=3287.1 KJ/kg,s2=6.6327 KJ/kg K\n",
"By interpolation state 3 i.e. for isentropic expansion betweeen 2-3 lies at 328.98oc at 30 bar.h3=3049.48 KJ/kg\n",
"actual enthapy at 3_a,h3_a in KJ/kg= 3097.0\n",
"enthalpy at inlet to LP turbine,h4=3230.9 KJ/kg,s4=6.9212 KJ K\n",
"for ideal expansion from 4-6,s4=s6.Let dryness fraction at state 6 be x6.\n",
"s6=6.9212=sf at 0.075 bar+x6* sfg at 0.075 bar in KJ/kg K\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"so x6= 0.83\n",
"h6=hf at 0.075 bar+x6*hfg at 0.075 bar in KJ/kg K\n",
"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\n",
"for actual expansion process in LP turbine.\n",
"h6_a=h4-0.85*(h4-h6) in KJ/kg 2319.4\n",
"Ideally,enthalpy at bleed point can be obtained by locating state 5 using s5=s4.The pressure at bleed point shall be saturation pressure corresponding to the 140oc i.e from steam tables.Let dryness fraction at state 5 be x5.\n",
"s5_a=6.9212=sf at 140oc+x5*sfg at 140oc\n",
"from steam tables,at 140oc,sf=1.7391 KJ/kg K,sfg=5.1908 KJ/kg K\n",
"so x5= 1.0\n",
"h5=hf at 140oc+x5*hfg at 140oc in KJ/kg\n",
"from steam tables,at 140oc,hf=589.13 KJ/kg,hfg=2144.7 KJ/kg\n",
"actual enthalpy,h5_a in KJ/kg= 2790.16\n",
"enthalpy at exit of open feed water heater,h9=hf at 30 bar=1008.42 KJ/kg\n",
"specific volume at inlet of CEP,v7=0.001008 m^3/kg\n",
"enthalpy at inlet of CEP,h7=168.79 KJ/kg\n",
"for pumping process 7-8,h8 in KJ/kg= 169.15\n",
"Applying energy balance at open feed water heater.Let mass of bled steam be m kg per kg of steam generated.\n",
"m*h5+(1-m)*h8=h9\n",
"so m in kg /kg of steam generated= 0.33\n",
"For process on feed pump,9-1,v9=vf at 140oc=0.00108 m^3/kg\n",
"h1= in KJ/kg= 1015.59\n",
"Net work per kg of steam generated,W_net=in KJ/kg steam generated= 938.83\n",
"heat added per kg of steam generated,q_add in KJ/kg of steam generated= 2405.41\n",
"Thermal efficiency,n= 0.39\n",
"in percentage= 39.03\n",
"so thermal efficiency=39.03%%\n",
"NOTE=>In this question there is some calculation mistake while calculating W_net and q_add in book, which is corrected above and the answers may vary.\n"
]
}
],
"source": [
"#cal of cycle efficiency\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.10, Page:277 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 10\")\n",
"print(\"at inlet to HP turbine,h2=3287.1 KJ/kg,s2=6.6327 KJ/kg K\")\n",
"h2=3287.1;\n",
"s2=6.6327;\n",
"print(\"By interpolation state 3 i.e. for isentropic expansion betweeen 2-3 lies at 328.98oc at 30 bar.h3=3049.48 KJ/kg\")\n",
"h3=3049.48;\n",
"h3_a=h2-0.80*(h2-h3)\n",
"print(\"actual enthapy at 3_a,h3_a in KJ/kg=\"),round(h3_a,2)\n",
"print(\"enthalpy at inlet to LP turbine,h4=3230.9 KJ/kg,s4=6.9212 KJ K\")\n",
"h4=3230.9;\n",
"s4=6.9212;\n",
"print(\"for ideal expansion from 4-6,s4=s6.Let dryness fraction at state 6 be x6.\")\n",
"s6=s4;\n",
"print(\"s6=6.9212=sf at 0.075 bar+x6* sfg at 0.075 bar in KJ/kg K\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"sf=0.5764;\n",
"sfg=7.6750;\n",
"x6=(s6-sf)/sfg\n",
"print(\"so x6=\"),round(x6,2)\n",
"x6=0.827;#approx.\n",
"print(\"h6=hf at 0.075 bar+x6*hfg at 0.075 bar in KJ/kg K\")\n",
"print(\"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\")\n",
"hf=168.79;\n",
"hfg=2406.0;\n",
"h6=hf+x6*hfg\n",
"print(\"for actual expansion process in LP turbine.\")\n",
"h6_a=h4-0.85*(h4-h6)\n",
"print(\"h6_a=h4-0.85*(h4-h6) in KJ/kg\"),round(h6_a,2)\n",
"print(\"Ideally,enthalpy at bleed point can be obtained by locating state 5 using s5=s4.The pressure at bleed point shall be saturation pressure corresponding to the 140oc i.e from steam tables.Let dryness fraction at state 5 be x5.\")\n",
"p5=3.61;\n",
"s5=s4;\n",
"print(\"s5_a=6.9212=sf at 140oc+x5*sfg at 140oc\")\n",
"print(\"from steam tables,at 140oc,sf=1.7391 KJ/kg K,sfg=5.1908 KJ/kg K\")\n",
"sf=1.7391;\n",
"sfg=5.1908;\n",
"x5=(s5-sf)/sfg\n",
"print(\"so x5=\"),round(x5,2)\n",
"x5=0.99;#approx.\n",
"print(\"h5=hf at 140oc+x5*hfg at 140oc in KJ/kg\")\n",
"print(\"from steam tables,at 140oc,hf=589.13 KJ/kg,hfg=2144.7 KJ/kg\")\n",
"hf=589.13;\n",
"hfg=2144.7;\n",
"h5=hf+x5*hfg\n",
"h5_a=h4-0.85*(h4-h5)\n",
"print(\"actual enthalpy,h5_a in KJ/kg=\"),round(h5_a,2)\n",
"print(\"enthalpy at exit of open feed water heater,h9=hf at 30 bar=1008.42 KJ/kg\")\n",
"h9=1008.42;\n",
"print(\"specific volume at inlet of CEP,v7=0.001008 m^3/kg\")\n",
"v7=0.001008;\n",
"print(\"enthalpy at inlet of CEP,h7=168.79 KJ/kg\")\n",
"h7=168.79;\n",
"h8=h7+v7*(3.61-0.075)*10**2\n",
"print(\"for pumping process 7-8,h8 in KJ/kg=\"),round(h8,2)\n",
"print(\"Applying energy balance at open feed water heater.Let mass of bled steam be m kg per kg of steam generated.\")\n",
"print(\"m*h5+(1-m)*h8=h9\")\n",
"m=(h9-h8)/(h5-h8)\n",
"print(\"so m in kg /kg of steam generated=\"),round(m,2)\n",
"print(\"For process on feed pump,9-1,v9=vf at 140oc=0.00108 m^3/kg\")\n",
"v9=0.00108;\n",
"h1=h9+v9*(70-3.61)*10**2\n",
"print(\"h1= in KJ/kg=\"),round(h1,2) \n",
"W_net=(h2-h3_a)+(h4-h5_a)+(1-m)*(h5_a-h6_a)-((1-m)*(h8-h7)+(h1-h9))\n",
"print(\"Net work per kg of steam generated,W_net=in KJ/kg steam generated=\"),round(W_net,2)\n",
"q_add=(h2-h1)+(h4-h3_a)\n",
"print(\"heat added per kg of steam generated,q_add in KJ/kg of steam generated=\"),round(q_add,2)\n",
"n=W_net/q_add\n",
"print(\"Thermal efficiency,n=\"),round(n,2)\n",
"n=n*100\n",
"print(\"in percentage=\"),round(n,2)\n",
"print(\"so thermal efficiency=39.03%%\")\n",
"print(\"NOTE=>In this question there is some calculation mistake while calculating W_net and q_add in book, which is corrected above and the answers may vary.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.11;pg no: 279"
]
},
{
"cell_type": "code",
"execution_count": 98,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.11, Page:279 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 11\n",
"Enthalpy of steam entering ST1,h2=3308.6 KJ/kg,s2=6.3443 KJ/kg K\n",
"for isentropic expansion 2-3-4-5,s2=s3=s4=s5\n",
"Let dryness fraction of states 3,4 and 5 be x3,x4 and x5\n",
"s3=6.3443=sf at 10 bar+x3*sfg at 10 bar\n",
"so x3=(s3-sf)/sfg\n",
"from steam tables,at 10 bar,sf=2.1387 KJ/kg K,sfg=4.4478 KJ/kg K\n",
"h3=hf+x3*hfg in KJ/kg\n",
"from steam tables,hf=762.81 KJ/kg,hfg=2015.3 KJ/kg\n",
"s4=6.3443=sf at 1.5 bar+x4*sfg at 1.5 bar\n",
"so x4=(s4-sf)/sfg\n",
"from steam tables,at 1.5 bar,sf=1.4336 KJ/kg K,sfg=5.7897 KJ/kg K\n",
"so h4=hf+x4*hfg in KJ/kg\n",
"from steam tables,at 1.5 bar,hf=467.11 KJ/kg,hfg=2226.5 KJ/kg\n",
"s5=6.3443=sf at 0.05 bar+x5*sfg at 0.05 bar\n",
"so x5=(s5-sf)/sfg\n",
"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\n",
"h5=hf+x5*hfg in KJ/kg\n",
"from steam tables,at 0.05 bar,hf=137.82 KJ/kg,hfg=2423.7 KJ/kg\n",
"h6=hf at 0.05 bar=137.82 KJ/kg\n",
"v6=vf at 0.05 bar=0.001005 m^3/kg\n",
"h7=h6+v6*(1.5-0.05)*10^2 in KJ/kg\n",
"h8=hf at 1.5 bar=467.11 KJ/kg\n",
"v8=0.001053 m^3/kg=vf at 1.5 bar\n",
"h9=h8+v8*(150-1.5)*10^2 in KJ/kg\n",
"h10=hf at 150 bar=1610.5 KJ/kg\n",
"v10=0.001658 m^3/kg=vf at 150 bar\n",
"h12=h10+v10*(150-10)*10^2 in KJ/kg\n",
"Let mass of steam bled out at 10 bar,1.5 bar be m1 and m2 per kg of steam generated.\n",
"Heat balance on closed feed water heater yields,\n",
"m1*h3+(1-m)*h9=m1*h10+(1-m1)*4.18*150\n",
"so m1=(4.18*150-h9)/(h3-h9-h10+4.18*150)in kg/kg of steam generated.\n",
"heat balance on open feed water can be given as under,\n",
"m2*h4+(1-m1-m2)*h7=(1-m1)*h8\n",
"so m2=((1-m1)*(h8-h7))/(h4-h7)in kg/kg of steam\n",
"for mass flow rate of 300 kg/s=>m1=36 kg/s,m2=39 kg/s\n",
"For mixing after closed feed water heater,\n",
"h1=(4.18*150)*(1-m1)+m1*h12 in KJ/kg\n",
"Net work output per kg of steam generated=W_ST1+W_ST2+W_ST3-{W_CEP+W_FP+W_FP2}\n",
"W_net=(h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-{(1-m1-m2)*(h7-h6)+(1-m1)*(h9-h8)+(m1*(h12-h10))}in KJ/kg of steam generated.\n",
"heat added per kg of steam generated,q_add=(h2-h1) in KJ/kg\n",
"cycle thermal efficiency,n=W_net/q_add 0.48\n",
"in percentage 47.59\n",
"Net power developed in KW=1219*300 in KW 365700.0\n",
"cycle thermal efficiency=47.6%\n",
"Net power developed=365700 KW\n"
]
}
],
"source": [
"#cal of cycle thermal efficiency,Net power developed\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.11, Page:279 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 11\")\n",
"print(\"Enthalpy of steam entering ST1,h2=3308.6 KJ/kg,s2=6.3443 KJ/kg K\")\n",
"h2=3308.6;\n",
"s2=6.3443;\n",
"print(\"for isentropic expansion 2-3-4-5,s2=s3=s4=s5\")\n",
"s3=s2;\n",
"s4=s3;\n",
"s5=s4;\n",
"print(\"Let dryness fraction of states 3,4 and 5 be x3,x4 and x5\")\n",
"print(\"s3=6.3443=sf at 10 bar+x3*sfg at 10 bar\")\n",
"print(\"so x3=(s3-sf)/sfg\")\n",
"print(\"from steam tables,at 10 bar,sf=2.1387 KJ/kg K,sfg=4.4478 KJ/kg K\")\n",
"sf=2.1387;\n",
"sfg=4.4478;\n",
"x3=(s3-sf)/sfg\n",
"x3=0.945;#approx.\n",
"print(\"h3=hf+x3*hfg in KJ/kg\")\n",
"print(\"from steam tables,hf=762.81 KJ/kg,hfg=2015.3 KJ/kg\")\n",
"hf=762.81;\n",
"hfg=2015.3;\n",
"h3=hf+x3*hfg\n",
"print(\"s4=6.3443=sf at 1.5 bar+x4*sfg at 1.5 bar\")\n",
"print(\"so x4=(s4-sf)/sfg\")\n",
"print(\"from steam tables,at 1.5 bar,sf=1.4336 KJ/kg K,sfg=5.7897 KJ/kg K\")\n",
"sf=1.4336;\n",
"sfg=5.7897;\n",
"x4=(s4-sf)/sfg\n",
"x4=0.848;#approx.\n",
"print(\"so h4=hf+x4*hfg in KJ/kg\")\n",
"print(\"from steam tables,at 1.5 bar,hf=467.11 KJ/kg,hfg=2226.5 KJ/kg\")\n",
"hf=467.11;\n",
"hfg=2226.5;\n",
"h4=hf+x4*hfg\n",
"print(\"s5=6.3443=sf at 0.05 bar+x5*sfg at 0.05 bar\")\n",
"print(\"so x5=(s5-sf)/sfg\")\n",
"print(\"from steam tables,at 0.05 bar,sf=0.4764 KJ/kg K,sfg=7.9187 KJ/kg K\")\n",
"sf=0.4764;\n",
"sfg=7.9187;\n",
"x5=(s5-sf)/sfg\n",
"x5=0.739;#approx.\n",
"print(\"h5=hf+x5*hfg in KJ/kg\")\n",
"print(\"from steam tables,at 0.05 bar,hf=137.82 KJ/kg,hfg=2423.7 KJ/kg\")\n",
"hf=137.82;\n",
"hfg=2423.7;\n",
"h5=hf+x5*hfg \n",
"print(\"h6=hf at 0.05 bar=137.82 KJ/kg\")\n",
"h6=137.82;\n",
"print(\"v6=vf at 0.05 bar=0.001005 m^3/kg\")\n",
"v6=0.001005;\n",
"print(\"h7=h6+v6*(1.5-0.05)*10^2 in KJ/kg\")\n",
"h7=h6+v6*(1.5-0.05)*10**2\n",
"print(\"h8=hf at 1.5 bar=467.11 KJ/kg\")\n",
"h8=467.11; \n",
"print(\"v8=0.001053 m^3/kg=vf at 1.5 bar\")\n",
"v8=0.001053;\n",
"print(\"h9=h8+v8*(150-1.5)*10^2 in KJ/kg\")\n",
"h9=h8+v8*(150-1.5)*10**2\n",
"print(\"h10=hf at 150 bar=1610.5 KJ/kg\")\n",
"h10=1610.5; \n",
"print(\"v10=0.001658 m^3/kg=vf at 150 bar\")\n",
"v10=0.001658;\n",
"print(\"h12=h10+v10*(150-10)*10^2 in KJ/kg\")\n",
"h12=h10+v10*(150-10)*10**2\n",
"print(\"Let mass of steam bled out at 10 bar,1.5 bar be m1 and m2 per kg of steam generated.\")\n",
"print(\"Heat balance on closed feed water heater yields,\")\n",
"print(\"m1*h3+(1-m)*h9=m1*h10+(1-m1)*4.18*150\")\n",
"print(\"so m1=(4.18*150-h9)/(h3-h9-h10+4.18*150)in kg/kg of steam generated.\")\n",
"m1=(4.18*150-h9)/(h3-h9-h10+4.18*150)\n",
"print(\"heat balance on open feed water can be given as under,\")\n",
"print(\"m2*h4+(1-m1-m2)*h7=(1-m1)*h8\")\n",
"print(\"so m2=((1-m1)*(h8-h7))/(h4-h7)in kg/kg of steam\")\n",
"m2=((1-m1)*(h8-h7))/(h4-h7)\n",
"print(\"for mass flow rate of 300 kg/s=>m1=36 kg/s,m2=39 kg/s\")\n",
"print(\"For mixing after closed feed water heater,\")\n",
"print(\"h1=(4.18*150)*(1-m1)+m1*h12 in KJ/kg\")\n",
"h1=(4.18*150)*(1-m1)+m1*h12\n",
"print(\"Net work output per kg of steam generated=W_ST1+W_ST2+W_ST3-{W_CEP+W_FP+W_FP2}\")\n",
"print(\"W_net=(h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-{(1-m1-m2)*(h7-h6)+(1-m1)*(h9-h8)+(m1*(h12-h10))}in KJ/kg of steam generated.\")\n",
"W_net=(h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-((1-m1-m2)*(h7-h6)+(1-m1)*(h9-h8)+(m1*(h12-h10)))\n",
"print(\"heat added per kg of steam generated,q_add=(h2-h1) in KJ/kg\")\n",
"q_add=(h2-h1)\n",
"n=W_net/q_add\n",
"print(\"cycle thermal efficiency,n=W_net/q_add\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"Net power developed in KW=1219*300 in KW\"),round(1219*300,2)\n",
"print(\"cycle thermal efficiency=47.6%\")\n",
"print(\"Net power developed=365700 KW\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.12;pg no: 282"
]
},
{
"cell_type": "code",
"execution_count": 99,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.12, Page:282 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 12\n",
"At inlet to HPT,h2=3373.7 KJ/kg,s2=6.5966 KJ/kg K\n",
"For isentropic expansion between 2-3-4-5,s2=s3=s4=s5\n",
"state 3 lies in superheated region as s3>sg at 20 bar.By interpolation from superheated steam table,T3=261.6oc.Enthalpy at 3,h3=2930.57 KJ/kg\n",
"since s4 For the reheating introduced at 20 bar up to 400oc.The modified cycle representation is shown on T-S diagram by 1-2-3-3_a-4_a-5_a-6-7-8-9-10-11\n",
"At state 2,h2=3373.7 KJ/kg,s2=6.5966 KJ/kg K\n",
"At state 3,h3=2930.57 KJ/kg\n",
"At state 3_a,h3_a=3247.6 KJ/kg,s3_a=7.1271 KJ/kg K\n",
"At state 4_a and 5_a,s3_a=s4_a=s5_a=7.1271 KJ/kg K\n",
"From steam tables by interpolation state 4_a is seen to be at 190.96oc at 4 bar,h4_a=2841.02 KJ/kg\n",
"Let dryness fraction at state 5_a be x5,\n",
"s5_a=7.1271=sf at 0.075 bar+x5_a*sfg at 0.075 bar\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"so x5_a=(s5_a-sf)/sfg\n",
"h5_a=hf at 0.075 bar+x5_a*hfg at 0.075 bar in KJ/kg\n",
"from steam tables,at 0.075 bar,hf=168.76 KJ/kg,hfg=2406.0 KJ/kg\n",
"Let mass of bled steam at 20 bar and 4 bar be m1_a,m2_a per kg of steam generated.Applying heat balance at closed feed water heater.\n",
"m1_a*h3+h9=m1*h10+4.18*200\n",
"so m1_a=(4.18*200-h9)/(h3-h10) in kg\n",
"Applying heat balance at open feed water heater,\n",
"m1_a*h11+m2_a*h4_a+(1-m1_a-m2_a)*h7=h8\n",
"so m2_a=(h8-m1_a*h11-h7+m1_a*h7)/(h4_a-h7) in kg\n",
"Net work per kg steam generated\n",
"w_net=(h2-h3)+(1-m1_a)*(h3_a-h4_a)+(1-m1_a-m2_a)*(h4_a-h5_a)-{(1-m1_a-m2_a)*(h7-h6)+(h9-h8)}in KJ/kg\n",
"Heat added per kg steam generated,q_add=(h2-h1)+(1-m1_a)*(h3_a-h3)in KJ/kg\n",
"Thermal efficiency,n= 0.45\n",
"in percentage 45.04\n",
"% increase in thermal efficiency due to reheating= 0.56\n",
"so thermal efficiency of reheat cycle=45.03%\n",
"% increase in efficiency due to reheating=0.56%\n"
]
}
],
"source": [
"#cal of thermal efficiency,steam generation rate\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.12, Page:282 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 12\")\n",
"P=100*10**3;#net power output in KW\n",
"print(\"At inlet to HPT,h2=3373.7 KJ/kg,s2=6.5966 KJ/kg K\")\n",
"h2=3373.7;\n",
"s2=6.5966;\n",
"print(\"For isentropic expansion between 2-3-4-5,s2=s3=s4=s5\")\n",
"s3=s2;\n",
"s4=s3;\n",
"s5=s4;\n",
"print(\"state 3 lies in superheated region as s3>sg at 20 bar.By interpolation from superheated steam table,T3=261.6oc.Enthalpy at 3,h3=2930.57 KJ/kg\")\n",
"T3=261.6;\n",
"h3=2930.57;\n",
"print(\"since s4 For the reheating introduced at 20 bar up to 400oc.The modified cycle representation is shown on T-S diagram by 1-2-3-3_a-4_a-5_a-6-7-8-9-10-11\")\n",
"print(\"At state 2,h2=3373.7 KJ/kg,s2=6.5966 KJ/kg K\")\n",
"h2=3373.7;\n",
"s2=6.5966;\n",
"print(\"At state 3,h3=2930.57 KJ/kg\")\n",
"h3=2930.57;\n",
"print(\"At state 3_a,h3_a=3247.6 KJ/kg,s3_a=7.1271 KJ/kg K\")\n",
"h3_a=3247.6;\n",
"s3_a=7.1271;\n",
"print(\"At state 4_a and 5_a,s3_a=s4_a=s5_a=7.1271 KJ/kg K\")\n",
"s4_a=s3_a;\n",
"s5_a=s4_a;\n",
"print(\"From steam tables by interpolation state 4_a is seen to be at 190.96oc at 4 bar,h4_a=2841.02 KJ/kg\")\n",
"h4_a=2841.02;\n",
"print(\"Let dryness fraction at state 5_a be x5,\")\n",
"print(\"s5_a=7.1271=sf at 0.075 bar+x5_a*sfg at 0.075 bar\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"print(\"so x5_a=(s5_a-sf)/sfg\")\n",
"x5_a=(s5_a-sf)/sfg\n",
"x5_a=0.853;#approx.\n",
"print(\"h5_a=hf at 0.075 bar+x5_a*hfg at 0.075 bar in KJ/kg\")\n",
"print(\"from steam tables,at 0.075 bar,hf=168.76 KJ/kg,hfg=2406.0 KJ/kg\")\n",
"h5_a=hf+x5_a*hfg\n",
"print(\"Let mass of bled steam at 20 bar and 4 bar be m1_a,m2_a per kg of steam generated.Applying heat balance at closed feed water heater.\")\n",
"print(\"m1_a*h3+h9=m1*h10+4.18*200\")\n",
"print(\"so m1_a=(4.18*200-h9)/(h3-h10) in kg\")\n",
"m1_a=(4.18*200-h9)/(h3-h10)\n",
"m1_a=0.114;#approx.\n",
"print(\"Applying heat balance at open feed water heater,\")\n",
"print(\"m1_a*h11+m2_a*h4_a+(1-m1_a-m2_a)*h7=h8\")\n",
"print(\"so m2_a=(h8-m1_a*h11-h7+m1_a*h7)/(h4_a-h7) in kg\")\n",
"m2_a=(h8-m1_a*h11-h7+m1_a*h7)/(h4_a-h7)\n",
"m2_a=0.131;#approx.\n",
"print(\"Net work per kg steam generated\")\n",
"print(\"w_net=(h2-h3)+(1-m1_a)*(h3_a-h4_a)+(1-m1_a-m2_a)*(h4_a-h5_a)-{(1-m1_a-m2_a)*(h7-h6)+(h9-h8)}in KJ/kg\")\n",
"w_net=(h2-h3)+(1-m1_a)*(h3_a-h4_a)+(1-m1_a-m2_a)*(h4_a-h5_a)-((1-m1_a-m2_a)*(h7-h6)+(h9-h8))\n",
"print(\"Heat added per kg steam generated,q_add=(h2-h1)+(1-m1_a)*(h3_a-h3)in KJ/kg\")\n",
"q_add=(h2-h1)+(1-m1_a)*(h3_a-h3)\n",
"n=w_net/q_add\n",
"print(\"Thermal efficiency,n=\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"% increase in thermal efficiency due to reheating=\"),round((0.4503-0.4478)*100/0.4478,2)\n",
"print(\"so thermal efficiency of reheat cycle=45.03%\")\n",
"print(\"% increase in efficiency due to reheating=0.56%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.13;pg no: 286"
]
},
{
"cell_type": "code",
"execution_count": 100,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.13, Page:286 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 13\n",
"For mercury cycle,\n",
"insentropic heat drop=349-234.5 in KJ/kg Hg\n",
"actual heat drop=0.85*114.5 in KJ/kg Hg\n",
"Heat rejected in condenser=(349-97.325-35)in KJ/kg\n",
"heat added in boiler=349-35 in KJ/kg\n",
"For steam cycle,\n",
"Enthalpy of steam generated=h at 40 bar,0.98 dry=2767.13 KJ/kg\n",
"Enthalpy of inlet to steam turbine,h2=h at 40 bar,450oc=3330.3 KJ/kg\n",
"Entropy of steam at inlet to steam turbine,s2=6.9363 KJ/kg K\n",
"Therefore,heat added in condenser of mercury cycle=h at 40 bar,0.98 dry-h_feed at 40 bar in KJ/kg\n",
"Therefore,mercury required per kg of steam=2140.13/heat rejected in condenser in kg per kg of steam\n",
"for isentropic expansion,s2=s3=s4=s5=6.9363 KJ/kg K\n",
"state 3 lies in superheated region,by interpolation the state can be given by,temperature 227.07oc at 8 bar,h3=2899.23 KJ/kg\n",
"state 4 lies in wet region,say with dryness fraction x4\n",
"s4=6.9363=sf at 1 bar+x4*sfg at 1 bar\n",
"so x4=(s4-sf)/sfg\n",
"from steam tables,at 1 bar,sf=1.3026 KJ/kg K,sfg=6.0568 KJ/kg K\n",
"h4=hf at 1 bar+x4*hfg at 1 bar in KJ/kg\n",
"from steam tables,at 1 bar,hf=417.46 KJ/kg,hfg=2258.0 KJ/kg\n",
"Let state 5 lie in wet region with dryness fraction x5,\n",
"s5=6.9363=sf at 0.075 bar+x5*sfg at 0.075 bar\n",
"so x5=(s5-sf)/sfg\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"h5=hf+x5*hfg in KJ/kg\n",
"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\n",
"Let mass of steam bled at 8 bar and 1 bar be m1 and m2 per kg of steam generated.\n",
"h7=h6+v6*(1-0.075)*10^2 in KJ/kg\n",
"from steam tables,at 0.075 bar,h6=hf=168.79 KJ/kg,v6=vf=0.001008 m^3/kg\n",
"h9=hf at 1 bar=417.46 KJ/kg,h13=hf at 8 bar=721.11 KJ/kg\n",
"Applying heat balance on CFWH1,T1=150oc and also T15=150oc\n",
"m1*h3+(1-m1)*h12=m1*h13+(4.18*150)*(1-m1)\n",
"(m1-2899.23)+(1-m1)*h12=(m1*721.11)+627*(1-m1)\n",
"Applying heat balance on CFEH2,T11=90oc\n",
"m2*h4+(1-m1-m2)*h7=m2*h9+(1-m1-m2)*4.18*90\n",
"(m2*2517.4)+(1-m1-m2)*168.88=(m2*417.46)+376.2*(1-m1-m2)\n",
"Heat balance at mixing between CFWH1 and CFWH2,\n",
"(1-m1-m2)*4.18*90+m2*h10=(1-m1)*h12\n",
"376.2*(1-m1-m2)+m2*h10=(1-m1)*h12\n",
"For pumping process,9-10,h10=h9+v9*(8-1)*10^2 in KJ/kg\n",
"from steam tables,h9=hf at 1 bar=417.46 KJ/kg,v9=vf at 1 bar=0.001043 m^3/kg\n",
"solving above equations,we get\n",
"m1=0.102 kg per kg steam generated\n",
"m2=0.073 kg per kg steam generated\n",
"pump work in process 13-14,h14-h13=v13*(40-8)*10^2\n",
"so h14-h13 in KJ/kg\n",
"Total heat supplied(q_add)=(9.88*314)+(3330.3-2767.13) in KJ/kg of steam\n",
"net work per kg of steam,w_net=w_mercury+w_steam\n",
"w_net=(9.88*97.325)+{(h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-(1-m1-m2)*(h4-h6)-m2*(h10-h9)-m1*(h14-h13)} in KJ/kg\n",
"thermal efficiency of binary vapour cycle=w_net/q_add 0.55\n",
"in percentage 55.36\n",
"so thermal efficiency=55.36%\n",
"NOTE=>In this question there is some mistake in formula used for w_net which is corrected above.\n"
]
}
],
"source": [
"#cal of thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.13, Page:286 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 13\")\n",
"print(\"For mercury cycle,\")\n",
"print(\"insentropic heat drop=349-234.5 in KJ/kg Hg\")\n",
"349-234.5\n",
"print(\"actual heat drop=0.85*114.5 in KJ/kg Hg\")\n",
"0.85*114.5\n",
"print(\"Heat rejected in condenser=(349-97.325-35)in KJ/kg\")\n",
"(349-97.325-35)\n",
"print(\"heat added in boiler=349-35 in KJ/kg\")\n",
"349-35\n",
"print(\"For steam cycle,\")\n",
"print(\"Enthalpy of steam generated=h at 40 bar,0.98 dry=2767.13 KJ/kg\")\n",
"h=2767.13;\n",
"print(\"Enthalpy of inlet to steam turbine,h2=h at 40 bar,450oc=3330.3 KJ/kg\")\n",
"h2=3330.3;\n",
"print(\"Entropy of steam at inlet to steam turbine,s2=6.9363 KJ/kg K\")\n",
"s2=6.9363;\n",
"print(\"Therefore,heat added in condenser of mercury cycle=h at 40 bar,0.98 dry-h_feed at 40 bar in KJ/kg\")\n",
"h-4.18*150\n",
"print(\"Therefore,mercury required per kg of steam=2140.13/heat rejected in condenser in kg per kg of steam\")\n",
"2140.13/216.675\n",
"print(\"for isentropic expansion,s2=s3=s4=s5=6.9363 KJ/kg K\")\n",
"s3=s2;\n",
"s4=s3;\n",
"s5=s4;\n",
"print(\"state 3 lies in superheated region,by interpolation the state can be given by,temperature 227.07oc at 8 bar,h3=2899.23 KJ/kg\")\n",
"h3=2899.23;\n",
"print(\"state 4 lies in wet region,say with dryness fraction x4\")\n",
"print(\"s4=6.9363=sf at 1 bar+x4*sfg at 1 bar\")\n",
"print(\"so x4=(s4-sf)/sfg\")\n",
"print(\"from steam tables,at 1 bar,sf=1.3026 KJ/kg K,sfg=6.0568 KJ/kg K\")\n",
"sf=1.3026;\n",
"sfg=6.0568;\n",
"x4=(s4-sf)/sfg\n",
"x4=0.93;#approx.\n",
"print(\"h4=hf at 1 bar+x4*hfg at 1 bar in KJ/kg\")\n",
"print(\"from steam tables,at 1 bar,hf=417.46 KJ/kg,hfg=2258.0 KJ/kg\")\n",
"hf=417.46;\n",
"hfg=2258.0;\n",
"h4=hf+x4*hfg\n",
"print(\"Let state 5 lie in wet region with dryness fraction x5,\")\n",
"print(\"s5=6.9363=sf at 0.075 bar+x5*sfg at 0.075 bar\")\n",
"print(\"so x5=(s5-sf)/sfg\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"sf=0.5764;\n",
"sfg=7.6750;\n",
"x5=(s5-sf)/sfg\n",
"x5=0.828;#approx.\n",
"print(\"h5=hf+x5*hfg in KJ/kg\")\n",
"print(\"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\")\n",
"hf=168.79;\n",
"hfg=2406.0;\n",
"h5=hf+x5*hfg\n",
"print(\"Let mass of steam bled at 8 bar and 1 bar be m1 and m2 per kg of steam generated.\")\n",
"print(\"h7=h6+v6*(1-0.075)*10^2 in KJ/kg\")\n",
"print(\"from steam tables,at 0.075 bar,h6=hf=168.79 KJ/kg,v6=vf=0.001008 m^3/kg\")\n",
"h6=168.79;\n",
"v6=0.001008;\n",
"h7=h6+v6*(1-0.075)*10**2\n",
"print(\"h9=hf at 1 bar=417.46 KJ/kg,h13=hf at 8 bar=721.11 KJ/kg\")\n",
"h9=417.46;\n",
"h13=721.11;\n",
"print(\"Applying heat balance on CFWH1,T1=150oc and also T15=150oc\")\n",
"T1=150;\n",
"T15=150;\n",
"print(\"m1*h3+(1-m1)*h12=m1*h13+(4.18*150)*(1-m1)\")\n",
"print(\"(m1-2899.23)+(1-m1)*h12=(m1*721.11)+627*(1-m1)\")\n",
"print(\"Applying heat balance on CFEH2,T11=90oc\")\n",
"T11=90;\n",
"print(\"m2*h4+(1-m1-m2)*h7=m2*h9+(1-m1-m2)*4.18*90\")\n",
"print(\"(m2*2517.4)+(1-m1-m2)*168.88=(m2*417.46)+376.2*(1-m1-m2)\")\n",
"print(\"Heat balance at mixing between CFWH1 and CFWH2,\")\n",
"print(\"(1-m1-m2)*4.18*90+m2*h10=(1-m1)*h12\")\n",
"print(\"376.2*(1-m1-m2)+m2*h10=(1-m1)*h12\")\n",
"print(\"For pumping process,9-10,h10=h9+v9*(8-1)*10^2 in KJ/kg\")\n",
"print(\"from steam tables,h9=hf at 1 bar=417.46 KJ/kg,v9=vf at 1 bar=0.001043 m^3/kg\")\n",
"h9=417.46;\n",
"v9=0.001043;\n",
"h10=h9+v9*(8-1)*10**2 \n",
"print(\"solving above equations,we get\")\n",
"print(\"m1=0.102 kg per kg steam generated\")\n",
"print(\"m2=0.073 kg per kg steam generated\")\n",
"m1=0.102;\n",
"m2=0.073;\n",
"print(\"pump work in process 13-14,h14-h13=v13*(40-8)*10^2\")\n",
"print(\"so h14-h13 in KJ/kg\")\n",
"v13=0.001252;\n",
"v13*(40-8)*10**2\n",
"print(\"Total heat supplied(q_add)=(9.88*314)+(3330.3-2767.13) in KJ/kg of steam\")\n",
"q_add=(9.88*314)+(3330.3-2767.13)\n",
"print(\"net work per kg of steam,w_net=w_mercury+w_steam\")\n",
"print(\"w_net=(9.88*97.325)+{(h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-(1-m1-m2)*(h4-h6)-m2*(h10-h9)-m1*(h14-h13)} in KJ/kg\")\n",
"w_net=(9.88*97.325)+((h2-h3)+(1-m1)*(h3-h4)+(1-m1-m2)*(h4-h5)-(1-m1-m2)*(h7-h6)-m2*(h10-h9)-m1*4.006)\n",
"print(\"thermal efficiency of binary vapour cycle=w_net/q_add\"),round(w_net/q_add,2)\n",
"print(\"in percentage\"),round(w_net*100/q_add,2)\n",
"print(\"so thermal efficiency=55.36%\")\n",
"print(\"NOTE=>In this question there is some mistake in formula used for w_net which is corrected above.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.14;pg no: 288"
]
},
{
"cell_type": "code",
"execution_count": 101,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.14, Page:288 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 14\n",
"This is a mixed pressure turbine so the output of turbine shall be sum of the contributions by HP and LP steam streams.\n",
"For HP:at inlet of HP steam=>h1=3023.5 KJ/kg,s1=6.7664 KJ/kg K\n",
"ideally, s2=s1=6.7664 KJ/kg K\n",
"s2=sf at 0.075 bar +x3* sfg at 0.075 bar\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"so x3=(s2-sf)/sfg\n",
"h_3HP=hf at 0.075 bar+x3*hfg at 0.075 bar in KJ/kg\n",
"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\n",
"actual enthalpy drop in HP(h_HP)=(h1-h_3HP)*n in KJ/kg\n",
"for LP:at inlet of LP steam\n",
"h2=2706.7 KJ/kg,s2=7.1271 KJ/kg K\n",
"Enthalpy at exit,h_3LP=2222.34 KJ/kg\n",
"actual enthalpy drop in LP(h_LP)=(h2-h_3LP)*n in KJ/kg\n",
"HP steam consumption at full load=P*0.7457/h_HP in kg/s\n",
"HP steam consumption at no load=0.10*(P*0.7457/h_HP)in kg/s\n",
"LP steam consumption at full load=P*0.7457/h_LP in kg/s\n",
"LP steam consumption at no load=0.10*(P*0.7457/h_LP)in kg/s\n",
"The problem can be solved geometrically by drawing willans line as per scale on graph paper and finding out the HP stream requirement for getting 1000 hp if LP stream is available at 1.5 kg/s.\n",
"or,Analytically the equation for willans line can be obtained for above full load and no load conditions for HP and LP seperately.\n",
"Willians line for HP:y=m*x+C,here y=steam consumption,kg/s\n",
"x=load,hp\n",
"y_HP=m_HP*x+C_HP\n",
"0.254=m_HP*0+C_HP\n",
"so C_HP=0.254\n",
"2.54=m_HP*2500+C_HP\n",
"so m_HP=(2.54-C_HP)/2500\n",
"so y_HP=9.144*10^-4*x_HP+0.254\n",
"Willans line for LP:y_LP=m_LP*x_LP+C_LP\n",
"0.481=m_LP*0+C_LP\n",
"so C_LP=0.481\n",
"4.81=m_LP*2500+C_LP\n",
"so m_LP=(4.81-C_LP)/2500\n",
"so y_LP=1.732*10^-3*x_LP+0.481\n",
"Total output(load) from mixed turbine,x=x_HP+x_LP\n",
"For load of 1000 hp to be met by mixed turbine,let us find out the load shared by LP for steam flow rate of 1.5 kg/s\n",
"from y_LP=1.732*10^-3*x_LP+0.481,\n",
"x_LP=(y_LP-0.481)/1.732*10^-3\n",
"since by 1.5 kg/s of LP steam only 588.34 hp output contribution is made so remaining(1000-588.34)=411.66 hp,411.66 hp should be contributed by HP steam.By willans line for HP turbine,\n",
"from y_HP=9.144*10^-4*x_HP+C_HP in kg/s 0.63\n",
"so HP steam requirement=0.63 kg/s\n"
]
}
],
"source": [
"#cal of HP steam required\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.14, Page:288 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 14\")\n",
"n=0.8;#efficiency of both HP and LP turbine\n",
"P=2500;#output in hp\n",
"print(\"This is a mixed pressure turbine so the output of turbine shall be sum of the contributions by HP and LP steam streams.\")\n",
"print(\"For HP:at inlet of HP steam=>h1=3023.5 KJ/kg,s1=6.7664 KJ/kg K\")\n",
"h1=3023.5;\n",
"s1=6.7664;\n",
"print(\"ideally, s2=s1=6.7664 KJ/kg K\")\n",
"s2=s1;\n",
"print(\"s2=sf at 0.075 bar +x3* sfg at 0.075 bar\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"sf=0.5764;\n",
"sfg=7.6750;\n",
"print(\"so x3=(s2-sf)/sfg\")\n",
"x3=(s2-sf)/sfg\n",
"x3=0.806;#approx.\n",
"print(\"h_3HP=hf at 0.075 bar+x3*hfg at 0.075 bar in KJ/kg\")\n",
"print(\"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\")\n",
"hf=168.79;\n",
"hfg=2406.0; \n",
"h_3HP=hf+x3*hfg\n",
"print(\"actual enthalpy drop in HP(h_HP)=(h1-h_3HP)*n in KJ/kg\")\n",
"h_HP=(h1-h_3HP)*n\n",
"print(\"for LP:at inlet of LP steam\")\n",
"print(\"h2=2706.7 KJ/kg,s2=7.1271 KJ/kg K\")\n",
"h2=2706.7;\n",
"s2=7.1271;\n",
"print(\"Enthalpy at exit,h_3LP=2222.34 KJ/kg\")\n",
"h_3LP=2222.34;\n",
"print(\"actual enthalpy drop in LP(h_LP)=(h2-h_3LP)*n in KJ/kg\")\n",
"h_LP=(h2-h_3LP)*n\n",
"print(\"HP steam consumption at full load=P*0.7457/h_HP in kg/s\")\n",
"P*0.7457/h_HP\n",
"print(\"HP steam consumption at no load=0.10*(P*0.7457/h_HP)in kg/s\")\n",
"0.10*(P*0.7457/h_HP)\n",
"print(\"LP steam consumption at full load=P*0.7457/h_LP in kg/s\")\n",
"P*0.7457/h_LP\n",
"print(\"LP steam consumption at no load=0.10*(P*0.7457/h_LP)in kg/s\")\n",
"0.10*(P*0.7457/h_LP)\n",
"print(\"The problem can be solved geometrically by drawing willans line as per scale on graph paper and finding out the HP stream requirement for getting 1000 hp if LP stream is available at 1.5 kg/s.\")\n",
"print(\"or,Analytically the equation for willans line can be obtained for above full load and no load conditions for HP and LP seperately.\")\n",
"print(\"Willians line for HP:y=m*x+C,here y=steam consumption,kg/s\")\n",
"print(\"x=load,hp\")\n",
"print(\"y_HP=m_HP*x+C_HP\")\n",
"print(\"0.254=m_HP*0+C_HP\")\n",
"print(\"so C_HP=0.254\")\n",
"C_HP=0.254;\n",
"print(\"2.54=m_HP*2500+C_HP\")\n",
"print(\"so m_HP=(2.54-C_HP)/2500\")\n",
"m_HP=(2.54-C_HP)/2500\n",
"print(\"so y_HP=9.144*10^-4*x_HP+0.254\")\n",
"print(\"Willans line for LP:y_LP=m_LP*x_LP+C_LP\")\n",
"print(\"0.481=m_LP*0+C_LP\")\n",
"print(\"so C_LP=0.481\")\n",
"C_LP=0.481;\n",
"print(\"4.81=m_LP*2500+C_LP\")\n",
"print(\"so m_LP=(4.81-C_LP)/2500\")\n",
"m_LP=(4.81-C_LP)/2500\n",
"print(\"so y_LP=1.732*10^-3*x_LP+0.481\")\n",
"print(\"Total output(load) from mixed turbine,x=x_HP+x_LP\")\n",
"print(\"For load of 1000 hp to be met by mixed turbine,let us find out the load shared by LP for steam flow rate of 1.5 kg/s\")\n",
"y_LP=1.5;\n",
"print(\"from y_LP=1.732*10^-3*x_LP+0.481,\")\n",
"print(\"x_LP=(y_LP-0.481)/1.732*10^-3\")\n",
"x_LP=(y_LP-0.481)/(1.732*10**-3)\n",
"print(\"since by 1.5 kg/s of LP steam only 588.34 hp output contribution is made so remaining(1000-588.34)=411.66 hp,411.66 hp should be contributed by HP steam.By willans line for HP turbine,\")\n",
"x_HP=411.66;\n",
"y_HP=9.144*10**-4*x_HP+C_HP\n",
"print(\"from y_HP=9.144*10^-4*x_HP+C_HP in kg/s\"),round(y_HP,2)\n",
"print(\"so HP steam requirement=0.63 kg/s\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.15;pg no: 289"
]
},
{
"cell_type": "code",
"execution_count": 102,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.15, Page:289 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 15\n",
"Let us carry out analysis for 1 kg of steam generated in boiler.\n",
"Enthalpy at inlet to HPT,h2=2960.7 KJ/kg,s2=6.3615 KJ/kg K\n",
"state at 3 i.e. exit from HPT can be identified by s2=s3=6.3615 KJ/kg K\n",
"Let dryness fraction be x3,s3=6.3615=sf at 2 bar+x3*sfg at 2 bar\n",
"so x3= 0.86\n",
"from stem tables,at 2 bar,sf=1.5301 KJ/kg K,sfg=5.5970 KJ/kg K\n",
"h3=2404.94 KJ/kg\n",
"If one kg of steam is generated in bolier then at exit of HPT,0.5 kg goes into process heater and 0.5 kg goes into separator\n",
"mass of moisture retained in separator(m)=(1-x3)*0.5 kg\n",
"Therefore,mass of steam entering LPT(m_LP)=0.5-m kg\n",
"Total mass of water entering hot well at 8(i.e. from process heater and drain from separator)=(0.5+0.685)=0.5685 kg\n",
"Let us assume the temperature of water leaving hotwell be T oc.Applying heat balance for mixing;\n",
"(0.5685*4.18*90)+(0.4315*4.18*40)=(1*4.18*T)\n",
"so T in degree celcius= 68.425\n",
"so temperature of water leaving hotwell=68.425 degree celcius\n",
"Applying heat balanced on trap\n",
"0.5*h7+0.0685*hf at 2 bar=(0.5685*4.18*90)\n",
"so h7=((0.5685*4.18*90)-(0.0685*hf))/0.5 in KJ/kg\n",
"from steam tables,at 2 bar,hf=504.70 KJ/kg\n",
"Therefore,heat transferred in process heater in KJ/kg steam generated= 1023.172\n",
"so heat transferred per kg steam generated=1023.175 KJ/kg steam generated\n",
"For state 10 at exit of LPT,s10=s3=s2=6.3615 KJ/kg K\n",
"Let dryness fraction be x10\n",
"s10=6.3615=sf at 0.075 bar+x10*sfg at 0.075 bar\n",
"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\n",
"so x10=(s10-sf)/sfg\n",
"h10=hf at 0.075 bar+x10*hfg at 0.075 bar\n",
"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\n",
"so h10=hf+x10*hfg in KJ/kg \n",
"net work output,neglecting pump work per kg of steam generated,\n",
"w_net=(h2-h3)*1+0.4315*(h3-h10) in KJ/kg steam generated\n",
"Heat added in boiler per kg steam generated,q_add in KJ/kg= 2674.68\n",
"thermal efficiency=w_net/q_add 0.28\n",
"in percentage 27.59\n",
"so Thermal efficiency=27.58%\n"
]
}
],
"source": [
"#cal of thermal efficiency,heat transferred and temperature\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.15, Page:289 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 15\")\n",
"print(\"Let us carry out analysis for 1 kg of steam generated in boiler.\")\n",
"print(\"Enthalpy at inlet to HPT,h2=2960.7 KJ/kg,s2=6.3615 KJ/kg K\")\n",
"h2=2960.7;\n",
"s2=6.3615;\n",
"print(\"state at 3 i.e. exit from HPT can be identified by s2=s3=6.3615 KJ/kg K\")\n",
"s3=s2;\n",
"print(\"Let dryness fraction be x3,s3=6.3615=sf at 2 bar+x3*sfg at 2 bar\")\n",
"sf=1.5301;\n",
"sfg=5.5970;\n",
"x3=(s3-sf)/sfg\n",
"print(\"so x3=\"),round(x3,2)\n",
"print(\"from stem tables,at 2 bar,sf=1.5301 KJ/kg K,sfg=5.5970 KJ/kg K\")\n",
"x3=0.863;#approx.\n",
"print(\"h3=2404.94 KJ/kg\")\n",
"h3=2404.94;\n",
"print(\"If one kg of steam is generated in bolier then at exit of HPT,0.5 kg goes into process heater and 0.5 kg goes into separator\")\n",
"print(\"mass of moisture retained in separator(m)=(1-x3)*0.5 kg\")\n",
"m=(1-x3)*0.5\n",
"print(\"Therefore,mass of steam entering LPT(m_LP)=0.5-m kg\")\n",
"m_LP=0.5-m\n",
"print(\"Total mass of water entering hot well at 8(i.e. from process heater and drain from separator)=(0.5+0.685)=0.5685 kg\")\n",
"print(\"Let us assume the temperature of water leaving hotwell be T oc.Applying heat balance for mixing;\")\n",
"print(\"(0.5685*4.18*90)+(0.4315*4.18*40)=(1*4.18*T)\")\n",
"T=((0.5685*4.18*90)+(0.4315*4.18*40))/4.18\n",
"print(\"so T in degree celcius=\"),round(T,3)\n",
"print(\"so temperature of water leaving hotwell=68.425 degree celcius\")\n",
"print(\"Applying heat balanced on trap\")\n",
"print(\"0.5*h7+0.0685*hf at 2 bar=(0.5685*4.18*90)\")\n",
"print(\"so h7=((0.5685*4.18*90)-(0.0685*hf))/0.5 in KJ/kg\")\n",
"print(\"from steam tables,at 2 bar,hf=504.70 KJ/kg\")\n",
"hf=504.70;\n",
"h7=((0.5685*4.18*90)-(0.0685*hf))/0.5\n",
"print(\"Therefore,heat transferred in process heater in KJ/kg steam generated=\"),round(0.5*(h3-h7),3)\n",
"print(\"so heat transferred per kg steam generated=1023.175 KJ/kg steam generated\")\n",
"print(\"For state 10 at exit of LPT,s10=s3=s2=6.3615 KJ/kg K\")\n",
"s10=s3;\n",
"print(\"Let dryness fraction be x10\")\n",
"print(\"s10=6.3615=sf at 0.075 bar+x10*sfg at 0.075 bar\")\n",
"print(\"from steam tables,at 0.075 bar,sf=0.5764 KJ/kg K,sfg=7.6750 KJ/kg K\")\n",
"sf=0.5764;\n",
"sfg=7.6750;\n",
"print(\"so x10=(s10-sf)/sfg\")\n",
"x10=(s10-sf)/sfg\n",
"x10=0.754;#approx.\n",
"print(\"h10=hf at 0.075 bar+x10*hfg at 0.075 bar\")\n",
"print(\"from steam tables,at 0.075 bar,hf=168.79 KJ/kg,hfg=2406.0 KJ/kg\")\n",
"hf=168.79;\n",
"hfg=2406.0;\n",
"print(\"so h10=hf+x10*hfg in KJ/kg \")\n",
"h10=hf+x10*hfg \n",
"print(\"net work output,neglecting pump work per kg of steam generated,\")\n",
"print(\"w_net=(h2-h3)*1+0.4315*(h3-h10) in KJ/kg steam generated\")\n",
"w_net=(h2-h3)*1+0.4315*(h3-h10) \n",
"q_add=(h2-4.18*68.425)\n",
"print(\"Heat added in boiler per kg steam generated,q_add in KJ/kg=\"),round(q_add,2)\n",
"w_net/q_add\n",
"print(\"thermal efficiency=w_net/q_add\"),round(w_net/q_add,2)\n",
"print(\"in percentage\"),round(w_net*100/q_add,2)\n",
"print(\"so Thermal efficiency=27.58%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.16;pg no: 291"
]
},
{
"cell_type": "code",
"execution_count": 103,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.16, Page:291 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 16\n",
"from steam tables,h1=3530.9 KJ/kg,s1=6.9486 KJ/kg K\n",
"Assuming isentropic expansion in nozzle,s1=s2=6.9486\n",
"Letdryness fraction at state 2,x2=0.864\n",
"s2=sf at 0.2 bar+x2*sfg at 0.2 bar\n",
"from steam tables,sf=0.8320 KJ/kg K,sfg=7.0766 KJ/kg K\n",
"so x2= 0.86\n",
"hence,h2=hf at 0.2 bar+x2*hfg at 0.2 bar in KJ/kg\n",
"from steam tables,hf at 0.2 bar=251.4 KJ/kg,hfg at 0.2 bar=2358.3 KJ/kg\n",
"considering pump work to be of isentropic type,deltah_34=v3*deltap_34\n",
"from steam table,v3=vf at 0.2 bar=0.001017 m^3/kg\n",
"or deltah_34 in KJ/kg= 7.1\n",
"pump work,Wp in KJ/kg= 7.1\n",
"turbine work,Wt=deltah_12=(h1-h2)in KJ/kg\n",
"net work(W_net)=Wt-Wp in KJ/kg\n",
"power produced(P)=mass flow rate*W_net in KJ/s\n",
"so net power=43.22 MW\n",
"heat supplied in boiler(Q)=(h1-h4) in KJ/kg\n",
"enthalpy at state 4,h4=h3+deltah_34 in KJ/kg\n",
"total heat supplied to boiler(Q)=m*(h1-h4)in KJ/s 114534.05\n",
"thermal efficiency=net work/heat supplied=W_net/Q 0.38\n",
"in percentage 37.73\n",
"so thermal efficiency=37.73%\n"
]
}
],
"source": [
"#cal of thermal efficiency,net power\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.16, Page:291 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 16\")\n",
"m=35;#mass flow rate in kg/s\n",
"print(\"from steam tables,h1=3530.9 KJ/kg,s1=6.9486 KJ/kg K\")\n",
"h1=3530.9;\n",
"s1=6.9486;\n",
"print(\"Assuming isentropic expansion in nozzle,s1=s2=6.9486\")\n",
"s2=s1;\n",
"print(\"Letdryness fraction at state 2,x2=0.864\")\n",
"print(\"s2=sf at 0.2 bar+x2*sfg at 0.2 bar\")\n",
"print(\"from steam tables,sf=0.8320 KJ/kg K,sfg=7.0766 KJ/kg K\")\n",
"sf=0.8320;\n",
"sfg=7.0766;\n",
"x2=(s2-sf)/sfg\n",
"print(\"so x2=\"),round(x2,2)\n",
"x2=0.864;#approx.\n",
"print(\"hence,h2=hf at 0.2 bar+x2*hfg at 0.2 bar in KJ/kg\")\n",
"print(\"from steam tables,hf at 0.2 bar=251.4 KJ/kg,hfg at 0.2 bar=2358.3 KJ/kg\")\n",
"hf=251.4;\n",
"hfg=2358.3;\n",
"h2=hf+x2*hfg\n",
"print(\"considering pump work to be of isentropic type,deltah_34=v3*deltap_34\")\n",
"print(\"from steam table,v3=vf at 0.2 bar=0.001017 m^3/kg\")\n",
"v3=0.001017;\n",
"p3=70;#;pressure of steam entering turbine in bar\n",
"p4=0.20;#condenser pressure in bar\n",
"deltah_34=v3*(p3-p4)*100\n",
"print(\"or deltah_34 in KJ/kg=\"),round(deltah_34,2)\n",
"Wp=deltah_34\n",
"print(\"pump work,Wp in KJ/kg=\"),round(Wp,2)\n",
"print(\"turbine work,Wt=deltah_12=(h1-h2)in KJ/kg\")\n",
"Wt=(h1-h2)\n",
"print(\"net work(W_net)=Wt-Wp in KJ/kg\")\n",
"W_net=Wt-Wp\n",
"print(\"power produced(P)=mass flow rate*W_net in KJ/s\")\n",
"P=m*W_net\n",
"print(\"so net power=43.22 MW\")\n",
"print(\"heat supplied in boiler(Q)=(h1-h4) in KJ/kg\")\n",
"print(\"enthalpy at state 4,h4=h3+deltah_34 in KJ/kg\")\n",
"h3=hf;\n",
"h4=h3+deltah_34 \n",
"Q=m*(h1-h4)\n",
"print(\"total heat supplied to boiler(Q)=m*(h1-h4)in KJ/s\"),round(Q,2)\n",
"print(\"thermal efficiency=net work/heat supplied=W_net/Q\"),round(P/Q,2)\n",
"print(\"in percentage\"),round(P*100/Q,2)\n",
"print(\"so thermal efficiency=37.73%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 8.17;pg no: 292"
]
},
{
"cell_type": "code",
"execution_count": 104,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 8.1, Page:292 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 17\n",
"from steam tables,h1=3625.3 KJ/s,s1=6.9029 KJ/kg K\n",
"due to isentropic expansion,s1=s2=s3=6.9029 KJ/kg K\n",
"at state 2,i.e at pressure of 2 MPa and entropy 6.9029 KJ/kg K\n",
"by interpolating state for s2 between 2 MPa,300 degree celcius and 2 MPa,350 degree celcius from steam tables,\n",
"h2=3105.08 KJ/kg \n",
"for state 3,i.e at pressure of 0.01 MPa entropy,s3 lies in wet region as s3In this question there is some caclulation mistake while calculating m6 in book,which is corrected above so some answers may vary.\n"
]
}
],
"source": [
"#cal of thermal efficiency,mass of steam\n",
"#intiation of all variables\n",
"# Chapter 8\n",
"print\"Example 8.18, Page:294 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 8 Example 18\")\n",
"W_net=50*10**3;#net output of turbine in KW\n",
"print(\"from steam tables,at inlet to first stage of turbine,h1=h at 100 bar,500oc=3373.7 KJ/kg,s1=s at 100 bar,500oc=6.5966 KJ/kg\")\n",
"h1=3373.7;\n",
"s1=6.5966;\n",
"print(\"Due to isentropic expansion,s1=s6=s2 and s3=s8=s4\")\n",
"s2=s1;\n",
"s6=s2;\n",
"print(\"State at 6 i.e bleed state from HP turbine,temperature by interpolation from steam table =261.6oc.\")\n",
"print(\"At inlet to second stage of turbine,h6=2930.572 KJ/kg\")\n",
"h6=2930.572;\n",
"print(\"h3=h at 10 bar,500oc=3478.5 KJ/kg,s3=s at 10 bar,500oc=7.7622 KJ/kg K\")\n",
"h3=3478.5;\n",
"s3=7.7622;\n",
"s4=s3;\n",
"s8=s4;\n",
"print(\"At exit from first stage of turbine i.e. at 10 bar and entropy of 6.5966 KJ/kg K,Temperature by interpolation from steam table at 10 bar and entropy of 6.5966 KJ/kg K\")\n",
"print(\"T2=181.8oc,h2=2782.8 KJ/kg\")\n",
"T2=181.8;\n",
"h2=2782.8;\n",
"print(\"state at 8,i.e bleed state from second stage of expansion,i.e at 4 bar and entropy of 7.7622 KJ/kg K,Temperature by interpolation from steam table,T8=358.98oc=359oc\")\n",
"T8=359;\n",
"print(\"h8=3188.7 KJ/kg\")\n",
"h8=3188.7;\n",
"print(\"state at 4 i.e. at condenser pressure of 0.1 bar and entropy of 7.7622 KJ/kg K,the state lies in wet region.So let the dryness fraction be x4.\")\n",
"print(\"s4=sf at 0.1 bar+x4*sfg at 0.1 bar\")\n",
"print(\"from steam tables,at 0.1 bar,sf=0.6493 KJ/kg K,sfg=7.5009 KJ/kg K\")\n",
"sf=0.6493;\n",
"sfg=7.5009; \n",
"x4=(s4-sf)/sfg\n",
"print(\"so x4=\"),round(x4,2)\n",
"x4=0.95;#approx.\n",
"print(\"h4=hf at 0.1 bar+x4*hfg at 0.1 bar in KJ/kg \")\n",
"print(\"from steam tables,at 0.1 bar,hf=191.83 KJ/kg,hfg=2392.8 KJ/kg\")\n",
"hf=191.83;\n",
"hfg=2392.8;\n",
"h4=hf+x4*hfg\n",
"print(\"given,h4=2464.99 KJ/kg,h11=856.8 KJ/kg,h9=hf at 4 bar=604.74 KJ/kg\")\n",
"h4=2464.99;\n",
"h11=856.8;\n",
"h9=604.74;\n",
"print(\"considering pump work,the net output can be given as,\")\n",
"print(\"W_net=W_HPT+W_LPT-(W_CEP+W_FP)\")\n",
"print(\"where,W_HPT={(h1-h6)+(1-m6)*(h6-h2)}per kg of steam from boiler.\")\n",
"print(\"W_LPT={(1-m6)+(h3-h8)*(1-m6-m8)*(h8-h4)}per kg of steam from boiler.\")\n",
"print(\"for closed feed water heater,energy balance yields;\")\n",
"print(\"m6*h6+h10=m6*h7+h11\")\n",
"print(\"assuming condensate leaving closed feed water heater to be saturated liquid,\")\n",
"print(\"h7=hf at 20 bar=908.79 KJ/kg\")\n",
"h7=908.79; \n",
"print(\"due to throttline,h7=h7_a=908.79 KJ/kg\")\n",
"h7_a=h7;\n",
"print(\"for open feed water heater,energy balance yields,\")\n",
"print(\"m6*h7_a+m8*h8+(1-m6-m8)*h5=h9\")\n",
"print(\"for condensate extraction pump,h5-h4_a=v4_a*deltap\")\n",
"print(\"h5-hf at 0.1 bar=vf at 0.1 bar*(4-0.1)*10^2 \")\n",
"print(\"from steam tables,at 0.1 bar,hf=191.83 KJ/kg,vf=0.001010 m^3/kg\")\n",
"hf=191.83;\n",
"vf=0.001010; \n",
"h5=hf+vf*(4-0.1)*10**2\n",
"print(\"so h5 in KJ/kg=\"),round(h5,2)\n",
"print(\"for feed pump,h10-h9=v9*deltap\")\n",
"print(\"h10=h9+vf at 4 bar*(100-4)*10^2 in KJ/kg\")\n",
"print(\"from steam tables,at 4 bar,hf=604.74 KJ/kg,vf=0.001084 m^3/kg \")\n",
"hf=604.74;\n",
"vf=0.001084;\n",
"h10=h9+vf*(100-4)*10**2\n",
"print(\"substituting in energy balance upon closed feed water heater,\")\n",
"m6=(h11-h10)/(h6-h7)\n",
"print(\"m6 in kg per kg of steam from boiler=\"),round(m6,3)\n",
"print(\"substituting in energy balance upon feed water heater,\")\n",
"m8=(h9-m6*h7_a+m6*h5-h5)/(h8-h5)\n",
"print(\"m8 in kg per kg of steam from boiler=\"),round(m8,3)\n",
"print(\"Let the mass of steam entering first stage of turbine be m kg,then\")\n",
"{(h1-h6)+(1-m6)*(h6-h2)}\n",
"print(\"W_HPT=m*{(h1-h6)+(1-m6)*(h6-h2)}\")\n",
"print(\"W_HPT/m=\"),round(((h1-h6)+(1-m6)*(h6-h2)),2)\n",
"print(\"so W_HPT=m*573.24 KJ\")\n",
"print(\"also,W_LPT={(1-m6)*(h3-h8)+(1-m6-m8)*(h8-h4)}per kg of steam from boiler\")\n",
"{(1-m6)*(h3-h8)+(1-m6-m8)*(h8-h4)}\n",
"print(\"W_LPT/m=\"),round(((1-m6)*(h3-h8)+(1-m6-m8)*(h8-h4)),2)\n",
"print(\"so W_LPT=m*813.42 KJ\")\n",
"print(\"pump works(negative work)\")\n",
"print(\"W_CEP=m*(1-m6-m8)*(h5-h4_a)\")\n",
"h4_a=191.83;#h4_a=hf at 0.1 bar\n",
"print(\"W_CEP/m=\")\n",
"(1-m6-m8)*(h5-h4_a)\n",
"print(\"so W_CEP=m* 0.304\")\n",
"print(\"W_FP=m*(h10-h9)\")\n",
"print(\"W_FP/m=\"),round((h10-h9),2)\n",
"print(\"so W_FP=m*10.41\")\n",
"print(\"net output,\")\n",
"print(\"W_net=W_HPT+W_LPT-W_CEP-W_FP \")\n",
"print(\"so 50*10^3=(573.24*m+813.42*m-0.304*m-10.41*m)\")\n",
"m=W_net/(573.24+813.42-0.304-10.41)\n",
"print(\"so m in kg/s=\"),round(m,2)\n",
"Q_add=m*(h1-h11)\n",
"print(\"heat supplied in boiler,Q_add in KJ/s=\"),round(m*(h1-h11),2)\n",
"print(\"Thermal efficenncy=\"),round(W_net/Q_add,2)\n",
"print(\"in percentage\"),round(W_net*100/Q_add,2)\n",
"print(\"so mass of steam bled at 20 bar=0.119 kg per kg of steam entering first stage\")\n",
"print(\"mass of steam bled at 4 bar=0.109 kg per kg of steam entering first stage\")\n",
"print(\"mass of steam entering first stage=36.33 kg/s\")\n",
"print(\"thermal efficiency=54.66%\")\n",
"print(\"NOTE=>In this question there is some caclulation mistake while calculating m6 in book,which is corrected above so some answers may vary.\")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I%D/+Engineering Thermodynamics/chapter9_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Chapter 9:Gas Power Cycles"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.1;pg no: 334"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.1, Page:334 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 1\n",
"SI engine operate on otto cycle.consider working fluid to be perfect gas.\n",
"here,y=Cp/Cv\n",
"Cp-Cv=R in KJ/kg K\n",
"compression ratio,r=V1/V2=(0.15+V2)/V2\n",
"so V2=0.15/(r-1) in m^3\n",
"so V2=0.03 m^3\n",
"total cylinder volume=V1=r*V2 m^3\n",
"from perfect gas law,P*V=m*R*T\n",
"so m=P1*V1/(R*T1) in kg\n",
"from state 1 to 2 by P*V^y=P2*V2^y\n",
"so P2=P1*(V1/V2)^y in KPa\n",
"also,P1*V1/T1=P2*V2/T2\n",
"so T2=P2*V2*T1/(P1*V1)in K\n",
"from heat addition process 2-3\n",
"Q23=m*CV*(T3-T2)\n",
"T3=T2+(Q23/(m*Cv))in K\n",
"also from,P3*V3/T3=P2*V2/T2\n",
"P3=P2*V2*T3/(V3*T2) in KPa\n",
"for adiabatic expansion 3-4,\n",
"P3*V3^y=P4*V4^y\n",
"and V4=V1\n",
"hence,P4=P3*V3^y/V1^y in KPa\n",
"and from P3*V3/T3=P4*V4/T4\n",
"T4=P4*V4*T3/(P3*V3) in K\n",
"entropy change from 2-3 and 4-1 are same,and can be given as,\n",
"S3-S2=S4-S1=m*Cv*log(T4/T1)\n",
"so entropy change,deltaS_32=deltaS_41 in KJ/K\n",
"heat rejected,Q41=m*Cv*(T4-T1) in KJ\n",
"net work(W) in KJ= 76.75\n",
"efficiency(n)= 0.51\n",
"in percentage 51.16\n",
"mean effective pressure(mep)=work/volume change in KPa= 511.64\n",
"so mep=511.67 KPa\n"
]
}
],
"source": [
"#cal of mean effective pressure\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 9.1, Page:334 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 1\")\n",
"Cp=1;#specific heat at constant pressure in KJ/kg K\n",
"Cv=0.71;#specific heat at constant volume in KJ/kg K\n",
"P1=98;#pressure at begining of compression in KPa\n",
"T1=(60+273.15);#temperature at begining of compression in K\n",
"Q23=150;#heat supplied in KJ/kg\n",
"r=6;#compression ratio\n",
"R=0.287;#gas constant in KJ/kg K\n",
"print(\"SI engine operate on otto cycle.consider working fluid to be perfect gas.\")\n",
"print(\"here,y=Cp/Cv\")\n",
"y=Cp/Cv\n",
"y=1.4;#approx.\n",
"print(\"Cp-Cv=R in KJ/kg K\")\n",
"R=Cp-Cv\n",
"print(\"compression ratio,r=V1/V2=(0.15+V2)/V2\")\n",
"print(\"so V2=0.15/(r-1) in m^3\")\n",
"V2=0.15/(r-1)\n",
"print(\"so V2=0.03 m^3\")\n",
"print(\"total cylinder volume=V1=r*V2 m^3\")\n",
"V1=r*V2\n",
"print(\"from perfect gas law,P*V=m*R*T\")\n",
"print(\"so m=P1*V1/(R*T1) in kg\")\n",
"m=P1*V1/(R*T1)\n",
"m=0.183;#approx.\n",
"print(\"from state 1 to 2 by P*V^y=P2*V2^y\")\n",
"print(\"so P2=P1*(V1/V2)^y in KPa\")\n",
"P2=P1*(V1/V2)**y\n",
"print(\"also,P1*V1/T1=P2*V2/T2\")\n",
"print(\"so T2=P2*V2*T1/(P1*V1)in K\")\n",
"T2=P2*V2*T1/(P1*V1)\n",
"print(\"from heat addition process 2-3\")\n",
"print(\"Q23=m*CV*(T3-T2)\")\n",
"print(\"T3=T2+(Q23/(m*Cv))in K\")\n",
"T3=T2+(Q23/(m*Cv))\n",
"print(\"also from,P3*V3/T3=P2*V2/T2\")\n",
"print(\"P3=P2*V2*T3/(V3*T2) in KPa\")\n",
"V3=V2;#constant volume process\n",
"P3=P2*V2*T3/(V3*T2) \n",
"print(\"for adiabatic expansion 3-4,\")\n",
"print(\"P3*V3^y=P4*V4^y\")\n",
"print(\"and V4=V1\")\n",
"V4=V1;\n",
"print(\"hence,P4=P3*V3^y/V1^y in KPa\")\n",
"P4=P3*V3**y/V1**y\n",
"print(\"and from P3*V3/T3=P4*V4/T4\")\n",
"print(\"T4=P4*V4*T3/(P3*V3) in K\")\n",
"T4=P4*V4*T3/(P3*V3)\n",
"print(\"entropy change from 2-3 and 4-1 are same,and can be given as,\")\n",
"print(\"S3-S2=S4-S1=m*Cv*log(T4/T1)\")\n",
"print(\"so entropy change,deltaS_32=deltaS_41 in KJ/K\")\n",
"deltaS_32=m*Cv*math.log(T4/T1)\n",
"deltaS_41=deltaS_32;\n",
"print(\"heat rejected,Q41=m*Cv*(T4-T1) in KJ\")\n",
"Q41=m*Cv*(T4-T1)\n",
"W=Q23-Q41\n",
"print(\"net work(W) in KJ=\"),round(W,2)\n",
"n=W/Q23\n",
"print(\"efficiency(n)=\"),round(W/Q23,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"mep=W/0.15\n",
"print(\"mean effective pressure(mep)=work/volume change in KPa=\"),round(W/0.15,2)\n",
"print(\"so mep=511.67 KPa\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.2;pg no: 336"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.2, Page:336 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 2\n",
"as given\n",
"Va=V2+(7/8)*(V1-V2)\n",
"Vb=V2+(1/8)*(V1-V2)\n",
"and also\n",
"Pa*Va^y=Pb*Vb^y\n",
"so (Va/Vb)=(Pb/Pa)^(1/y)\n",
"also substituting for Va and Vb\n",
"(V2+(7/8)*(V1-V2))/(V2+(1/8)*(V1-V2))=5.18\n",
"so V1/V2=r=1+(4.18*8/1.82) 19.37\n",
"it gives r=19.37 or V1/V2=19.37,compression ratio=19.37\n",
"as given;cut off occurs at(V1-V2)/15 volume\n",
"V3=V2+(V1-V2)/15\n",
"cut off ratio,rho=V3/V2\n",
"air standard efficiency for diesel cycle(n_airstandard)= 0.63\n",
"in percentage 63.23\n",
"overall efficiency(n_overall)=n_airstandard*n_ite*n_mech 0.253\n",
"in percentage 25.3\n",
"fuel consumption,bhp/hr in kg= 0.26\n",
"so compression ratio=19.37\n",
"air standard efficiency=63.25%\n",
"fuel consumption,bhp/hr=0.255 kg\n"
]
}
],
"source": [
"#cal of compression ratio,air standard efficiency,fuel consumption,bhp/hr\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.2, Page:336 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 2\")\n",
"Pa=138;#pressure during compression at 1/8 of stroke in KPa\n",
"Pb=1.38*10**3;#pressure during compression at 7/8 of stroke in KPa\n",
"n_ite=0.5;#indicated thermal efficiency\n",
"n_mech=0.8;#mechanical efficiency\n",
"C=41800;#calorific value in KJ/kg\n",
"y=1.4;#expansion constant\n",
"print(\"as given\")\n",
"print(\"Va=V2+(7/8)*(V1-V2)\")\n",
"print(\"Vb=V2+(1/8)*(V1-V2)\")\n",
"print(\"and also\")\n",
"print(\"Pa*Va^y=Pb*Vb^y\")\n",
"print(\"so (Va/Vb)=(Pb/Pa)^(1/y)\")\n",
"(Pb/Pa)**(1/y)\n",
"print(\"also substituting for Va and Vb\")\n",
"print(\"(V2+(7/8)*(V1-V2))/(V2+(1/8)*(V1-V2))=5.18\")\n",
"r=1+(4.18*8/1.82)\n",
"print(\"so V1/V2=r=1+(4.18*8/1.82)\"),round(r,2)\n",
"print(\"it gives r=19.37 or V1/V2=19.37,compression ratio=19.37\")\n",
"print(\"as given;cut off occurs at(V1-V2)/15 volume\")\n",
"print(\"V3=V2+(V1-V2)/15\")\n",
"print(\"cut off ratio,rho=V3/V2\")\n",
"rho=1+(r-1)/15\n",
"n_airstandard=1-(1/(r**(y-1)*y))*((rho**y-1)/(rho-1))\n",
"print(\"air standard efficiency for diesel cycle(n_airstandard)=\"),round(n_airstandard,2)\n",
"print(\"in percentage\"),round(n_airstandard*100,2)\n",
"n_airstandard=0.6325;\n",
"n_overall=n_airstandard*n_ite*n_mech\n",
"print(\"overall efficiency(n_overall)=n_airstandard*n_ite*n_mech\"),round(n_overall,3)\n",
"print(\"in percentage\"),round(n_overall*100,2)\n",
"n_overall=0.253;\n",
"75*60*60/(n_overall*C*100)\n",
"print(\"fuel consumption,bhp/hr in kg=\"),round(75*60*60/(n_overall*C*100),2)\n",
"print(\"so compression ratio=19.37\")\n",
"print(\"air standard efficiency=63.25%\")\n",
"print(\"fuel consumption,bhp/hr=0.255 kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.3;pg no: 338"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.3, Page:338 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 3\n",
"1-2-3-4=cycle a\n",
"1-2_a-3_a-4_a-5=cycle b\n",
"here Cp/Cv=y\n",
"and R=0.293 KJ/kg K\n",
"let us consider 1 kg of air for perfect gas,\n",
"P*V=m*R*T\n",
"so V1=m*R*T1/P1 in m^3\n",
"at state 3,\n",
"P3*V3=m*R*T3\n",
"so T3/V2=P3/(m*R)\n",
"so T3=17064.8*V2............eq1\n",
"for cycle a and also for cycle b\n",
"T3_a=17064.8*V2_a.............eq2\n",
"a> for otto cycle,\n",
"Q23=Cv*(T3-T2)\n",
"so T3-T2=Q23/Cv\n",
"and T2=T3-2394.36.............eq3\n",
"from gas law,P2*V2/T2=P3*V3/T3\n",
"here V2=V3 and using eq 3,we get\n",
"so P2/(T3-2394.36)=5000/T3\n",
"substituting T3 as function of V2\n",
"P2/(17064.8*V2-2394.36)=5000/(17064.8*V2)\n",
"P2=5000*(17064.8*V2-2394.36)/(17064.8*V2)\n",
"also P1*V1^y=P2*V2^y\n",
"or 103*(1.06)^1.4=(5000*(17064.8*V2-2394.36)/(17064.8*V2))*V2^1.4\n",
"upon solving it yields\n",
"381.4*V2=17064.8*V2^2.4-2394.36*V2^1.4\n",
"or V2^1.4-0.140*V2^0.4-.022=0\n",
"by hit and trial it yields,V2=0.18 \n",
"thus compression ratio,r=V1/V2\n",
"otto cycle efficiency,n_otto=1-(1/r)^(y-1)\n",
"in percentage\n",
"b> for mixed or dual cycle\n",
"Cp*(T4_a-T3_a)=Cv*(T3_a-T2_a)=1700/2=850\n",
"or T3_a-T2_a=850/Cv\n",
"or T2_a=T3_a-1197.2 .............eq4 \n",
"also P2_a*V2_a/T2_a=P3_a*V3_a/T3_a\n",
"P2_a*V2_a/(T3_a-1197.2)=5000*V2_a/T3_a\n",
"or P2_a/(T3_a-1197.2)=5000/T3_a\n",
"also we had seen earlier that T3_a=17064.8*V2_a\n",
"so P2_a/(17064.8*V2_a-1197.2)=5000/(17064.8*V2_a)\n",
"so P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a).....................eq5\n",
"or for adiabatic process,1-2_a\n",
"P1*V1^y=P2*V2^y\n",
"so 1.3*(1.06)^1.4=V2_a^1.4*(5000-(359.78/V2_a))\n",
"or V2_a^1.4-0.07*V2_a^0.4-0.022=0\n",
"by hit and trial \n",
"V2_a=0.122 m^3\n",
"therefore upon substituting V2_a,\n",
"by eq 5,P2_a in KPa\n",
"by eq 2,T3_a in K\n",
"by eq 4,T2_a in K\n",
"from constant pressure heat addition\n",
"Cp*(T4_a-T3_a)=850\n",
"so T4_a=T3_a+(850/Cp) in K\n",
"also P4_a*V4_a/T4_a= P3_a*V3_a/T3_a\n",
"so V4_a=P3_a*V3_a*T4_a/(T3_a*P4_a) in m^3 \n",
"here P3_a=P4_a and V2_a=V3_a\n",
"using adiabatic formulations V4_a=0.172 m^3\n",
"(V5/V4_a)^(y-1)=(T4_a/T5),here V5=V1\n",
"so T5=T4_a/(V5/V4_a)^(y-1) in K\n",
"heat rejected in process 5-1,Q51=Cv*(T5-T1) in KJ\n",
"efficiency of mixed cycle(n_mixed)= 0.57\n",
"in percentage 56.55\n"
]
},
{
"data": {
"text/plain": [
"'NOTE=>In this question temperature difference (T3-T2) for part a> in book is calculated wrong i.e 2328.77,which is corrected above and comes to be 2394.36,however it doesnt effect the efficiency of any part of this question.'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#cal of comparing efficiency of two cycles\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.3, Page:338 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 3\")\n",
"T1=(100+273.15);#temperature at beginning of compresssion in K\n",
"P1=103;#pressure at beginning of compresssion in KPa\n",
"Cp=1.003;#specific heat at constant pressure in KJ/kg K\n",
"Cv=0.71;#specific heat at constant volume in KJ/kg K\n",
"Q23=1700;#heat added during combustion in KJ/kg\n",
"P3=5000;#maximum pressure in cylinder in KPa\n",
"print(\"1-2-3-4=cycle a\")\n",
"print(\"1-2_a-3_a-4_a-5=cycle b\")\n",
"print(\"here Cp/Cv=y\")\n",
"y=Cp/Cv\n",
"y=1.4;#approx.\n",
"print(\"and R=0.293 KJ/kg K\")\n",
"R=0.293;\n",
"print(\"let us consider 1 kg of air for perfect gas,\")\n",
"m=1;#mass of air in kg\n",
"print(\"P*V=m*R*T\")\n",
"print(\"so V1=m*R*T1/P1 in m^3\")\n",
"V1=m*R*T1/P1\n",
"print(\"at state 3,\")\n",
"print(\"P3*V3=m*R*T3\")\n",
"print(\"so T3/V2=P3/(m*R)\")\n",
"P3/(m*R)\n",
"print(\"so T3=17064.8*V2............eq1\")\n",
"print(\"for cycle a and also for cycle b\")\n",
"print(\"T3_a=17064.8*V2_a.............eq2\")\n",
"print(\"a> for otto cycle,\")\n",
"print(\"Q23=Cv*(T3-T2)\")\n",
"print(\"so T3-T2=Q23/Cv\")\n",
"Q23/Cv\n",
"print(\"and T2=T3-2394.36.............eq3\")\n",
"print(\"from gas law,P2*V2/T2=P3*V3/T3\")\n",
"print(\"here V2=V3 and using eq 3,we get\")\n",
"print(\"so P2/(T3-2394.36)=5000/T3\")\n",
"print(\"substituting T3 as function of V2\")\n",
"print(\"P2/(17064.8*V2-2394.36)=5000/(17064.8*V2)\")\n",
"print(\"P2=5000*(17064.8*V2-2394.36)/(17064.8*V2)\")\n",
"print(\"also P1*V1^y=P2*V2^y\")\n",
"print(\"or 103*(1.06)^1.4=(5000*(17064.8*V2-2394.36)/(17064.8*V2))*V2^1.4\")\n",
"print(\"upon solving it yields\")\n",
"print(\"381.4*V2=17064.8*V2^2.4-2394.36*V2^1.4\")\n",
"print(\"or V2^1.4-0.140*V2^0.4-.022=0\")\n",
"print(\"by hit and trial it yields,V2=0.18 \")\n",
"V2=0.18;\n",
"print(\"thus compression ratio,r=V1/V2\")\n",
"r=V1/V2\n",
"print(\"otto cycle efficiency,n_otto=1-(1/r)^(y-1)\")\n",
"n_otto=1-(1/r)**(y-1)\n",
"print(\"in percentage\")\n",
"n_otto=n_otto*100\n",
"print(\"b> for mixed or dual cycle\")\n",
"print(\"Cp*(T4_a-T3_a)=Cv*(T3_a-T2_a)=1700/2=850\")\n",
"print(\"or T3_a-T2_a=850/Cv\")\n",
"850/Cv\n",
"print(\"or T2_a=T3_a-1197.2 .............eq4 \")\n",
"print(\"also P2_a*V2_a/T2_a=P3_a*V3_a/T3_a\")\n",
"print(\"P2_a*V2_a/(T3_a-1197.2)=5000*V2_a/T3_a\")\n",
"print(\"or P2_a/(T3_a-1197.2)=5000/T3_a\")\n",
"print(\"also we had seen earlier that T3_a=17064.8*V2_a\")\n",
"print(\"so P2_a/(17064.8*V2_a-1197.2)=5000/(17064.8*V2_a)\")\n",
"print(\"so P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a).....................eq5\")\n",
"print(\"or for adiabatic process,1-2_a\")\n",
"print(\"P1*V1^y=P2*V2^y\")\n",
"print(\"so 1.3*(1.06)^1.4=V2_a^1.4*(5000-(359.78/V2_a))\")\n",
"print(\"or V2_a^1.4-0.07*V2_a^0.4-0.022=0\")\n",
"print(\"by hit and trial \")\n",
"print(\"V2_a=0.122 m^3\")\n",
"V2_a=0.122;\n",
"print(\"therefore upon substituting V2_a,\")\n",
"print(\"by eq 5,P2_a in KPa\")\n",
"P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a)\n",
"print(\"by eq 2,T3_a in K\")\n",
"T3_a=17064.8*V2_a\n",
"print(\"by eq 4,T2_a in K\")\n",
"T2_a=T3_a-1197.2\n",
"print(\"from constant pressure heat addition\")\n",
"print(\"Cp*(T4_a-T3_a)=850\")\n",
"print(\"so T4_a=T3_a+(850/Cp) in K\")\n",
"T4_a=T3_a+(850/Cp)\n",
"print(\"also P4_a*V4_a/T4_a= P3_a*V3_a/T3_a\")\n",
"print(\"so V4_a=P3_a*V3_a*T4_a/(T3_a*P4_a) in m^3 \")\n",
"print(\"here P3_a=P4_a and V2_a=V3_a\")\n",
"V4_a=V2_a*T4_a/(T3_a)\n",
"print(\"using adiabatic formulations V4_a=0.172 m^3\")\n",
"print(\"(V5/V4_a)^(y-1)=(T4_a/T5),here V5=V1\")\n",
"V5=V1;\n",
"print(\"so T5=T4_a/(V5/V4_a)^(y-1) in K\")\n",
"T5=T4_a/(V5/V4_a)**(y-1)\n",
"print(\"heat rejected in process 5-1,Q51=Cv*(T5-T1) in KJ\")\n",
"Q51=Cv*(T5-T1)\n",
"n_mixed=(Q23-Q51)/Q23\n",
"print(\"efficiency of mixed cycle(n_mixed)=\"),round(n_mixed,2)\n",
"print(\"in percentage\"),round(n_mixed*100,2)\n",
"(\"NOTE=>In this question temperature difference (T3-T2) for part a> in book is calculated wrong i.e 2328.77,which is corrected above and comes to be 2394.36,however it doesnt effect the efficiency of any part of this question.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.4;pg no: 341"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.4, Page:341 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 4\n",
"optimum pressure ratio for maximum work output,\n",
"rp=(T_max/T_min)^((y)/(2*(y-1)))\n",
"so p2/p1=11.3,For process 1-2, T2/T1=(p2/p1)^(y/(y-1))\n",
"so T2=T1*(p2/p1)^((y-1)/y)in K\n",
"For process 3-4,\n",
"T3/T4=(p3/p4)^((y-1)/y)=(p2/p1)^((y-1)/y)\n",
"so T4=T3/(rp)^((y-1)/y)in K\n",
"heat supplied,Q23=Cp*(T3-T2)in KJ/kg\n",
"compressor work,Wc in KJ/kg= 301.5\n",
"turbine work,Wt in KJ/kg= 603.0\n",
"thermal efficiency=net work/heat supplied= 0.5\n",
"so compressor work=301.5 KJ/kg,turbine work=603 KJ/kg,thermal efficiency=50%\n"
]
}
],
"source": [
"#cal of thermal efficiency,turbine and compressor work\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.4, Page:341 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 4\")\n",
"T3=1200;#maximum temperature in K\n",
"T1=300;#minimum temperature in K\n",
"y=1.4;#expansion constant\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"print(\"optimum pressure ratio for maximum work output,\")\n",
"print(\"rp=(T_max/T_min)^((y)/(2*(y-1)))\")\n",
"T_max=T3;\n",
"T_min=T1;\n",
"rp=(T_max/T_min)**((y)/(2*(y-1)))\n",
"print(\"so p2/p1=11.3,For process 1-2, T2/T1=(p2/p1)^(y/(y-1))\")\n",
"print(\"so T2=T1*(p2/p1)^((y-1)/y)in K\")\n",
"T2=T1*(rp)**((y-1)/y)\n",
"print(\"For process 3-4,\")\n",
"print(\"T3/T4=(p3/p4)^((y-1)/y)=(p2/p1)^((y-1)/y)\")\n",
"print(\"so T4=T3/(rp)^((y-1)/y)in K\")\n",
"T4=T3/(rp)**((y-1)/y)\n",
"print(\"heat supplied,Q23=Cp*(T3-T2)in KJ/kg\")\n",
"Q23=Cp*(T3-T2)\n",
"Wc=Cp*(T2-T1)\n",
"print(\"compressor work,Wc in KJ/kg=\"),round(Wc,2)\n",
"Wt=Cp*(T3-T4)\n",
"print(\"turbine work,Wt in KJ/kg=\"),round(Wt,2)\n",
"(Wt-Wc)/Q23\n",
"print(\"thermal efficiency=net work/heat supplied=\"),round((Wt-Wc)/Q23,2)\n",
"print(\"so compressor work=301.5 KJ/kg,turbine work=603 KJ/kg,thermal efficiency=50%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.5;pg no: 342"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.5, Page:342 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 5\n",
"gas turbine cycle is shown by 1-2-3-4 on T-S diagram,\n",
"for process 1-2 being isentropic,\n",
"T2/T1=(P2/P1)^((y-1)/y)\n",
"so T2=T1*(P2/P1)^((y-1)/y) in K\n",
"considering compressor efficiency,n_compr=(T2-T1)/(T2_a-T1)\n",
"so T2_a=T1+((T2-T1)/n_compr)in K\n",
"during process 2-3 due to combustion of unit mass of compressed the energy balance shall be as under,\n",
"heat added=mf*q\n",
"=((ma+mf)*Cp_comb*T3)-(ma*Cp_air*T2)\n",
"or (mf/ma)*q=((1+(mf/ma))*Cp_comb*T3)-(Cp_air*T2_a)\n",
"so T3=((mf/ma)*q+(Cp_air*T2_a))/((1+(mf/ma))*Cp_comb)in K\n",
"for expansion 3-4 being\n",
"T4/T3=(P4/P3)^((n-1)/n)\n",
"so T4=T3*(P4/P3)^((n-1)/n) in K\n",
"actaul temperature at turbine inlet considering internal efficiency of turbine,\n",
"n_turb=(T3-T4_a)/(T3-T4)\n",
"so T4_a=T3-(n_turb*(T3-T4)) in K\n",
"compressor work,per kg of air compressed(Wc) in KJ/kg of air= 234.42\n",
"so compressor work=234.42 KJ/kg of air\n",
"turbine work,per kg of air compressed(Wt) in KJ/kg of air= 414.71\n",
"so turbine work=414.71 KJ/kg of air\n",
"net work(W_net) in KJ/kg of air= 180.29\n",
"heat supplied(Q) in KJ/kg of air= 751.16\n",
"thermal efficiency(n)= 0.24\n",
"in percentage 24.0\n",
"so thermal efficiency=24%\n"
]
}
],
"source": [
"#cal of thermal efficiency,turbine and compressor work\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.5, Page:342 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 5\")\n",
"P1=1*10**5;#initial pressure in Pa\n",
"P4=P1;#constant pressure process\n",
"T1=300;#initial temperature in K\n",
"P2=6.2*10**5;#pressure after compression in Pa\n",
"P3=P2;#constant pressure process\n",
"k=0.017;#fuel to air ratio\n",
"n_compr=0.88;#compressor efficiency\n",
"q=44186;#heating value of fuel in KJ/kg\n",
"n_turb=0.9;#turbine internal efficiency\n",
"Cp_comb=1.147;#specific heat of combustion at constant pressure in KJ/kg K\n",
"Cp_air=1.005;#specific heat of air at constant pressure in KJ/kg K\n",
"y=1.4;#expansion constant\n",
"n=1.33;#expansion constant for polytropic constant\n",
"print(\"gas turbine cycle is shown by 1-2-3-4 on T-S diagram,\")\n",
"print(\"for process 1-2 being isentropic,\")\n",
"print(\"T2/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"so T2=T1*(P2/P1)^((y-1)/y) in K\")\n",
"T2=T1*(P2/P1)**((y-1)/y)\n",
"print(\"considering compressor efficiency,n_compr=(T2-T1)/(T2_a-T1)\")\n",
"print(\"so T2_a=T1+((T2-T1)/n_compr)in K\")\n",
"T2_a=T1+((T2-T1)/n_compr)\n",
"print(\"during process 2-3 due to combustion of unit mass of compressed the energy balance shall be as under,\")\n",
"print(\"heat added=mf*q\")\n",
"print(\"=((ma+mf)*Cp_comb*T3)-(ma*Cp_air*T2)\")\n",
"print(\"or (mf/ma)*q=((1+(mf/ma))*Cp_comb*T3)-(Cp_air*T2_a)\")\n",
"print(\"so T3=((mf/ma)*q+(Cp_air*T2_a))/((1+(mf/ma))*Cp_comb)in K\")\n",
"T3=((k)*q+(Cp_air*T2_a))/((1+(k))*Cp_comb)\n",
"print(\"for expansion 3-4 being\")\n",
"print(\"T4/T3=(P4/P3)^((n-1)/n)\")\n",
"print(\"so T4=T3*(P4/P3)^((n-1)/n) in K\")\n",
"T4=T3*(P4/P3)**((n-1)/n)\n",
"print(\"actaul temperature at turbine inlet considering internal efficiency of turbine,\")\n",
"print(\"n_turb=(T3-T4_a)/(T3-T4)\")\n",
"print(\"so T4_a=T3-(n_turb*(T3-T4)) in K\")\n",
"T4_a=T3-(n_turb*(T3-T4))\n",
"Wc=Cp_air*(T2_a-T1)\n",
"print(\"compressor work,per kg of air compressed(Wc) in KJ/kg of air=\"),round(Wc,2)\n",
"print(\"so compressor work=234.42 KJ/kg of air\")\n",
"Wt=Cp_comb*(T3-T4_a)\n",
"print(\"turbine work,per kg of air compressed(Wt) in KJ/kg of air=\"),round(Wt,2)\n",
"print(\"so turbine work=414.71 KJ/kg of air\")\n",
"W_net=Wt-Wc\n",
"print(\"net work(W_net) in KJ/kg of air=\"),round(W_net,2)\n",
"Q=k*q\n",
"print(\"heat supplied(Q) in KJ/kg of air=\"),round(Q,2)\n",
"n=W_net/Q\n",
"print(\"thermal efficiency(n)=\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"so thermal efficiency=24%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.6;pg no: 343"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.6, Page:343 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 6\n",
"NOTE=>In this question formula for overall pressure ratio is derived,which cannot be done using scilab,so using this formula we proceed further.\n",
"overall pressure ratio(rp)= 13.59\n",
"so overall optimum pressure ratio=13.6\n"
]
}
],
"source": [
"#cal of overall optimum pressure ratio\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.6, Page:343 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 6\")\n",
"T1=300;#minimum temperature in brayton cycle in K\n",
"T5=1200;#maximum temperature in brayton cycle in K\n",
"n_isen_c=0.85;#isentropic efficiency of compressor\n",
"n_isen_t=0.9;#isentropic efficiency of turbine\n",
"y=1.4;#expansion constant\n",
"print(\"NOTE=>In this question formula for overall pressure ratio is derived,which cannot be done using scilab,so using this formula we proceed further.\")\n",
"rp=(T1/(T5*n_isen_c*n_isen_t))**((2*y)/(3*(1-y)))\n",
"print(\"overall pressure ratio(rp)=\"),round(rp,2)\n",
"print(\"so overall optimum pressure ratio=13.6\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.7;pg no: 346"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.7, Page:346 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 7\n",
"i> theoretically state of air at exit can be determined by the given stage pressure ratio of 1.35.Let pressure at inlet to first stage P1 and subsequent intermediate pressure be P2,P3,P4,P5,P6,P7,P8 and exit pressure being P9.\n",
"therefore,P2/P1=P3/P2=P4/P3=P5/P4=P6/P5=P7/P6=P8/P7=P9/P8=r=1.35\n",
"or P9/P1=k=(1.35)^8 11.03\n",
"or theoretically,the temperature at exit of compressor can be predicted considering isentropic compression of air(y=1.4)\n",
"T9/T1=(P9/P1)^((y-1)/y)\n",
"so T9 in K= 621.47\n",
"considering overall efficiency of compression 82% the actual temperature at compressor exit can be obtained\n",
"(T9-T1)/(T9_actual-T1)=0.82\n",
"so T9_actual=T1+((T9-T1)/0.82) in K 689.19\n",
"let the actual index of compression be n, then\n",
"(T9_actual/T1)=(P9/P1)^((n-1)/n)\n",
"so n=log(P9/P1)/(log(P9/P1)-log(T9-actual/T1))\n",
"so state of air at exit of compressor,pressure=11.03 bar and temperature=689.18 K\n",
"ii> let polytropic efficiency be n_polytropic for compressor then,\n",
"(n-1)/n=((y-1)/y)*(1/n_polytropic)\n",
"so n_polytropic= 0.87\n",
"in percentage 86.9\n",
"so ploytropic efficiency=86.88%\n",
"iii> stage efficiency can be estimated for any stage.say first stage.\n",
"ideal state at exit of compressor stage=T2/T1=(P2/P1)^((y-1)/y)\n",
"so T2=T1*(P2/P1)^((y-1)/y) in K\n",
"actual temperature at exit of first stage can be estimated using polytropic index 1.49.\n",
"T2_actual/T1=(P2/P1)^((n-1)/n)\n",
"so T2_actual=T1*(P2/P1)^((n-1)/n) in K\n",
"stage efficiency for first stage,ns_1= 0.86\n",
"in percentage 86.33\n",
"actual temperature at exit of second stage,\n",
"T3_actual/T2_actual=(P3/P2)^((n-1)/n)\n",
"so T3_actual=T2_actual*(P3/P2)^((n-1)/n) in K\n",
"ideal temperature at exit of second stage\n",
"T3/T2_actual=(P3/P2)^((n-1)/n)\n",
"so T3=T2_actual*(P3/P2)^((y-1)/y) in K\n",
"stage efficiency for second stage,ns_2= 0.86\n",
"in percentage 86.33\n",
"actual rtemperature at exit of third stage,\n",
"T4_actual/T3_actual=(P4/P3)^((n-1)/n)\n",
"so T4_actual in K= 420.83\n",
"ideal temperature at exit of third stage,\n",
"T4/T3_actual=(P4/P3)^((n-1)/n)\n",
"so T4 in K= 415.42\n",
"stage efficiency for third stage,ns_3= 0.86\n",
"in percentage= 8632.9\n",
"so stage efficiency=86.4%\n",
"iv> from steady flow energy equation,\n",
"Wc=dw=dh and dh=du+p*dv+v*dp\n",
"dh=dq+v*dp\n",
"dq=0 in adiabatic process\n",
"dh=v*dp\n",
"Wc=v*dp\n",
"here for polytropic compression \n",
"P*V^1.49=constant i.e n=1.49\n",
"Wc in KJ/s= 16419.87\n",
"due to overall efficiency being 90% the actual compressor work(Wc_actual) in KJ/s= 14777.89\n",
"so power required to drive compressor =14777.89 KJ/s\n"
]
}
],
"source": [
"#cal of state of air at exit of compressor,polytropic efficiency,efficiency of each sate,power\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 9.7, Page:346 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 7\")\n",
"T1=313.;#air entering temperature in K\n",
"P1=1*10**5;#air entering pressure in Pa\n",
"m=50.;#flow rate through compressor in kg/s\n",
"R=0.287;#gas constant in KJ/kg K\n",
"print(\"i> theoretically state of air at exit can be determined by the given stage pressure ratio of 1.35.Let pressure at inlet to first stage P1 and subsequent intermediate pressure be P2,P3,P4,P5,P6,P7,P8 and exit pressure being P9.\")\n",
"print(\"therefore,P2/P1=P3/P2=P4/P3=P5/P4=P6/P5=P7/P6=P8/P7=P9/P8=r=1.35\")\n",
"r=1.35;#compression ratio\n",
"k=(1.35)**8\n",
"print(\"or P9/P1=k=(1.35)^8\"),round(k,2)\n",
"k=11.03;#approx.\n",
"print(\"or theoretically,the temperature at exit of compressor can be predicted considering isentropic compression of air(y=1.4)\")\n",
"y=1.4;#expansion constant \n",
"print(\"T9/T1=(P9/P1)^((y-1)/y)\")\n",
"T9=T1*(k)**((y-1)/y)\n",
"print(\"so T9 in K=\"),round(T9,2)\n",
"print(\"considering overall efficiency of compression 82% the actual temperature at compressor exit can be obtained\")\n",
"print(\"(T9-T1)/(T9_actual-T1)=0.82\")\n",
"T9_actual=T1+((T9-T1)/0.82)\n",
"print(\"so T9_actual=T1+((T9-T1)/0.82) in K\"),round(T9_actual,2)\n",
"print(\"let the actual index of compression be n, then\")\n",
"print(\"(T9_actual/T1)=(P9/P1)^((n-1)/n)\")\n",
"print(\"so n=log(P9/P1)/(log(P9/P1)-log(T9-actual/T1))\")\n",
"n=math.log(k)/(math.log(k)-math.log(T9_actual/T1))\n",
"print(\"so state of air at exit of compressor,pressure=11.03 bar and temperature=689.18 K\")\n",
"print(\"ii> let polytropic efficiency be n_polytropic for compressor then,\")\n",
"print(\"(n-1)/n=((y-1)/y)*(1/n_polytropic)\")\n",
"n_polytropic=((y-1)/y)/((n-1)/n)\n",
"print(\"so n_polytropic=\"),round(n_polytropic,2)\n",
"print(\"in percentage\"),round(n_polytropic*100,2)\n",
"print(\"so ploytropic efficiency=86.88%\")\n",
"print(\"iii> stage efficiency can be estimated for any stage.say first stage.\")\n",
"print(\"ideal state at exit of compressor stage=T2/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"so T2=T1*(P2/P1)^((y-1)/y) in K\")\n",
"T2=T1*(r)**((y-1)/y)\n",
"print(\"actual temperature at exit of first stage can be estimated using polytropic index 1.49.\")\n",
"print(\"T2_actual/T1=(P2/P1)^((n-1)/n)\")\n",
"print(\"so T2_actual=T1*(P2/P1)^((n-1)/n) in K\")\n",
"T2_actual=T1*(r)**((n-1)/n)\n",
"ns_1=(T2-T1)/(T2_actual-T1)\n",
"print(\"stage efficiency for first stage,ns_1=\"),round(ns_1,2)\n",
"print(\"in percentage\"),round(ns_1*100,2)\n",
"print(\"actual temperature at exit of second stage,\")\n",
"print(\"T3_actual/T2_actual=(P3/P2)^((n-1)/n)\")\n",
"print(\"so T3_actual=T2_actual*(P3/P2)^((n-1)/n) in K\")\n",
"T3_actual=T2_actual*(r)**((n-1)/n)\n",
"print(\"ideal temperature at exit of second stage\")\n",
"print(\"T3/T2_actual=(P3/P2)^((n-1)/n)\")\n",
"print(\"so T3=T2_actual*(P3/P2)^((y-1)/y) in K\")\n",
"T3=T2_actual*(r)**((y-1)/y)\n",
"ns_2=(T3-T2_actual)/(T3_actual-T2_actual)\n",
"print(\"stage efficiency for second stage,ns_2=\"),round(ns_2,2)\n",
"print(\"in percentage\"),round(ns_2*100,2)\n",
"print(\"actual rtemperature at exit of third stage,\")\n",
"print(\"T4_actual/T3_actual=(P4/P3)^((n-1)/n)\")\n",
"T4_actual=T3_actual*(r)**((n-1)/n)\n",
"print(\"so T4_actual in K=\"),round(T4_actual,2)\n",
"print(\"ideal temperature at exit of third stage,\")\n",
"print(\"T4/T3_actual=(P4/P3)^((n-1)/n)\")\n",
"T4=T3_actual*(r)**((y-1)/y)\n",
"print(\"so T4 in K=\"),round(T4,2)\n",
"ns_3=(T4-T3_actual)/(T4_actual-T3_actual)\n",
"print(\"stage efficiency for third stage,ns_3=\"),round(ns_3,2)\n",
"ns_3=ns_3*100\n",
"print(\"in percentage=\"),round(ns_3*100,2)\n",
"print(\"so stage efficiency=86.4%\")\n",
"print(\"iv> from steady flow energy equation,\")\n",
"print(\"Wc=dw=dh and dh=du+p*dv+v*dp\")\n",
"print(\"dh=dq+v*dp\")\n",
"print(\"dq=0 in adiabatic process\")\n",
"print(\"dh=v*dp\")\n",
"print(\"Wc=v*dp\")\n",
"print(\"here for polytropic compression \")\n",
"print(\"P*V^1.49=constant i.e n=1.49\")\n",
"n=1.49;\n",
"Wc=(n/(n-1))*m*R*T1*(((k)**((n-1)/n))-1)\n",
"print(\"Wc in KJ/s=\"),round(Wc,2)\n",
"Wc_actual=Wc*0.9\n",
"print(\"due to overall efficiency being 90% the actual compressor work(Wc_actual) in KJ/s=\"),round(Wc*0.9,2)\n",
"print(\"so power required to drive compressor =14777.89 KJ/s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.8;pg no: 349"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.8, Page:349 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 8\n",
"In question no.8,expression for air standard cycle efficiency is derived which cannot be solve using python software.\n"
]
}
],
"source": [
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.8, Page:349 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 8\")\n",
"print(\"In question no.8,expression for air standard cycle efficiency is derived which cannot be solve using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.9;pg no: 350"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.9, Page:350 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 9\n",
"using polytropic efficiency the index of compression and expansion can be obtained as under,\n",
"let compression index be nc,\n",
"(nc-1)/nc=(y-1)/(y*n_poly_c)\n",
"so nc=1/(1-((y-1)/(y*n_poly_c)))\n",
"let expansion index be nt,\n",
"(nt-1)/nt=(n_poly_T*(y-1))/y\n",
"so nt=1/(1-((n_poly_T*(y-1))/y))\n",
"For process 1-2\n",
"T2/T1=(p2/p1)^((nc-1)/nc)\n",
"so T2=T1*(p2/p1)^((nc-1)/nc)in K\n",
"also T4/T3=(p4/p3)^((nt-1)/nt)\n",
"so T4=T3*(p4/p3)^((nt-1)/nt)in K\n",
"using heat exchanger effectivenesss,\n",
"epsilon=(T5-T2)/(T4-T2)\n",
"so T5=T2+(epsilon*(T4-T2))in K\n",
"heat added in combustion chamber,q_add=Cp*(T3-T5)in KJ/kg\n",
"compressor work,Wc=Cp*(T2-T1)in \n",
"turbine work,Wt=Cp*(T3-T4)in KJ/kg\n",
"cycle efficiency= 0.33\n",
"in percentage 32.79\n",
"work ratio= 0.33\n",
"specific work output in KJ/kg= 152.56\n",
"so cycle efficiency=32.79%,work ratio=0.334,specific work output=152.56 KJ/kg\n"
]
}
],
"source": [
"#cal of cycle efficiency,work ratio,specific work output\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.9, Page:350 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 9\")\n",
"y=1.4;#expansion constant\n",
"n_poly_c=0.85;#ploytropic efficiency of compressor\n",
"n_poly_T=0.90;#ploytropic efficiency of Turbine\n",
"r=8.;#compression ratio\n",
"T1=(27.+273.);#temperature of air in compressor in K\n",
"T3=1100.;#temperature of air leaving combustion chamber in K\n",
"epsilon=0.8;#effectiveness of heat exchanger\n",
"Cp=1.0032;#specific heat at constant pressure in KJ/kg K\n",
"print(\"using polytropic efficiency the index of compression and expansion can be obtained as under,\")\n",
"print(\"let compression index be nc,\")\n",
"print(\"(nc-1)/nc=(y-1)/(y*n_poly_c)\")\n",
"print(\"so nc=1/(1-((y-1)/(y*n_poly_c)))\")\n",
"nc=1/(1-((y-1)/(y*n_poly_c)))\n",
"print(\"let expansion index be nt,\")\n",
"print(\"(nt-1)/nt=(n_poly_T*(y-1))/y\")\n",
"print(\"so nt=1/(1-((n_poly_T*(y-1))/y))\")\n",
"nt=1/(1-((n_poly_T*(y-1))/y))\n",
"print(\"For process 1-2\")\n",
"print(\"T2/T1=(p2/p1)^((nc-1)/nc)\")\n",
"print(\"so T2=T1*(p2/p1)^((nc-1)/nc)in K\")\n",
"T2=T1*(r)**((nc-1)/nc)\n",
"print(\"also T4/T3=(p4/p3)^((nt-1)/nt)\")\n",
"print(\"so T4=T3*(p4/p3)^((nt-1)/nt)in K\")\n",
"T4=T3*(1/r)**((nt-1)/nt)\n",
"print(\"using heat exchanger effectivenesss,\") \n",
"print(\"epsilon=(T5-T2)/(T4-T2)\")\n",
"print(\"so T5=T2+(epsilon*(T4-T2))in K\")\n",
"T5=T2+(epsilon*(T4-T2))\n",
"print(\"heat added in combustion chamber,q_add=Cp*(T3-T5)in KJ/kg\")\n",
"q_add=Cp*(T3-T5)\n",
"print(\"compressor work,Wc=Cp*(T2-T1)in \")\n",
"Wc=Cp*(T2-T1)\n",
"print(\"turbine work,Wt=Cp*(T3-T4)in KJ/kg\")\n",
"Wt=Cp*(T3-T4)\n",
"(Wt-Wc)/q_add\n",
"print(\"cycle efficiency=\"),round((Wt-Wc)/q_add,2)\n",
"print(\"in percentage\"),round((Wt-Wc)*100/q_add,2)\n",
"(Wt-Wc)/Wt\n",
"print(\"work ratio=\"),round((Wt-Wc)/Wt,2)\n",
"print(\"specific work output in KJ/kg=\"),round(Wt-Wc,2)\n",
"print(\"so cycle efficiency=32.79%,work ratio=0.334,specific work output=152.56 KJ/kg\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.10;pg no: 351"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.10, Page:351 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 10\n",
"for process 1-2_a\n",
"T2_a/T1=(p2_a/p1)^((y-1)/y)\n",
"so T2_a=T1*(p2_a/p1)^((y-1)/y) in K\n",
"nc=(T2_a-T1)/(T2-T1)\n",
"so T2=T1+((T2_a-T1)/nc) in K\n",
"for process 3-4_a,\n",
"T4_a/T3=(p4/p3)^((y-1)/y)\n",
"so T4_a=T3*(p4/p3)^((y-1)/y)in K\n",
"Compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg\n",
"Turbine work per kg,Wt=Cp*(T3-T4)in KJ/kg\n",
"net output,W_net=Wt-Wc={Wc-(Cp*(T3-T4))} in KJ/kg\n",
"heat added,q_add=Cp*(T3-T2) in KJ/kg\n",
"thermal efficiency,n=W_net/q_add\n",
"n={Wc-(Cp*(T3-T4))}/q_add\n",
"so T4=T3-((Wc-(n*q_add))/Cp)in K\n",
"therefore,isentropic efficiency of turbine,nt=(T3-T4)/(T3-T4_a) 0.297\n",
"in percentage 29.7\n",
"so turbine isentropic efficiency=29.69%\n"
]
}
],
"source": [
"#cal of isentropic efficiency of turbine\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.10, Page:351 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 10\")\n",
"T1=(27+273);#temperature of air in compressor in K\n",
"p1=1*10**5;#pressure of air in compressor in Pa\n",
"p2=5*10**5;#pressure of air after compression in Pa\n",
"p3=p2-0.2*10**5;#pressure drop in Pa\n",
"p4=1*10**5;#pressure to which expansion occur in turbine in Pa\n",
"nc=0.85;#isentropic efficiency\n",
"T3=1000;#temperature of air in combustion chamber in K\n",
"n=0.2;#thermal efficiency of plant\n",
"y=1.4;#expansion constant\n",
"Cp=1.0032;#specific heat at constant pressure in KJ/kg K\n",
"print(\"for process 1-2_a\")\n",
"print(\"T2_a/T1=(p2_a/p1)^((y-1)/y)\")\n",
"print(\"so T2_a=T1*(p2_a/p1)^((y-1)/y) in K\")\n",
"T2_a=T1*(p2/p1)**((y-1)/y)\n",
"print(\"nc=(T2_a-T1)/(T2-T1)\")\n",
"print(\"so T2=T1+((T2_a-T1)/nc) in K\")\n",
"T2=T1+((T2_a-T1)/nc)\n",
"print(\"for process 3-4_a,\")\n",
"print(\"T4_a/T3=(p4/p3)^((y-1)/y)\")\n",
"print(\"so T4_a=T3*(p4/p3)^((y-1)/y)in K\")\n",
"T4_a=T3*(p4/p3)**((y-1)/y)\n",
"print(\"Compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg\")\n",
"Wc=Cp*(T2-T1)\n",
"print(\"Turbine work per kg,Wt=Cp*(T3-T4)in KJ/kg\")\n",
"print(\"net output,W_net=Wt-Wc={Wc-(Cp*(T3-T4))} in KJ/kg\")\n",
"print(\"heat added,q_add=Cp*(T3-T2) in KJ/kg\")\n",
"q_add=Cp*(T3-T2)\n",
"print(\"thermal efficiency,n=W_net/q_add\")\n",
"print(\"n={Wc-(Cp*(T3-T4))}/q_add\")\n",
"print(\"so T4=T3-((Wc-(n*q_add))/Cp)in K\")\n",
"T4=T3-((Wc-(n*q_add))/Cp)\n",
"nt=(T3-T4)/(T3-T4_a)\n",
"print(\"therefore,isentropic efficiency of turbine,nt=(T3-T4)/(T3-T4_a)\"),round((T3-T4)/(T3-T4_a),3)\n",
"print(\"in percentage\"),round(nt*100,2)\n",
"print(\"so turbine isentropic efficiency=29.69%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.11;pg no: 352"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.11, Page:352 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 11\n",
"for perfect intercooling the pressure ratio of each compression stage(k)\n",
"k=sqrt(r)\n",
"for process 1-2_a,T2_a/T1=(P2/P1)^((y-1)/y)\n",
"so T2_a=T1*(k)^((y-1)/y)in K\n",
"considering isentropic efficiency of compression,\n",
"nc=(T2_a-T1)/(T2-T1)\n",
"so T2=T1+((T2_a-T1)/nc)in K\n",
"for process 3-4,\n",
"T4_a/T3=(P4/P3)^((y-1)/y)\n",
"so T4_a=T3*(P4/P3)^((y-1)/y) in K\n",
"again due to compression efficiency,nc=(T4_a-T3)/(T4-T3)\n",
"so T4=T3+((T4_a-T3)/nc)in K\n",
"total compressor work,Wc=2*Cp*(T4-T3) in KJ/kg\n",
"for expansion process 5-6_a,\n",
"T6_a/T5=(P6/P5)^((y-1)/y)\n",
"so T6_a=T5*(P6/P5)^((y-1)/y) in K\n",
"considering expansion efficiency,ne=(T5-T6)/(T5-T6_a)\n",
"T6=T5-(ne*(T5-T6_a)) in K\n",
"for expansion in 7-8_a\n",
"T8_a/T7=(P8/P7)^((y-1)/y)\n",
"so T8_a=T7*(P8/P7)^((y-1)/y) in K\n",
"considering expansion efficiency,ne=(T7-T8)/(T7-T8_a)\n",
"so T8=T7-(ne*(T7-T8_a))in K\n",
"expansion work output per kg of air(Wt)=Cp*(T5-T6)+Cp*(T7-T8) in KJ/kg\n",
"heat added per kg air(q_add)=Cp*(T5-T4)+Cp*(T7-T6) in KJ/kg\n",
"fuel required per kg of air,mf=q_add/C 0.02\n",
"air-fuel ratio=1/mf 51.08\n",
"net output(W) in KJ/kg= 229.2\n",
"output for air flowing at 30 kg/s,=W*m in KW 6876.05\n",
"thermal efficiency= 0.28\n",
"in percentage 27.88\n",
"so thermal efficiency=27.87%,net output=6876.05 KW,A/F ratio=51.07\n",
"NOTE=>In this question,expansion work is calculated wrong in book,so it is corrected above and answers vary accordingly.\n"
]
}
],
"source": [
"#cal of thermal efficiency,net output,A/F ratio\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 9.11, Page:352 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 11\")\n",
"P1=1.*10**5;#initial pressure in Pa\n",
"T1=(27.+273.);#initial temperature in K\n",
"T3=T1;\n",
"r=10.;#pressure ratio\n",
"T5=1000.;#maximum temperature in cycle in K\n",
"P6=3.*10**5;#first stage expansion pressure in Pa\n",
"T7=995.;#first stage reheated temperature in K\n",
"C=42000.;#calorific value of fuel in KJ/kg\n",
"Cp=1.0032;#specific heat at constant pressure in KJ/kg K\n",
"m=30.;#air flow rate in kg/s\n",
"nc=0.85;#isentropic efficiency of compression\n",
"ne=0.9;#isentropic efficiency of expansion\n",
"y=1.4;#expansion constant\n",
"print(\"for perfect intercooling the pressure ratio of each compression stage(k)\")\n",
"print(\"k=sqrt(r)\")\n",
"k=math.sqrt(r)\n",
"k=3.16;#approx.\n",
"print(\"for process 1-2_a,T2_a/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"so T2_a=T1*(k)^((y-1)/y)in K\")\n",
"T2_a=T1*(k)**((y-1)/y)\n",
"print(\"considering isentropic efficiency of compression,\")\n",
"print(\"nc=(T2_a-T1)/(T2-T1)\")\n",
"print(\"so T2=T1+((T2_a-T1)/nc)in K\")\n",
"T2=T1+((T2_a-T1)/nc)\n",
"print(\"for process 3-4,\")\n",
"print(\"T4_a/T3=(P4/P3)^((y-1)/y)\")\n",
"print(\"so T4_a=T3*(P4/P3)^((y-1)/y) in K\")\n",
"T4_a=T3*(k)**((y-1)/y)\n",
"print(\"again due to compression efficiency,nc=(T4_a-T3)/(T4-T3)\")\n",
"print(\"so T4=T3+((T4_a-T3)/nc)in K\")\n",
"T4=T3+((T4_a-T3)/nc)\n",
"print(\"total compressor work,Wc=2*Cp*(T4-T3) in KJ/kg\")\n",
"Wc=2*Cp*(T4-T3)\n",
"print(\"for expansion process 5-6_a,\")\n",
"print(\"T6_a/T5=(P6/P5)^((y-1)/y)\")\n",
"print(\"so T6_a=T5*(P6/P5)^((y-1)/y) in K\")\n",
"P5=10.*10**5;#pressure in Pa\n",
"T6_a=T5*(P6/P5)**((y-1)/y)\n",
"print(\"considering expansion efficiency,ne=(T5-T6)/(T5-T6_a)\")\n",
"print(\"T6=T5-(ne*(T5-T6_a)) in K\")\n",
"T6=T5-(ne*(T5-T6_a))\n",
"print(\"for expansion in 7-8_a\")\n",
"print(\"T8_a/T7=(P8/P7)^((y-1)/y)\")\n",
"print(\"so T8_a=T7*(P8/P7)^((y-1)/y) in K\")\n",
"P8=P1;#constant pressure process\n",
"P7=P6;#constant pressure process\n",
"T8_a=T7*(P8/P7)**((y-1)/y)\n",
"print(\"considering expansion efficiency,ne=(T7-T8)/(T7-T8_a)\")\n",
"print(\"so T8=T7-(ne*(T7-T8_a))in K\")\n",
"T8=T7-(ne*(T7-T8_a))\n",
"print(\"expansion work output per kg of air(Wt)=Cp*(T5-T6)+Cp*(T7-T8) in KJ/kg\")\n",
"Wt=Cp*(T5-T6)+Cp*(T7-T8)\n",
"print(\"heat added per kg air(q_add)=Cp*(T5-T4)+Cp*(T7-T6) in KJ/kg\")\n",
"q_add=Cp*(T5-T4)+Cp*(T7-T6)\n",
"mf=q_add/C\n",
"print(\"fuel required per kg of air,mf=q_add/C\"),round(q_add/C,2)\n",
"print(\"air-fuel ratio=1/mf\"),round(1/mf,2)\n",
"W=Wt-Wc\n",
"print(\"net output(W) in KJ/kg=\"),round(Wt-Wc,2)\n",
"print(\"output for air flowing at 30 kg/s,=W*m in KW\"),round(W*m,2)\n",
"W/q_add\n",
"print(\"thermal efficiency=\"),round(W/q_add,2)\n",
"print(\"in percentage\"),round(W*100/q_add,2)\n",
"print(\"so thermal efficiency=27.87%,net output=6876.05 KW,A/F ratio=51.07\")\n",
"print(\"NOTE=>In this question,expansion work is calculated wrong in book,so it is corrected above and answers vary accordingly.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.12;pg no: 354"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.12, Page:354 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 12\n",
"for process 1-2,\n",
"T2/T1=(P2/P1)^((y-1)/y)\n",
"so T2=T1*(P2/P1)^((y-1)/y) in K\n",
"for process 3-4,\n",
"T4/T3=(P4/P3)^((y-1)/y)\n",
"so T4=T3*(P4/P3)^((y-1)/y) in K\n",
"for process 6-7,\n",
"T7/T6=(P7/P6)^((y-1)/y)\n",
"so T7=T6*(P7/P6)^((y-1)/y) in K\n",
"for process 8-9,\n",
"T9/T8=(P9/P8)^((y-1)/y)\n",
"T9=T8*(P9/P8)^((y-1)/y) in K\n",
"in regenerator,effectiveness=(T5-T4)/(T9-T4)\n",
"T5=T4+(ne*(T9-T4))in K\n",
"compressor work per kg air,Wc=Cp*(T2-T1)+Cp*(T4-T3) in KJ/kg\n",
"turbine work per kg air,Wt in KJ/kg= 660.84\n",
"heat added per kg air,q_add in KJ/kg= 765.43\n",
"total fuel required per kg of air= 0.02\n",
"net work,W_net in KJ/kg= 450.85\n",
"cycle thermal efficiency,n= 0.59\n",
"in percentage 58.9\n",
"fuel required per kg air in combustion chamber 1,Cp*(T8-T7)/C= 0.0056\n",
"fuel required per kg air in combustion chamber2,Cp*(T6-T5)/C= 0.0126\n",
"so fuel-air ratio in two combustion chambers=0.0126,0.0056\n",
"total turbine work=660.85 KJ/kg\n",
"cycle thermal efficiency=58.9%\n",
"NOTE=>In this question,fuel required per kg air in combustion chamber 1 and 2 are calculated wrong in book,so it is corrected above and answers vary accordingly. \n"
]
}
],
"source": [
"#cal of fuel-air ratio in two combustion chambers,total turbine work,cycle thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.12, Page:354 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 12\")\n",
"P1=1.*10**5;#initial pressure in Pa\n",
"P9=P1;\n",
"T1=300.;#initial temperature in K\n",
"P2=4.*10**5;#pressure of air in intercooler in Pa\n",
"P3=P2;\n",
"T3=290.;#temperature of air in intercooler in K\n",
"T6=1300.;#temperature of combustion chamber in K\n",
"P4=8.*10**5;#pressure of air after compression in Pa\n",
"P6=P4;\n",
"T8=1300.;#temperature after reheating in K\n",
"P8=4.*10**5;#pressure after expansion in Pa\n",
"P7=P8;\n",
"C=42000.;#heating value of fuel in KJ/kg\n",
"y=1.4;#expansion constant\n",
"ne=0.8;#effectiveness of regenerator\n",
"Cp=1.0032;#specific heat at constant pressure in KJ/kg K\n",
"print(\"for process 1-2,\")\n",
"print(\"T2/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"so T2=T1*(P2/P1)^((y-1)/y) in K\")\n",
"T2=T1*(P2/P1)**((y-1)/y)\n",
"print(\"for process 3-4,\")\n",
"print(\"T4/T3=(P4/P3)^((y-1)/y)\")\n",
"print(\"so T4=T3*(P4/P3)^((y-1)/y) in K\")\n",
"T4=T3*(P4/P3)**((y-1)/y)\n",
"print(\"for process 6-7,\")\n",
"print(\"T7/T6=(P7/P6)^((y-1)/y)\")\n",
"print(\"so T7=T6*(P7/P6)^((y-1)/y) in K\")\n",
"T7=T6*(P7/P6)**((y-1)/y)\n",
"print(\"for process 8-9,\")\n",
"print(\"T9/T8=(P9/P8)^((y-1)/y)\")\n",
"print(\"T9=T8*(P9/P8)^((y-1)/y) in K\")\n",
"T9=T8*(P9/P8)**((y-1)/y)\n",
"print(\"in regenerator,effectiveness=(T5-T4)/(T9-T4)\")\n",
"print(\"T5=T4+(ne*(T9-T4))in K\")\n",
"T5=T4+(ne*(T9-T4))\n",
"print(\"compressor work per kg air,Wc=Cp*(T2-T1)+Cp*(T4-T3) in KJ/kg\")\n",
"Wc=Cp*(T2-T1)+Cp*(T4-T3)\n",
"Wt=Cp*(T6-T7)+Cp*(T8-T9)\n",
"print(\"turbine work per kg air,Wt in KJ/kg=\"),round(Wt,2)\n",
"q_add=Cp*(T6-T5)+Cp*(T8-T7)\n",
"print(\"heat added per kg air,q_add in KJ/kg=\"),round(q_add,2)\n",
"q_add/C\n",
"print(\"total fuel required per kg of air=\"),round(q_add/C,2)\n",
"W_net=Wt-Wc\n",
"print(\"net work,W_net in KJ/kg=\"),round(W_net,2)\n",
"n=W_net/q_add\n",
"print(\"cycle thermal efficiency,n=\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"fuel required per kg air in combustion chamber 1,Cp*(T8-T7)/C=\"),round(Cp*(T8-T7)/C,4)\n",
"print(\"fuel required per kg air in combustion chamber2,Cp*(T6-T5)/C=\"),round(Cp*(T6-T5)/C,4)\n",
"print(\"so fuel-air ratio in two combustion chambers=0.0126,0.0056\")\n",
"print(\"total turbine work=660.85 KJ/kg\")\n",
"print(\"cycle thermal efficiency=58.9%\")\n",
"print(\"NOTE=>In this question,fuel required per kg air in combustion chamber 1 and 2 are calculated wrong in book,so it is corrected above and answers vary accordingly. \")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.13;pg no: 356"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.13, Page:356 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 13\n",
"work done per kg of air,W=R*(T2-T1)*log(r) in KJ/kg\n",
"heat added per kg of air,q=R*T2*log(r)+(1-epsilon)*Cv*(T2-T1) in KJ/kg\n",
"for 30 KJ/s heat supplied,the mass of air/s(m)=q_add/q in kg/s\n",
"mass of air per cycle=m/n in kg/cycle\n",
"brake output in KW= 17.12\n",
"stroke volume,V in m^3= 0.0117\n",
"brake output=17.11 KW\n",
"stroke volume=0.0116 m^3\n"
]
}
],
"source": [
"#cal of brake output,stroke volume\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 9.13, Page:356 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 13\")\n",
"T2=700.;#highest temperature of stirling engine in K\n",
"T1=300.;#lowest temperature of stirling engine in K\n",
"r=3.;#compression ratio\n",
"q_add=30.;#heat addition in KJ/s\n",
"epsilon=0.9;#regenerator efficiency\n",
"P=1*10**5;#pressure at begining of compression in Pa\n",
"n=100.;#number of cycle per minute\n",
"Cv=0.72;#specific heat at constant volume in KJ/kg K\n",
"R=29.27;#gas constant in KJ/kg K\n",
"print(\"work done per kg of air,W=R*(T2-T1)*log(r) in KJ/kg\")\n",
"W=R*(T2-T1)*math.log(r)\n",
"print(\"heat added per kg of air,q=R*T2*log(r)+(1-epsilon)*Cv*(T2-T1) in KJ/kg\")\n",
"q=R*T2*math.log(r)+(1-epsilon)*Cv*(T2-T1)\n",
"print(\"for 30 KJ/s heat supplied,the mass of air/s(m)=q_add/q in kg/s\")\n",
"m=q_add/q\n",
"print(\"mass of air per cycle=m/n in kg/cycle\")\n",
"m/n\n",
"print(\"brake output in KW=\"),round(W*m,2)\n",
"m=1.33*10**-4;#mass of air per cycle in kg/cycle\n",
"T=T1;\n",
"V=m*R*T*1000/P\n",
"print(\"stroke volume,V in m^3=\"),round(V,4)\n",
"print(\"brake output=17.11 KW\")\n",
"print(\"stroke volume=0.0116 m^3\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.14;pg no: 357"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.14, Page:357 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 14\n",
"In question no.14,various expression is derived which cannot be solved using python software.\n"
]
}
],
"source": [
"#cal of compression ratio,air standard efficiency,fuel consumption,bhp/hr\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.14, Page:357 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 14\")\n",
"print(\"In question no.14,various expression is derived which cannot be solved using python software.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.15;pg no: 361"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.15, Page:361 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 15\n",
"In gas turbine cycle,T2/T1=(P2/P1)^((y-1)/y)\n",
"so T2=T1*(P2/P1)^((y-1)/y)in K\n",
"T4/T3=(P4/P3)^((y-1)/y)\n",
"so T4=T3*(P4/P3)^((y-1)/y) in K\n",
"compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg\n",
"turbine work per kg,Wt=Cp*(T3-T4) in KJ/kg \n",
"heat added in combustion chamber per kg,q_add=Cp*(T3-T2) in KJ/kg \n",
"net gas turbine output,W_net_GT=Wt-Wc in KJ/kg air\n",
"heat recovered in HRSG for steam generation per kg of air\n",
"q_HRGC=Cp*(T4-T5)in KJ/kg\n",
"at inlet to steam in turbine,\n",
"from steam table,ha=3177.2 KJ/kg,sa=6.5408 KJ/kg K\n",
"for expansion in steam turbine,sa=sb\n",
"let dryness fraction at state b be x\n",
"also from steam table,at 15KPa, sf=0.7549 KJ/kg K,sfg=7.2536 KJ/kg K,hf=225.94 KJ/kg,hfg=2373.1 KJ/kg\n",
"sb=sf+x*sfg\n",
"so x=(sb-sf)/sfg \n",
"so hb=hf+x*hfg in KJ/kg K\n",
"at exit of condenser,hc=hf ,vc=0.001014 m^3/kg from steam table\n",
"at exit of feed pump,hd=hd-hc\n",
"hd=vc*(Pg-Pc)*100 in KJ/kg\n",
"heat added per kg of steam =ha-hd in KJ/kg\n",
"mass of steam generated per kg of air in kg steam per kg air= 0.119\n",
"net steam turbine cycle output,W_net_ST in KJ/kg= 677.4\n",
"steam cycle output per kg of air(W_net_ST) in KJ/kg air= 80.61\n",
"total combined cycle output in KJ/kg air= 486.88\n",
"combined cycle efficiency,n_cc=(W_net_GT+W_net_ST)/q_add 0.58\n",
"in percentage 57.77\n",
"In absence of steam cycle,gas turbine cycle efficiency,n_GT= 0.48\n",
"in percentage 48.21\n",
"thus ,efficiency is seen to increase in combined cycle upto 57.77% as compared to gas turbine offering 48.21% efficiency.\n",
"overall efficiency=57.77%\n",
"steam per kg of air=0.119 kg steam per/kg air\n"
]
}
],
"source": [
"#cal of overall efficiency,steam per kg of air\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.15, Page:361 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 15\")\n",
"r=10.;#pressure ratio\n",
"Cp=1.0032;#specific heat of air in KJ/kg K\n",
"y=1.4;#expansion constant\n",
"T3=1400.;#inlet temperature of gas turbine in K\n",
"T1=(17.+273.);#ambient temperature in K\n",
"P1=1.*10**5;#ambient pressure in Pa\n",
"Pc=15.;#condensor pressure in KPa\n",
"Pg=6.*1000;#pressure of steam in generator in KPa\n",
"T5=420.;#temperature of exhaust from gas turbine in K\n",
"print(\"In gas turbine cycle,T2/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"so T2=T1*(P2/P1)^((y-1)/y)in K\")\n",
"T2=T1*(r)**((y-1)/y)\n",
"print(\"T4/T3=(P4/P3)^((y-1)/y)\")\n",
"print(\"so T4=T3*(P4/P3)^((y-1)/y) in K\")\n",
"T4=T3*(1/r)**((y-1)/y)\n",
"print(\"compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg\")\n",
"Wc=Cp*(T2-T1)\n",
"print(\"turbine work per kg,Wt=Cp*(T3-T4) in KJ/kg \")\n",
"Wt=Cp*(T3-T4)\n",
"print(\"heat added in combustion chamber per kg,q_add=Cp*(T3-T2) in KJ/kg \")\n",
"q_add=Cp*(T3-T2)\n",
"print(\"net gas turbine output,W_net_GT=Wt-Wc in KJ/kg air\")\n",
"W_net_GT=Wt-Wc\n",
"print(\"heat recovered in HRSG for steam generation per kg of air\")\n",
"print(\"q_HRGC=Cp*(T4-T5)in KJ/kg\")\n",
"q_HRGC=Cp*(T4-T5)\n",
"print(\"at inlet to steam in turbine,\")\n",
"print(\"from steam table,ha=3177.2 KJ/kg,sa=6.5408 KJ/kg K\")\n",
"ha=3177.2;\n",
"sa=6.5408;\n",
"print(\"for expansion in steam turbine,sa=sb\")\n",
"sb=sa;\n",
"print(\"let dryness fraction at state b be x\")\n",
"print(\"also from steam table,at 15KPa, sf=0.7549 KJ/kg K,sfg=7.2536 KJ/kg K,hf=225.94 KJ/kg,hfg=2373.1 KJ/kg\")\n",
"sf=0.7549;\n",
"sfg=7.2536;\n",
"hf=225.94;\n",
"hfg=2373.1;\n",
"print(\"sb=sf+x*sfg\")\n",
"print(\"so x=(sb-sf)/sfg \")\n",
"x=(sb-sf)/sfg\n",
"print(\"so hb=hf+x*hfg in KJ/kg K\")\n",
"hb=hf+x*hfg\n",
"print(\"at exit of condenser,hc=hf ,vc=0.001014 m^3/kg from steam table\")\n",
"hc=hf;\n",
"vc=0.001014;\n",
"print(\"at exit of feed pump,hd=hd-hc\")\n",
"print(\"hd=vc*(Pg-Pc)*100 in KJ/kg\")\n",
"hd=vc*(Pg-Pc)*100\n",
"print(\"heat added per kg of steam =ha-hd in KJ/kg\")\n",
"ha-hd\n",
"print(\"mass of steam generated per kg of air in kg steam per kg air=\"),round(q_HRGC/(ha-hd),3)\n",
"W_net_ST=(ha-hb)-(hd-hc)\n",
"print(\"net steam turbine cycle output,W_net_ST in KJ/kg=\"),round(W_net_ST,2)\n",
"W_net_ST=W_net_ST*0.119 \n",
"print(\"steam cycle output per kg of air(W_net_ST) in KJ/kg air=\"),round(W_net_ST,2)\n",
"(W_net_GT+W_net_ST)\n",
"print(\"total combined cycle output in KJ/kg air= \"),round((W_net_GT+W_net_ST),2)\n",
"n_cc=(W_net_GT+W_net_ST)/q_add\n",
"print(\"combined cycle efficiency,n_cc=(W_net_GT+W_net_ST)/q_add\"),round(n_cc,2)\n",
"print(\"in percentage\"),round(n_cc*100,2)\n",
"n_GT=W_net_GT/q_add\n",
"print(\"In absence of steam cycle,gas turbine cycle efficiency,n_GT=\"),round(n_GT,2)\n",
"print(\"in percentage\"),round(n_GT*100,2)\n",
"print(\"thus ,efficiency is seen to increase in combined cycle upto 57.77% as compared to gas turbine offering 48.21% efficiency.\")\n",
"print(\"overall efficiency=57.77%\")\n",
"print(\"steam per kg of air=0.119 kg steam per/kg air\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 9.16;pg no: 363"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 9.16, Page:363 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 16\n",
"here P4/P1=P3/P1=70............eq1\n",
"compression ratio,V1/V2=V1/V3=15.............eq2\n",
"heat added at constant volume= heat added at constant pressure\n",
"Q23=Q34\n",
"m*Cv*(T3-T2)=m*Cp*(T4-T3)\n",
"(T3-T2)=y*(T4-T3)\n",
"for process 1-2;\n",
"T2/T1=(P2/P1)^((y-1)/y)\n",
"T2/T1=(V1/V2)^(y-1)\n",
"so T2=T1*(V1/V2)^(y-1) in K\n",
"and (P2/P1)=(V1/V2)^y\n",
"so P2=P1*(V1/V2)^y in Pa...........eq3\n",
"for process 2-3,\n",
"P2/P3=T2/T3\n",
"so T3=T2*P3/P2\n",
"using eq 1 and 3,we get\n",
"T3=T2*k/r^y in K\n",
"using equal heat additions for processes 2-3 and 3-4,\n",
"(T3-T2)=y*(T4-T3)\n",
"so T4=T3+((T3-T2)/y) in K\n",
"for process 3-4,\n",
"V3/V4=T3/T4\n",
"(V3/V1)*(V1/V4)=T3/T4\n",
"so (V1/V4)=(T3/T4)*r\n",
"so V1/V4=11.88 and V5/V4=11.88\n",
"for process 4-5,\n",
"P4/P5=(V5/V4)^y,or T4/T5=(V5/V4)^(y-1)\n",
"so T5=T4/((V5/V4)^(y-1))\n",
"air standard thermal efficiency(n)=1-(heat rejected/heat added)\n",
"n=1-(m*Cv*(T5-T1)/(m*Cp*(T4-T3)+m*Cv*(T3-T2)))\n",
"n= 0.65\n",
"air standard thermal efficiency=0.6529\n",
"in percentage 65.29\n",
"so air standard thermal efficiency=65.29%\n",
"Actual thermal efficiency may be different from theoretical efficiency due to following reasons\n",
"a> Air standard cycle analysis considers air as the working fluid while in actual cycle it is not air throughtout the cycle.Actual working fluid which are combustion products do not behave as perfect gas.\n",
"b> Heat addition does not occur isochorically in actual process.Also combustion is accompanied by inefficiency such as incomplete combustion,dissociation of combustion products,etc.\n",
"c> Specific heat variation occurs in actual processes where as in air standard cycle analysis specific heat variation neglected.Also during adiabatic process theoretically no heat loss occur while actually these processes are accompanied by heat losses.\n"
]
}
],
"source": [
"#cal of air standard thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"print\"Example 9.16, Page:363 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 9 Example 16\")\n",
"T1=(27+273);#temperature at begining of compression in K\n",
"k=70;#ration of maximum to minimum pressures\n",
"r=15;#compression ratio\n",
"y=1.4;#expansion constant\n",
"print(\"here P4/P1=P3/P1=70............eq1\")\n",
"print(\"compression ratio,V1/V2=V1/V3=15.............eq2\")\n",
"print(\"heat added at constant volume= heat added at constant pressure\")\n",
"print(\"Q23=Q34\")\n",
"print(\"m*Cv*(T3-T2)=m*Cp*(T4-T3)\")\n",
"print(\"(T3-T2)=y*(T4-T3)\")\n",
"print(\"for process 1-2;\")\n",
"print(\"T2/T1=(P2/P1)^((y-1)/y)\")\n",
"print(\"T2/T1=(V1/V2)^(y-1)\")\n",
"print(\"so T2=T1*(V1/V2)^(y-1) in K\")\n",
"T2=T1*(r)**(y-1)\n",
"print(\"and (P2/P1)=(V1/V2)^y\")\n",
"print(\"so P2=P1*(V1/V2)^y in Pa...........eq3\")\n",
"print(\"for process 2-3,\")\n",
"print(\"P2/P3=T2/T3\")\n",
"print(\"so T3=T2*P3/P2\")\n",
"print(\"using eq 1 and 3,we get\")\n",
"print(\"T3=T2*k/r^y in K\")\n",
"T3=T2*k/r**y \n",
"print(\"using equal heat additions for processes 2-3 and 3-4,\")\n",
"print(\"(T3-T2)=y*(T4-T3)\")\n",
"print(\"so T4=T3+((T3-T2)/y) in K\")\n",
"T4=T3+((T3-T2)/y)\n",
"print(\"for process 3-4,\")\n",
"print(\"V3/V4=T3/T4\")\n",
"print(\"(V3/V1)*(V1/V4)=T3/T4\")\n",
"print(\"so (V1/V4)=(T3/T4)*r\")\n",
"(T3/T4)*r\n",
"print(\"so V1/V4=11.88 and V5/V4=11.88\")\n",
"print(\"for process 4-5,\")\n",
"print(\"P4/P5=(V5/V4)^y,or T4/T5=(V5/V4)^(y-1)\")\n",
"print(\"so T5=T4/((V5/V4)^(y-1))\")\n",
"T5=T4/(11.88)**(y-1)\n",
"print(\"air standard thermal efficiency(n)=1-(heat rejected/heat added)\")\n",
"print(\"n=1-(m*Cv*(T5-T1)/(m*Cp*(T4-T3)+m*Cv*(T3-T2)))\")\n",
"n=1-((T5-T1)/(y*(T4-T3)+(T3-T2)))\n",
"print(\"n=\"),round(n,2)\n",
"print(\"air standard thermal efficiency=0.6529\")\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"so air standard thermal efficiency=65.29%\")\n",
"print(\"Actual thermal efficiency may be different from theoretical efficiency due to following reasons\")\n",
"print(\"a> Air standard cycle analysis considers air as the working fluid while in actual cycle it is not air throughtout the cycle.Actual working fluid which are combustion products do not behave as perfect gas.\")\n",
"print(\"b> Heat addition does not occur isochorically in actual process.Also combustion is accompanied by inefficiency such as incomplete combustion,dissociation of combustion products,etc.\")\n",
"print(\"c> Specific heat variation occurs in actual processes where as in air standard cycle analysis specific heat variation neglected.Also during adiabatic process theoretically no heat loss occur while actually these processes are accompanied by heat losses.\")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
Iҿە,Engineering Thermodynamics/chapter10_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 10:Intoduction to Internal Combustion engines"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.1;pg no: 387"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.1, Page:387 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 1\n",
"from stroke to bore ratio i.e L/D=1.2 and cylinder diameter=bore,i.e D=12 cm\n",
"stroke(L)=1.2*D in m\n",
"Area of indicator diagram(A)=30*10^-4 m^2\n",
"length of indicator diagram(l)=(1/2)*L in m\n",
"mean effective pressure(mep)=A*k/l in N/m^2\n",
"cross-section area of piston(Ap)=%pi*D^2/4 in m^2\n",
"for one cylinder indicated power(IP)=mep*Ap*L*N/(2*60) in W\n",
"for four cylinder total indicated power(IP)=4*IP in W 90477.87\n",
"frictional power loss(FP)=0.10*IP in W\n",
"brake power available(BP)=indicated power-frictional power=IP-FP in W 81430.08\n",
"therefore,mechanical efficiency of engine(n)=brake power/indicated power=BP/IP= 0.9\n",
"in percentage 90.0\n",
"so indicated power=90477.8 W\n",
"and mechanical efficiency=90%\n"
]
}
],
"source": [
"#cal of indicated power,,mechanical efficiency\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 10.1, Page:387 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 1\")\n",
"k=20.*10**6;#spring constant in N/m^2\n",
"N=2000.;#engine rpm\n",
"print(\"from stroke to bore ratio i.e L/D=1.2 and cylinder diameter=bore,i.e D=12 cm\")\n",
"D=12.*10**-2;#cylinder diameter in m\n",
"print(\"stroke(L)=1.2*D in m\")\n",
"L=1.2*D\n",
"print(\"Area of indicator diagram(A)=30*10^-4 m^2\")\n",
"A=30.*10**-4;\n",
"print(\"length of indicator diagram(l)=(1/2)*L in m\")\n",
"l=(1./2.)*L\n",
"print(\"mean effective pressure(mep)=A*k/l in N/m^2\")\n",
"mep=A*k/l\n",
"print(\"cross-section area of piston(Ap)=%pi*D^2/4 in m^2\")\n",
"Ap=math.pi*D**2./4.\n",
"print(\"for one cylinder indicated power(IP)=mep*Ap*L*N/(2*60) in W\")\n",
"IP=mep*Ap*L*N/(2.*60.)\n",
"IP=4.*IP\n",
"print(\"for four cylinder total indicated power(IP)=4*IP in W\"),round(IP,2)\n",
"print(\"frictional power loss(FP)=0.10*IP in W\")\n",
"FP=0.10*IP\n",
"BP=IP-FP\n",
"print(\"brake power available(BP)=indicated power-frictional power=IP-FP in W\"),round(BP,2)\n",
"n=BP/IP\n",
"print(\"therefore,mechanical efficiency of engine(n)=brake power/indicated power=BP/IP=\"),round(BP/IP,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"so indicated power=90477.8 W\")\n",
"print(\"and mechanical efficiency=90%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.2;pg no: 388"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.2, Page:388 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 2\n",
"reciprocating pump is work absorbing machine having its mechanism similar to the piston-cylinder arrangement in IC engine.\n",
"mean effective pressure(mep)=A*k/l in pa\n",
"indicator power(IP)=Ap*L*mep*N*1*2/60 in W\n",
"(it is double acting so let us assume total power to be double of that in single acting) 88357.29\n",
"so power required to drive=88.36 KW\n"
]
}
],
"source": [
"#cal of power required to drive\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.2, Page:388 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 2\")\n",
"A=40*10**-4;#area of indicator diagram in m^2\n",
"l=8*10**-2;#length of indicator diagram in m\n",
"D=15*10**-2;#bore of cylinder in m\n",
"L=20*10**-2;#stroke in m\n",
"k=1.5*10**8;#spring constant in pa/m\n",
"N=100;#pump motor rpm\n",
"print(\"reciprocating pump is work absorbing machine having its mechanism similar to the piston-cylinder arrangement in IC engine.\")\n",
"print(\"mean effective pressure(mep)=A*k/l in pa\")\n",
"mep=A*k/l \n",
"print(\"indicator power(IP)=Ap*L*mep*N*1*2/60 in W\")\n",
"Ap=math.pi*D**2/4\n",
"IP=Ap*L*mep*N*2/60\n",
"print(\"(it is double acting so let us assume total power to be double of that in single acting)\"),round(IP,2)\n",
"print(\"so power required to drive=88.36 KW\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.3;pg no: 388"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.3, Page:388 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 3\n",
"indicated power(IP)=brake power/mechanical efficiency in KW= 42.22\n",
"frictional power loss(FP)=IP-BP in KW 4.22\n",
"brake power at quater load(BPq)=0.25*BP in KW\n",
"mechanical efficiency(n1)=BPq/IP 0.69\n",
"in percentage 69.23\n",
"so indicated power=42.22 KW\n",
"frictional power loss=4.22 KW\n",
"mechanical efficiency=69.24%\n"
]
}
],
"source": [
"#cal of indicated power,frictional power loss,mechanical efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"print\"Example 10.3, Page:388 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 3\")\n",
"n=0.9;#mechanical efficiency of engine\n",
"BP=38;#brake power in KW\n",
"IP=BP/n\n",
"print(\"indicated power(IP)=brake power/mechanical efficiency in KW=\"),round(IP,2)\n",
"FP=IP-BP\n",
"print(\"frictional power loss(FP)=IP-BP in KW\"),round(FP,2)\n",
"print(\"brake power at quater load(BPq)=0.25*BP in KW\")\n",
"BPq=0.25*BP\n",
"IP=BPq+FP;\n",
"n1=BPq/IP\n",
"print(\"mechanical efficiency(n1)=BPq/IP\"),round(n1,2)\n",
"print(\"in percentage\"),round(n1*100,2)\n",
"print(\"so indicated power=42.22 KW\")\n",
"print(\"frictional power loss=4.22 KW\")\n",
"print(\"mechanical efficiency=69.24%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.4;pg no: 389"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.4, Page:389 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 4\n",
"brake power of engine(BP) in MW= 3120.98\n",
"so brake power is 3.121 MW\n",
"The fuel consumption in kg/hr(m)=m*BP in kg/hr\n",
"In order to find out brake thermal efficiency the heat input from fuel per second is required.\n",
"heat from fuel(Q)in KJ/s\n",
"Q=m*C/3600\n",
"energy to brake power=3120.97 KW\n",
"brake thermal efficiency(n)= 0.33\n",
"in percentage 33.49\n",
"so fuel consumption=780.24 kg/hr,brake thermal efficiency=33.49%\n",
"NOTE=>In book,it is given that brake power in MW is 31.21 but in actual it is 3120.97 KW or 3.121 MW which is corrected above.\n"
]
}
],
"source": [
"#cal of brake power,fuel consumption\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.4, Page:389 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 4\")\n",
"m=0.25;#specific fuel consumption in kg/KWh\n",
"Pb_mep=1.5*1000;#brake mean effective pressure of each cylinder in Kpa\n",
"N=100;#engine rpm\n",
"D=85*10**-2;#bore of cylinder in m\n",
"L=220*10**-2;#stroke in m\n",
"C=43*10**3;#calorific value of diesel in KJ/kg\n",
"A=math.pi*D**2/4;\n",
"BP=Pb_mep*L*A*N/60\n",
"print(\"brake power of engine(BP) in MW=\"),round(BP,2)\n",
"print(\"so brake power is 3.121 MW\")\n",
"print(\"The fuel consumption in kg/hr(m)=m*BP in kg/hr\")\n",
"m=m*BP\n",
"print(\"In order to find out brake thermal efficiency the heat input from fuel per second is required.\")\n",
"print(\"heat from fuel(Q)in KJ/s\")\n",
"print(\"Q=m*C/3600\")\n",
"Q=m*C/3600\n",
"print(\"energy to brake power=3120.97 KW\")\n",
"n=BP/Q\n",
"print(\"brake thermal efficiency(n)=\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"so fuel consumption=780.24 kg/hr,brake thermal efficiency=33.49%\")\n",
"print(\"NOTE=>In book,it is given that brake power in MW is 31.21 but in actual it is 3120.97 KW or 3.121 MW which is corrected above.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.5;pg no: 389"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.5, Page:389 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 5\n",
"brake thermal efficiency(n)=3600/(m*C) 0.33\n",
"in percentage 33.49\n",
"brake power(BP)in KW\n",
"BP= 226.19\n",
"brake specific fuel consumption,m=mf/BP\n",
"so mf=m*BP in kg/hr\n",
"air consumption(ma)from given air fuel ratio=k*mf in kg/hr\n",
"ma in kg/min\n",
"using perfect gas equation,\n",
"P*Va=ma*R*T\n",
"sa Va=ma*R*T/P in m^3/min\n",
"swept volume(Vs)=%pi*D^2*L/4 in m^3\n",
"volumetric efficiency,n_vol=Va/(Vs*(N/2)*no. of cylinder) 1.87\n",
"in percentage 186.55\n",
"NOTE=>In this question,while calculating swept volume in book,values of D=0.30 m and L=0.4 m is taken which is wrong.Hence above solution is solve taking right values given in book which is D=0.20 m and L=0.3 m,so the volumetric efficiency vary accordingly.\n"
]
}
],
"source": [
"#cal of brake thermal efficiency,brake power,volumetric efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.5, Page:389 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 5\")\n",
"Pb_mep=6*10**5;#brake mean effective pressure in pa\n",
"N=600;#engine rpm\n",
"m=0.25;#specific fuel consumption in kg/KWh\n",
"D=20*10**-2;#bore of cylinder in m\n",
"L=30*10**-2;#stroke in m\n",
"k=26;#air to fuel ratio\n",
"C=43*10**3;#calorific value in KJ/kg\n",
"R=0.287;#gas constant in KJ/kg K\n",
"T=(27+273);#ambient temperature in K\n",
"P=1*10**2;#ambient pressure in Kpa\n",
"n=3600/(m*C)\n",
"print(\"brake thermal efficiency(n)=3600/(m*C)\"),round(n,2)\n",
"print(\"in percentage\"),round(n*100,2)\n",
"print(\"brake power(BP)in KW\")\n",
"A=math.pi*D**2/4;\n",
"BP=4*Pb_mep*L*A*N/60000\n",
"print(\"BP=\"),round(BP,2)\n",
"print(\"brake specific fuel consumption,m=mf/BP\")\n",
"print(\"so mf=m*BP in kg/hr\")\n",
"mf=m*BP\n",
"print(\"air consumption(ma)from given air fuel ratio=k*mf in kg/hr\")\n",
"ma=k*mf\n",
"print(\"ma in kg/min\")\n",
"ma=ma/60\n",
"print(\"using perfect gas equation,\")\n",
"print(\"P*Va=ma*R*T\")\n",
"print(\"sa Va=ma*R*T/P in m^3/min\")\n",
"Va=ma*R*T/P\n",
"print(\"swept volume(Vs)=%pi*D^2*L/4 in m^3\")\n",
"Vs=math.pi*D**2*L/4\n",
"n_vol=Va/(Vs*(N/2)*4)\n",
"print(\"volumetric efficiency,n_vol=Va/(Vs*(N/2)*no. of cylinder)\"),round(n_vol,2)\n",
"print(\"in percentage\"),round(n_vol*100,2)\n",
"print(\"NOTE=>In this question,while calculating swept volume in book,values of D=0.30 m and L=0.4 m is taken which is wrong.Hence above solution is solve taking right values given in book which is D=0.20 m and L=0.3 m,so the volumetric efficiency vary accordingly.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.6;pg no: 390"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.6, Page:390 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 6\n",
"let the bore diameter be (D) m\n",
"piston speed(V)=2*L*N\n",
"so L=V/(2*N) in m\n",
"volumetric efficiency,n_vol=air sucked/(swept volume * no. of cylinder)\n",
"so air sucked/D^2=n_vol*(%pi*L/4)*N*2 in m^3/min\n",
"so air sucked =274.78*D^2 m^3/min\n",
"air requirement(ma),kg/min=A/F ratio*fuel consumption per min\n",
"so ma=r*m in kg/min\n",
"using perfect gas equation,P*Va=ma*R*T\n",
"so Va=ma*R*T/P in m^3/min\n",
"ideally,air sucked=Va\n",
"so 274.78*D^2=0.906\n",
"D=sqrt(0.906/274.78) in m\n",
"indicated power(IP)=P_imep*L*A*N*no.of cylinders in KW\n",
"brake power=indicated power*mechanical efficiency\n",
"BP=IP*n_mech in KW 10.35\n",
"so brake power=10.34 KW\n"
]
}
],
"source": [
"#cal of brake power\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 10.6, Page:390 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 6\")\n",
"N=3000;#engine rpm\n",
"m=5;#fuel consumption in litre/hr\n",
"r=19;#air-fuel ratio\n",
"sg=0.7;#specific gravity of fuel\n",
"V=500;#piston speed in m/min\n",
"P_imep=6*10**5;#indicated mean effective pressure in pa\n",
"P=1.013*10**5;#ambient pressure in pa\n",
"T=(15+273);#ambient temperature in K\n",
"n_vol=0.7;#volumetric efficiency \n",
"n_mech=0.8;#mechanical efficiency\n",
"R=0.287;#gas constant for gas in KJ/kg K\n",
"print(\"let the bore diameter be (D) m\")\n",
"print(\"piston speed(V)=2*L*N\")\n",
"print(\"so L=V/(2*N) in m\")\n",
"L=V/(2*N)\n",
"L=0.0833;#approx.\n",
"print(\"volumetric efficiency,n_vol=air sucked/(swept volume * no. of cylinder)\")\n",
"print(\"so air sucked/D^2=n_vol*(%pi*L/4)*N*2 in m^3/min\")\n",
"n_vol*(math.pi*L/4)*N*2\n",
"print(\"so air sucked =274.78*D^2 m^3/min\")\n",
"print(\"air requirement(ma),kg/min=A/F ratio*fuel consumption per min\")\n",
"print(\"so ma=r*m in kg/min\")\n",
"ma=r*m*sg/60\n",
"print(\"using perfect gas equation,P*Va=ma*R*T\")\n",
"print(\"so Va=ma*R*T/P in m^3/min\")\n",
"Va=ma*R*T*1000/P \n",
"print(\"ideally,air sucked=Va\")\n",
"print(\"so 274.78*D^2=0.906\")\n",
"print(\"D=sqrt(0.906/274.78) in m\")\n",
"D=math.sqrt(0.906/274.78) \n",
"print(\"indicated power(IP)=P_imep*L*A*N*no.of cylinders in KW\")\n",
"IP=P_imep*L*(math.pi*D**2/4)*(N/60)*2/1000\n",
"print(\"brake power=indicated power*mechanical efficiency\")\n",
"BP=IP*n_mech \n",
"print(\"BP=IP*n_mech in KW\"),round(BP,2)\n",
"print(\"so brake power=10.34 KW\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.7;pg no: 391"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.7, Page:391 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 7\n",
"After switching off fuel supply the capacity of motor required to run engine will be the friction power required at this speed of engine.\n",
"friction power(FP)=5 KW\n",
"brake power(BP) in KW= 30.82\n",
"indicated power(IP) in KW= 35.82\n",
"mechanical efficiency(n_mech)= 0.86\n",
"in percentage 86.04\n",
"brake specific fuel consumption(bsfc)=specific fuel consumption/brake power in kg/KW hr= 0.29\n",
"brake thermal efficiency(n_bte)= 0.29\n",
"in percentage 28.67\n",
"also,mechanical efficiency(n_mech)=brake thermal efficiency/indicated thermal efficiency\n",
"indicated thermal efficiency(n_ite)= 0.33\n",
"in percentage 33.32\n",
"indicated power(IP)=P_imep*L*A*N\n",
"so P_imep in Kpa= 76.01\n",
"Also,mechanical efficiency=P_bmep/P_imep\n",
"so P_bmep in Kpa= 65.4\n",
"brake power=30.82 KW\n",
"indicated power=35.82 KW\n",
"mechanical efficiency=86.04%\n",
"brake thermal efficiency=28.67%\n",
"indicated thermal efficiency=33.32%\n",
"brake mean effective pressure=65.39 Kpa\n",
"indicated mean effective pressure=76.01 Kpa\n"
]
}
],
"source": [
"#cal of power and efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.7, Page:391 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 7\")\n",
"M=20;#load on dynamometer in kg\n",
"r=50*10**-2;#radius in m\n",
"N=3000;#speed of rotation in rpm\n",
"D=20*10**-2;#bore in m\n",
"L=30*10**-2;#stroke in m\n",
"m=0.15;#fuel supplying rate in kg/min\n",
"C=43;#calorific value of fuel in MJ/kg\n",
"FP=5;#friction power in KW\n",
"g=9.81;#acceleration due to gravity in m/s^2\n",
"print(\"After switching off fuel supply the capacity of motor required to run engine will be the friction power required at this speed of engine.\")\n",
"print(\"friction power(FP)=5 KW\")\n",
"BP=2*math.pi*N*(M*g*r)*10**-3/60\n",
"print(\"brake power(BP) in KW=\"),round(BP,2)\n",
"IP=BP+FP\n",
"print(\"indicated power(IP) in KW=\"),round(IP,2)\n",
"n_mech=BP/IP\n",
"print(\"mechanical efficiency(n_mech)=\"),round(n_mech,2)\n",
"print(\"in percentage\"),round(n_mech*100,2)\n",
"bsfc=m*60/BP\n",
"print(\"brake specific fuel consumption(bsfc)=specific fuel consumption/brake power in kg/KW hr=\"),round(bsfc,2)\n",
"n_bte=3600/(bsfc*C*1000)\n",
"print(\"brake thermal efficiency(n_bte)=\"),round(n_bte,2)\n",
"print(\"in percentage\"),round(n_bte*100,2)\n",
"print(\"also,mechanical efficiency(n_mech)=brake thermal efficiency/indicated thermal efficiency\")\n",
"n_ite=n_bte/n_mech\n",
"print(\"indicated thermal efficiency(n_ite)=\"),round(n_ite,2)\n",
"print(\"in percentage\"),round(n_ite*100,2)\n",
"print(\"indicated power(IP)=P_imep*L*A*N\")\n",
"P_imep=IP/(L*(math.pi*D**2/4)*N/60)\n",
"print(\"so P_imep in Kpa=\"),round(P_imep,2)\n",
"print(\"Also,mechanical efficiency=P_bmep/P_imep\")\n",
"n_mech=0.8604;#mechanical efficiency\n",
"P_bmep=P_imep*n_mech\n",
"print(\"so P_bmep in Kpa=\"),round(P_bmep,2)\n",
"print(\"brake power=30.82 KW\")\n",
"print(\"indicated power=35.82 KW\")\n",
"print(\"mechanical efficiency=86.04%\")\n",
"print(\"brake thermal efficiency=28.67%\")\n",
"print(\"indicated thermal efficiency=33.32%\")\n",
"print(\"brake mean effective pressure=65.39 Kpa\")\n",
"print(\"indicated mean effective pressure=76.01 Kpa\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.8;pg no: 392"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.8, Page:392 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 8\n",
"indicated power(IP) in KW= 282.74\n",
"mechanical efficiency(n_mech)=brake power/indicated power\n",
"so n_mech= 0.88\n",
"in percentage 88.42\n",
"brake specific fuel consumption(bsfc)=m*60/BP in kg/KW hr\n",
"brake thermal efficiency(n_bte)= 0.35\n",
"in percentage 34.88\n",
"swept volume(Vs)=%pi*D^2*L/4 in m^3\n",
"mass of air corresponding to above swept volume,using perfect gas equation\n",
"P*Vs=ma*R*T\n",
"so ma=(P*Vs)/(R*T) in kg\n",
"volumetric effeciency(n_vol)=mass of air taken per minute/mass corresponding to swept volume per minute\n",
"so mass of air taken per minute in kg/min \n",
"mass corresponding to swept volume per minute in kg/min\n",
"so volumetric efficiency 0.8333\n",
"in percentage 83.3333\n",
"so indicated power =282.74 KW,mechanical efficiency=88.42%\n",
"brake thermal efficiency=34.88%,volumetric efficiency=83.33%\n"
]
}
],
"source": [
"#cal of brake thermal efficiency,volumetric effeciency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.8, Page:392 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 8\")\n",
"N=300.;#engine rpm\n",
"BP=250.;#brake power in KW\n",
"D=30.*10**-2;#bore in m\n",
"L=25.*10**-2;#stroke in m\n",
"m=1.;#fuel consumption in kg/min\n",
"r=10.;#airfuel ratio \n",
"P_imep=0.8;#indicated mean effective pressure in pa\n",
"C=43.*10**3;#calorific value of fuel in KJ/kg\n",
"P=1.013*10**5;#ambient pressure in K\n",
"R=0.287;#gas constant in KJ/kg K\n",
"T=(27.+273.);#ambient temperature in K\n",
"IP=P_imep*L*(math.pi*D**2/4)*N*4*10**3/60\n",
"print(\"indicated power(IP) in KW=\"),round(IP,2)\n",
"print(\"mechanical efficiency(n_mech)=brake power/indicated power\")\n",
"n_mech=BP/IP\n",
"print(\"so n_mech=\"),round(n_mech,2)\n",
"print(\"in percentage \"),round(n_mech*100,2)\n",
"print(\"brake specific fuel consumption(bsfc)=m*60/BP in kg/KW hr\")\n",
"bsfc=m*60./BP\n",
"n_bte=3600./(bsfc*C)\n",
"print(\"brake thermal efficiency(n_bte)=\"),round(n_bte,2)\n",
"print(\"in percentage\"),round(n_bte*100,2)\n",
"print(\"swept volume(Vs)=%pi*D^2*L/4 in m^3\")\n",
"Vs=math.pi*D**2*L/4\n",
"print(\"mass of air corresponding to above swept volume,using perfect gas equation\")\n",
"print(\"P*Vs=ma*R*T\")\n",
"print(\"so ma=(P*Vs)/(R*T) in kg\")\n",
"ma=(P*Vs)/(R*T*1000) \n",
"ma=0.02;#approx.\n",
"print(\"volumetric effeciency(n_vol)=mass of air taken per minute/mass corresponding to swept volume per minute\")\n",
"print(\"so mass of air taken per minute in kg/min \")\n",
"1*10\n",
"print(\"mass corresponding to swept volume per minute in kg/min\")\n",
"ma*4*N/2\n",
"print(\"so volumetric efficiency \"),round(10./12.,4)\n",
"print(\"in percentage\"),round((10./12.)*100.,4)\n",
"print(\"so indicated power =282.74 KW,mechanical efficiency=88.42%\")\n",
"print(\"brake thermal efficiency=34.88%,volumetric efficiency=83.33%\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.9;pg no: 393"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.9, Page:393 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 9\n",
"indicated mean effective pressure(P_imeb)=h*k in Kpa\n",
"indicated power(IP)=P_imeb*L*A*N/2 in KW 9.375\n",
"brake power(BP)=2*%pi*N*T in KW 4.62\n",
"mechanical efficiency(n_mech)= 0.49\n",
"in percentage 49.31\n",
"so indicated power=9.375 KW\n",
"brake power=4.62 KW\n",
"mechanical efficiency=49.28%\n",
"energy liberated from fuel(Ef)=C*m/60 in KJ/s\n",
"energy available as brake power(BP)=4.62 KW\n",
"energy to coolant(Ec)=(mw/M)*Cw*(T2-T1) in KW\n",
"energy carried by exhaust gases(Eg)=30 KJ/s\n",
"unaccounted energy loss in KW= 34.75\n",
"NOTE=>overall energy balance sheet is attached as jpg file with this code.\n"
]
}
],
"source": [
"#cal of indicated power,brake power,mechanical efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.9, Page:393 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 9\")\n",
"h=10.;#height of indicator diagram in mm\n",
"k=25.;#indicator constant in KN/m^2 per mm\n",
"N=300.;#engine rpm\n",
"Vs=1.5*10**-2;#swept volume in m^3\n",
"M=60.;#effective brake load upon dynamometer in kg\n",
"r=50.*10**-2;#effective brake drum radius in m\n",
"m=0.12;#fuel consumption in kg/min\n",
"C=42.*10**3;#calorific value in KJ/kg\n",
"mw=6.;#circulating water rate in kg/min\n",
"T1=35.;#cooling water entering temperature in degree celcius\n",
"T2=70.;#cooling water leaving temperature in degree celcius\n",
"Eg=30.;#exhaust gases leaving energy in KJ/s\n",
"Cw=4.18;#specific heat of water in KJ/kg K\n",
"g=9.81;#accelaration due to gravity in m/s^2\n",
"print(\"indicated mean effective pressure(P_imeb)=h*k in Kpa\")\n",
"P_imeb=h*k\n",
"IP=P_imeb*Vs*N/(2*60)\n",
"print(\"indicated power(IP)=P_imeb*L*A*N/2 in KW\") ,round(IP,3)\n",
"BP=2*math.pi*N*(M*g*r*10**-3)/(2*60)\n",
"print(\"brake power(BP)=2*%pi*N*T in KW\"),round(BP,2)\n",
"n_mech=BP/IP\n",
"print(\"mechanical efficiency(n_mech)=\"),round(n_mech,2)\n",
"print(\"in percentage\"),round(n_mech*100,2)\n",
"print(\"so indicated power=9.375 KW\")\n",
"print(\"brake power=4.62 KW\")\n",
"print(\"mechanical efficiency=49.28%\")\n",
"print(\"energy liberated from fuel(Ef)=C*m/60 in KJ/s\")\n",
"Ef=C*m/60\n",
"print(\"energy available as brake power(BP)=4.62 KW\")\n",
"print(\"energy to coolant(Ec)=(mw/M)*Cw*(T2-T1) in KW\")\n",
"Ec=(mw/M)*Cw*(T2-T1)\n",
"print(\"energy carried by exhaust gases(Eg)=30 KJ/s\")\n",
"Ef-BP-Ec-Eg\n",
"print(\"unaccounted energy loss in KW=\"),round(Ef-BP-Ec-Eg,2)\n",
"print(\"NOTE=>overall energy balance sheet is attached as jpg file with this code.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.10;pg no: 394"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.10, Page:394 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 10\n",
"brake power(BP)=2*%pi*N*T in KW 47.12\n",
"so brake power=47.124 KW\n",
"brake specific fuel consumption(bsfc) in kg/KW hr= 0.34\n",
"indicated power(IP) in Kw= 52.36\n",
"indicated thermal efficiency(n_ite)= 0.28\n",
"in percentage 28.05\n",
"so indicated thermal efficiency=28.05%\n",
"heat available from fuel(Qf)=(m/mw)*C in KJ/min 11200.0\n",
"energy consumed as brake power(BP) in KJ/min= 2827.43\n",
"energy carried by cooling water(Qw) in KJ/min= 1442.1\n",
"energy carried by exhaust gases(Qg) in KJ/min= 4786.83\n",
"unaccounted energy loss in KJ/min 2143.63\n",
"NOTE=>Heat balance sheet on per minute basis is attached as jpg file with this code.\n"
]
}
],
"source": [
"#cal of brake power,brake specific fuel consumption,indicated thermal efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.10, Page:394 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 10\")\n",
"m=4.;#mass of fuel consumed in kg\n",
"N=1500.;#engine rpm\n",
"mw=15.;#water circulation rate in kg/min\n",
"T1=27.;#cooling water inlet temperature in degree celcius\n",
"T2=50.;#cooling water outlet temperature in degree celcius\n",
"ma=150.;#mass of air consumed in kg\n",
"T_exhaust=400.;#exhaust temperature in degree celcius\n",
"T_atm=27.;#atmospheric temperature in degree celcius\n",
"Cg=1.25;#mean specific heat of exhaust gases in KJ/kg K\n",
"n_mech=0.9;#mechanical efficiency\n",
"T=300.*10**-3;#brake torque in N\n",
"C=42.*10**3;#calorific value in KJ/kg\n",
"Cw=4.18;#specific heat of water in KJ/kg K\n",
"BP=2.*math.pi*N*T/60\n",
"print(\"brake power(BP)=2*%pi*N*T in KW\"),round(BP,2)\n",
"print(\"so brake power=47.124 KW\")\n",
"bsfc=m*60/(mw*BP)\n",
"print(\"brake specific fuel consumption(bsfc) in kg/KW hr=\"),round(bsfc,2)\n",
"IP=BP/n_mech\n",
"print(\"indicated power(IP) in Kw=\"),round(IP,2)\n",
"n_ite=IP*mw*60/(m*C)\n",
"print(\"indicated thermal efficiency(n_ite)=\"),round(n_ite,2)\n",
"print(\"in percentage\"),round(n_ite*100,2)\n",
"print(\"so indicated thermal efficiency=28.05%\")\n",
"Qf=(m/mw)*C\n",
"print(\"heat available from fuel(Qf)=(m/mw)*C in KJ/min\"),round(Qf,2)\n",
"BP=BP*60 \n",
"print(\"energy consumed as brake power(BP) in KJ/min=\"),round(BP,2)\n",
"Qw=mw*Cw*(T2-T1)\n",
"print(\"energy carried by cooling water(Qw) in KJ/min=\"),round(Qw,2)\n",
"Qg=(ma+m)*Cg*(T_exhaust-T_atm)/mw\n",
"print(\"energy carried by exhaust gases(Qg) in KJ/min=\"),round(Qg,2)\n",
"Qf-(BP+Qw+Qg)\n",
"print(\"unaccounted energy loss in KJ/min\"),round(Qf-(BP+Qw+Qg),2)\n",
"print(\"NOTE=>Heat balance sheet on per minute basis is attached as jpg file with this code.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.11;pg no: 395"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.11, Page:395 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 11\n",
"indicated power of 1st cylinder=BP-BP1 in KW\n",
"indicated power of 2nd cylinder=BP-BP2 in KW\n",
"indicated power of 3rd cylinder=BP-BP3 in KW\n",
"indicated power of 4th cylinder=BP-BP4 in KW\n",
"indicated power of 5th cylinder=BP-BP5 in KW\n",
"indicated power of 6th cylinder=BP-BP6 in KW\n",
" total indicated power(IP)in KW= 61.9\n",
"mechanical efficiency(n_mech)= 0.81\n",
"in percentage 80.78\n",
"so indicated power=61.9 KW\n",
"mechanical efficiency=80.77%\n"
]
}
],
"source": [
"#cal of indicated power and mechanical efficiency\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.11, Page:395 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 11\")\n",
"BP=50.;#brake power output at full load in KW\n",
"BP1=40.1;#brake power output of 1st cylinder in KW\n",
"BP2=39.5;#brake power output of 2nd cylinder in KW\n",
"BP3=39.1;#brake power output of 3rd cylinder in KW\n",
"BP4=39.6;#brake power output of 4th cylinder in KW\n",
"BP5=39.8;#brake power output of 5th cylinder in KW\n",
"BP6=40.;#brake power output of 6th cylinder in KW\n",
"print(\"indicated power of 1st cylinder=BP-BP1 in KW\")\n",
"BP-BP1\n",
"print(\"indicated power of 2nd cylinder=BP-BP2 in KW\")\n",
"BP-BP2\n",
"print(\"indicated power of 3rd cylinder=BP-BP3 in KW\")\n",
"BP-BP3\n",
"print(\"indicated power of 4th cylinder=BP-BP4 in KW\")\n",
"BP-BP4\n",
"print(\"indicated power of 5th cylinder=BP-BP5 in KW\")\n",
"BP-BP5\n",
"print(\"indicated power of 6th cylinder=BP-BP6 in KW\")\n",
"BP-BP6\n",
"IP=9.9+10.5+10.9+10.4+10.2+10\n",
"print(\" total indicated power(IP)in KW=\"),round(IP,2)\n",
"n_mech=BP/IP\n",
"print(\"mechanical efficiency(n_mech)=\"),round(n_mech,2)\n",
"print(\"in percentage\"),round(n_mech*100,2)\n",
"print(\"so indicated power=61.9 KW\")\n",
"print(\"mechanical efficiency=80.77%\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.12;pg no: 396"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.12, Page:396 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 12\n",
"brake power output of engine(BP) in KW= 19.63\n",
"brake power when cylinder 1 is cut(BP1) in KW= 13.74\n",
"so indicated power of first cylinder(IP1) in KW= 5.89\n",
"brake power when cylinder 2 is cut(BP2) in KW= 14.14\n",
"so indicated power of second cylinder(IP2) in KW= 5.5\n",
"brake power when cylinder 3 is cut(BP3) in KW= 14.29\n",
"so indicated power of third cylinder(IP3) in KW= 5.34\n",
"brake power when cylinder 4 is cut(BP4) in KW= 13.35\n",
"so indicated power of fourth cylinder(IP4) in KW= 6.28\n",
"now total indicated power(IP) in KW 23.01\n",
"engine mechanical efficiency(n_mech)= 0.85\n",
"in percentage 85.32\n",
"so BP=19.63 KW,IP=23 KW,n_mech=83.35%\n",
"heat liberated by fuel(Qf)=m*C in KJ/min 8127.0\n",
"heat carried by exhaust gases(Qg) in KJ/min= 1436.02\n",
"heat carried by cooling water(Qw) in KJ/min= 1730.52\n",
"energy to brake power(BP) in KJ/min= 1177.8\n",
"unaccounted losses in KJ/min 3782.66\n",
"NOTE=>Heat balance sheet on per minute basis is attached as jpg file with this code. \n"
]
}
],
"source": [
"#cal of brake power,indicated power,heat balance sheet\n",
"#intiation of all variables\n",
"# Chapter 9\n",
"import math\n",
"print\"Example 10.12, Page:396 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 12\")\n",
"N=1500.;#engine rpm at full load\n",
"F=250.;#brake load at full load in N\n",
"F1=175.;#brake reading 1 in N\n",
"F2=180.;#brake reading 2 in N\n",
"F3=182.;#brake reading 3 in N\n",
"F4=170.;#brake reading 4 in N\n",
"r=50.*10**-2;#brake drum radius in m\n",
"m=0.189;#fuel consumption rate in kg/min\n",
"C=43.*10**3;#fuel calorific value in KJ/kg\n",
"k=12.;#air to fuel ratio\n",
"T_exhaust=600.;#exhaust gas temperature in degree celcius\n",
"mw=18.;#cooling water flow rate in kg/min\n",
"T1=27.;#cooling water entering temperature in degree celcius\n",
"T2=50.;#cooling water leaving temperature in degree celcius\n",
"T_atm=27.;#atmospheric air temperature\n",
"Cg=1.02;#specific heat of exhaust gas in KJ/kg K\n",
"Cw=4.18;#specific heat of water in KJ/kg K\n",
"BP=2.*math.pi*N*F*r*10**-3/60.\n",
"print(\"brake power output of engine(BP) in KW=\"),round(BP,2)\n",
"BP1=2.*math.pi*N*F1*r*10**-3/60.\n",
"print(\"brake power when cylinder 1 is cut(BP1) in KW=\"),round(BP1,2)\n",
"IP1=BP-BP1\n",
"print(\"so indicated power of first cylinder(IP1) in KW=\"),round(IP1,2)\n",
"BP2=2.*math.pi*N*F2*r*10**-3/60.\n",
"print(\"brake power when cylinder 2 is cut(BP2) in KW=\"),round(BP2,2)\n",
"IP2=BP-BP2\n",
"print(\"so indicated power of second cylinder(IP2) in KW=\"),round(IP2,2)\n",
"BP3=2.*math.pi*N*F3*r*10**-3/60.\n",
"print(\"brake power when cylinder 3 is cut(BP3) in KW=\"),round(BP3,2)\n",
"IP3=BP-BP3\n",
"print(\"so indicated power of third cylinder(IP3) in KW=\"),round(IP3,2)\n",
"BP4=2.*math.pi*N*F4*r*10**-3/60.\n",
"print(\"brake power when cylinder 4 is cut(BP4) in KW=\"),round(BP4,2)\n",
"IP4=BP-BP4\n",
"print(\"so indicated power of fourth cylinder(IP4) in KW=\"),round(IP4,2)\n",
"IP=IP1+IP2+IP3+IP4\n",
"print(\"now total indicated power(IP) in KW\"),round(IP,2)\n",
"n_mech=BP/IP\n",
"print(\"engine mechanical efficiency(n_mech)=\"),round(n_mech,2)\n",
"print(\"in percentage\"),round(n_mech*100,2)\n",
"print(\"so BP=19.63 KW,IP=23 KW,n_mech=83.35%\")\n",
"Qf=m*C\n",
"print(\"heat liberated by fuel(Qf)=m*C in KJ/min\"),round(Qf,2)\n",
"Qg=(k+1)*m*Cg*(T_exhaust-T_atm)\n",
"print(\"heat carried by exhaust gases(Qg) in KJ/min=\"),round(Qg,2)\n",
"Qw=mw*Cw*(T2-T1)\n",
"print(\"heat carried by cooling water(Qw) in KJ/min=\"),round(Qw,2)\n",
"BP=19.63*60\n",
"print(\"energy to brake power(BP) in KJ/min=\"),round(19.63*60,2)\n",
"Qf-(Qg+Qw+BP)\n",
"print(\"unaccounted losses in KJ/min\"),round(Qf-(Qg+Qw+BP),2)\n",
"print(\"NOTE=>Heat balance sheet on per minute basis is attached as jpg file with this code. \")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 10.13;pg no: 397"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 10.13, Page:397 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 13\n",
"brake power(BP)=2*%pi*N*T in KW\n",
"indicated power(IP)=(mep*L*A*N)/60000 in KW\n",
"A> heat added(Q)=m*C/3600 in KJ/s 52.36\n",
"or Q in KJ/min\n",
"thermal efficiency(n_th)= 0.27\n",
"in percentage 26.85\n",
"B> heat equivalent of brake power(BP) in KJ/min= 659.76\n",
"C> heat loss to cooling water(Qw)=mw*Cpw*(T2-T1) in KJ/min\n",
"heat carried by exhaust gases=heat carried by steam in exhaust gases+heat carried by fuel gases(dry gases) in exhaust gases\n",
"mass of exhaust gases(mg)=mass of air+mass of fuel in kg/min\n",
"mg=(ma+m)/60\n",
"mass of steam in exhaust gases in kg/min\n",
"mass of dry exhaust gases in kg/min\n",
"D> heat carried by steam in exhaust in KJ/min 299.86\n",
"E> heat carried by fuel gases(dry gases) in exhaust gases(Qg) in KJ/min 782.64\n",
"F> unaccounted loss=A-B-C-D-E in KJ/min 537.4\n",
"NOTE># on per minute basis is attached as jpg file with this code.\n"
]
}
],
"source": [
"#cal of thermal efficiency and heat balance sheet\n",
"#intiation of all variables\n",
"# Chapter 10\n",
"import math\n",
"print\"Example 10.13, Page:397 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 10 Example 13\")\n",
"D=20.*10**-2;#cylinder diameter in m\n",
"L=28.*10**-2;#stroke in m\n",
"m=4.22;#mass of fuel used in kg\n",
"C=44670.;#calorific value of fuel in KJ/kg\n",
"N=21000./60.;#engine rpm\n",
"mep=2.74*10**5;#mean effective pressure in pa\n",
"F=600.;#net brake load applied to a drum of 100 cm diameter in N\n",
"r=50.*10**-2;#brake drum radius in m\n",
"mw=495.;#total mass of cooling water in kg\n",
"T1=13.;#cooling water inlet temperature in degree celcius\n",
"T2=38.;#cooling water outlet temperature in degree celcius\n",
"ma=135.;#mass of air used in kg\n",
"T_air=20.;#temperature of air in test room in degree celcius\n",
"T_exhaust=370.;#temperature of exhaust gases in degree celcius\n",
"Cp_gases=1.005;#specific heat of gases in KJ/kg K\n",
"Cp_steam=2.093;#specific heat of steam at atmospheric pressure in KJ/kg K\n",
"Cpw=4.18;#specific heat of water in KJ/kg K\n",
"print(\"brake power(BP)=2*%pi*N*T in KW\")\n",
"BP=2*math.pi*N*F*r/60000\n",
"print(\"indicated power(IP)=(mep*L*A*N)/60000 in KW\")\n",
"IP=(mep*L*(math.pi*D**2/4)*N)/60000\n",
"Q=m*C/3600\n",
"print(\"A> heat added(Q)=m*C/3600 in KJ/s\"),round(Q,2)\n",
"print(\"or Q in KJ/min\")\n",
"Q=Q*60\n",
"Q=52.36;#heat added in KJ/s\n",
"n_th=IP/Q\n",
"print(\"thermal efficiency(n_th)= \"),round(n_th,2)\n",
"print(\"in percentage\"),round(n_th*100,2)\n",
"BP=BP*60\n",
"print(\"B> heat equivalent of brake power(BP) in KJ/min= \"),round(10.996*60,2)\n",
"print(\"C> heat loss to cooling water(Qw)=mw*Cpw*(T2-T1) in KJ/min\")\n",
"Qw=mw*Cpw*(T2-T1)/60\n",
"print(\"heat carried by exhaust gases=heat carried by steam in exhaust gases+heat carried by fuel gases(dry gases) in exhaust gases\")\n",
"print(\"mass of exhaust gases(mg)=mass of air+mass of fuel in kg/min\")\n",
"print(\"mg=(ma+m)/60\")\n",
"mg=(ma+m)/60\n",
"print(\"mass of steam in exhaust gases in kg/min\")\n",
"9*(0.15*m/60)\n",
"print(\"mass of dry exhaust gases in kg/min\")\n",
"mg-0.095\n",
"0.095*(Cpw*(100-T_air)+2256.9+Cp_steam*(T_exhaust-100))\n",
"print(\"D> heat carried by steam in exhaust in KJ/min\"),round(0.095*(Cpw*(100-T_air)+2256.9+Cp_steam*(T_exhaust-100)),2)\n",
"Qg=2.225*Cp_gases*(T_exhaust-T_air)\n",
"print(\"E> heat carried by fuel gases(dry gases) in exhaust gases(Qg) in KJ/min\"),round(Qg,2)\n",
"print(\"F> unaccounted loss=A-B-C-D-E in KJ/min\"),round(3141.79-659.76-862.13-299.86-782.64,2)\n",
"print(\"NOTE># on per minute basis is attached as jpg file with this code.\")\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
IIs,Engineering Thermodynamics/chapter11_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 11:Introduction to refrigeration and Air Conditioning"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.1;pg no: 435"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.1, Page:435 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 1\n",
"for refrigerator working on reversed carnot cycle.\n",
"Q1/T1=Q2/T2\n",
"so Q2=Q1*T2/T1 in KJ/min\n",
"and work input required,W in KJ/min\n",
"W=Q2-Q1 83.66\n"
]
}
],
"source": [
"#cal of work input\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.1, Page:435 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 1\")\n",
"T1=(-16.+273.);#temperature of refrigerated space in K\n",
"T2=(27.+273.);#temperature of atmosphere in K\n",
"Q1=500.;#heat extracted from refrigerated space in KJ/min\n",
"print(\"for refrigerator working on reversed carnot cycle.\")\n",
"print(\"Q1/T1=Q2/T2\")\n",
"print(\"so Q2=Q1*T2/T1 in KJ/min\")\n",
"Q2=Q1*T2/T1\n",
"print(\"and work input required,W in KJ/min\")\n",
"W=Q2-Q1\n",
"print(\"W=Q2-Q1\"),round(W,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.2;pg no: 435"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.2, Page:435 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 2\n",
"refrigeration capacity or heat extraction rate(Q)in KJ/s\n",
"let the ice formation rate be m kg/s\n",
"heat to be removed from per kg of water for its transformation into ice(Q1)in KJ/kg.\n",
"ice formation rate(m)in kg=refrigeration capacity/heat removed for getting per kg of ice= 6.25\n",
"COP of refrigerator,=T1/(T2-T1)=refrigeration capacity/work done\n",
"also COP=Q/W\n",
"so W=Q/COP in KJ/s\n",
"HP required 643.62\n",
"NOTE=>In book,this question is solved by taking T1=-5 degree celcius,but according to question T1=-7 degree celcius so this question is correctly solved above by considering T1=-7 degree celcius.\n"
]
}
],
"source": [
"#cal of HP required\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.2, Page:435 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 2\")\n",
"Q=800.;#refrigeration capacity in tons\n",
"Q_latent=335.;#latent heat for ice formation from water in KJ/kg\n",
"T1=(-7.+273.);#temperature of reservoir 1 in K\n",
"T2=(27.+273.);#temperature of reservoir 2 in K\n",
"print(\"refrigeration capacity or heat extraction rate(Q)in KJ/s\")\n",
"Q=Q*3.5\n",
"print(\"let the ice formation rate be m kg/s\")\n",
"print(\"heat to be removed from per kg of water for its transformation into ice(Q1)in KJ/kg.\")\n",
"Q1=4.18*(27-0)+Q_latent\n",
"m=Q/Q1\n",
"print(\"ice formation rate(m)in kg=refrigeration capacity/heat removed for getting per kg of ice=\"),round(Q/Q1,2)\n",
"print(\"COP of refrigerator,=T1/(T2-T1)=refrigeration capacity/work done\")\n",
"COP=T1/(T2-T1)\n",
"print(\"also COP=Q/W\")\n",
"print(\"so W=Q/COP in KJ/s\")\n",
"W=Q/COP\n",
"W=W/0.7457\n",
"print(\"HP required\"),round(W/0.7457,2)\n",
"print(\"NOTE=>In book,this question is solved by taking T1=-5 degree celcius,but according to question T1=-7 degree celcius so this question is correctly solved above by considering T1=-7 degree celcius.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.3;pg no: 436"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.3, Page:436 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 3\n",
"COP=T1/(T2-T1)=Q/W 1.56\n",
"equating,COP=T1/(T2-T1)\n",
"so temperature of surrounding(T2)in K\n",
"T2= 403.69\n"
]
}
],
"source": [
"#cal of COP and temperature of surrounding\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.3, Page:436 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 3\")\n",
"T1=(-27+273);#temperature of refrigerator in K\n",
"W=3*.7457;#work input in KJ/s\n",
"Q=1*3.5;#refrigeration effect in KJ/s\n",
"COP=Q/W\n",
"print(\"COP=T1/(T2-T1)=Q/W\"),round(COP,2)\n",
"COP=1.56;#approx.\n",
"print(\"equating,COP=T1/(T2-T1)\")\n",
"print(\"so temperature of surrounding(T2)in K\")\n",
"T2=T1+(T1/COP)\n",
"print(\"T2=\"),round(T2,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.4;pg no: 436"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.4, Page:436 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 4\n",
"during process 1-2_a\n",
"p2/p1=(T2_a/T1)^(y/(y-1))\n",
"so T2_a=T1*(p2/p1)^((y-1)/y)in K\n",
"theoretical temperature after compression,T2_a=440.18 K\n",
"for compression process,\n",
"n1=(T2_a-T1)/(T2-T1)\n",
"so T2=T1+(T2_a-T1)/n1 in K\n",
"for expansion process,3-4_a\n",
"T4_a/T3=(p1/p2)^((y-1)/y)\n",
"so T4_a=T3*(p1/p2)^((y-1)/y) in K\n",
"n2=0.9=(T3-T4)/(T3-T4_a)\n",
"so T4=T3-(n2*(T3-T4_a))in K\n",
"so work during compression,W_C in KJ/s\n",
"W_C=m*Cp*(T2-T1)\n",
"work during expansion,W_T in KJ/s\n",
"W_T=m*Cp*(T3-T4)\n",
"refrigeration effect is realized during process,4-1.so refrigeration shall be,\n",
"Q_ref=m*Cp*(T1-T4) in KJ/s\n",
"Q_ref in ton 18.36\n",
"net work required(W)=W_C-W_T in KJ/s 111.59\n",
"COP= 0.58\n",
"so refrigeration capacity=18.36 ton or 64.26 KJ/s\n",
"and COP=0.57\n",
"NOTE=>In book this question is solve by taking T1=240 K which is incorrect,hence correction is made above according to question by taking T1=-30 degree celcius or 243 K,so answer may vary slightly.\n"
]
}
],
"source": [
"#cal of refrigeration capacity and COP\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.4, Page:436 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 4\")\n",
"T1=(-30.+273.);#temperature of air at beginning of compression in K\n",
"T3=(27.+273.);#temperature of air after cooling in K\n",
"r=8.;#pressure ratio\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"y=1.4;#expansion constant \n",
"m=1.;#air flow rate in kg/s\n",
"n1=0.85;#isentropic efficiency for compression process\n",
"n2=.9;#isentropic efficiency for expansion process\n",
"print(\"during process 1-2_a\")\n",
"print(\"p2/p1=(T2_a/T1)^(y/(y-1))\")\n",
"print(\"so T2_a=T1*(p2/p1)^((y-1)/y)in K\")\n",
"T2_a=T1*(r)**((y-1)/y)\n",
"print(\"theoretical temperature after compression,T2_a=440.18 K\")\n",
"print(\"for compression process,\")\n",
"print(\"n1=(T2_a-T1)/(T2-T1)\")\n",
"print(\"so T2=T1+(T2_a-T1)/n1 in K\")\n",
"T2=T1+(T2_a-T1)/n1\n",
"print(\"for expansion process,3-4_a\")\n",
"print(\"T4_a/T3=(p1/p2)^((y-1)/y)\")\n",
"print(\"so T4_a=T3*(p1/p2)^((y-1)/y) in K\")\n",
"T4_a=T3*(1/r)**((y-1)/y)\n",
"print(\"n2=0.9=(T3-T4)/(T3-T4_a)\")\n",
"print(\"so T4=T3-(n2*(T3-T4_a))in K\")\n",
"T4=T3-(n2*(T3-T4_a))\n",
"print(\"so work during compression,W_C in KJ/s\")\n",
"print(\"W_C=m*Cp*(T2-T1)\")\n",
"W_C=m*Cp*(T2-T1)\n",
"print(\"work during expansion,W_T in KJ/s\")\n",
"print(\"W_T=m*Cp*(T3-T4)\")\n",
"W_T=m*Cp*(T3-T4)\n",
"print(\"refrigeration effect is realized during process,4-1.so refrigeration shall be,\")\n",
"print(\"Q_ref=m*Cp*(T1-T4) in KJ/s\")\n",
"Q_ref=m*Cp*(T1-T4)\n",
"Q_ref=Q_ref/3.5\n",
"print(\"Q_ref in ton\"),round(Q_ref,2)\n",
"W=W_C-W_T\n",
"print(\"net work required(W)=W_C-W_T in KJ/s\"),round(W,2)\n",
"Q_ref=64.26;\n",
"COP=Q_ref/(W_C-W_T)\n",
"print(\"COP=\"),round(COP,2)\n",
"print(\"so refrigeration capacity=18.36 ton or 64.26 KJ/s\")\n",
"print(\"and COP=0.57\")\n",
"print(\"NOTE=>In book this question is solve by taking T1=240 K which is incorrect,hence correction is made above according to question by taking T1=-30 degree celcius or 243 K,so answer may vary slightly.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.5;pg no: 437"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.5, Page:437 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 5\n",
"for isentropic compression process:\n",
"(p2/p1)^((y-1)/y)=T2/T1\n",
"so T2=T1*(p2/p1)^((y-1)/y) in K\n",
"for isenropic expansion process:\n",
"(p3/p4)^((y-1)/y)=(T3/T4)=(p2/p1)^((y-1)/y)\n",
"so T4=T3/(p2/p1)^((y-1)/y) in K\n",
"heat rejected during process 2-3,Q23=Cp*(T2-T3)in KJ/kg\n",
"refrigeration process,heat picked during process 4-1,Q41=Cp*(T1-T4) in KJ/kg\n",
"so net work(W)=Q23-Q41 in KJ/kg\n",
"so COP=refrigeration effect/net work= 1.71\n"
]
}
],
"source": [
"#cal of COP\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.5, Page:437 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 5\")\n",
"T1=(7+273);#temperature of refrigerated space in K\n",
"T3=(27+273);#temperature after compression in K\n",
"p1=1*10**5;#pressure of refrigerated space in pa\n",
"p2=5*10**5;#pressure after compression in pa\n",
"y=1.4;#expansion constant\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"print(\"for isentropic compression process:\")\n",
"print(\"(p2/p1)^((y-1)/y)=T2/T1\")\n",
"print(\"so T2=T1*(p2/p1)^((y-1)/y) in K\")\n",
"T2=T1*(p2/p1)**((y-1)/y)\n",
"print(\"for isenropic expansion process:\")\n",
"print(\"(p3/p4)^((y-1)/y)=(T3/T4)=(p2/p1)^((y-1)/y)\")\n",
"print(\"so T4=T3/(p2/p1)^((y-1)/y) in K\")\n",
"T4=T3/(p2/p1)**((y-1)/y)\n",
"print(\"heat rejected during process 2-3,Q23=Cp*(T2-T3)in KJ/kg\")\n",
"Q23=Cp*(T2-T3)\n",
"print(\"refrigeration process,heat picked during process 4-1,Q41=Cp*(T1-T4) in KJ/kg\")\n",
"Q41=Cp*(T1-T4)\n",
"print(\"so net work(W)=Q23-Q41 in KJ/kg\")\n",
"W=Q23-Q41\n",
"COP=Q41/W\n",
"print(\"so COP=refrigeration effect/net work=\"),round(COP,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.6;pg no: 438"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.6, Page:438 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 6\n",
"for process 1-2\n",
"(p2/p1)^((y-1)/y)=T2/T1\n",
"so T2=T1*(p2/p1)^((y-1)/y) in K\n",
"for process 3-4\n",
"(p3/p4)^((y-1)/y)=T3/T4\n",
"so T4=T3/(p3/p4)^((y-1)/y)=T3/(p2/p1)^((y-1)/y)in K\n",
"refrigeration capacity(Q) in KJ/s= 63.25\n",
"Q in ton\n",
"work required to run compressor(w)=(m*n)*(p2*v2-p1*v1)/(n-1)\n",
"w=(m*n)*R*(T2-T1)/(n-1) in KJ/s\n",
"HP required to run compressor 177.86\n",
"so HP required to run compressor=177.86 hp\n",
"net work input(W)=m*Cp*{(T2-T3)-(T1-T4)}in KJ/s\n",
"COP=refrigeration capacity/work=Q/W 1.59\n"
]
}
],
"source": [
"#cal of refrigeration capacity,HP required to run compressor,COP\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.6, Page:438 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 6\")\n",
"T1=(-10.+273.);#air entering temperature in K\n",
"p1=1.*10**5;#air entering pressure in pa\n",
"T3=(27.+273.);#compressed air temperature after cooling in K\n",
"p2=5.5*10**5;#pressure after compression in pa\n",
"m=0.8;#air flow rate in kg/s\n",
"Cp=1.005;#specific heat capacity at constant pressure in KJ/kg K\n",
"y=1.4;#expansion constant\n",
"R=0.287;#gas constant in KJ/kg K\n",
"print(\"for process 1-2\")\n",
"print(\"(p2/p1)^((y-1)/y)=T2/T1\")\n",
"print(\"so T2=T1*(p2/p1)^((y-1)/y) in K\")\n",
"T2=T1*(p2/p1)**((y-1)/y)\n",
"print(\"for process 3-4\")\n",
"print(\"(p3/p4)^((y-1)/y)=T3/T4\")\n",
"print(\"so T4=T3/(p3/p4)^((y-1)/y)=T3/(p2/p1)^((y-1)/y)in K\")\n",
"T4=T3/(p2/p1)**((y-1)/y)\n",
"Q=m*Cp*(T1-T4)\n",
"print(\"refrigeration capacity(Q) in KJ/s=\"),round(Q,2)\n",
"print(\"Q in ton\")\n",
"Q=Q/3.5\n",
"print(\"work required to run compressor(w)=(m*n)*(p2*v2-p1*v1)/(n-1)\")\n",
"print(\"w=(m*n)*R*(T2-T1)/(n-1) in KJ/s\")\n",
"n=y;\n",
"w=(m*n)*R*(T2-T1)/(n-1)\n",
"print(\"HP required to run compressor\"),round(w/0.7457,2)\n",
"print(\"so HP required to run compressor=177.86 hp\")\n",
"print(\"net work input(W)=m*Cp*{(T2-T3)-(T1-T4)}in KJ/s\")\n",
"W=m*Cp*((T2-T3)-(T1-T4))\n",
"Q=63.25;#refrigeration capacity in KJ/s\n",
"COP=Q/W\n",
"print(\"COP=refrigeration capacity/work=Q/W\"),round(COP,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.7;pg no: 440"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.7, Page:440 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 7\n",
"for process 1-2,n=1.45\n",
"T2/T1=(p2/p1)^((n-1)/n)\n",
"so T2=T1*(p2/p1)^((n-1)/n) in K\n",
"for process 3-4,n=1.3\n",
"T4/T3=(p4/p3)^((n-1)/n)\n",
"so T4=T3*(p4/p3)^((n-1)/n)in K\n",
"refrigeration effect in passenger cabin with m kg/s mass flow rate of air.\n",
"Q=m*Cp*(T5-T4)\n",
"m in kg/s= 0.55\n",
"so air mass flow rate in cabin=0.55 kg/s\n",
"let the mass flow rate through intercooler be m1 kg/s then the energy balance upon intercooler yields,\n",
"m1*Cp*(T8-T7)=m*Cp*(T2-T3)\n",
"during process 6-7,T7/T6=(p7/p6)^((n-1)/n)\n",
"so T7=T6*(p7/p6)^((n-1)/n) in K\n",
"substituting T2,T3,T7,T8 and m in energy balance on intercooler,\n",
"m1=m*(T2-T3)/(T8-T7)in kg/s\n",
"total ram air mass flow rate=m+m1 in kg/s 2.11\n",
"ram air mass flow rate=2.12 kg/s\n",
"work input to compressor(W)=m*Cp*(T2-T1)in KJ/s\n",
"COP=refrigeration effect/work input=Q/W 0.485\n"
]
}
],
"source": [
"#cal of air mass flow rate in cabin,ram air mass flow rate,COP\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.7, Page:440 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 7\")\n",
"p1=1.2*10**5;#pressure of ram air in pa\n",
"p6=p1;\n",
"T1=(15.+273.);#temperature of ram air in K\n",
"T6=T1;\n",
"p7=0.9*10**5;#pressure of ram air after expansion in pa\n",
"p3=4.*10**5;#pressure of ram air after compression in pa\n",
"p2=p3;\n",
"p4=1.*10**5;#pressure of ram air after expansion in second turbine in pa\n",
"T5=(25.+273.);#temperature of air when exhausted from cabin in K\n",
"T3=(50.+273.);#temperature of compressed air in K\n",
"T8=(30.+273.);#limited temperaure of ram air in K\n",
"Q=10.*3.5;#refrigeration capacity in KJ/s\n",
"Cp=1.005;#specific heat capacity at constant pressure in KJ/kg K\n",
"print(\"for process 1-2,n=1.45\")\n",
"n=1.45;\n",
"print(\"T2/T1=(p2/p1)^((n-1)/n)\")\n",
"print(\"so T2=T1*(p2/p1)^((n-1)/n) in K\")\n",
"T2=T1*(p2/p1)**((n-1)/n)\n",
"print(\"for process 3-4,n=1.3\")\n",
"n=1.3;\n",
"print(\"T4/T3=(p4/p3)^((n-1)/n)\")\n",
"print(\"so T4=T3*(p4/p3)^((n-1)/n)in K\")\n",
"T4=T3*(p4/p3)**((n-1)/n)\n",
"print(\"refrigeration effect in passenger cabin with m kg/s mass flow rate of air.\")\n",
"print(\"Q=m*Cp*(T5-T4)\")\n",
"m=Q/(Cp*(T5-T4))\n",
"print(\"m in kg/s=\"),round(m,2)\n",
"print(\"so air mass flow rate in cabin=0.55 kg/s\")\n",
"print(\"let the mass flow rate through intercooler be m1 kg/s then the energy balance upon intercooler yields,\")\n",
"print(\"m1*Cp*(T8-T7)=m*Cp*(T2-T3)\")\n",
"print(\"during process 6-7,T7/T6=(p7/p6)^((n-1)/n)\")\n",
"print(\"so T7=T6*(p7/p6)^((n-1)/n) in K\")\n",
"T7=T6*(p7/p6)**((n-1)/n)\n",
"print(\"substituting T2,T3,T7,T8 and m in energy balance on intercooler,\")\n",
"print(\"m1=m*(T2-T3)/(T8-T7)in kg/s\")\n",
"m1=m*(T2-T3)/(T8-T7)\n",
"print(\"total ram air mass flow rate=m+m1 in kg/s\"),round(m+m1,2)\n",
"print(\"ram air mass flow rate=2.12 kg/s\")\n",
"print(\"work input to compressor(W)=m*Cp*(T2-T1)in KJ/s\")\n",
"m=0.55;#approx.\n",
"W=m*Cp*(T2-T1)\n",
"COP=Q/W\n",
"print(\"COP=refrigeration effect/work input=Q/W\"),round(Q/W,3)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.8;pg no: 441"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.8, Page:441 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 8\n",
"considering index of compression and expansion as 1.4\n",
"during ramming action,process 0-1,\n",
"T1/To=(p1/po)^((y-1)/y)\n",
"T1=To*(p1/po)^((y-1)/y)in K\n",
"during compression process 1-2_a\n",
"T2_a/T1=(p2/p1)^((y-1)/y)\n",
"T2_a=T1*(p2/p1)^((y-1)/y)in K\n",
"n1=(T2_a-T1)/(T2-T1)\n",
"so T2=T1+(T2_a-T1)/n1 in K\n",
"In heat exchanger 66% of heat loss shall result in temperature at exit from heat exchanger to be,T3=0.34*T2 in K\n",
"subsequently for 10 degree celcius temperature drop in evaporator,\n",
"T4=T3-10 in K\n",
"expansion in cooling turbine during process 4-5;\n",
"T5_a/T4=(p5/p4)^((y-1)/y)\n",
"T5_a=T4*(p5/p4)^((y-1)/y)in K\n",
"n2=(T4-T5)/(T4-T5_a)\n",
"T5=T4-(T4-T5_a)*n2 in K\n",
"let the mass flow rate of air through cabin be m kg/s.using refrigeration capacity heat balance yields.\n",
"Q=m*Cp*(T6-T5)\n",
"so m=Q/(Cp*(T6-T5))in kg/s\n",
"work input to compressor(W)=m*Cp*(T2-T1)in KJ/s 41.4\n",
"W in Hp\n",
"COP=refrigeration effect/work input=Q/W= 1.27\n",
"so COP=1.27\n",
"and HP required=55.48 hp\n"
]
}
],
"source": [
"#cal of COP and HP required\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.8, Page:441 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 8\")\n",
"po=0.9*10**5;#atmospheric air pressure in pa\n",
"To=(3.+273.);#temperature of atmospheric air in K\n",
"p1=1.*10**5;#pressure due to ramming air in pa\n",
"p2=4.*10**5;#pressure when air leaves compressor in pa\n",
"p3=p2;\n",
"p4=p3;\n",
"p5=1.03*10**5;#pressure maintained in passenger cabin in pa\n",
"T6=(25.+273.);#temperature of air leaves cabin in K\n",
"Q=15.*3.5;#refrigeration capacity of aeroplane in KJ/s\n",
"n1=0.9;#isentropic efficiency of compressor\n",
"n2=0.8;#isentropic efficiency of turbine\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg K\n",
"print(\"considering index of compression and expansion as 1.4\")\n",
"y=1.4;\n",
"print(\"during ramming action,process 0-1,\")\n",
"print(\"T1/To=(p1/po)^((y-1)/y)\")\n",
"print(\"T1=To*(p1/po)^((y-1)/y)in K\")\n",
"T1=To*(p1/po)**((y-1)/y)\n",
"print(\"during compression process 1-2_a\")\n",
"print(\"T2_a/T1=(p2/p1)^((y-1)/y)\")\n",
"print(\"T2_a=T1*(p2/p1)^((y-1)/y)in K\")\n",
"T2_a=T1*(p2/p1)**((y-1)/y)\n",
"print(\"n1=(T2_a-T1)/(T2-T1)\")\n",
"print(\"so T2=T1+(T2_a-T1)/n1 in K\")\n",
"T2=T1+(T2_a-T1)/n1\n",
"print(\"In heat exchanger 66% of heat loss shall result in temperature at exit from heat exchanger to be,T3=0.34*T2 in K\")\n",
"T3=0.34*T2\n",
"print(\"subsequently for 10 degree celcius temperature drop in evaporator,\")\n",
"print(\"T4=T3-10 in K\")\n",
"T4=T3-10\n",
"print(\"expansion in cooling turbine during process 4-5;\")\n",
"print(\"T5_a/T4=(p5/p4)^((y-1)/y)\")\n",
"print(\"T5_a=T4*(p5/p4)^((y-1)/y)in K\")\n",
"T5_a=T4*(p5/p4)**((y-1)/y)\n",
"print(\"n2=(T4-T5)/(T4-T5_a)\")\n",
"print(\"T5=T4-(T4-T5_a)*n2 in K\")\n",
"T5=T4-(T4-T5_a)*n2\n",
"print(\"let the mass flow rate of air through cabin be m kg/s.using refrigeration capacity heat balance yields.\")\n",
"print(\"Q=m*Cp*(T6-T5)\")\n",
"print(\"so m=Q/(Cp*(T6-T5))in kg/s\")\n",
"m=Q/(Cp*(T6-T5))\n",
"W=m*Cp*(T2-T1)\n",
"print(\"work input to compressor(W)=m*Cp*(T2-T1)in KJ/s\"),round(W,2)\n",
"print(\"W in Hp\")\n",
"W=W/.7457\n",
"W=41.37;#work input to compressor in KJ/s\n",
"COP=Q/W\n",
"print(\"COP=refrigeration effect/work input=Q/W=\"),round(COP,2)\n",
"print(\"so COP=1.27\")\n",
"print(\"and HP required=55.48 hp\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.9;pg no: 443"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.9, Page:443 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 9\n",
"properties of NH3,\n",
"at 15 degree celcius,h9=-54.51 KJ/kg,hg=1303.74 KJ/kg,s9=-0.2132 KJ/kg K,sg=5.0536 KJ/kg K\n",
"and at 25 degree celcius,h3=99.94 KJ/kg,h2=1317.95 KJ/kg,s3=0.3386 KJ/kg K,s2=4.4809 KJ/kg K\n",
"here work done,W=Area 1-2-3-9-1\n",
"refrigeration effect=Area 1-5-6-4-1\n",
"Area 3-8-9 =(Area 3-11-7)-(Area 9-11-10)-(Area 9-8-7-10)\n",
"so Area 3-8-9=h3-h9-T1*(s3-s9)in KJ/kg\n",
"during throttling process between 3 and 4,h3=h4\n",
"(Area=3-11-7-3)=(Area 4-9-11-6-4)\n",
"(Area 3-8-9)+(Area 8-9-11-7-8)=(Area 4-6-7-8-4)+(Area 8-9-11-7-8)\n",
"(Area 3-8-9)=(Area 4-6-7-8-4)\n",
"so (Area 4-6-7-8-4)=12.09 KJ/kg\n",
"also,(Area 4-6-7-8-4)=T1*(s4-s8)\n",
"so (s4-s8)in KJ/kg K=\n",
"also s3=s8=0.3386 KJ/kg K\n",
"so s4 in KJ/kg K=\n",
"also s1=s2=4.4809 KJ/kg K\n",
"refrigeration effect(Q)=Area (1-5-6-4-1)=T1*(s1-s4)in KJ/kg\n",
"work done(W)=Area (1-2-3-9-1)=(Area 3-8-9)+((T2-T1)*(s1-s8))in KJ/kg\n",
"so COP=refrigeration effect/work done= 5.94\n",
"so COP=5.94\n"
]
}
],
"source": [
"#cal of COP\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.9, Page:443 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 9\")\n",
"print(\"properties of NH3,\")\n",
"print(\"at 15 degree celcius,h9=-54.51 KJ/kg,hg=1303.74 KJ/kg,s9=-0.2132 KJ/kg K,sg=5.0536 KJ/kg K\")\n",
"T1=(-15+273);\n",
"h9=-54.51;\n",
"hg=1303.74;\n",
"s9=-0.2132;\n",
"sg=5.0536;\n",
"print(\"and at 25 degree celcius,h3=99.94 KJ/kg,h2=1317.95 KJ/kg,s3=0.3386 KJ/kg K,s2=4.4809 KJ/kg K\")\n",
"T2=(25+273);\n",
"h3=99.94;\n",
"h2=1317.95;\n",
"s3=0.3386;\n",
"s2=4.4809;\n",
"print(\"here work done,W=Area 1-2-3-9-1\")\n",
"print(\"refrigeration effect=Area 1-5-6-4-1\")\n",
"print(\"Area 3-8-9 =(Area 3-11-7)-(Area 9-11-10)-(Area 9-8-7-10)\")\n",
"print(\"so Area 3-8-9=h3-h9-T1*(s3-s9)in KJ/kg\")\n",
"h3-h9-T1*(s3-s9)\n",
"print(\"during throttling process between 3 and 4,h3=h4\")\n",
"print(\"(Area=3-11-7-3)=(Area 4-9-11-6-4)\")\n",
"print(\"(Area 3-8-9)+(Area 8-9-11-7-8)=(Area 4-6-7-8-4)+(Area 8-9-11-7-8)\")\n",
"print(\"(Area 3-8-9)=(Area 4-6-7-8-4)\")\n",
"print(\"so (Area 4-6-7-8-4)=12.09 KJ/kg\")\n",
"print(\"also,(Area 4-6-7-8-4)=T1*(s4-s8)\")\n",
"print(\"so (s4-s8)in KJ/kg K=\")\n",
"12.09/T1\n",
"print(\"also s3=s8=0.3386 KJ/kg K\")\n",
"s8=s3;\n",
"print(\"so s4 in KJ/kg K=\")\n",
"s4=s8+12.09/T1\n",
"print(\"also s1=s2=4.4809 KJ/kg K\")\n",
"s1=s2;\n",
"print(\"refrigeration effect(Q)=Area (1-5-6-4-1)=T1*(s1-s4)in KJ/kg\")\n",
"Q=T1*(s1-s4)\n",
"print(\"work done(W)=Area (1-2-3-9-1)=(Area 3-8-9)+((T2-T1)*(s1-s8))in KJ/kg\")\n",
"W=12.09+((T2-T1)*(s1-s8))\n",
"COP=Q/W\n",
"print(\"so COP=refrigeration effect/work done=\"),round(COP,2)\n",
"print(\"so COP=5.94\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.10;pg no: 445"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.10, Page:445 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 10\n",
"properties of Freon-12,\n",
"at -20 degree celcius,P1=1.51 bar,vg=0.1088 m^3/kg,hf=17.8 KJ/kg,h1=178.61 KJ/kg,sf=0.0730 KJ/kg K,s1=0.7082 KJ/kg K,Cpg=0.605 KJ/kg K\n",
"at 40 degree celcius,P2=9.61 bar,h3=74.53 KJ/kg,hg=203.05 KJ/kg,sf=0.2716 KJ/kg K,sg=0.682 KJ/kg K,Cpf=0.976 KJ/kg K,Cpg=0.747 KJ/kg K\n",
"during expansion(throttling)between 3 and 4\n",
"h3=h4=hf_40oc=74.53 KJ/kg=h4\n",
"process 1-2 is adiabatic compression so,\n",
"s1=s2,s1=sg_-20oc=0.7082 KJ/kg K\n",
"at 40 degree celcius or 313 K,s1=sg+Cpg*log(T2/313)\n",
"T2=313*exp((s1-sg)/Cpg)in K\n",
"so temperature after compression,T2=324.17 K\n",
"enthalpy after compression,h2=hg+Cpg*(T2-313)in KJ/kg\n",
"compression work required,per kg(Wc)=h2-h1 in KJ/kg\n",
"refrigeration effect during cycle,per kg(q)=h1-h4 in KJ/kg\n",
"mass flow rate of refrigerant,m=Q/q in kg/s\n",
"COP=q/Wc 3.17452\n",
"volumetric efficiency of reciprocating compressor,given C=0.02\n",
"n_vol=1+C-C*(P2/P1)^(1/n)\n",
"let piston printlacement by V,m^3\n",
"mass flow rate,m=(V*n_vol*N)/(60*vg_-20oc)\n",
"so V in cm^3= 569.43\n",
"so COP=3.175\n",
"and piston printlacement=569.45 cm^3\n"
]
}
],
"source": [
"#cal of COP and piston printlacement\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.10, Page:445 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 10\")\n",
"Q=2.86*3.5;#refrigeration effect in KJ/s\n",
"N=1200;#compressor rpm\n",
"n=1.13;#compression index\n",
"print(\"properties of Freon-12,\")\n",
"print(\"at -20 degree celcius,P1=1.51 bar,vg=0.1088 m^3/kg,hf=17.8 KJ/kg,h1=178.61 KJ/kg,sf=0.0730 KJ/kg K,s1=0.7082 KJ/kg K,Cpg=0.605 KJ/kg K\")\n",
"P1=1.51;\n",
"T1=(-20+273);\n",
"vg=0.1088;\n",
"h1=178.61;\n",
"s1=0.7082;\n",
"s2=s1;\n",
"print(\"at 40 degree celcius,P2=9.61 bar,h3=74.53 KJ/kg,hg=203.05 KJ/kg,sf=0.2716 KJ/kg K,sg=0.682 KJ/kg K,Cpf=0.976 KJ/kg K,Cpg=0.747 KJ/kg K\")\n",
"P2=9.61;\n",
"h3=74.53;\n",
"h4=h3;\n",
"hg=203.05;\n",
"sf=0.2716;\n",
"sg=0.682;\n",
"Cpf=0.976;\n",
"Cpg=0.747;\n",
"print(\"during expansion(throttling)between 3 and 4\")\n",
"print(\"h3=h4=hf_40oc=74.53 KJ/kg=h4\")\n",
"print(\"process 1-2 is adiabatic compression so,\")\n",
"print(\"s1=s2,s1=sg_-20oc=0.7082 KJ/kg K\")\n",
"print(\"at 40 degree celcius or 313 K,s1=sg+Cpg*log(T2/313)\")\n",
"print(\"T2=313*exp((s1-sg)/Cpg)in K\")\n",
"T2=313*math.exp((s1-sg)/Cpg)\n",
"print(\"so temperature after compression,T2=324.17 K\")\n",
"print(\"enthalpy after compression,h2=hg+Cpg*(T2-313)in KJ/kg\")\n",
"h2=hg+Cpg*(T2-313)\n",
"print(\"compression work required,per kg(Wc)=h2-h1 in KJ/kg\")\n",
"Wc=h2-h1\n",
"print(\"refrigeration effect during cycle,per kg(q)=h1-h4 in KJ/kg\")\n",
"q=h1-h4\n",
"print(\"mass flow rate of refrigerant,m=Q/q in kg/s\")\n",
"m=Q/q\n",
"m=0.096;#approx.\n",
"COP=q/Wc\n",
"print(\"COP=q/Wc\"),round(COP,5)\n",
"print(\"volumetric efficiency of reciprocating compressor,given C=0.02\")\n",
"C=0.02;\n",
"print(\"n_vol=1+C-C*(P2/P1)^(1/n)\")\n",
"n_vol=1+C-C*(P2/P1)**(1/n)\n",
"print(\"let piston printlacement by V,m^3\")\n",
"print(\"mass flow rate,m=(V*n_vol*N)/(60*vg_-20oc)\")\n",
"V=(m*60*vg)*10**6/(N*n_vol)\n",
"print(\"so V in cm^3=\"),round(V,2)\n",
"print(\"so COP=3.175\")\n",
"print(\"and piston printlacement=569.45 cm^3\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.11;pg no: 447"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.11, Page:447 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 11\n",
"properties of CO2,\n",
"at 20 degree celcius,P1=57.27 bar,hf=144.11 KJ/kg,hg=299.62 KJ/kg,sf=0.523 KJ/kg K,sg_20oc=1.0527 KJ/kg K,Cpf=2.889 KJ/kg K,Cpg=2.135 KJ/kg K\n",
"at -10 degree celcius,P2=26.49 bar,vg=0.014 m^3/kg,hf=60.78 KJ/kg,hg=322.28 KJ/kg,sf=0.2381 KJ/kg K,sg=1.2324 KJ/kg K\n",
"processes of vapour compression cycle are shown on T-s diagram\n",
"1-2:isentropic compression process\n",
"2-3-4:condensation process\n",
"4-5:isenthalpic expansion process\n",
"5-1:refrigeration process in evaporator\n",
"h1=hg at -10oc=322.28 KJ/kg\n",
"at 20 degree celcius,h2=hg+Cpg*(40-20)in KJ/kg\n",
"entropy at state 2,at 20 degree celcius,s2=sg_20oc+Cpg*log((273+40)/(273+20))in KJ/kg K\n",
"entropy during isentropic process,s1=s2\n",
"at -10 degree celcius,s2=sf+x1*sfg\n",
"so x1=(s2-sf)/(sg-sf)\n",
"enthalpy at state 1,at -10 degree celcius,h1=hf+x1*hfg in KJ/kg\n",
"h3=hf at 20oc=144.11 KJ/kg\n",
"since undercooling occurs upto 10oc,so,h4=h3-Cpf*deltaT in KJ/kg\n",
"also,h4=h5=115.22 KJ/kg\n",
"refrigeration effect per kg of refrigerant(q)=(h1-h5)in KJ/kg\n",
"let refrigerant flow rate be m kg/s\n",
"refrigerant effect(Q)=m*q\n",
"m=Q/q in kg/s 0.01016\n",
"compressor work,Wc=h2-h1 in KJ/kg\n",
"COP=refrigeration effect per kg/compressor work per kg= 6.51\n",
"so COP=6.51,mass flow rate=0.01016 kg/s\n",
"NOTE=>In book,mass flow rate(m) which is 0.1016 kg/s is calculated wrong and it is correctly solve above and comes out to be m=0.01016 kg/s. \n"
]
}
],
"source": [
"#cal of COP and mass flow rate\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.11, Page:447 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 11\")\n",
"Q=2;#refrigeration effect in KW\n",
"print(\"properties of CO2,\")\n",
"print(\"at 20 degree celcius,P1=57.27 bar,hf=144.11 KJ/kg,hg=299.62 KJ/kg,sf=0.523 KJ/kg K,sg_20oc=1.0527 KJ/kg K,Cpf=2.889 KJ/kg K,Cpg=2.135 KJ/kg K\")\n",
"T1=(20.+273.);#condensation temperature in K\n",
"P1=57.27;\n",
"h3=144.11;\n",
"hg=299.62;\n",
"sf=0.523;\n",
"sg_20oc=1.0527;\n",
"Cpf=2.889;\n",
"Cpg=2.135;\n",
"print(\"at -10 degree celcius,P2=26.49 bar,vg=0.014 m^3/kg,hf=60.78 KJ/kg,hg=322.28 KJ/kg,sf=0.2381 KJ/kg K,sg=1.2324 KJ/kg K\")\n",
"T2=(-10+273);#evaporator temperature in K\n",
"P2=26.49;\n",
"vg=0.014;\n",
"hf=60.78;\n",
"h1=322.28;\n",
"sf=0.2381;\n",
"sg=1.2324;\n",
"print(\"processes of vapour compression cycle are shown on T-s diagram\")\n",
"print(\"1-2:isentropic compression process\")\n",
"print(\"2-3-4:condensation process\")\n",
"print(\"4-5:isenthalpic expansion process\")\n",
"print(\"5-1:refrigeration process in evaporator\")\n",
"print(\"h1=hg at -10oc=322.28 KJ/kg\")\n",
"print(\"at 20 degree celcius,h2=hg+Cpg*(40-20)in KJ/kg\")\n",
"h2=hg+Cpg*(40.-20.)\n",
"print(\"entropy at state 2,at 20 degree celcius,s2=sg_20oc+Cpg*log((273+40)/(273+20))in KJ/kg K\")\n",
"s2=sg_20oc+Cpg*math.log((273.+40.)/(273.+20.))\n",
"print(\"entropy during isentropic process,s1=s2\")\n",
"print(\"at -10 degree celcius,s2=sf+x1*sfg\")\n",
"print(\"so x1=(s2-sf)/(sg-sf)\")\n",
"x1=(s2-sf)/(sg-sf)\n",
"print(\"enthalpy at state 1,at -10 degree celcius,h1=hf+x1*hfg in KJ/kg\")\n",
"h1=hf+x1*(h1-hf)\n",
"print(\"h3=hf at 20oc=144.11 KJ/kg\")\n",
"print(\"since undercooling occurs upto 10oc,so,h4=h3-Cpf*deltaT in KJ/kg\")\n",
"h4=h3-Cpf*(20.-10.)\n",
"print(\"also,h4=h5=115.22 KJ/kg\")\n",
"h5=h4;\n",
"print(\"refrigeration effect per kg of refrigerant(q)=(h1-h5)in KJ/kg\")\n",
"q=(h1-h5)\n",
"print(\"let refrigerant flow rate be m kg/s\")\n",
"print(\"refrigerant effect(Q)=m*q\")\n",
"m=Q/q\n",
"print(\"m=Q/q in kg/s\"),round(m,5)\n",
"print(\"compressor work,Wc=h2-h1 in KJ/kg\")\n",
"Wc=h2-h1\n",
"COP=q/Wc\n",
"print(\"COP=refrigeration effect per kg/compressor work per kg=\"),round(COP,2)\n",
"print(\"so COP=6.51,mass flow rate=0.01016 kg/s\")\n",
"print(\"NOTE=>In book,mass flow rate(m) which is 0.1016 kg/s is calculated wrong and it is correctly solve above and comes out to be m=0.01016 kg/s. \")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.12;pg no: 448"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.12, Page:448 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 12\n",
"here pressure of atmospheric air(P)may be taken as 1.013 bar\n",
"specific humidity,omega=0.622*(Pv/(P-Pv))\n",
"so partial pressure of vapour(Pv)in bar\n",
"Pv in bar= 0.0254\n",
"relative humidity(phi)=(Pv/Pv_sat)\n",
"from pychrometric properties of air Pv_sat at 25 degree celcius=0.03098 bar\n",
"so phi=Pv/Pv_sat 0.82\n",
"in percentage 81.99\n",
"so partial pressure of vapour=0.0254 bar\n",
"relative humidity=81.98 %\n"
]
}
],
"source": [
"#cal of partial pressure of vapour and relative humidity\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.12, Page:448 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 12\")\n",
"omega=0.016;#specific humidity in gm/gm of air\n",
"print(\"here pressure of atmospheric air(P)may be taken as 1.013 bar\")\n",
"P=1.013;#pressure of atmospheric air in bar\n",
"print(\"specific humidity,omega=0.622*(Pv/(P-Pv))\")\n",
"print(\"so partial pressure of vapour(Pv)in bar\")\n",
"Pv=P/(1+(0.622/omega))\n",
"print(\"Pv in bar=\"),round(Pv,4)\n",
"Pv=0.0254;#approx.\n",
"print(\"relative humidity(phi)=(Pv/Pv_sat)\")\n",
"print(\"from pychrometric properties of air Pv_sat at 25 degree celcius=0.03098 bar\")\n",
"Pv_sat=0.03098;\n",
"phi=Pv/Pv_sat\n",
"print(\"so phi=Pv/Pv_sat\"),round(phi,2)\n",
"print(\"in percentage\"),round(phi*100,2)\n",
"print(\"so partial pressure of vapour=0.0254 bar\")\n",
"print(\"relative humidity=81.98 %\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.13;pg no: 449"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.13, Page:449 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 13\n",
"at 30 degree celcius from steam table,saturation pressure,Pv_sat=0.0425 bar\n",
"partial pressure of vapour(Pv)=relative humidity*Pv_sat in bar 0.03\n",
"partial pressure of air(Pa)=total pressure of mixture-partial pressure of vapour 0.99\n",
"so partial pressure of air=0.9875 bar\n",
"humidity ratio,omega in kg/kg of dry air= 0.01606\n",
"so humidity ratio=0.01606 kg/kg of air\n",
"Dew point temperature may be seen from the steam table.The saturation temperature corresponding to the partial pressure of vapour is 0.0255 bar.Dew point temperature can be approximated as 21.4oc by interpolation\n",
"so Dew point temperature=21.4 degree celcius\n",
"density of mixture(rho_m)=density of air(rho_a)+density of vapour(rho_v)\n",
"rho_m=(rho_a)+(rho_v)=rho_a*(1+omega)\n",
"rho_m in kg/m^3= 1.1836\n",
"so density = 1.1835 kg/m^3\n",
"enthalpy of mixture,h in KJ/kg of dry air= 71.21\n",
"enthalpy of mixture =71.2 KJ/kg of dry air\n"
]
}
],
"source": [
"#cal of partial pressure,humidity ratio,Dew point temperature,density and enthalpy of mixture\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.13, Page:449 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 13\")\n",
"r=0.6;#relative humidity\n",
"P=1.013;#total pressure of mixture in bar\n",
"R=0.287;#gas constant in KJ/kg K\n",
"Ta=(30+273);#room temperature in K\n",
"Cp=1.005;#specific heat at constant pressure in KJ/kg degree celcius\n",
"print(\"at 30 degree celcius from steam table,saturation pressure,Pv_sat=0.0425 bar\")\n",
"Pv_sat=0.0425;\n",
"Pv=r*Pv_sat\n",
"print(\"partial pressure of vapour(Pv)=relative humidity*Pv_sat in bar\"),round(Pv,2)\n",
"Pa=P-Pv\n",
"print(\"partial pressure of air(Pa)=total pressure of mixture-partial pressure of vapour\"),round(Pa,2)\n",
"print(\"so partial pressure of air=0.9875 bar\")\n",
"omega=0.622*Pv/(P-Pv)\n",
"print(\"humidity ratio,omega in kg/kg of dry air=\"),round(omega,5)\n",
"print(\"so humidity ratio=0.01606 kg/kg of air\")\n",
"print(\"Dew point temperature may be seen from the steam table.The saturation temperature corresponding to the partial pressure of vapour is 0.0255 bar.Dew point temperature can be approximated as 21.4oc by interpolation\")\n",
"print(\"so Dew point temperature=21.4 degree celcius\")\n",
"print(\"density of mixture(rho_m)=density of air(rho_a)+density of vapour(rho_v)\")\n",
"print(\"rho_m=(rho_a)+(rho_v)=rho_a*(1+omega)\")\n",
"rho_m=P*100*(1+omega)/(R*Ta)\n",
"print(\"rho_m in kg/m^3=\"),round(rho_m,4)\n",
"print(\"so density = 1.1835 kg/m^3\")\n",
"T=30;#room temperature in degree celcius\n",
"hg=2540.1;#enthalpy at 30 degree celcius in KJ/kg\n",
"h=Cp*T+omega*(hg+1.860*(30-21.4))\n",
"print(\"enthalpy of mixture,h in KJ/kg of dry air=\"),round(h,2)\n",
"print(\"enthalpy of mixture =71.2 KJ/kg of dry air\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.14;pg no: 449"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.14, Page:449 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 14\n",
"initial state at 15 degree celcius and 80% relative humidity is shown by point 1 and final state at 25 degree celcius and 50% relative humidity is shown by point 2 on psychrometric chart.\n",
"omega1=0.0086 kg/kg of air,h1=37 KJ/kg,omega2=0.01 kg/kg of air,h2=50 KJ/kg,v2=0.854 m^3/kg\n",
"mass of water added between states 1 and 2 omega2-omega1 in kg/kg of air\n",
"mass flow rate of air(ma)=0.8/v2 in kg/s\n",
"total mass of water added=ma*(omega2-omega1)in kg/s 0.001311\n",
"heat transferred in KJ/s= 12.18\n",
"so mass of water added=0.001312 kg/s,heat transferred=12.18 KW\n"
]
}
],
"source": [
"#cal of mass of water added and heat transferred\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.14, Page:449 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 14\")\n",
"print(\"initial state at 15 degree celcius and 80% relative humidity is shown by point 1 and final state at 25 degree celcius and 50% relative humidity is shown by point 2 on psychrometric chart.\")\n",
"print(\"omega1=0.0086 kg/kg of air,h1=37 KJ/kg,omega2=0.01 kg/kg of air,h2=50 KJ/kg,v2=0.854 m^3/kg\")\n",
"omega1=0.0086;\n",
"h1=37.;\n",
"omega2=0.01;\n",
"h2=50.;\n",
"v2=0.854;\n",
"print(\"mass of water added between states 1 and 2 omega2-omega1 in kg/kg of air\")\n",
"omega2-omega1\n",
"print(\"mass flow rate of air(ma)=0.8/v2 in kg/s\")\n",
"ma=0.8/v2\n",
"print(\"total mass of water added=ma*(omega2-omega1)in kg/s\"),round(ma*(omega2-omega1),6)\n",
"print(\"heat transferred in KJ/s=\"),round(ma*(h2-h1),2)\n",
"print(\"so mass of water added=0.001312 kg/s,heat transferred=12.18 KW\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.15;pg no: 451"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.15, Page:451 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 15\n",
"Let temperature after mixing be Toc.For getting final enthalpy after adiabatic mixing the enthalpy of two streams are required.\n",
"For moist air stream at 30 degree celcius and 30% relative humidity.\n",
"phi1=Pv1/Pv_sat_30oc\n",
"here Pv_sat_30oc=0.04246 bar\n",
"so Pv1=phi1*Pv_sat_30oc in bar\n",
"corresponding to vapour pressure of 0.01274 bar the dew point temperature shall be 10.5 degree celcius\n",
"specific humidity,omega1 in kg/kg of air= 0.00792\n",
"at dew point temperature of 10.5 degree celcius,enthalpy,hg at 10.5oc=2520.7 KJ/kg\n",
"h1=Cp_air*T1+omega1*{hg-Cp_stream*(T1-Tdp1)}in KJ/kg of dry air\n",
"for second moist air stream at 35oc and 85% relative humidity\n",
"phi2=Pv2/Pv_sat_35oc\n",
"here Pv_sat_35oc=0.005628 bar\n",
"so Pv2=phi2*Pv_sat_35oc in bar\n",
"specific humidity,omega2 in kg/kg of air= 0.00295\n",
"corresponding to vapour pressure of 0.004784 bar the dew point temperature is 32 degree celcius\n",
"so,enthalpy of second stream,\n",
"h2=Cp_air*T2+omega2*{hg+Cp_stream*(T2-Tdp2)}in KJ/kg of dry air\n",
"enthalpy of mixture after adiabatic mixing,\n",
"=(1/(m1+m2))*((h1*m1/(1+omega1))+(h2*m2/(1+omega2))) in KJ/kg of moist air\n",
"mass of vapour per kg of moist air=(1/5)*((omega1*m1/(1+omega1))+(omega2*m2/(1+omega2)))in kg/kg of moist air\n",
"specific humidity of mixture(omega)in kg/kg of dry air= 0.00592\n",
"omega=0.622*Pv/(P-Pv)\n",
"Pv in bar= 0.00956\n",
"partial pressure of water vapour=0.00957 bar\n",
"so specific humidity of mixture=0.00593 kg/kg dry air\n",
"and partial pressure of water vapour in mixture=0.00957 bar\n"
]
}
],
"source": [
"#cal of specific humidity and partial pressure of water vapour in mixture\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.15, Page:451 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 15\")\n",
"P=1.013;#atmospheric pressure in bar\n",
"Cp_air=1.005;#specific heat of air at constant pressure in KJ/kg K\n",
"Cp_stream=1.86;#specific heat of stream at constant pressure in KJ/kg K\n",
"T1=30.;#temperature of first stream of moist air in K\n",
"m1=3.;#mass flow rate of first stream in kg/s \n",
"T2=35.;#temperature of second stream of moist air in K\n",
"m2=2.;#mass flow rate of second stream in kg/s \n",
"print(\"Let temperature after mixing be Toc.For getting final enthalpy after adiabatic mixing the enthalpy of two streams are required.\")\n",
"print(\"For moist air stream at 30 degree celcius and 30% relative humidity.\")\n",
"phi1=0.3;\n",
"print(\"phi1=Pv1/Pv_sat_30oc\")\n",
"print(\"here Pv_sat_30oc=0.04246 bar\")\n",
"Pv_sat_30oc=0.04246;\n",
"print(\"so Pv1=phi1*Pv_sat_30oc in bar\")\n",
"Pv1=phi1*Pv_sat_30oc\n",
"print(\"corresponding to vapour pressure of 0.01274 bar the dew point temperature shall be 10.5 degree celcius\")\n",
"Tdp1=10.5;\n",
"omega1=0.622*Pv1/(P-Pv1)\n",
"print(\"specific humidity,omega1 in kg/kg of air=\"),round(omega1,5)\n",
"print(\"at dew point temperature of 10.5 degree celcius,enthalpy,hg at 10.5oc=2520.7 KJ/kg\")\n",
"hg=2520.7;#enthalpy at 10.5 degree celcius in KJ/kg\n",
"print(\"h1=Cp_air*T1+omega1*{hg-Cp_stream*(T1-Tdp1)}in KJ/kg of dry air\")\n",
"h1=Cp_air*T1+omega1*(hg-Cp_stream*(T1-Tdp1))\n",
"print(\"for second moist air stream at 35oc and 85% relative humidity\")\n",
"phi2=0.85;\n",
"print(\"phi2=Pv2/Pv_sat_35oc\")\n",
"print(\"here Pv_sat_35oc=0.005628 bar\")\n",
"Pv_sat_35oc=0.005628;\n",
"print(\"so Pv2=phi2*Pv_sat_35oc in bar\")\n",
"Pv2=phi2*Pv_sat_35oc\n",
"omega2=0.622*Pv2/(P-Pv2)\n",
"print(\"specific humidity,omega2 in kg/kg of air=\"),round(omega2,5)\n",
"print(\"corresponding to vapour pressure of 0.004784 bar the dew point temperature is 32 degree celcius\")\n",
"Tdp2=32.;\n",
"print(\"so,enthalpy of second stream,\")\n",
"print(\"h2=Cp_air*T2+omega2*{hg+Cp_stream*(T2-Tdp2)}in KJ/kg of dry air\")\n",
"hg=2559.9;#enthalpy at 32 degree celcius in KJ/kg\n",
"h2=Cp_air*T2+omega2*(hg+Cp_stream*(T2-Tdp2))\n",
"print(\"enthalpy of mixture after adiabatic mixing,\")\n",
"print(\"=(1/(m1+m2))*((h1*m1/(1+omega1))+(h2*m2/(1+omega2))) in KJ/kg of moist air\")\n",
"(1./(m1+m2))*((h1*m1/(1+omega1))+(h2*m2/(1+omega2)))\n",
"print(\"mass of vapour per kg of moist air=(1/5)*((omega1*m1/(1+omega1))+(omega2*m2/(1+omega2)))in kg/kg of moist air\")\n",
"(1./5.)*((omega1*m1/(1+omega1))+(omega2*m2/(1+omega2)))\n",
"omega=0.00589/(1-0.005893)\n",
"print(\"specific humidity of mixture(omega)in kg/kg of dry air=\"),round(omega,5)\n",
"print(\"omega=0.622*Pv/(P-Pv)\")\n",
"Pv=omega*P/(omega+0.622)\n",
"print(\"Pv in bar=\"),round(Pv,5)\n",
"print(\"partial pressure of water vapour=0.00957 bar\")\n",
"print(\"so specific humidity of mixture=0.00593 kg/kg dry air\")\n",
"print(\"and partial pressure of water vapour in mixture=0.00957 bar\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 11.16;pg no: 452"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 11.16, Page:452 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 16\n",
"The type of heating involved is sensible heating.Locating satte 1 on psychrometric chart corresponding to 15 degree celcius dbt and 80% relative humidity the other property values shall be,\n",
"h1=36.4 KJ/kg,omega1=0.0086 kg/kg of air,v1=0.825 m^3/kg\n",
"final state 2 has,h2=52 KJ/kg\n",
"mass of air(m)=m1/v1 in kg/s\n",
"amount of heat added(Q)in KJ/s\n",
"Q=m*(h2-h1) 56.78\n"
]
}
],
"source": [
"#cal of amount of heat added\n",
"#intiation of all variables\n",
"# Chapter 11\n",
"import math\n",
"print\"Example 11.16, Page:452 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 11 Example 16\")\n",
"m1=3;#rate at which moist air enter in heating coil in m^3/s\n",
"print(\"The type of heating involved is sensible heating.Locating satte 1 on psychrometric chart corresponding to 15 degree celcius dbt and 80% relative humidity the other property values shall be,\")\n",
"print(\"h1=36.4 KJ/kg,omega1=0.0086 kg/kg of air,v1=0.825 m^3/kg\")\n",
"h1=36.4;\n",
"omega1=0.0086;\n",
"v1=0.825;\n",
"print(\"final state 2 has,h2=52 KJ/kg\")\n",
"h2=52;\n",
"print(\"mass of air(m)=m1/v1 in kg/s\")\n",
"m=m1/v1\n",
"m=3.64;#approx.\n",
"print(\"amount of heat added(Q)in KJ/s\")\n",
"Q=m*(h2-h1)\n",
"print(\"Q=m*(h2-h1)\"),round(Q,2)"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I1uv33,Engineering Thermodynamics/chapter12_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 12:Introduction to Heat Transfer"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.1;pg no: 483"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.1, Page:483 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 1\n",
"here for one dimentional heat transfer across the wall the heat transfer circuit shall comprises of thermal resistance due to convection between air & brick(R1),conduction in brick wall(R2),conduction in wood(R3),and convection between wood and air(R4).Let temperature at outer brick wall be T2 K,brick-wood interface be T3 K,outer wood wall be T4 K\n",
"overall heat transfer coefficient for steady state heat transfer(U)in W/m^2 K\n",
"(1/U)=(1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5)\n",
"so U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\n",
"rate of heat transfer,Q in W= 10590.0\n",
"so rate of heat transfer=10590 W\n",
"heat transfer across states 1 and 3(at interface).\n",
"overall heat transfer coefficient between 1 and 3\n",
"(1/U1)=(1/h1)+(deltax_brick/k_brick)\n",
"so U1=1/((1/h1)+(deltax_brick/k_brick))in W/m^2 K\n",
"Q=U1*A*(T1-T3)\n",
"so T3=T1-(Q/(U1*A))in degree celcius 44.7\n",
"so temperature at interface of brick and wood =44.71 degree celcius\n"
]
}
],
"source": [
"#cal of rate of heat transfer and temperature at interface of brick and wood\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.1, Page:483 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 1\")\n",
"h1=30.;#heat transfer coefficient on side of 50 oc in W/m^2 K\n",
"h5=10.;#heat transfer coefficient on side of 20 oc in W/m^2 K\n",
"k_brick=0.9;#conductivity of brick in W/m K\n",
"k_wood=0.15;#conductivity of wood in W/m K\n",
"T1=50.;#temperature of air on one side of wall in degree celcius\n",
"T5=20.;#temperature of air on other side of wall in degree celcius\n",
"A=100.;#surface area in m^2\n",
"deltax_brick=1.5*10**-2;#length of brick in m\n",
"deltax_wood=2*10**-2;#length of wood in m\n",
"print(\"here for one dimentional heat transfer across the wall the heat transfer circuit shall comprises of thermal resistance due to convection between air & brick(R1),conduction in brick wall(R2),conduction in wood(R3),and convection between wood and air(R4).Let temperature at outer brick wall be T2 K,brick-wood interface be T3 K,outer wood wall be T4 K\")\n",
"print(\"overall heat transfer coefficient for steady state heat transfer(U)in W/m^2 K\")\n",
"print(\"(1/U)=(1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5)\")\n",
"print(\"so U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\")\n",
"U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\n",
"U=3.53;#approx.\n",
"Q=U*A*(T1-T5)\n",
"print(\"rate of heat transfer,Q in W=\"),round(Q,2)\n",
"print(\"so rate of heat transfer=10590 W\")\n",
"print(\"heat transfer across states 1 and 3(at interface).\")\n",
"print(\"overall heat transfer coefficient between 1 and 3\")\n",
"print(\"(1/U1)=(1/h1)+(deltax_brick/k_brick)\")\n",
"print(\"so U1=1/((1/h1)+(deltax_brick/k_brick))in W/m^2 K\")\n",
"U1=1/((1/h1)+(deltax_brick/k_brick))\n",
"print(\"Q=U1*A*(T1-T3)\")\n",
"T3=T1-(Q/(U1*A))\n",
"print(\"so T3=T1-(Q/(U1*A))in degree celcius\"),round(T3,2)\n",
"print(\"so temperature at interface of brick and wood =44.71 degree celcius\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.2;pg no: 484"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.2, Page:484 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 2\n",
"here thermal resistances are\n",
"R1=thermal resistance due to convection between kitchen air and outer surface of refrigerator wall(T1 & T2)\n",
"R2=thermal resistance due to conduction across mild steel wall between 2 & 3(T2 & T3)\n",
"R3=thermal resistance due to conduction across glass wool between 3 & 4(T3 & T4)\n",
"R4=thermal resistance due to conduction across mild steel wall between 4 & 5(T4 & T5)\n",
"R5=thermal resistance due to convection between inside refrigerator wall and inside of refrigerator between 5 & 6(T5 & T6)\n",
"overall heat transfer coefficient for one dimentional steady state heat transfer\n",
"(1/U)=(1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6)\n",
"so U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))in KJ/m^2hr oc\n",
"rate of heat transfer(Q) in KJ/m^2 hr= 112.0\n",
"wall surface area(A) in m^2\n",
"so rate of heat transfer=112 KJ/m^2 hr \n",
"Q=A*h1*(T1-T2)=k_steel*A*(T2-T3)/deltax_steel=k_wool*A*(T3-T4)/deltax_wool\n",
"Q=k_steel*A*(T4-T5)/deltax_steel=A*h6*(T5-T6)\n",
"substituting,T2 in degree celcius= 23.6\n",
"so temperature of outer wall,T2=23.6 oc\n",
"T3 in degree= 23.6\n",
"so temperature at interface of outer steel wall and wool,T3=23.59 oc\n",
"T4 in degree celcius= 6.1\n",
"so temperature at interface of wool and inside steel wall,T4=6.09 oc\n",
"T5 in degree celcius= 6.1\n",
"so temperature at inside of inner steel wall,T5=6.08 oc\n"
]
}
],
"source": [
"#cal of rate of heat transfer,temperatures\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.2, Page:484 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 2\")\n",
"h1=40;#average heat transfer coefficient at inner surface in KJ/m^2 hr oc\n",
"h6=50;#average heat transfer coefficient at outer surface in KJ/m^2 hr oc\n",
"deltax_steel=2*10**-3;#mild steel sheets thickness in m\n",
"deltax_wool=5*10**-2;#thickness of glass wool insulation in m\n",
"k_wool=0.16;#thermal conductivity of wool in KJ/m hr\n",
"k_steel=160;#thermal conductivity of steel in KJ/m hr\n",
"T1=25;#kitchen temperature in degree celcius\n",
"T6=5;#refrigerator temperature in degree celcius\n",
"print(\"here thermal resistances are\")\n",
"print(\"R1=thermal resistance due to convection between kitchen air and outer surface of refrigerator wall(T1 & T2)\")\n",
"print(\"R2=thermal resistance due to conduction across mild steel wall between 2 & 3(T2 & T3)\")\n",
"print(\"R3=thermal resistance due to conduction across glass wool between 3 & 4(T3 & T4)\")\n",
"print(\"R4=thermal resistance due to conduction across mild steel wall between 4 & 5(T4 & T5)\")\n",
"print(\"R5=thermal resistance due to convection between inside refrigerator wall and inside of refrigerator between 5 & 6(T5 & T6)\")\n",
"print(\"overall heat transfer coefficient for one dimentional steady state heat transfer\")\n",
"print(\"(1/U)=(1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6)\")\n",
"print(\"so U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))in KJ/m^2hr oc\")\n",
"U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))\n",
"U=2.8;#approx.\n",
"A=4*(1*0.5)\n",
"Q=U*A*(T1-T6)\n",
"print(\"rate of heat transfer(Q) in KJ/m^2 hr=\"),round(Q,2)\n",
"print(\"wall surface area(A) in m^2\")\n",
"print(\"so rate of heat transfer=112 KJ/m^2 hr \")\n",
"print(\"Q=A*h1*(T1-T2)=k_steel*A*(T2-T3)/deltax_steel=k_wool*A*(T3-T4)/deltax_wool\")\n",
"print(\"Q=k_steel*A*(T4-T5)/deltax_steel=A*h6*(T5-T6)\")\n",
"T2=T1-(Q/(A*h1))\n",
"print(\"substituting,T2 in degree celcius=\"),round(T2,1)\n",
"print(\"so temperature of outer wall,T2=23.6 oc\")\n",
"T3=T2-(Q*deltax_steel/(k_steel*A))\n",
"print(\"T3 in degree= \"),round(T3,2)\n",
"print(\"so temperature at interface of outer steel wall and wool,T3=23.59 oc\")\n",
"T4=T3-(Q*deltax_wool/(k_wool*A))\n",
"print(\"T4 in degree celcius=\"),round(T4,2)\n",
"print(\"so temperature at interface of wool and inside steel wall,T4=6.09 oc\")\n",
"T5=T4-(Q*deltax_steel/(k_steel*A))\n",
"print(\"T5 in degree celcius=\"),round(T5,2)\n",
"print(\"so temperature at inside of inner steel wall,T5=6.08 oc\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.3;pg no: 486"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.3, Page:486 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 3\n",
"here,heat conduction is considered in pipe wall from 1 to 2 and conduction through insulation between 2 and 3 of one dimentional steady state type.\n",
"Q=(T1-T3)*2*%pi*L/((1/k_pipe)*log(r2/r1)+(1/k_insulation*log(r3/r2)))in KJ/hr\n",
"so heat loss per meter from pipe in KJ/hr= 1479.77\n",
"heat loss from 5 m length(Q) in KJ/hr 7396.7\n",
"enthalpy of saturated steam at 300 oc,h_sat=2749 KJ/kg=hg from steam table\n",
"mass flow of steam(m)in kg/hr\n",
"final enthalpy of steam per kg at exit of 5 m pipe(h)in KJ/kg\n",
"let quality of steam at exit be x,\n",
"also at 300oc,hf=1344 KJ/kg,hfg=1404.9 KJ/kg from steam table\n",
"h=hf+x*hfg\n",
"so x=(h-hf)/hfg 0.8245\n",
"so quality of steam at exit=0.8245\n"
]
}
],
"source": [
"#cal of heat loss per meter from pipe and quality of steam\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.3, Page:486 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 3\")\n",
"k_insulation=0.3;#thermal conductivity of insulation in KJ/m hr oc\n",
"k_pipe=209;#thermal conductivity of pipe in KJ/m hr oc\n",
"T1=300;#temperature of inner surface of steam pipe in degree celcius\n",
"T3=50;#temperature of outer surface of insulation layer in degree celcius\n",
"r1=15*10**-2/2;#steam pipe inner radius without insulation in m\n",
"r2=16*10**-2/2;#steam pipe outer radius without insulation in m\n",
"r3=22*10**-2/2;#radius with insulation in m\n",
"m=0.5;#steam entering rate in kg/min\n",
"print(\"here,heat conduction is considered in pipe wall from 1 to 2 and conduction through insulation between 2 and 3 of one dimentional steady state type.\")\n",
"print(\"Q=(T1-T3)*2*%pi*L/((1/k_pipe)*log(r2/r1)+(1/k_insulation*log(r3/r2)))in KJ/hr\")\n",
"L=1;\n",
"Q=(T1-T3)*2*math.pi*L/((1/k_pipe)*math.log(r2/r1)+(1/k_insulation*math.log(r3/r2)))\n",
"print(\"so heat loss per meter from pipe in KJ/hr=\"),round(Q,2)\n",
"Q=5*Q\n",
"print(\"heat loss from 5 m length(Q) in KJ/hr\"),round(5*1479.34,2)\n",
"print(\"enthalpy of saturated steam at 300 oc,h_sat=2749 KJ/kg=hg from steam table\")\n",
"hg=2749;\n",
"print(\"mass flow of steam(m)in kg/hr\")\n",
"m=m*60\n",
"print(\"final enthalpy of steam per kg at exit of 5 m pipe(h)in KJ/kg\")\n",
"h=hg-(Q/m)\n",
"print(\"let quality of steam at exit be x,\")\n",
"print(\"also at 300oc,hf=1344 KJ/kg,hfg=1404.9 KJ/kg from steam table\")\n",
"hf=1344;\n",
"hfg=1404.9;\n",
"print(\"h=hf+x*hfg\")\n",
"x=(h-hf)/hfg\n",
"print(\"so x=(h-hf)/hfg\"),round(x,4)\n",
"print(\"so quality of steam at exit=0.8245\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.4;pg no: 487"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.4, Page:487 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 4\n",
"considering one dimensional heat transfer of steady state type\n",
"for sphere(Q)=(T1-T2)*4*%pi*k*r1*r2/(r2-r1) in KJ/hr 168892.02\n",
"so heat transfer rate=168892.02 KJ/hr\n",
"heat flux in KJ/m^2 hr= 23893.33\n",
"so heat flux=23893.33 KJ/m^2 hr\n"
]
}
],
"source": [
"#cal of amount of heat transfer and heat flux\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.4, Page:487 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 4\")\n",
"r1=150.*10**-2/2;#inner radius in m\n",
"r2=200.*10**-2/2;#outer radius in m\n",
"k=28.;#thermal conductivity in KJ m hr oc\n",
"T1=200.;#inside surface temperature in degree celcius\n",
"T2=40.;#outer surface temperature in degree celcius\n",
"print(\"considering one dimensional heat transfer of steady state type\")\n",
"Q=(T1-T2)*4*math.pi*k*r1*r2/(r2-r1)\n",
"print(\"for sphere(Q)=(T1-T2)*4*%pi*k*r1*r2/(r2-r1) in KJ/hr\"),round(Q,2)\n",
"print(\"so heat transfer rate=168892.02 KJ/hr\")\n",
"Q/(4*math.pi*r1**2)\n",
"print(\"heat flux in KJ/m^2 hr=\"),round(Q/(4*math.pi*r1**2),2)\n",
"print(\"so heat flux=23893.33 KJ/m^2 hr\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.5;pg no: 487"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.5, Page:487 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 5\n",
"R1=thermal resistance for convection heat transfer between inside room (1)and inside surface of glass window(2)=1/(h1*A)\n",
"R2=thermal resistance for conduction through glass between inside of glass window(2)to outside surface of glass window(3)=deltax/(k*A)\n",
"R3=thermal resistance for convection heat transfer between outside surface of glass window(3)to outside atmosphere(4)=1/(h4*A)\n",
"total thermal resistance,R_total=R1+R2+R3 in oc/W\n",
"so rate of heat transfer,Q=(T1-T4)/R_total in W 118.03\n",
"heat transfer rate from inside of room to inside surface of glass window.\n",
"Q=(T1-T2)/R1\n",
"so T2=T1-Q*R1 in degree celcius 9.26\n",
"Thus,inside surface of glass window will be at temperature of 9.26 oc where as room inside temperature is 25 oc\n"
]
}
],
"source": [
"#cal of heat transfer rate\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.5, Page:487 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 5\")\n",
"T1=25.;#room temperature in degree celcius\n",
"T4=2.;#winter outside temperature in degree celcius\n",
"h1=10.;#heat transfer coefficient on inner window surfaces in W/m^2 oc\n",
"h4=30.;#heat transfer coefficient on outer window surfaces in W/m^2 oc\n",
"k=0.78;#thermal conductivity of glass in W/m^2 oc\n",
"A=75.*10**-2*100.*10**-2;#area in m^2\n",
"deltax=10.*10**-3;#glass thickness in m\n",
"print(\"R1=thermal resistance for convection heat transfer between inside room (1)and inside surface of glass window(2)=1/(h1*A)\")\n",
"print(\"R2=thermal resistance for conduction through glass between inside of glass window(2)to outside surface of glass window(3)=deltax/(k*A)\")\n",
"print(\"R3=thermal resistance for convection heat transfer between outside surface of glass window(3)to outside atmosphere(4)=1/(h4*A)\")\n",
"print(\"total thermal resistance,R_total=R1+R2+R3 in oc/W\")\n",
"R_total=1/(h1*A)+deltax/(k*A)+1/(h4*A)\n",
"Q=(T1-T4)/R_total\n",
"print(\"so rate of heat transfer,Q=(T1-T4)/R_total in W\"),round(Q,2)\n",
"print(\"heat transfer rate from inside of room to inside surface of glass window.\")\n",
"R1=(1/7.5);\n",
"T2=T1-Q*R1\n",
"print(\"Q=(T1-T2)/R1\")\n",
"print(\"so T2=T1-Q*R1 in degree celcius\"),round(T2,2)\n",
"print(\"Thus,inside surface of glass window will be at temperature of 9.26 oc where as room inside temperature is 25 oc\") \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.6;pg no: 488"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.6, Page:488 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 6\n",
"reynolds number,Re=V*D/v\n",
"subsituting in Nu=0.023*(Re)^0.8*(Pr)^0.4\n",
"or (h*D/k)=0.023*(Re)^0.8*(Pr)^0.4\n",
"so h=(k/D)*0.023*(Re)^0.8*(Pr)^0.4 in W/m^2 K\n",
"rate of heat transfer due to convection,Q in W \n",
"Q=h*A*(T2-T1)= 61259.36\n",
"so heat transfer rate=61259.38 W\n"
]
}
],
"source": [
"#cal of heat transfer rate\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.6, Page:488 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 6\")\n",
"D=4*10**-2;#inner diameter in m\n",
"L=3;#length in m\n",
"V=1;#velocity of water in m/s\n",
"T1=40;#mean temperature in degree celcius\n",
"T2=75;#pipe wall temperature in degree celcius \n",
"k=0.6;#conductivity of water in W/m\n",
"Pr=3;#prandtl no.\n",
"v=0.478*10**-6;#viscocity in m^2/s\n",
"print(\"reynolds number,Re=V*D/v\")\n",
"Re=V*D/v\n",
"print(\"subsituting in Nu=0.023*(Re)^0.8*(Pr)^0.4\")\n",
"print(\"or (h*D/k)=0.023*(Re)^0.8*(Pr)^0.4\")\n",
"print(\"so h=(k/D)*0.023*(Re)^0.8*(Pr)^0.4 in W/m^2 K\")\n",
"h=(k/D)*0.023*(Re)**0.8*(Pr)**0.4 \n",
"print(\"rate of heat transfer due to convection,Q in W \") \n",
"Q=h*(math.pi*D*L)*(T2-T1)\n",
"print(\"Q=h*A*(T2-T1)=\"),round(Q,2)\n",
"print(\"so heat transfer rate=61259.38 W\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.7;pg no: 489"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.7, Page:489 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 7\n",
"Let the temperature of water at exit be T\n",
"Heat exchanger,Q=heat rejected by glasses=heat gained by water\n",
"Q=m*Cg*(T1-T2)=mw*Cw*(T-T3)\n",
"so T=T3+(m*Cg*(T1-T2)/(mw*Cw))in degree celcius\n",
"and Q in KJ\n",
"deltaT_in=T1-T3 in degree celcius\n",
"deltaT_out=T2-T in degree celcius\n",
"for parallel flow heat exchanger,\n",
"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree celcius\n",
"also,Q=U*A*LMTD\n",
"so A=Q/(U*LMTD) in m^2 5.937\n",
"surface area,A=5.936 m^2\n"
]
}
],
"source": [
"#cal of surface area\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.7, Page:489 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 7\")\n",
"m=0.5;#hot gases flowing rate in kg/s\n",
"T1=500;#initial temperature of gas in degree celcius\n",
"T2=150;#final temperature of gas in degree celcius\n",
"Cg=1.2;#specific heat of gas in KJ/kg K\n",
"Cw=4.18;#specific heat of water in KJ/kg K\n",
"U=150;#overall heat transfer coefficient in W/m^2 K\n",
"mw=1;#mass of water in kg/s\n",
"T3=10;#water entering temperature in degree celcius\n",
"print(\"Let the temperature of water at exit be T\")\n",
"print(\"Heat exchanger,Q=heat rejected by glasses=heat gained by water\")\n",
"print(\"Q=m*Cg*(T1-T2)=mw*Cw*(T-T3)\")\n",
"print(\"so T=T3+(m*Cg*(T1-T2)/(mw*Cw))in degree celcius\")\n",
"T=T3+(m*Cg*(T1-T2)/(mw*Cw))\n",
"print(\"and Q in KJ\")\n",
"Q=m*Cg*(T1-T2)\n",
"print(\"deltaT_in=T1-T3 in degree celcius\")\n",
"deltaT_in=T1-T3\n",
"print(\"deltaT_out=T2-T in degree celcius\")\n",
"deltaT_out=T2-T\n",
"print(\"for parallel flow heat exchanger,\")\n",
"print(\"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree celcius\")\n",
"LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)\n",
"print(\"also,Q=U*A*LMTD\")\n",
"A=Q*10**3/(U*LMTD)\n",
"print(\"so A=Q/(U*LMTD) in m^2\"),round(A,3)\n",
"print(\"surface area,A=5.936 m^2\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.8;pg no: 490"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.8, Page:490 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 8\n",
"This oil cooler has arrangement similar to a counter flow heat exchanger.\n",
"by heat exchanger,Q=U*A*LMTD=mc*Cpc*(Tc_out-Th_in)=mh*Cph*(Tc_in-Th_out)\n",
"so Q in KJ/min\n",
"and T=Th_out+(Q/(mh*Cph))in degree celcius\n",
"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree \n",
"here deltaT_in=Tc_out-T in degree celcius\n",
"deltaT_out=Th_in-Th_out in degree celcius\n",
"so LMTD in degree celcius\n",
"substituting in,Q=U*A*LMTD\n",
"A=(Q*10^3/60)/(U*LMTD)in m^2 132.81\n",
"so surface area=132.85 m^2\n"
]
}
],
"source": [
"#cal of surface area\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.8, Page:490 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 8\")\n",
"mc=20;#mass of oil in kg/min \n",
"Tc_out=100;#initial temperature of oil in degree celcius\n",
"Th_in=30;#final temperature of oil in degree celcius\n",
"Th_out=25;#temperature of water in degree celcius\n",
"Cpc=2;#specific heat of oil in KJ/kg K\n",
"Cph=4.18;#specific heat of water in KJ/kg K\n",
"mh=15;#water flow rate in kg/min\n",
"U=25;#overall heat transfer coefficient in W/m^2 K\n",
"print(\"This oil cooler has arrangement similar to a counter flow heat exchanger.\")\n",
"print(\"by heat exchanger,Q=U*A*LMTD=mc*Cpc*(Tc_out-Th_in)=mh*Cph*(Tc_in-Th_out)\")\n",
"print(\"so Q in KJ/min\")\n",
"Q=mc*Cpc*(Tc_out-Th_in)\n",
"print(\"and T=Th_out+(Q/(mh*Cph))in degree celcius\")\n",
"T=Th_out+(Q/(mh*Cph))\n",
"print(\"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree \")\n",
"print(\"here deltaT_in=Tc_out-T in degree celcius\")\n",
"deltaT_in=Tc_out-T\n",
"print(\"deltaT_out=Th_in-Th_out in degree celcius\")\n",
"deltaT_out=Th_in-Th_out\n",
"print(\"so LMTD in degree celcius\")\n",
"LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)\n",
"print(\"substituting in,Q=U*A*LMTD\")\n",
"A=(Q*10**3/60)/(U*LMTD)\n",
"print(\"A=(Q*10^3/60)/(U*LMTD)in m^2\"),round(A,2)\n",
"print(\"so surface area=132.85 m^2\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.9;pg no: 490"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.9, Page:490 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 9\n",
"rate of heat loss by radiation(Q)=wpsilon*sigma*A*(T1^4-T2^4)\n",
"heat loss per unit area by radiation(Q)in W\n",
"Q= 93597.71\n"
]
}
],
"source": [
"#cal of heat loss per unit area by radiation\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.9, Page:490 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 9\")\n",
"T1=(1200+273);#temperature of body in K\n",
"T2=(600+273);#temperature of black surrounding in K\n",
"epsilon=0.4;#emissivity of body at 1200 degree celcius\n",
"sigma=5.67*10**-8;#stephen boltzman constant in W/m^2 K^4\n",
"print(\"rate of heat loss by radiation(Q)=wpsilon*sigma*A*(T1^4-T2^4)\")\n",
"print(\"heat loss per unit area by radiation(Q)in W\")\n",
"Q=epsilon*sigma*(T1**4-T2**4)\n",
"print(\"Q=\"),round(Q,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.10;pg no: 491"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.10, Page:491 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 10\n",
"Let us carry out one dimentional analysis for steady state.Due to flow of electricity the heat generated can be given as:\n",
"Q=V*I in W\n",
"For steady state which means there should be no change in temperature of cable due to electricity flow,the heat generated should be transferred out to surroundings.Therefore,heat transfer across table should be 80 W\n",
"surface area for heat transfer,A2=2*%pi*r*L in m^2\n",
"R1=thermal resistance due to convection between surroundings and cable outer surface,(1-2)=1/(h1*A2)\n",
"R2=thermal resistance due to conduction across plastic insulation(2-3)=log(r2/r3)/(2*%pi*k*L)\n",
"Total resistance,R_total=R1+R2 in oc/W\n",
"Q=(T3-T1)/R_total\n",
"so T3 in degree celcius= 98.28\n",
"so temperature at interface=125.12 degree celcius\n",
"critical radius of insulation,rc in m= 0.01\n",
"rc in mm 10.67\n",
"This rc is more than outer radius of cable so the increase in thickness of insulation upon rc=110.66 mmwould increase rate of heat transfer.Doubling insulation thickness means new outer radius would be r1=1.5+5=6.5 mm.Hence doubling(increase) of insulation thickness would increase heat transfer and thus temperature at interface would decrease if other parameters reamins constant.\n",
"NOTE=>In this question value of R_total is calculated wrong in book,hence it is correctly solve above,so the values of R_total and T3 may vary.\n"
]
}
],
"source": [
"#cal of temperature at interface\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.10, Page:491 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 10\")\n",
"V=16.;#voltage drop in V\n",
"I=5.;#current in cable in A\n",
"r2=8.*10.**-3/2.;#outer cable radius in m\n",
"r3=3.*10.**-3/2.;#copper wire radius in m\n",
"k=0.16;#thermal conductivity of copper wire in W/m oc\n",
"L=5.;#length of cable in m\n",
"h1=15.;#heat transfer coefficient of cable in W/m^2 oc\n",
"T1=40.;#temperature of surrounding in degree celcius\n",
"print(\"Let us carry out one dimentional analysis for steady state.Due to flow of electricity the heat generated can be given as:\")\n",
"print(\"Q=V*I in W\")\n",
"Q=V*I\n",
"print(\"For steady state which means there should be no change in temperature of cable due to electricity flow,the heat generated should be transferred out to surroundings.Therefore,heat transfer across table should be 80 W\")\n",
"print(\"surface area for heat transfer,A2=2*%pi*r*L in m^2\")\n",
"A2=2.*math.pi*r2*L\n",
"A2=0.125;#approx.\n",
"print(\"R1=thermal resistance due to convection between surroundings and cable outer surface,(1-2)=1/(h1*A2)\")\n",
"print(\"R2=thermal resistance due to conduction across plastic insulation(2-3)=log(r2/r3)/(2*%pi*k*L)\")\n",
"print(\"Total resistance,R_total=R1+R2 in oc/W\")\n",
"R_total=(1/(h1*A2))+(math.log(r2/r3)/(2.*math.pi*k*L))\n",
"print(\"Q=(T3-T1)/R_total\")\n",
"T3=T1+Q*R_total\n",
"print(\"so T3 in degree celcius=\"),round(T3,2)\n",
"print(\"so temperature at interface=125.12 degree celcius\")\n",
"rc=k/h1\n",
"print(\"critical radius of insulation,rc in m=\"),round(rc,2)\n",
"print(\"rc in mm\"),round(rc*1000,2)\n",
"print(\"This rc is more than outer radius of cable so the increase in thickness of insulation upon rc=110.66 mmwould increase rate of heat transfer.Doubling insulation thickness means new outer radius would be r1=1.5+5=6.5 mm.Hence doubling(increase) of insulation thickness would increase heat transfer and thus temperature at interface would decrease if other parameters reamins constant.\")\n",
"print(\"NOTE=>In this question value of R_total is calculated wrong in book,hence it is correctly solve above,so the values of R_total and T3 may vary.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.11;pg no: 492"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.11, Page:492 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 11\n",
"for maximum heat transfer the critical radius of insulation should be used.\n",
"critical radius of insulation(rc)=k/h in mm\n",
"economical thickness of insulation(t)=rc-r_wire in mm\n",
"so economical thickness of insulation=7 mm\n",
"heat convected from cable surface to environment,Q in W\n",
"Q= 35.2\n",
"so heat transferred per unit length=35.2 W\n"
]
}
],
"source": [
"#cal of heat transferred per unit length\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.11, Page:492 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 11\")\n",
"r_wire=3;#radius of electric wire in mm\n",
"k=0.16;#thermal conductivity in W/m oc\n",
"T_surrounding=45;#temperature of surrounding in degree celcius\n",
"T_surface=80;#temperature of surface in degree celcius\n",
"h=16;#heat transfer cooefficient in W/m^2 oc\n",
"print(\"for maximum heat transfer the critical radius of insulation should be used.\")\n",
"print(\"critical radius of insulation(rc)=k/h in mm\")\n",
"rc=k*1000/h\n",
"print(\"economical thickness of insulation(t)=rc-r_wire in mm\")\n",
"t=rc-r_wire\n",
"print(\"so economical thickness of insulation=7 mm\")\n",
"print(\"heat convected from cable surface to environment,Q in W\")\n",
"L=1;#length in mm\n",
"Q=2*math.pi*rc*L*h*(T_surface-T_surrounding)*10**-3\n",
"print(\"Q=\"),round(Q,1)\n",
"print(\"so heat transferred per unit length=35.2 W\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 12.12;pg no: 492"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 12.12, Page:492 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 12\n",
"heat transfer through concentric sphere,Q in KJ/hr \n",
"Q= -6297.1\n",
"so heat exchange=6297.1 KJ/hr\n"
]
}
],
"source": [
"#cal of heat exchange\n",
"#intiation of all variables\n",
"# Chapter 12\n",
"import math\n",
"print\"Example 12.12, Page:492 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 12\")\n",
"T1=(-150+273);#temperature of air inside in K\n",
"T2=(35+273);#temperature of outer surface in K\n",
"epsilon1=0.03;#emissivity\n",
"epsilon2=epsilon1;\n",
"D1=25*10**-2;#diameter of inner sphere in m\n",
"D2=30*10**-2;#diameter of outer sphere in m\n",
"sigma=2.04*10**-4;#stephen boltzmann constant in KJ/m^2 hr K^4\n",
"print(\"heat transfer through concentric sphere,Q in KJ/hr \")\n",
"A1=4*math.pi*D1**2/4;\n",
"A2=4*math.pi*D2**2/4;\n",
"Q=(A1*sigma*(T1**4-T2**4))/((1/epsilon1)+((A1/A2)*((1/epsilon2)-1)))\n",
"print(\"Q=\"),round(Q,2)\n",
"print(\"so heat exchange=6297.1 KJ/hr\")"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
IwjG11,Engineering Thermodynamics/chapter13_3.ipynb{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 13:One Dimensional Compressible Fluid Flow"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 13.1;pg no: 525"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 13.1, Page:525 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 1\n",
"mass flow rate(m)=rho*A*C\n",
"so rho*C=4*m/(%pi*d^2)\n",
"so rho=165.79/C\n",
"now using perfect gas equation,p=rho*R*T\n",
"T=P/(rho*R)=P/((165.79/C)*R)\n",
"C/T=165.79*R/P\n",
"so C=1.19*T\n",
"we know,C^2=((2*y*R)/(y-1))*(To-T)\n",
"C^2=(2*1.4*287)*(300-T)/(1.4-1)\n",
"C^2=602.7*10^3-2009*T\n",
"C^2+1688.23*C-602.7*10^3=0\n",
"solving we get,C=302.72 m/s and T=254.39 K\n",
"using stagnation property relation,\n",
"To/T=1+(y-1)*M^2/2\n",
"so M= 0.947\n",
"stagnation pressure,Po in bar= 0.472\n",
"so mach number=0.947,stagnation pressure=0.472 bar,velocity=302.72 m/s\n"
]
}
],
"source": [
"#cal of mach number,stagnation pressure,velocity\n",
"#intiation of all variables\n",
"# Chapter 13\n",
"import math\n",
"print\"Example 13.1, Page:525 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 1\")\n",
"To=(27+273);#stagnation temperature in K\n",
"P=0.4*10**5;#static pressure in pa\n",
"m=3000/3600;#air flowing rate in kg/s\n",
"d=80*10**-3;#diameter of duct in m\n",
"R=287;#gas constant in J/kg K\n",
"y=1.4;#expansion constant\n",
"print(\"mass flow rate(m)=rho*A*C\")\n",
"print(\"so rho*C=4*m/(%pi*d^2)\")\n",
"4*m/(math.pi*d**2)\n",
"print(\"so rho=165.79/C\")\n",
"print(\"now using perfect gas equation,p=rho*R*T\")\n",
"print(\"T=P/(rho*R)=P/((165.79/C)*R)\")\n",
"print(\"C/T=165.79*R/P\")\n",
"165.79*R/P\n",
"print(\"so C=1.19*T\")\n",
"print(\"we know,C^2=((2*y*R)/(y-1))*(To-T)\")\n",
"print(\"C^2=(2*1.4*287)*(300-T)/(1.4-1)\")\n",
"print(\"C^2=602.7*10^3-2009*T\")\n",
"print(\"C^2+1688.23*C-602.7*10^3=0\")\n",
"print(\"solving we get,C=302.72 m/s and T=254.39 K\")\n",
"C=302.72;\n",
"T=254.39;\n",
"print(\"using stagnation property relation,\")\n",
"print(\"To/T=1+(y-1)*M^2/2\")\n",
"M=math.sqrt(((To/T)-1)/((y-1)/2))\n",
"print(\"so M=\"),round(M,3)\n",
"M=0.947;#approx.\n",
"Po=P*(1+(y-1)*M**2/2)/10**5\n",
"print(\"stagnation pressure,Po in bar=\"),round(Po,3)\n",
"print(\"so mach number=0.947,stagnation pressure=0.472 bar,velocity=302.72 m/s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 13.2;pg no: 525"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 13.2, Page:525 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 2\n",
"mach number,M_a=(1/sin(a))=sqrt(2)\n",
"here,P/Po=0.25/1.01=0.2475.Corresponding to this P/Po ratio the mach number and T/To can be seen from air table as M=1.564 and T/To=0.6717\n",
"T=To*0.6717 in K\n",
"and C_max=M*sqrt(y*R*T) in m/s\n",
"corresponding to mach number(M_a=1.414)as obtained from experimental observation,the T/To can be seen from air table and it comes out as (T/To)=0.7145\n",
"so T=0.7145*To in K\n",
"and C_av=M_a*sqrt(y*R*T) in m/s\n",
"ratio of kinetic energy= 0.869\n",
"so ratio of kinetic energy=0.869\n"
]
}
],
"source": [
"#cal of ratio of kinetic energy\n",
"#intiation of all variables\n",
"# Chapter 13\n",
"import math\n",
"print\"Example 13.2, Page:525 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 2\")\n",
"To=(273.+1100.);#stagnation temperature in K\n",
"a=45.;#mach angle over exit cross-section in degree\n",
"Po=1.01;#pressure at upstream side of nozzle in bar\n",
"P=0.25;#ststic pressure in bar\n",
"y=1.4;#expansion constant \n",
"R=287.;#gas constant in J/kg K\n",
"print(\"mach number,M_a=(1/sin(a))=sqrt(2)\")\n",
"M_a=math.sqrt(2)\n",
"M_a=1.414;#approx.\n",
"print(\"here,P/Po=0.25/1.01=0.2475.Corresponding to this P/Po ratio the mach number and T/To can be seen from air table as M=1.564 and T/To=0.6717\")\n",
"M=1.564;\n",
"print(\"T=To*0.6717 in K\")\n",
"T=To*0.6717\n",
"print(\"and C_max=M*sqrt(y*R*T) in m/s\")\n",
"C_max=M*math.sqrt(y*R*T)\n",
"print(\"corresponding to mach number(M_a=1.414)as obtained from experimental observation,the T/To can be seen from air table and it comes out as (T/To)=0.7145\")\n",
"print(\"so T=0.7145*To in K\")\n",
"T=0.7145*To\n",
"print(\"and C_av=M_a*sqrt(y*R*T) in m/s\")\n",
"C_av=M_a*math.sqrt(y*R*T)\n",
"print(\"ratio of kinetic energy=\"),round(((1./2.)*C_av**2)/((1./2.)*C_max**2),3)\n",
"print(\"so ratio of kinetic energy=0.869\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 13.3;pg no: 526"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 13.3, Page:526 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 3\n",
"From bernoulli equation,Po-P=(1/2)*rho*C^2\n",
"so Po=P+(1/2)*rho*C^2 in N/m^2\n",
"speed indicator reading shall be given by mach no.s\n",
"mach no.,M=C/a=C/sqrt(y*R*T)\n",
"using perfect gas equation,P=rho*R*T\n",
"so T=P/(rho*R)in K\n",
"so mach no.,M 0.95\n",
"considering compressibility effect,Po/P=(1+(y-1)*M^2/2)^(y/(y-1))\n",
"so stagnation pressure,Po=P*((1+(y-1)*M^2/2)^(y/(y-1)))in N/m^2\n",
"also Po-P=(1+k)*(1/2)*rho*C^2\n",
"substitution yields,k= 0.2437\n",
"so compressibility correction factor,k=0.2437\n"
]
}
],
"source": [
"#cal of mach no,compressibility correction factor\n",
"#intiation of all variables\n",
"# Chapter 13\n",
"import math\n",
"print\"Example 13.3, Page:526 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 3\")\n",
"C=300.;#aircraft flying speed in m/s\n",
"P=0.472*10**5;#altitude pressure in Pa\n",
"rho=0.659;#density in kg/m^3\n",
"y=1.4;#expansion constant\n",
"R=287.;#gas constant in J/kg K\n",
"print(\"From bernoulli equation,Po-P=(1/2)*rho*C^2\")\n",
"print(\"so Po=P+(1/2)*rho*C^2 in N/m^2\")\n",
"Po=P+(1/2)*rho*C**2\n",
"print(\"speed indicator reading shall be given by mach no.s\")\n",
"print(\"mach no.,M=C/a=C/sqrt(y*R*T)\")\n",
"print(\"using perfect gas equation,P=rho*R*T\")\n",
"print(\"so T=P/(rho*R)in K\")\n",
"T=P/(rho*R)\n",
"M=C/math.sqrt(y*R*T)\n",
"print(\"so mach no.,M\"),round(M,2)\n",
"M=0.947;#approx.\n",
"print(\"considering compressibility effect,Po/P=(1+(y-1)*M^2/2)^(y/(y-1))\")\n",
"print(\"so stagnation pressure,Po=P*((1+(y-1)*M^2/2)^(y/(y-1)))in N/m^2\")\n",
"Po=P*((1+(y-1)*M**2/2)**(y/(y-1)))\n",
"print(\"also Po-P=(1+k)*(1/2)*rho*C^2\")\n",
"k=((Po-P)/((1./2.)*rho*C**2))-1.\n",
"print(\"substitution yields,k=\"),round(k,4)\n",
"print(\"so compressibility correction factor,k=0.2437\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 13.4;pg no: 527"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 13.4, Page:527 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 4\n",
"we know that,Po/P=(1+(y-1)*M^2/2)^((y)/(y-1))\n",
"so M= 1.897\n",
"so mach number,M=1.89\n"
]
}
],
"source": [
"#cal of mach number\n",
"#intiation of all variables\n",
"# Chapter 13\n",
"import math\n",
"print\"Example 13.4, Page:527 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 4\")\n",
"Po=2;#total pressure in bar\n",
"P=0.3;#static pressure in bar\n",
"y=1.4;#expansion constant\n",
"print(\"we know that,Po/P=(1+(y-1)*M^2/2)^((y)/(y-1))\")\n",
"M=math.sqrt((math.exp(math.log(Po/P)/(y/(y-1)))-1)/((y-1)/2))\n",
"print(\"so M=\"),round(M,3)\n",
"print(\"so mach number,M=1.89\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##example 13.5;pg no: 527"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Example 13.5, Page:527 \n",
" \n",
"\n",
"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 5\n",
"actual static pressure(P)=1+0.3 in bar\n",
"It is also given that,Po-P=0.6,\n",
"so Po=P+0.6 in bar\n",
"air velocity,ao=sqrt(y*R*To)in m/s\n",
"density of air,rho_o=Po/(R*To)in \n",
"considering air to be in-compressible,\n",
"Po=P+rho_o*C^2/2\n",
"so C in m/s= 235.13\n",
"for compressible fluid,Po/P=(1+(y-1)*M^2/2)^(y/(y-1))\n",
"so M=sqrt((exp(log(Po/P)/(y/(y-1)))-1)/((y-1)/2))\n",
"compressibility correction factor,k\n",
"k=(M^2/4)+((2-y)/24)*M^4\n",
"stagnation temperature,To/T=1+((y-1)/2)*M^2\n",
"so T=To/(1+((y-1)/2)*M^2) in K\n",
"density,rho=P/(R*T) in kg/m^3\n",
"substituting Po-P=(1/2)*rho*C^2(1+k)\n",
"C in m/s= 250.94\n",
"so C=250.95 m/s\n"
]
}
],
"source": [
"#cal of air stream velocity\n",
"#intiation of all variables\n",
"# Chapter 13\n",
"import math\n",
"print\"Example 13.5, Page:527 \\n \\n\"\n",
"print(\"Engineering Thermodynamics by Onkar Singh Chapter 13 Example 5\")\n",
"To=305.;#stagnation temperature of air stream in K\n",
"y=1.4;#expansion constant\n",
"R=287.;#gas constant in J/kg K\n",
"print(\"actual static pressure(P)=1+0.3 in bar\")\n",
"P=1.+0.3\n",
"print(\"It is also given that,Po-P=0.6,\")\n",
"print(\"so Po=P+0.6 in bar\")\n",
"Po=P+0.6\n",
"print(\"air velocity,ao=sqrt(y*R*To)in m/s\")\n",
"ao=math.sqrt(y*R*To)\n",
"print(\"density of air,rho_o=Po/(R*To)in \")\n",
"rho_o=Po*10.**5/(R*To)\n",
"print(\"considering air to be in-compressible,\")\n",
"print(\"Po=P+rho_o*C^2/2\")\n",
"C=math.sqrt((Po-P)*10.**5*2./rho_o)\n",
"print(\"so C in m/s=\"),round(C,2)\n",
"print(\"for compressible fluid,Po/P=(1+(y-1)*M^2/2)^(y/(y-1))\")\n",
"print(\"so M=sqrt((exp(log(Po/P)/(y/(y-1)))-1)/((y-1)/2))\")\n",
"M=math.sqrt((math.exp(math.log(Po/P)/(y/(y-1)))-1)/((y-1)/2))\n",
"M=0.7567;#approx.\n",
"print(\"compressibility correction factor,k\")\n",
"print(\"k=(M^2/4)+((2-y)/24)*M^4\")\n",
"k=(M**2/4.)+((2.-y)/24.)*M**4\n",
"print(\"stagnation temperature,To/T=1+((y-1)/2)*M^2\")\n",
"print(\"so T=To/(1+((y-1)/2)*M^2) in K\")\n",
"T=To/(1+((y-1)/2)*M**2)\n",
"print(\"density,rho=P/(R*T) in kg/m^3\")\n",
"rho=P*10**5/(R*T)\n",
"print(\"substituting Po-P=(1/2)*rho*C^2(1+k)\")\n",
"C=math.sqrt((Po-P)*10.**5/((1./2.)*rho*(1.+k)))\n",
"print(\"C in m/s=\"),round(C,2)\n",
"print(\"so C=250.95 m/s\")"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
PK
I\($$,Engineering Thermodynamics/chapter_1_3.ipynbPK
IE)E)+nEngineering Thermodynamics/chapter2_3.ipynbPK
I(OO+Engineering Thermodynamics/chapter3_3.ipynbPK
IXI+Engineering Thermodynamics/chapter4_3.ipynbPK
IIF?+++Engineering Thermodynamics/chapter5_3.ipynbPK
Iww+6!Engineering Thermodynamics/chapter6_3.ipynbPK
I ΧJJ+Engineering Thermodynamics/chapter7_2.ipynbPK
I+Engineering Thermodynamics/chapter8_3.ipynbPK
I%D/+¬Engineering Thermodynamics/chapter9_3.ipynbPK
Iҿە,Engineering Thermodynamics/chapter10_3.ipynbPK
IIs,bEngineering Thermodynamics/chapter11_3.ipynbPK
I1uv33,/ Engineering Thermodynamics/chapter12_3.ipynbPK
IwjG11, Engineering Thermodynamics/chapter13_3.ipynbPK
&