From 92cca121f959c6616e3da431c1e2d23c4fa5e886 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 7 Apr 2015 15:58:05 +0530 Subject: added books --- Engineering_Thermodynamics/README.txt | 10 + Engineering_Thermodynamics/ch1.ipynb | 249 ++++++ Engineering_Thermodynamics/ch10.ipynb | 1017 ++++++++++++++++++++++ Engineering_Thermodynamics/ch11.ipynb | 170 ++++ Engineering_Thermodynamics/ch12.ipynb | 805 ++++++++++++++++++ Engineering_Thermodynamics/ch13.ipynb | 590 +++++++++++++ Engineering_Thermodynamics/ch14.ipynb | 502 +++++++++++ Engineering_Thermodynamics/ch15.ipynb | 487 +++++++++++ Engineering_Thermodynamics/ch16.ipynb | 554 ++++++++++++ Engineering_Thermodynamics/ch17.ipynb | 517 ++++++++++++ Engineering_Thermodynamics/ch18.ipynb | 554 ++++++++++++ Engineering_Thermodynamics/ch2.ipynb | 136 +++ Engineering_Thermodynamics/ch3.ipynb | 498 +++++++++++ Engineering_Thermodynamics/ch4.ipynb | 353 ++++++++ Engineering_Thermodynamics/ch5.ipynb | 423 ++++++++++ Engineering_Thermodynamics/ch6.ipynb | 322 +++++++ Engineering_Thermodynamics/ch7.ipynb | 576 +++++++++++++ Engineering_Thermodynamics/ch8.ipynb | 1018 +++++++++++++++++++++++ Engineering_Thermodynamics/ch9.ipynb | 1016 ++++++++++++++++++++++ Engineering_Thermodynamics/screenshots/ch1.png | Bin 0 -> 74665 bytes Engineering_Thermodynamics/screenshots/ch16.png | Bin 0 -> 75493 bytes Engineering_Thermodynamics/screenshots/ch9.png | Bin 0 -> 78654 bytes 22 files changed, 9797 insertions(+) create mode 100755 Engineering_Thermodynamics/README.txt create mode 100755 Engineering_Thermodynamics/ch1.ipynb create mode 100755 Engineering_Thermodynamics/ch10.ipynb create mode 100755 Engineering_Thermodynamics/ch11.ipynb create mode 100755 Engineering_Thermodynamics/ch12.ipynb create mode 100755 Engineering_Thermodynamics/ch13.ipynb create mode 100755 Engineering_Thermodynamics/ch14.ipynb create mode 100755 Engineering_Thermodynamics/ch15.ipynb create mode 100755 Engineering_Thermodynamics/ch16.ipynb create mode 100755 Engineering_Thermodynamics/ch17.ipynb create mode 100755 Engineering_Thermodynamics/ch18.ipynb create mode 100755 Engineering_Thermodynamics/ch2.ipynb create mode 100755 Engineering_Thermodynamics/ch3.ipynb create mode 100755 Engineering_Thermodynamics/ch4.ipynb create mode 100755 Engineering_Thermodynamics/ch5.ipynb create mode 100755 Engineering_Thermodynamics/ch6.ipynb create mode 100755 Engineering_Thermodynamics/ch7.ipynb create mode 100755 Engineering_Thermodynamics/ch8.ipynb create mode 100755 Engineering_Thermodynamics/ch9.ipynb create mode 100755 Engineering_Thermodynamics/screenshots/ch1.png create mode 100755 Engineering_Thermodynamics/screenshots/ch16.png create mode 100755 Engineering_Thermodynamics/screenshots/ch9.png (limited to 'Engineering_Thermodynamics') diff --git a/Engineering_Thermodynamics/README.txt b/Engineering_Thermodynamics/README.txt new file mode 100755 index 00000000..26581a43 --- /dev/null +++ b/Engineering_Thermodynamics/README.txt @@ -0,0 +1,10 @@ +Contributed By: Raviraj Jadeja +Course: mca +College/Institute/Organization: Freelancing work +Department/Designation: Freelancer +Book Title: Engineering Thermodynamics +Author: P. K. Nag +Publisher: Tata McGraw - Hill Education Pvt. Ltd., New Delhi +Year of publication: 2008 +Isbn: 0-07-026062-1 +Edition: 4 \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch1.ipynb b/Engineering_Thermodynamics/ch1.ipynb new file mode 100755 index 00000000..fff2e7be --- /dev/null +++ b/Engineering_Thermodynamics/ch1.ipynb @@ -0,0 +1,249 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0acf769d31306f5bc291e2574308a74de8651b4a4723b52ee59419306e6b7112" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 Page No : 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "d_r = 13640.; \t\t\t# Density of mercury in kg/m3\n", + "g = 9.79; \t\t\t # Acceleration due to gravity in m/s2\n", + "z = 562e-03; \t\t\t# Difference in height in m\n", + "z0 = 761e-03; \t\t\t# Reading of barometer in m\n", + "\n", + "# Calculation\n", + "P = (d_r*g*(z+z0))*(0.987/1e05); \t\t\t# Gas Pressure in bar\n", + "\n", + "# Results\n", + "print \"Gas Pressure is %.3f bar\"%P\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Gas Pressure is 1.744 bar\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 Page No : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "d_r = 13.6e03; \t\t\t# Density of mercury in kg/m3\n", + "g = 9.81; \t\t\t# Acceleration due to gravity in m/s2\n", + "z = 710e-03; \t\t\t# Stean flow pressure in m\n", + "z0 = 772e-03; \t\t\t# Reading of barometer in m\n", + "P = 1.4e06; \t\t\t# Gauge pressure of applied steam in Pa\n", + "\n", + "# Calculation\n", + "P0 = d_r*g*z0; \t\t\t# Atmospheric pressure in Pa\n", + "Pi = P+P0 ; \t\t\t# Inlet steam pressure in Pa\n", + "Pc = d_r*g*(z0-z); \t\t\t# Condenser pressure in Pa\n", + "\n", + "# Results\n", + "print \"Inlet steam pressure is %.3e Pa\"%Pi\n", + "print \"Condenser pressure is %.2e Pa\"%Pc\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Inlet steam pressure is 1.503e+06 Pa\n", + "Condenser pressure is 8.27e+03 Pa\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 Page No : 21" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "z = 0.760; \t\t\t# Barometer reading in m\n", + "# Part (a)\n", + "h1 = 40e-02; \t\t\t# Mercury height in vaccume in m\n", + "d_r = 13.6e03; \t\t\t# Density of mercury in kg/m3\n", + "g = 9.80; \t\t\t# Acceleration due to gravity in m/s2\n", + "\n", + "# Calculation and Results\n", + "Patm = z*d_r*g; \t\t\t# Atmospheric pressure in Pas\n", + "Pv = h1*d_r*g; \t\t\t# Pressue in vaccume in Pa\n", + "Pabst = Patm-Pv; \t\t\t# Absolute pressure in Pa\n", + "Pabs = 101.325 - Pv/1000\n", + "\n", + "print \"Pvaccum = %.2f kPa\"%(Pv/1000)\n", + "print \"Pabsolute = %.f\"%(Pabst/1000),\"kPa\"\n", + "print \"40 cmHg vacuum : %.3f kPa\"%Pabs\n", + "\n", + "# Part (b)\n", + "h2 = 90e-02; \t\t\t# Mercury height in gauge in m\n", + "Pg = h2*d_r*g; \t\t\t# Gauge Pressure in Pa\n", + "Pabs1 = Patm + Pg ; \t\t\t# Absolute pressure in Pa\n", + "\n", + "print \"\\nPgauge = %.f kPa\"%(Pg/1000)\n", + "print \"90cmHg gauge is %.3f\"%(Pabs1/1000),\"kPa\"\n", + "\n", + "# Part(c)\n", + "d_w = 1e03 ; \t\t\t# Density of water in kg/m3\n", + "h3 = 1.2 ; \t\t\t# Gauge Pressure water height in m\n", + "Pga = d_w*h3*g; \t\t\t# Gauge Pressure in Pa\n", + "Pabs3 = Patm + Pga ; \t\t\t# Absolute pressure in Pa\n", + "print \"\\n1.2 m H2O gauge is %.3f\"%(Pabs3/1000),\"kPa\"\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pvaccum = 53.31 kPa\n", + "Pabsolute = 48 kPa\n", + "40 cmHg vacuum : 48.013 kPa\n", + "\n", + "Pgauge = 120 kPa\n", + "90cmHg gauge is 221.245 kPa\n", + "\n", + "1.2 m H2O gauge is 113.053 kPa\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4 Page No : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "\n", + "# Variables\n", + "Pr = 1.033e05; \t\t\t# Required Pressure in bar\n", + "\n", + "# Calculation\n", + "def pressure(p):\n", + " return p**(-0.714);\n", + "g = 9.81; \t\t\t# Acceleration due to gravity in m/s2\n", + "H = ((2.5e05**0.714)/g)* quad(pressure,0,Pr)[0]; \t\t\t# Depth of atmosphere required in m\n", + "\n", + "# Results\n", + "print \"The depth of atmosphere required is %.3f Km\"%(H/1000)\n", + " \n", + "# note : there will be rounding off error because of quad function" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The depth of atmosphere required is 69.203 Km\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5 Page No : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "m = 68. ; \t\t\t# Astronaut mass in Kg\n", + "g = 9.806; \t\t\t# Acceleration due to gravity in m/s2\n", + "\n", + "# Calculation\n", + "a = 10*g ; \t\t\t# Lift off acceleration in m/s2\n", + "F = m*a; \t\t\t# Net vertical force in N\n", + "\n", + "# Results\n", + "print \"Net vertical force experienced by astronaut is %.0f N\"%F\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net vertical force experienced by astronaut is 6668 N\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch10.ipynb b/Engineering_Thermodynamics/ch10.ipynb new file mode 100755 index 00000000..40b22144 --- /dev/null +++ b/Engineering_Thermodynamics/ch10.ipynb @@ -0,0 +1,1017 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:417bf1adea0580223c4d3786d62ed073e6155f8ed43cae453792997d33751fc8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 : Properties of Gases and Gas Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 Page No : 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "# Variables\n", + "# Part (a)\n", + "P1 = 100.\n", + "P2 = 50.;\n", + "T1 = 273.+300;\n", + "\n", + "# Calculation and Results\n", + "T2 = (P2/P1)*T1;\n", + "R = 0.287\n", + "cv = 0.718;\n", + "V1 = 0.8;\n", + "m = (P1*V1)/(R*T1);\n", + "Q = m*cv*(T2-T1);\n", + "print \"If the fluid is in the air\"\n", + "print \"The final temperature is \",T2,\"K\"\n", + "print \"The heat transferred is %.2f kJ/Kg\"%Q\n", + "\n", + "# Part (b)\n", + "t2 = 273+81.33\n", + "vf = 0.00103\n", + "vg = 3.24;\n", + "v1 = 2.6388\n", + "u1 = 2810.4; \n", + "x2 = (v1-vf)/(vg-vf);\n", + "u2 = 340.42+(x2*2143.4);\n", + "m_ = V1/v1;\n", + "Q_ = m_*(u2-u1);\n", + "\n", + "print (\"\\nIf the fluid is in the steam\")\n", + "print \"The final temperature is \",t2,\"K\"\n", + "print \"The heat transferred is %.2f kJ/Kg\"%Q_\n", + "\n", + "# rounding off error. please check . value of m is wrong in book please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "If the fluid is in the air\n", + "The final temperature is 286.5 K\n", + "The heat transferred is -100.07 kJ/Kg\n", + "\n", + "If the fluid is in the steam\n", + "The final temperature is 354.33 K\n", + "The heat transferred is -219.62 kJ/Kg\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 Page No : 353" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# Part (a)\n", + "R = 0.287\n", + "T1 = 273.+150\n", + "v1 = 0.96\n", + "v2 = 1.55\n", + "Cp = 1.005;\n", + "\n", + "# Calculation and Results\n", + "P = (R*T1)/v1;\n", + "W = P*(v2-v1);\n", + "T2 = (v2/v1)*T1;\n", + "Q = Cp*(T2-T1);\n", + "print (\"If the fluid is in the air\")\n", + "print \"The final temperature is %.2f K\"%T2\n", + "print \"The heat transferred is %.2f kJ\"%Q\n", + "print \"Work done is %.2f kJ\"%W\n", + "\n", + "# Part (b)\n", + "vg = 0.3928;\n", + "P1 = 200e03;\n", + "P2 = P1;\n", + "h1 = 2768.8;\n", + "t2 = 273+400; h2 = 3276.5;\n", + "Q_ = h2-h1;\n", + "W_ = P1*(v2-v1);\n", + "print (\"\\nIf the fluid is in the steam\")\n", + "print \"The final temperature is \",t2,\"K\"\n", + "print \"The heat transferred is\",Q_,\"kJ\"\n", + "print \"Work done is\",W_/1000,\"kJ\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "If the fluid is in the air\n", + "The final temperature is 682.97 K\n", + "The heat transferred is 261.27 kJ\n", + "Work done is 74.61 kJ\n", + "\n", + "If the fluid is in the steam\n", + "The final temperature is 673 K\n", + "The heat transferred is 507.7 kJ\n", + "Work done is 118.0 kJ\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 Page No : 355" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "v = 16. ; \t\t\t# v = v1./v2\n", + "P1 = 300e03;\n", + "P2 = P1*v;\n", + "R = 0.287\n", + "T1 = 300+223;\n", + "\n", + "# Calculation and Results\n", + "W12 = R*T1*math.log(1./v);\n", + "\n", + "print (\"If the fluid is in the air\")\n", + "print \"The final pressure is \",P2/1000,\"kPa\"\n", + "print \"The change in internal energy is\",0,\"kJ\"\n", + "print \"Work done is %.2f kJ\"%W12\n", + "\n", + "# Part (b)\n", + "v1 = 0.7664; u1 = 2728.7;\n", + "v2 = v1/16;\n", + "x2 = (v2-0.00125)/(0.05013);\n", + "s2 = 2.7927+(x2*3.2802);\n", + "s1 = 7.5165\n", + "u2 = 1080.37+(x2*1522.0);\n", + "du = u2-u1;\n", + "T = 250+273;\n", + "Q12 = T*(s2-s1)\n", + "\n", + "print (\"\\nIf the fluid is in the steam\")\n", + "print \"The final temperature is \",T,\"K\"\n", + "print \"The heat transferred is\",Q12,\"kJ/kg\"\n", + "print \"The change in internal energy is\",du,\"kJ/kg \"\n", + "\n", + "# rounding off error. please check. value of x2 is wrong in book ." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "If the fluid is in the air\n", + "The final pressure is 4800.0 kPa\n", + "The change in internal energy is 0 kJ\n", + "Work done is -416.17 kJ\n", + "\n", + "If the fluid is in the steam\n", + "The final temperature is 523 K\n", + "The heat transferred is -874.095064273 kJ/kg\n", + "The change in internal energy is -231.986493118 kJ/kg \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 Page No : 356" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# Part (a)\n", + "P1 = 10.\n", + "P2 = 1.;\n", + "T1 = 273.+300;\n", + "g = 1.4;\n", + "\n", + "# Calculation and Results\n", + "T2 = T1*((P2/P1)**((g-1)/g));\n", + "R = 0.287;\n", + "W12 = ((R*T1)/(1-g))*(T2/T1-1);\n", + "v2 = (R*T2)/(100*P2);\n", + "\n", + "print (\"If the fluid is in the air\")\n", + "print \"The specific volume is %.3f m3/Kg\"%v2\n", + "print \"The work done per kg of the fluid is %.2f kJ\"%W12\n", + "\n", + "# Part (b)\n", + "u1 = 2793.2\n", + "v1 = 0.2579\n", + "s1 = 7.1228;\n", + "x2 = (7.1228-1.3025)/6.0568;\n", + "u2 = 417.33+(x2*2088.7);\n", + "v2 = 0.001043+(0.96*1.693);\n", + "W12 = u1-u2;\n", + "print (\"\\nIf the fluid is in the steam\")\n", + "print \"The specific volume is %.3f m3/Kg\"%v2\n", + "print \"The work done per kg of the fluid is %.1f kJ\"%round(W12,-1)\n", + "\n", + "# note : rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "If the fluid is in the air\n", + "The specific volume is 0.852 m3/Kg\n", + "The work done per kg of the fluid is 198.19 kJ\n", + "\n", + "If the fluid is in the steam\n", + "The specific volume is 1.626 m3/Kg\n", + "The work done per kg of the fluid is 370.0 kJ\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 Page No : 357" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# Part (a)\n", + "P1 = 10.\n", + "P2 = 1.;\n", + "T1 = 273.+200\n", + "n = 1.15\n", + "R = 0.287;\n", + "\n", + "# Calculation and Results\n", + "v2 = ((R*T1)/(P1*100))*((P1/P2)**(1./1.15));\n", + "v1 = ((R*T1)/(P1*100));\n", + "T2 = T1*(P2/P1)*(v2/v1);\n", + "cv = 0.716;\n", + "Q = (cv+(R/(1-n)))*(T2-T1);\n", + "\n", + "print (\"If the fluid is in the air\")\n", + "print \"The specific volume is %.4f m3/Kg\"%v2\n", + "print \"The final temperature is %.1f K\"%T2\n", + "print \"Heat transferred per kg is %.f kJ\"%Q\n", + "\n", + "# Part (b)\n", + "v1 = 0.20596\n", + "u1 = 2621.9;\n", + "v2 = v1*(P1/P2)**(1./n);\n", + "x2 = (v2-0.001043)/(1.694-0.001043);\n", + "t2 = 99.62;\n", + "W = ((P1*100*0.13575)-(P2*100*1.525))/(n-1);\n", + "Q = 2366.1-u1+W;\n", + "\n", + "print (\"\\nIf the fluid is in the steam\")\n", + "print \"The specific volume is %.3f m3/Kg\"%v2\n", + "print \"The final temperature is \",t2,\"C\"\n", + "print \"Heat transferred per kg is %.2f kJ\"%Q\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "If the fluid is in the air\n", + "The specific volume is 1.0053 m3/Kg\n", + "The final temperature is 350.3 K\n", + "Heat transferred per kg is 147 kJ\n", + "\n", + "If the fluid is in the steam\n", + "The specific volume is 1.525 m3/Kg\n", + "The final temperature is 99.62 C\n", + "Heat transferred per kg is -367.47 kJ\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 Page No : 359" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P0 = 1000.;\n", + "T0 = 3.; \n", + "V0 = 0.001;\n", + "R = 287.;\n", + "\n", + "# Calculation\n", + "n = (P0*V0)/(R*T0); \t\t\t# Number of moles\n", + "\n", + "# Process ab\n", + "Wab = 0;\n", + "cv = (3/2.)*R;\n", + "Ta = T0; Tb = 300;\n", + "Qab = n*cv*(Tb-Ta);\n", + "Ua = 0; \t\t\t# Given internal energy\n", + "Ub = Qab+Ua;\n", + "Uab = Ub-Ua;\n", + "print Qab\n", + "# Process bc\n", + "Qbc = 0\n", + "Uc = 0\n", + "Ubc = Uc-Ub;\n", + "Wbc = -Ubc;\n", + "# Process ca\n", + "Tc = Ta;\n", + "g = 5./3; \t\t\t# gamma\n", + "Vcb = (Tb/Tc)**(3./2); \t\t\t# Vc/Vb\n", + "Wca = -n*R*Tc*math.log(Vcb);\n", + "Qca = Wca ;\n", + "Uca = 0;\n", + "\n", + "# Results\n", + "print \"Work done in the cycle is %.1f J\"%(Wbc)\n", + "print \"Internal energy change in the cycle is\",Ub,\"J\"\n", + "print \"Heat transfer in the cycle is %.2f\"%(Wca)\n", + "\n", + "# Part (b)\n", + "e = (Qab+Qca)/Qab;\n", + "print \"Thermal efficiency of the system is %.3f %%\"%(e)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "148.5\n", + "Work done in the cycle is 148.5 J\n", + "Internal energy change in the cycle is 148.5 J\n", + "Heat transfer in the cycle is -6.91\n", + "Thermal efficiency of the system is 0.953 %\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 Page No : 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "Pa = 1.5; \n", + "Ta = 273.+50; \n", + "ca = 0.5;\n", + "Pb = 0.6; \n", + "Tb = 20.+273; \n", + "mb = 2.5;\n", + "R = 8.3143;\n", + "\n", + "# Calculation\n", + "Va = (ca*R*Ta)/(Pa*1e03);\n", + "ma = ca*28;\n", + "Rn = R/28.;\n", + "Vb = (mb*Rn*Tb)/(Pb*1e03);\n", + "V = Va + Vb ;\n", + "m = ma + mb ;\n", + "Tf = 27+273.;\n", + "P = (m*Rn*Tf)/V;\n", + "g = 1.4;\n", + "cv = Rn/(g-1);\n", + "U1 = cv*(ma*Ta+mb*Tb);\n", + "U2 = m*cv*Tf;\n", + "Q = U2-U1;\n", + "\n", + "# Results\n", + "print \"The final equillibrium pressure is %.3f MPa\"%(P/1000)\n", + "print \"The amount of heat transferred to the surrounding is %.1f kJ\"%Q\n", + "T_ = (ma*Ta+mb*Tb)/m ;\n", + "P_ = (m*Rn*T_)/V;\n", + "print \"If the vessel is perfectly inslulated\"\n", + "print \"The final temperature is %.1f k\"%T_\n", + "print \"The final pressure is %.2f MPa\"%(P_/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final equillibrium pressure is 1.169 MPa\n", + "The amount of heat transferred to the surrounding is -226.0 kJ\n", + "If the vessel is perfectly inslulated\n", + "The final temperature is 318.5 k\n", + "The final pressure is 1.24 MPa\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 Page No : 361" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "cp = 1.968; \n", + "cv = 1.507;\n", + "R_ = 8.314;\n", + "V = 0.3; \n", + "m = 2.; \n", + "T1 = 5.+273; \n", + "T2 = 100.+273;\n", + "\n", + "# Calculation\n", + "R = cp-cv;\n", + "mu = R_/R;\n", + "Q12 = m*cv*(T2-T1);\n", + "W12 = 0 ;\n", + "U21 = Q12;\n", + "H21= m*cp*(T2-T1);\n", + "S21 = m*cv*math.log(T2/T1);\n", + "\n", + "# Results\n", + "print \"Molecular weight and the gas constant of the gas are %.2f kJ/Kg mol and %.3f kJ/Kg K\"%(mu,R)\n", + "print \"Work done\",0,\"kJ\"\n", + "print \"The heat transferred %.2f kJ\"%Q12\n", + "print \"The change in internal energy \",U21,\"kJ\"\n", + "print \"Change in entropy %.1f kJ/K\"%S21\n", + "print \"Change in enthalpy\",H21,\"kJ\"\n", + "\n", + "# rounding off error would be there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Molecular weight and the gas constant of the gas are 18.03 kJ/Kg mol and 0.461 kJ/Kg K\n", + "Work done 0 kJ\n", + "The heat transferred 286.33 kJ\n", + "The change in internal energy 286.33 kJ\n", + "Change in entropy 0.9 kJ/K\n", + "Change in enthalpy 373.92 kJ\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.9 Page No : 362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "# Variables\n", + "m = 1.5;\n", + "P1 = 5.6; \n", + "V1 = 0.06;\n", + "T2 = 273.+240;\n", + "a = 0.946; b = 0.662;\n", + "k = 0.0001;\n", + "\n", + "# Calculation\n", + "# Part (b)\n", + "R = a-b;\n", + "T1 = (P1*1e03*V1)/(m*R);\n", + "def f8(T): \n", + "\t return m*(b+k*T)\n", + "\n", + "W12 = - quad(f8,T1,T2)[0]\n", + "\n", + "# Results\n", + "print \"The work done in the expansion is %.0f kJ\"%W12\n", + "\n", + "# note : answer is different becaues of quad function." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The work done in the expansion is 301 kJ\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.11 Page No : 363" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 0.5;\n", + "P1 = 80e03; \n", + "T1 = 273.+60;\n", + "P2 = 0.4e06;\n", + "R = 0.287;\n", + "V1 = (m*R*T1)/P1 ;\n", + "g = 1.4; \t\t\t# Gamma\n", + "\n", + "# Calculation\n", + "T2 = T1*(P2/P1)**((g-1)/g);\n", + "W12 = (m*R*(T1-T2))/(g-1);\n", + "V2 = V1*((P1/P2)**(1./g));\n", + "W23 = P2*(V1-V2);\n", + "W = W12+W23;\n", + "V3 = V1;\n", + "T3 = T2*(V3/V2);\n", + "cp = 1.005;\n", + "Q = m*cp*(T3-T2);\n", + "\n", + "# Results\n", + "print \"The work transfer for the whole path is %.1f kJ\"%W\n", + "print \"The heat transfer for the whole path %.2f kJ\"%Q\n", + "\n", + "# note : incorrect answer in the textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The work transfer for the whole path is 93.5 kJ\n", + "The heat transfer for the whole path 571.64 kJ\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.12 Page No : 365" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 700e03\n", + "T1 = 273.+260; \n", + "T3 = T1;\n", + "V1 = 0.028; \n", + "V2 = 0.084;\n", + "R = 0.287;\n", + "\n", + "# Calculation\n", + "m = (P1*V1)/(R*T1);\n", + "P2 = P1;\n", + "T2 = T1*((P2*V2)/(P1*V1));\n", + "n = 1.5;\n", + "P3 = P2*((T3/T2)**(n/(n-1)));\n", + "cp = 1.005; cv = 0.718;\n", + "Q12 = m*cp*(T2-T1);\n", + "Q23 = m*cv*(T3-T2) + (m*R*(T2-T3))/(n-1);\n", + "Q31 = m*R*T1*math.log(P3/P1);\n", + "Q1 = Q12;\n", + "Q2 = -(Q23+Q31);\n", + "e = 1-(Q2/Q1);\n", + "\n", + "# Results\n", + "print \"The heat received in the cycle is\",round(Q1/1000,2),\"kJ\"\n", + "print \"The heat rejected in the cycle\",round(Q2/1000,2),\"J\"\n", + "print \"The efficiency of the cycle is %.2f\"%e\n", + "\n", + "# note : rounding error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat received in the cycle is 137.27 kJ\n", + "The heat rejected in the cycle 84.27 J\n", + "The efficiency of the cycle is 0.39\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.13 Page No : 366" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 300e03; \n", + "V1 = 0.07;\n", + "m = 0.25; \n", + "T1 = 80+273;\n", + "\n", + "# Calculation\n", + "R = (P1*V1)/(1000*m*T1);\n", + "P2 = P1;\n", + "V2 = 0.1;\n", + "T2 = (P2*V2)/(1000*m*R);\n", + "W = -25;\n", + "cv = -W/(m*(T2-T1));\n", + "cp = R+cv;\n", + "S21 = m*cp*math.log(V2/V1); \t\t\t# S21 = S2-S1\n", + "\n", + "# Results\n", + "print \"cv of the gas is %.3f kJ/Kg K\"%cv\n", + "print \"cp of the gas is %.3f kJ/Kg K\"%cp\n", + "print \"Increase in the entropy of the gas is %.2f kJ/Kg K\"%S21\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "cv of the gas is 0.661 kJ/Kg K\n", + "cp of the gas is 0.899 kJ/Kg K\n", + "Increase in the entropy of the gas is 0.08 kJ/Kg K\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.14 Page No : 367" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P1 = 1.;\n", + "P2 = 15.;\n", + "V1 = 800e-06;\n", + "V2 = V1/8;\n", + "cv = 0.718; \n", + "g = 1.4;\n", + "\n", + "# Calculation\n", + "n = (math.log(P2/P1))/(math.log(V1/V2))\n", + "T1 = 348; R = 0.287;\n", + "m = (P1*100*V1)/(R*T1);\n", + "T2 = T1*((P2*V2)/(P1*V1));\n", + "P3 = 50;\n", + "T3 = T2*(P3/P2);\n", + "S21 = m*(cv*math.log(T2/T1)+R*math.log(V2/V1));\n", + "S32 = m*cv*math.log(T3/T2);\n", + "Q = (m*cv*(g-n)*(T2-T1))/(1-n);\n", + "\n", + "# Results\n", + "print \"The index of compression process is %.1f\"%n\n", + "print \"T2 = %.1f K\"%T2\n", + "print \"S2-S1 is %.6f kJ/K\"%S21\n", + "print \"S3-S2 is %.6f kJ/k\"%S32\n", + "print \"The heat exchange is %.3f kJ\"%Q\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The index of compression process is 1.3\n", + "T2 = 652.5 K\n", + "S2-S1 is -0.000117 kJ/K\n", + "S3-S2 is 0.000692 kJ/k\n", + "The heat exchange is -0.057 kJ\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.15 Page No : 368" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "mn = 3.; \t\t\t# Mass of nitrogen in kg\n", + "mc = 5.; \t\t\t# mass of CO2 in kg\n", + "an = 28.; \t\t\t# Atomic weight of nitrogen\n", + "ac = 44.; \t\t\t# Atomic weight of CO2\n", + "\n", + "# Calculation and Results\n", + "# Part (a)\n", + "xn = (mn/an)/((mn/an)+(mc/ac)); \n", + "xc = (mc/ac)/((mn/an)+(mc/ac)); \n", + "print \"Mole fraction of N2 is %.3f\"%xn\n", + "print \"Mole fraction of CO2 is %.3f\"%xc\n", + "\n", + "# Part (b)\n", + "M = xn*an+xc*ac;\n", + "print \"Equivalant molecular weight of mixture is %.2f Kg\"%M\n", + "\n", + "# Part (c)\n", + "R = 8.314;\n", + "Req = ((mn*R/an)+(mc*R/ac))/(mn+mc);\n", + "print \"The equivalent gas consmath.tant of the mixture is %.3f kJ/Kg K\"%Req\n", + "\n", + "# Part (d)\n", + "P = 300.; \t\t\t# Pressure in kPa\n", + "T = 20.+273;\n", + "Pn = xn*P; \t\t\t# Partial pressure of Nitrogen\n", + "Pc = xc*P; \t\t\t# Partial pressure of CO2 \n", + "Vn = (mn*R*T)/(P*an); \t\t\t# Volume of nitrogen\n", + "Vc = (mc*R*T)/(P*ac); \t\t\t# Volume of CO2\n", + "print \"Partial pressures of nitrogen and CO2 are %.1f and %.1f kPa respectively\"%(Pn,Pc)\n", + "print \"Partial volume of nitrogen and CO2 are %.2f and %.2f m3 respectively\"%(Vn,Vc)\n", + "\n", + "# Part (e)\n", + "V = (mn+mc)*Req*T/P; \t\t\t# Total volume\n", + "rho = (mn+mc)/V;\n", + "print \"Volume of mixture is %.2f m3\"%V\n", + "print \"Density of mixture is %.2f Kg/m3\"%rho\n", + "\n", + "# Part (f)\n", + "gn = 1.4; \t\t\t# Gamma\n", + "gc = 1.286;\n", + "cvn = R/((gn-1)*an); \t\t\t# cp and cv of N2\n", + "cpn = gn*cvn; \n", + "cvc = R/((gc-1)*ac); \t\t\t# cp and cv of CO2\n", + "cpc = gc*cvc;\n", + "cp = (mn*cpn+mc*cpc)/(mn+mc) ; \t\t\t# of mixture\n", + "cv = (mn*cvn+mc*cvc)/(mn+mc) ;\n", + "print \"cp and cv of mixture are %.2f and %.2f kJ/Kg K respectively\"%(cp,cv)\n", + "\n", + "T1 = T; \n", + "T2 = 40.+273;\n", + "U21 = (mn+mc)*cv*(T2-T1);\n", + "H21 = (mn+mc)*cp*(T2-T1);\n", + "S21v = (mn+mc)*cv*math.log(T2/T1); \t\t\t# If heated at constant volume\n", + "\n", + "print \"Change in internal energy of the system heated at constant volume is %.1f kJ\"%U21\n", + "print \"Change in enthalpy of the system heated at constant volume is %.1f kJ\"%H21\n", + "print \"Change in entropy of the system heated at constant volume is %.3f kJ/Kg K\"%S21v\n", + "S21p = (mn+mc)*cp*math.log(T2/T1); \t\t\t# If heated at constant Pressure\n", + "print \"Change in entropy of the system heated at constant Pressure is %.2f kJ\"%S21p\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mole fraction of N2 is 0.485\n", + "Mole fraction of CO2 is 0.515\n", + "Equivalant molecular weight of mixture is 36.24 Kg\n", + "The equivalent gas consmath.tant of the mixture is 0.229 kJ/Kg K\n", + "Partial pressures of nitrogen and CO2 are 145.6 and 154.4 kPa respectively\n", + "Partial volume of nitrogen and CO2 are 0.87 and 0.92 m3 respectively\n", + "Volume of mixture is 1.79 m3\n", + "Density of mixture is 4.46 Kg/m3\n", + "cp and cv of mixture are 0.92 and 0.69 kJ/Kg K respectively\n", + "Change in internal energy of the system heated at constant volume is 110.6 kJ\n", + "Change in enthalpy of the system heated at constant volume is 147.3 kJ\n", + "Change in entropy of the system heated at constant volume is 0.365 kJ/Kg K\n", + "Change in entropy of the system heated at constant Pressure is 0.49 kJ\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.16 Page No : 370" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "mo = 2.;\n", + "mn = 6.;\n", + "muo = 32.; \n", + "mun = 28.;\n", + "\n", + "# Calculation\n", + "o = mo/muo;\n", + "n = mn/mun;\n", + "xo = o/(n+o);\n", + "xn = n/(n+o);\n", + "R = 8.314;\n", + "Ro = R/muo; Rn = R/mun;\n", + "dS = -mo*Ro*math.log(xo)-mn*Rn*math.log(xn);\n", + "\n", + "# Results\n", + "print \"Increase in entropy is %.4f kJ/Kg K\"%dS\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in entropy is 1.2292 kJ/Kg K\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.17 Page No : 371" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "an = 20.183; \t\t\t# molecular weight of neon\n", + "Pc = 2.73; \t\t\t# Critical pressure\n", + "Tc = 44.5;\n", + "Vc = 0.0416;\n", + "Pr = 2; \t\t\t# Reduced Pressure\n", + "Tr = 1.3; \n", + "Z = 0.7;\n", + "\n", + "# Calculation\n", + "P = Pr*Pc; \n", + "T = Tr*Tc;\n", + "R = 8.314;\n", + "v = (Z*R*T)/(P*1000*an);\n", + "vr = (v*an)/Vc ;\n", + "\n", + "# Results\n", + "print \"Specific volume is %.3e m3/Kg\"%v\n", + "print \"Specific temperature is\",T,\"K\"\n", + "print \"Specific pressure is\",P,\"MPa\"\n", + "print \"Reduced volume is %.2f\"%vr\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific volume is 3.055e-03 m3/Kg\n", + "Specific temperature is 57.85 K\n", + "Specific pressure is 5.46 MPa\n", + "Reduced volume is 1.48\n" + ] + } + ], + "prompt_number": 31 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch11.ipynb b/Engineering_Thermodynamics/ch11.ipynb new file mode 100755 index 00000000..66454009 --- /dev/null +++ b/Engineering_Thermodynamics/ch11.ipynb @@ -0,0 +1,170 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b99b43ef9ee3f0e18b3e8ae0d1337578843f4e3386da957a44c33db0abf4a4dd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Thermodynamic Relations, Equilibrium and Stability" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 Page No : 418" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Tb = 353.;\n", + "T = 303.;\n", + "R = 8.3143;\n", + "\n", + "# Calculation\n", + "P = 101.325*math.exp((88/R)*(1-(Tb/T)));\n", + "\n", + "# Results\n", + "print \"Vapour pressure of benzene is %.1f kPa\"%P\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Vapour pressure of benzene is 17.7 kPa\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 Page No : 418" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T = (3754.-3063)/(23.03-19.49);\n", + "P = math.exp(23.03-(3754/195.2));\n", + "\n", + "# Calculation\n", + "R = 8.3143;\n", + "Lsub = R*3754;\n", + "Lvap = 3063*R;\n", + "Lfu = Lsub-Lvap;\n", + "\n", + "# Results\n", + "print \"Temperature of triple point is %.1f K\"%T\n", + "print \"Pressure of triple point is %.2f mm Hg\"%P\n", + "print \"Latent heat of sublimation is %.0f kJ/Kg mol\"%round(Lsub,-2)\n", + "print \"Latent heat of vapourization is %.0f kJ/kg mol\"%round(Lvap,-2)\n", + "print \"Latent heat of fusion is %.0f kJ/kg mol\"%round(Lfu,-2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of triple point is 195.2 K\n", + "Pressure of triple point is 44.63 mm Hg\n", + "Latent heat of sublimation is 31200 kJ/Kg mol\n", + "Latent heat of vapourization is 25500 kJ/kg mol\n", + "Latent heat of fusion is 5700 kJ/kg mol\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 Page No : 420" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "R = 8.314;\n", + "N1 = 0.5e-03; \n", + "N2 = 0.75e-03; \t\t\t# Mole number of system 1 and 2 in kg/mol\n", + "T1 = 200.; \n", + "T2 = 300.; \n", + "V = 0.02;\n", + "\n", + "# Calculation\n", + "Tf = ((N1*T1)+(N2*T2))/(N1+N2); \t\t\t# Final temperature\n", + "Uf1 = (3./2)*R*N1*Tf;\n", + "Uf2 = (3./2)*R*N2*Tf;\n", + "Pf = (R*Tf*(N1+N2))/V;\n", + "Vf1 = (R*N1*Tf)/Pf;\n", + "Vf2 = V - Vf1;\n", + "\n", + "# Results\n", + "print (\"System 1\")\n", + "print \"Volume is\",Vf1,\"m3\"\n", + "print \"Energy is %.2f kJ\"%Uf1\n", + "print \"\\nSystem 2\"\n", + "print \"Volume is\",Vf2,\"m3\"\n", + "print \"Energy is\",round(Uf2*1000,-1),\"kJ\"\n", + "print \"Final temperature is\",Tf,\"K\"\n", + "print \"Final Pressure is\",round(Pf),\"kN/m**2\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "System 1\n", + "Volume is 0.008 m3\n", + "Energy is 1.62 kJ\n", + "\n", + "System 2\n", + "Volume is 0.012 m3\n", + "Energy is 2430.0 kJ\n", + "Final temperature is 260.0 K\n", + "Final Pressure is 135.0 kN/m**2\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch12.ipynb b/Engineering_Thermodynamics/ch12.ipynb new file mode 100755 index 00000000..9036d55c --- /dev/null +++ b/Engineering_Thermodynamics/ch12.ipynb @@ -0,0 +1,805 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:abd75e2d0144cfdf6dd59935ddb4f9b5824ec80059ba3e73a72bf780292d0a06" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 : Vapour Power Cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 Page No : 475" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# Part (a)\n", + "P1 = 1e05;\n", + "P2 = 10e05;\n", + "vf = 0.001043;\n", + "\n", + "# Calculation and Results\n", + "Wrev = vf*(P1-P2);\n", + "print \"The work required in saturated liquid form is\",Wrev/1000,\"kJ/kg\"\n", + "\n", + "# Part (b)\n", + "h1 = 2675.5; \n", + "s1 = 7.3594;\n", + "s2 = s1;\n", + "h2 = 3195.5;\n", + "Wrev1 = h1-h2;\n", + "print \"The work required in saturated vapour form is\",Wrev1,\"kJ/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The work required in saturated liquid form is -0.9387 kJ/kg\n", + "The work required in saturated vapour form is -520.0 kJ/kg\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 Page No : 476" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3159.3;\n", + "s1 = 6.9917;\n", + "h3 = 173.88; \n", + "s3 = 0.5926; \n", + "sfp2 = s3; \n", + "hfp2 = h3;\n", + "hfgp2 = 2403.1; \n", + "sgp2 = 8.2287;\n", + "vfp2 = 0.001008; \n", + "sfgp2 = 7.6361;\n", + "\n", + "# Calculation and Results\n", + "x2s = (s1-sfp2)/(sfgp2);\n", + "h2s = hfp2+(x2s*hfgp2);\n", + "\n", + "# Part (a)\n", + "P1 = 20e02; \n", + "P2 = 0.08e02;\n", + "h4s = vfp2*(P1-P2)+h3 ; \n", + "Wp = h4s-h3;\n", + "Wt = h1-h2s;\n", + "Wnet = Wt-Wp;\n", + "Q1 = h1-h4s;\n", + "n_cycle = Wnet/Q1;\n", + "print \"Net work per kg of steam is %.2f kJ/Kg\"%Wnet\n", + "print \"Cycle efficiency is %.3f\"%n_cycle\n", + "\n", + "# Part (b)\n", + "n_p = 0.8; \n", + "n_t = 0.8;\n", + "Wp_ = Wp/n_p;\n", + "Wt_ = Wt*n_t;\n", + "Wnet_ = Wt_-Wp_;\n", + "P = 100*((Wnet-Wnet_)/Wnet) ;\n", + "n_cycle_ = Wnet_/Q1;\n", + "P_ = 100*((n_cycle-n_cycle_)/n_cycle);\n", + "print \"Percentage reduction in net work per kg of steam is %.1f %%\"%P\n", + "print \"Percentage reduction in cycle efficiency is %.1f %%\"%P_\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work per kg of steam is 969.60 kJ/Kg\n", + "Cycle efficiency is 0.325\n", + "Percentage reduction in net work per kg of steam is 20.1 %\n", + "Percentage reduction in cycle efficiency is 20.1 %\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 Page No : 477" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 0.08; \t\t\t# in bar\n", + "sf = 0.5926; \n", + "x2s = 0.85; \n", + "sg = 8.2287; \n", + "\n", + "# Calculation\n", + "s2s = sf+(x2s*(sg-sf));\n", + "s1 = s2s;\n", + "P2 = 16.832; \t\t\t# by steam table opposite to s1 in bar\n", + "h1 = 3165.54;\n", + "h2s = 173.88 + (0.85*2403.1);\n", + "h3 = 173.88;\n", + "vfp2 = 0.001;\n", + "h4s = h3 + (vfp2*(P2-P1)*100);\n", + "Q1 = h1-h4s;\n", + "Wt = h1-h2s;\n", + "Wp = h4s-h3;\n", + "n_cycle = 100*((Wt-Wp)/Q1);\n", + "Tm = (h1-h4s)/(s2s-sf);\n", + "\n", + "# Results\n", + "print \"The greatest allowable steam pressure at the turbine inlet is\",P2,\"bar\"\n", + "print \"Rankine cycle efficiency is %.2f %%\"%n_cycle\n", + "print \"Mean temperature of heat addition is %.2f K\"%Tm\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The greatest allowable steam pressure at the turbine inlet is 16.832 bar\n", + "Rankine cycle efficiency is 31.68 %\n", + "Mean temperature of heat addition is 460.66 K\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 Page No : 478" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3465.;\n", + "h2s = 3065.; \n", + "h3 = 3565.;\n", + "h4s = 2300.; \n", + "x4s = 0.88; \n", + "h5 = 191.83;\n", + "v = 0.001;\n", + "P = 150.; \t\t\t# in bar\n", + "\n", + "# Calculation\n", + "Wp = v*P*100;\n", + "h6s = 206.83;\n", + "Q1 = (h1-h6s)+(h3-h2s);\n", + "Wt = (h1-h2s)+(h3-h4s);\n", + "Wnet = Wt-Wp;\n", + "n_cycle = 100*Wnet/Q1;\n", + "sr = 3600/Wnet;\n", + "\n", + "# Results\n", + "print \"Quality at turbine exhaust is\",0.88\n", + "print \"Cycle efficiency is %.1f %%\"%n_cycle\n", + "print \"steam rate is %.2f Kg/kW h\"%sr\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quality at turbine exhaust is 0.88\n", + "Cycle efficiency is 43.9 %\n", + "steam rate is 2.18 Kg/kW h\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 Page No : 479" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3230.9; \n", + "s1 = 6.9212; \n", + "s2 = s1; \n", + "s3 = s1;\n", + "h2 = 2796; \n", + "sf = 0.6493; \n", + "sfg = 7.5009;\n", + "\n", + "# Calculation\n", + "x3 = (s3-sf)/sfg;\n", + "h3 = 191.83 + x3*2392.8;\n", + "h4 = 191.83; h5 = h4;\n", + "h6 = 640.23; h7 = h6;\n", + "m = (h6-h5)/(h2-h5);\n", + "Wt = (h1-h2)+(1-m)*(h2-h3);\n", + "Q1 = h1-h6;\n", + "n_cycle = 100*Wt/Q1;\n", + "sr = 3600/Wt;\n", + "s7 = 1.8607; s4 = 0.6493;\n", + "Tm = (h1-h7)/(s1-s7);\n", + "Tm1 = (h1-h4)/(s1-s4); \t\t\t# With out regeneration\n", + "dT = Tm-Tm1;\n", + "Wt_ = h1-h3;\n", + "sr_ = 3600/Wt_;\n", + "dsr = sr-sr_;\n", + "n_cycle_ = 100*(h1-h3)/(h1-h4);\n", + "dn = n_cycle-n_cycle_;\n", + "\n", + "# Results\n", + "print \"Efficiency of the cycle is %.2f %%\"%n_cycle\n", + "print \"Steam rate of the cycle is %.2f kg/kW h\"%sr\n", + "print \"Increase in temperature due to regeneration is %.1f degree centigrade\"%dT\n", + "print \"Increase in steam rate due to regeneration is %.1f kg/kW h\"%dsr\n", + "print \"Increase in Efficiency of the cycle due to regeneration is %.2f %%\"%dn\n", + "\n", + "# note: rounding error is there because of decimal points." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the cycle is 36.07 %\n", + "Steam rate of the cycle is 3.85 kg/kW h\n", + "Increase in temperature due to regeneration is 27.4 degree centigrade\n", + "Increase in steam rate due to regeneration is 0.4 kg/kW h\n", + "Increase in Efficiency of the cycle due to regeneration is 1.90 %\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 Page No : 481" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3023.5; \n", + "s1 = 6.7664; \n", + "s2 = s1; \n", + "s3 = s1; \n", + "s4 = s1;\n", + "t_sat_20 = 212.;\n", + "t_sat_1 = 46.;\n", + "\n", + "# Calculation\n", + "dt = t_sat_20-t_sat_1;\n", + "n =3; \t\t\t# number of heaters\n", + "t = dt/n;\n", + "t1 = t_sat_20-t;\n", + "t2 = t1-t;\n", + "\n", + "# 0.1 bar\n", + "hf = 191.83; \n", + "hfg = 2392.8; \n", + "sf = 0.6493;\n", + "sg = 8.1502;\n", + "# At 100 degree\n", + "hf100 = 419.04; \n", + "hfg100 = 2257.0; \n", + "sf100 = 1.3069; \n", + "sg100 = 7.3549;\n", + "# At 150 degree\n", + "hf150 = 632.20; \n", + "hfg150 = 2114.3; \n", + "sf150 = 1.8418; \n", + "sg150 = 6.8379;\n", + "x2 = (s1-sf150)/4.9961;\n", + "h2 = hf150+(x2*hfg150);\n", + "x3 = (s1-sf100)/6.0480;\n", + "h3 = hf100+(x3*hfg100);\n", + "x4 = (s1-sf)/7.5010;\n", + "h4 = hf+(x4*hfg);\n", + "h5 = hf; h6 = h5;\n", + "h7 = hf100; h8 = h7;\n", + "h9 = 632.2; h10 = h9;\n", + "m1 = (h9-h7)/(h2-h7);\n", + "m2 = ((1-m1)*(h7-h6))/(h3-h6);\n", + "Wt = 1*(h1-h2)+(1-m1)*(h2-h3)+(1-m1-m2)*(h3-h4);\n", + "Q1 = h1-h9;\n", + "Wp = 0 ; \t\t\t# Pump work is neglected\n", + "n_cycle = 100*(Wt-Wp)/Q1;\n", + "sr = 3600/(Wt-Wp);\n", + "\n", + "# Results \n", + "print \"Net work per kg of stem is %.2f kJ/Kg\"%Wt\n", + "print \"Cycle efficiency is %.2f %%\"%n_cycle\n", + "print \"Stream rate is %.2f Kg/kW h\"%sr\n", + "\n", + "# rounding off error would be there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work per kg of stem is 798.64 kJ/Kg\n", + "Cycle efficiency is 33.40 %\n", + "Stream rate is 4.51 Kg/kW h\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 Page No : 483" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Ti = 2000.;\n", + "Te = 450.;\n", + "T0 = 300.;\n", + "Q1_dot = 100e03; \t\t\t# in kW\n", + "cpg = 1.1;\n", + "\n", + "# Calculation\n", + "wg = Q1_dot/(cpg*(Ti-Te));\n", + "af1 = wg*cpg*T0*((Ti/T0)-1-math.log(Ti/T0));\n", + "af2 = wg*cpg*T0*((Te/T0)-1-math.log(Te/T0));\n", + "afi = af1-af2;\n", + "h1 = 2801; h3 = 169; h4 = 172.8; h2 = 1890.2;\n", + "s1 = 6.068; s2 = s1; s3 = 0.576; s4 = s3;\n", + "Wt = h1-h2;\n", + "Wp = h4-h3;\n", + "Q1 = h1-h4;\n", + "Q2 = h2-h3;\n", + "Wnet = Wt-Wp;\n", + "ws = Q1_dot/2628;\n", + "afu = 38*(h1-h4-T0*(s1-s3));\n", + "I_dot = afi-afu;\n", + "Wnet_dot = ws*Wnet;\n", + "afc = ws*(h2-h3-T0*(s2-s3));\n", + "n2 = 100*Wnet_dot/af1;\n", + "\n", + "# Results\n", + "print \"The second law efficiency is %.1f %%\"%n2\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The second law efficiency is 47.3 %\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.8 Page No : 485" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "h1 = 2758.; # kJ/kg\n", + "h2 = 1817.; \n", + "h3 = 192.\n", + "h4 = 200.;\n", + "cpg = 1.1\n", + "\n", + "# Calculation and Results\n", + "Wt = h1-h2; \n", + "Wp = h4-h3;\n", + "Q1 = h1-h4; \n", + "Wnet = Wt-Wp;\n", + "n1 = Wnet/Q1;\n", + "WR = Wnet/Wt;\n", + "Q1_ = 100.;\n", + "PO = n1*Q1_;\n", + "cp = 1000.;\n", + "wg = (Q1_/(833.-450));\n", + "EIR = 59.3\n", + "n2 = PO/EIR ;\n", + "print (\"Part (a)\")\n", + "print \"n1 is %.1f %%\"%(n1*100)\n", + "print \"n2 is %.1f %%\"%(n2*100)\n", + "print \"Work ratio is %.3f\"%WR\n", + "\n", + "# Part (b)\n", + "h1b = 3398.; \n", + "h2b = 2130.\n", + "h3b = 192.; \n", + "h4b = 200.;\n", + "Wtb = 1268.; \n", + "Wpb = 8.; \n", + "Q1b = 3198.;\n", + "Wt = 1268.\n", + "Wp = 8.\n", + "n1b = (Wt-Wp)/Q1b;\n", + "WRb = (Wt-Wp)/Wtb;\n", + "EIRb = 59.3;\n", + "Wnetb = Q1b*n1b;\n", + "n2b = 36.5/EIRb;\n", + "print (\"\\nPart (b)\")\n", + "print \"n1 is %.1f %%\"%(n1b*100)\n", + "print \"n2 is %.1f %%\"%(n2b*100)\n", + "print \"Work ratio is %.3f\"%WRb\n", + "\n", + "# Part (c)\n", + "h1c = 3398.; \n", + "h2c = 2761.; \n", + "h3c = 3482.; \n", + "h4c = 2522.; \n", + "h5c = 192.; \n", + "h6c = 200.;\n", + "Wt1 = 637.; \n", + "Wt2 = 960.; \n", + "Wtc = Wt1+Wt2; Wpc = 8.;\n", + "Wnetc = 1589.; \n", + "Q1c = 3198+721.;\n", + "n1c = Wnetc/Q1c;\n", + "WRc = Wnetc/Wtc;\n", + "POc = Q1_*n1c;\n", + "EIRc = 59.3;\n", + "n2c = POc/EIRc;\n", + "print (\"\\nPart (c)\")\n", + "print \"n1 is %.1f %%\"%(n1c*100)\n", + "print \"n2 is %.1f %%\"%(n2c*100)\n", + "print \"Work ratio is %.3f\"%WRc\n", + "\n", + "# Part (d)\n", + "T3 = 318.8; T1 = 568.;\n", + "n1d = 1-(T3/T1);\n", + "Q1d = 2758-1316.;\n", + "Wnet = Q1d*n1d;\n", + "Wpd = 8.; \n", + "Wtd = 641.;\n", + "WRd = (Wtd-Wpd)/Wtd;\n", + "POd = Q1_*0.439;\n", + "EIRd = (Q1_/(833-593.))*cpg*((833.-300)-300*(math.log(833./300)));\n", + "n2d = POd/94.6;\n", + "print (\"\\nPart (d)\")\n", + "print \"n1 is %.1f %%\"%(n1d*100)\n", + "print \"n2 is %.1f %%\"%(n2d*100)\n", + "print \"Work ratio is %.3f\"%WRd\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "n1 is 36.5 %\n", + "n2 is 61.5 %\n", + "Work ratio is 0.991\n", + "\n", + "Part (b)\n", + "n1 is 39.4 %\n", + "n2 is 61.6 %\n", + "Work ratio is 0.994\n", + "\n", + "Part (c)\n", + "n1 is 40.5 %\n", + "n2 is 68.4 %\n", + "Work ratio is 0.995\n", + "\n", + "Part (d)\n", + "n1 is 43.9 %\n", + "n2 is 46.4 %\n", + "Work ratio is 0.988\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9 Page No : 488" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "hfg = 2202.6;\n", + "Qh = 5.83;\n", + "ws = Qh/hfg;\n", + "eg = 0.9; \t\t\t# efficiency of generator\n", + "P = 1000;\n", + "Wnet = 1000/0.9;\n", + "nbrake = 0.8;\n", + "\n", + "# Calculation\n", + "h1_2s = Wnet/(ws*nbrake); \t\t\t# h1-h2s\n", + "n_internal = 0.85;\n", + "h12 = n_internal*h1_2s;\n", + "hg = 2706.3; \n", + "h2 = hg;\n", + "h1 = h12+h2;\n", + "h2s = h1-h1_2s;\n", + "hf = 503.71;\n", + "x2s = (h2s-hf)/hfg;\n", + "sf = 1.5276; \n", + "sfg = 5.6020;\n", + "s2s = sf+(x2s*sfg);\n", + "s1 = s2s;\n", + "P1 = 22.5; \t\t\t# in bar from Moiller chart\n", + "t1 = 360;\n", + "\n", + "# Results\n", + "print \"Temperature of the steam is\",t1,\"degree\"\n", + "print \"Pressure of the steam is \",P1,\"bar\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of the steam is 360 degree\n", + "Pressure of the steam is 22.5 bar\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10 Page No : 489" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3037.3; h2 = 561+(0.96*2163.8);\n", + "s2 = 1.6718+(0.96*5.3201);\n", + "s3s = s2;\n", + "\n", + "# Calculation\n", + "x3s = (s3s-0.6493)/7.5009;\n", + "h3s = 191.83+(x3s*2392.8);\n", + "h23 = 0.8*(h2-h3s); \t\t\t# h2-h3\n", + "h3 = h2-h23;\n", + "h5 = 561.47; h4 = 191.83;\n", + "Qh = 3500.; \t\t\t# in kJ/s\n", + "w = Qh/(h2-h5);\n", + "Wt = 1500.;\n", + "ws = (Wt+w*(h2-h3))/(h1-h3); \n", + "ws_ = 3600.*ws ; \t\t\t# in kg/h\n", + "h6 = ((ws-w)*h4+w*h5)/ws;\n", + "h7 = h6;\n", + "n_boiler = 0.85;\n", + "CV = 44000.; \t\t\t# in kJ/kg\n", + "wf = (1.1*ws_*(h1-h7))/(n_boiler*CV);\n", + "\n", + "# Results\n", + "print \"Fuel buring rate is %.2f Kg/h\"%wf\n", + "print \"Wf = %.2f tonnes/day\"%(wf*24/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fuel buring rate is 756.64 Kg/h\n", + "Wf = 18.16 tonnes/day\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11 Page No : 491" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 3285.; \n", + "h2s = 3010.\n", + "h3 = 3280.; \n", + "h4s = 3030.;\n", + "\n", + "# Calculation\n", + "h4 = h3-0.83*(h3-h4s);\n", + "h5s = 2225;\n", + "h5 = h4-0.83*(h4-h5s);\n", + "h6 = 162.7; h7 = h6;\n", + "h8 = 762.81;\n", + "h2 = h1-0.785*(h1-h2s);\n", + "m = (h8-h7)/(h4-h7);\n", + "n_cycle = ((h1-h2)+(h3-h4)+(1-m)*(h4-h5))/((h1-h8)+(h3-h2))\n", + "\n", + "# Results\n", + "print \"Steam flow at turbine inlet is %.3f Kg/s\"%m\n", + "print \"cycle efficiency is %.2f %%\"%(n_cycle*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Steam flow at turbine inlet is 0.206 Kg/s\n", + "cycle efficiency is 35.92 %\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.12 Page No : 493" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# From table and graph \n", + "\n", + "# Variables\n", + "h1 = 2792.2;\n", + "h4 = 122.96;\n", + "hb = 254.88;\n", + "hc = 29.98;\n", + "ha = 355.98;\n", + "hd = hc;\n", + "h2 = 1949.27;\n", + "\n", + "# Calculation and Results\n", + "m = (h1-h4)/(hb-hc); \t\t\t# Amount of mercury circulating\n", + "Q1t = m*(ha-hd);\n", + "W1t = m*(ha-hb) + (h1-h2);\n", + "Nov = W1t/Q1t ;\n", + "print \"Overall efficiency of the cycle %.2f %%\"%(Nov*100)\n", + "\n", + "S = 50000.; \t\t\t# Stem flow rate through turbine in kg/h\n", + "wm = S*m;\n", + "print \"Flow through the mercury turbine is %.2e Kg/h\"%wm\n", + "\n", + "Wt = W1t*S/3600;\n", + "print \"Useful work done in binary vapour cycle is %.2e kW\"%Wt\n", + "\n", + "nm = 0.85; \t\t\t# Internal efficiency of mercury turbine\n", + "ns = 0.87; \t\t\t# Internal efficiency of steam turbine\n", + "WTm = nm*(ha-hb);\n", + "hb_ = ha-WTm; \t\t\t# hb'\n", + "m_ = (h1-h4)/(hb_-hc); \t\t\t# m'\n", + "h1_ = 3037.3; \t\t\t# h'\n", + "Q1t = m_*(ha-hd)+(h1_-h1);\n", + "x2_ = (6.9160-0.4226)/(8.47-0.4226);\n", + "h2_ = 121+(0.806*2432.9);\n", + "WTst = ns*(h1_-h2_);\n", + "WTt = m_*(ha-hb_)+WTst;\n", + "Nov = WTt/Q1t;\n", + "\n", + "print \"Overall efficiency is %.1f %%\"%(Nov*100)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Overall efficiency of the cycle 52.80 %\n", + "Flow through the mercury turbine is 5.93e+05 Kg/h\n", + "Useful work done in binary vapour cycle is 2.84e+04 kW\n", + "Overall efficiency is 46.2 %\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch13.ipynb b/Engineering_Thermodynamics/ch13.ipynb new file mode 100755 index 00000000..4c7ec6db --- /dev/null +++ b/Engineering_Thermodynamics/ch13.ipynb @@ -0,0 +1,590 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:20c7c69ec3c2fcafe0d93dd099c65cc40aeef92c301c25a624e4ebbb2e24b55e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 : Gas Power Cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 Page No : 543" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 273.+35;\n", + "P1 = 100e03; \t\t\t# in kN/m2\n", + "Q1 = 2100.;\n", + "R = 0.287;\n", + "v1 = 0.884\n", + "v2 = 0.11\n", + "v3 = v2;\n", + "rk = 8.\n", + "g = 1.4; \t\t\t# gamma\n", + "\n", + "# Calculation\n", + "n_cycle = 1-(1./rk**(1.4-1));\n", + "v12 = 8; \t\t\t# v1./v2\n", + "v1 = (R*T1)/P1;\n", + "v2 = v1/8;\n", + "T2 = T1*(v1/v2)**(g-1);\n", + "cv = 0.718;\n", + "T3 = Q1/cv + T2\n", + "P21 = (v1/v2)**g;\n", + "P2 = P21*P1;\n", + "P3 = P2*(T3/T2);\n", + "Wnet = Q1*n_cycle;\n", + "Pm = Wnet/(v1-v2);\n", + "\n", + "# Results\n", + "print \"Maximum pressure is %.2f mPa\"%(P3/1e06)\n", + "print \"Temperature of the cycle is %.2f K\"%T3,\"K\"\n", + "print \"Cycle efficiency is %.2f %%\"%(n_cycle*100)\n", + "print \"Mean effective pressure is %.3f MPa\"%(Pm/1e06)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum pressure is 9.43 mPa\n", + "Temperature of the cycle is 3632.39 K K\n", + "Cycle efficiency is 56.47 %\n", + "Mean effective pressure is 1.533 MPa\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 Page No : 544" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "rk = 14.;\n", + "k = 0.06\n", + "rc = k*(14-1)+1;\n", + "g = 1.4;\n", + "\n", + "# Calculation\n", + "n_diesel = 1-((1./g))*(1./rk**(g-1))*((rc**(g-1))/(rc-1));\n", + "\n", + "# Results\n", + "print \"Air standard efficiency is %.f %%\"%(n_diesel*100)\n", + "\n", + "# note : rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air standard efficiency is 60 %\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3 Page No : 544" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "rk = 16.;\n", + "T1 = 273.+15;\n", + "P1 = 100.; \t\t\t# in kN/m2\n", + "T3 = 1480.+273;\n", + "g = 1.4; \t\t\t# gamma \n", + "R = 0.287;\n", + "T2 = 288*(rk**(g-1));\n", + "\n", + "# Calculation\n", + "rc = T3/T2 ;\n", + "cp = 1.005; cv = 0.718;\n", + "Q1 = cp*(T3-T2);\n", + "T4 = T3*((rc/rk)**(g-1));\n", + "Q2 = cv*(T4-T1);\n", + "n = 1-(Q2/Q1); \t\t\t# cycle efficiency\n", + "n_ = 1-((1./g))*(1./rk**(g-1))*((rc**(g-1))/(rc-1)); \t\t\t# cycle efficiency from another formula\n", + "Wnet = Q1*n;\n", + "v1 = (R*T1)/P1 ;\n", + "v2 = v1/rk;\n", + "Pm = Wnet/(v1-v2);\n", + "\n", + "# Results\n", + "print \"cut-off ratio is %.2f\"%rc\n", + "print \"Heat supplied per kg of air is %.1f kJ/Kg\"%Q1\n", + "print \"Cycle efficiency is %.1f %%\"%(n*100)\n", + "print \"Mean effective pressure is %.2f Kpa\"%Pm\n", + "\n", + "# rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "cut-off ratio is 2.01\n", + "Heat supplied per kg of air is 884.3 kJ/Kg\n", + "Cycle efficiency is 61.3 %\n", + "Mean effective pressure is 699.97 Kpa\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4 Page No : 546" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 273.+50;\n", + "rk = 16.;\n", + "g = 1.4; \t\t\t# gamma\n", + "P3 = 70.; \n", + "cv = 0.718; \n", + "cp = 1.005; \n", + "R = 0.287;\n", + "\n", + "# Calculation\n", + "T2 = T1*((rk**(g-1)));\n", + "P1 = 1; \t\t\t# in bar\n", + "P2 = P1*(rk)**g;\n", + "T3 = T2*(P3/P2);\n", + "Q23 = cv*(T3-T2);\n", + "T4 = (Q23/cp)+T3;\n", + "v43 = T4/T3; \t\t\t# v4/v3\n", + "v54 = rk/v43; \t\t\t# v5/v4 = (v1./v2)*(v3/v4)\n", + "T5 = T4*(1./v54)**(g-1);\n", + "P5 = P1*(T5/T1);\n", + "Q1 = cv*(T3-T2)+cp*(T4-T3);\n", + "Q2 = cv*(T5-T1);\n", + "n_cycle = 1-(Q2/Q1);\n", + "v1 = (R*T1)/P1;\n", + "v12 = (15./16)*v1; \t\t\t# v1-v2\n", + "Wnet = Q1*n_cycle;\n", + "Pm = Wnet/(v12);\n", + "\n", + "# Results\n", + "print \"Efficiency of the cycle is %.2f %%\"%(n_cycle*100)\n", + "print \"Mean effective pressure is %.2f\"%Pm,\"bar\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the cycle is 66.31 %\n", + "Mean effective pressure is 4.76 bar\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5 Page No : 547" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 0.1e06;\n", + "T1 = 303.;\n", + "T3 = 1173.;\n", + "PR = 6.; \t\t\t# Pressure ratio\n", + "rp = 6.; \n", + "nt = 0.8; \n", + "nc = 0.8;\n", + "g = 1.4; \n", + "cv = 0.718; \n", + "cp = 1.005; \n", + "R = 0.287;\n", + "\n", + "# Calculation\n", + "j = (PR)**((g-1)/g);\n", + "T2s = j*T1;\n", + "T4s = T3/j;\n", + "T21 = (T2s-T1)/nc ; \t\t\t# T2-T1\n", + "T34 = nt*(T3-T4s); \t\t\t# T3-T4\n", + "Wt = cp*T34;\n", + "Wc = cp*T21;\n", + "T2 = T21+T1;\n", + "Q1 = cp*(T3-T2);\n", + "n = (Wt-Wc)/Q1;\n", + "T4 = T3-375;\n", + "T6 = 0.75*(T4-T2) + T2 ;\n", + "Q1_ = cp*(T3-T6);\n", + "n_ = (Wt-Wc)/Q1_;\n", + "I = (n_-n)/n ;\n", + "\n", + "# Results\n", + "print \"The percentage efficiency in cycle efficiency due to regeneration is %.f %%\"%(I*100)\n", + "\n", + "# note : rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The percentage efficiency in cycle efficiency due to regeneration is 42 %\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6 Page No : 549" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "cp = 1.005;\n", + "Tmax = 1073.\n", + "Tmin = 300.;\n", + "\n", + "# Calculation\n", + "Wnet_max = cp*(math.sqrt(Tmax)-math.sqrt(Tmin))**2;\n", + "n_cycle = 1-math.sqrt(Tmin/Tmax);\n", + "n_carnot = 1-(Tmin/Tmax);\n", + "r = n_cycle/n_carnot;\n", + "\n", + "# Results\n", + "print \"Maximum work done per kg of air is %.2f kJ/Kg\"%Wnet_max\n", + "print \"cycle efficiency is %.0f %%\"%(n_cycle*100)\n", + "print \"ratio of brayton and carnot efficiency is %.3f\"%r\n", + "\n", + "# note : rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum work done per kg of air is 239.47 kJ/Kg\n", + "cycle efficiency is 47 %\n", + "ratio of brayton and carnot efficiency is 0.654\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.7 Page No : 549" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "rp = 6.;\n", + "g = 1.4; \n", + "cv = 0.718; \n", + "cp = 1.005; \n", + "R = 0.287;\n", + "T1 = 300.; \n", + "T3 = 1100.; \n", + "T0 = 300.;\n", + "\n", + "# Calculation\n", + "n_cycle = 1-(1./rp**((g-1)/g));\n", + "j = rp**((g-1)/g);\n", + "T2 = T1*j;\n", + "T4 = T3/j;\n", + "Wc = cp*(T2-T1);\n", + "Wt = cp*(T3-T4);\n", + "WR = (Wt-Wc)/Wt;\n", + "Q1 = 100; \t\t\t# in MW\n", + "PO = n_cycle*Q1;\n", + "m_dot = (Q1*1e06)/(cp*(T3-T2));\n", + "R = m_dot*cp*T0*((T4/T0)-1-math.log(T4/T0));\n", + "\n", + "# Results\n", + "print \"The thermal efficiency of the cycle is %.1f %%\"%(n_cycle*100)\n", + "print \"Work ratio is %.3f\"%WR\n", + "print \"Power output is %.1f MW\"%PO\n", + "print \"Energy flow rate of the exhaust gas stream is %.2f MW\"%(R/1e06)\n", + "\n", + "# rounding error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The thermal efficiency of the cycle is 40.1 %\n", + "Work ratio is 0.545\n", + "Power output is 40.1 MW\n", + "Energy flow rate of the exhaust gas stream is 20.53 MW\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.8 Page No : 550" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "nc = 0.87; \n", + "nt = 0.9; \n", + "T1 = 311.; \n", + "rp = 8.; \t\t\t# P2/P1\n", + "P1 = 1.; \n", + "P2 = 8.; \n", + "P3 = 0.95*P2; \n", + "P4 = 1;\n", + "T3 = 1100.; \n", + "g = 1.4; \n", + "cv = 0.718; \n", + "cp = 1.005; \n", + "R = 0.287;\n", + "\n", + "# Calculation\n", + "# With no cooling\n", + "T2s = T1*((P2/P1)**((g-1)/g));\n", + "T2 = T1 + (T2s-T1)/0.87;\n", + "T4s = T3*(P4/P3)**((g-1)/g);\n", + "n = (((T3-T4s)*nt)-((T2s-T1)/nc))/(T3-T2);\n", + "# With cooling\n", + "n_cycle = n-0.05;\n", + "x = 0.13;\n", + "r = 0.13/1.13;\n", + "\n", + "# Results\n", + "print \"Percentage of air that may be taken from the compressor is %.1f%%\"%(r*100)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage of air that may be taken from the compressor is 11.5%\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.10 Page No : 555" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 233.; \n", + "V1 = 300.; \n", + "cp = 1.005; \n", + "g = 1.4;\n", + "\n", + "# Calculation and Results\n", + "T2 = T1+((V1**2)/(2*cp))*1e-03 ;\n", + "P1 = 35;\n", + "P2 = P1*(T2/T1)**(g/(g-1));\n", + "rp = 10; \t\t\t# Pressure ratio\n", + "P3 = rp*P2;\n", + "T3 = T2*(P3/P2)**((g-1)/g);\n", + "T4 = 1373;\n", + "T5 = T4-T3+T2;\n", + "P4 = P3;\n", + "P5 = P4*(T5/T4)**(g/(g-1));\n", + "print \"Temperature at the turbine exit is %.2f K\"%T5\n", + "print \"Pressure at the turbine exit is %.2f kPa\"%P5\n", + "P6 = P1;\n", + "T6 = T5*(P6/P5)**((g-1)/g);\n", + "V6 = (2*cp*1000*(T5-T6))**0.5 ;\n", + "\n", + "print \"Velocity of the gas at the nozzle exit is %.1f m/s\"%V6\n", + "w = 50.;\n", + "Ve = V6; Vi = 300.;\n", + "Wp_dot = w*Vi*(Ve-Vi);\n", + "h4 = 1373.; \n", + "h3 = 536.66;\n", + "Q1 = w*cp*(h4-h3); \t\t\t# in kJ/kg\n", + "np = Wp_dot/(Q1*1000);\n", + "print \"The propulsive efficiency of the cycle is %.1f %%\"%(np*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature at the turbine exit is 1114.47 K\n", + "Pressure at the turbine exit is 312.00 kPa\n", + "Velocity of the gas at the nozzle exit is 1020.3 m/s\n", + "The propulsive efficiency of the cycle is 25.7 %\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.11 Page No : 556" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ta = 288.;\n", + "rp = 8.; \t\t\t# Pb/Pa\n", + "g = 1.33; \n", + "g1 = 1.44; \n", + "cv = 0.718; \n", + "cpa = 1.005; \n", + "cpg = 1.11; \n", + "R = 0.287;\n", + "\n", + "# Calculation\n", + "Tb = Ta*(rp)**((g1-1)/g1);\n", + "Tc = 1073.; \n", + "Tm = 800.+273; \n", + "Tmin = 100.+273;\n", + "Td = Tc/(rp**((g-1)/g));\n", + "Wgt = cpg*(Tc-Td)-cpa*(Tb-Ta);\n", + "Q1 = cpg*(Tc-Tb);\n", + "Q1_ = cpg*(Tc-Td);\n", + "h1 = 3775.; h2 = 2183.; h3 = 138.; h4 = h3;\n", + "Q1_st = h1-h3; \t\t\t# Q1'\n", + "Q_fe = cpg*(Tm-Tmin);\n", + "was = Q1_st/Q_fe; \t\t\t# wa/ws\n", + "Wst = h1-h2;\n", + "PO = 190e03; \t\t\t# in kW\n", + "ws = PO/(was*Wgt+Wst);\n", + "wa = 322.5;\n", + "CV = 43300.; \t\t\t# in kJ/kg\n", + "waf = round(CV/(1095.),1)\n", + "FEI = (wa/waf)*CV;\n", + "noA = PO/FEI;\n", + "\n", + "# Results\n", + "print \"Air fuel ratio is %.2f\"%waf\n", + "print \"Overall efficiency of combined plant is %.1f %%\"%(noA*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air fuel ratio is 39.50\n", + "Overall efficiency of combined plant is 53.7 %\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch14.ipynb b/Engineering_Thermodynamics/ch14.ipynb new file mode 100755 index 00000000..4a601b5b --- /dev/null +++ b/Engineering_Thermodynamics/ch14.ipynb @@ -0,0 +1,502 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:43030cb407ee8b4a262c4ba255fecb3e020be8690e26722c194a6ec2d965f42c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 : Refrigeration Cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 Page No : 587" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T2 = 268.; \n", + "T1 = 308.;\n", + "\n", + "# Calculation\n", + "COP = T2/(T1-T2);\n", + "ACOP = COP/3; \t\t\t# Actual COP\n", + "Q2 = 29.; \t\t\t# in kW\n", + "W = Q2/ACOP;\n", + "\n", + "# Results\n", + "print \"Power required to derive the plane is %.0f kW\"%W\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required to derive the plane is 13 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 Page No : 589" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 236.04; s1 = 0.9322; s2 = s1;\n", + "P2 = 0.8; \t\t\t# in MPa\n", + "h2 = 272.05; h3 = 93.42; h4 = h3;\n", + "m = 0.06; \t\t\t# mass flow rate\n", + "\n", + "# Calculation\n", + "Q2 = m*(h1-h4);\n", + "Wc = m*(h2-h1);\n", + "Q1 = m*(h2-h4);\n", + "COP = Q2/Wc;\n", + "\n", + "# Results\n", + "print \"The rate of heat removal is %.2f kW\"%Q2\n", + "print \"Power input to the compressor is %.2f kW\"%Wc\n", + "print \"The heat rejection rate in the condenser is %.2f kW\"%Q1\n", + "print \"COP is %.3f\"%COP\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rate of heat removal is 8.56 kW\n", + "Power input to the compressor is 2.16 kW\n", + "The heat rejection rate in the condenser is 10.72 kW\n", + "COP is 3.961\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 Page No : 589" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 183.19; \n", + "h2 = 209.41; \n", + "h3 = 74.59; \n", + "h4 = h3;\n", + "T1 = 313.; \n", + "T2 = 263.;\n", + "W = 70000./3600; \t\t\t# Plant capacity in kW\n", + "\n", + "# Calculation\n", + "w = W/(h1-h4); \t\t\t# Refrigerant flow rate\n", + "v1 = 0.077;\n", + "VFR = w*v1;\n", + "T = 48.; \t\t\t# in degree\n", + "P2 = 9.6066; P1 = 2.1912;\n", + "rp = P2/P1; \t\t\t# Pressure ratio\n", + "Q1 = w*(h2-h3);\n", + "hf = 26.87; hfg = 156.31;\n", + "x4 = (h4-hf)/hfg;\n", + "COP = (h1-h4)/(h2-h1);\n", + "PI = w*(h2-h1);\n", + "COP = T2/(T1-T2);\n", + "COP_v = 4.14;\n", + "r = COP_v/COP;\n", + "\n", + "# Results\n", + "print \"Refrigerant flow rate is %.2f Kg/s\"%w\n", + "print \"Volume flow rate is %.4f m3/s\"%VFR\n", + "print \"Compressor discharge temperature is\",T,\"degree\"\n", + "print \"Pressure ratio is %.2f\"%rp\n", + "print \"Heat rejected to the condenser is %.2f kW\"%Q1\n", + "print \"Flash gas percentage is %.1f %%\"%(x4*100)\n", + "print \"COP is\",COP\n", + "print \"Power required to drive the compressor is %.2f kW\"%PI\n", + "print \"Ratio of COP of carnot refrigerator is %.3f\"%r\n", + "\n", + "# note : rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Refrigerant flow rate is 0.18 Kg/s\n", + "Volume flow rate is 0.0138 m3/s\n", + "Compressor discharge temperature is 48.0 degree\n", + "Pressure ratio is 4.38\n", + "Heat rejected to the condenser is 24.14 kW\n", + "Flash gas percentage is 30.5 %\n", + "COP is 5.26\n", + "Power required to drive the compressor is 4.69 kW\n", + "Ratio of COP of carnot refrigerator is 0.787\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.4 Page No : 590" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "h3 = 882.\n", + "h2 = 1034.;\n", + "h6 = 998.\n", + "h1 = 1008.;\n", + "v1 = 0.084;\n", + "\n", + "# Calculation and Results\n", + "h4 = h3-h1+h6; h5 = h4;\n", + "t4 = 25.+273;\n", + "print \"Refrigeration effect is\",h6-h5,\"kJ/kg\"\n", + "\n", + "m = 10.;\n", + "w = (m*14000)/((h6-h5)*3600); \t\t\t# in kg/s\n", + "print \"Refrigerant flow rate is %.2f kg/s\"%w\n", + "\n", + "v1 = 0.084;\n", + "VFR = w*3600*v1; \t\t\t# in kg/h\n", + "ve = 0.8; \t\t\t# volumetric efficiency\n", + "CD = VFR/(ve*60); \t\t\t# in m3/min\n", + "N = 900;\n", + "n = 2;\n", + "D = ((CD*4)/(math.pi*1.1*N*n))**(1./3); \t\t\t# L = 1.1D L = length D = diameter\n", + "L = 1.1*D;\n", + "print \"Diameter of cylinder is %.1f cm\"%(D*100)\n", + "print \"Length of cylinder is %.2f cm\"%(L*100)\n", + "COP = (h6-h5)/(h2-h1);\n", + "PI = w*(h2-h1);\n", + "print \"Power required to drive the compresor is %.2f kW\"%PI\n", + "print \"COP is %.2f\"%COP\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Refrigeration effect is 126.0 kJ/kg\n", + "Refrigerant flow rate is 0.31 kg/s\n", + "Diameter of cylinder is 10.8 cm\n", + "Length of cylinder is 11.85 cm\n", + "Power required to drive the compresor is 8.02 kW\n", + "COP is 4.85\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.5 Page No : 592" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "P2 = 1554.3;\n", + "P1 = 119.5;\n", + "Pi = math.sqrt(P1*P2);\n", + "h1 = 1404.6; \n", + "h2 = 1574.3; \n", + "h3 = 1443.5; \n", + "h4 = 1628.1;\n", + "h5 = 371.7; h6 = h5; h7 = 181.5;\n", + "w = 30.; \t\t\t# capacity of plant\n", + "\n", + "# Calculation\n", + "m2_dot = (3.89*30)/(h1-h7);\n", + "m1_dot = m2_dot*((h2-h7)/(h3-h6));\n", + "Wc_dot = m2_dot*(h2-h1)+m1_dot*(h4-h3);\n", + "COP = w*3.89/Wc_dot;\n", + "\t\t\t# math.single stage\n", + "h1_ = 1404.6; h2_ = 1805.1;\n", + "h3_ = 371.1; h4_ = h3_;\n", + "m_dot = (3.89*30)/(h1_-h4_);\n", + "Wc = m_dot*(h2_-h1_);\n", + "COP_ = w*3.89/Wc;\n", + "IW = (Wc-Wc_dot)/Wc_dot;\n", + "ICOP = (COP-COP_)/COP_\n", + "\n", + "# Results\n", + "print \"Increase in work of compression is %.2f\"%(IW*100)\n", + "print \"Increase in COP for 2 stage compression is %.2f %%\"%(ICOP*100)\n", + "\n", + "# note : rounding error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in work of compression is 15.72\n", + "Increase in COP for 2 stage compression is 15.72 %\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.6 Page No : 593" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "tsat = 120.2+273\n", + "hfg = 2201.9;\n", + "T1 = 120.2+273;\n", + "T2 = 30.+273;\n", + "Tr = -10.+273;\n", + "\n", + "# Calculation\n", + "COP_max = ((T1-T2)*Tr)/((T2-Tr)*T1);\n", + "ACOP = 0.4*COP_max;\n", + "Qe = (20.*14000)/3600; \t\t\t# in KW\n", + "Qg = Qe/ACOP;\n", + "x = 0.9; \n", + "H = x*hfg;\n", + "SFR = Qg/H;\n", + "\n", + "# Results\n", + "print \"Steam flow rate required is %.4f kg/s\"%SFR\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Steam flow rate required is 0.0651 kg/s\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.7 Page No : 594" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 277.; \n", + "T3 = 273.+55;\n", + "rp = 3.; \t\t\t# Pressure ratio\n", + "g = 1.4; \n", + "cp = 1.005;\n", + "\n", + "# Calculation and Results\n", + "T2s = T1*(rp**((g-1)/g));\n", + "T2 = T1+(T2s-T1)/0.72\n", + "T4s = T3/(rp**((g-1)/g));\n", + "T34 = 0.78*(T3-T4s); \t\t\t# T3-T4\n", + "T4 = T3-T34;\n", + "COP = (T1-T4)/((T2-T1)-(T3-T4));\n", + "print \"COP of the refrigerator is %.2f\"%COP\n", + "P = (3.*14000)/(COP*3600)\n", + "print \"Driving power required is %.1f kW\"%P\n", + "m = (3.*14000)/(cp*(T1-T4));\n", + "print \"Mass flow rate is %.2f kg/s\"%(m/3600)\n", + "\n", + "# note: rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "COP of the refrigerator is 0.25\n", + "Driving power required is 47.5 kW\n", + "Mass flow rate is 0.65 kg/s\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.8 Page No : 596" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "P1 = 2.4; T1 = 0+273;\n", + "h1 = 188.9; s1 = 0.7177; v1 = 0.0703;\n", + "P2 = 9; T2 = 60+273;\n", + "h2 = 219.37;\n", + "h2s = 213.27;\n", + "h3 = 71.93; h4 = h3;\n", + "v1 = 0.0703;\n", + "A1V1 = 0.6/60;\n", + "\n", + "# Calculation\n", + "m_dot = A1V1/0.0703;\n", + "Wc_dot = m_dot*(h2-h1);\n", + "Q1_dot = m_dot*(h2-h3);\n", + "COP = Q1_dot/Wc_dot;\n", + "nis = (h2s-h1)/(h2-h1);\n", + "\n", + "# Results\n", + "print \"Power input is %.2f kW\"%Wc_dot\n", + "print \"Heating capacity is %.2f kW\"%Q1_dot\n", + "print \"COP is %.3f\"%COP\n", + "print \"The isentropic compressor efficiency is %.2f %%\"%(nis*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power input is 4.33 kW\n", + "Heating capacity is 20.97 kW\n", + "COP is 4.839\n", + "The isentropic compressor efficiency is 79.98 %\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.9 Page No : 597" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T1 = 275.; \n", + "T3 = 310.;\n", + "P1 = 1. ; P2 = 4.;\n", + "\n", + "# Calculation\n", + "T2s = T1*(P2/P1);\n", + "nc = 0.8;\n", + "T2 = T1 + (T2s-T1)*nc;\n", + "pr = 0.1;\n", + "P3 = P2-0.1;\n", + "P4 = P1+0.08;\n", + "PR = P3/P4;\n", + "\n", + "# Results\n", + "print \"Pressure ratio for the turbine is %.3f\"%PR\n", + "T4s = T3*(1./PR)**(0.286);\n", + "nt = 0.85;\n", + "T4 = T3-(T3-T4s)*nt;\n", + "COP = (T1-T4)/((442.26-T3)-(T1-T4));\n", + "print \"COP is %.3f\"%COP\n", + "\n", + "# note : rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure ratio for the turbine is 3.611\n", + "COP is 0.533\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch15.ipynb b/Engineering_Thermodynamics/ch15.ipynb new file mode 100755 index 00000000..c18d2a4a --- /dev/null +++ b/Engineering_Thermodynamics/ch15.ipynb @@ -0,0 +1,487 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:69db660ca30a9a3baf1684d4ef5be81cf91d6088bb69eac31dc95900ca98814a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 15 : Psychrometrics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.1 Page No : 618" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "Ps = 0.033363; \n", + "P = 1.0132;\n", + "\n", + "# Calculation and Results\n", + "W2 = (0.622*Ps)/(P-Ps);\n", + "hfg2 = 2439.9; hf2 = 109.1; cpa = 1.005;\n", + "hg = 2559.9; hw1 = hg;\n", + "T2 = 25+273; T1 = 32+273;\n", + "W1 = (cpa*(T2-T1)+(W2*hfg2))/(hw1-hf2);\n", + "Pw = ((W1/0.622)*P)/(1+(W1/0.622));\n", + "print \"Specific humidity is \",round(W1,4),\"kg vap./kg dry air\"\n", + "print \"Partial pressure of water vapour is\",round(Pw,2),\"bar\"\n", + "print \"Dew point temperature is\",24.1,\"degree\" \t\t\t# saturation temperature at 0.03 bar\n", + "\n", + "Psat = 0.048; \t\t\t# at 32 degree\n", + "fi = Pw/Psat;\n", + "print \"Relative humidity is\",round((fi*100),1),\"%\"\n", + "mu = (Pw/Ps)*((P-Ps)/(P-Pw));\n", + "print \"Degree of saturation is %.3f\"%mu\n", + "Pa = P-Pw;\n", + "Ra = 0.287; Tab = T1;\n", + "rho_a = (Pa*100)/(Ra*Tab);\n", + "print \"Density of dry air is\",round(rho_a,2),\"kg/m3\"\n", + "rho_w = W1*rho_a;\n", + "print \"Density of water vapour is\",round(rho_w,3),\"kg/m3\"\n", + "ta = 32.; \n", + "tdb = 32.; \n", + "tdp = 24.1;\n", + "h = cpa*ta + W1*(hg+1.88*(tdb-tdp));\n", + "print \"Enthalpy of the mixture is\",round(h,2),\"kJ/kg\"\n", + "\n", + "# note: rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific humidity is 0.0182 kg vap./kg dry air\n", + "Partial pressure of water vapour is 0.03 bar\n", + "Dew point temperature is 24.1 degree\n", + "Relative humidity is 60.1 %\n", + "Degree of saturation is 0.860\n", + "Density of dry air is 1.12 kg/m3\n", + "Density of water vapour is 0.02 kg/m3\n", + "Enthalpy of the mixture is 79.06 kJ/kg\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.2 Page No : 620" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Ps = 2.339; P = 100;\n", + "W2 = (0.622*Ps)/(P-Ps);\n", + "hfg2 = 2454.1; hf2 = 83.96; cpa = 1.005;\n", + "hw1 = 2556.3;\n", + "T2 = 20.; \n", + "T1 = 30.;\n", + "\n", + "# Calculation\n", + "W1 = (cpa*(T2-T1)+(W2*hfg2))/(hw1-hf2);\n", + "Pw1 = ((W1/0.622)*P)/(1+(W1/0.622));\n", + "Ps1 = 4.246;\n", + "fi = (Pw1/Ps1);\n", + "\n", + "# Results\n", + "print \"Relative humidity is\",round((fi*100),1),\"%\"\n", + "print \"Humidity ratio of inlet mixture is\",round(W1,4),\"kg vap./kg dry air\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative humidity is 39.9 %\n", + "Humidity ratio of inlet mixture is 0.0107 kg vap./kg dry air\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.3 Page No : 621" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Psat = 2.339;\n", + "fi3 = 0.50;\n", + "P = 101.3; \n", + "cp = 1.005;\n", + "\n", + "# Calculation\n", + "Pw3 = fi3*Psat;\n", + "Pa3 = P-Pw3;\n", + "W3 = 0.622*(Pw3/Pa3);\n", + "Psa1_1 = 0.7156;\n", + "Pw1 = 0.7156;\n", + "Pa1 = P-Pw1;\n", + "W1 = 0.622*(Pw1/Pa1); W2 = W1;\n", + "T3 = 293.; \n", + "Ra = 0.287; \n", + "Pa3 = 100.13;\n", + "va3 = (Ra*T3)/Pa3;\n", + "SW = (W3-W1)/va3;\n", + "t3 = 20.; \n", + "tsat = 9.65; \n", + "hg = 2518.; \n", + "h4 = 10.;\n", + "t2 = ( W3*(hg+1.884*(t3-tsat))-W2*(hg-1.884*tsat) + cp*t3 - (W3-W2)*h4 )/ (cp+W2*1.884)\n", + "\n", + "# Results\n", + "print \"Mass of spray water required is\",round(SW,5),\"kg moisture/m3\"\n", + "print \"Temperature to which air must be heated is\",round(t2,1),\"degree\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of spray water required is 0.00338 kg moisture/m3\n", + "Temperature to which air must be heated is 27.1 degree\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.4 Page No : 622" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 82.; \n", + "h2 = 52.; \n", + "h3 = 47.; \n", + "h4 = 40.;\n", + "W1 = 0.020; \n", + "W2 = 0.0115; \n", + "W3 = W2;\n", + "v1 = 0.887;\n", + "v = 3.33; \t\t\t# amount of free sir circulated\n", + "\n", + "# Calculation\n", + "G = v/v1;\n", + "CC = (G*(h1-h3)*3600.)/14000; \t\t\t# in tonns\n", + "R = G*(W1-W3);\n", + "\n", + "# Results\n", + "print \"Capacity of the cooling coil in tonnes\",round(CC,2),\"tonnes\"\n", + "print \"Rate of water vapour removed is\",round(R,4),\"kg/s\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity of the cooling coil in tonnes 33.79 tonnes\n", + "Rate of water vapour removed is 0.0319 kg/s\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.5 Page No : 623" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "W1 = 0.0058\n", + "W2 = 0.0187; \n", + "h1 = 35.\n", + "h2 = 90.\n", + "\n", + "# Calculation\n", + "G12 = 1./2; \t\t\t# G12 = G1./G2 \n", + "W3 = (W2+G12*W1)/(1+G12);\n", + "h3 = (2./3)*h2 + (1./3)*h1;\n", + "\n", + "# Results\n", + "print (\"Final condition of air is given by\")\n", + "print \"W3 = \",W3,\"kg vap./kg dry air\"\n", + "print \"h3 = \",round(h3,2),\"kJ/kg dry air\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final condition of air is given by\n", + "W3 = 0.0144 kg vap./kg dry air\n", + "h3 = 71.67 kJ/kg dry air\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.6 Page no : 624" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# variables\n", + "T2 = 38.5 # c\n", + "o3 =11.2 # c\n", + "\n", + "# calculations\n", + "h1h3 = 60.5 - 42.\n", + "w1w2 = 0.0153 - 0.0083 \n", + "\n", + "# results\n", + "print \"T2 = %.1f C\"%T2\n", + "print \"h1 - h3 = %.1f kJ/kg dry air\"%h1h3\n", + "print \"W1 - W2 = %.4f kg vap/kg dry air\"%w1w2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "T2 = 38.5 C\n", + "h1 - h3 = 18.5 kJ/kg dry air\n", + "W1 - W2 = 0.0070 kg vap/kg dry air\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.7 Page No : 624" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h1 = 57.\n", + "h2 = h1;\n", + "h3 = 42.;\n", + "W1 = 0.0065; \n", + "W2 = 0.0088; \n", + "W3 = W2;\n", + "t2 = 34.5; \n", + "v1 = 0.896;\n", + "n = 1500.; \t\t\t# seating capacity of hall\n", + "a = 0.3; \t\t\t# amount of out door air suplied\n", + "\n", + "# Calculation\n", + "G = (n*a)/0.896 ; \t\t\t# Amount of dry air suplied\n", + "CC = (G*(h2-h3)*60)/14000; \t\t\t# in tonns\n", + "R = G*(W2-W1)*60;\n", + "\n", + "# Results\n", + "print \"Capacity of the cooling coil in tonnes\",round(CC,2),\"tonnes\"\n", + "print \"Capacity of humidifier\",round(R,1),\"kg/h\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity of the cooling coil in tonnes 32.29 tonnes\n", + "Capacity of humidifier 69.3 kg/h\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.8 Page No : 626" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "twb1 = 15.2; \n", + "twb2 = 26.7; \n", + "tw3 = 30.;\n", + "h1 = 43.; \n", + "h2 = 83.5; \n", + "hw = 84.; \n", + "mw = 1.15;\n", + "W1 = 0.0088; \n", + "W2 = 0.0213;\n", + "hw3 = 125.8; \n", + "hm = 84;\n", + "G = 1.;\n", + "\n", + "# Calculation\n", + "hw34 = (G/mw)*((h2-h1)-(W2-W1)*hw); \t\t\t# hw3-hw4\n", + "tw4 = tw3-(hw34/4.19);\n", + "A = tw4-twb1;\n", + "R = tw3-tw4;\n", + "x = G*(W2-W1);\n", + "\n", + "# Results\n", + "print \"Temperature of water leaving the tower is\",round(tw4,1),\"degree\"\n", + "print \"Fraction of water evoporated is\",x,\"kg/kg dry sir\"\n", + "print \"Range of cooling water is\",round(R,1),\"degree\"\n", + "print \"Approach of cooling water is\",round(A,1),\"degree\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of water leaving the tower is 21.8 degree\n", + "Fraction of water evoporated is 0.0125 kg/kg dry sir\n", + "Range of cooling water is 8.2 degree\n", + "Approach of cooling water is 6.6 degree\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.9 Page No : 627" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Psat1 = 0.01705; \n", + "hg1 = 2528.9; \t\t\t# at 15 degree\n", + "Psat2 = 0.05628; \n", + "hg2 = 2565.3; \t\t\t# At 35 degree\n", + "fi1 = 0.55;\n", + "Pw1 = fi1*Psat1;\n", + "fi2 = 1;\n", + "Pw2 = fi2*Psat2;\n", + "P = 1.;\n", + "\n", + "# Calculation\n", + "W1 = (0.622*Pw1)/(P-Pw1);\n", + "W2 = (0.622*Pw2)/(P-Pw2);\n", + "MW = W2-W1;\n", + "t2 = 35; t1 = 15; \n", + "m_dot = 2.78;\n", + "cpa = 1.005;\n", + "h43 = 35*4.187; \t\t\t# h4-h3\n", + "h5 = 14*4.187;\n", + "m_dot_w = (-(W2-W1)*h5 - W1*hg1 + W2*hg2 + cpa*(t2-t1))/(h43) ;\n", + "R = m_dot/m_dot_w ;\n", + "MW = (W2-W1)*R;\n", + "RWA = R*(1+W1);\n", + "R = 0.287; T = 288; \n", + "V_dot = (RWA*R*T)/(P*1e02) ; \t\t\t# Pressure is in kilo Pascal\n", + "\n", + "# Results\n", + "print \"Make up water flow rate is\",round(MW,3),\"kg/s\"\n", + "print \"Volume flow rate of air is\",round(V_dot,3),\"m3/s\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Make up water flow rate is 0.129 kg/s\n", + "Volume flow rate of air is 3.437 m3/s\n" + ] + } + ], + "prompt_number": 26 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch16.ipynb b/Engineering_Thermodynamics/ch16.ipynb new file mode 100755 index 00000000..10fb2321 --- /dev/null +++ b/Engineering_Thermodynamics/ch16.ipynb @@ -0,0 +1,554 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1aee5040b10cb0c8b88b1f2c29303ab365a0d0e9e802f10ac15f3026e0ae4c4a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 16 : Reactive Systems" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.2 Page No : 657" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "eps_e = 0.27; \n", + "P = 1. ;\n", + "\n", + "# Calculation\n", + "K = (4*eps_e**2*P)/(1-eps_e**2);\n", + "P1 = 100./760; \t\t\t# in Pa\n", + "eps_e_1 = math.sqrt((K/P1)/(4+(K/P1)));\n", + "T1 = 318.; T2 = 298.;\n", + "R = 8.3143; K1 = 0.664; K2 = 0.141;\n", + "dH = 2.30*R*((T1*T2)/(T1-T2))*(math.log(K1/K2));\n", + "\n", + "# Results\n", + "print \"K is\",round(K,4),\"atm\"\n", + "print \"epislon is \",round(eps_e_1,3)\n", + "print \"The heat of reaction is\",round(dH,0),\"kJ/kg mol\"\n", + "\n", + "# note : book answer is wrong. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "K is 0.3145 atm\n", + "epislon is 0.612\n", + "The heat of reaction is 140399.0 kJ/kg mol\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.3 Page No : 659" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "v1 = 1.\n", + "v2 = v1; \n", + "v3 = v2; \n", + "v4 = v2;\n", + "e = 0.56; \t\t\t# Degree of reaction\n", + "P = 1.; \t\t\t# Dummy\n", + "T = 1200.\n", + "R = 8.3143;\n", + "\n", + "# Calculation\n", + "x1 = (1-e)/2; x2 = (1-e)/2;\n", + "x3 = e/2; x4 = e/2;\n", + "K = (((x3**v3)*(x4**v4))/((x1**v1)*(x2**v2)))*P**(v3+v4-v1-v2); \t\t\t# Equillibrium consmath.tant\n", + "dG = -R*T*math.log(K);\n", + "\n", + "# Results\n", + "print \"Equillibrium constant is\",round(K,2)\n", + "print \"Gibbs function change is\",round(dG,1),\"J/gmol\"\n", + "\n", + "# note : rounding off error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equillibrium constant is 1.62\n", + "Gibbs function change is -4812.2 J/gmol\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.5 Page No : 662" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Veo = 1.777; \t\t\t# Ve/Vo\n", + "e = 1-Veo; \t\t\t# Degree of dissociation\n", + "P = 0.124; \t\t\t# in atm\n", + "\n", + "# Calculation\n", + "K = (4*e**2*P)/(1-e**2);\n", + "\n", + "# Results\n", + "print \"The value of equillibrium constant is\",round(K,3),\"atm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of equillibrium constant is 0.756 atm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.6 Page No : 663" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "v1 = 1.; \n", + "v2 = 0.; \n", + "v3 = 1.; v4 = 1./2;\n", + "dH = 250560.; e = 3.2e-03;\n", + "R = 8.3143; T = 1900.;\n", + "\n", + "# Calculation\n", + "Cp = ((dH**2)*(1+e/2)*e*(1+e))/(R*T**2*(v1+v2)*(v3+v4));\n", + "\n", + "# Results\n", + "print \"Cp is\",round(Cp,3),\"j/gmol K\"\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cp is 4.484 j/gmol K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.7 Page No : 663" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "a = 21.89;\n", + "y = 18.5;\n", + "x = 8.9;\n", + "\n", + "# Calculation\n", + "PC = 100.*(x*12.)/((8.9*12)+(18.5*1));\n", + "PH = 100-PC;\n", + "AFR = ((32*a)+(3.76*a*28))/((12*x)+y);\n", + "EAU = (8.8*32)/((21.89*32)-(8.8*32));\n", + "\n", + "# Results\n", + "print \"carbon = \",round(PC,2),\"% and Hydrogen = \",round(PH,2),\"%\"\n", + "print \"Air fuel ratio is\",round(AFR,0)\n", + "print \"Percentage of excess air used is\",round((EAU*100),2),\"%\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "carbon = 85.24 % and Hydrogen = 14.76 %\n", + "Air fuel ratio is 24.0\n", + "Percentage of excess air used is 67.23 %\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.8 Page No : 664" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "hf_co2 = -393522;\n", + "hf_h20 = -285838;\n", + "hf_ch4 = -74874;\n", + "\n", + "# Calculation\n", + "D = hf_co2 + (2*hf_h20);\n", + "QCV = D - (hf_ch4+1);\n", + "\n", + "# Results\n", + "print \"Heat transfer per kg mol of fuel is\",D,\"kJ\"\n", + "print \"Qcv = %.f kJ\"%QCV\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer per kg mol of fuel is -965198 kJ\n", + "Qcv = -890325 kJ\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.9 Page No : 664" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Below values are taken fron table 16.4\n", + "\n", + "# Variables\n", + "Hr = -249952.+(18.7*560)+(70*540);\n", + "Hp = 8.*(-393522.+20288)+9*(-241827+16087)+6.25*14171+70*13491;\n", + "Wcv = 150.; \t\t\t# Energy out put from engine in kW\n", + "Qcv = -205.; \t\t\t# Heat transfer from engine in kW\n", + "\n", + "# Calculation\n", + "n = (Wcv-Qcv)*3600/(Hr-Hp);\n", + "\n", + "# Results\n", + "print \"Fuel consumption rate is\",round((n*114),1),\"kg/h\"\n", + "\n", + "# rounding error is there." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fuel consumption rate is 38.5 kg/h\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.10 Page No : 665" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import interp\n", + "\n", + "# Variables\n", + "Hr1 = -249952.; \t\t\t# For ocmath.tane\n", + "Hp1 = Hr1;\n", + "# Below values are calculated umath.sing value fron table 16.4\n", + "T2 = 1000.; \n", + "Hp2 = -1226577.\n", + "T3 = 1200.;\n", + "Hp3 = 46537.;\n", + "T4 = 1100.;\n", + "Hp4 = -595964.;\n", + "\n", + "# Calculation\n", + "Hp = [Hp2 ,Hp3, Hp4]\n", + "T = [T2 ,T3, T4]\n", + "T1 = interp(Hp1,Hp , T); \t\t\t# Interpolation to find temperature at Hp1\n", + "\n", + "# Results\n", + "print \"the adeabatic flame temperature is\",T1,\"K\"\n", + "\n", + "# note : answer varies because the method - interp gives some different answer. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the adeabatic flame temperature is 1100.0 K\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.11 Page No : 666" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "T0 = 298.;\n", + "Wrev = -23316-3*(-394374)-4*(-228583);\n", + "Wrev_ = Wrev/44.; \t\t\t# in kJ/kg\n", + "Hr = -103847.;\n", + "T = 980.; \t\t\t# Through trial and error\n", + "\n", + "# Calculation\n", + "Sr = 270.019+20*205.142+75.2*191.611;\n", + "Sp = 3*268.194 + 4*231.849 + 15*242.855 + 75.2*227.485;\n", + "IE = Sp-Sr; \t\t\t# Increase in entropy\n", + "I = T0*3699.67/44;\n", + "Si = Wrev_ - I;\n", + "\n", + "# Results\n", + "print \"Reversible work is\",Wrev_,\"kJ/kg\"\n", + "print \"Increase in entropy during combustion is\",round(Sp-Sr,2),\"kj/kg mol K\"\n", + "print \"Irreversibility of the process\",round(I,0),\"kJ/kg\"\n", + "print \"Availability of products of combustion is\",round(Si,1),\"kJ/kg\"\n", + "\n", + "# note : there are rounding off errors. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reversible work is 47139.5 kJ/kg\n", + "Increase in entropy during combustion is 3699.67 kj/kg mol K\n", + "Irreversibility of the process 25057.0 kJ/kg\n", + "Availability of products of combustion is 22082.6 kJ/kg\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.12 Page No : 667" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T0 = 298.15; P0 = 1; R = 8.3143;\n", + "xn2 = 0.7567\n", + "xo2 = 0.2035\n", + "xh2o = 0.0312\n", + "xco2 = 0.0003;\n", + "\n", + "# Calculation and Results\n", + "# Part (a)\n", + "g_o2 = 0; g_c = 0; g_co2 = -394380; \n", + "A = -g_co2 + R*T0*math.log(xo2/xco2);\n", + "print \"The chemical energy of carbon is\",round(A,0),\"kJ/k mol\"\n", + "\n", + "# Part (b)\n", + "g_h2 = 0; g_h2o_g = -228590;\n", + "B = g_h2 + g_o2/2 - g_h2o_g + R*T0*math.log(xo2**0.5/xh2o);\n", + "print \"The chemical energy of hydrogen is\",round(B,0),\"kJ/k mol\"\n", + "\n", + "# Part (c)\n", + "g_ch4 = -50790;\n", + "C = g_ch4 + 2*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**2)/(xco2*xh2o));\n", + "print \"The chemical energy of methane is\",round(C,0),\"kJ/k mol\"\n", + "\n", + "# Part (d)\n", + "g_co = -137150;\n", + "D = g_co + g_o2/2 - g_co2 + R*T0*math.log((xo2**0.5)/xco2);\n", + "print \"The chemical energy of Carbonmonoxide is\",round(D,0),\"kJ/k mol\"\n", + "\n", + "# Part (e)\n", + "g_ch3oh = -166240;\n", + "E = g_ch3oh + 1.5*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**1.5)/(xco2*(xh2o**2)))\n", + "print \"The chemical energy of methanol is\",round(E,0),\"kJ/k mol\"\n", + "\n", + "# Part (f)\n", + "F = R*T0*math.log(1./xn2);\n", + "print \"The chemical energy of nitrogen is\",round(F,1),\"kJ/k mol\"\n", + "\n", + "# Part (g)\n", + "G = R*T0*math.log(1./xo2);\n", + "print \"The chemical energy of Oxygen is\",round(G,0),\"kJ/k mol\"\n", + "\n", + "# Part (h)\n", + "H = R*T0*math.log(1./xco2);\n", + "print \"The chemical energy of carbondioxide is\",round(H,0),\"kJ/k mol\"\n", + "\n", + "# Part (i)\n", + "g_h2o_l = -237180;\n", + "I = g_h2o_l - g_h2o_g + R*T0*math.log(1./xh2o);\n", + "print \"The chemical energy of water is\",round(I,1),\"kJ/k mol\"\n", + "\n", + "\n", + "# note : rounding off error is there. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The chemical energy of carbon is 410542.0 kJ/k mol\n", + "The chemical energy of hydrogen is 235212.0 kJ/k mol\n", + "The chemical energy of methane is 821580.0 kJ/k mol\n", + "The chemical energy of Carbonmonoxide is 275365.0 kJ/k mol\n", + "The chemical energy of methanol is 716699.0 kJ/k mol\n", + "The chemical energy of nitrogen is 691.1 kJ/k mol\n", + "The chemical energy of Oxygen is 3947.0 kJ/k mol\n", + "The chemical energy of carbondioxide is 20108.0 kJ/k mol\n", + "The chemical energy of water is 5.2 kJ/k mol\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.13 Page No : 669" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "b = 8./(0.114+0.029); \t\t\t# By carbon balance\n", + "C = 18./2 \t\t\t# By hydrogen balance\n", + "a = b*0.114 + (b/2)*0.029 + b*0.016 + C/2 ; \t\t\t# By oxygen balance\n", + "Wcv = 1. \t\t\t# Power developed by engine in kW \n", + "\n", + "# Calculation and Results\n", + "n_fuel = (0.57*1)/(3600*114.22);\n", + "Qcv = Wcv-n_fuel*3845872; \t\t\t# 5.33 \n", + "print \"The rate of heat transfer from the engine is\",round(Qcv,2),\"kW\"\n", + "# Part (b)\n", + "ach = 5407843.; \t\t\t# chemical energy of liquid ocmath.tane\n", + "n2 = Wcv/(n_fuel*ach);\n", + "print \"The second law efficiency is\",round((n2*100),1),\"%\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The rate of heat transfer from the engine is -4.33 kW\n", + "The second law efficiency is 13.3 %\n" + ] + } + ], + "prompt_number": 25 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch17.ipynb b/Engineering_Thermodynamics/ch17.ipynb new file mode 100755 index 00000000..92aeb958 --- /dev/null +++ b/Engineering_Thermodynamics/ch17.ipynb @@ -0,0 +1,517 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:72e2616045657b51e34a7053265f42c549d2a5b15ca9a3b0a7fb70c4376d5ddc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 17 : Compressible Fluid Flow" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.1 Page No : 694" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "import sys\n", + "\n", + "# Variables\n", + "T0 = 37+273\n", + "P = 40.\n", + "g = 1.4;\n", + "\n", + "def speed(a,b,f):\n", + " N = 100.;\n", + " eps = 1e-5;\n", + " if((f(a)*f(b))>0):\n", + " print('no root possible f(a)*f(b)>0');\n", + " sys.exit(0)\n", + " if(abs(f(a))0):\n", + " c = (a+b)/2.\n", + " if(abs(f(c))0):\n", + " print ('no root possible f(a)*f(b)>0');\n", + " sys.exit(0)\n", + " if(abs(f(a))0):\n", + " c = (a+b)/2.\n", + " if(abs(f(c))0):\n", + " print ('no root possible f(a)*f(b)>0');\n", + " sys.exit(0);\n", + "\n", + " if(abs(f(a))0):\n", + " c = (a+b)/2\n", + " if(abs(f(c))0):\n", + " print ('no root possible f(a)*f(b)>0');\n", + " sys.exit(0);\n", + "\n", + " if(abs(f(a))0):\n", + " c = (a+b)/2\n", + " if(abs(f(c)) T2 so the process must be polytropic\"\n", + "\n", + "# Part (b)\n", + "p = math.log(P2/P1); q = math.log(T2/T1);\n", + "n = p/(p-q);\n", + "print \"The polytropic index is %.2f\"%n\n", + "\n", + "# Part (c)\n", + "cp = 1.0035; R = 0.287;\n", + "Wa = cp*(T1-T2)-(V2**2/2)*1e-03 ;\n", + "Wt = -R*T0*math.log(P2/P1)-(V2**2/2)*1e-03;\n", + "Nt = Wt/Wa;\n", + "print \"The isothermal effiency is %.3f\"%Nt\n", + "\n", + "# Part (d)\n", + "f12 = cp*(T1-T2) + T0*((R*math.log(P2/P1))-(cp*math.log(T2/T1))) - (V2**2/2)*1e-03 ;\n", + "I = f12-Wa ; \n", + "print \"The minimum work input and irreversibility are %.1f and %.1f kJ/Kg \"%(f12,I)\n", + "\n", + "# Part (e)\n", + "n2 = (f12/Wa);\n", + "print \"Second law efficiency is %.2f\"%n2\n", + "\n", + "# note : answer are slightly different because of rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "As T2s> T2 so the process must be polytropic\n", + "The polytropic index is 1.33\n", + "The isothermal effiency is 0.978\n", + "The minimum work input and irreversibility are -97.4 and 14.0 kJ/Kg \n", + "Second law efficiency is 0.87\n" + ] + } + ], + "prompt_number": 12 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/ch9.ipynb b/Engineering_Thermodynamics/ch9.ipynb new file mode 100755 index 00000000..0c0c9e93 --- /dev/null +++ b/Engineering_Thermodynamics/ch9.ipynb @@ -0,0 +1,1016 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7f2ac1f73c638662f50d765235be56ca14cf295f3e77d6b32e206a78e4a459fc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Properties of Pure Substances" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 Page No : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "tsat = 179.91; # celsius\n", + "vf = 0.001127; # m**3/kg\n", + "vg = 0.19444; #m**3/kg\n", + "\n", + "# Calculation\n", + "vfg = vg-vf;\n", + "sf = 2.1387;\n", + "sg = 6.5865;\n", + "sfg = sg-sf;\n", + "\n", + "# Results\n", + "print \"At 1 Mpa saturation temperature is\",tsat,\"degree\"\n", + "print \"Changes in specific volume is\",vfg,\"m3/kg\"\n", + "print \"Change in entropy during evaporation is\",sfg,\"kJ/kg K\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "At 1 Mpa saturation temperature is 179.91 degree\n", + "Changes in specific volume is 0.193313 m3/kg\n", + "Change in entropy during evaporation is 4.4478 kJ/kg K\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 Page No : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "v = 0.09\n", + "vf = 0.001177\n", + "vg = 0.09963;\n", + "\n", + "# Calculation\n", + "x = (v-vf)/(vg-vf);\n", + "hf = 908.79; hfg = 1890.7;\n", + "sf = 2.4474; sfg = 3.8935;\n", + "h = hf+(x*hfg);\n", + "s = sf+(x*sfg);\n", + "\n", + "# Results\n", + "print \"The enthalpy and entropy of the system are %.4f and %.2f kJ/kg and kJ/kg K respectively\"%(s,h)\n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The enthalpy and entropy of the system are 5.9601 and 2614.55 kJ/kg and kJ/kg K respectively\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 Page No : 296" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import interp\n", + "\n", + "# Variables\n", + "# for T = 350 degree\n", + "T1 = 350; \n", + "v1 = 0.2003; \n", + "h1 = 3149.5; \n", + "s1 = 7.1369;\n", + "# for T = 400 degree\n", + "T2 = 400; \n", + "v2 = 0.2178; \n", + "h2 = 3257.5; \n", + "s2 = 7.3026;\n", + "\n", + "# Calculation\n", + "# Interpolation for T = 380;\n", + "T = [T1 ,T2];\n", + "v = [v1 ,v2];\n", + "h = [h1 ,h2];\n", + "s = [s1 ,s2];\n", + "v3 = interp(380,T,v);\n", + "h3 = interp(380,T,h);\n", + "s3 = interp(380,T,s);\n", + "\n", + "# Results\n", + "print \"The entropy, enthalpy and volume of stem at 1.4MPa and 380 degree is %.4f kJ/Kg, %.1f kJ/Kg, %.4f kJ/Kg respectively\"%(s3,h3,v3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The entropy, enthalpy and volume of stem at 1.4MPa and 380 degree is 7.2363 kJ/Kg, 3214.3 kJ/Kg, 0.2108 kJ/Kg respectively\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 Page No : 296" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Psat = 3.973e06;\n", + "vf = 0.0012512\n", + "vg = 0.05013;\n", + "hf = 1085.36\n", + "hfg = 1716.2;\n", + "sf = 2.7927\n", + "sfg = 3.2802;\n", + "mf = 9 # liquid in kg\n", + "V = 0.04; # volume\n", + "\n", + "# Calculation\n", + "Vf = mf*vf;\n", + "Vg = V-Vf;\n", + "mg = Vg/vg;\n", + "m = mf+mg;\n", + "x = mg/m;\n", + "v = vf+x*(vg-vf);\n", + "h = hf+x*hfg;\n", + "s = sf+(x*sfg);\n", + "u = h-Psat*v*1e-03;\n", + "\n", + "# at T = 250\n", + "uf = 1080.39\n", + "ufg = 1522;\n", + "u_ = uf+x*ufg;\n", + "\n", + "# Results\n", + "print \"The pressure is %.3f Mpa\"%(Psat/1000000)\n", + "print \"The mass is %.3f Kg\"%m\n", + "print \"Specific volume is %.5f m3/Kg\"%v\n", + "print \"Enthalpy is %.2f kJ/Kg\"%h\n", + "print \"The entropy is %.4f kJ/Kg K\"%s\n", + "print \"The interal energy is %.2f kJ/Kg\"%u\n", + "print \"u = %.2f kJ/kg\"%u_ #incorrect answer in the textbook\n", + "\n", + "# rounding off error. please check. book answers may wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The pressure is 3.973 Mpa\n", + "The mass is 9.573 Kg\n", + "Specific volume is 0.00418 m3/Kg\n", + "Enthalpy is 1188.13 kJ/Kg\n", + "The entropy is 2.9891 kJ/Kg K\n", + "The interal energy is 1171.53 kJ/Kg\n", + "u = 1171.53 kJ/kg\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 Page No : 297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import interp\n", + "\n", + "# Part (a)\n", + "vg1_ = 0.8919\n", + "T1_ = 120;\n", + "vg2_ = 0.77076\n", + "T2_ = 125;\n", + "vg_ = [vg1_, vg2_]\n", + "T_ = [T1_, T2_];\n", + "v1 = 0.7964;\n", + "h1 = 2967.6;\n", + "P1 = 0.3e03; \t\t\t# in Kpa\n", + "\n", + "# Calculation and Results\n", + "T1 = interp(v1,vg_,T_);\n", + "print \"The steam become saturated at \",T1,\"degree\"\n", + "\n", + "# Part (b)\n", + "vf = 0.001029\n", + "vg = 3.407;\n", + "hf = 334.91\n", + "hfg = 2308.8;\n", + "Psat = 47.39; \t\t\t# In kPa\n", + "v2 = v1;\n", + "x2 = (v1-vf)/(vg-vf);\n", + "h2 = hf+x2*hfg;\n", + "P2 = Psat;\n", + "Q12 = (h2-h1)+v1*(P1-P2);\n", + "\n", + "print \"The quality factor at t=80 degree is %.4f\"%x2\n", + "print \"The heat transfered per kg of steam in cooling from 250 degree to 80 degree %.2f kJ/Kg\"%Q12\n", + "\n", + "# rounding off error. interp function gives slightly different answer." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The steam become saturated at 125.0 degree\n", + "The quality factor at t=80 degree is 0.2335\n", + "The heat transfered per kg of steam in cooling from 250 degree to 80 degree -1892.35 kJ/Kg\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.7 Page No : 298" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Variables\n", + "# At T = 40 degree\n", + "Psat = 7.384e06;\n", + "sf = 0.5725\n", + "sfg = 7.6845;\n", + "hf = 167.57\n", + "hfg = 2406.7;\n", + "s1 = 6.9189\n", + "h1 = 3037.6;\n", + "\n", + "# Calculation\n", + "x2 = round((s1-sf)/sfg,3) ;\n", + "h2 = hf+(x2*hfg);\n", + "W = h1-h2;\n", + "\n", + "\n", + "# Results\n", + "print \"The ideal work output of the turbine is %.2f kJ/Kg\"%W\n", + "\n", + "# rounding off error. please check using calculator." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The ideal work output of the turbine is 882.10 kJ/Kg\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.8 Page No : 299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "from numpy import interp\n", + "\n", + "# Variables\n", + "w3 = 2.3 #adiabatic mixing\n", + "w1 = 1.0;\n", + "w2 = w3-w1;\n", + "h1 = 2950.0;\n", + "\n", + "# At 0.8MPa, 0.95 dry\n", + "x = 0.95;\n", + "hf = 721.11\n", + "hfg = 2048;\n", + "\n", + "# Calculation\n", + "h2 = hf + (x*hfg);\n", + "h3 = ((w1*h1)+(w2*h2))/w3;\n", + "# Interpolation\n", + "H = [2769.1, 2839.3];\n", + "T = [170.43, 200];\n", + "t3 = interp(2790,H,T);\n", + "s3 = 6.7087; \n", + "s4 = s3;\n", + "x4 = (s3-1.7766)/5.1193;\n", + "h4 = 604.74+(x4*2133.8);\n", + "V4 = math.sqrt(2000*(h3-h4));\n", + "\n", + "# Results\n", + "print \"The condition of superheat after mixing %.2f degree\"%(t3-T[0])\n", + "print \"The velocity of steam leaving the nozzle is %.1f m/sec\"%V4\n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The condition of superheat after mixing 8.80 degree\n", + "The velocity of steam leaving the nozzle is 508.7 m/sec\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.9 Page No : 300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "h2 = 2716.2\n", + "hf = 844.89\n", + "hfg = 1947.3;\n", + "\n", + "# Calculation\n", + "x1 = (h2-hf)/hfg;\n", + "h3 = 2685.5;\n", + "x4 = (h3-hf)/hfg;\n", + "\n", + "# Results\n", + "print \"The quality of steam in pipe line is %.3f\"%x1\n", + "print \"Maximum moisture is %.2f %%\"%(100-(x4*100))\n", + "\n", + "# rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The quality of steam in pipe line is 0.961\n", + "Maximum moisture is 5.48 %\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.10 Page No : 301" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# At 0.1Mpa, 110 degree\n", + "h2 = 2696.2\n", + "hf = 844.89\n", + "hfg = 1947.3;\n", + "\n", + "# Calculation\n", + "x2 = (h2-hf)/hfg;\n", + "vf = 0.001023; \t\t\t# at T = 70 degree\n", + "V = 0.000150; \t\t\t# In m3\n", + "m1 = V/vf;\n", + "m2 = 3.24;\n", + "x1 = (x2*m2)/(m1+m2);\n", + "\n", + "# Results\n", + "print \"The quality of the steam in the pipe line is %.3f\"%x1\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The quality of the steam in the pipe line is 0.910\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.11 Page No : 302" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# P = 1MPa\n", + "vf = 0.001127\n", + "vg = 0.1944;\n", + "hg = 2778.1\n", + "uf = 761.68;\n", + "ug = 2583.6\n", + "ufg = 1822;\n", + "# Initial anf final mass\n", + "Vis = 5.\n", + "Viw = 5.;\n", + "Vfs = 6.\n", + "Vfw = 4.\n", + "\n", + "# Calculation\n", + "ms = ((Viw/vf)+(Vis/vg)) - ((Vfw/vf)+(Vfs/vg)) ;\n", + "U1 = ((Viw*uf/vf)+(Vis*ug/vg));\n", + "Uf = ((Vfw*uf/vf)+(Vfs*ug/vg));\n", + "Q = Uf-U1+(ms*hg)\n", + "\n", + "# Results\n", + "print \"The heat transfer during the process is\",round(Q/1000,3),\"kJ\"\n", + "\n", + "# It seems book answer is wrong. please check using calculator." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat transfer during the process is 1788.192 kJ\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.12 Page No : 303" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 0.02\n", + "d = 0.28\n", + "l = 0.305;\n", + "P1 = 0.6e06\n", + "P2 = 0.12e06;\n", + "\n", + "# Calculation and Results\n", + "# At 0.6MPa, t = 200 degree\n", + "v1 = 0.352\n", + "h1 = 2850.1;\n", + "V1 = m*v1;\n", + "Vd = (math.pi/4)*d**2*l;\n", + "V2 = V1+Vd ; \n", + "n = math.log(P1/P2)/math.log(V2/V1);\n", + "W12 = ((P1*V1)-(P2*V2))/(n-1);\n", + "\n", + "print \"The value of n is %.2f\"%n\n", + "print \"The work done by the steam is %.1f kJ\"%(W12/1000)\n", + "\n", + "v2 = V2/m;\n", + "vf = 0.0010476\n", + "vfg = 1.4271;\n", + "x2 = (v2-vf)/vfg ;\n", + "# At 0.12MPa\n", + "uf = 439.3\n", + "ug = 2512.0;\n", + "u2 = uf + (x2*(ug-uf));\n", + "u1 = h1-(P1*v1*1e-03);\n", + "Q12 = m*(u2-u1)+ (W12/1000);\n", + "\n", + "print \"The heat transfer is %.3f kJ\"%Q12\n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of n is 1.24\n", + "The work done by the steam is 4.7 kJ\n", + "The heat transfer is -1.801 kJ\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.13 Page No : 305" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "x1 = 1.\n", + "x2 = 0.8;\n", + "# at 0.2MPa\n", + "vg = 0.8857\n", + "v1 = vg\n", + "hg = 2706.7\n", + "h1 = hg; \n", + "m1 = 5.\n", + "V1 = m1*v1;\n", + "\n", + "# Calculation\n", + "# at 0.5MPa\n", + "m2 = 10; \n", + "hf = 640.23\n", + "hfg = 2108.5\n", + "vf = 0.001093\n", + "vfg = 0.3749;\n", + "v2 = vf+(x2*vfg);\n", + "V2 = m2*v2;\n", + "\n", + "Vm = V1+V2;\n", + "m = m1+m2;\n", + "vm = Vm/m;\n", + "u1 = h1;\n", + "h2 = hf+(x2*hfg);\n", + "u2 = h2;\n", + "m3 = m;\n", + "h3 = ((m1*u1)+(m2*u2))/m3;\n", + "u3 = h3; \n", + "v3 = vm;\n", + "# From mollier diagram\n", + "x3 = 0.870\n", + "p3 = 3.5\n", + "s3 = 6.29;\n", + "s1 = 7.1271;\n", + "sf = 1.8607\n", + "sfg = 4.9606;\n", + "s2 = sf+(x2*sfg);\n", + "E = m3*s3-((m1*s1)+(m2*s2));\n", + "\n", + "# Results\n", + "print \"Final pressure is \",p3,\"bar\"\n", + "print \"Steam quality is\",x3\n", + "print \"Entropy change during the process is %.2f kJ/K\"%E\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure is 3.5 bar\n", + "Steam quality is 0.87\n", + "Entropy change during the process is 0.42 kJ/K\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.14 Page No : 306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# At 6 MPa, 400 degree\n", + "h1 = 3177.2\n", + "s1 = 6.5408;\n", + "\n", + "# At 20 degree\n", + "h0= 83.96\n", + "s0 = 0.2966;\n", + "T0 = 293.\n", + "\n", + "# Calculation\n", + "f1 = (h1-h0)-T0*(s1-s0);\n", + "# By interpolation \n", + "t2 = 273. + 393;\n", + "s2 = 6.63;\n", + "h2 = h1;\n", + "f2 = (h2-h0)-T0*(s2-s0);\n", + "df = f1-f2;\n", + "x3s = (s2-1.5301)/(7.1271-1.5301);\n", + "h3s = 504.7+(x3s*2201.9);\n", + "eis = 0.82;\n", + "h3 = h2-eis*(h1-h3s);\n", + "x3 = (h3-504.7)/2201.7;\n", + "s3 = 1.5301+(x3*5.597);\n", + "f3 = (h3-h0)-T0*(s3-s0);\n", + "\n", + "# Results\n", + "print \"The availability of the steam before the throttle valve %.1f kJ/Kg\"%f1\n", + "print \"The availability of the steam after the throttle valve %.2f Kj/Kg\"%f2\n", + "print \"The availability of the steam at the turbine exhaust %.2f kJ/Kg\"%f3\n", + "print \"The specific work output from the turbine is %.1f kJ/Kg\"%(h2-h3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The availability of the steam before the throttle valve 1263.7 kJ/Kg\n", + "The availability of the steam after the throttle valve 1237.55 Kj/Kg\n", + "The availability of the steam at the turbine exhaust 601.85 kJ/Kg\n", + "The specific work output from the turbine is 546.3 kJ/Kg\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.15 Page No : 308" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# At 25 bar, 350 degree\n", + "h1 = 3125.87\n", + "s1 = 6.8481;\n", + "# 30 degree\n", + "h0 = 125.79\n", + "s0 = 0.4369;\n", + "h2 = 2865.5\n", + "s2 = 7.3115;\n", + "# At 0.2 bar 0.95 dry\n", + "hf = 251.4\n", + "hfg = 2358.3;\n", + "sf = 0.8320\n", + "sg = 7.0765;\n", + "\n", + "# Calculation\n", + "h3 = hf+0.92*hfg;\n", + "s3 = sf+(0.92*sg);\n", + "# Part (a)\n", + "T0 = 303;\n", + "f1 = (h1-h0)-(T0*(s1-s0));\n", + "f2 = (h2-h0)-(T0*(s2-s0));\n", + "f3 = (h3-h0)-(T0*(s3-s0));\n", + "\n", + "# Results\n", + "print \"Availability of steam entering at state 1 is %.2f kJ/Kg\"%f1\n", + "print \"Availability of steam leaving at state 2 is %.2f kJ/Kg\"%f2\n", + "print \"Availability of steam leaving at state 3 is %.2f kJ/Kg\"%f3\n", + "\n", + "# Part (b)\n", + "m2m1 = 0.25\n", + "m3m1 = 0.75;\n", + "Wrev = f1-(m2m1*f2)-(m3m1*f3);\n", + "print \"Maximum work is %.2f kJ/Kg\"%Wrev\n", + "\n", + "# Part (c)\n", + "w1 = 600.\n", + "w2 = 150.\n", + "w3 = 450.;\n", + "Q = -10.*3600; \t\t\t# For 1 hour\n", + "I = T0*(w2*s2+w3*s3-w1*s1)-Q;\n", + "print \"Irreversibility is %.2f MJ/h\"%(I/1000)\n", + "\n", + "# rounding off error. please check using calcultor." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Availability of steam entering at state 1 is 1057.49 kJ/Kg\n", + "Availability of steam leaving at state 2 is 656.71 kJ/Kg\n", + "Availability of steam leaving at state 3 is 202.89 kJ/Kg\n", + "Maximum work is 741.15 kJ/Kg\n", + "Irreversibility is 124.46 MJ/h\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.16 Page No : 309" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# At dead state of 1 bar, 300K\n", + "u0 = 113.1\n", + "h0 = 113.2;\n", + "v0 = 0.001005\n", + "s0 = 0.0395;\n", + "T0 = 300.\n", + "P0 = 100.;\n", + "\n", + "# Calculation and Results\n", + "K = h0-(T0*s0);\n", + "# Part (a)\n", + "u = 376.9\n", + "h = 377; \n", + "v = 0.001035\n", + "s = 1.193;\n", + "m = 3 \n", + "a = h - 300 * s\n", + "fi = m*(a - (-5.3)) \t\t\t# As P = P0 = 1 bar\n", + "print \"Energy of system in Part (a) is\",fi,\"kJ\"\n", + "\n", + "# Part (b)\n", + "u = 3099.8\n", + "h = 3446.3\n", + "v = 0.08637\n", + "s = 7.090; \t\t\t# At P = 4 Mpa, t = 500 degree\n", + "m = 0.2;\n", + "b = u +100* v - 300 * s\n", + "fib = m*(b-(-5.3));\n", + "print \"Energy of system in Part (b) is\",fib,\"kJ\"\n", + "\n", + "# Part (c)\n", + "m = 0.4;\n", + "x = 0.85; \t\t\t# Quality\n", + "u = 192+x*2245;\n", + "h = 192+x*2392;\n", + "s = 0.649+x*7.499;\n", + "v = 0.001010+x*14.67;\n", + "c = round(u + 100*v - 300*s,1)\n", + "fic = m*(c - (-5.3));\n", + "print \"Energy of system in Part (c) is\",round(fic,1),\"kJ\"\n", + "\n", + "# Part (d)\n", + "m = 3;\n", + "h = -354.1; s = -1.298; \t\t\t# at 1000kPa, -10 degree\n", + "fid = m*(h-h0-T0*(s-s0))# ((h-h0)-T0*(s-s0));\n", + "print \"Energy of system in Part (d) is\",fid,\"kJ\"\n", + "\n", + "# book answer is wrong. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Energy of system in Part (a) is 73.2 kJ\n", + "Energy of system in Part (b) is 197.3474 kJ\n", + "Energy of system in Part (c) is 498.3 kJ\n", + "Energy of system in Part (d) is -198.15 kJ\n" + ] + } + ], + "prompt_number": 64 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.17 Page No : 310" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "# Given\n", + "th1 = 90.+273;\n", + "tc1 = 25.+273;\n", + "tc2 = 50.+273;\n", + "mc = 1.\n", + "T0 = 300.;\n", + "th2p = 60.+273; \t\t\t# Parallel\n", + "th2c = 35.+273; \t\t\t# Counter\n", + "\n", + "# Calculation\n", + "mhp = (tc2-tc1)/(th1-th2p); \t\t\t# Parallel\n", + "mhc = (tc2-tc1)/(th1-th2c); \t\t\t# Counter\n", + "h0 = 113.2\n", + "s0 = 0.395\n", + "T0 = 300; \t\t\t# At 300 K\n", + "h1 = 376.92\n", + "s1 = 1.1925; \t\t\t# At 90 degree\n", + "af1 = mhp*((h1-h0)-T0*(s1-s0));\n", + "\n", + "# Parallel Flow\n", + "h2 = 251.13; s2 =0.8312; \t\t\t# At 60 degree\n", + "h3 = 104.89; s3 = 0.3674; \t\t\t# At 25 degree\n", + "h4 = 209.33; s4 = 0.7038; \t\t\t# At 50 degree\n", + "REG = mc*((h4-h3)-T0*(s4-s3)); \t\t\t# Rate of energy gain\n", + "REL = mhp*((h1-h2)-T0*(s1-s2)); \t\t\t# Rate of energy loss\n", + "Ia = REL-REG; \t\t\t# Energy destruction\n", + "n2a = REG/REL; \t\t\t# Second law efficiency\n", + "\n", + "# Results\n", + "print (\"In parallel flow\")\n", + "print \"The rate of irreversibility is\",Ia,\"kW\"\n", + "print \"The Second law efficiency is %.2f %%\"%(n2a*100)\n", + "\n", + "# Counter flow\n", + "h2 = 146.68\n", + "s2 = 0.5053; \t\t\t# At 35 degree\n", + "REG_b = REG; \t\t\t# Rate of energy gain by hot water is same in both flows\n", + "REL_b = mhc*((h1-h2)-T0*(s1-s2));\n", + "Ib = REL_b-REG_b; \t\t\t# Energy destruction\n", + "n2b = REG_b/REL_b; \t\t\t# Second law efficiency\n", + "\n", + "print (\"In Counter flow\")\n", + "print \"The rate of irreversibility is %.2f kW\"%Ib\n", + "print \"The Second law efficiency is %.2f %%\"%(n2b*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "In parallel flow\n", + "The rate of irreversibility is 10.98 kW\n", + "The Second law efficiency is 24.28 %\n", + "In Counter flow\n", + "The rate of irreversibility is 7.43 kW\n", + "The Second law efficiency is 32.16 %\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.18 Page No : 312" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "m = 50 ; \t\t\t# in kg/h\n", + "Th = 23.+273; \t\t\t# Home temperature\n", + "\n", + "# State 1\n", + "T1 = 150.+273;\n", + "h1 = 2746.4;\n", + "s1 = 6.8387;\n", + "\n", + "# State 2\n", + "h2 = 419.0;\n", + "s2 = 1.3071;\n", + "T0 = 318;\n", + "\n", + "# Calculation\n", + "b1 = h1-(T0*s1);\n", + "b2 = h2-(T0*s2);\n", + "Q_max = m*(b1-b2)/(T0/Th-1);\n", + "\n", + "# Results\n", + "print \"The maximum cooling rate is %.0f kW\"%(Q_max/3600)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum cooling rate is 106 kW\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Engineering_Thermodynamics/screenshots/ch1.png b/Engineering_Thermodynamics/screenshots/ch1.png new file mode 100755 index 00000000..d65e8e21 Binary files /dev/null and b/Engineering_Thermodynamics/screenshots/ch1.png differ diff --git a/Engineering_Thermodynamics/screenshots/ch16.png b/Engineering_Thermodynamics/screenshots/ch16.png new file mode 100755 index 00000000..bff877c7 Binary files /dev/null and b/Engineering_Thermodynamics/screenshots/ch16.png differ diff --git a/Engineering_Thermodynamics/screenshots/ch9.png b/Engineering_Thermodynamics/screenshots/ch9.png new file mode 100755 index 00000000..33917721 Binary files /dev/null and b/Engineering_Thermodynamics/screenshots/ch9.png differ -- cgit