diff options
Diffstat (limited to 'Thermal_Engineering_by_S._l._Somasundaram/Ch1.ipynb')
-rw-r--r-- | Thermal_Engineering_by_S._l._Somasundaram/Ch1.ipynb | 437 |
1 files changed, 437 insertions, 0 deletions
diff --git a/Thermal_Engineering_by_S._l._Somasundaram/Ch1.ipynb b/Thermal_Engineering_by_S._l._Somasundaram/Ch1.ipynb new file mode 100644 index 00000000..e4ea4f44 --- /dev/null +++ b/Thermal_Engineering_by_S._l._Somasundaram/Ch1.ipynb @@ -0,0 +1,437 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:645f0312235dca513f2dc1a6a9e79defd41db0b001d5f5d700ed6a60e922990d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch -1 : Thermodynamic Cycles for Gas Engines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.1 : Pg - 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "t2=275 #k\n", + "t1=1100 #k\n", + "R = 0.287 # kJ/kgK\n", + "y = 1.4\n", + "qs = 250 # kJ/kgK\n", + "pa = 1.01325 # bar\n", + "th=393 #k\n", + "re=0.14\n", + "#CALCULATIONS\n", + "eff = 1-t2/t1\n", + "from sympy import symbols, solve, log\n", + "p1,pb = symbols('p1 pb')\n", + "expr = t1/t2-(p1/pa)**((y-1)/y)\n", + "p1 = float(solve(expr,p1)[0])\n", + "expr2 = qs-R*t1*log(pb/p1)\n", + "pb = float(solve(expr2,pb)[0])\n", + "va = R*t2/pa\n", + "vb = R*t1/pb\n", + "mep = qs*eff/(va-vb)\n", + "#RESULTS\n", + "print \"Cycle efficiency = %0.2f \\nmean effective pressure = %0.3f bar\"%(eff, mep)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cycle efficiency = 1.00 \n", + "mean effective pressure = 3.256 bar\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.2 : Pg - 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initailisation variables\n", + "d=20 #cm\n", + "l=25 #cm\n", + "cv=1400 #cc\n", + "g=1.4\n", + "#CALCULATIONS\n", + "sv=(22/7*d**2*l)/4\n", + "tv=sv+cv\n", + "r=tv/cv\n", + "e=1-1/(r)**(g-1)\n", + "print 'otto efficiency is %.3f'%e" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "otto efficiency is 0.512\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.3 : Pg - 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "t1=305 #K\n", + "t3=1920 #K\n", + "r=7\n", + "g=1.4\n", + "p1=1 #bar\n", + "cv=0.718\n", + "R=0.287 #kj/kgk\n", + "#CALCULATIONS\n", + "print \"part(a): \"\n", + "t2=t1*r**(g-1)\n", + "p2=p1*r**(g)\n", + "print \"T2 = %0.f K\"%t2\n", + "print \"P2 = %0.1f bar\"%p2\n", + "p3=p2*(t3/t2)\n", + "print \"T3 = %0.f K\"%t3\n", + "print \"P3 = %0.1f bar\"%p3\n", + "t4=t3*1/r**(g-1)\n", + "p4=p3*(1/r)**(g)\n", + "print \"T4 = %0.f K\"%t4\n", + "print \"P4 = %0.2f bar\"%p4\n", + "print \"part(b) :\"\n", + "qs=cv*(t3-t2)\n", + "print \"Heat Supplied, qs = %0.1f kJ/kg/cycle\"%qs\n", + "qr1=cv*(t4-t1)\n", + "print \"part(c) :\"\n", + "print \"Heat rejected, qr = %0.1f kJ/kg/cycle\"%qr1\n", + "wo=qs-qr1\n", + "print \"part(d) : \"\n", + "print \"Work Output = %0.1f kJ/kg/cycle\"%wo\n", + "print \"part(e) : \"\n", + "ef=wo/qs\n", + "print \"Efficiency = %0.3f\"%ef\n", + "v1=R*t1/p1\n", + "v2=v1/r\n", + "sv=v1-v2\n", + "cl=v2/(v1-v2)\n", + "print \"part(f) : \\nclearance = %0.4f\"%cl\n", + "mep=wo/sv\n", + "print 'part(g) : \\nmean effective pressure is %0.3f bar'%mep" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part(a): \n", + "T2 = 664 K\n", + "P2 = 15.2 bar\n", + "T3 = 1920 K\n", + "P3 = 44.1 bar\n", + "T4 = 882 K\n", + "P4 = 0.00 bar\n", + "part(b) :\n", + "Heat Supplied, qs = 901.6 kJ/kg/cycle\n", + "part(c) :\n", + "Heat rejected, qr = 414.0 kJ/kg/cycle\n", + "part(d) : \n", + "Work Output = 487.6 kJ/kg/cycle\n", + "part(e) : \n", + "Efficiency = 0.541\n", + "part(f) : \n", + "clearance = 0.1667\n", + "part(g) : \n", + "mean effective pressure is 6.499 bar\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.4 : Pg - 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "#initialisation of variables\n", + "r=14\n", + "g=1.4\n", + "x=1.78 #x=v3/v2\n", + "#CALCULATIONS\n", + "oef=1-(1/14)**(g-1)\n", + "Def=1-((1/(14)**(g)*1.4))*((x**(g) -1)/(x-1))\n", + "print 'otto efficiency is %0.3f'%oef" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "otto efficiency is 1.000\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.5 : Pg - 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#1.5\n", + "from __future__ import division\n", + "#initialisation of variables\n", + "t1=300 #K\n", + "t3=1900 #K\n", + "r=15\n", + "g=1.4\n", + "p1=1 #bar \n", + "cp=1.005\n", + "cv=0.718\n", + "R=0.287 #kj/kgk\n", + "#CALCULATIONS\n", + "t2=t1*r**(g-1)\n", + "p2=p1*r**(g)\n", + "p3=p2\n", + "t4=t3*0.143**(g-1)\n", + "p4=p3*(0.143)**(g)\n", + "qs=cp*(t3-t2)\n", + "qr1=cv*(t4-t1)\n", + "wo=qs-qr1\n", + "ef=wo/qs\n", + "v1=R*t1/p1/1e2\n", + "v2=v1/r\n", + "sv=v1-v2\n", + "cl=v2/(v1-v2)\n", + "v3 = t3/t2*v2\n", + "cf = (v3-v2)/(v1-v2)\n", + "mep=wo/sv\n", + "print \"part(a) : \\nT2 = %0.f K\\nP2 = %0.1f bar\\nT4 = %0.f K\\nP4 = %0.2f bar\"%(t2,p2,t4,p4)\n", + "print \"part(b) : \\nHeat Supplied, qs = %0.2f\"%qs\n", + "print \"part(c) : \\nHeat rejected, qr = %0.2f kJ/kg/cycle\"%qr1\n", + "print \"part(d) : \\nNet work output = %0.2f kJ/kg/cycle\" %wo\n", + "print \"part(e) : \\nEfficiency = %0.4f \"%ef\n", + "print \"part(f) : \\nClearance = %0.5f\"%cl\n", + "print \"part(g) : \\nCut-off = %0.4f\"%cf\n", + "print 'part(h) : \\nmean effective pressure is %0.f kN/m^2'%mep" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part(a) : \n", + "T2 = 886 K\n", + "P2 = 44.3 bar\n", + "T4 = 873 K\n", + "P4 = 2.91 bar\n", + "part(b) : \n", + "Heat Supplied, qs = 1018.82\n", + "part(c) : \n", + "Heat rejected, qr = 411.23 kJ/kg/cycle\n", + "part(d) : \n", + "Net work output = 607.58 kJ/kg/cycle\n", + "part(e) : \n", + "Efficiency = 0.5964 \n", + "part(f) : \n", + "Clearance = 0.07143\n", + "part(g) : \n", + "Cut-off = 0.0817\n", + "part(h) : \n", + "mean effective pressure is 756 kN/m^2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.6 : Pg - 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables \n", + "t1=300 #temparature in k\n", + "r=10 #compression ratio\n", + "p1=1 #pressure in bar\n", + "g=1.4 \n", + "p3=40 #pressure in bar\n", + "x=0.166 #x=v4/v5=t4/v1=(v4/v2)*(v2/v1)\n", + "t4=2000 #temparature in k\n", + "p4=40 #pressure in bar\n", + "cv=0.718 #calorific value(const volume)\n", + "cp=1.005 #calorific value(const preussure)\n", + "R=0.287\n", + "r=10\n", + "#CALCULATIONS\n", + "t2=(t1*(r)**(g-1))\n", + "p2=(p1*(r)**(g))\n", + "t3=t2*(p3/p2)\n", + "t5=t4*(x)**(g-1)\n", + "p5=p4*(x)**(g)\n", + "q23=cv*(t3-t2)\n", + "q34=cp*(t4-t3)\n", + "q44=cv*(t5-t1)\n", + "nwd=q23+q34-q44\n", + "ef=nwd/(q23+q34)\n", + "v1=(R*t1)/(p1*100)\n", + "v2=v1/r\n", + "mep=nwd/(v1-v2)\n", + "effo=1-(1/(r)**(g-1))\n", + "v3=(R*t4)/(p2*100)\n", + "cr=v3/v2\n", + "effd=1-((1/(r)**(g-1))*(1/g)*((cr)**(g)-1)/(cr-1))\n", + "#RESULTS\n", + "print '(a) temparature 2,3,5 and pressure 2,5 are %.fk,%.fk,%.fk and %0.f bar,%0.2f bar'%(t2,t3,t5,p2,p5)\n", + "print '\\n(b) heat supplied at const volume is %.2f kJ/kg/cycle'%q23\n", + "print '\\n(c) heat supplied at const pressure is %.2f kJ/kg/cycle'%q34\n", + "print '\\n(d) heat rejected is %.2f kJ/kg/cycle'%q44\n", + "print '\\n(e) net work output is %.2f'%nwd\n", + "print '\\n(f) efficiency is %.4f'%ef\n", + "print '\\n(g) otto efficiency is %0.3f'%effo,\n", + "print ' & diesel efficiency is %0.3f'%effd" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) temparature 2,3,5 and pressure 2,5 are 754k,1200k,975k and 25 bar,3.24 bar\n", + "\n", + "(b) heat supplied at const volume is 320.54 kJ/kg/cycle\n", + "\n", + "(c) heat supplied at const pressure is 804.00 kJ/kg/cycle\n", + "\n", + "(d) heat rejected is 484.76 kJ/kg/cycle\n", + "\n", + "(e) net work output is 639.78\n", + "\n", + "(f) efficiency is 0.5689\n", + "\n", + "(g) otto efficiency is 0.602 & diesel efficiency is 0.498\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.7 : Pg - 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#initialisation of variables\n", + "t1=295 #temparature in k\n", + "r=5.25\n", + "g=1.4\n", + "t3=923 #temparature in k\n", + "tc=511 #temparature in k\n", + "tt=633 #temparature in k\n", + "#CALCULATIONS\n", + "t2=t1*(r)**((g-1)/g)\n", + "t4=t3/(r)**((g-1)/g)\n", + "effb=1-((t4-t1)/(t3-t2))\n", + "wt=t3-t4\n", + "wc=t2-t1\n", + "wr1=(1-(t2-t1)/(t3-t4))\n", + "ctwr1=(t2-t1)/(t3-t4)\n", + "effc=(t2-t1)/(tc-t1)\n", + "efft=(t3-tt)/(t3-t4)\n", + "effbr=1-((tt-t1)/(t3-tc))\n", + "wr2=1-((tc-t1)/(t3-tt))\n", + "ctwr2=(tc-t1)/(t3-tt)\n", + "#RESULTS\n", + "print 'work ratio and compressed turbine wrok ratio in first part of problem are %.3f and %0.3f'%(wr1,ctwr1)\n", + "print '\\nwork ratio and compressed turbine wrok ratio in second part of problem are %0.3f and %0.3f'%(wr2,ctwr2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "work ratio and compressed turbine wrok ratio in first part of problem are 0.487 and 0.513\n", + "\n", + "work ratio and compressed turbine wrok ratio in second part of problem are 0.255 and 0.745\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |