summaryrefslogtreecommitdiff
path: root/Concepts_of_Thermodynamics
diff options
context:
space:
mode:
Diffstat (limited to 'Concepts_of_Thermodynamics')
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter1.ipynb229
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter10.ipynb150
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter12.ipynb201
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter13.ipynb1217
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter14.ipynb216
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter15.ipynb300
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter16.ipynb478
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter2.ipynb102
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter3.ipynb94
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter5.ipynb104
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter7.ipynb204
-rwxr-xr-xConcepts_of_Thermodynamics/Chapter9.ipynb773
-rwxr-xr-xConcepts_of_Thermodynamics/README.txt10
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap10.pngbin0 -> 45814 bytes
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap10_1.pngbin0 -> 45814 bytes
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap12.pngbin0 -> 47043 bytes
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap12_1.pngbin0 -> 47043 bytes
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap9.pngbin0 -> 39243 bytes
-rwxr-xr-xConcepts_of_Thermodynamics/screenshots/chap9_1.pngbin0 -> 39243 bytes
19 files changed, 4078 insertions, 0 deletions
diff --git a/Concepts_of_Thermodynamics/Chapter1.ipynb b/Concepts_of_Thermodynamics/Chapter1.ipynb
new file mode 100755
index 00000000..ecf3e043
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter1.ipynb
@@ -0,0 +1,229 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - Survey of Dimensions and Units"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 1 - Pg 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the force required to accelerate\n",
+ "#Initialization of variables\n",
+ "gc=32.1739 #lbm ft/lbf s^2\n",
+ "m=10 #lbm\n",
+ "a=10 #ft/s^2\n",
+ "#calculations\n",
+ "F=m*a/gc\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"Force to accelerate =\",F,\"lbf\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force to accelerate = 3.108 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the force required to accelerate\n",
+ "#Initialization of variables\n",
+ "gc=32.1739 #lbm ft/lbf s^2\n",
+ "m=10 #lbm\n",
+ "a=gc #ft/s^2\n",
+ "#calculations\n",
+ "F=m*a/gc\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Force to accelerate =\",F,\"lbf\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force to accelerate = 10 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the force required to accelerate\n",
+ "#Initialization of variables\n",
+ "gc=32.1739 #lbm ft/lbf s^2\n",
+ "F=5.00e-9 #lbf hr/ft^2\n",
+ "#calculations\n",
+ "F2=F*3600*gc\n",
+ "#results\n",
+ "print '%s %.2e %s' %(\"Force required =\",F2,\"lbm/ft sec\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force required = 5.79e-04 lbm/ft sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 4 -Pg 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the required velocity\n",
+ "#Initialization of variables\n",
+ "v=88 #ft/s\n",
+ "#calculations\n",
+ "v2=v*3600./5280.\n",
+ "#results\n",
+ "print '%s %d %s' %(\"velocity =\",v2,\"mph\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity = 60 mph\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the required velocity\n",
+ "#Initialization of variables\n",
+ "v=88 #ft/s\n",
+ "#calculations\n",
+ "v2=v*1/5280.*3600.\n",
+ "#results\n",
+ "print '%s %d %s' %(\"velocity =\",v2,\"mph\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity = 60 mph\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the density of water and specific weight in this system\n",
+ "#Initialization of variables\n",
+ "rho=62.305 #lbf/ft^2\n",
+ "g=32.1739 #ft/s^2\n",
+ "#calculations\n",
+ "gam=rho/g\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"Density of water in this system =\",gam,\"lbf/ft^2\")\n",
+ "print '%s %.3f %s' %(\"\\n Specific weight =\",rho,\"lbf/ft^2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of water in this system = 1.937 lbf/ft^2\n",
+ "\n",
+ " Specific weight = 62.305 lbf/ft^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter10.ipynb b/Concepts_of_Thermodynamics/Chapter10.ipynb
new file mode 100755
index 00000000..b6abe8aa
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter10.ipynb
@@ -0,0 +1,150 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - The pvT relationships"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " Example 1 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure of the gas using both ideal and vanderwaals cases\n",
+ "#Initialization of variables\n",
+ "m=1 #lbm\n",
+ "T1=212+460. #R\n",
+ "sv=0.193 #ft^3/lbm\n",
+ "M=44\n",
+ "a=924.2 #atm ft^2 /mole^2\n",
+ "b=0.685 #ft^3/mol\n",
+ "R=0.73 #atm ft^3/R mol\n",
+ "#calculations\n",
+ "v=sv*M\n",
+ "p=R*T1/v\n",
+ "p2=R*T1/(v-b) -a/v/v\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"In ideal gas case, pressure =\",p,\"atm\")\n",
+ "print '%s %.1f %s' %(\"\\n In vanderwaals equation, pressure =\",p2,\"atm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In ideal gas case, pressure = 57.8 atm\n",
+ "\n",
+ " In vanderwaals equation, pressure = 50.0 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the volume of the gas\n",
+ "#Initialization of variables\n",
+ "m=1 #lbm\n",
+ "p=50.9 #atm\n",
+ "t=212+460. #R\n",
+ "R=0.73\n",
+ "#calculations\n",
+ "pc=72.9 #atm\n",
+ "tc=87.9 +460 #R\n",
+ "pr=p/pc\n",
+ "Tr=t/tc\n",
+ "z=0.88\n",
+ "v=z*R*t/p\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"volume =\",v,\"ft^3/mole\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "volume = 8.481 ft^3/mole\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure of the gas\n",
+ "#Initialization of variables\n",
+ "t=212+460. #R\n",
+ "v=0.193 #ft^3/lbm\n",
+ "M=44\n",
+ "R=0.73\n",
+ "#calculations\n",
+ "tc=87.9+460. #F\n",
+ "zc=0.275\n",
+ "vc=1.51 #ft^3/mol\n",
+ "tr=t/tc\n",
+ "vr=v*M/vc\n",
+ "vrd=vr*zc\n",
+ "z=0.88\n",
+ "p=z*R*t/(M*v)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Pressure =\",p,\"atm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure = 50.8 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter12.ipynb b/Concepts_of_Thermodynamics/Chapter12.ipynb
new file mode 100755
index 00000000..f88c4b5f
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter12.ipynb
@@ -0,0 +1,201 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - The ideal gas and deviations of real gases"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the work done in the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "n=1.3\n",
+ "T1=460+60. #R\n",
+ "P1=14.7 #psia\n",
+ "P2=125. #psia\n",
+ "R=1545.\n",
+ "M=29.\n",
+ "#calculations\n",
+ "T2=T1*math.pow((P2/P1),((n-1)/n))\n",
+ "wrev=R/M *(T2-T1)/(1-n)\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Work done =\",wrev,\"ft-lbf/lbm\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done = -58988 ft-lbf/lbm\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in kinetic energy\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "P2=10. #psia\n",
+ "P1=100. #psia\n",
+ "T1=900. #R\n",
+ "w=50 #Btu/lbm\n",
+ "k=1.39\n",
+ "cp=0.2418\n",
+ "#calculations\n",
+ "T2=T1*math.pow((P2/P1),((k-1)/k))\n",
+ "T2=477\n",
+ "KE=-w-cp*(T2-T1)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Change in kinetic energy =\",KE,\" Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in kinetic energy = 52.3 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the final temperature of the system\n",
+ "#Initialization of variables\n",
+ "T1=900. #R\n",
+ "P1=100. #psia\n",
+ "P2=10. #psia\n",
+ "#calculations\n",
+ "print '%s' %(\"From table B-9\")\n",
+ "pr1=8.411\n",
+ "pr2=pr1*P2/P1\n",
+ "T2=468. #R\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Final temperature =\",T2,\"R \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table B-9\n",
+ "Final temperature = 468 R \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calcuate the final temperature, pressure, enthalpy and the work done in the process\n",
+ "#Initialization of variables\n",
+ "cr=6\n",
+ "p1=14.7 #psia\n",
+ "t1=60.3 #F\n",
+ "M=29.\n",
+ "R=1.986\n",
+ "#calculations\n",
+ "print '%s' %(\"from table b-9\")\n",
+ "vr1=158.58 \n",
+ "u1=88.62 #Btu/lbm\n",
+ "pr1=1.2147\n",
+ "vr2=vr1/cr\n",
+ "T2=1050. #R\n",
+ "u2=181.47 #Btu/lbm\n",
+ "pr2=14.686\n",
+ "p2=p1*(pr2/pr1)\n",
+ "dw=u1-u2\n",
+ "h2=u2+T2*R/M\n",
+ "#results\n",
+ "print '%s %d %s' %(\"final temperature =\",T2,\" R\")\n",
+ "print '%s %.1f %s' %(\"\\n final pressure =\",p2,\"psia\")\n",
+ "print '%s %.2f %s' %(\"\\n work done =\",dw,\"Btu/lbm\")\n",
+ "print '%s %.1f %s' %(\"\\n final enthalpy =\",h2,\" Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from table b-9\n",
+ "final temperature = 1050 R\n",
+ "\n",
+ " final pressure = 177.7 psia\n",
+ "\n",
+ " work done = -92.85 Btu/lbm\n",
+ "\n",
+ " final enthalpy = 253.4 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter13.ipynb b/Concepts_of_Thermodynamics/Chapter13.ipynb
new file mode 100755
index 00000000..1bb39540
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter13.ipynb
@@ -0,0 +1,1217 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 - Mixtures"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#For the mixture, determine the molefractions, average mol. wt., specific gas constant, volume and density, partial pressures and volumes\n",
+ "#Initialization of variables\n",
+ "m1=10. #lbm\n",
+ "m2=15. #lnm\n",
+ "p=50. #psia\n",
+ "t=60.+460 #R\n",
+ "M1=32.\n",
+ "M2=28.02\n",
+ "R0=1545 \n",
+ "#calculations\n",
+ "n1=m1/M1\n",
+ "n2=m2/M2\n",
+ "x1=n1/(n1+n2)\n",
+ "x2=n2/(n1+n2)\n",
+ "M=x1*M1+x2*M2\n",
+ "R=R0/M\n",
+ "V=(n1+n2)*R0*t/p/144.\n",
+ "rho=p*144/(R0*t)\n",
+ "rho2=M*rho\n",
+ "p1=x1*p\n",
+ "p2=x2*p\n",
+ "v1=x1*V\n",
+ "v2=x2*V\n",
+ "#results\n",
+ "print '%s' %(\"part a\")\n",
+ "print '%s %.3f %s %.3f %s' %(\"Mole fractions of oxygen and nitrogen are\",x1,\" and\",x2,\"respectively\")\n",
+ "print '%s' %(\"part b\")\n",
+ "print '%s %.1f' %(\"Average molecular weight (gm) =\",M)\n",
+ "print '%s' %(\"part c\")\n",
+ "print '%s %.2f %s' %(\"specific gas constant =\",R,\"psia ft^3/lbm R\")\n",
+ "print '%s' %(\"part d\")\n",
+ "print '%s %.1f %s' %(\"volume of mixture =\",V,\"ft^3\")\n",
+ "print '%s %.5f %s %.3f %s' %(\"density of mixture is\",rho, \"mole/ft^3 and\",rho2, \"lbm/ft^3\")\n",
+ "print '%s' %(\"part e\")\n",
+ "print '%s %.2f %s %.2f %s' %(\"partial pressures of oxygen and nitrogen are\",p1, \"psia and\",p2, \"psia respectively\")\n",
+ "print '%s %.2f %s %.2f %s' %(\"partial volumes of oxygen and nitrogen are\",v1, \"ft^3 and\",v2, \"ft^3 respectively\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part a\n",
+ "Mole fractions of oxygen and nitrogen are 0.369 and 0.631 respectively\n",
+ "part b\n",
+ "Average molecular weight (gm) = 29.5\n",
+ "part c\n",
+ "specific gas constant = 52.40 psia ft^3/lbm R\n",
+ "part d\n",
+ "volume of mixture = 94.6 ft^3\n",
+ "density of mixture is 0.00896 mole/ft^3 and 0.264 lbm/ft^3\n",
+ "part e\n",
+ "partial pressures of oxygen and nitrogen are 18.43 psia and 31.57 psia respectively\n",
+ "partial volumes of oxygen and nitrogen are 34.87 ft^3 and 59.73 ft^3 respectively\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the gravimetric analysis\n",
+ "#Initialization of variables\n",
+ "m1=5.28\n",
+ "m2=1.28\n",
+ "m3=23.52\n",
+ "#calculations\n",
+ "m=m1+m2+m3\n",
+ "x1=m1/m\n",
+ "x2=m2/m\n",
+ "x3=m3/m\n",
+ "C=12./44. *m1/ m\n",
+ "O=(32./44. *m1 + m2)/m\n",
+ "N=m3/m\n",
+ "sum1=(x1+x2+x3)*100\n",
+ "sum2=(C+N+O)*100\n",
+ "#results\n",
+ "print '%s %.1f %s %.1f %s %.1f %s' %(\"From gravimetric analysis, co2 =\",x1*100,\" percent , o2 =\",x2*100,\"percent and n2 =\",x3*100,\"percent\")\n",
+ "print '%s %.2f %s %.2f %s %.2f %s' %(\"\\n From ultimate analysis, co2 =\",C*100,\"percent , o2 =\",O*100,\"percent and n2 =\",N*100,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Sum in case 1 =\",sum1,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Sum in case 2 =\",sum2,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From gravimetric analysis, co2 = 17.6 percent , o2 = 4.3 percent and n2 = 78.2 percent\n",
+ "\n",
+ " From ultimate analysis, co2 = 4.79 percent , o2 = 17.02 percent and n2 = 78.19 percent\n",
+ "\n",
+ " Sum in case 1 = 100.0 percent\n",
+ "\n",
+ " Sum in case 2 = 100.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the entropy of the mixture\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "x1=1./3.\n",
+ "n1=1\n",
+ "n2=2\n",
+ "x2=2./3.\n",
+ "p=12.7 #psia\n",
+ "cp1=7.01 #Btu/mole R\n",
+ "cp2=6.94 #Btu/mole R\n",
+ "R0=1.986\n",
+ "T2=460+86.6 #R\n",
+ "T1=460 #R\n",
+ "p0=14.7 #psia\n",
+ "#calculations\n",
+ "p1=x1*p\n",
+ "p2=x2*p\n",
+ "ds1= cp1*math.log(T2/T1) - R0*math.log(p1/p0)\n",
+ "ds2= cp2*math.log(T2/T1) - R0*math.log(p2/p0)\n",
+ "S=n1*ds1+n2*ds2\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Entropy of mixture =\",S,\"Btu/R\")\n",
+ "print '%s' %(\"\\n the answer given in textbook is wrong. please check using a calculator\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy of mixture = 8.27 Btu/R\n",
+ "\n",
+ " the answer given in textbook is wrong. please check using a calculator\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in internal energy and entropy of the gas\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "c1=4.97 #Btu/mol R\n",
+ "c2=5.02 #Btu/mol R\n",
+ "n1=2\n",
+ "n2=1\n",
+ "T1=86.6+460 #R\n",
+ "T2=50.+460 #R\n",
+ "#calculations\n",
+ "du=(n1*c1+n2*c2)*(T2-T1)\n",
+ "ds=(n1*c1+n2*c2)*math.log(T2/T1)\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Change in internal energy =\",du,\"Btu\")\n",
+ "print '%s %.3f %s' %(\"\\n Change in entropy =\",ds,\"Btu/R\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in internal energy = -547 Btu\n",
+ "\n",
+ " Change in entropy = -1.037 Btu/R\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure and mixing temperature of the mixture\n",
+ "#Initialization of variables\n",
+ "n1=1.\n",
+ "n2=2.\n",
+ "c1=5.02\n",
+ "c2=4.97\n",
+ "t1=60. #F\n",
+ "t2=100. #F\n",
+ "R0=10.73\n",
+ "p1=30. #psia\n",
+ "p2=10. #psia\n",
+ "#calcualtions\n",
+ "t=(n1*c1*t1+n2*c2*t2)/(n1*c1+n2*c2)\n",
+ "V1= n1*R0*(t1+460)/p1\n",
+ "V2=n2*R0*(t2+460)/p2\n",
+ "V=V1+V2\n",
+ "pm=(n1+n2)*R0*(t+460)/V\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Pressure of mixture =\",pm,\"psia\")\n",
+ "print '%s %.1f %s' %(\"\\n Mixing temperature =\",t,\"F\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure of mixture = 12.7 psia\n",
+ "\n",
+ " Mixing temperature = 86.6 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in entropy in all cases\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "T2=546.6 #R\n",
+ "T1=520. #R\n",
+ "T3=560. #R\n",
+ "v2=1389.2\n",
+ "v1=186.2\n",
+ "R0=1.986\n",
+ "c1=5.02\n",
+ "c2=4.97\n",
+ "n1=1\n",
+ "n2=2\n",
+ "v3=1203.\n",
+ "#calculations\n",
+ "ds1=n1*c1*math.log(T2/T1) + n1*R0*math.log(v2/v1)\n",
+ "ds2=n2*c2*math.log(T2/T3)+n2*R0*math.log(v2/v3)\n",
+ "ds=ds1+ds2\n",
+ "ds3=n1*c1*math.log(T2/T1)+n2*c2*math.log(T2/T3)\n",
+ "ds4=n2*R0*math.log(v2/v3)+ n1*R0*math.log(v2/v1)\n",
+ "dss=ds3+ds4\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"Change in entropy for gas 1 =\",ds1,\"Btu/R\")\n",
+ "print '%s %.3f %s' %(\"\\n Change in entropy for gas 1 =\",ds2,\"Btu/R\")\n",
+ "print '%s %.3f %s' %(\"\\n Net change in entropy =\",ds,\" Btu/R\")\n",
+ "print '%s %.3f %s' %(\"\\n In case 2, change in entropy =\",dss,\" Btu/R\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in the textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy for gas 1 = 4.242 Btu/R\n",
+ "\n",
+ " Change in entropy for gas 1 = 0.331 Btu/R\n",
+ "\n",
+ " Net change in entropy = 4.572 Btu/R\n",
+ "\n",
+ " In case 2, change in entropy = 4.572 Btu/R\n",
+ "The answer is a bit different due to rounding off error in the textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7 - Pg 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the final temperature and changes in entropy of air and water\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "m1=1 #lbm\n",
+ "m2=0.94 #lbm\n",
+ "M1=29.\n",
+ "M2=18.\n",
+ "p1=50. #psia\n",
+ "p2=100. #psia\n",
+ "t1=250. +460 #R\n",
+ "R0=1.986\n",
+ "cpa=6.96\n",
+ "cpb=8.01\n",
+ "#calculations\n",
+ "xa = (m1/M1)/((m1/M1)+ m2/M2)\n",
+ "xb=1-xa\n",
+ "t2=t1*math.pow((p2/p1),(R0/(xa*cpa+xb*cpb)))\n",
+ "d=R0/(xa*cpa+xb*cpb)\n",
+ "k=1/(1-d)\n",
+ "dsa=cpa*math.log(t2/t1) -R0*math.log(p2/p1)\n",
+ "dSa=(m1/M1)*dsa\n",
+ "dSw=-dSa\n",
+ "dsw=dSw*M2/m2\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Final remperature =\",t2,\"R\")\n",
+ "print '%s %.3f %s %.5f %s' %(\"\\n Change in entropy of air =\",dsa,\" btu/mole R and\",dSa, \"Btu/R\")\n",
+ "print '%s %.4f %s %.5f %s' %(\"\\n Change in entropy of water =\",dsw,\" btu/mole R and\",dSw, \"Btu/R\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final remperature = 851 R\n",
+ "\n",
+ " Change in entropy of air = -0.115 btu/mole R and -0.00395 Btu/R\n",
+ "\n",
+ " Change in entropy of water = 0.0757 btu/mole R and 0.00395 Btu/R\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8 - Pg 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the volume occupied and mass of steam\n",
+ "#Initialization of variables\n",
+ "T=250. + 460 #R\n",
+ "p=29.825 #psia\n",
+ "pt=50. #psia\n",
+ "vg=13.821 #ft^3/lbm\n",
+ "M=29.\n",
+ "R=10.73\n",
+ "#calculations\n",
+ "pa=pt-p\n",
+ "V=1/M *R*T/pa\n",
+ "ma=V/vg\n",
+ "xa=p/pt\n",
+ "mb=xa/M *18/(1-xa)\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"In case 1, volume occupied =\",V,\"ft^3\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 1, mass of steam =\",ma,\" lbm steam\")\n",
+ "print '%s %.3f %s' %(\"\\n In case 2, mass of steam =\",mb,\" lbm steam\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In case 1, volume occupied = 13.02 ft^3\n",
+ "\n",
+ " In case 1, mass of steam = 0.94 lbm steam\n",
+ "\n",
+ " In case 2, mass of steam = 0.918 lbm steam\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9 - Pg 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the percentage of alcohol evaporated\n",
+ "#Initialization of variables\n",
+ "ps=0.64 #psia\n",
+ "p=14.7 #psia\n",
+ "M=29\n",
+ "M2=46\n",
+ "#calculations\n",
+ "xa=ps/p\n",
+ "mb=xa*9/M *M2/(1-xa)*100\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"percentage of alcohol evaporated =\",mb,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "percentage of alcohol evaporated = 65.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10 - Pg 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the partial pressure of water vapor\n",
+ "#Initialization of variables\n",
+ "ps=0.5069 #psia\n",
+ "p=20 #psia\n",
+ "m1=0.01\n",
+ "m2=1\n",
+ "M1=18.\n",
+ "M2=29.\n",
+ "#calculations\n",
+ "xw= (m1/M1)/(m1/M1+m2/M2)\n",
+ "pw=xw*p\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"partial pressure of water vapor =\",pw,\"psia\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "partial pressure of water vapor = 0.317 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure, dew temperature of water. Calculate the density of water, air,specific humidity and the degree of saturation\n",
+ "#Initialization of variables\n",
+ "t1=80+460. #R\n",
+ "ps=0.5069 #psia\n",
+ "print '%s' %(\"from steam tables,\")\n",
+ "vs=633.1 #ft^3/lbm\n",
+ "phi=0.3\n",
+ "R=85.6\n",
+ "Ra=53.3\n",
+ "p=14.696\n",
+ "#calculations\n",
+ "tdew=46 #F\n",
+ "pw=phi*ps\n",
+ "rhos=1/vs\n",
+ "rhow=phi*rhos\n",
+ "rhow2= pw*144/(R*t1)\n",
+ "pa=p-pw\n",
+ "rhoa= pa*144/(Ra*t1)\n",
+ "w=rhow/rhoa\n",
+ "mu=phi*(p-ps)/(p-pw)\n",
+ "Ws=0.622*(ps/(p-ps))\n",
+ "mu2=w/Ws\n",
+ "#results\n",
+ "print '%s' %(\"part a\")\n",
+ "print '%s %.5f %s' %(\"partial pressure of water =\",pw,\"psia\")\n",
+ "print '%s %d %s' %(\"\\n dew temperature =\",tdew,\"F\")\n",
+ "print '%s' %(\"part b\")\n",
+ "print '%s %.6f %s' %(\"density of water =\",rhow,\"lbm/ft^3\")\n",
+ "print '%s %.6f %s' %(\"\\n in case 2, density of water =\",rhow2,\"lbm/ft^3\")\n",
+ "print '%s %.6f %s' %(\"\\n density of air =\",rhoa,\"lbm/ft^3\")\n",
+ "print '%s' %(\"part c\")\n",
+ "print '%s %.4f %s' %(\"specific humidity =\",w,\"lbm steam/lbm air\")\n",
+ "print '%s' %(\"part d\")\n",
+ "print '%s %.3f' %(\"In method 1, Degree of saturation = \",mu)\n",
+ "print '%s %.3f' %(\"\\n In method 2, Degree of saturation = \",mu2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from steam tables,\n",
+ "part a\n",
+ "partial pressure of water = 0.15207 psia\n",
+ "\n",
+ " dew temperature = 46 F\n",
+ "part b\n",
+ "density of water = 0.000474 lbm/ft^3\n",
+ "\n",
+ " in case 2, density of water = 0.000474 lbm/ft^3\n",
+ "\n",
+ " density of air = 0.072765 lbm/ft^3\n",
+ "part c\n",
+ "specific humidity = 0.0065 lbm steam/lbm air\n",
+ "part d\n",
+ "In method 1, Degree of saturation = 0.293\n",
+ "\n",
+ " In method 2, Degree of saturation = 0.293\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in moisture content \n",
+ "#Initialization of variables\n",
+ "p=14.696 #psia\n",
+ "ps=0.0808 #psia\n",
+ "ps2=0.5069 #psia\n",
+ "phi2=0.5\n",
+ "phi=0.6\n",
+ "grain=7000\n",
+ "#calculations\n",
+ "pw=phi*ps\n",
+ "w1=0.622*pw/(p-pw)\n",
+ "pw2=phi2*ps2\n",
+ "w2=0.622*pw2/(p-pw2)\n",
+ "dw=w2-w1\n",
+ "dwg=dw*grain\n",
+ "#results\n",
+ "print '%s %.6f %s' %(\"change in moisture content =\",dw,\"lbm water/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n in grains, change =\",dwg,\"grains water/lbm dry air\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in moisture content = 0.008857 lbm water/lbm dry air\n",
+ "\n",
+ " in grains, change = 62.00 grains water/lbm dry air\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13 - Pg 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the humidity ratio, relative humidity and dew point of the gas\n",
+ "#Initialization of variables\n",
+ "t1=80. #F\n",
+ "t2=60. #F\n",
+ "p=14.696 #psia\n",
+ "ps=0.507 #psia\n",
+ "pss=0.256 #psia\n",
+ "cp=0.24\n",
+ "#calculations\n",
+ "ws=0.622*pss/(p-pss)\n",
+ "w=(cp*(t2-t1) + ws*1060)/(1060+ 0.45*(t1-t2))\n",
+ "pw=w*p/(0.622+w)\n",
+ "phi=pw/ps*100\n",
+ "td=46. #F\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"\\n humidity ratio =\",w,\"lbm/lbm dry air\")\n",
+ "print '%s %.1f %s' %(\"\\n relative humidity =\",phi,\" percent\")\n",
+ "print '%s %d %s' %(\"\\n Dew point =\",td,\"F\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " humidity ratio = 0.0064 lbm/lbm dry air\n",
+ "\n",
+ " relative humidity = 29.7 percent\n",
+ "\n",
+ " Dew point = 46 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14 - Pg 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the enthalpy and sigma function of the mixture\n",
+ "#Initialization of variables\n",
+ "W=0.0065 #lbm/lbm of dry air\n",
+ "t=80. #F\n",
+ "td=60. #F\n",
+ "#calculations\n",
+ "H=0.24*t+W*(1060+0.45*t)\n",
+ "sig=H-W*(td-32)\n",
+ "Ws=0.0111\n",
+ "H2=0.24*td+Ws*(1060+0.45*td)\n",
+ "sig2=H2-Ws*(td-32)\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"In case 1, enthalpy =\",H,\"Btu/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 1, sigma function =\",sig,\"Btu/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 2, enthalpy =\",H2,\"Btu/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 2, sigma function =\",sig2,\"Btu/lbm dry air\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In case 1, enthalpy = 26.32 Btu/lbm dry air\n",
+ "\n",
+ " In case 1, sigma function = 26.14 Btu/lbm dry air\n",
+ "\n",
+ " In case 2, enthalpy = 26.47 Btu/lbm dry air\n",
+ "\n",
+ " In case 2, sigma function = 26.15 Btu/lbm dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the enthalpy and heat added\n",
+ "#Initialization of variables\n",
+ "t1=30. #F\n",
+ "t2=60. #F\n",
+ "t3=80. #F\n",
+ "W1=0.00206\n",
+ "W2=0.01090\n",
+ "#calculations\n",
+ "cm1=0.24+0.45*W1\n",
+ "H1=cm1*t1+W1*1060\n",
+ "cm2=0.24+0.45*W2\n",
+ "H2=cm2*t3+W2*1060\n",
+ "hf=t2-32\n",
+ "dq=H2-H1-(W2-W1)*hf\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"In case 1, Enthalpy =\",H1,\"Btu/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 2, Enthalpy =\",H2,\"Btu/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n Heat added =\",dq,\"Btu/lbm dry air\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In case 1, Enthalpy = 9.41 Btu/lbm dry air\n",
+ "\n",
+ " In case 2, Enthalpy = 31.15 Btu/lbm dry air\n",
+ "\n",
+ " Heat added = 21.49 Btu/lbm dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the partial pressure and dew temperature of water. Calculate the density of water and air and also the specific humidity\n",
+ "#Initialization of variables\n",
+ "pw=0.15#psia\n",
+ "print '%s' %(\"using psychrometric charts,\")\n",
+ "tdew=46. #F\n",
+ "#calculations\n",
+ "va=13.74 #ft^3/lbm dry air\n",
+ "rhoa=1/va\n",
+ "V=13.74\n",
+ "mw=46./7000.\n",
+ "rhow=mw/V\n",
+ "w=0.00657\n",
+ "#results\n",
+ "print '%s' %(\"part a\")\n",
+ "print '%s %.2f %s' %(\"partial pressure of water =\",pw,\"psia\")\n",
+ "print '%s %d %s' %(\"\\n dew temperature =\",tdew,\"F\")\n",
+ "print '%s' %(\"part b\")\n",
+ "print '%s %.6f %s' %(\"density of water =\",rhow,\"lbm/ft^3\")\n",
+ "print '%s %.4f %s' %(\"\\n density of air =\",rhoa,\"lbm/ft^3\")\n",
+ "print '%s' %(\"part c\")\n",
+ "print '%s %.5f %s' %(\"specific humidity =\",w,\"lbm steam/lbm air\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "using psychrometric charts,\n",
+ "part a\n",
+ "partial pressure of water = 0.15 psia\n",
+ "\n",
+ " dew temperature = 46 F\n",
+ "part b\n",
+ "density of water = 0.000478 lbm/ft^3\n",
+ "\n",
+ " density of air = 0.0728 lbm/ft^3\n",
+ "part c\n",
+ "specific humidity = 0.00657 lbm steam/lbm air\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in enthalpy\n",
+ "#Initialization of variables\n",
+ "W1=0.00206 #lbm/lbm dry air\n",
+ "W2=0.01090 #lbm/lbm dry air\n",
+ "t=60 #F\n",
+ "#calculations\n",
+ "dw=W1-W2\n",
+ "hs=144.4\n",
+ "hs2=66.8-32\n",
+ "w1=14.4 #Btu/lbm\n",
+ "ws1=20 #Btu/lbm\n",
+ "w2=76.3 #Btu/lbm\n",
+ "ws2=98.5 #Btu/lbm\n",
+ "dwh1=-(w1-ws1)/7000. *hs\n",
+ "H1=9.3+dwh1\n",
+ "dwh2=(w2-ws2)/7000. *hs2\n",
+ "H2=31.3+dwh2\n",
+ "dwc=dw*(t-32)\n",
+ "dq=H2-H1+dwc\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Enthalpy change =\",dq,\"Btu/lbm dry air\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enthalpy change = 21.53 Btu/lbm dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18 - Pg 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the humidity and temperature of the gas\n",
+ "#Initialization of variables\n",
+ "print '%s' %(\"From psychrometric charts,\")\n",
+ "va1=13. #ft^3/lbm dry air\n",
+ "va2=13.88 #ft^3/lbm dry air\n",
+ "flow=2000. #cfm\n",
+ "#calculations\n",
+ "ma1= flow/va1\n",
+ "ma2=flow/va2\n",
+ "t=62.5 # F\n",
+ "phi=0.83 #percent\n",
+ "#results\n",
+ "print '%s %.2f' %(\"humidity = \",phi)\n",
+ "print '%s %.1f %s' %(\"\\n Temperature =\",t,\"F\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From psychrometric charts,\n",
+ "humidity = 0.83\n",
+ "\n",
+ " Temperature = 62.5 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19 - Pg 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the dry bulb temperature and percentage humidity\n",
+ "#Initialization of variables\n",
+ "t=90 #F\n",
+ "ts=67.2 #F\n",
+ "phi=0.3\n",
+ "per=0.8\n",
+ "#calculations\n",
+ "dep=t-ts\n",
+ "dt=dep*per\n",
+ "tf=t-dt\n",
+ "print '%s' %(\"from psychrometric charts,\")\n",
+ "phi2=0.8\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Dry bulb temperature =\",tf,\"F\")\n",
+ "print '%s %.2f' %(\"\\n percent humidity =\",phi2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from psychrometric charts,\n",
+ "Dry bulb temperature = 71.76 F\n",
+ "\n",
+ " percent humidity = 0.80\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20 - Pg 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the cooling range, approach and amount of water cooled and percentage of water lost by evaporation\n",
+ "#Initialization of variables\n",
+ "m=1 #lbm\n",
+ "t1=100. #F\n",
+ "t2=75. #F\n",
+ "db=65. #F\n",
+ "print '%s' %(\"From psychrometric charts,\")\n",
+ "t11=82 #F\n",
+ "phi1=0.4\n",
+ "H1=30 #Btu/lbm dry air\n",
+ "w1=65 #grains/lbm dry air\n",
+ "w2=250 #grains/lbm dry air\n",
+ "#calculations\n",
+ "cr=t1-t2\n",
+ "appr=t2-db\n",
+ "dmf3=(w2-w1)*0.0001427\n",
+ "hf3=68\n",
+ "hf4=43\n",
+ "H2=62.2\n",
+ "H1=30\n",
+ "mf4= (H1-H2+ dmf3*hf3)/(hf4-hf3)\n",
+ "per=dmf3/(dmf3+mf4)*100\n",
+ "#results\n",
+ "print '%s %d %s' %(\"cooling range =\",cr,\"F\")\n",
+ "print '%s %d %s' %(\"\\n Approach =\",appr,\"F\")\n",
+ "print '%s %.3f %s' %(\"\\n amount of water cooled per pound of dry air =\",mf4,\"lbm dry air/lbm dry air\")\n",
+ "print '%s %.2f %s' %(\"\\n percentage of water lost by evaporation =\",per,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From psychrometric charts,\n",
+ "cooling range = 25 F\n",
+ "\n",
+ " Approach = 10 F\n",
+ "\n",
+ " amount of water cooled per pound of dry air = 1.216 lbm dry air/lbm dry air\n",
+ "\n",
+ " percentage of water lost by evaporation = 2.12 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21 - Pg 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure and error in both cases\n",
+ "#Initialization of variables\n",
+ "R0=0.73 #atm ft^3/mol R\n",
+ "a1=578.9\n",
+ "a2=3675\n",
+ "b1=0.684\n",
+ "b2=1.944\n",
+ "n1=0.396 #mol\n",
+ "n2=0.604 #mol\n",
+ "V=8.518 #ft^3\n",
+ "T=460+460. #R\n",
+ "#calculations\n",
+ "p1=R0*n1*T/(V-n1*b1) - a1*n1*n1 /V/V\n",
+ "p2= R0*n2*T/(V-n2*b2) -a2*n2*n2 /V/V\n",
+ "p=p1+p2\n",
+ "pa=(n1+n2)*R0*T/V\n",
+ "err=(pa-p)/p*100\n",
+ "pb=58.7 #atm\n",
+ "err2= (p-pb)/p*100\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Pressure =\",p,\" atm\")\n",
+ "print '%s %.1f %s' %(\"\\n Pressure in case 2 =\",pb,\"atm\")\n",
+ "print '%s %.1f %s' %(\"\\n error in ideal case =\",err,\" percent\")\n",
+ "print '%s %.1f %s' %(\"\\n error in case 2 =\",err2,\" percent\")\n",
+ "print '%s' %('The answer is a bit different due to rounding off error in textbook')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure = 67.8 atm\n",
+ "\n",
+ " Pressure in case 2 = 58.7 atm\n",
+ "\n",
+ " error in ideal case = 16.4 percent\n",
+ "\n",
+ " error in case 2 = 13.4 percent\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22 - Pg 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure using both cases\n",
+ "#Initialization of variables\n",
+ "p1=45.8 #atm\n",
+ "p2=36 #atm\n",
+ "t1=343.3 #R\n",
+ "t2=766.8 #R\n",
+ "n1=0.396 #mol\n",
+ "n2=0.604 #mol\n",
+ "V=8.518 #ft^3\n",
+ "R0=0.73\n",
+ "T=920 #R\n",
+ "#calcualtions\n",
+ "vr1=p1*(V/n1)/(R0*t1)\n",
+ "vr2=p2*(V/n2)/(R0*t2)\n",
+ "tr1=T/t1\n",
+ "tr2=T/t2\n",
+ "print '%s' %(\"From compressibility charts,\")\n",
+ "z1=1\n",
+ "z2=0.79\n",
+ "Z=n1*z1+n2*z2\n",
+ "p=Z*R0*T/V\n",
+ "p2=62. #atm\n",
+ "err=(p-p2)/p*100\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"In case 1, pressure =\",p,\"atm\")\n",
+ "print '%s %d %s' %(\"\\n In case 2, pressure using trail and error method =\",p2,\"atm\")\n",
+ "print '%s %d %s' %(\"\\n Error =\",err,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From compressibility charts,\n",
+ "In case 1, pressure = 68.8 atm\n",
+ "\n",
+ " In case 2, pressure using trail and error method = 62 atm\n",
+ "\n",
+ " Error = 9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23 - Pg 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure required\n",
+ "#Initialization of variables\n",
+ "t1=343.3 #R\n",
+ "t2=766.8 #R\n",
+ "n1=0.396 #mol\n",
+ "n2=0.604 #mol\n",
+ "V=8.518 #ft^3\n",
+ "p1=45.8 #atm\n",
+ "p2=36 #atm\n",
+ "R0=0.73\n",
+ "T=920 #R\n",
+ "#calculations\n",
+ "tcd=n1*t1+n2*t2\n",
+ "pcd=n1*p1+n2*p2\n",
+ "Tr=T/tcd\n",
+ "Vr=pcd*V/(R0*tcd)\n",
+ "Z=0.87\n",
+ "p=Z*R0*T/V\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Pressure =\",p,\"atm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure = 68.6 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter14.ipynb b/Concepts_of_Thermodynamics/Chapter14.ipynb
new file mode 100755
index 00000000..3c8834de
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter14.ipynb
@@ -0,0 +1,216 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Equilibrium and the third law"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the equlibrium constant\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "n1=0.95\n",
+ "n2=0.05\n",
+ "n3=0.025\n",
+ "P=147 #psia\n",
+ "pa=14.7 #psia\n",
+ "#calculations\n",
+ "n=n1+n2+n3\n",
+ "p1=n1/n *P/pa\n",
+ "p2=n2/n *P/pa\n",
+ "p3=n3/n *P/pa\n",
+ "Kp1= p1/(p2*math.pow(p3,0.5))\n",
+ "Kp2= p1*p1 /(p2*p2 *p3)\n",
+ "#results\n",
+ "print '%s %.1f' %(\"In case 1, Equilibrium constant = \",Kp1)\n",
+ "print '%s %.1f' %(\"\\n In case 2, Equilibrium constant = \",Kp2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In case 1, Equilibrium constant = 38.5\n",
+ "\n",
+ " In case 2, Equilibrium constant = 1480.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the degree of dissociation\n",
+ "#Initialization of variables\n",
+ "kp=5. \n",
+ "import numpy\n",
+ "from numpy import roots\n",
+ "#calculations\n",
+ "vec=numpy.roots([24,0, 3,-2])\n",
+ "x=vec[2]\n",
+ "vec2=numpy.roots([249,0,3,-2])\n",
+ "y=vec2[2]\n",
+ "#results\n",
+ "print '%s %.2f' %(\"\\n degree of dissociation = \",x)\n",
+ "print '%s %.2f' %(\"\\n If pressure =10 . degree of dissociation =\",y)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " degree of dissociation = 0.34\n",
+ "\n",
+ " If pressure =10 . degree of dissociation = 0.18\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "-c:12: ComplexWarning: Casting complex values to real discards the imaginary part\n",
+ "-c:13: ComplexWarning: Casting complex values to real discards the imaginary part\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the degree of dissociation\n",
+ "#Initialization of variables\n",
+ "k=5.\n",
+ "import numpy\n",
+ "from numpy import roots\n",
+ "#calculations\n",
+ "p=[k*k-1, k-5*k*k,7*k*k, -3*k*k]\n",
+ "vec=roots(p)\n",
+ "x=vec[2]\n",
+ "#results\n",
+ "print '%s %.2f' %(\"degree of dissociation = \",x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "degree of dissociation = 0.78\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the work done in all the cases\n",
+ "import math\n",
+ "#Initialization of variables\n",
+ "T=77+460. #R\n",
+ "x1=0.21\n",
+ "x2=1-x1\n",
+ "G=-169557 #Btu/mole\n",
+ "n1=1\n",
+ "n2=3.76\n",
+ "R0=1.986\n",
+ "v=0.0885\n",
+ "pi=14.7\n",
+ "J=778.\n",
+ "#calculations\n",
+ "dg1=-n1*R0*T*math.log(x1)\n",
+ "dg2=-n2*R0*T*math.log(x2)\n",
+ "dg=dg1+dg2\n",
+ "dG=dg+G\n",
+ "W=-dG\n",
+ "W2=-G\n",
+ "p=0.0004 #atm\n",
+ "G1=-n1*R0*T*math.log(1./p)\n",
+ "W3= -(dg1+G+G1)\n",
+ "dgf=v*pi*144/J\n",
+ "#results\n",
+ "print '%s %d %s' %(\"In case 1,Work done =\",W,\"Btu/mole C\")\n",
+ "print '%s %d %s' %(\"\\n In case 2,Work done =\",W2,\"Btu/mole C\")\n",
+ "print '%s %d %s' %(\"\\n In case 3,Work done =\",W3,\"Btu/mole C\")\n",
+ "print '%s %.2f %s' %(\"\\n In case 4,Work done =\",dgf,\" Btu/mole C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In case 1,Work done = 166947 Btu/mole C\n",
+ "\n",
+ " In case 2,Work done = 169557 Btu/mole C\n",
+ "\n",
+ " In case 3,Work done = 176236 Btu/mole C\n",
+ "\n",
+ " In case 4,Work done = 0.24 Btu/mole C\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter15.ipynb b/Concepts_of_Thermodynamics/Chapter15.ipynb
new file mode 100755
index 00000000..cf9c110e
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter15.ipynb
@@ -0,0 +1,300 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 - Basic Flow equations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 407"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calcualte the final temperature and pressure of the gas\n",
+ "#Initialization of variables\n",
+ "print '%s' %(\"From Table B-4,\")\n",
+ "h=1187.2 #Btu/lbm\n",
+ "t=328. #F\n",
+ "#calculations\n",
+ "p2=100 #psia\n",
+ "u2=1187.2 #Btu/lbm\n",
+ "t2=540. #F\n",
+ "dt=t2-t\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Final temperature of steam =\",t2,\"F\")\n",
+ "print '%s %d %s' %(\"\\n Final pressure =\",p2,\"psia\")\n",
+ "print '%s %d %s' %(\"\\n Change in temperature =\",dt,\"F\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From Table B-4,\n",
+ "Final temperature of steam = 540 F\n",
+ "\n",
+ " Final pressure = 100 psia\n",
+ "\n",
+ " Change in temperature = 212 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the work done in the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "p1=100. #psia\n",
+ "p2=14.7 #psia\n",
+ "k=1.4\n",
+ "T1=700. #R\n",
+ "R=10.73/29\n",
+ "V=50.\n",
+ "cv=0.171\n",
+ "cp=0.24\n",
+ "R2=1.986/29.\n",
+ "#calculations\n",
+ "T2=T1/ math.pow((p1/p2),((k-1)/k))\n",
+ "m1=p1*V/(R*T1)\n",
+ "m2=p2*V/(R*T2)\n",
+ "Wrev= cv*(m1*T1 - m2*T2) - (m1-m2)*(T2)*cp\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Work done in case 1 =\",Wrev,\" Btu\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done in case 1 = 572 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the friction of the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "p1=100. #psia\n",
+ "p2=10. #psia\n",
+ "n=1.3\n",
+ "T1=800. #R\n",
+ "cv=0.172\n",
+ "R=1.986/29.\n",
+ "T0=537. #R\n",
+ "cp=0.24\n",
+ "#calculations\n",
+ "T2=T1*math.pow((p2/p1),((n-1)/n))\n",
+ "dwir=cv*(T1-T2)\n",
+ "dwr=R*(T2-T1)/(1-n)\n",
+ "dq=dwr-dwir\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"The friction of the process per pound of air =\",dq,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The friction of the process per pound of air = 18.6 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the friction in the process\n",
+ "#Initialization of variables\n",
+ "ms=10 #lbm\n",
+ "den=62.3 #lbm/ft^3\n",
+ "A1=0.0218 #ft^2\n",
+ "A2=0.00545 #ft^2\n",
+ "p2=50. #psia\n",
+ "p1=100. #psia\n",
+ "gc=32.2 #ft/s^2\n",
+ "dz=30. #ft\n",
+ "T0=537. #R\n",
+ "T1=620. #R\n",
+ "T2=420. #R\n",
+ "#calculations\n",
+ "V1=ms/(A1*den)\n",
+ "V2=ms/(A2*den)\n",
+ "df=-144/den*(p2-p1) - (V2*V2 -V1*V1)/(2*gc) - dz\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Friction =\",df,\"ft-lbf/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Friction = 72.9 ft-lbf/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the efficiency of the cycle and the loss of available energy\n",
+ "#Initialization of variables\n",
+ "cp1=0.25\n",
+ "T=3460 #R\n",
+ "T0=946.2 #R\n",
+ "T00=520 #R\n",
+ "dG=1228 #Btu/lbm\n",
+ "cp=0.45\n",
+ "#calculations\n",
+ "dqa=cp1*(T-T0)\n",
+ "w=cp*dqa\n",
+ "dg=489.\n",
+ "eff=w/dg*100\n",
+ "dI=-dg+w\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"\\n Efficiency of cycle =\",eff,\" percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Loss of available energy =\",dI,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Efficiency of cycle = 57.8 percent\n",
+ "\n",
+ " Loss of available energy = -206.2 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the engine efficiency and effectiveness. Also, calculate the loss of available energy\n",
+ "#Initialization of variables\n",
+ "p1=400. #psia\n",
+ "t1=600. #F\n",
+ "h1=1306.9 #Btu/lbm\n",
+ "b1=480.9 #Btu/lbm\n",
+ "p2=50 #psia\n",
+ "h2=1122 #Btu/lbm\n",
+ "h3=1169.5 #Btu/lbm\n",
+ "b3=310.9 #Btu/lbm\n",
+ "#calculations\n",
+ "print '%s' %(\"All the values are obtained from Mollier chart,\")\n",
+ "dw13=h1-h3\n",
+ "dw12=h1-h2\n",
+ "dasf=b3-b1\n",
+ "etae=dw13/dw12*100\n",
+ "eta=abs(dw13/dasf)*100\n",
+ "dq=dw13+dasf\n",
+ "#results\n",
+ "print '%s %.1f %s' % (\"Engine efficiency =\",etae,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Effectiveness =\",eta,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Loss of available energy =\",dq,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "All the values are obtained from Mollier chart,\n",
+ "Engine efficiency = 74.3 percent\n",
+ "\n",
+ " Effectiveness = 80.8 percent\n",
+ "\n",
+ " Loss of available energy = -32.6 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter16.ipynb b/Concepts_of_Thermodynamics/Chapter16.ipynb
new file mode 100755
index 00000000..164da53c
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter16.ipynb
@@ -0,0 +1,478 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 - Combustion"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 448"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the molecule \n",
+ "#Initialization of variables\n",
+ "per=85.\n",
+ "#calculations\n",
+ "a=per/12.\n",
+ "b=100-per\n",
+ "ad=1.13*a\n",
+ "bd=1.13*b\n",
+ "#results\n",
+ "print '%s %d %s %d' %(\"Molecule is C\",ad, \"H\",bd+1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molecule is C 8 H 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 448"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Oxygen and Nitrogen compositions and also the molecule\n",
+ "#Initialization of variables\n",
+ "per=0.071\n",
+ "#calculations\n",
+ "O2=8.74\n",
+ "N2=per/2. + 3.76*O2\n",
+ "Nin=32.85\n",
+ "CO2=7.333\n",
+ "H2o=3\n",
+ "So2=0.0312\n",
+ "#results\n",
+ "print '%s %.2f %s %.2f'%(\"Oxygen =\",O2,\" and Nitrogen =\",N2)\n",
+ "print '%s %.3f %s %d %s %.2f %s %.2f %s %.3f %s %d %s %.5f %s %.2f %s' %(\"\\n Equation is C\",CO2, \"H\",2*H2o,\"+\",O2,\" O2 +\",Nin,\" N2 = \",CO2,\"CO2 +\",H2o,\"H2O +\",So2,\" SO2 +\",N2,\"N2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Oxygen = 8.74 and Nitrogen = 32.90\n",
+ "\n",
+ " Equation is C 7.333 H 6 + 8.74 O2 + 32.85 N2 = 7.333 CO2 + 3 H2O + 0.03120 SO2 + 32.90 N2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the air fuel ratio\n",
+ "#Initialization of variables\n",
+ "N2=78.1\n",
+ "M=29\n",
+ "co2=8.7\n",
+ "co=8.9\n",
+ "x4=0.3\n",
+ "x5=3.7\n",
+ "x6=14.7\n",
+ "#calculations\n",
+ "O2=N2/3.76\n",
+ "Z=(co2+co+x4)/8.\n",
+ "AF=(O2+N2)*M/(Z*113.)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Air fuel ratio =\",AF,\"lbm air/lbm fuel\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air fuel ratio = 11.3 lbm air/lbm fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the air fuel ratio\n",
+ "#Initialization of variables\n",
+ "N2=78.1\n",
+ "M=29\n",
+ "ba=2.12\n",
+ "x4=0.3\n",
+ "x5=3.7\n",
+ "x6=14.7\n",
+ "#calculations\n",
+ "O2=N2/3.76\n",
+ "O2=N2/3.76\n",
+ "Z=(x4*4+x5*2+x6*2)/17.\n",
+ "AF=(O2+N2)*M/(Z*113.)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Air fuel ratio =\",AF,\"lbm air/lbm fuel\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air fuel ratio = 11.4 lbm air/lbm fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the air fuel ratio\n",
+ "#Initialization of variables\n",
+ "N2=78.1\n",
+ "M=29\n",
+ "ba=2.12\n",
+ "x4=0.3\n",
+ "x5=3.7\n",
+ "x6=14.7\n",
+ "#calculations\n",
+ "O2=N2/3.76\n",
+ "c=14.7\n",
+ "b= x4*4 + x5*2 + x6*2\n",
+ "a=b/ba\n",
+ "AF=(O2+N2)*M/(a*12 + b)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Air fuel ratio =\",AF,\"lbm air/lbm fuel\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air fuel ratio = 11.3 lbm air/lbm fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7 - Pg 453"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the air fuel ratio\n",
+ "#Initialization of variables\n",
+ "N2=78.1\n",
+ "M=29\n",
+ "ba=2.12\n",
+ "co2=8.7\n",
+ "co=8.9\n",
+ "x4=0.3\n",
+ "x5=3.7\n",
+ "x6=14.7\n",
+ "#calculations\n",
+ "O2=N2/3.76\n",
+ "c=14.7\n",
+ "Z=2.238\n",
+ "X=(Z*17-x4*4-x5*2)/2\n",
+ "a=co2+co/2+x4+x6/2\n",
+ "b=3.764*a\n",
+ "AF=(O2+N2)*M/(Z*113)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Air fuel ratio =\",AF,\"lbm air/lbm fuel\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air fuel ratio = 11.3 lbm air/lbm fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8 - Pg 454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the air fuel ratio\n",
+ "#Initialization of variables\n",
+ "x1=8.7\n",
+ "x2=8.9\n",
+ "x3=0.3\n",
+ "N=78.1\n",
+ "z=113\n",
+ "M=29\n",
+ "#calculations\n",
+ "co2=(x1+x2+x3)*100/(N+x1+x2+x3)\n",
+ "a=2.325\n",
+ "AF=103*M/(a*z)\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Air fuel ratio =\",AF,\"lbm air/lbm fuel\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Air fuel ratio = 11.37 lbm air/lbm fuel\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9 - Pg 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the higher heating value\n",
+ "#Initialization of variables\n",
+ "dH=-2369859. #Btu\n",
+ "r=1.986\n",
+ "dn=5.5\n",
+ "T=536.7 #R\n",
+ "#calculations\n",
+ "dQ=dH+dn*r*T\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Higher heating value =\",dQ,\"Btu\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Higher heating value = -2363996 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10 - Pg 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the lower heating value\n",
+ "#Initialization of variables\n",
+ "y=13.\n",
+ "x=12.\n",
+ "M2=18.\n",
+ "M=170.\n",
+ "p=0.4593\n",
+ "vfg=694.9\n",
+ "J=778.2\n",
+ "m=9*18\n",
+ "u1=-2363996 #Btu\n",
+ "#calculations\n",
+ "z=y*M2/M\n",
+ "hfg=1050.4 #Btu/lbm\n",
+ "ufg= hfg- p*vfg*144/J\n",
+ "dU=ufg*m \n",
+ "Lhv=u1+dU\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Lower heating value =\",Lhv,\" Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lower heating value = -2203398 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11 - Pg 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat of reaction\n",
+ "#Initialization of variables\n",
+ "n1=8.\n",
+ "n2=9.\n",
+ "n3=1.\n",
+ "n4=12.5\n",
+ "U11=3852.\n",
+ "U12=115.\n",
+ "U21=3009.\n",
+ "U22=101.\n",
+ "U31=24773.\n",
+ "U32=640.\n",
+ "U41=2539.\n",
+ "U42=83.\n",
+ "H=-2203389.\n",
+ "#calculations\n",
+ "dU1=n1*(U11-U12)+n2*(U21-U22)\n",
+ "dU2=n3*(U31-U32)+n4*(U41-U42)\n",
+ "Q=H+dU1-dU2\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Heat of reaction =\",Q,\"Btu\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of reaction = -2202154 Btu\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12 - Pg 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the final temperature\n",
+ "#Initialization of variables\n",
+ "n1=8\n",
+ "n2=9\n",
+ "n3=47\n",
+ "h1=118\n",
+ "h2=104\n",
+ "h3=82.5\n",
+ "Q=2203279 #Btu\n",
+ "#calculations\n",
+ "U11=n1*h1+n2*h2+n3*h3\n",
+ "U12=U11+Q\n",
+ "T2=5271 #R\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Upon interpolating, T2 =\",T2,\" R\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Upon interpolating, T2 = 5271 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter2.ipynb b/Concepts_of_Thermodynamics/Chapter2.ipynb
new file mode 100755
index 00000000..3568063b
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter2.ipynb
@@ -0,0 +1,102 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Fundamental Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the potential energy of the system\n",
+ "#Initialization of variables\n",
+ "z=100 #ft\n",
+ "m=32.1739 #lbm\n",
+ "#calculations\n",
+ "PE=m*z\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Potential energy =\",PE,\"ft-lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential energy = 3217.39 ft-lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the absolute energy and change in mass of the mixture\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "m0=18.016 #lbm\n",
+ "gc=32.1739 #lbm ft/lbf sec^2\n",
+ "c=186000*5280\n",
+ "dU=94.4*math.pow(10,6) #ft-lbf\n",
+ "#calculations\n",
+ "U=m0/gc *c*c\n",
+ "dm= -dU*gc/(c*c)\n",
+ "#results\n",
+ "print '%s %.2e %s' %(\"Absolute energy of this mixture =\",U,\"ft-lbf\")\n",
+ "print '%s' %(\"\\n In case b, there is no change in mass\")\n",
+ "print '%s %.2e %s' %(\"\\n Change in mass =\",dm,\"lbm\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute energy of this mixture = 5.40e+17 ft-lbf\n",
+ "\n",
+ " In case b, there is no change in mass\n",
+ "\n",
+ " Change in mass = -3.15e-09 lbm\n",
+ "The answers are a bit different due to rounding off error in textbook.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter3.ipynb b/Concepts_of_Thermodynamics/Chapter3.ipynb
new file mode 100755
index 00000000..f2dd489f
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter3.ipynb
@@ -0,0 +1,94 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 - Temperature and the ideal gas"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the volume of the gas\n",
+ "#Initialization of variables\n",
+ "p=14.7 #psia\n",
+ "R0=1545 \n",
+ "t=460 +60. #R\n",
+ "#calculations\n",
+ "v=R0*t/(p*144.)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Volume =\",v,\"ft^3/mol\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume = 379.5 ft^3/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the density of nitrogen\n",
+ "#Initialization of variables\n",
+ "p=20 #psia\n",
+ "R0=1545. \n",
+ "t=460. +100 #R\n",
+ "M=28.\n",
+ "#calculations\n",
+ "v=R0*t/(p*144*M)\n",
+ "rho=1/v\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"density of nitrogen =\",rho,\"lbm/ft^3\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "density of nitrogen = 0.0932 lbm/ft^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter5.ipynb b/Concepts_of_Thermodynamics/Chapter5.ipynb
new file mode 100755
index 00000000..e463b7a8
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter5.ipynb
@@ -0,0 +1,104 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 - The first law and the dynamic open system"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the work done and power of the system\n",
+ "#Initialization of variables\n",
+ "rate= 5 #lbm/sec\n",
+ "Q=50. #Btu/s\n",
+ "h2=1020. #Btu/lbm\n",
+ "h1=1000. #Btu/lbm\n",
+ "V2=50. #ft/s\n",
+ "V1=100. #ft/s\n",
+ "J=778.\n",
+ "g=32.2 #ft/s^2\n",
+ "gc=g\n",
+ "Z2=0\n",
+ "Z1=100. #ft\n",
+ "#calculations\n",
+ "dw=Q/rate -(h2-h1) -(V2*V2- V1*V1)/(2*gc*J) -g/gc *(Z2-Z1)/J\n",
+ "power=dw*rate\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"work done by the system =\",dw,\"Btu/lbm\")\n",
+ "print '%s %.1f %s' %(\"\\n Power =\",power,\"Btu/s\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "work done by the system = -9.7 Btu/lbm\n",
+ "\n",
+ " Power = -48.6 Btu/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the area of the inlet pipe\n",
+ "#Initialization of variables\n",
+ "V=100. #ft/s\n",
+ "v=15. #lbm/ft^3\n",
+ "m=5. #lbm/s\n",
+ "#calculations\n",
+ "A=m*v/V\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Area of inlet pipe =\",A,\"ft^2\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of inlet pipe = 0.75 ft^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter7.ipynb b/Concepts_of_Thermodynamics/Chapter7.ipynb
new file mode 100755
index 00000000..15a3011b
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter7.ipynb
@@ -0,0 +1,204 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 - The second law"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the entropy in each part and efficiency of the cycle\n",
+ "import math\n",
+ "#Initialization of variables\n",
+ "cv=0.175 #Btu/lbm R\n",
+ "R0=1.986\n",
+ "M=29.\n",
+ "T2=1040. #R\n",
+ "T1=520. #R\n",
+ "#calculations\n",
+ "cp=cv+R0/M\n",
+ "sab=cv*math.log(T2/T1)\n",
+ "sac=cp*math.log(T2/T1)\n",
+ "dqab=cv*(T2-T1)\n",
+ "dqca=cp*(T1-T2)\n",
+ "dqrev=T2*(sac-sab)\n",
+ "eta=(dqab+dqrev+dqca)/(dqab+dqrev)*100\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"Entropy in ab part =\",sab,\" Btu/lbm R\")\n",
+ "print '%s %.4f %s' %(\"\\n Entropy in ac part =\",sac,\"Btu/lbm R\")\n",
+ "print '%s %.2f %s' %(\"\\n Efficiency =\",eta,\" percent\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy in ab part = 0.1213 Btu/lbm R\n",
+ "\n",
+ " Entropy in ac part = 0.1688 Btu/lbm R\n",
+ "\n",
+ " Efficiency = 9.80 percent\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in entropy of the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "tc=32. #F\n",
+ "th=80. #F\n",
+ "mw=5 #lbm\n",
+ "mi=1 #lbm\n",
+ "P=14.7 #psia\n",
+ "cp=1\n",
+ "#calculations\n",
+ "t= (-144*mi+tc*mi+th*mw)/(mw+mi)\n",
+ "ds1=144/(tc+460)\n",
+ "ds2=cp*math.log((460+t)/(460+tc))\n",
+ "dsice=ds1+ds2\n",
+ "dswater=mw*cp*math.log((t+460)/(460+th))\n",
+ "ds=dsice+dswater\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"Change in entropy of the process =\",ds,\"Btu/R\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy of the process = 0.0192 Btu/R\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the thermal efficiency of the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cp=0.25 #Btu/lbm R\n",
+ "T2=520. #R\n",
+ "T1=3460. #R\n",
+ "#calculations\n",
+ "dq=cp*(T2-T1)\n",
+ "ds=cp*math.log(T2/T1)\n",
+ "dG=dq-T2*ds\n",
+ "eff=dG/dq*100\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Thermal efficiency =\",eff,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 66.5 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in available energy and also the decrease in energy of isolated system\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cp=1\n",
+ "T2=60. #F\n",
+ "T1=100. #F\n",
+ "ta=32. #F\n",
+ "#calculations\n",
+ "dq=cp*(T2-T1)\n",
+ "ds=cp*math.log((460+T2)/(460+T1))\n",
+ "dE=dq-ds*(ta+460)\n",
+ "dec=dq-dE\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Change in available energy =\",dE,\" Btu/lbm\")\n",
+ "print '%s %.1f %s' %(\"\\n The available energy of the isolated system decreased in the amount of\",dec, \"Btu/lbm\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in available energy = -3.5 Btu/lbm\n",
+ "\n",
+ " The available energy of the isolated system decreased in the amount of -36.5 Btu/lbm\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/Chapter9.ipynb b/Concepts_of_Thermodynamics/Chapter9.ipynb
new file mode 100755
index 00000000..ff2f789c
--- /dev/null
+++ b/Concepts_of_Thermodynamics/Chapter9.ipynb
@@ -0,0 +1,773 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 - Properties of the pure substance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the internal energy of the system.\n",
+ "#Initialization of variables\n",
+ "T=32. #F\n",
+ "m=1 #lbm\n",
+ "J=778.16\n",
+ "#calculations\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "hf=0 \n",
+ "p=0.08854 #psia\n",
+ "vf=0.01602 #ft^3/lbm\n",
+ "u=hf-p*144*vf/J\n",
+ "#results\n",
+ "print '%s %.7f %s' %(\"Internal energy =\",u,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Internal energy = -0.0002625 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in entropy of the process\n",
+ "#Initialization of variables\n",
+ "P=40. #psia\n",
+ "#calculations\n",
+ "print '%s' %(\"from steam tables,\")\n",
+ "hf=200.8 #Btu/lbm\n",
+ "hg=27 #Btu/lbm\n",
+ "T=495. #R\n",
+ "ds=(hf-hg)/T\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"Change in entropy =\",ds,\"Btu/lbm R\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from steam tables,\n",
+ "Change in entropy = 0.351 Btu/lbm R\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the specific enthalpy of the mixture\n",
+ "#Initialization of variables\n",
+ "x=0.35\n",
+ "T=18. #F\n",
+ "#calculations\n",
+ "print '%s' %(\"From table B-14,\")\n",
+ "hf=12.12 #Btu/lbm\n",
+ "hg=80.27 #Btu.lbm\n",
+ "hfg=-hf+hg\n",
+ "h=hf+x*hfg\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"specific enthalpy =\",h,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table B-14,\n",
+ "specific enthalpy = 36.0 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat required for the process\n",
+ "#Initialization of variables\n",
+ "x=0.35\n",
+ "T=18. #F\n",
+ "T2=55.5 #F\n",
+ "#calculations\n",
+ "print '%s' %(\"From table B-14,\")\n",
+ "hf=12.12 #Btu/lbm\n",
+ "hg=80.27 #Btu.lbm\n",
+ "hfg=-hf+hg\n",
+ "h=hf+x*hfg\n",
+ "h2=85.68 #Btu/lbm\n",
+ "dh=h2-h\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Heat required =\",dh,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table B-14,\n",
+ "Heat required = 49.71 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the enthalpy given out and the quality of the gas\n",
+ "#Initialization of variables\n",
+ "P=1460. #psia\n",
+ "T=135. #F\n",
+ "P2=700. #psia\n",
+ "#calculations\n",
+ "print '%s' %(\"From mollier chart,\")\n",
+ "h=120 #Btu/lbm\n",
+ "x=0.83\n",
+ "#results\n",
+ "print '%s %d %s' %(\"enthalpy =\",h,\" Btu/lbm\")\n",
+ "print '%s %.2f' %(\"\\n Qulaity = \",x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From mollier chart,\n",
+ "enthalpy = 120 Btu/lbm\n",
+ "\n",
+ " Qulaity = 0.83\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat transferred in the process\n",
+ "#Initialization of variables\n",
+ "m=1 #lbm\n",
+ "P1=144. #psia\n",
+ "P2=150. #psia\n",
+ "T1=360. #F\n",
+ "J=778.16\n",
+ "#calculations\n",
+ "print '%s' %(\"From table 3,\")\n",
+ "v1=3.160 #ft^3/lbm\n",
+ "h1=1196.5 #Btu/lbm\n",
+ "u1=h1-P1*144*v1/J\n",
+ "h2=1211.4 #Btu/lbm\n",
+ "u2=h2-P2*144*v1/J\n",
+ "dq=u2-u1\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Heat transferred =\",dq,\" Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table 3,\n",
+ "Heat transferred = 11.4 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7 - Pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the work required, reversible work and the work done in compression \n",
+ "#Initialization of variables\n",
+ "T1=100 #F\n",
+ "P2=1000. #psia\n",
+ "x=0.6\n",
+ "J=778.16\n",
+ "tir=2 \n",
+ "P1=0.9 #psia\n",
+ "#calculations\n",
+ "print '%s' %(\"From table 3,\")\n",
+ "hf=67.97\n",
+ "htc=2.7\n",
+ "hpc=0.32\n",
+ "h1=67.97\n",
+ "dv=0.000051\n",
+ "v=0.01613\n",
+ "h2=hf+htc+hpc\n",
+ "wrev=h1-h2\n",
+ "wact=wrev/x\n",
+ "dt=hpc+tir\n",
+ "t2act=T1+dt\n",
+ "wrev2=-v*144*(P2-P1)/J\n",
+ "dw=(P1+P2)/2. *dv *144/J\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Work required =\",wact,\" Btu/lbm\")\n",
+ "print '%s %.2f %s' %(\"\\n reversible work done =\",wrev2,\" Btu/lbm\")\n",
+ "print '%s %.4f %s' %(\"\\n Work done in compression =\",dw,\"Btu/lbm\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table 3,\n",
+ "Work required = -5.03 Btu/lbm\n",
+ "\n",
+ " reversible work done = -2.98 Btu/lbm\n",
+ "\n",
+ " Work done in compression = 0.0047 Btu/lbm\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat transferred in the process\n",
+ "#Initialization of variables\n",
+ "pa=1000. #atm\n",
+ "ta=100. #F\n",
+ "#calculations\n",
+ "hf=67.97 #Btu/lbm\n",
+ "w=3 #Btu/lbm\n",
+ "ha=hf+w\n",
+ "print '%s' %(\"from steam table 2,\")\n",
+ "hc=1191.8 #Btu/lbm\n",
+ "qrev=hc-ha\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Heat transferred =\",qrev,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from steam table 2,\n",
+ "Heat transferred = 1120.8 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10 - Pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the work done and final pressure\n",
+ "#Initialization of variables\n",
+ "P1=144 #psia\n",
+ "T1=400 #F\n",
+ "y=0.7\n",
+ "#calculations\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "h1=1220.4 #Btu/lbm\n",
+ "s1=1.6050 #Btu/lbm R\n",
+ "s2=1.6050 #Btu/lbm R\n",
+ "P2=3 #psia\n",
+ "sf=0.2008 #Btu/lbm R\n",
+ "sfg=1.6855 #Btu/lbm R\n",
+ "x=(s1-sf)/sfg\n",
+ "hf=109.37 #Btu/lbm\n",
+ "hfg=1013.2 #Btu/;bm\n",
+ "h2=hf+x*hfg\n",
+ "work=h1-h2\n",
+ "dw=y*work\n",
+ "h2d=h1-dw\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Work done =\",work,\"Btu/lbm\")\n",
+ "print '%s %.1f %s' %(\"\\n work done in case 2 =\",dw,\"Btu/lbm\")\n",
+ "print '%s %d %s' %(\"\\n Final state pressure =\",P2,\"psia\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Work done = 266 Btu/lbm\n",
+ "\n",
+ " work done in case 2 = 186.8 Btu/lbm\n",
+ "\n",
+ " Final state pressure = 3 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the quality of wet steam\n",
+ "#Initialization of variables\n",
+ "pb=14.696 #psia\n",
+ "pa=150 #psia\n",
+ "tb=300 #F\n",
+ "#calculations\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "hb=1192.8 #Btu/lbm\n",
+ "ha=hb\n",
+ "hf=330.51 #Btu/lbm\n",
+ "hfg=863.6 #Btu/lbm\n",
+ "x=(ha-hf)/hfg*100\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Quality of wet steam =\",x,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Quality of wet steam = 99.8 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12 - Pg 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal and furnace efficiencies\n",
+ "#Initialization of variables\n",
+ "p1=600 #psia\n",
+ "p2=0.2563 #psia\n",
+ "t1=486.21 #F\n",
+ "t2=60 #F\n",
+ "fur=0.75\n",
+ "#calculations\n",
+ "print '%s' %(\"from steam tables,\")\n",
+ "h1=1203.2\n",
+ "hf1=471.6\n",
+ "hfg1=731.6\n",
+ "h2=1088\n",
+ "hf2=28.06\n",
+ "hfg2=1059.9\n",
+ "s1=1.4454\n",
+ "sf1=0.6720\n",
+ "sfg1=0.7734\n",
+ "s2=2.0948\n",
+ "sf2=0.0555\n",
+ "sfg2=2.0393\n",
+ "xd=(s1-sf2)/sfg2\n",
+ "hd=hf2+xd*hfg2\n",
+ "xa=0.3023\n",
+ "ha=hf2+xa*hfg2\n",
+ "wbc=0\n",
+ "wda=0\n",
+ "wcd=h1-hd\n",
+ "wab=ha-hf1\n",
+ "W=wab+wcd+wbc+wda\n",
+ "Wrev=hfg1- (t2+459.7)*sfg1\n",
+ "etat=(t1-t2)/(t1+459.7)*100\n",
+ "eta=fur*etat\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Thermal efficiency =\",etat,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Furnace efficiency =\",eta,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from steam tables,\n",
+ "Thermal efficiency = 45 percent\n",
+ "\n",
+ " Furnace efficiency = 33.8 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13 - Pg 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal and overall efficiencies\n",
+ "#Initialization of variables\n",
+ "dhab=-123.1\n",
+ "etac=0.5\n",
+ "ha=348.5\n",
+ "etaf=0.75\n",
+ "eta=0.85\n",
+ "hf=471.6\n",
+ "hfg=731.6\n",
+ "hc=1203.2\n",
+ "dhcd=452.7\n",
+ "#calculations\n",
+ "dwabs=dhab/etac\n",
+ "hbd=ha-dwabs\n",
+ "dwcds=dhcd*eta\n",
+ "dqa=hc-hbd\n",
+ "etat=(dwcds+dwabs)/dqa*100\n",
+ "eta=etat*etaf\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Thermal efficiency =\",etat,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Overall efficiency =\",eta,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 22.8 percent\n",
+ "\n",
+ " Overall efficiency = 17.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal and overall efficiencies\n",
+ "#Initialization of variables\n",
+ "t=60 #F\n",
+ "J=778.16\n",
+ "p1=600 #psia\n",
+ "p2=0.2563 #psia\n",
+ "etaf=0.85 \n",
+ "#calculations\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "vf=0.01604 #ft^3/lbm\n",
+ "dw=-vf*(p1-p2)*144/J\n",
+ "ha=28.06 #Btu/lbm\n",
+ "hb=29.84 #Btu/lbm\n",
+ "hd=1203.2 #Btu/lbm\n",
+ "he=750.5 #Btu/lbm\n",
+ "dqa=hd-hb\n",
+ "dqr=ha-he\n",
+ "dw=dqa+dqr\n",
+ "dwturb=hd-he\n",
+ "dwpump=ha-hb\n",
+ "etat=dw/dqa*100\n",
+ "eta=etat*etaf\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Thermal efficiency =\",etat,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Overall efficiency =\",eta,\"percent\")\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Thermal efficiency = 38.4 percent\n",
+ "\n",
+ " Overall efficiency = 32.7 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15 - Pg 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal and overall efficiencies\n",
+ "#Initialization of variables\n",
+ "dhab=-1.78\n",
+ "etac=0.5\n",
+ "ha=28.06\n",
+ "eta=0.85\n",
+ "hf=471.6\n",
+ "hfg=731.6\n",
+ "hd=1203.2\n",
+ "dhcd=452.7\n",
+ "#calculations\n",
+ "dwabs=dhab/etac\n",
+ "hbd=ha-dwabs\n",
+ "dwcds=dhcd*eta\n",
+ "dqa=hd-hbd\n",
+ "etat=(dwcds+dwabs)/dqa*100\n",
+ "eta=etat*eta\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Thermal efficiency =\",etat,\"percent\")\n",
+ "print '%s %.1f %s' %(\"\\n Overall efficiency =\",eta,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 32.5 percent\n",
+ "\n",
+ " Overall efficiency = 27.7 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the coefficient of performance, hp required, work of compression and expansion\n",
+ "#Initialization of variables\n",
+ "Ta=500. #R\n",
+ "Tr=540. #R\n",
+ "#calculations\n",
+ "cop=Ta/(Tr-Ta)\n",
+ "hp=4.71/cop\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "ha=48.02\n",
+ "hb=46.6\n",
+ "hc=824.1\n",
+ "hd=886.9\n",
+ "Wc=-(hd-hc)\n",
+ "We=-(hb-ha)\n",
+ "#results\n",
+ "print '%s %.1f' %(\"Coefficient of performance = \",cop)\n",
+ "print '%s %.3f %s' %(\"\\n horsepower required per ton of refrigeration =\",hp,\"hp/ton refrigeration\")\n",
+ "print '%s %.1f %s' %(\"\\n Work of compression =\",Wc,\"Btu/lbm\")\n",
+ "print '%s %.2f %s' %(\"\\n Work of expansion =\",We,\"Btu/lbm\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Coefficient of performance = 12.5\n",
+ "\n",
+ " horsepower required per ton of refrigeration = 0.377 hp/ton refrigeration\n",
+ "\n",
+ " Work of compression = -62.8 Btu/lbm\n",
+ "\n",
+ " Work of expansion = 1.42 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the coefficient of performance\n",
+ "#Initialization of variables\n",
+ "x=0.8\n",
+ "he=26.28 #Btu/lbm\n",
+ "hb=26.28 #Btu/lbm\n",
+ "pe=98.76 #psia\n",
+ "pc=51.68 #psia\n",
+ "hc=82.71 #Btu/lbm\n",
+ "hf=86.80+0.95\n",
+ "#calculations\n",
+ "dwisen=-(hf-hc)\n",
+ "dwact=dwisen/x\n",
+ "hd=hc-dwact\n",
+ "cop=(hc-hb)/(hd-hc)\n",
+ "#results\n",
+ "print '%s %.2f' %(\"Coefficient of performance = \",cop)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Coefficient of performance = 8.96\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/README.txt b/Concepts_of_Thermodynamics/README.txt
new file mode 100755
index 00000000..0b5ad1fc
--- /dev/null
+++ b/Concepts_of_Thermodynamics/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Tushar Ranjan
+Course: btech
+College/Institute/Organization: IIT Bombay
+Department/Designation: Chemical Engineering
+Book Title: Concepts of Thermodynamics
+Author: Obert Edward F
+Publisher: New York : McGraw-Hill
+Year of publication: 1960
+Isbn: 0829900373
+Edition: 1 \ No newline at end of file
diff --git a/Concepts_of_Thermodynamics/screenshots/chap10.png b/Concepts_of_Thermodynamics/screenshots/chap10.png
new file mode 100755
index 00000000..7e11d0b9
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap10.png
Binary files differ
diff --git a/Concepts_of_Thermodynamics/screenshots/chap10_1.png b/Concepts_of_Thermodynamics/screenshots/chap10_1.png
new file mode 100755
index 00000000..7e11d0b9
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap10_1.png
Binary files differ
diff --git a/Concepts_of_Thermodynamics/screenshots/chap12.png b/Concepts_of_Thermodynamics/screenshots/chap12.png
new file mode 100755
index 00000000..9abefd86
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap12.png
Binary files differ
diff --git a/Concepts_of_Thermodynamics/screenshots/chap12_1.png b/Concepts_of_Thermodynamics/screenshots/chap12_1.png
new file mode 100755
index 00000000..9abefd86
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap12_1.png
Binary files differ
diff --git a/Concepts_of_Thermodynamics/screenshots/chap9.png b/Concepts_of_Thermodynamics/screenshots/chap9.png
new file mode 100755
index 00000000..0686a129
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap9.png
Binary files differ
diff --git a/Concepts_of_Thermodynamics/screenshots/chap9_1.png b/Concepts_of_Thermodynamics/screenshots/chap9_1.png
new file mode 100755
index 00000000..0686a129
--- /dev/null
+++ b/Concepts_of_Thermodynamics/screenshots/chap9_1.png
Binary files differ