summaryrefslogtreecommitdiff
path: root/Fundamental_of_internal_combustion_engines/chap4.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Fundamental_of_internal_combustion_engines/chap4.ipynb')
-rwxr-xr-xFundamental_of_internal_combustion_engines/chap4.ipynb793
1 files changed, 793 insertions, 0 deletions
diff --git a/Fundamental_of_internal_combustion_engines/chap4.ipynb b/Fundamental_of_internal_combustion_engines/chap4.ipynb
new file mode 100755
index 00000000..c8818341
--- /dev/null
+++ b/Fundamental_of_internal_combustion_engines/chap4.ipynb
@@ -0,0 +1,793 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Fuel Air Cycles and their analysis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page No 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8.5 #The compression ratio \n",
+ "sv=1.4 #The specific heat at constant volume in percent\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "n=1-(1/r)**(sv-1) \n",
+ "ef=(((1-n)/n)*(sv-1)*(math.log(r))*(sv/100.0))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The efficiency decreases by \",round(ef,3),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency decreases by 0.885 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page No 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=18.0 #The compression ratio \n",
+ "l=6.0 #The cut off taking place corresponding of the stroke in percent\n",
+ "sc=2.0 #The specific heat at constant volume increases in percent\n",
+ "cv=0.717 #The specific heat at constant volume in kJ/kgK\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "Vs=(r-1)\n",
+ "B=((l/100.0)*Vs)+1\n",
+ "cp=cv+R\n",
+ "R1=cp/cv\n",
+ "n=1-(((((1/r)**(R1-1))*(B**R1-1))/(R1*(B-1)))) \n",
+ "dn=(((1-n)/n)*((R1-1)*((math.log(r))-(((B**R1)*math.log(B))/(B**R1-1))+(1/B)))*(sc/100.0))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The efficiency decreases by \",round(dn,1),\"percent\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency decreases by 1.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8 #The compression ratio\n",
+ "af=15 #Air/fuel ratio\n",
+ "p1=1 #The pressure at the beginning of a compression stroke in bar\n",
+ "t=60 #The temperature at the beginning of a compression stroke in degree centigrade\n",
+ "cv=44000 #The calorific value of the fuel in kJ/kg\n",
+ "n=1.32 #The index of the compression \n",
+ "Cv=0.717 #specific heat at constant volume in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "T1=t+273\n",
+ "p2=p1*(r)**n\n",
+ "T2=T1*r**(n-1)\n",
+ "f=(1/(af+1))\n",
+ "a=(af/(af+1))\n",
+ "q23=cv/(af+1)\n",
+ "T3=((-10430+((10430)**2+(4*494.8*10**5))**(1/2.0))/2.0)\n",
+ "p3=(T3/T1)*(r)*p1\n",
+ "T31=(q23/Cv)+T2\n",
+ "p31=(T31/T1)*r*p1\n",
+ "\n",
+ "#Output\n",
+ "print\"(a) The Maximum temperature in the cylinder = \",round(T3,0),\"K\" \n",
+ "print\"The Maximum pressure in the cylinder P3 = \",round(p3,0),\"bar\" \n",
+ "print\"(b)With constant value of Cv \"\n",
+ "print\"The Maximum temperature in the cylinder = \",round(T31,0),\"K\" \n",
+ "print\"The Maximum pressure in the cylinder P3 = \",round(p31,1),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The Maximum temperature in the cylinder = 3541.0 K\n",
+ "The Maximum pressure in the cylinder P3 = 85.0 bar\n",
+ "(b)With constant value of Cv \n",
+ "The Maximum temperature in the cylinder = 4483.0 K\n",
+ "The Maximum pressure in the cylinder P3 = 107.7 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=21 #The compression ratio \n",
+ "af=29 #Air/fuel ratio\n",
+ "T=1000 #The temperature at the end of compression in K\n",
+ "cv=42000 #The calorific value of the in kJ/kg\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations \n",
+ "q23=cv/(af+1)\n",
+ "T3=(-0.997+(((0.997)**2)+(4*2411*14*10**-6))**(1/2.0))/(28.0*10.0**-6)\n",
+ "V3=(T3/T)\n",
+ "Vs=(r-1)\n",
+ "V=V3-1\n",
+ "pc=(V/Vs)*100\n",
+ "\n",
+ "#Output\n",
+ "print\"The percentage of stroke at which combustion is complete = \",round(pc,3),\"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of stroke at which combustion is complete = 6.706 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page No 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=16.0 #The compression ratio \n",
+ "l=6.0 #The cut-off of the stroke in percent\n",
+ "p3=70.0 #The maximum pressure obtained in bar\n",
+ "p1=1.0 #The pressure at the beginning of compression in bar\n",
+ "T1=(100.0+273.0) #The temperature at the beginning of compression in K\n",
+ "R=0.287 #Gas constant in kJ/kgK\n",
+ "g=1.4 #Assume the isentropic index \n",
+ "\n",
+ "#Calculations\n",
+ "T2=T1*(r)**(g-1)\n",
+ "Cv=(1/(T2-T1))*(0.716+125*10**-6*(T2**2-T1**2))\n",
+ "Cp=Cv+R\n",
+ "g1=Cp/Cv\n",
+ "T21=T1*(r)**(g1-1)\n",
+ "Cv1=(1/(T21-T1))*((0.716+125*10**-6*(T21**2-T1**2)))\n",
+ "Cp1=Cv1+R\n",
+ "g2=Cp1/Cv1\n",
+ "gm=1.358 #mean value\n",
+ "T22=T1*(r)**(gm-1)\n",
+ "p2=(T22/T1)*r*p1\n",
+ "T3=(p3/p2)*T22\n",
+ "V=((l/100.0)*(r-1))+1\n",
+ "T4=(V)*T3\n",
+ "p4=p3\n",
+ "g3=1.3\n",
+ "V5=r/V\n",
+ "T5=T4*(1/V5)**(g3-1)\n",
+ "Cv2=((0.716*(T5-T4))+(62.5*10**-6*(T5**2-T4**2)))/(T5-T4)\n",
+ "Cp2=Cv2+R\n",
+ "g4=Cp2/Cv2\n",
+ "T51=T4*(1/V5)**(g4-1)\n",
+ "Cv3=((0.716*(T51-T4))+(62.5*10**-6*(T51**2-T4**2)))/(T51-T4)\n",
+ "Cp3=Cv3+R\n",
+ "g5=Cp3/Cv3\n",
+ "T52=T4*(1/V5)**(g5-1)\n",
+ "p5=(T52/T1)*p1\n",
+ "\n",
+ "#Output\n",
+ "print\"The pressure and temperature at all points of the cycle \\nat point 2: Temperature T2 = \",round(T22,0),\"K and Pressure P2 = \",round(p2,2),\" bar\" \n",
+ "print\"at point 3 :Temperature T3 = \",round(T3,1),\" K and Pressure P3 = \",p3,\" bar\" \n",
+ "print\"at point 4 : Temperature T4 = \",T4,\" K and Pressure P4 = \",p4,\"bar\" \n",
+ "print\"at point 5 :Temperature T5 = \",round(T52,0),\" K and Pressure P5 = \",round(p5,2),\"bar\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure and temperature at all points of the cycle \n",
+ "at point 2: Temperature T2 = 1006.0 K and Pressure P2 = 43.17 bar\n",
+ "at point 3 :Temperature T3 = 1631.9 K and Pressure P3 = 70.0 bar\n",
+ "at point 4 : Temperature T4 = 3100.5625 K and Pressure P4 = 70.0 bar\n",
+ "at point 5 :Temperature T5 = 1698.0 K and Pressure P5 = 4.55 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page No 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8 #Compression ratio\n",
+ "lcv=44000 #The lower heating value of the fuel in kJ/kg\n",
+ "af=15 #The air/fuel ratio\n",
+ "Cv=0.71 #The specific heat at constant volume in kJ/kgK\n",
+ "p=1 #The pressure at the beginning of the compression in bar\n",
+ "t=60 #The temperature at the beginning of the compression in degree centigrade\n",
+ "Mo=32 #Molecular weight of oxygen\n",
+ "Mn=28.161 #Molecular weight of nitrogen\n",
+ "Mh=18 #Molecular weight of water \n",
+ "n=1.3 #Polytrpic index\n",
+ "\n",
+ "#Calculations\n",
+ "T1=(t+273)\n",
+ "sa=(12.5*(Mo+(3.76*Mn)))/((12*8)+(1*Mh))\n",
+ "Y=af*(((12*8)+(1*Mh))/(Mo+(3.76*Mn)))\n",
+ "x=(12.5-Y)*2\n",
+ "nb=1+Y+(Y*3.76)\n",
+ "na=x+7.8+9+46.624 \n",
+ "Me=((na-nb)/nb)*100\n",
+ "T2=T1*(r)**(n-1)\n",
+ "T3=(lcv/(af+1))*(1/Cv)+(T2)\n",
+ "p3=r*(T3/T1)*p\n",
+ "p31=p3*(na/nb)\n",
+ "\n",
+ "#Output\n",
+ "print\"The percentage molecular expansion is \",round(Me,0),\"percent\"\n",
+ "print\"(a) Without considering the molecular expansion \"\n",
+ "print\" The maximum temperature is \",round(T3,0),\"K\" \n",
+ "print\"The maximum pressure is \",round(p3,0),\"bar\"\n",
+ "print\"(b) With molecular expansion \" \n",
+ "print\"The maximum temperature is \",round(T3,0),\"K\" \n",
+ "print\"The maximum pressure is \",round(p31,1),\"bar\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage molecular expansion is 6.0 percent\n",
+ "(a) Without considering the molecular expansion \n",
+ " The maximum temperature is 4495.0 K\n",
+ "The maximum pressure is 108.0 bar\n",
+ "(b) With molecular expansion \n",
+ "The maximum temperature is 4495.0 K\n",
+ "The maximum pressure is 114.4 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "f=0.03 #The residual fraction of an engine\n",
+ "e=1.2 #The equivalence ratio\n",
+ "F=0.0795 #Fuel/air ratio for corresponding equivalence ratio \n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T=1+F\n",
+ "fa=1-f\n",
+ "ff=F*(fa)\n",
+ "ra=f\n",
+ "rf=ra*F\n",
+ "\n",
+ "#Output\n",
+ "print\"Fresh air = \",fa,\"kg\" \n",
+ "print\"Fresh fuel = \",ff,\"kg\" \n",
+ "print\"Air in residual = \",ra,\"kg\" \n",
+ "print\"Fuel in residual = \",rf,\"kg\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fresh air = 0.97 kg\n",
+ "Fresh fuel = 0.077115 kg\n",
+ "Air in residual = 0.03 kg\n",
+ "Fuel in residual = 0.002385 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page No 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=800 #The given temperature in K\n",
+ "e=1 #The equivalence ratio \n",
+ "hi=154.723 #Sensible Enthalpy for isooctane at 800 K in MJ/kmol \n",
+ "ho=15.841 #Sensible Enthalpy for oxygen at 800 K in MJ/kmol \n",
+ "hn=15.046 #Sensible Enthalpy for nitrogen at 800 K in MJ/kmol\n",
+ "nc=0.00058 #Number of kmoles of C8H18 for equivalence ratio for 1 kg of air \n",
+ "no=0.00725 #Number of kmoles of oxygen for equivalence ratio for 1 kg of air \n",
+ "nn=0.0273 #Number of kmoles of nitrogen for equivalence ratio for 1 kg of air \n",
+ "R=8.314 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "Hs=(nc*hi)+(no*ho)+(nn*hn)\n",
+ "Hs1=Hs*1000\n",
+ "n=nc+no+nn\n",
+ "Us=Hs-(n*R*10**-3*(T-298))\n",
+ "Us1=Us*1000\n",
+ "\n",
+ "#Output\n",
+ "print\"Total sensible enthalpy of reactants = \",round(Hs1,3),\"kJ/kg air\" \n",
+ "print\"Sensible internal energy of reactants = \",round(Us1,3),\"kJ/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total sensible enthalpy of reactants = 615.342 kJ/kg air\n",
+ "Sensible internal energy of reactants = 468.723 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page No 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "T=500.0 #The given temperature in K\n",
+ "e=1.0 #Equivalence ratio \n",
+ "Ai=0.0662 #The amount of isooctane for 1 kg of air in kg\n",
+ "Ta=298.0 #Consider the ambient temperature in K \n",
+ "R=8.314 #Gas constant in kJ/kgK\n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "E=((0.0662*((0.44*math.log(T/Ta))+(3.67*10**-3*(T-Ta))))+((0.921*math.log(T/Ta))+(2.31*10**-4*(T-Ta))))*1000\n",
+ "Ri=Ri/114.0\n",
+ "W=(0.5874-(0.662*Ri*math.log(T/Ta))-(0.287*math.log(T/Ta)))*1000\n",
+ "\n",
+ "#Output\n",
+ "print\"The isentropic compression functions at 500 K for the unburned\" \n",
+ "print\"isooctsne-air mixture are \",round(E,1),\"J/kg air and\",round(W,1),\"J/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The isentropic compression functions at 500 K for the unburned\n",
+ "isooctsne-air mixture are 587.4 J/kg air and 438.9 J/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page No 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=7.8 #Compression ratio \n",
+ "p=1.0 #The pressure at the start of compression in atm\n",
+ "T1=335.0 #The temperature at the start of compression in K\n",
+ "W1=100 #Isentropic compression function for T1 in J/kg air K \n",
+ "T2=645 #The temperature corresponding to isentropic compression function in J/kg air K \n",
+ "U1=35 #Internal energy corresponding to temp T1 in kJ/kg air \n",
+ "U2=310 #Internal energy corresponding to temp T2 in kJ/kg air \n",
+ "E1=120 #Isentropic compression function at T1 \n",
+ "E2=910 #Isentropic compression function at T2 \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "W2=W1-(292*math.log(1/r))\n",
+ "V1=(292*T1)/(p*10.0**5)\n",
+ "p2=p*(T2/T1)*r\n",
+ "V2=V1/r\n",
+ "W=U2-U1\n",
+ "p21=(math.exp((E2-E1)/292.0)) \n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At the end of the compression stroke\"\n",
+ "print\"The temperature is \",T2,\"K\" \n",
+ "print\"The pressure is \",round(p2,0),\"atm\" \n",
+ "print\"The volume per unit mass of air is \",round(V2,3),\"m**3/kg air\"\n",
+ "print\"The pressure is \",round(p21,0),\"atm\" \n",
+ "print\"(b)The work input during compression is \",W,\"kJ/kg air\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At the end of the compression stroke\n",
+ "The temperature is 645 K\n",
+ "The pressure is 15.0 atm\n",
+ "The volume per unit mass of air is 0.125 m**3/kg air\n",
+ "The pressure is 15.0 atm\n",
+ "(b)The work input during compression is 275 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11 Page No 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "p=65 #The pressure in the cylinder in bar\n",
+ "r=10 #The compression ratio \n",
+ "V3=0.1 #The volume per unit mass of air at the start of expansion in m**3/kg air \n",
+ "p3=p*100 #The pressure in the cylinder after the completion of combustion in kN/m**2\n",
+ "T3=2240 #The temperature from the chart corresponding to p3,V3 in K\n",
+ "u3=-1040 #The energy from the chart in kJ/kg air \n",
+ "s3=8.87 #The entropy from the chart in kJ/kg air K\n",
+ "T4=1280 #The temperature from the chart corresponding to p4,V4 in K \n",
+ "u4=-2220 #The energy from the chart in kJ/kg air \n",
+ "p4=4.25 #The pressure from the chart in bar \n",
+ "\n",
+ "#Calculations \n",
+ "s4=s3\n",
+ "V4=r*V3\n",
+ "W=-(u4-u3)\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At the end of expansion stroke\"\n",
+ "print\"The pressure is \",p4,\"bar\" \n",
+ "print\"The temperature is \",T4,\"K\" \n",
+ "print\"The volume is \",V4,\"m**3/kg air\" \n",
+ "print\"(b)The work during the expansion stroke is \",W,\"kJ/kg air\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At the end of expansion stroke\n",
+ "The pressure is 4.25 bar\n",
+ "The temperature is 1280 K\n",
+ "The volume is 1.0 m**3/kg air\n",
+ "(b)The work during the expansion stroke is 1180 kJ/kg air\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12 Page no 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "#From Table 4.4\n",
+ "H1=-224.1*1000 #MJ/mol, Enthalpy of C8H18\n",
+ "H2=-393.52*1000 #Enthalpy of CO2\n",
+ "H3=-241.82*1000 #Enthalpy of H2O\n",
+ "U1=-204.1*1000 #MJ/mol, Internal energyof C8H18\n",
+ "U2=-393.52*1000 #Internal energy of CO2\n",
+ "U3=-240.6*1000 #Internal energy of H2O\n",
+ "\n",
+ "\n",
+ "M1=114.0 #g, molecular wt of C8H18\n",
+ "M2=32.0 #g, molecular wt of O2\n",
+ "M3=28.0 #g, molecular wt of N2\n",
+ "M4=44.0 #g, molecular wt of CO2\n",
+ "M5=18.0 #g, molecular wt of H2O\n",
+ "#For 1 kg air, from the eq., the fraction of wt are\n",
+ "x1=0.0661 \n",
+ "x2=0.232\n",
+ "x3=0.768\n",
+ "x4=0.204\n",
+ "x5=0.094\n",
+ "\n",
+ "#Calculation\n",
+ "import sympy\n",
+ "f=sympy.Symbol(\"f\")\n",
+ "n1=(x1/M1)*(1-f) #No. of kmoles of C8H18\n",
+ "n2=x2/M2*(1-f)\n",
+ "n3=x3/M3\n",
+ "n4=x4/M4*f\n",
+ "n5=x5/M5*f\n",
+ "N1=(n1*H1+n4*H2+n5*H3)\n",
+ "N2=n1*U1+n4*U2+n5*U3\n",
+ "\n",
+ "#Result\n",
+ "print \"Standard Enthalpy of formation is\",N1\n",
+ "print \"Internal energy of formation is\",N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Standard Enthalpy of formation is -2957.40091174907*f - 129.938684210526\n",
+ "Internal energy of formation is -2962.62629186603*f - 118.342192982456\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.13 Page No 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "Tu=645.0 #The temperature at the end of compression process in K\n",
+ "usu=310.0 #The internal energy at the end of compression process in kJ/kg air \n",
+ "pu=(15.4*1.013) #The pressure at the end of the compression process in bar \n",
+ "Vu=0.124 #The volume at the end of the compression process in m**3/kg air \n",
+ "e=1.0 #Equivalence ratio \n",
+ "f=0.065 #Burned gas fraction \n",
+ "Tb=2820.0 #The temperature for constant volume \n",
+ "pb=6500.0 #The pressure for constant volume \n",
+ "hsu=440.0 #The enthalpy from chart corresponding to temp Tu in kJ/kg air \n",
+ "pb1=1560.0 #The pressure for constant pressure adiabatic combustion in kN/m**2 \n",
+ "ub1=-700.0 #Trail and error along the pb internal energy in kJ/kg air\n",
+ "Tb1=2420.0 #The temperature for constant pressure \n",
+ "\n",
+ "#Calculations \n",
+ "ufu=-118.5-(2963*f)\n",
+ "ub=usu-ufu\n",
+ "Vb=Vu\n",
+ "hfu=-129.9-(2958*f)\n",
+ "hb=hsu+hfu\n",
+ "vb1=(118-ub1)/pb\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)For constant volume adiabatic combustion\"\n",
+ "print\"The temperature is \",Tb,\"K\" \n",
+ "print\"The pressure is \",pb,\"kN/m**2\"\n",
+ "print\"(b)For constant pressure adiabatic combustion\"\n",
+ "print\"The temperature is \",Tb1,\"K\" \n",
+ "print\"The pressure is \",pb1,\"kN/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)For constant volume adiabatic combustion\n",
+ "The temperature is 2820.0 K\n",
+ "The pressure is 6500.0 kN/m**2\n",
+ "(b)For constant pressure adiabatic combustion\n",
+ "The temperature is 2420.0 K\n",
+ "The pressure is 1560.0 kN/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.14 Page No 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "r=8.0 #The compression ratio \n",
+ "T1=350.0 #The given temperature at the start of compression in K\n",
+ "p=1.0 #The given pressure at the start of compression in bar\n",
+ "f=0.08 #The exhaust residual fraction \n",
+ "cv=44000 #The calorific value in kJ/kg\n",
+ "W1=150 #Isentropic compression functions for corresponding temp T1 in J/kg air K\n",
+ "T2=682 #The temperature corresponding to isentropic compression function in K \n",
+ "us2=350 #The internal energy corresponding to temp T2 in K\n",
+ "us1=40 #The internal energy corresponding to temp T1 in K \n",
+ "T3=2825 #The temperature at point 3 corresponding to u3,V3 on the burned gas chart in K\n",
+ "p3=7100 #The pressure at point 3 in kN/m**2 \n",
+ "s3=9.33 #Entropy at point 3 in kJ/kg air K \n",
+ "u4=-1540 #The internal energy at point 4 corresponding to V4,s4 in kJ/kg air \n",
+ "p4=570 #The pressure at point 4 in kN/m**2 \n",
+ "T4=1840 #The temperature at point 4 in K \n",
+ "\n",
+ "#Calculations\n",
+ "import math\n",
+ "W2=W1-(292*math.log(1/r))\n",
+ "V1=(292*T1)/(p*10.0**5)\n",
+ "p2=p*(T2/T1)*r\n",
+ "V2=V1/r\n",
+ "Wc=us2-us1\n",
+ "ufu=-118.5-(2963*f)\n",
+ "u3=us2+ufu\n",
+ "V3=V2\n",
+ "s4=s3\n",
+ "V4=V1\n",
+ "We=u3-u4 \n",
+ "Wn=We-Wc\n",
+ "nth=((Wn)/((1-f)*0.0662*cv))*100\n",
+ "imep=((Wn*1000)/(V1-V2))/10.0**5\n",
+ "nv=(((1-f)*287*298)/(1.013*10**5*(1-0.125)))*100\n",
+ "\n",
+ "#Output\n",
+ "print\"(a)At point 2, \\nThe temperature is \",T2,\" K \\nThe pressure is \",round(p2,1),\"atm\"\n",
+ "print\"At point 3, \\nThe temperature is \",T3,\" K \\nThe pressure is \",p3,\"kN/m**2\" \n",
+ "print\"At point 4, \\nThe temperature is \",T4,\" K \\nThe pressure is \",p4,\"kN/m**2\" \n",
+ "print\"(b)The indicated thermal efficiency is \",round(nth,1),\"percent\" \n",
+ "print\"(c)The indicated mean effective pressure is \",round(imep,0),\" bar\" \n",
+ "print\"(d)The volumetric efficiency is \",round(nv,2), \"percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)At point 2, \n",
+ "The temperature is 682 K \n",
+ "The pressure is 15.6 atm\n",
+ "At point 3, \n",
+ "The temperature is 2825 K \n",
+ "The pressure is 7100 kN/m**2\n",
+ "At point 4, \n",
+ "The temperature is 1840 K \n",
+ "The pressure is 570 kN/m**2\n",
+ "(b)The indicated thermal efficiency is 45.7 percent\n",
+ "(c)The indicated mean effective pressure is 14.0 bar\n",
+ "(d)The volumetric efficiency is 88.77 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file