diff options
Diffstat (limited to 'Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb')
-rw-r--r-- | Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb | 85 |
1 files changed, 77 insertions, 8 deletions
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb index 259744fa..df919019 100644 --- a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb +++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch5.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "" + "name": "", + "signature": "sha256:45c34efa92ef22d9ef4ef3ec497299bfe0d1792fe0aef4bcd0da61b878004248" }, "nbformat": 3, "nbformat_minor": 0, @@ -27,22 +28,32 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", + " \n", "import math \n", "\n", "\n", + "# Variables\n", "T=212. # [F]\n", "\n", + "#**********#\n", + "#From the steam table, we have \n", "delta_h=970.3 #[Btu/lbm]\n", "delta_v=26.78 #[ft**(3)/lbm] and\n", "\n", + "# Calculations\n", + "# changing the units\n", "delta_h1=delta_h*778 #[ft*lbf/lbm]\n", "delta_v1=delta_v*144 #[ft*in**(2)/lbm]\n", "T=671.7 #[R]\n", "\n", + "# We have dP/dT = delta_h/(T*delta_v)\n", + "#Thus\n", "dP_by_dT=delta_h1/(T*delta_v1) #[psi/R]\n", "\n", + "# Results\n", "print \"The value of dP/dT is %f psi/R\"%(dP_by_dT)\n", + "#Using the nearest adjacent steam table entries for vapour pressure, wee have \n", + "#dP_by_dT = delta_P_by_delta_T=(15.291-14.125)/(214-210)=0.2915 psi/R\n" ], "language": "python", "metadata": {}, @@ -69,21 +80,32 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", + " \n", "import math \n", "\n", + "# Variables\n", "p_2=0.005 # [psia]\n", "R=1.987/18. #[1/R]\n", "\n", + "#From the steam tables at the tripple point, we find \n", "T_1=460+32.018 #[R]\n", "p_1=0.0887 #[psia]\n", "\n", + "#delta_h(solid to gas) = delta_h(sublimation) = 1218.7#[Btu/lbm]\n", "delta_H=1218.7 #[Btu/lbm]\n", + "#Assuming that the enthalpy change of vaporization is independent of temperature (a fairly good approximation in this case)\n", + "#we start with Eq. 5.10 and rearrange:\n", + "#1/T_2 = 1/T_1-(math.log(p_2/p_1))*R/delta_H\n", + "#So\n", "\n", + "# Calculations\n", "T_2=1/(1/T_1-(math.log(p_2/p_1))*R/delta_H) #[R]\n", + "#Changing the temperature in farenheit\n", "T_2F=T_2-460 #[F]\n", "\n", + "# Results\n", "print \"The temperature is %.2f F\"%(T_2F)\n", + "#BY linear interpolation in the steam tables, one finds -23.8 F. Because of imprecision of linear interpolation, these values are approximately equal.\n" ], "language": "python", "metadata": {}, @@ -110,18 +132,27 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", - "\n", + " \n", "import math \n", "from numpy import *\n", "\n", + "# Variables\n", "T_3=1155.2 #[R]\n", "T_2=652.9 #[R]\n", "T_1=787.5 #[R]\n", "p_2=10. #[psia]\n", "p_1=100. #[psia]\n", "\n", + "# Calculations\n", + "#******#\n", + "#Here we can write Eq. 5.9 as reported in the book in the form most often seen.\n", + "# math.log(p)=A-B/T\n", + "#Where A and B are consmath.tants to be determined from the pair of T and p values above.\n", "\n", + "#we simply write \n", + "#math.log(10)=A-B/652.9\n", + "#math.log(100)=A-B/787.5\n", + "# We have to solve the above two simulmath.taneous equations having two vaiables A and B.\n", "\n", "M = matrix([[1, -1/652.9],[1,-1/787.5]])\n", "C = array([[math.log(10)],[math.log(100)]])\n", @@ -130,10 +161,14 @@ "A=X[0]\n", "B=X[1]\n", "\n", + "# By straightforward algebra we find the values of A and B. Thus, for 1155.2 R we have \n", "p_3=math.exp(A-B/T_3)\n", "\n", + "# Results\n", "print \"Vapuor pressure of water at given temperature is %f psia\"%(p_3)\n", "\n", + "# p_3=3499 psia. \n", + "# Note : \"It has been reported in the book that from table 5.1 we see that the correct value is 3000 psia. Thus there is an error of 16% in the predicted pressure.\"\n", "\n" ], "language": "python", @@ -161,14 +196,20 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", + " \n", "import math \n", "\n", + "# Variables\n", + "# At Tr = 0.7, we read \n", "Pr=0.023\n", + "# and thus accentric factor is given by\n", "\n", + "# Calculations\n", "w=-math.log10(0.023)-1\n", "\n", + "# Results\n", "print \"The accentric factor based on the given data is %f\"%(w)\n", + "#It has been reported in the book that table A.1 shows that the value based on the best data is 0.645.\n" ], "language": "python", "metadata": {}, @@ -195,18 +236,29 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", + " \n", "import math \n", "\n", + "# Variables\n", + "#From Antoine equation we have \n", + "# math.log(p) = A-B/(T+C)\n", + "#Solving above equation for T, we have\n", + "# T = B/(A-math.log(p))-C\n", + "#Inserting the values of the consmath.tants for the water which are reported in the given book in the table A.2 (page 419),\n", + "# and the value of 1.00 atm expressed in torr, we find that \n", "A=7.96681\n", "B=1668.21\n", "C=228.0\n", "p=760. #[torr]\n", "\n", + "# Calculations\n", + "#Thus\n", "T=B/(A-math.log10(p))-C\n", "\n", + "# Results\n", "print \"NBP of water umath.sing antoine equation and table A.2 is %f C\"%(T)\n", "\n", + "#This does not prove the overall accuracy of the Antoine equation, but does show that whoever fitted the consmath.tants to the experimental data for water made them represent the NBP (100C) very well. \n" ], "language": "python", "metadata": {}, @@ -233,26 +285,43 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", + " \n", "import math \n", "\n", + "# Variables\n", "T_2=-22. #[C]\n", + "# converting temperature in farenheit\n", "T_2F=T_2*9/5+32 #[F]\n", + "#Expressing T_2 in Rankine\n", "T_2R=460+T_2F #[R]\n", + "#delta_h = delta_h(fusion)\n", "delta_h=143.35*778. #[ft*lbf/lbm]\n", + "#delta_v = v_water-v_ice\n", "delta_v=0.01602-0.01747 #[ft**(3)/lbm]\n", + "# changing the unit \n", "delta_v1=delta_v*144 #[ft*in/lbm]\n", "\n", + "# Calculations\n", + "#and\n", "T_1=460+32. #[R]\n", "dP_by_dT=delta_h/(T_1*delta_v1) #[psi/R] at 32F\n", "delta_T=T_2R-T_1\n", "\n", + "#This gives the rigorously correct slope of the liquid-solid curve at 32F on a P-T diagram.\n", + "#Here we use P instead of p because neither phase is a gas, so this is not a vapour pressure. \n", + "#If we further assume that the solid-liquid curve is a straight line, which is equivalent to assuming that delta_h/(T*deta_v)is a consmath.tant over the region of interest, then we can estimate the pressure at -22C = -7.6F by\n", + "#So\n", "\n", "delta_P=(dP_by_dT)*delta_T #[psi]\n", "\n", + "# From this we can estimate the final pressure as\n", "delta_P=delta_P+0.09 #[psi]\n", "\n", + "# Results\n", "print \"Freezing preesure of water at given temperature is %f psi\"%(delta_P)\n", + "# In this case, the experimental pressure is well known, because this temperature corresponds to the tripple point between liquid and water, \n", + "# ice I(the common variety), and ice III, a variety that does not exist at pressure below about 30000 psia (see figure 1.10 in the book). \n", + "# The measured value is 30000 psia, which shows that our assumption of a straight line on a P-T plot (delta_h/(T*delta_v)=consmath.tant) is only approximately correct.\n", "\n" ], "language": "python", |