summaryrefslogtreecommitdiff
path: root/Engineering_Thermodynamics
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Thermodynamics')
-rwxr-xr-xEngineering_Thermodynamics/README.txt10
-rwxr-xr-xEngineering_Thermodynamics/ch1.ipynb249
-rwxr-xr-xEngineering_Thermodynamics/ch10.ipynb1017
-rwxr-xr-xEngineering_Thermodynamics/ch11.ipynb170
-rwxr-xr-xEngineering_Thermodynamics/ch12.ipynb805
-rwxr-xr-xEngineering_Thermodynamics/ch13.ipynb590
-rwxr-xr-xEngineering_Thermodynamics/ch14.ipynb502
-rwxr-xr-xEngineering_Thermodynamics/ch15.ipynb487
-rwxr-xr-xEngineering_Thermodynamics/ch16.ipynb554
-rwxr-xr-xEngineering_Thermodynamics/ch17.ipynb517
-rwxr-xr-xEngineering_Thermodynamics/ch18.ipynb554
-rwxr-xr-xEngineering_Thermodynamics/ch2.ipynb136
-rwxr-xr-xEngineering_Thermodynamics/ch3.ipynb498
-rwxr-xr-xEngineering_Thermodynamics/ch4.ipynb353
-rwxr-xr-xEngineering_Thermodynamics/ch5.ipynb423
-rwxr-xr-xEngineering_Thermodynamics/ch6.ipynb322
-rwxr-xr-xEngineering_Thermodynamics/ch7.ipynb576
-rwxr-xr-xEngineering_Thermodynamics/ch8.ipynb1018
-rwxr-xr-xEngineering_Thermodynamics/ch9.ipynb1016
-rwxr-xr-xEngineering_Thermodynamics/screenshots/ch1.pngbin0 -> 74665 bytes
-rwxr-xr-xEngineering_Thermodynamics/screenshots/ch16.pngbin0 -> 75493 bytes
-rwxr-xr-xEngineering_Thermodynamics/screenshots/ch9.pngbin0 -> 78654 bytes
22 files changed, 9797 insertions, 0 deletions
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))<eps):\n",
+ " print('solution at a');\n",
+ " sys.exit(0)\n",
+ " if(abs(f(b))<eps):\n",
+ " print('solution at b');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " while(N>0):\n",
+ " c = (a+b)/2.\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c ;\n",
+ " return x;\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c ;\n",
+ " else:\n",
+ " a = c ;\n",
+ " N = N-1;\n",
+ "\n",
+ " print('no convergence');\n",
+ " sys.exit(0)\n",
+ "\n",
+ "def p(x): \n",
+ "\t return x**4 + (5*(x**2)) - 3.225 \n",
+ "x = speed(0.5,1,p);\n",
+ "M = x; \t\t\t# Mach number\n",
+ "g = 1.4; \t\t\t# gamma\n",
+ "R = 0.287;\n",
+ "\n",
+ "# Calculation\n",
+ "T = T0/(1+((g-1)/2)*M**2);\n",
+ "c = math.sqrt(g*R*T*1000);\n",
+ "V = c*M;\n",
+ "P0 = P*((T0/T)**(g/(g-1)));\n",
+ "\n",
+ "# Results\n",
+ "print \"Mach number is\",round(M,2)\n",
+ "print \"Velocity is\",round(V,1),\"m/s\"\n",
+ "print \"Stagnation pressure is\",round(P0,2),\"kPa\"\n",
+ "\n",
+ "# note: rounding off error is there."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mach number is 0.76\n",
+ "Velocity is 254.1 m/s\n",
+ "Stagnation pressure is 58.67 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.2 Page No : 695"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "P1 = 0.18e03; \t\t\t# in Kpa\n",
+ "R = 0.287\n",
+ "T1 = 310.; \n",
+ "P0 = 0.1e03;\n",
+ "A1 = 0.11; \n",
+ "V1 = 267.;\n",
+ "\n",
+ "# Calculation\n",
+ "w = (P1/(R*T1))*A1*V1;\n",
+ "g = 1.4;\n",
+ "c1 = math.sqrt(g*R*T1*1000);\n",
+ "M1 = V1/c1;\n",
+ "A1A_ = 1.0570; \t\t\t# A1./A* A* = A_\n",
+ "P1P01 = 0.68207;\n",
+ "T1T01 = 0.89644;\n",
+ "F1F_ = 1.0284;\n",
+ "A2A1 = 0.44/0.11 ; \t\t\t# A2A1 = A2/A1\n",
+ "A2A_ = A2A1*A1A_;\n",
+ "M2 = 0.135; \n",
+ "P2P02 = 0.987; \n",
+ "T2T02 = 0.996; \n",
+ "F2F_ = 3.46;\n",
+ "P2P1 = P2P02/P1P01;\n",
+ "T2T1 = T2T02/T1T01;\n",
+ "F2F1 = F2F_/F1F_;\n",
+ "P2 = P2P1*P1;\n",
+ "T2 = T2T1*T1;\n",
+ "A2 = A2A1*A1;\n",
+ "F1 = P1*A1*(1+g*M1**2);\n",
+ "F2 = F2F1*F1;\n",
+ "Tint = F2-F1;\n",
+ "Text = P0*(A2-A1);\n",
+ "NT = Tint - Text ;\n",
+ "\n",
+ "# Results\n",
+ "print \"Net thrust is\",round(NT,2),\"kN\"\n",
+ "\n",
+ "# rounding off error is there."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net thrust is 51.33 kN\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.3 Page No : 697"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "M2 = 2.197; \n",
+ "P2P0 = 0.0939; \n",
+ "T2T0 = 0.5089;\n",
+ "P0 = 1000.\n",
+ "T0 = 360.; \n",
+ "g = 1.4; \n",
+ "R = 0.287; \n",
+ "\n",
+ "# Calculation and Results\n",
+ "P2 = P2P0*P0;\n",
+ "T2 = T2T0*T0;\n",
+ "c2 = math.sqrt(g*R*T2*1000);\n",
+ "V2 = c2*M2;\n",
+ "# for air\n",
+ "P_P0 = 0.528; T_T0 = 0.833; \t\t\t# T_ == T*\n",
+ "P_ = P_P0*P0; T_ = T_T0*T0;\n",
+ "rho_ = P_/(R*T_);\n",
+ "V_ = math.sqrt(g*R*T_*1000);\n",
+ "At = 500e-06; \t\t\t# throat area\n",
+ "w = At*V_*rho_;\n",
+ "\n",
+ "print (\"When divergent section act as a nozzle\")\n",
+ "print \"Maximum flow rate of air is\",round(w,3),\"kg/s\"\n",
+ "print \"Static temperature is\",round(T2,1),\"K\"\n",
+ "print \"Static Pressure is\",P2,\"kPa\"\n",
+ "print \"Velocity at the exit from the nozzle is\",round(V2,0),\"m/s\"\n",
+ "\n",
+ "# Part (b)\n",
+ "Mb = 0.308; \n",
+ "P2P0b = 0.936;\n",
+ "T2T0b = 0.9812;\n",
+ "P2b = P2P0b*P0;\n",
+ "T2b = T2T0b*T0;\n",
+ "c2b = math.sqrt(g*R*T2b*1000);\n",
+ "V2b = c2b*Mb; \n",
+ "\n",
+ "print (\"\\nWhen divergent section act as a diffuser\")\n",
+ "print \"Maximum flow rate of air is\",round(w,3),\"kg/s\"\n",
+ "print \"Static temperature is\",round(T2b,1),\"K\"\n",
+ "print \"Static Pressure is\",P2b,\"kPa\"\n",
+ "print \"Velocity at the exit from the nozzle is\",round(V2b,0),\"m/s\"\n",
+ "\n",
+ " \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When divergent section act as a nozzle\n",
+ "Maximum flow rate of air is 1.065 kg/s\n",
+ "Static temperature is 183.2 K\n",
+ "Static Pressure is 93.9 kPa\n",
+ "Velocity at the exit from the nozzle is 596.0 m/s\n",
+ "\n",
+ "When divergent section act as a diffuser\n",
+ "Maximum flow rate of air is 1.065 kg/s\n",
+ "Static temperature is 353.2 K\n",
+ "Static Pressure is 936.0 kPa\n",
+ "Velocity at the exit from the nozzle is 116.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.4 Page No : 698"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Px = 16. #kPa; \n",
+ "Poy = 70. #kPa;\n",
+ "Mx = 1.735; \n",
+ "Pyx = 3.34; \t\t\t# Pyx = Py/Px\n",
+ "rho_yx = 2.25;\n",
+ "Tyx = 1.483; Poyox = 0.84; My = 0.631;\n",
+ "Tox = 573; Toy = Tox;\n",
+ "\n",
+ "# Calculation\n",
+ "Tx = Tox/(1+((g-1)/2.)*Mx**2);\n",
+ "Ty = Tyx*Tx;\n",
+ "Pox = Poy/Poyox ;\n",
+ "# From table\n",
+ "Mx = 1.735;\n",
+ "\n",
+ "# Results\n",
+ "print \"Mach number of the tunnel is\",Mx\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mach number of the tunnel is 1.735\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.5 Page No : 699"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Ax = 18.75; \n",
+ "A_ = 12.50; \t\t\t# A_= A*\n",
+ "AA_ = 1.5; \t\t\t# A/A*\n",
+ "Mx = 1.86; \n",
+ "Pxox = 0.159; \n",
+ "R = 0.287;\n",
+ "Pox = 0.21e03; \t\t\t# in kPa\n",
+ "\n",
+ "# Calculation\n",
+ "Px = Pxox*Pox;\n",
+ "# from the gas table on normal shock\n",
+ "Mx = 1.86; My = 0.604; Pyx = 3.87; Poyx = 4.95; Poyox = 0.786;\n",
+ "Py = Pyx*Px;\n",
+ "Poy = Poyx*Px;\n",
+ "My = 0.604;\n",
+ "Ay_ = 1.183;\n",
+ "A2 = 25.; Ay = 18.75;\n",
+ "A2_ = (A2/Ay)*Ay_;\n",
+ "# From isentropic table \n",
+ "M2 = 0.402;\n",
+ "P2oy = 0.895;\n",
+ "P2 = P2oy*Poy;\n",
+ "syx = -R*math.log(Poy/Pox); \t\t\t# sy-sx\n",
+ "\n",
+ "# Results\n",
+ "print \"Exit mach number is M2\",M2\n",
+ "print \"Exit pressure is\",round(P2,2),\"kPa\"\n",
+ "print \"Exit Stagnation pressure is\",round((Pox-Poy),1),\"kPa\"\n",
+ "print \"Entropy increase is\",round(syx,4),\"kJ/kg K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exit mach number is M2 0.402\n",
+ "Exit pressure is 147.93 kPa\n",
+ "Exit Stagnation pressure is 44.7 kPa\n",
+ "Entropy increase is 0.0687 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.6 Page No : 700"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "g = 1.4\n",
+ "R = 0.287\n",
+ "d = 1.4; \t\t\t# del \n",
+ "P0 = 1.4; \t\t\t# in bar\n",
+ "T0 = 280.\n",
+ "T1 = T0;\n",
+ "cp = 1.005\n",
+ "A2 = 0.0013\n",
+ "\n",
+ "# Calculation\n",
+ "P_ = P0/((g+1)/2.)**(d/(d-1)) ; \t\t\t# P_ = P*\n",
+ "P1 = P0; Pb = 1.; P2 = Pb;\n",
+ "T2 = T1*(P2/P1)**((d-1)/d);\n",
+ "V2 = math.sqrt(2*cp*(T1-T2)*1000);\n",
+ "m_dot = (A2*V2*P2*100)/(R*T2);\n",
+ "\n",
+ "# Results\n",
+ "print \"Mass flow rate is\",round(m_dot,4),\"kg/s\"\n",
+ "print \"The mass flow rate can be increased by raising the supply pressure\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate is 0.4045 kg/s\n",
+ "The mass flow rate can be increased by raising the supply pressure\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.7 Page No : 701"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Mx = 1.8\n",
+ "Pyx = 3.6133;\n",
+ "Px = 0.5; Tx = 280.; Ty = 429.;\n",
+ "R = 0.287\n",
+ "\n",
+ "\n",
+ "# Calculation and Results\n",
+ "Py = Pyx*Px; cp = 1.005;\n",
+ "print \"Pressure Py is\",round(Py,4),\"bar\"\n",
+ "\n",
+ "Pxox = 0.17404;\n",
+ "Pox = Px/Pxox;\n",
+ "print \"Stagnation pressure is\",round(Pox,2),\"bar\"\n",
+ "\n",
+ "Txox = 0.60680;\n",
+ "Tox = Tx/Txox; \n",
+ "print \"Stagnation temperature is\",round(Tox,1),\"K\"\n",
+ "\n",
+ "sysx = cp*math.log(Ty/Tx)-R*math.log(Py/Px);\n",
+ "print \"The change in specific entropy is\",round(sysx,5),\"kJ/kg K\"\n",
+ "\n",
+ "# note : rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure Py is 1.8067 bar\n",
+ "Stagnation pressure is 2.87 bar\n",
+ "Stagnation temperature is 461.4 K\n",
+ "The change in specific entropy is 0.06011 kJ/kg K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.8 Page no : 701"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# variables\n",
+ "M1 = 0.39\n",
+ "T1ox = 0.97032\n",
+ "Tox = 546.2\n",
+ "P1ox = 0.9\n",
+ "pox = 3.778 # bar\n",
+ "Mx = 2\n",
+ "Pxox = 0.1278\n",
+ "Px = 0.4828 # bar\n",
+ "My = 0.57735\n",
+ "Pyoy = 0.79737\n",
+ "Poy = 2.735 # bar\n",
+ "Toy = 546.2 # K\n",
+ "Tox = Toy\n",
+ "\n",
+ "# calculations and Results\n",
+ "A1 = 0.5*0.287*530/(180*3.4*100) # m**2\n",
+ "print \"A1 = %.4e m**2\"%A1\n",
+ "M1 = 0.39\n",
+ "A1 = 1.6346\n",
+ "Astar = 7.602*10**-4\n",
+ "print \"A* = %.3e m**2\"%(Astar)\n",
+ "M = 0.57735\n",
+ "A2 = 1.25*Astar\n",
+ "print \"A2 = Exit plane area = %.3e m**2\"%A2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A1 = 1.2427e-03 m**2\n",
+ "A* = 7.602e-04 m**2\n",
+ "A2 = Exit plane area = 9.503e-04 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch18.ipynb b/Engineering_Thermodynamics/ch18.ipynb
new file mode 100755
index 00000000..808ecda7
--- /dev/null
+++ b/Engineering_Thermodynamics/ch18.ipynb
@@ -0,0 +1,554 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9e53418f9e4cdd211f20a8f37b3c55eb0a17f05c8100d8c18f420c262cc67c0c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Gas Compressors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.1 Page No : 723"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T2 = 488.\n",
+ "T1 = 298.; n = 1.3; R =8314./44;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "rp = (T2/T1)**(n/(n-1));\n",
+ "print \"Pressure ratio is\",round(rp,2)\n",
+ "\n",
+ "b = 0.12; \t\t\t# Bore of compressor\n",
+ "L = 0.15; \t\t\t# Stroke of compressor\n",
+ "V1 = (math.pi/4)*(b)**2*L ; \n",
+ "P1 = 120e03; \t\t\t# in kPa\n",
+ "W = ((n*P1*V1)/(n-1))*(((rp)**((n-1)/n))-1);\n",
+ "P = (W*1200*0.001)/60 ; \n",
+ "print \"Indicated power is\",round(P,2),\"kW\"\n",
+ "print \"Shaft power is\",round((P/0.8),1),\"kW\"\n",
+ "\n",
+ "V1_dot = V1*(1200./60);\n",
+ "m_dot = (P1*V1_dot)/(R*T1);\n",
+ "print \"Mass flow rate is\",round(m_dot,4),\"kg/s\"\n",
+ "\n",
+ "rp_1 = rp**2;\n",
+ "print \"Pressure ratio when second stage is added is\",round(rp_1,1)\n",
+ "\n",
+ "V2 = (1./rp)**(1./n)*V1;\n",
+ "print \"Volume derived per cycle is V2\",round(V2,5),\"m3\"\n",
+ "\n",
+ "d = math.sqrt((V2*4)/(L*math.pi));\n",
+ "print \"Second stage bore would be\",round((d*1000),0),\"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure ratio is 8.48\n",
+ "Indicated power is 11.25 kW\n",
+ "Shaft power is 14.1 kW\n",
+ "Mass flow rate is 0.0723 kg/s\n",
+ "Pressure ratio when second stage is added is 71.9\n",
+ "Volume derived per cycle is V2 0.00033 m3\n",
+ "Second stage bore would be 53.0 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.2 Page No : 724"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 101.3e03\n",
+ "P4 = P1; \t\t\t# in Pa\n",
+ "P2 = 8*P1\n",
+ "P3 = P2;\n",
+ "T1 = 288.\n",
+ "Vs = 2000.;\n",
+ "V3 = 100.\n",
+ "Vc = V3;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "V1 = Vs + Vc ;\n",
+ "n = 1.25\n",
+ "R = 287.;\n",
+ "V4 = ((P3/P4)**(1./n))*V3;\n",
+ "W = ((n*P1*(V1-V4)*1e-06)/(n-1))*(((P2/P1)**((n-1)/n))-1);\n",
+ "P = (W*800*0.001)/60 ; \n",
+ "print \"Indicated poer is\",round(P,2),\"kW\"\n",
+ "print \"Volumetric efficiency is\",round((100*(V1-V4)/Vs),1),\"%\"\n",
+ "\n",
+ "m = (P1*(V1-V4)*1e-06)/(R*T1);\n",
+ "m_dot = m*800;\n",
+ "print \"Mass flow rate is\",round(m_dot,2),\"kg/min\"\n",
+ "\n",
+ "FAD = (V1-V4)*1e-06*800;\n",
+ "print \"Free air delivery is\",round(FAD,2),\"m3/min\"\n",
+ "\n",
+ "Wt = P1*(V1-V4)*1e-06*math.log(P2/P1);\n",
+ "n_isothermal = (Wt*800*0.001)/(P*60);\n",
+ "print \"Isothermal efficiency is\",round(100*n_isothermal,1),\"%\"\n",
+ "\n",
+ "ip = P/0.85;\n",
+ "print \"Input power is\",round(ip,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Indicated poer is 5.48 kW\n",
+ "Volumetric efficiency is 78.6 %\n",
+ "Mass flow rate is 1.54 kg/min\n",
+ "Free air delivery is 1.26 m3/min\n",
+ "Isothermal efficiency is 80.6 %\n",
+ "Input power is 6.44 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.3 Page No : 725"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.; \n",
+ "P3 = 9.;\n",
+ "\n",
+ "# Calculation\n",
+ "P2 = math.sqrt(P1*P3);\n",
+ "T1 = 300.; \n",
+ "cp = 1.005;\n",
+ "R = 0.287; n = 1.3;\n",
+ "W = ((2*n*R*T1)/(n-1))*((P2/P1)**((n-1)/n)-1);\n",
+ "T2 = T1*(P2/P1)**((n-1)/n);\n",
+ "H = cp*(T2-T1);\n",
+ "\n",
+ "# Results\n",
+ "print \"Heat rejected to the intercooler is\",round(H,2),\"kJ/kg\"\n",
+ "\n",
+ "# rounding off error is there."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat rejected to the intercooler is 87.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page No : 726"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.013\n",
+ "P4 = 80.;\n",
+ "P2 = math.sqrt(P1*P4);\n",
+ "V_dot = 4./60; \t\t\t# in m3/s\n",
+ "n = 1.25;\n",
+ "n_mech = 0.75;\n",
+ "\n",
+ "# Calculation\n",
+ "W_dot = ((2*n)/(n-1))*((P1*100*V_dot)/n_mech)*((P2/P1)**((n-1)/n)-1);\n",
+ "N = 250.;\n",
+ "L = (3*60.)/(2*N); \t\t\t# Stroke length of piston in m\n",
+ "Vlp = 4/N;\n",
+ "n_vol = 0.8;\n",
+ "Dlp = math.sqrt((Vlp*4)/(n_vol*L*math.pi));\n",
+ "Dhp = Dlp*math.sqrt(P1/P2);\n",
+ "\n",
+ "# Results\n",
+ "print \"Minimum power required is\",round(W_dot,2),\"kW\"\n",
+ "print \"Stroke of the compressor is\",L*100,\"cm\"\n",
+ "print \"Bore of high pressure compressure is\",round((Dhp*100),2),\"cm\"\n",
+ "print \"Bore of lo pressure compressure is\",round((Dlp*100),1),\"cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum power required is 49.34 kW\n",
+ "Stroke of the compressor is 36.0 cm\n",
+ "Bore of high pressure compressure is 8.92 cm\n",
+ "Bore of lo pressure compressure is 26.6 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.5 Page No : 727"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "V12 = 0.4; \t\t\t# V12 = V1./V2\n",
+ "T1 = 38.+273; \n",
+ "n = 1.3; \n",
+ "P3 = 112.; \t\t\t# back pressure\n",
+ "m = 1.25; R = 0.287;\n",
+ "\n",
+ "# Calculation\n",
+ "T2 = ((V12)**(n-1))*T1;\n",
+ "P1 = 700.; \t\t\t# in kPa\n",
+ "P2 = P1*(V12)**n;\n",
+ "V2 = (m*R*T2)/P2;\n",
+ "v2 = V2/m ;\n",
+ "A = R*T1 + R*(T1-T2)/(n-1) - P3*v2; \t\t\t# Area of indicator diagram\n",
+ "IO = A*0.85*m;\n",
+ "\n",
+ "# Results\n",
+ "print \"Indicated output is\",round(IO,2),\"kJ\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Indicated output is 132.88 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.6 Page No : 728"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.\n",
+ "P41 = 15.; \t\t\t# P41 = P4/P1\n",
+ "P21 = (P41)**(1./3);\n",
+ "P2 = P21*P1;\n",
+ "n = 1.3; \n",
+ "R = 0.287;\n",
+ "P3 = P21*P2;\n",
+ "P11 = P2; P12 = P1;\n",
+ "b = 0.45\n",
+ "s = 0.3; \t\t\t# Bore and stroke of cylinder\n",
+ "Vs = (math.pi/4)*b**2*s; \t\t\t# Swept volume of the cylinder\n",
+ "\n",
+ "# Calculation and Results\n",
+ "V11 = 0.05*Vs; \t\t\t# Clearance volume\n",
+ "V1 = V11+Vs;\n",
+ "V12 = V11*(P11/P12)**(1./n);\n",
+ "print \"Effective swept volume of the LP cylinder is\",round((V1-V12),5),\"m3\"\n",
+ "\n",
+ "T1 = 291.\n",
+ "T3 = T1; \n",
+ "T5 = T1;\n",
+ "P43 = P21; \t\t\t# P4/P3\n",
+ "T6 = T5*(P43)**((n-1)/n);\n",
+ "print \"Delivery temperature is\",round(T6,1),\"K\"\n",
+ "\n",
+ "P4 = 15; \t\t\t# Delivery pressure\n",
+ "V6_7 = (P1/P4)*(T6/T1)*(V1-V12); \t\t\t# V6-V7\n",
+ "print \"Volume of the air delivered\",round(V6_7,5),\"m3\"\n",
+ "\n",
+ "W = ((3*n*R*T1)/(n-1))*((P21)**((n-1)/n)-1);\n",
+ "print \"Work done per kg of the air is\",round(W,1),\"kJ\"\n",
+ "\n",
+ "# rounding off error is there. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective swept volume of the LP cylinder is 0.04532 m3\n",
+ "Delivery temperature is 358.4 K\n",
+ "Volume of the air delivered 0.00372 m3\n",
+ "Work done per kg of the air is 251.4 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.7 Page No : 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "P1 = 1.013;\n",
+ "P2 = 1.5*P1;\n",
+ "Vs = 0.03\n",
+ "Va = Vs;\n",
+ "WD = (P2-P1)*Vs*100.;\n",
+ "Pi = (P1+P2)/2;\n",
+ "g = 1.4;\n",
+ "\n",
+ "# Calculation\n",
+ "Aa = ((g*P1*100*Vs)/(g-1))*((Pi/P1)**((g-1)/g)-1);\n",
+ "Vb = Va *(P1/Pi)**(1./g);\n",
+ "Ab = Vb*(P2-Pi)*100;\n",
+ "WR = Aa+Ab;\n",
+ "\n",
+ "# Results\n",
+ "print \"Work required is\",round(WR,2),\"kJ/rev\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work required is 1.35 kJ/rev\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.8 Page No : 730"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# For Blower\n",
+ "import math \n",
+ "m_dot = 1.; \n",
+ "R = 0.287; \n",
+ "T1 = 343.;\n",
+ "P1 = 100.; \n",
+ "P2 = 2*P1; \n",
+ "g = 1.4;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "V_dot = (m_dot*R*T1)/P1;\n",
+ "PRb = V_dot*(P2-P1);\n",
+ "print \"Power required by the blower is\",round(PRb,1),\"kW\"\n",
+ "\n",
+ "# For van compressor\n",
+ "P1v = 1.\n",
+ "V21 = 0.7 \t\t\t# V2/V1\n",
+ "P2v = P1v*(1./V12)**g;\n",
+ "V2_dot = 0.7;\n",
+ "V1_dot = 0.7*V_dot;\n",
+ "P3v = 2.;\n",
+ "PRv = (g/0.4)*P1*0.995*( (1.65/1)**(0.4/g) - 1) + 0.696*(2 - 1.65)*P1\n",
+ "print \"Power Required by van compressor is\",round(PRv),\"kW\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power required by the blower is 98.4 kW\n",
+ "Power Required by van compressor is 78.0 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.9 Page No : 731"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 283.\n",
+ "P21 = 2.5; \t\t\t# P2/P1\n",
+ "P32 = 2.1; \t\t\t# P3/P2\n",
+ "ns = 0.85\n",
+ "ma = 5.; \n",
+ "cp = 1.005;\n",
+ "\n",
+ "# Calculation\n",
+ "T2s = round(T1*(P21)**((g-1)/g),1);\n",
+ "T2 = round(T1 + (T2s-T1)/ns,2);\n",
+ "T3 = T2-50;\n",
+ "T4s = round(T3*(P32)**((g-1)/g),2);\n",
+ "T4 = T3 + (T4s-T3)/ns;\n",
+ "P = ma*cp*((T2-T1)+(T4-T3));\n",
+ "\n",
+ "# Results\n",
+ "print \"Total compressor power is\",round(P,1),\"kW\"\n",
+ "\n",
+ "# note : T4 is calculted wrongly in book. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total compressor power is 965.1 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.10 Page No : 732"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 278.\n",
+ "P21 = 2.5; \t\t\t# P2/P1\n",
+ "cp = 1.005\n",
+ "ns = 0.84; V2 = 120.;\n",
+ "\n",
+ "# Calculation\n",
+ "T2s = T1*(P21)**((g-1)/g);\n",
+ "T2 = T1 + (T2s-T1)/ns;\n",
+ "mg = 0.04*(13+1);\n",
+ "P = mg*cp*(T2-T1);\n",
+ "T02 = T2 + V2**2/(2*cp*1000);\n",
+ "P1 = 0.6;\n",
+ "P2 = P21*0.6;\n",
+ "P02 = P2*(T02/T2)**(g/(g-1));\n",
+ "\n",
+ "# Results\n",
+ "print \"Power required to drive the compressor is\",round(P,1),\"kW\"\n",
+ "print \"Stagnation temperature is\",round(T02,2),\"K\"\n",
+ "print \"Stagnation pressure is\",round(P02,3),\"bar\"\n",
+ "\n",
+ "# note : rounding off error is there. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power required to drive the compressor is 55.7 kW\n",
+ "Stagnation temperature is 384.21 K\n",
+ "Stagnation pressure is 1.602 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch2.ipynb b/Engineering_Thermodynamics/ch2.ipynb
new file mode 100755
index 00000000..d11b05b0
--- /dev/null
+++ b/Engineering_Thermodynamics/ch2.ipynb
@@ -0,0 +1,136 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b3d39c917cf6a960ba7edac2c3153505a96c95d76c51386c4b445bdbf3a8a712"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Temperature"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page No : 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "d = 1\n",
+ "l = 1; \t\t\t# Assuming\n",
+ "\n",
+ "# Calculation\n",
+ "A_ACDB = (math.pi/4)*(1./3)*((1.05*d)**2)*10.5*l - (math.pi/4)*(1./3)*d**2*10*l ; \t\t\t# Area of ABCD\n",
+ "A_AEFB = (math.pi/4)*(1./3)*((1.1*d)**2)*11*l - (math.pi/4)*(1./3)*d**2*10*l;\n",
+ "t = 100*(A_ACDB/A_AEFB);\n",
+ "\n",
+ "# Results\n",
+ "print \"The straight bore thermometer reading would e %.1f degree Celcius\"%t\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The straight bore thermometer reading would e 47.6 degree Celcius\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page No : 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from hornerc import horner\n",
+ "\n",
+ "# Calculation\n",
+ "#e0 = horner(e, 0.); \t\t\t# e.m.f. at t = 0 degree\n",
+ "e100 = horner([0,0.2,-5e-04], 100.); \t\t\t# e.m.f. at t = 100 degree\n",
+ "e50 = horner([0,0.2,-5e-04],50); \t\t\t# e.m.f. at t = 50 degreer\n",
+ "r = (100./e100)*e50; \t\t\t# Reading of thermocouple at t = 50degree\n",
+ "\n",
+ "# Results\n",
+ "print \"Reading of thermocouple at t = 50 degree is %.2f degree Celcius \"%r\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reading of thermocouple at t = 50 degree is 58.33 degree Celcius \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page No : 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "R0 = 2.8; \t\t\t# Resistence at t=0 degree in ohm\n",
+ "R100 = 3.8; \t\t\t# Resistence at t = 100 degree in ohm\n",
+ "\n",
+ "# Calculation\n",
+ "a = (R100/R0 - 1)*0.01; \t\t\t# alpha\n",
+ "R = 5.8; \t\t\t# Indicated ressistace in ohm\n",
+ "t = (R/R0 - 1)/a; \t\t\t# Temperature in degree\n",
+ "\n",
+ "# Results\n",
+ "print \"The temperature when indicated resismath.tance is 5.8 ohm is \",t,\"degree\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature when indicated resismath.tance is 5.8 ohm is 300.0 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch3.ipynb b/Engineering_Thermodynamics/ch3.ipynb
new file mode 100755
index 00000000..bf6e25d5
--- /dev/null
+++ b/Engineering_Thermodynamics/ch3.ipynb
@@ -0,0 +1,498 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:55c55de869585c95b66b35484f9ada77cb90e10b18096bd3c44fa78bdf53f425"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Work and Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page No : 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 100.; \t\t\t# Initial velocity in m/s\n",
+ "g = 9.81; \t\t\t# Acceleration due to gravity in m/s2\n",
+ "z1 = 100.; \t\t\t# Initial elevation in m\n",
+ "\n",
+ "# Calculation\n",
+ "V = math.sqrt(((2*g*z1)+(V1)**2)); \t\t\t# Final velocity in m/s2\n",
+ "\n",
+ "# Results\n",
+ "print \"The velocity of the object just before ir hits the ground is %.1f m/s\"%V\n",
+ "\n",
+ "# note : incorrect answer in the textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the object just before ir hits the ground is 109.4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page No : 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "dV = 0.5; \t\t\t# Change in volume in m3\n",
+ "P = 101.325e03; \t\t\t# Atmospheric pressure in N/m2\n",
+ "\n",
+ "# Calculation\n",
+ "Wd = P*dV; \t\t\t# Work done in J\n",
+ "\n",
+ "# Results\n",
+ "print \"The amount of work done upon the atmosphere by the ballon is %.2f kJ\"%(Wd/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of work done upon the atmosphere by the ballon is 50.66 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page No : 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "dV = 0.6; \t\t\t# Change in volume in m3\n",
+ "P = 101.325e03; \t# Atmospheric pressure in N/m2\n",
+ "\n",
+ "# Calculation\n",
+ "Wd = P*dV; \t\t\t# Work done in J\n",
+ "\n",
+ "# Results\n",
+ "print \"The print lacement work done by the air is %.1f KJ\"%(Wd/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The print lacement work done by the air is 60.8 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page No : 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T = 1.275e-03; \t\t\t# Torque acting against the fluid in N\n",
+ "N = 10000.; \t\t\t# Number of revolutions\n",
+ "W1 = 2*math.pi*T*N; \t\t\t# Work done by stirring device upon the system\n",
+ "P = 101.325e03; \t\t\t# Atmospheric pressure in N/m2\n",
+ "d = 0.6; \t\t\t# Piston diameter in m\n",
+ "\n",
+ "# Calculation\n",
+ "A = (math.pi/4.)*(d)**2; \t\t\t# Piston area in m\n",
+ "L = 0.80; \t\t\t # Displacement of diameter in m\n",
+ "W2 = (P*A*L)/1000.; \t\t\t# Work done by the system on the surroundings i KJ\n",
+ "W = -W1+W2; \t\t\t# Net work tranfer for the system\n",
+ "\n",
+ "# Results\n",
+ "print \"The Net work tranfer for the system is %.1f KJ\"%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Net work tranfer for the system is -57.2 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page No : 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "ad = 5.5e-04; \t\t\t# Area of indicator diagram\n",
+ "ld = 0.06; \t\t\t# Length of diagram\n",
+ "k = 147e06; \t\t\t# Spring consmath.tant in MPa/m\n",
+ "w = 150.; \t\t\t# Speed of engine\n",
+ "L = 1.2 ; \t\t\t# Stroke of piston\n",
+ "d = 0.8; \t\t\t# Diameter of the cylinder in m\n",
+ "\n",
+ "# Calculation\n",
+ "A = (math.pi/4)*(0.8**2); \t\t\t# Area of cylinder\n",
+ "Pm = (ad/ld)*k; \t\t\t# Effective pressure\n",
+ "W1 = Pm*L*A*w; \t\t\t# Work done in 1 minute\n",
+ "W = (12*W1)/60; \t\t\t# The rate of work transfer gas to the piston in MJ/s\n",
+ "\n",
+ "# Results\n",
+ "print \"The rate of work transfer gas to the piston is %.0f kw\"%(round(W/1000,-2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of work transfer gas to the piston is 24400 kw\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page No : 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Tm = 1535.; \t\t\t# Melting point of iron on degree\n",
+ "Ti = 15.; \t\t\t# Initial temperature\n",
+ "Tf = 1650.; \t\t\t# Final temperature\n",
+ "Lh = 270.e03; \t\t\t# Latent heat of iron in J/Kg\n",
+ "ml = 29.93; \t\t\t# Atomic weight of iron in liquid state\n",
+ "m = 56.; \t\t\t# Atomoc weight of iron\n",
+ "sh = 0.502e03; \t\t\t# Specific heat of iron in J/Kg\n",
+ "d = 6900.; \t\t\t# Density of molten metal in kg/m3\n",
+ "\n",
+ "# Calculation and Results\n",
+ "H = (Tm-Ti)*sh + Lh + (ml/m)*(Tf-Tm)*1000; \t\t\t# Heat required\n",
+ "Mr = 5e03; \t \t\t# Melting rate in Kg/h\n",
+ "Hr = H*Mr ; \t \t \t# Rate of heat suppy\n",
+ "HrA = Hr/(0.7*3600) \t\t\t# Actual rate of heat supply\n",
+ "print \"Rating of furnace would be %.2e\"%HrA,\"W\"\n",
+ "\n",
+ "V = (3*Mr)/d; \t\t\t# Volume required in m3\n",
+ "d = ((V/2.)*(4/math.pi))**(1./3); \t\t\t# Diameter of cylinder of furnace in m\n",
+ "l = 2*d; \t\t\t # Length of cylinder of furnace in m\n",
+ "print \" Length of cylinder of furnace is %.2f m\"%l\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rating of furnace would be 2.17e+06 W\n",
+ " Length of cylinder of furnace is 2.23 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page No : 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "SH = 0.9; \t\t\t# Specific heat of alluminium in solid state \n",
+ "L = 390.; \t \t\t# Latent heat\n",
+ "aw = 27.; \t\t \t# Atomic weight\n",
+ "D = 2400.; \t\t\t # Density in molten state\n",
+ "Tf = 700.+273; \t\t\t# Final temperature\n",
+ "Tm = 660.+273; \t\t\t# Melting point of aluminium\n",
+ "Ti = 15.+273; \t\t\t# Intial temperature\n",
+ "\n",
+ "# Calculation\n",
+ "HR = round(SH*(Tm-Ti)+L+(29.93/27)*(Tf-Tm),1); \t\t\t# Heat requires\n",
+ "HS = round(HR/0.7,1) ; \t\t\t# Heat supplied\n",
+ "RM = 217*1000*3600/HS ; \t\t\t# From the data of problem 3.7\n",
+ "V = 2.18; \t\t\t# Volume\n",
+ "M = V*D;\n",
+ "\n",
+ "# Results\n",
+ "print \"Mass of alluminium that can be melted is %.2f\"%(M/1000),\"tonnes\"\n",
+ "print \"Rate at which alluminium can be melted is %.2f\"%(RM/100000),\"tonnes/h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of alluminium that can be melted is 5.23 tonnes\n",
+ "Rate at which alluminium can be melted is 5.39 tonnes/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8 Page No : 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "dd = 60e-06;\n",
+ "mw = 1.;\n",
+ "st = 0.07;\n",
+ "dw = 1000.;\n",
+ "dp = 15e-03;\n",
+ "\n",
+ "# Calculation\n",
+ "N = (mw*6)/(math.pi*dd**3*dw);\n",
+ "Af = math.pi*dd**2*N;\n",
+ "S_L = 4/(dp*dw);\n",
+ "W = st*(100-S_L);\n",
+ "\n",
+ "# Results\n",
+ "print \"Work done during automization is %.2f J\"%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done during automization is 6.98 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9 Page No : 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "dc = 40e-02;\n",
+ "L = 30e-02;\n",
+ "P = 1e05; \t\t\t# Pressure in Pascal\n",
+ "I = 0.5;\n",
+ "V = 24.;\n",
+ "t = 15.*60; \t\t\t# in seconds\n",
+ "\n",
+ "# Calculation\n",
+ "Wm = V*I*t;\n",
+ "Ws = 0.9*Wm;\n",
+ "W = P*(math.pi/4)*dc**2*L;\n",
+ "\n",
+ "# Results\n",
+ "print \"Work input to the motor is %.1f kJ\"%(Wm/1000)\n",
+ "print \"Work input to the stirrer is %.2f kJ\"%(Ws/1000)\n",
+ "print \"Work done by the fluid on the atmosphere is %.2f kJ\"%(W/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work input to the motor is 10.8 kJ\n",
+ "Work input to the stirrer is 9.72 kJ\n",
+ "Work done by the fluid on the atmosphere is 3.77 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10 Page No : 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 100.\n",
+ "P2 = 37.9\n",
+ "P3 = 14.4;\n",
+ "V1 = 0.1\n",
+ "V2 = 0.2\n",
+ "V3 = 0.4;\n",
+ "\n",
+ "# Calculation\n",
+ "n1 = (math.log(P1/P2))/(math.log(V2/V1));\n",
+ "n2 = (math.log(P2/P3))/(math.log(V3/V2));\n",
+ "# n1 = n2\n",
+ "W = ((P1*V1)-(P3*V3))/(n1-1);\n",
+ "\n",
+ "# Results\n",
+ "print \"Work done by the system is %.1f kJ\"%W\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done by the system is 10.6 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page No : 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "P1 = 20*1.01325e05;\n",
+ "V1 = 0.04\n",
+ "V2 = 2*V1;\n",
+ "n = 1.45;\n",
+ "\n",
+ "# Calculation\n",
+ "P2 = round((V1/V2)**n*P1,-2)\n",
+ "W12 = ((P1*V1)-(P2*V2))/(n-1);\n",
+ "W23 = P2*(V2-V1);\n",
+ "Wc = W12-W23;\n",
+ "\n",
+ "# Results\n",
+ "print \"Work done in the cycle is %.2f kJ\"%(Wc/1000)\n",
+ "\n",
+ "# rounding off error. please check using calculator."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done in the cycle is 18.61 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch4.ipynb b/Engineering_Thermodynamics/ch4.ipynb
new file mode 100755
index 00000000..d353eb40
--- /dev/null
+++ b/Engineering_Thermodynamics/ch4.ipynb
@@ -0,0 +1,353 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:eafe81375ae6bd6abb8d4dff5b78c1d88df56b904362e7f55dc57c603062c8b9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : First Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page No : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "V1 = 0.3; \t\t\t# Initial volume in m3\n",
+ "V2 = 0.15; \t\t\t# Final volume in m3\n",
+ "P = 0.105e06; \t\t\t# Pressure in Pa\n",
+ "Q = -37.6e03; \t\t\t# Heat tranferred in J\n",
+ "\n",
+ "# Calculation\n",
+ "W = P*(V2-V1); \t\t\t# Work done\n",
+ "U = Q-W; \t\t\t# Internal energy change\n",
+ "\n",
+ "# Results\n",
+ "print \"Change in the internal energy of the system is %.2f kJ\"%(U/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in the internal energy of the system is -21.85 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page No : 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Qacb = 84e03;\n",
+ "Wacb = 32e03;\n",
+ "Uba = Qacb-Wacb; \t\t\t# Ub-Ua\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# Part (a)\n",
+ "Wadb = 10.5e03; \n",
+ "Qadb = Uba+Wadb; \n",
+ "print \"The heat flow into the system along the path adb\",(Qadb/1000),\"kJ\"\n",
+ "\n",
+ "# Part (b)\n",
+ "Wb_a = -21e03;\n",
+ "Uab = - Uba;\n",
+ "Qb_a = Uab+Wb_a;\n",
+ "print \"The heat liberated along the path b-a is\",round(Qb_a/1000),\"kJ\"\n",
+ "\n",
+ "# Part (c)\n",
+ "Wdb = 0.; \t\t\t# Constant volume\n",
+ "Wad = 10.4e03; \n",
+ "Wadb = Wdb-Wad; \n",
+ "Ud = 42e03;\n",
+ "Ua = 0.;\n",
+ "Qad = Ud-Ua+Wad;\n",
+ "Qdb = Qadb-Qad; \n",
+ "print \"The heat absorbed in the path ad and db are\",round(Qdb/1000),\"kJ\",\"and\",round(Qad/1000),\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat flow into the system along the path adb 62.5 kJ\n",
+ "The heat liberated along the path b-a is -73.0 kJ\n",
+ "The heat absorbed in the path ad and db are 10.0 kJ and 52.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page No : 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "# Process a-b\n",
+ "Qab = 0;\n",
+ "Wab = 2170; \t\t\t# in KJ/min\n",
+ "Eab = Qab-Wab; \n",
+ "\n",
+ "# Process b-c\n",
+ "Qbc = 21000;\n",
+ "Wbc = 0; \n",
+ "Ebc = Qbc-Wbc;\n",
+ "\n",
+ "# Process c-d\n",
+ "Qcd = -2100;\n",
+ "Ecd = -36600; \n",
+ "Wcd = Qcd-Ecd;\n",
+ "\n",
+ "# Calculation\n",
+ "# Process d-a\n",
+ "Q = -17000; \t\t\t# Total heat transfer\n",
+ "Qda = Q-Qab-Qbc-Qcd; \n",
+ "Eda = -Eab-Ebc-Ecd;\n",
+ "Wda = Qda-Eda;\n",
+ "M = [[Qab, Wab, Eab],[Qbc, Wbc ,Ebc],[Qcd, Wcd, Ecd],[Qda, Wda, Eda]];\n",
+ "process = [\"a-b\",\"b-c\",\"c-d\",\"d-a\"]\n",
+ "# Results\n",
+ "print \"The completed table is\"\n",
+ "print \" process Q W deltaE\"\n",
+ "for i in range(4):\n",
+ " print \"%10s\"%process[i],\n",
+ " for j in range(3):\n",
+ " print \"%10d\"%M[i][j],\n",
+ "\n",
+ " print \"\"\n",
+ "print \"\\nRate of work output : %.f kJ/min\"%(sum([M[0][0],M[1][0],M[2][0],M[3][0]]))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The completed table is\n",
+ " process Q W deltaE\n",
+ " a-b 0 2170 -2170 \n",
+ " b-c 21000 0 21000 \n",
+ " c-d -2100 34500 -36600 \n",
+ " d-a -35900 -53670 17770 \n",
+ "\n",
+ "Rate of work output : -17000 kJ/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page No : 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Part (a)\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 3.;\n",
+ "V1 = 0.22; #volume m^3\n",
+ "P1 = 500.e03; #initial pressure Pa\n",
+ "P2 = 100.e03; #final pressure Pa\n",
+ "\n",
+ "# Calculation\n",
+ "V2 = V1*(P1/P2)**(1./1.2);\n",
+ "dU = 3.56*(P2*V2-P1*V1);\n",
+ "gama = 1.2;\n",
+ "W = (P2*V2-P1*V1)/(1-gama);\n",
+ "Q = dU+W;\n",
+ "\n",
+ "# Results\n",
+ "print \"Q,W and dU of the quasi static process are\",int(dU/1000),round(W/1000),round(Q/1000),\"kJ respectively\"\n",
+ "\n",
+ "# Part (b)\n",
+ "Qb = 30e03;\n",
+ "Wb = Qb-dU; \n",
+ "print \"Work transfer for the process is\",round(Wb/1000),\"kJ\"\n",
+ "\n",
+ "# Part (c)\n",
+ "print \"Wb is not equal to integral(p*dv) .since the process is not quasi static\"\n",
+ "\n",
+ "# rounding off error. please check"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q,W and dU of the quasi static process are -92 129.0 37.0 kJ respectively\n",
+ "Work transfer for the process is 122.0 kJ\n",
+ "Wb is not equal to integral(p*dv) .since the process is not quasi static\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page No : 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy.linalg import inv\n",
+ "from numpy import *\n",
+ "from scipy.integrate import *\n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.03; #initial volume m^3\n",
+ "P1 = 170e03; #initial pressure Pa\n",
+ "P2 = 400e03; #final pressure Pa\n",
+ "V2 = 0.06; #final volume m^3\n",
+ "U = 3.15*(P2*V2-P1*V1);\n",
+ "B = array([P1, P2]);\n",
+ "B= B.transpose()\n",
+ "\n",
+ "A = [[1, V1],[1, V2]];\n",
+ "A = array(A)\n",
+ "x = inv(A)*B;\n",
+ "\n",
+ "a = -60000\n",
+ "b = 7666666.7;\n",
+ "\n",
+ "# Calculation\n",
+ "def pressure(V):\n",
+ " return a+b*V;\n",
+ "\n",
+ "W = quad(pressure,V1,V2)[0]\n",
+ "Q = U+W;\n",
+ "\n",
+ "# Results\n",
+ "print \"The work done by the system is\",round(W/1000,2),\"kJ\"\n",
+ "print \"The internal energy change of the system is\",round(U/1000,1),\"J\"\n",
+ "print \"The heat flow into the system is\",round(Q/1000,2),\"kJ\"\n",
+ "\n",
+ "# rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work done by the system is 8.55 kJ\n",
+ "The internal energy change of the system is 59.5 J\n",
+ "The heat flow into the system is 68.09 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page No : 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Process 1-2\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "Q12 = 235; \t\t\t# in KJ/Kg\n",
+ "W12 = 0 ;\n",
+ "\n",
+ "# Calculation\n",
+ "U12 = Q12-W12;\n",
+ "# Process 2-3\n",
+ "Q23 = 0; \n",
+ "U23 = -70 ;\n",
+ "W23 = Q23-U23;\n",
+ "\n",
+ "# Process 3-1\n",
+ "Q31 = - 200; \n",
+ "U31 = -U12-U23;\n",
+ "W31 = Q31-U31;\n",
+ "W = W12 + W23 + W31;\n",
+ "Q = Q12 + Q23 + Q31;\n",
+ "\n",
+ "# Results\n",
+ "print \"Heat trasfer in the cycle is\",Q,\"KJ/Kg\"\n",
+ "print \"Work done during the the cycle is\",W,\"KJ/Kg\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat trasfer in the cycle is 35 KJ/Kg\n",
+ "Work done during the the cycle is 35 KJ/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch5.ipynb b/Engineering_Thermodynamics/ch5.ipynb
new file mode 100755
index 00000000..2711babd
--- /dev/null
+++ b/Engineering_Thermodynamics/ch5.ipynb
@@ -0,0 +1,423 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:98381098beaf5d6805e531ad8738dca152c4ca499326121575e7f6afde31d8cf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : First Law Applied to Flow Processes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page No : 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "V1 = 0.95;\n",
+ "P1 = 100e03; #initial pressure Pa\n",
+ "v1 = 7.; #initial velocity m/s\n",
+ "V2 = 0.19; #final velocity m/s\n",
+ "P2 = 700e03; #final pressure Pa\n",
+ "v2 = 5.;\n",
+ "w = 0.5;\n",
+ "u21 = 90e03; \t\t\t# u21 = u2-u1\n",
+ "Q = -58e03; \t\t\t# As heat is added Q = dQ/dt\n",
+ "\n",
+ "# Calculation and Results\n",
+ "W = - w*( u21 + (P2*V2-P1*V1) + ((v2**2-v1**2)/2) ) + Q; \t\t\t# W = dW/dt \n",
+ "print \"The rate of work input is\",round(W/1000),\"kW\"\n",
+ "\n",
+ "# Part (b)\n",
+ "A = (v2/v1)*(V1/V2); \t\t\t# A = A1./A2\n",
+ "d = math.sqrt(A); \t\t\t# d = d1./d2\n",
+ "print \"The ratio of the inlet pipe diameter and outer pipe diameter is %.2f\"%d\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of work input is -122.0 kW\n",
+ "The ratio of the inlet pipe diameter and outer pipe diameter is 1.89\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page No : 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "V1 = 0.37; #specific volume m^3/kg\n",
+ "P1 = 600.e03;\n",
+ "v1 = 16.;\n",
+ "V2 = 0.62; \n",
+ "P2 = 100.e03;\n",
+ "v2 = 270.;\n",
+ "Z1 = 32.;\n",
+ "Z2 = 0;\n",
+ "g = 9.81; \n",
+ "Q = -9.e03; \t\t\t# heat loss Q = dQ/dt\n",
+ "W = 135.e03; \t\t\t# Work done W = dW/dt\n",
+ "\n",
+ "# Calculation\n",
+ "U12 = (P2*V2-P1*V1) + ((v2**2-v1**2)/2.) + (Z2-Z1)*g + W - Q; \t\t\t# U12 = U1-U2\n",
+ "\n",
+ "# Results\n",
+ "print \"The internal energy decreases by\",round(U12/1000,3),\"Joule\"\n",
+ "\n",
+ "# note : rounding off error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal energy decreases by 20.008 Joule\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page No : 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 4e06;\n",
+ "t1 = 400.;\n",
+ "h1 = 3213e03;\n",
+ "V1 = 0.073;\n",
+ "P2 = 3.5e06;\n",
+ "t2 = 392.;\n",
+ "h2 = 3202e03;\n",
+ "V2 = 0.084;\n",
+ "Q = -8.5e03;\n",
+ "\n",
+ "# Calculation\n",
+ "v1 = math.sqrt((2*(h1-h2+Q))/(1.15**2-1));\n",
+ "A1 = (math.pi/4)*0.2**2;\n",
+ "w = (A1*v1)/V1;\n",
+ "\n",
+ "# Results\n",
+ "print \"The stean flow rate is %.1f Kg/s\"%w\n",
+ "\n",
+ "# rounding off error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The stean flow rate is 53.6 Kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page No : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "import sys\n",
+ "from numpy import *\n",
+ "from sympy import Symbol\n",
+ "\n",
+ "# Variables\n",
+ "h1 = 313.93;\n",
+ "h2 = 2676.;\n",
+ "h3 = 419.;\n",
+ "w1 = 4.2;\n",
+ "\n",
+ "# Calculation\n",
+ "w = Symbol('w') \t\t\t# w = w2\n",
+ "P = w1*h1 + w*h2 - h3*(4.2+w)\n",
+ "def stress(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))<eps):\n",
+ " print ('solution at a');\n",
+ " sys.exit(0)\n",
+ " if(abs(f(b))<eps):\n",
+ " print ('solution at b');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " while(N>0):\n",
+ " c = (a+b)/2.\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c ;\n",
+ " return x;\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c ;\n",
+ " else:\n",
+ " a = c ;\n",
+ " N = N-1;\n",
+ " print ('no convergence');\n",
+ " sys.exit(0)\n",
+ "\n",
+ "def p(w): \n",
+ "\t return - 441.294 + 2257*w \n",
+ "\n",
+ "w = stress(0.1,0.2,p);\n",
+ "\n",
+ "# Results\n",
+ "print \"The amount of heat that should be supplied is %.0fKg/h\"%(w*3600)\n",
+ "\n",
+ "# rounding off error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amount of heat that should be supplied is 704Kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page No : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "t1 = 15.\n",
+ "t2 = 800. \n",
+ "t3 = 650.\n",
+ "t4 = 500.;\n",
+ "v1 = 30.; \n",
+ "v2 = 30. \n",
+ "v3 = 60.; \n",
+ "w = 2.;\n",
+ "cp = 1005.;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "Q1_2 = w*cp*(t2-t1);\n",
+ "print \"The rate of heat transfer to the air in the heat exchanger is %.0f KJ/s\"%(round(Q1_2/1000,-1)),\"KJ/s\"\n",
+ "W_T = w*( ((v2**2-v3**2)/2) + cp*(t2-t3));\n",
+ "print \"The power output from the turbine assuming no heat loss\",W_T/1000,\"KW\"\n",
+ "v4 = math.sqrt( (v3**2) + (2*cp*(t3-t4)) );\n",
+ "print \"The velocity at the exit of the nozzle is %.0f m/s\"%v4\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of heat transfer to the air in the heat exchanger is 1580 KJ/s KJ/s\n",
+ "The power output from the turbine assuming no heat loss 298.8 KW\n",
+ "The velocity at the exit of the nozzle is 552 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page No : 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Variables\n",
+ "w = 5.\n",
+ "h1 = 900\n",
+ "h2 = 400\n",
+ "v1 = 50. \n",
+ "v2 = 150.\n",
+ "Q = -25*5. \t\t\t# Q = dQ/dt for w = 5kg\n",
+ "\n",
+ "# Calculation and Results\n",
+ "W = (w*( (h1-h2) + ((v1**2-v2**2)/2)*10**-3 )) + Q; \t\t\t# W = dW/dt\n",
+ "print \"The power output of the turbine is %.0f kW\"%(W)\n",
+ "R = 285.\n",
+ "T1 = 300.\n",
+ "P1 = 100e03;\n",
+ "V = (w*R*T1)/P1; \t\t\t# V = dV/dt\n",
+ "A1 = V/v1; \n",
+ "D1 = math.sqrt((4*A1)/math.pi);\n",
+ "print \"The diameter of the inlet pipe is %.2f m\"%D1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power output of the turbine is 2325 kW\n",
+ "The diameter of the inlet pipe is 0.33 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page No : 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "ha = 260.; \t\t\t # Enthalpy of air\n",
+ "hg = 912.; \t\t \t# Enthalpy of gas\n",
+ "Va = 270.; \t \t\t# Velocity of air\n",
+ "f = 0.0190; \t\t\t# Fuel to air ratio wf/wa\n",
+ "Ef = 44500.; \t\t\t# Chemical energy of fuel in kJ/kg\n",
+ "Q = 21.; \t\t\t# Heat loss from the engine\n",
+ "\n",
+ "# Calculation\n",
+ "Eg = 0.05*f*Ef/(1+f) \t# As 5% of chemical energy is not released in reaction\n",
+ "Vg = math.sqrt(2000*(((ha+(Va**2*0.001)/2+(f*Ef)-Q)/(1+f))-hg-Eg));\n",
+ "\n",
+ "# Results\n",
+ "print \"Velocity of exhaust gas is %.0f m/s\"%Vg\n",
+ "\n",
+ "# rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of exhaust gas is 541 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page No : 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from hornerc import horner\n",
+ "\n",
+ "# Variables\n",
+ "u0 = 0.718*273*1e03;\n",
+ "#t = poly(0,'t');\n",
+ "#u = u0+718*t; \t\t\t# in SI unit\n",
+ "#hp = u + 285*(t+273); \t\t\t# \"\"\n",
+ "hp = [273819, 1003]\n",
+ "\n",
+ "# Calculation\n",
+ "h = horner(hp,150); \t\t\t# h = hp(150)\n",
+ "W = 100.; \t\t\t# W = dW/dt\n",
+ "m = W/h;\n",
+ "\n",
+ "# Results\n",
+ "print \"The rate at which air flows out of the tank %.3f kg/h\"%(m*3600)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate at which air flows out of the tank 0.849 kg/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch6.ipynb b/Engineering_Thermodynamics/ch6.ipynb
new file mode 100755
index 00000000..61336d7b
--- /dev/null
+++ b/Engineering_Thermodynamics/ch6.ipynb
@@ -0,0 +1,322 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:284938688fc57eccf01fe20d1b336bc54ea30fa2a3b9197c8f73f3ff6a7b1e2c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page No : 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 800.;\n",
+ "T2 = 30.;\n",
+ "\n",
+ "# Calculation\n",
+ "e_max = 1.-((T2+273)/(T1+273));\n",
+ "Wnet = 1. \t\t\t# in kW\n",
+ "Q1 = Wnet/e_max;\n",
+ "Q2 = Q1-Wnet;\n",
+ "\n",
+ "# Results\n",
+ "print \"Least rate of heat rejection is %.3f KW\"%Q2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Least rate of heat rejection is 0.394 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page No : 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = -15.+273;\n",
+ "T2 = 30.+273;\n",
+ "Q2 = 1.75; \t\t\t# in kJ/sec\n",
+ "\n",
+ "# Calculation\n",
+ "Q1 = Q2*T2/T1\n",
+ "W = Q1-Q2;\n",
+ "\n",
+ "# Results\n",
+ "print \"Least Power necessary to pump the heat out is\",round(W,2),\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Least Power necessary to pump the heat out is 0.31 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page No : 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Q1 = 200.;\n",
+ "T1 = 373.15;\n",
+ "T2 = 273.16;\n",
+ "\n",
+ "# Calculation\n",
+ "Q2 = Q1*(T2/T1);\n",
+ "W = Q1-Q2;\n",
+ "e = W/Q1;\n",
+ "\n",
+ "# Results\n",
+ "print \"The heat rejected, the work done and the thermal effiency of the engine is %.3f J, %.1f J, %.1f respectively\"%(e,W,Q2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat rejected, the work done and the thermal effiency of the engine is 0.268 J, 53.6 J, 146.4 respectively\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page No : 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 873.;\n",
+ "T2 = 313.;\n",
+ "T3 = 253.;\n",
+ "Q1 = 2000.; \t\t\t# In joule\n",
+ "W = 360.; \t\t\t# in joule\n",
+ "\n",
+ "# Calculation\n",
+ "# Part (a)\n",
+ "e_max = round(1-(T2/T1),3);\n",
+ "W1 = e_max*Q1;\n",
+ "COP = T3/(T2-T3);\n",
+ "W2 = W1-W;\n",
+ "Q4 = COP*W2;\n",
+ "Q3 = Q4+W2;\n",
+ "Q2 = Q1-W1;\n",
+ "\n",
+ "# Results\n",
+ "print \"The heat rejection to the 40 degree reservior is\",round((Q2+Q3)),\"kJ\"\n",
+ "\n",
+ "# Part (b)\n",
+ "e_max_ = 0.4*e_max;\n",
+ "W1_ = e_max_*Q1;\n",
+ "W2_ = W1_-W;\n",
+ "COP_ = 0.4*COP;\n",
+ "Q4_ = COP_*W2_;\n",
+ "Q3_ = Q4_+W2_;\n",
+ "Q2_ = Q1-W1_;\n",
+ "\n",
+ "print \"Q4 = %.1f kJ\"%round(Q4_,1)\n",
+ "print \"Q3 = %.1f kJ\"%round(Q3_,1)\n",
+ "print \"Q2 = %.1f kJ\"%round(Q2_,1)\n",
+ "print \"The heat rejection to the 40 degree reservior is\",round((Q2_+Q3_)),\"kJ\"\n",
+ "\n",
+ "# note: answers are slightly different because of rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat rejection to the 40 degree reservior is 5528.0 kJ\n",
+ "Q4 = 257.7 kJ\n",
+ "Q3 = 410.5 kJ\n",
+ "Q2 = 1487.2 kJ\n",
+ "The heat rejection to the 40 degree reservior is 1898.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page No : 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 473.;\n",
+ "T2 = 293.;\n",
+ "T3 = 273.;\n",
+ "\n",
+ "# Calculation\n",
+ "MF = (T2*(T1-T3))/(T1*(T2-T3));\n",
+ "\n",
+ "# Results\n",
+ "print \" The multiplication factor is %.1f\"%MF\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The multiplication factor is 6.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.8 Page No : 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 363.;\n",
+ "T2 = 293.;\n",
+ "W = 1.; \t\t\t# Kj/s\n",
+ "\n",
+ "# Calculation\n",
+ "e_max = 1.-(T2/T1);\n",
+ "Qmin = W/e_max ;\n",
+ "Qmin_ = Qmin*3600.;\n",
+ "E = 1880.; \t\t\t# in kJ/m2 h\n",
+ "Amin = Qmin_/E ;\n",
+ "\n",
+ "# Results\n",
+ "print \"Minimum area required for the collector plate %.0f m2\"%Amin\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum area required for the collector plate 10 m2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9 Page No : 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T1 = 1000.;\n",
+ "W = 1000.; \t\t\t# in W\n",
+ "K = 5.67e-08;\n",
+ "\n",
+ "# Calculation\n",
+ "Amin = (256.*W)/(27.*K*T1**4);\n",
+ "\n",
+ "# Results\n",
+ "print \"Area of the panel %.4f m^2\"%Amin\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of the panel 0.1672 m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch7.ipynb b/Engineering_Thermodynamics/ch7.ipynb
new file mode 100755
index 00000000..09b2856d
--- /dev/null
+++ b/Engineering_Thermodynamics/ch7.ipynb
@@ -0,0 +1,576 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f22779b8fff9ea06914fd530daf547f36c0e2d7163616b6b2b466ab75a676e0a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Entropy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1 Page No : 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 37.+273;\n",
+ "T2 = 35.+273;\n",
+ "m = 1.;\n",
+ "cv = 4.187;\n",
+ "\n",
+ "# Calculation\n",
+ "S = m*cv*math.log(T1/T2); \t\t\t# S = S2-S1\n",
+ "\n",
+ "# Results\n",
+ "print \"Change in the entropy of the water is %.4f KJ/K\"%S\n",
+ "\n",
+ "# note : answer is accurate. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in the entropy of the water is 0.0271 KJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2 Page No : 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Part (a)\n",
+ "T1 = 273.;\n",
+ "T2 = 373.;\n",
+ "m = 1. ;\n",
+ "cv = 4.187;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "Ss = m*cv*math.log(T2/T1); \t\t\t# S = S2-S1\n",
+ "Q = m*cv*(T2-T1);\n",
+ "Sr = -(Q/T2);\n",
+ "S = Ss+Sr;\n",
+ "\n",
+ "print \"The entropy change of the universe is %.3f kJ/K\"%S\n",
+ "\n",
+ "# Part (b)\n",
+ "T3 = 323.;\n",
+ "Sw = m*cv*(math.log(T3/T1)+math.log(T2/T3));\n",
+ "Sr1 = -m*cv*(T3-T1)/T3;\n",
+ "Sr2 = -m*cv*(T2-T3)/T2;\n",
+ "Su = Sw+Sr1+Sr2;\n",
+ "print \"The entropy change of the universe is %.3f kJ/K\"%Su\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The entropy change of the universe is 0.184 kJ/K\n",
+ "The entropy change of the universe is 0.097 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3 Page No : 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "# Part (a)\n",
+ "m = 1.;\n",
+ "T1 = -5.+273;\n",
+ "T2 = 20.+273;\n",
+ "T0 = 0.+273;\n",
+ "cp = 2.093;\n",
+ "cv = 4.187;\n",
+ "lf = 333.3;\n",
+ "\n",
+ "# Calculation\n",
+ "Q = m*cp*(T0-T1)+1*333.3+m*cv*(T2-T0);\n",
+ "Sa = -Q/T2;\n",
+ "Ss1 = m*cp*math.log(T0/T1);\n",
+ "Ss2 = lf/T0;\n",
+ "Ss3 = m*cv*math.log(T2/T0);\n",
+ "St = Ss1+Ss2+Ss3;\n",
+ "Su = St+Sa;\n",
+ "\n",
+ "# Results\n",
+ "print \"The entropy change of the universe is %.4f kJ/K\"%Su\n",
+ "\n",
+ "# Part (b)\n",
+ "S = 1.5549; \t\t\t# S = S4-S1\n",
+ "Wmin = T2*(S)-Q;\n",
+ "print \"The minimum risk required is %.1f kJ\"%Wmin\n",
+ "\n",
+ "# rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The entropy change of the universe is 0.0965 kJ/K\n",
+ "The minimum risk required is 28.1 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 Page No : 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "Vo = 8.4;\n",
+ "Vh = 14.;\n",
+ "n1 = Vo/22.4; \n",
+ "n2 = Vh/22.4;\n",
+ "R = 8.31;\n",
+ "\n",
+ "# Calculation\n",
+ "x1 = n1/(n1+n2);\n",
+ "x2 = n2/(n1+n2);\n",
+ "S = -R*(n1*math.log(x1)+n2*math.log(x2));\n",
+ "\n",
+ "# Results\n",
+ "print \"Entropy change for the process is %.2f J/K\"%S\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy change for the process is 5.50 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8 Page No : 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from hornerc import horner\n",
+ "import sys\n",
+ "\n",
+ "# Variables\n",
+ "#T = poly(0,'T'); \t\t\t# T = Tf\n",
+ "Tf_ = [700,-2] #700-2*T; \t\t\t# Tf_ = Tf'\n",
+ "\n",
+ "# Calculation\n",
+ "# Bisection method to solve for the polynomial\n",
+ "def Temperature(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",
+ "\n",
+ " if(abs(f(a))<eps):\n",
+ " print ('solution at a');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " if(abs(f(b))<eps):\n",
+ " print ('solution at b');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " while(N>0):\n",
+ " c = (a+b)/2\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c ;\n",
+ " return x;\n",
+ "\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c ;\n",
+ " else:\n",
+ " a = c ;\n",
+ " N = N-1;\n",
+ " print ('no convergence');\n",
+ " sys.exit(0);\n",
+ "\n",
+ "\n",
+ "def p(T): \n",
+ "\t return 2*T**3-700*T**2+9000000 \n",
+ "T = Temperature(100,200,p);\n",
+ "\n",
+ "Tf_ = horner(Tf_,T);\n",
+ "\n",
+ "print \"The final temperature of the body C is\",Tf_,\"K\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final temperature of the body C is 400 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9 Page No : 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "import sys\n",
+ "from numpy import poly1d\n",
+ "from sympy import Symbol\n",
+ "\n",
+ "# Variables\n",
+ "T1 = 200.;\n",
+ "T2 = 100.;\n",
+ "A = 0.042;\n",
+ "\n",
+ "# Calculation\n",
+ "def f10(T): \n",
+ "\t return A*T**2\n",
+ "\n",
+ "Q1 = quad(f10,T1,T2)[0]\n",
+ "\n",
+ "\n",
+ "def f11(T): \n",
+ "\t return A*T**2/T\n",
+ "\n",
+ "S = quad(f11,T1,T2)[0]\n",
+ "\n",
+ "W = Symbol('W');\n",
+ "Z = (-Q1-W)/T2 + S; \t\t\t# Polynomial to be solved for W\n",
+ "\n",
+ "# Bisection method to solve for the Work\n",
+ "def Work(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",
+ "\n",
+ " if(abs(f(a))<eps):\n",
+ " print ('solution at a');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " if(abs(f(b))<eps):\n",
+ " print ('solution at b');\n",
+ " sys.exit(0)\n",
+ "\n",
+ " while(N>0):\n",
+ " c = (a+b)/2\n",
+ " if(abs(f(c))<eps):\n",
+ " x = c ;\n",
+ " return x;\n",
+ " if((f(a)*f(c))<0 ):\n",
+ " b = c ;\n",
+ " else:\n",
+ " a = c ;\n",
+ " N = N-1;\n",
+ " print ('no convergence');\n",
+ " sys.exit(0)\n",
+ "\n",
+ "def p(W): \n",
+ "\t return 350-0.01*W \n",
+ "\n",
+ "W = Work(34000,36000,p);\n",
+ "\n",
+ "print \"The maximum work that can be recovered is\",W/1000,\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum work that can be recovered is 35 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.10 Page No : 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 0.5e06;\n",
+ "V1 = 0.2\n",
+ "V2 = 0.05;\n",
+ "n = 1.3\n",
+ "\n",
+ "# Calculation\n",
+ "P2 = P1*(V1/V2)**n;\n",
+ "def H(p):\n",
+ " return ((P1*V1**n)/p)**(1./n);\n",
+ "\n",
+ "def f0(p): \n",
+ "\t return H\n",
+ "\n",
+ "H = quad(H,P1,P2)[0]\n",
+ "\n",
+ "U = H-(P2*V2-P1*V1);\n",
+ "W12 = -U;\n",
+ "\n",
+ "# Results\n",
+ "print \"Change in enthalpy is %.1f kJ\"%(H/1000)\n",
+ "print \"Change in internal energy is %.2f kJ\"%(U/1000)\n",
+ "print \"The change in entropy and heat transfer are\",0,\"and\",0,\"kJ\"\n",
+ "print \"The work transfer during the process is %.2f kJ\"%(W12/1000)\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy is 223.5 kJ\n",
+ "Change in internal energy is 171.91 kJ\n",
+ "The change in entropy and heat transfer are 0 and 0 kJ\n",
+ "The work transfer during the process is -171.91 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.11 Page No : 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "Pa = 130e03; \n",
+ "Pb = 100e03;\n",
+ "Ta = 50+273; \n",
+ "Tb = 13+273;\n",
+ "cp = 1.005;\n",
+ "\n",
+ "# Calculation\n",
+ "def f1(T): \n",
+ "\t return cp/T\n",
+ "\n",
+ "def f2(p):\n",
+ " return .287/p\n",
+ "Ss = quad(f1,Ta,Tb)[0] - quad(f2,Pa,Pb)[0]\n",
+ "Ssy = 0;\n",
+ "Su = Ss+Ssy;\n",
+ "\n",
+ "# Results\n",
+ "print \"Change in the entropy of the universe is %.3f kJ/Kg k\"%Su\n",
+ "print \"As the change in entropy of the universe in the process A-B is negative so the flow must be from B-A\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in the entropy of the universe is -0.047 kJ/Kg k\n",
+ "As the change in entropy of the universe in the process A-B is negative so the flow must be from B-A\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12 Page No : 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 300.\n",
+ "T2 = 330.\n",
+ "T3 = 270.\n",
+ "P1 = 4.\n",
+ "P2 =1.\n",
+ "P3 =1.\n",
+ "cp = 1.0005\n",
+ "R = 0.287;\n",
+ "\n",
+ "# Calculation\n",
+ "S21 = cp*math.log(T2/T1)-R*math.log(P2/P1); \t\t\t# S21 = S2-S1\n",
+ "S31 = cp*math.log(T3/T1)-R*math.log(P3/P1); \t\t\t# S31 = S3-S1\n",
+ "Sgen = 1*S21 + 1*S31;\n",
+ "\n",
+ "# Results\n",
+ "print \"The entropy generated during the process is %.3f kW/K\"%Sgen\n",
+ "print \"As the entropy generated is positive so such device is possible\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The entropy generated during the process is 0.786 kW/K\n",
+ "As the entropy generated is positive so such device is possible\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.13 Page No : 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "A = 5.*7;\n",
+ "k = 0.71;\n",
+ "L = 0.32;\n",
+ "Ti = 21.+273;\n",
+ "To = 6.+273;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "Q = k*A*(Ti-To)/L ;\n",
+ "print \"The rate of heat transfer through the wall is %.2f W\"%Q\n",
+ "\n",
+ "Sgen_wall = Q/To - Q/Ti;\n",
+ "print \"The rate of entropy through the wall is %.3f W/K\"%Sgen_wall\n",
+ "\n",
+ "Tr = 27+273.;\n",
+ "Ts = 2+273.;\n",
+ "Sgen_total = Q/Ts-Q/Tr;\n",
+ "print \"The rate of total entropy generation with this heat transfer process is %.3f W/K\"%Sgen_total\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of heat transfer through the wall is 1164.84 W\n",
+ "The rate of entropy through the wall is 0.213 W/K\n",
+ "The rate of total entropy generation with this heat transfer process is 0.353 W/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Thermodynamics/ch8.ipynb b/Engineering_Thermodynamics/ch8.ipynb
new file mode 100755
index 00000000..d0460b5a
--- /dev/null
+++ b/Engineering_Thermodynamics/ch8.ipynb
@@ -0,0 +1,1018 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c3df87d51665052238119b4e7ee4111718a96b4fbb9e6d0115f49e4b893482d1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Available Energy, Availability and Irreversibility"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page No : 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 308.;\n",
+ "T1 = 693.; \n",
+ "T1_ = 523.; \t\t\t# T1_ = T1'\n",
+ "T1_ = 523.; \t\t\t# \"\"\n",
+ "\n",
+ "# Calculation\n",
+ "f = (T0*(T1-T1_))/(T1_*(T1-T0));\n",
+ "\n",
+ "# Results\n",
+ "print \"The fraction of energy that becomes unavailable due to irreversible heat transfer is %.2f\"%f\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of energy that becomes unavailable due to irreversible heat transfer is 0.26\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page No : 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "lhw = 1858.5; \t\t\t# Latent heat of water\n",
+ "Tew = 220+273.;\n",
+ "Sw = lhw/Tew; \n",
+ "Tig = 1100.; \t\t\t# Initial temperature of the gas\n",
+ "Tfg = 550.; \t\t\t# Final \"\"\n",
+ "\n",
+ "# Calculation\n",
+ "k = 1*lhw/(Tig-Tfg); \t\t\t# k = mg_dot*cpg\n",
+ "Tg2 = 823.\n",
+ "Tg1 = 1373.\n",
+ "T0 = 303.;\n",
+ "\n",
+ "def f2(T): \n",
+ "\t return k/T\n",
+ "\n",
+ "Sg = quad(f2,Tg1,Tg2)[0]\n",
+ "\n",
+ "St = Sg+Sw; \n",
+ "\n",
+ "print \"Total change in entropy is %.3f kJ/K\"%St\n",
+ "print \"Increase in unavailable energy is %.0f Kj\"%(round(T0*St,-1))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total change in entropy is 2.040 kJ/K\n",
+ "Increase in unavailable energy is 620 Kj\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page No : 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "Tw = 75. + 273;\n",
+ "Ts = 5. + 273; \t\t\t# Ts = T0\n",
+ "m = 40.;\n",
+ "cp = 4.2;\n",
+ "\n",
+ "# Calculation\n",
+ "def f9(T): \n",
+ "\t return m*cp*(1-(Tw/T))\n",
+ "\n",
+ "W = -quad(f9,Ts,Tw)[0]\n",
+ "Q1 = m*cp*(Tw-Ts);\n",
+ "UE = Q1-W;\n",
+ "\n",
+ "# Results\n",
+ "print \"Total work %.0f kJ\"%W\n",
+ "print \"Heat released\",Q1,\"kJ\"\n",
+ "print \"Internal energy change %.0f kJ\"%UE\n",
+ "\n",
+ "# quad gives slightly different answer than book has. pLease check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total work 1370 kJ\n",
+ "Heat released 11760.0 kJ\n",
+ "Internal energy change 10390 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page No : 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "Ts = 273+15. #temperature \n",
+ "Tw1 = 95+273. #Water\n",
+ "Tw2 = 35+273. #water\n",
+ "m1 = 25. #energy\n",
+ "m2 = 35. \n",
+ "cp = 4.2 #Water\n",
+ "\n",
+ "# Calculation\n",
+ "def f3(T): \n",
+ "\t return m1*cp*(1-(Ts/T))\n",
+ "\n",
+ "AE25 = quad(f3,Ts,Tw1)[0]\n",
+ "\n",
+ "\n",
+ "def f4(T): \n",
+ "\t return m2*cp*(1-(Ts/T))\n",
+ "AE35 = quad(f4,Ts,Tw2)[0]\n",
+ "AEt = AE25 + AE35;\n",
+ "Tm = (m1*Tw1+m2*Tw2)/(m1+m2); \t\t\t# Temperature after mixing\n",
+ "\n",
+ "def f5(T): \n",
+ "\t return (m1+m2)*cp*(1-(Ts/T))\n",
+ "\n",
+ "AE60 = quad(f5,Ts,Tm)[0]\n",
+ "\n",
+ "AE = AEt - AE60;\n",
+ "print \"The decrease in the totla energy is %.2f kJ\"%AE\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The decrease in the totla energy is 281.82 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page No : 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "N1 = 3000.; #RPM\n",
+ "w1 = (2*math.pi*N1)/60.; \n",
+ "I = 0.54;\n",
+ "Ei = 0.5*I*w1**2;\n",
+ "ti = 15.+273; #temperature\n",
+ "m = 2.; #water equivalent\n",
+ "\n",
+ "# Calculation\n",
+ "dt = Ei/(1000*2*4.187);\n",
+ "tf = ti+dt;\n",
+ "\n",
+ "def f6(T): \n",
+ "\t return m*4.187*(1-(ti/T))\n",
+ "\n",
+ "AE = quad(f6,ti,tf)[0]\n",
+ "\n",
+ "UE = Ei/1000 - AE;\n",
+ "w2 = math.sqrt(AE*1000*2/I);\n",
+ "N2 = (w2*60)/(2*math.pi);\n",
+ "\n",
+ "# Results\n",
+ "print \"The final RPM of the flywheel would be %.0f\"%N2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final RPM of the flywheel would be 222\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page No : 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "T1 = 353.\n",
+ "T2 = 278.\n",
+ "V2 = 2.\n",
+ "V1 = 1.\n",
+ "P0 = 100. #tempareture\n",
+ "P1 = 500. #air\n",
+ "R = 0.287\n",
+ "cv = 0.718; #air \n",
+ "m = 2. \n",
+ "\n",
+ "# Calculation\n",
+ "def f7(T): \n",
+ "\t return (m*cv)/T\n",
+ "\n",
+ "def f8(V):\n",
+ " return m*R/V\n",
+ "\n",
+ "S = quad(f7,T1,T2)[0] + quad(f8,V1,V2)[0]\n",
+ "U = m*cv*(T1-T2);\n",
+ "Wmax = U-(T2*(-S));\n",
+ "V1_ = (m*R*T1)/P1;\n",
+ "CA = Wmax-P0*(V1_); \t\t\t# Change in availability\n",
+ "I = T2*S; \n",
+ "\n",
+ "# Results\n",
+ "print \"The maximum work is %.2f kJ\"%Wmax\n",
+ "print \"Change in availability is %.2f kJ\"%CA\n",
+ "print \"Irreversibility is %.1f kJ\"%I\n",
+ "\n",
+ "# rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum work is 122.96 kJ\n",
+ "Change in availability is 82.43 kJ\n",
+ "Irreversibility is 15.3 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page No : 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 500. # air\n",
+ "P2 = 100.; # kPa \n",
+ "T1 = 793.\n",
+ "T2 = 573.\n",
+ "cp = 1.005 # air\n",
+ "T0 = 293.\n",
+ "R = 0.287;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "S21 = (R*math.log(P2/P1))-(cp*math.log(T2/T1))\n",
+ "CA = cp*(T1-T2)-T0*S21; \t\t\t# Change in v=availability\n",
+ "print \"The decrease in availability is %.1f kJ/Kg\"%CA\n",
+ "\n",
+ "Wmax = CA;\n",
+ "print \"The maximum work is %.1f kJ/Kg\"%Wmax\n",
+ "\n",
+ "Q = -10.;\n",
+ "W = cp*(T1-T2)+Q ;\n",
+ "I = Wmax-W;\n",
+ "print \"The irreversibility is %.1f kJ/Kg\"%I\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The decrease in availability is 260.8 kJ/Kg\n",
+ "The maximum work is 260.8 kJ/Kg\n",
+ "The irreversibility is 49.7 kJ/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page No : 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T0 = 300. # cooled\n",
+ "Tg1 = 573.\n",
+ "Tg2 = 473.;\n",
+ "Ta1 = 313.; \n",
+ "cpg = 1.09 # tempareture\n",
+ "cpa = 1.005; # air\n",
+ "mg = 12.5\n",
+ "ma = 11.15;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "f1 = cpg*(Tg1-T0)-T0*cpg*(math.log(Tg1/T0));\n",
+ "f2 = cpg*(Tg2-T0)-T0*cpg*(math.log(Tg2/T0));\n",
+ "print \"The initial and final availbility of the products are %.2f and %.2f kJ/Kg respectively\"%(f1,f2)\n",
+ "\n",
+ "# Part (b)\n",
+ "Dfg = f1-f2;\n",
+ "Ta2 = Ta1 + (mg/ma)*(cpg/cpa)*(Tg1-Tg2);\n",
+ "Ifa = cpa*(Ta2-Ta1)-T0*cpa*(math.log(Ta2/Ta1));\n",
+ "I = mg*Dfg-ma*Ifa;\n",
+ "print \"The irreversibility of the process is %.2f kW\"%I\n",
+ "\n",
+ "# Part (c)\n",
+ "Ta2_ = Ta1*(math.e**(-(mg/ma)*(cpg/cpa)*math.log(Tg2/Tg1)));\n",
+ "Q1 = mg*cpg*(Tg1-Tg2);\n",
+ "Q2 = ma*cpa*(Ta2_-Ta1);\n",
+ "W = Q1-Q2;\n",
+ "print \"Tota power generated by the heat engine %.2f kW\"%W\n",
+ "\n",
+ "# rounding off error. please check."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The initial and final availbility of the products are 85.97 and 39.68 kJ/Kg respectively\n",
+ "The irreversibility of the process is 319.37 kW\n",
+ "Tota power generated by the heat engine 441.35 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9 Page No : 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "T2 = 1063.;\n",
+ "T1 = 1073.;\n",
+ "m = 2.; # pipe\n",
+ "cp = 1.1;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "I = m*cp*((T1-T2)-T0*(math.log(T1/T2)));\n",
+ "print \"The irrevesibility rate is %.3f kW\"%I\n",
+ "\n",
+ "# At lower temperature\n",
+ "T1_ = 353.\n",
+ "T2_ = 343.\n",
+ "I_ = m*cp*((T1_-T2_)-T0*(math.log(T1_/T2_)));\n",
+ "print \"The irrevesibility rate at lower temperature is %.3f kW\"%I_\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The irrevesibility rate is 15.820 kW\n",
+ "The irrevesibility rate at lower temperature is 3.033 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10 Page No : 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "m = 3.; # insulated pipe\n",
+ "R = 0.287; \n",
+ "T0 = 300.\n",
+ "k = 0.10; \t\t\t# k = dP/P1\n",
+ "\n",
+ "# Calculation\n",
+ "Sgen = m*R*k;\n",
+ "I = Sgen*T0;\n",
+ "\n",
+ "# Results\n",
+ "print \"The rate of energy loss because of the pressure drop due to friction\",I,\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of energy loss because of the pressure drop due to friction 25.83 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11 Page No : 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m1 = 2.; \t\t\t# m1_dot\n",
+ "m2 = 1.;\n",
+ "T1 = 90.+273; \n",
+ "T2 = 30.+273;\n",
+ "T0 =300.;\n",
+ "\n",
+ "# Calculation\n",
+ "m = m1+m2;\n",
+ "x = m1/m;\n",
+ "t = T2/T1; \t\t\t# Tau\n",
+ "cp = 4.187;\n",
+ "Sgen = m*cp*math.log((x+t*(1-x))/(t**(1-x)));\n",
+ "I = T0*Sgen;\n",
+ "\n",
+ "\n",
+ "print \"The rate of entropy generation is %.4f kW/K\"%Sgen\n",
+ "print \"The rate of energy loss due to mixing is %.1f kW\"%I\n",
+ "\n",
+ "# rounding off error."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of entropy generation is 0.0446 kW/K\n",
+ "The rate of energy loss due to mixing is 13.4 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12 Page No : 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Qr = 500.; \t\t\t# Heat release in kW\n",
+ "Tr = 2000.;\n",
+ "T0 = 300.; # chemical process \n",
+ "\n",
+ "# Calculation and Results\n",
+ "# Part (a)\n",
+ "Qa = 480.\n",
+ "Ta = 1000.;\n",
+ "n1a = (Qa/Qr);\n",
+ "n2a = n1a*(1-(T0/Ta))/(1-(T0/Tr));\n",
+ "print (\"PART (A)\")\n",
+ "print \"The first law efficiency is\",n1a*100,\"%\"\n",
+ "print \"The Second law efficiency is %.0f %%\"%(n2a*100)\n",
+ "\n",
+ "# Part (b)\n",
+ "Qb = 450.\n",
+ "Tb = 500.\n",
+ "n1b = (Qb/Qr);\n",
+ "n2b = n1b*(1-(T0/Tb))/(1-(T0/Tr));\n",
+ "print (\"PART (B)\")\n",
+ "print \"The first law efficiency is\",n1b*100,\"%\"\n",
+ "print \"The Second law efficiency is %.1f %%\"%(n2b*100)\n",
+ "\n",
+ "# Part (c)\n",
+ "Qc = 300.\n",
+ "Tc = 320.\n",
+ "n1c = (Qc/Qr);\n",
+ "n2c = n1c*(1-(T0/Tc))/(1-(T0/Tr));\n",
+ "print (\"PART (C)\")\n",
+ "print \"The first law efficiency is\",n1c*100,\"%\"\n",
+ "print \"The Second law efficiency is %.2f %%\"%(n2c*100)\n",
+ "\n",
+ "# Part (d)\n",
+ "Qd = 450.; \n",
+ "n1d = (Qd/Qr);\n",
+ "n2a_= n1d*(1-(T0/Ta))/(1-(T0/Tr));\n",
+ "n2b_= n1d*(1-(T0/Tb))/(1-(T0/Tr));\n",
+ "n2c_= n1d*(1-(T0/Tc))/(1-(T0/Tr));\n",
+ "print (\"Part (D)\")\n",
+ "print \"The first law efficiency is\",n1d\n",
+ "print \"The Second law efficiency of part (a) is %.2f %%\"%(n2a_*100)\n",
+ "print \"The Second law efficiency of part (b) is %.1f %%\"%(n2b_*100)\n",
+ "print \"The Second law efficiency of part (c) is %.2f %%\"%(n2c_*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PART (A)\n",
+ "The first law efficiency is 96.0 %\n",
+ "The Second law efficiency is 79 %\n",
+ "PART (B)\n",
+ "The first law efficiency is 90.0 %\n",
+ "The Second law efficiency is 42.4 %\n",
+ "PART (C)\n",
+ "The first law efficiency is 60.0 %\n",
+ "The Second law efficiency is 4.41 %\n",
+ "Part (D)\n",
+ "The first law efficiency is 0.9\n",
+ "The Second law efficiency of part (a) is 74.12 %\n",
+ "The Second law efficiency of part (b) is 42.4 %\n",
+ "The Second law efficiency of part (c) is 6.62 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14 Page No : 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cp = 1.005\n",
+ "T2 = 433.\n",
+ "T1 = 298.;\n",
+ "T0 = 298.\n",
+ "R = 0.287\n",
+ "P2 = 8.\n",
+ "P1 = 1.\n",
+ "Q = -100.\n",
+ "m = 1.\n",
+ "\n",
+ "# Calculation\n",
+ "W = Q + m*cp*(T1-T2);\n",
+ "AF = cp*(T2-T1)-T0*((cp*math.log(T2/T1))-(R*math.log(P2/P1))) ; \t\t\t# AF = af2-af1\n",
+ "e = AF/-W \t\t\t# efficiency \n",
+ "\n",
+ "# Results\n",
+ "print \"The power input is %.1f kW\"%W\n",
+ "print \"The second law efficiency of the compressor is %.3f\"%e\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power input is -235.7 kW\n",
+ "The second law efficiency of the compressor is 0.855\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15 Page No : 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "U = 0\n",
+ "H0 = 0\n",
+ "S = 0;\n",
+ "# If the vaccume ha reduced to dead state\n",
+ "U0 = 0\n",
+ "H0 = 0\n",
+ "S0 = H0\n",
+ "V0 = 0;\n",
+ "P0 = 100\n",
+ "V = 1;\n",
+ "\n",
+ "# Calculation\n",
+ "fi = P0*V;\n",
+ "\n",
+ "# Results\n",
+ "print \"The energy of the complete vaccume is\",fi,\"kJ\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy of the complete vaccume is 100 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16 Page No : 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "m = 1000. # mass in kg\n",
+ "T0 = 300.\n",
+ "P0 = 1. \n",
+ "T1 = 300.;\n",
+ "T2 = 273-20.\n",
+ "Tf = 273-2.2; # freezing point in C\n",
+ "Cb = 1.7 \n",
+ "Ca = 3.2;\n",
+ "Lh = 235. # latent heat\n",
+ "\n",
+ "# Calculation\n",
+ "H12 = m*((Cb*(Tf-T2))+Lh+(Ca*(T1-Tf)));\n",
+ "H21 = -H12;\n",
+ "S12 = m*((Cb*math.log(Tf/T2))+(Lh/Tf)+(Ca*math.log(T1/Tf)));\n",
+ "S21 = -S12;\n",
+ "E = H21-T0*S21;\n",
+ "\n",
+ "# Results\n",
+ "print \"Energy produced is %.1f MJ\"%(E/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy produced is 34.6 MJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.17 Page No : 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "cv = 0.718\n",
+ "T2 = 500. # tempareture\n",
+ "T1 = 300.\n",
+ "m = 1.\n",
+ "T0 = 300.\n",
+ "\n",
+ "# Case (a)\n",
+ "Sua = cv*math.log(T2/T1);\n",
+ "Ia = T0*Sua;\n",
+ "print \"The irreversibility in case a is %.1f kJ/Kg\"%Ia\n",
+ "\n",
+ "# Case (b)\n",
+ "Q = m*cv*(T2-T1);\n",
+ "T = 600.\n",
+ "Sub = Sua-(Q/T);\n",
+ "Ib = T0*Sub;\n",
+ "print \"The irreversibility in case b is %.2f kJ/Kg\"%Ib\n",
+ " \n",
+ "# rounding off error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The irreversibility in case a is 110.0 kJ/Kg\n",
+ "The irreversibility in case b is 38.23 kJ/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.18 Page No : 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "h1 = 3230.9\n",
+ "s1 = 6.69212\n",
+ "V1 = 160. # velocity\n",
+ "T1 = 273.+400; # Steam\n",
+ "h2 = 2676.1\n",
+ "s2 = 7.3549\n",
+ "V2 = 100.\n",
+ "T2 = 273. + 100;\n",
+ "T0 = 298.\n",
+ "W = 540. # water\n",
+ "Tb = 500. # tempareture\n",
+ "\n",
+ "# Calculation\n",
+ "Q = (h1-h2)+((V1**2-V2**2)/2)*1e-03-W;\n",
+ "I = 151.84-Q*(0.404);\n",
+ "AF = W + Q*(1-(T0/Tb)) + I; \t\t\t# AF = af1-af2\n",
+ "n2 = W/AF;\n",
+ "\n",
+ "# Results\n",
+ "print \"Irreversibility per unit mass is %.2f kJ/Kg\"%I\n",
+ "print \"The second law effiency of the turbine is %.2f\"%n2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Irreversibility per unit mass is 142.71 kJ/Kg\n",
+ "The second law effiency of the turbine is 0.78\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.19 Page No : 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "T0 = 300.\n",
+ "T = 1500. # resistor\n",
+ "Q = -8.5\n",
+ "W = 8.5;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# Case (a)\n",
+ "I = Q*(1-T0/T) + W;\n",
+ "R = Q*(1-T0/T);\n",
+ "print \"Rate of availability transfer with heat and the irreversibility rate are\",R,\"and\",I,\"kW\"\n",
+ "\n",
+ "# Case (b)\n",
+ "T1 = 500.;\n",
+ "Ib = - Q*(1-T0/T) + Q*(1-T0/T1);\n",
+ "print \"Rate of availability in case b is\",Ib,\"kW\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of availability transfer with heat and the irreversibility rate are -6.8 and 1.7 kW\n",
+ "Rate of availability in case b is 3.4 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.20 Page No : 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "P1 = 1.\n",
+ "T1 = 273.+30; \n",
+ "P2 = 3.5\n",
+ "T2 = 141.+273 ; \n",
+ "V = 90.;\n",
+ "T0 = 303.;\n",
+ "\n",
+ "# Calculation and Results\n",
+ "# Part (a)\n",
+ "g = 1.4;\n",
+ "T2s = T1*((P2/P1)**((g-1)/g));\n",
+ "print \"As T2s> 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
--- /dev/null
+++ b/Engineering_Thermodynamics/screenshots/ch1.png
Binary files differ
diff --git a/Engineering_Thermodynamics/screenshots/ch16.png b/Engineering_Thermodynamics/screenshots/ch16.png
new file mode 100755
index 00000000..bff877c7
--- /dev/null
+++ b/Engineering_Thermodynamics/screenshots/ch16.png
Binary files differ
diff --git a/Engineering_Thermodynamics/screenshots/ch9.png b/Engineering_Thermodynamics/screenshots/ch9.png
new file mode 100755
index 00000000..33917721
--- /dev/null
+++ b/Engineering_Thermodynamics/screenshots/ch9.png
Binary files differ