{ "metadata": { "name": "", "signature": "sha256:45c34efa92ef22d9ef4ef3ec497299bfe0d1792fe0aef4bcd0da61b878004248" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 5 : Vapor Pressure The Clapeyron Equation And Single Pure Chemical Species Phase Equilibrium" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.1 Page: 89" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of dP/dT is 0.291432 psi/R\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.2 Page: 90\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The temperature is -23.88 F\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.3 Page: 91\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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", "X = linalg.inv(M) * C\n", "\n", "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", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Vapuor pressure of water at given temperature is 3499.187053 psia\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.4 Page: 94\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The accentric factor based on the given data is 0.638272\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.5 Page: 94\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "NBP of water umath.sing antoine equation and table A.2 is 100.000625 C\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 5.6 Page: 96\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \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", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Freezing preesure of water at given temperature is 42991.024258 psi\n" ] } ], "prompt_number": 12 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }