diff options
Diffstat (limited to 'Elementary_Principles_of_Chemical_Processes/Chapter8.ipynb')
-rwxr-xr-x | Elementary_Principles_of_Chemical_Processes/Chapter8.ipynb | 1053 |
1 files changed, 1053 insertions, 0 deletions
diff --git a/Elementary_Principles_of_Chemical_Processes/Chapter8.ipynb b/Elementary_Principles_of_Chemical_Processes/Chapter8.ipynb new file mode 100755 index 00000000..34aa53f2 --- /dev/null +++ b/Elementary_Principles_of_Chemical_Processes/Chapter8.ipynb @@ -0,0 +1,1053 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:96d9d4935cd6f3c8e019e8d452a9980bb4f36e96fb606a03b9b38b11670ead8c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8: Balances on Nonreactive Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1-1, page no. 362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "basis=100. #mol/s\n", + "ninAcv=66.9 #mol/s\n", + "noutAcv=3.35 #mol/s\n", + "noutAcl=63.55 #mol/s\n", + "ninN2=33.1 #mol/s\n", + "noutN2=ninN2\n", + "HinAcv=35.7 #Kj/mol\n", + "HoutAcv=32.0 #Kj/mol\n", + "HinN2=1.16 #Kj/mol\n", + "HoutN2= -0.10 #Kj/mol\n", + "#Calculations and printing:\n", + "deltaH=noutAcv*HoutAcv+ noutN2*HoutN2-ninN2*HinN2-ninAcv*HinAcv\n", + "Q=deltaH\n", + "print '%s %.2f' %(\"Heat transferred from condenser to achieve required cooling and condensation at the rate of (kW) \",Q)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transferred from condenser to achieve required cooling and condensation at the rate of (kW) -2322.84\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "''" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3-1, page no. 367" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "mass=200.0 #kg\n", + "Ti=20.0 #C\n", + "Tf=150.0 #C\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "def Cv(T):\n", + " Cv=0.855+ T*9.42*math.pow(10,-4)\n", + " return Cv\n", + "\n", + "Ucap, err= scipy.integrate.quad(Cv,Ti,Tf) #integrate.quad is an inbult function used for definite integration\n", + "Q=mass*Ucap\n", + "print '%s %.3f' %(\"Heat Required (KJ) = \",Q)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + "Heat Required (KJ) = 24311.820\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 3, + "text": [ + "''" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3-2, page no. 369" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "T1=20.0 #C\n", + "T2=100.0 #C\n", + "T3=90.0 #C\n", + "T4=30.0 #C\n", + "P=3.0 #bar\n", + "V=5.0 #L\n", + "R=0.08314 #L.bar/mol.K\n", + "T=363.0 #K\n", + "ndot=100.0 #mol/min\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "print(\"part 1\")\n", + "def fun1(T):\n", + " fun1=0.02900+ T*0.2199*math.pow(10,-5) + math.pow(T,2) * 0.5723 *math.pow(10,-8) - math.pow(T,3) * 2.871 * math.pow(10,-12)\n", + " return fun1\n", + "\n", + "deltaH, err=scipy.integrate.quad(fun1,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration\n", + "Qdot=ndot*deltaH\n", + "print '%s %.3f' %(\"Heat Transferred (KJ/min) = \",Qdot)\n", + "print(\"part2\")\n", + "def fun2(T):\n", + " fun2=0.02900+ T*0.2199*math.pow(10,-5) + math.pow(T,2) * 0.5723 *math.pow(10,-8) - math.pow(T,3) * 2.871 * math.pow(10,-12)-8.14* math.pow(10,-3)\n", + " return fun2\n", + "\n", + "deltaU, err2=scipy.integrate.quad(fun2,T3,T4) #scipy.integrate.quad is an inbult function used for definite integration\n", + "n=P*V/(R*T)\n", + "Q=n*deltaU\n", + "print '%s %.3f' %(\"Heat transferred (KJ) = \",Q)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + "part 1\n", + "Heat Transferred (KJ/min) = 233.238\n", + "part2\n", + "Heat transferred (KJ) = -0.627\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 4, + "text": [ + "''" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3-3, page no. 371" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "T1=430.0 #C\n", + "T2=100.0 #C\n", + "ndot=15.0 #Kmol/min\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "def fun(T):\n", + " fun=0.02894 + T* 0.4147 *math.pow(10,-5) + math.pow(T,2) * 0.3191 * math.pow(10,-8) - math.pow(T,3) * 1.965 * math.pow(10,-12)\n", + " return fun\n", + "\n", + "deltaH, err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration\n", + "Qdot=ndot*deltaH*math.pow(10,3) /60.\n", + "print '%s %.3f' %(\" \\n Rate of heat removal (KW) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + " \n", + " Rate of heat removal (KW) = -2494.904\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 5, + "text": [ + "''" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3-4, page no. 373" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "x=0.6\n", + "T1=0.0\n", + "T2=400.0\n", + "ndot=150.0 #mol/h\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "def fun1(T):\n", + " fun1=0.04937 + T*13.92*math.pow(10,-5) - math.pow(T,2) *5.816*math.pow(10,-8) + math.pow(T,3) *7.280 * math.pow(10,-12)\n", + " return fun1\n", + "\n", + "def fun2(T):\n", + " fun2=0.06803 +T*22.59*math.pow(10,-5) - math.pow(T,2) *13.11*math.pow(10,-8) + math.pow(T,3) *31.71 * math.pow(10,-12)\n", + " return fun2\n", + "\n", + "def fun(T):\n", + " fun=x*fun1(T)+ (1-x)*fun2(T)\n", + " return fun\n", + "\n", + "deltaH , err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration\n", + "print '%s %.3f' %(\" \\n Heat capacity of Mixture (KJ/mol) = \",deltaH)\n", + "Qdot=ndot*deltaH\n", + "print '%s %.3f' %(\" \\n Heat Required (KJ/h) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + " \n", + " Heat capacity of Mixture (KJ/mol) = 34.890\n", + " \n", + " Heat Required (KJ/h) = 5233.495\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 6, + "text": [ + "''" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3-5, page no. 374" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "x=0.1 #CH4\n", + "T1=20.0\n", + "T2=300.0\n", + "Vdot=2000.0 #L/min\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "ndot=Vdot/22.4\n", + "def fun(T):\n", + " fun=0.03431 + T*5.469*math.pow(10,-5) + math.pow(T,2) *0.3661*math.pow(10,-8) + math.pow(T,3) *11*math.pow(10,-12)\n", + " return fun\n", + "\n", + "H1 ,err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration\n", + "print '%s %.3f' %(\"H1 (Kj/mol) = \",H1)\n", + "print(\"From Tables H2= -0.15 Kj/mol , H3=8.17 Kj/mol\")\n", + "H2= -0.15\n", + "H3=8.17\n", + "Qdot=(ndot*x*H1+ ndot*(1-x)*(H3-H2))/60.\n", + "print '%s %.3f' %(\"Heat Input (KW) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + "H1 (Kj/mol) = 12.112\n", + "From Tables H2= -0.15 Kj/mol , H3=8.17 Kj/mol\n", + "Heat Input (KW) = 12.945\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 7, + "text": [ + "''" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4-1, page no. 379" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "\n", + "mdot=1500.0 #g/min\n", + "M=32.0 #g/mol\n", + "deltaHv=35.3 #Kj/mol\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \\n \")\n", + "Qdot=mdot*deltaHv/(M*60.)\n", + "print '%s %.3f' %(\"Rate of Heat transfer (KW) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook \n", + " \n", + "Rate of Heat transfer (KW) = 27.578\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 9, + "text": [ + "''" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4-2, page no. 379" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "deltaHv=28.85 #Kj/mol at 69 C\n", + "T1=25.0 #C\n", + "T2=69.0 #C\n", + "Cp=0.2163 #Kj/mol C\n", + "V=1.0 #L\n", + "P=7.0 #bar\n", + "D=0.659 #KG/L\n", + "M=86.17 #Kg\n", + "ndot=100.0 #mol/h\n", + "T3=300.0 #C\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "print(\"We have deltaHv at 69C hence We follow path ADG\")\n", + "deltaHA=Cp*(T2-T1) + V*(1.013-P)*M/(D*math.pow(10,4))\n", + "print '%s %.3f' %(\" \\n deltaHA (Kj/mol) =\",deltaHA)\n", + "deltaHD=deltaHv\n", + "print '%s %.3f' %(\" \\n deltaHD (Kj/Kg) =\",deltaHD)\n", + "def fun1(T):\n", + " fun1=0.13744 + T*40.85*math.pow(10,-5) - math.pow(T,2) *23.92*math.pow(10,-8) + math.pow(T,3) *57.66*math.pow(10,-12)\n", + " return fun1\n", + "\n", + "deltaHG, err=scipy.integrate.quad(fun1,T2,T3) #scipy.integrate.quad is an inbult function used for definite integration\n", + "print '%s %.3f' %(\" \\n deltaHG (KJ/mol) = \",deltaHG)\n", + "Qdot=ndot*(deltaHA+deltaHD+deltaHG)/3600\n", + "print '%s %.3f' %(\" \\n rate of Heat supply (KJ/mol) = \",Qdot)\n", + "print(\" \\n In this problem we neglected V*deltaP as it is negligible \")\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + "We have deltaHv at 69C hence We follow path ADG\n", + " \n", + " deltaHA (Kj/mol) = 9.439\n", + " \n", + " deltaHD (Kj/Kg) = 28.850\n", + " \n", + " deltaHG (KJ/mol) = 47.149\n", + " \n", + " rate of Heat supply (KJ/mol) = 2.373\n", + " \n", + " In this problem we neglected V*deltaP as it is negligible \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 10, + "text": [ + "''" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4-3, page no. 382" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "\n", + "T1=337.9 #K\n", + "T2=473.0 #K\n", + "Tc=513.2 #K\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "print(\"using Trouton rule,\")\n", + "deltaHvT1=0.109*T1\n", + "print(\"In this case, trouton rule gives a better estimate\")\n", + "print(\"using Watson correction\")\n", + "deltaHvT2=36.8*math.pow(((Tc-T2)/(Tc-T1)),0.38)\n", + "print '%s %.3f' %(\"Estimated value using Trouton rule (Kj/mol) = \",deltaHvT1)\n", + "print '%s %.3f' %(\" \\n Estimated value using watson correction (Kj/mol) = \",deltaHvT2)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + "using Trouton rule,\n", + "In this case, trouton rule gives a better estimate\n", + "using Watson correction\n", + "Estimated value using Trouton rule (Kj/mol) = 36.831\n", + " \n", + " Estimated value using watson correction (Kj/mol) = 21.029\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 11, + "text": [ + "''" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4-4, page no. 383" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "\n", + "basis=1.0 #mol feed\n", + "x=0.684 #mole fraction Of B\n", + "y=0.4\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "A=([[1, 1],[x ,y]])\n", + "b=([[basis],[basis/2]])\n", + "C=numpy.dot(linalg.inv(A),b)\n", + "#Here We solved two linear equations simultaneously\n", + "nV=C[0,0]\n", + "nL=C[1,0]\n", + "H1=5.332\n", + "H2=6.340\n", + "H3=37.52\n", + "H4=42.93\n", + "Q=nV*x*H1 + nV*(1-x)*H2 + nL*y*H3 + nL*(1-y)*H4\n", + "print '%s %.3f' %(\" \\n Heat transferred (KJ) = \",Q)\n", + "print(\"The answer for this problem in Text is wrong\")\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + " \n", + " Heat transferred (KJ) = 28.401\n", + "The answer for this problem in Text is wrong\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "''" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4-6, page no. 390" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "basis=1. #lbm dry air\n", + "Tin=80. #F Inlet temperature\n", + "Tout=51. #F Outlet temperature\n", + "\n", + "\n", + "\n", + "#Calculations and printing:\n", + "print(\"For 80F and 80 percent RH, ha=0.018 lbm H20/lbm DA H1=38.8 Btu/lbm DA\")\n", + "ha=0.018 #lbm H20/lbm DA\n", + "H1=38.8 #Btu/lbm DA\n", + "m1=basis*ha\n", + "print(\"\\n For 51F and saturated, ha=0.0079 lbm H20/lbm DA H2=20.9 Btu/lbm DA\")\n", + "ha2=0.0079 #lbm H20/lbm DA\n", + "H2=20.9 #Btu/lbm DA\n", + "m2=basis*ha2\n", + "print(\"\\n Balance on H2O\")\n", + "m3=m1-m2\n", + "Fraction=m3/m1\n", + "print '%s %.3f' %(\"\\n Fraction H2O condensed = \",Fraction)\n", + "H3=basis*(Tout-32.)\n", + "Q=basis*H2+m3*H3-basis*H1\n", + "print(\"\\n From psychrometric chart, Vh=13.0 ft^3/lbm DA\")\n", + "Vbasis=basis*13.0\n", + "Qdot=Q*1000./Vbasis\n", + "print '%s %.2f' %(\"Rate at which heat must be removed (Btu/min) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For 80F and 80 percent RH, ha=0.018 lbm H20/lbm DA H1=38.8 Btu/lbm DA\n", + "\n", + " For 51F and saturated, ha=0.0079 lbm H20/lbm DA H2=20.9 Btu/lbm DA\n", + "\n", + " Balance on H2O\n", + "\n", + " Fraction H2O condensed = 0.561\n", + "\n", + " From psychrometric chart, Vh=13.0 ft^3/lbm DA\n", + "Rate at which heat must be removed (Btu/min) = -1362.16\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 13, + "text": [ + "''" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5-1, page no. 397" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "import scipy\n", + "from scipy import integrate\n", + "M1=35.6 #g/mol\n", + "M2=18.0 #g/mol\n", + "x=0.2\n", + "mdot=1000.0 #kg/h\n", + "T1=25.0 #C\n", + "T2=100.0 #C\n", + "T3=40.0 #C\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "nHCl=mdot*x*math.pow(10,3) /M1\n", + "nH2O=mdot*(1-x)*math.pow(10,3) /M2\n", + "def fun(T):\n", + " fun=29.13*math.pow(10,-3) - T*0.1341*math.pow(10,-5) +math.pow(T,2) *0.9715*math.pow(10,-8) - math.pow(T,3) *4.335*math.pow(10,-12)\n", + " return fun\n", + "\n", + "H1, err=scipy.integrate.quad(fun,T1,T2) #scipy.integrate.quad is an inbult function used for definite integration\n", + "r=nH2O/nHCl\n", + "print(\"From table B.11, deltaHa= -67.4 Kj/mol HCl\")\n", + "deltaHa= -67.4\n", + "y=nHCl/(nHCl+nH2O)\n", + "Cp=0.73*mdot*4.184/nHCl\n", + "deltaHb=Cp*(T3-T1)\n", + "H2=deltaHa+deltaHb\n", + "Qdot=nHCl*(H2-H1)\n", + "print '%s %.3E' %(\"Heat (kJ/h) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + "From table B.11, deltaHa= -67.4 Kj/mol HCl\n", + "Heat (kJ/h) = -3.451E+05\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 14, + "text": [ + "''" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5-2, page no. 400" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "\n", + "x=0.05\n", + "y=0.4\n", + "mdot=1000.0 #lbm/h\n", + "Hf=10.0 #Btu/lbm\n", + "Hl= -17 #Btu/lbm\n", + "Hv=1138.0 #Btu/lbm\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "print(\"\\n sulphuric acid balance\")\n", + "m2=x*mdot/y\n", + "print(\"\\n Total Mass balance\")\n", + "m1=mdot-m2\n", + "Qdot=m1*Hv+m2*Hl-mdot*Hf\n", + "print '%s %.3f' %(\" Rate of Heat transfer (Btu/h) = \",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + "\n", + " sulphuric acid balance\n", + "\n", + " Total Mass balance\n", + " Rate of Heat transfer (Btu/h) = 983625.000\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 15, + "text": [ + "''" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5-5, page no. 405" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#Initialization of variables\n", + "import math\n", + "import numpy\n", + "from numpy import linalg\n", + "\n", + "basis=100.0 #lbm/h\n", + "Hv=728.0 #Btu/lbm\n", + "Hl=45.0 #Btu/lbm\n", + "HF=100.0 #Btu/lbm\n", + "T=120.0 #F\n", + "xF=0.30\n", + "\n", + "#Calculations and printing :\n", + "\n", + "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", + "print(\"From figure 8.5-2, \")\n", + "xL=0.185\n", + "xV=0.89\n", + "mL=basis*((xV-xF)/(xV-xL))\n", + "mV=basis-mL\n", + "Qdot=mV*Hv + mL*Hl - basis*HF\n", + "print '%s %.3f' %(\"Rate of heat transfer (Btu/h) =\",Qdot)\n", + "raw_input('press enter key to exit')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", + "From figure 8.5-2, \n", + "Rate of heat transfer (Btu/h) = 5641.135\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "press enter key to exit\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 16, + "text": [ + "''" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |