summaryrefslogtreecommitdiff
path: root/_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-08-28 16:53:23 +0530
committerThomas Stephen Lee2015-08-28 16:53:23 +0530
commit4a1f703f1c1808d390ebf80e80659fe161f69fab (patch)
tree31b43ae8895599f2d13cf19395d84164463615d9 /_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb
parent9d260e6fae7328d816a514130b691fbd0e9ef81d (diff)
downloadPython-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.tar.gz
Python-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.tar.bz2
Python-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.zip
add books
Diffstat (limited to '_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb')
-rw-r--r--_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb1655
1 files changed, 1655 insertions, 0 deletions
diff --git a/_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb b/_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb
new file mode 100644
index 00000000..606321b3
--- /dev/null
+++ b/_Engineering_Thermodynamics_by__O._Singh/chapter9_2.ipynb
@@ -0,0 +1,1655 @@
+{
+ "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
+}