{ "metadata": { "name": "", "signature": "sha256:d221da8e75f5f6adc3adedef3c1ac8c09cdf0ffedf5eae70dc97519a155edf88" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 8 : Vapor Liquid Equilibrium VLE at Low Pressures" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.1 Page: 163" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "x_acetone = 0.05 # Mole fraction of Acetone in liquid\n", "x_water = (1-x_acetone)\n", "y_acetone = 0.6381 # Mole fraction of Acetone in vapour\n", "y_water = (1-y_acetone)\n", "\n", "K_acetone = y_acetone/x_acetone\n", "K_water = y_water/x_water\n", "a = K_acetone/K_water\n", "\n", "print \"The K factor of acetone is %f\"%(K_acetone)\n", "print \" The K factor of water is %f\"%(K_water)\n", "print \" The relative volatility is %f\"%(a)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The K factor of acetone is 12.762000\n", " The K factor of water is 0.380947\n", " The relative volatility is 33.500691\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.2 Page: 165\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "P = 1. #[atm]\n", "Temp = 74.8 #[C]\n", "A_a = 7.02447\n", "B_a = 1161\n", "C_a = 224\n", "p_acetone = 10**(A_a-B_a/(Temp+C_a)) #[mmHg]\n", "A_w = 7.94917\n", "B_w = 1657.462\n", "C_w = 227.02\n", "\n", "p_water = 10**(A_w-B_w/(Temp+C_w)) #[mmHg]\n", "p_acetone = p_acetone/760 #[atm]\n", "p_water = p_water/760 #[atm]\n", "y_acetone = 0.6381\n", "x_acetone = 0.05\n", "y_water = (1-y_acetone)\n", "x_water =(1-x_acetone)\n", "Y_acetone = y_acetone*P/(x_acetone*p_acetone)\n", "Y_water = y_water*P/(x_water*p_water)\n", "\n", "print \"Liquid-phase activity coefficient for acetone is %f\"%(Y_acetone)\n", "print \" Liquid-phase activity coefficient for water is %f\"%(Y_water)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Liquid-phase activity coefficient for acetone is 7.043759\n", " Liquid-phase activity coefficient for water is 1.009407\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.3 Page: 167\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "x_a = 0.05 # mole fraction of acetone in liquid phase\n", "x_w = (1-x_a) # mole fraction of the water in the liquid phase\n", "P = 1.00 #[atm] Total pressure in vapor phase\n", "\n", "T_1 = 80. #[C]\n", "A_a = 7.02447\n", "B_a = 1161.\n", "C_a = 224.\n", "A_w = 7.94917\n", "B_w = 1657.462\n", "C_w = 227.02\n", "\n", "p_a_1 = (1./760)*10**(A_a - B_a/(T_1+C_a)) #[atm]\n", "p_w_1 = (1./760)*10**(A_w - B_w/(T_1+C_w)) #[atm]\n", "\n", "y_a_1 = (x_a*p_a_1)/P\n", "y_w_1 = (x_w*p_w_1)/P\n", "\n", "y_1 = (y_a_1 + y_w_1)\n", "\n", "T_2 = 96.4060 #[C]\n", "\n", "p_a_2 = (1./760)*10**(A_a - B_a/(T_2+C_a)) #[atm]\n", "p_w_2 = (1./760)*10**(A_w - B_w/(T_2+C_w)) #[atm]\n", "\n", "y_a_2 = (x_a*p_a_2)/P\n", "y_w_2 = (x_w*p_w_2)/P\n", "\n", "y_2 = (y_a_2 + y_w_2)\n", "T_e = 74.8 #[C] Boiling temperature\n", "y_a_e = 0.6381 # vapor phase composition of acetone\n", "\n", "print \" Comparison of experimental values to those computed by the ideal solution assumption x_acetone = 0.05 and P = 1.00 atm\"\n", "print \" \\t\\t\\t Experimental Values from Table 8.1 \\t\\t\\t\\tValues calculated assuming idea solution\"\n", "print \" Equilibriumboiling) \\t\\t%0.1f \\t\\t\\t\\t\\t\\t\\t\\t\\t %0.1f temperature T deg C\"%(T_e,T_2)\n", "print \" Mole fraction acetone \\t\\t%f \\t\\t\\t\\t\\t\\t\\t\\t %f in the vapor phase y_a)\"%(y_a_e,y_a_2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Comparison of experimental values to those computed by the ideal solution assumption x_acetone = 0.05 and P = 1.00 atm\n", " \t\t\t Experimental Values from Table 8.1 \t\t\t\tValues calculated assuming idea solution\n", " Equilibriumboiling) \t\t74.8 \t\t\t\t\t\t\t\t\t 96.4 temperature T deg C\n", " Mole fraction acetone \t\t0.638100 \t\t\t\t\t\t\t\t 0.165615 in the vapor phase y_a)\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.4 Page: 177\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "n_water = 80. #[mol]\n", "n_bumath_tanol = 20. #[mol]\n", "n_total = n_water+n_bumath_tanol #[mol]\n", "\n", "x_feed = 0.8\n", "x_a_1 = 0.65\n", "x_a_2 = 0.98\n", "\n", "n_1 = (x_feed-x_a_2)/(x_a_1-x_a_2)*n_total #[mol]\n", "n_2 = (n_total-n_1) #[mol]\n", "n_a_1 = 0.65*n_1 #[mol]\n", "n_a_2 = 0.98*n_2 #[mol]\n", "\n", "print \" Total moles of water present in the first phase is %f mol\"%(n_a_1)\n", "print \" Total moles of water present in the second phase is %f mol\"%(n_a_2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Total moles of water present in the first phase is 35.454545 mol\n", " Total moles of water present in the second phase is 44.545455 mol\n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.5 Page: 178\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "P = 1. #[atm]\n", "y_water = 0.60\n", "x_water_1 = 0.22\n", "x_water_2 = 0.99\n", "\n", "print \" The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=60 mol%% is %f mol%% water\"%(x_water_1)\n", "print \" The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=90 mol%% is %f mol%% water\"%(x_water_2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=60 mol% is 0.220000 mol% water\n", " The equilibrium amount of water in liquid at bubble-point for the dew-point composition y_water=90 mol% is 0.990000 mol% water\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.6 Page: 178\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "P = 1.00 #[atm] assumed total vapor pressure\n", "P1 = 14.7 #[psia]\n", "x_1_water = 0.65\n", "x_1_bumath_tanol = (1-x_1_water)\n", "x_2_water = 0.98\n", "x_2_bumath_tanol = (1-x_2_water)\n", "y_water = 0.73\n", "y_bumath_tanol = (1-y_water)\n", "T = 92. #[C]\n", "\n", "A_w = 7.94917\n", "B_w = 1657.462\n", "C_w = 227.02\n", "\n", "A_b = 7.838\n", "B_b = 1558.190\n", "C_b = 196.881\n", "\n", "p_water = (14.7/760)*10**(A_w - B_w/(T+C_w))\n", "p_bumath_tanol = (14.7/760)*10**(A_b - B_b/(T+C_b))\n", "\n", "f_water = (y_water*P)\n", "f_bumath_tanol = (y_bumath_tanol*P)\n", "\n", "Y_water_1 = (y_water*P1)/(x_1_water*p_water)\n", "Y_bumath_tanol_1 = (y_bumath_tanol*P1)/(x_1_bumath_tanol*p_bumath_tanol)\n", "\n", "Y_water_2 = (y_water*P1)/(x_2_water*p_water)\n", "Y_bumath_tanol_2 = (y_bumath_tanol*P1)/(x_2_bumath_tanol*p_bumath_tanol)\n", "\n", "print \" Four activity coefficients and fufacities are shown in the following table:\"\n", "print \"Phase \\t x_water \\t f_wateratm \\t Y_water \\t x_butanol \\t f_butanolatm \\t\\t Y_butanol\"\n", "print \" 1 \\t %f \\t %f \\t %f \\t %f \\t %f \\t\\t %f \"%(x_1_water,f_water,Y_water_1,x_1_bumath_tanol,f_bumath_tanol,Y_bumath_tanol_1)\n", "print \" 2 \\t %f \\t %f \\t %0.2f \\t\\t %f \\t %f \\t\\t %f \"%(x_2_water,f_water,Y_water_2,x_2_bumath_tanol,f_bumath_tanol,Y_bumath_tanol_2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Four activity coefficients and fufacities are shown in the following table:\n", "Phase \t x_water \t f_wateratm \t Y_water \t x_butanol \t f_butanolatm \t\t Y_butanol\n", " 1 \t 0.650000 \t 0.730000 \t 1.504988 \t 0.350000 \t 0.270000 \t\t 2.108586 \n", " 2 \t 0.980000 \t 0.730000 \t 1.00 \t\t 0.020000 \t 0.270000 \t\t 36.900247 \n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.7 Page: 179\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "P = 1. #[atm] Total pressure in the vapor phase\n", "\n", "\n", "T = 89. #[C]\n", "A_w = 7.94917\n", "B_w = 1657.462\n", "C_w = 227.02\n", "\n", "A_b = 7.838\n", "B_b = 1558.190\n", "C_b = 196.881\n", "\n", "p_water = (1./760)*10**(A_w - B_w/(T+C_w))\n", "p_bumath_tanol = (1./760)*10**(A_b - B_b/(T+C_b))\n", "\n", "y_water = p_water/P\n", "y_bumath_tanol = p_bumath_tanol/P\n", "y = y_water + y_bumath_tanol\n", "\n", "\n", "print \" Boiling point of the two phase system is %0.0f deg C\"%(T)\n", "print \" In vapor phase mole fraction of the water is %0.2f\"%(y_water)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Boiling point of the two phase system is 89 deg C\n", " In vapor phase mole fraction of the water is 0.67\n" ] } ], "prompt_number": 25 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.8 Page: 184\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "Temp = 68. #[F]\n", "P = 1. #[atm]\n", "\n", "Temp = 273.15+(Temp-32)*5./9 #[K]\n", "P = P*1.01325 #[bar]\n", "T_c = 647.1 #[K]\n", "P_c = 220.55 #[bar]\n", "T_r = Temp/T_c\n", "P_r = P/P_c\n", "w = 0.345\n", "f_T_r = (0.083-0.422/T_r**(1.6))+w*(0.139-0.172/T_r**(4.2))\n", "f_by_P = math.exp(P_r/T_r*f_T_r)\n", "\n", "print \"The value of the f/P for water vapour in the hypothetical state is %0.2f\"%(f_by_P)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of the f/P for water vapour in the hypothetical state is 0.97\n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.9 Page: 189\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "x_a = 0.1238\n", "x_b = (1-x_a)\n", "T = 85.3 #[C] Given boiling temperature\n", "\n", "A_a = 8.04494\n", "B_a = 1554.3\n", "C_a = 222.65\n", "\n", "A_b = 7.96681\n", "B_b = 1668.21\n", "C_b = 228.0\n", "\n", "p_a = (1./760)*10**(A_a - B_a/(T+C_a))\n", "p_b = (1./760)*10**(A_b - B_b/(T+C_b))\n", "\n", "A = 0.7292\n", "B = 0.4104\n", "\n", "Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n", "Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n", "\n", "\n", "P = (Y_a*p_a*x_a)+(Y_b*p_b*x_b) #[atm]\n", "\n", "y_a = (Y_a*p_a*x_a)/P\n", "y_b = (Y_b*p_b*x_b)/P\n", "\n", "print \" Boiling pressure of the liquid at 85.3 deg C is %0.4f atm\"%(P)\n", "print \" Mole fraction of ethanaol in vapor phase is %0.4f\"%(y_a)\n", "print \" Mole fraction of water in the vapor phase is %0.4f\"%(y_b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Boiling pressure of the liquid at 85.3 deg C is 0.9991 atm\n", " Mole fraction of ethanaol in vapor phase is 0.4741\n", " Mole fraction of water in the vapor phase is 0.5259\n" ] } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.10 Page: 191\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "x_a = 0.2608\n", "x_b = (1-x_a)\n", "P = 1.00 #[atm] Given boiling pressure\n", "\n", "\n", "A_a = 8.04494\n", "B_a = 1554.3\n", "C_a = 222.65\n", "\n", "A_b = 7.96681\n", "B_b = 1668.21\n", "C_b = 228.0\n", "\n", "\n", "A = 0.7292\n", "B = 0.4104\n", "\n", "Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n", "Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n", "\n", "T = 80.\n", "err = 1.\n", "\n", "while err > 10**(-3):\n", " P_a = (10**(8.04494 - 1554.3/(222.65 + T)))/760\n", " P_b = (10**(7.96681 - 1668.21/(228 + T)))/760\n", " y_a = Y_a*P_a*x_a/P\n", " y_b = Y_b*P_b*x_b/P\n", " err = abs((y_a + y_b) - 1)\n", " T = T + 0.01\n", "\n", "print \" Boiling temperature of the liquid at 1 atm pressure is %0.4f atm\"%(T)\n", "print \" Mole fraction of ethanaol in vapor phase is \\t%0.4f\"%(y_a)\n", "print \" Mole fraction of water in the vapor phase is \\t%0.4f\"%(y_b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Boiling temperature of the liquid at 1 atm pressure is 82.0300 atm\n", " Mole fraction of ethanaol in vapor phase is \t0.5680\n", " Mole fraction of water in the vapor phase is \t0.4312\n" ] } ], "prompt_number": 28 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.11 Page: 192\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "y_a = 0.6122\n", "y_b = (1-y_a)\n", "T = 80.7 #[C] Given boiling temperature\n", "\n", "\n", "A_a = 8.04494\n", "B_a = 1554.3\n", "C_a = 222.65\n", "\n", "A_b = 7.96681\n", "B_b = 1668.21\n", "C_b = 228.0\n", "\n", "p_a = (1./760)*10**(A_a - B_a/(T+C_a))\n", "p_b = (1./760)*10**(A_b - B_b/(T+C_b))\n", "\n", "A = 0.7292\n", "B = 0.4104\n", "\n", "\n", "x_a = 0.6122 # Initial assumption of liquid phase composition of ethanol\n", "x_b = 0.3 # Initial assumption of liquid phase composition water\n", "P = 0.80 #[atm]\n", "err = 1\n", "\n", "while err > 2* 10**(-2):\n", " P = P + 0.01\n", " Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n", " Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n", "\n", " err = abs((x_a + x_b) - 1)\n", " x_a = y_a*P/(Y_a*p_a)\n", " x_b = y_b*P/(Y_b*p_b)\n", "\n", "print \" Boiling pressure of the liquid at 80.7 deg C is %0.4f atm\"%(P)\n", "print \" Mole fraction of ethanaol in liquid phase is %0.4f\"%(x_a)\n", "print \" Mole fraction of water in the liquid phase is %0.4f\"%(x_b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Boiling pressure of the liquid at 80.7 deg C is 0.9900 atm\n", " Mole fraction of ethanaol in liquid phase is 0.3730\n", " Mole fraction of water in the liquid phase is 0.6205\n" ] } ], "prompt_number": 29 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.12 Page: 193\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "y_a = 0.1700\n", "y_b = (1-y_a)\n", "P = 1.00 #[atm] Given boiling pressure\n", "\n", "\n", "A_a = 8.04494\n", "B_a = 1554.3\n", "C_a = 222.65\n", "\n", "A_b = 7.96681\n", "B_b = 1668.21\n", "C_b = 228.0\n", "\n", "\n", "A = 0.7292\n", "B = 0.4104\n", "\n", "\n", "\n", "x_a = 0.0100 # Initial assumption of liquid phase composition of ethanol\n", "x_b = 0.9 # Initial assumption of liquid phase composition water\n", "T = 80. #[C] Initial guess of the temperature\n", "err = 1\n", "\n", "while err > 1./16*10**(-2):\n", " P_a = (10**(8.04494 - 1554.3/(222.65 + T)))/760\n", " P_b = (10**(7.96681 - 1668.21/(228 + T)))/760\n", " \n", " Y_a = 10**((B**(2)*A*x_b**(2))/(A*x_a+B*x_b)**(2))\n", " Y_b = 10**((A**(2)*B*x_a**(2))/(A*x_a+B*x_b)**(2))\n", " \n", " x_a = y_a*P/(Y_a*P_a)\n", " x_b = y_b*P/(Y_b*P_b)\n", "\n", " err = abs((x_a + x_b) - 1)\n", " T = T + 0.01\n", "\n", "\n", "print \" Equilibrium Temperature of the system at pressure 1 atm is %0.4f atm\"%(T)\n", "print \" Mole fraction of ethanaol in liquid phase is %0.4f\"%(x_a)\n", "print \" Mole fraction of water in the liquid phase is %0.4f\"%(x_b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Equilibrium Temperature of the system at pressure 1 atm is 95.3500 atm\n", " Mole fraction of ethanaol in liquid phase is 0.0187\n", " Mole fraction of water in the liquid phase is 0.9816\n" ] } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.13 Page: 194\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "x_aF = 0.126\n", "x_bF = (1-x_aF)\n", "P = 1.00 #[atm] Given total pressure\n", "T = 91.8 #[C]\n", "\n", "x_a = 0.0401\n", "x_b = (1 - x_a)\n", "\n", "y_a = 0.2859\n", "y_b = ( 1 - y_a)\n", "\n", "V_by_F = ( x_aF - x_a )/(y_a - x_a)\n", "\n", "print \" Mole fraction of the ethanol in the liquid phase in equilibrium at the given condition is %f\"%(x_a)\n", "print \" Mole fraction of the water in the liquid phase in equilibrium at the given condition is %f\"%(x_b)\n", "print \" Mole fraction of the ethanol in the vapour phase in equilibrium at the given condition is %f\"%(y_a)\n", "print \" Mole fraction of the water in the vapour phase in equilibrium at the given condition is %f\"%(y_b)\n", "print \" Vapor fraction of the given water-ethanol mixture after the flash in equilibrium is %f\"%(V_by_F)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Mole fraction of the ethanol in the liquid phase in equilibrium at the given condition is 0.040100\n", " Mole fraction of the water in the liquid phase in equilibrium at the given condition is 0.959900\n", " Mole fraction of the ethanol in the vapour phase in equilibrium at the given condition is 0.285900\n", " Mole fraction of the water in the vapour phase in equilibrium at the given condition is 0.714100\n", " Vapor fraction of the given water-ethanol mixture after the flash in equilibrium is 0.349471\n" ] } ], "prompt_number": 31 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.14 Page: 198\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "P = 100. #[psia]\n", "x_a = 0.05 # Mole fraction of methane \n", "x_b = 0.40 # Mole fraction of bumath.tane \n", "x_c = 0.55 # mole fraction of penmath.tane\n", "\n", "\n", "T = [[15.8 ,0.087, 0.024],[16,0.105, 0.026],[16.2, 0.115, 0.03],[16.8 ,0.13, 0.035],[17.2 ,0.15, 0.04],[17.8, 0.17, 0.045],[18.2, 0.175, 0.0472727]]\n", "print \" Calculations for the various assumed temperatures are given in the table below\"\n", "print \" Temperature \\t\\t y_a \\t\\t y_b \\t\\t\\t y_c \\t\\t\\t y \"\n", "\n", "T_b = 0 #[F] Bubble point\n", "j=0\n", "for i in range(7):\n", " y_a = x_a*T[i][j]\n", " y_b = x_b*T[i][j+1]\n", " y_c = x_c*T[i][j+2]\n", " y = y_a + y_b + y_c\n", " T_b = T_b + 5\n", " print \" %f \\t\\t %f \\t\\t %f \\t\\t %f \\t\\t %f \"%(T_b,y_a,y_b,y_c,y)\n", "\n", "print \" For the temperature 30 deg F the summation of the mole fractions in the vapor phase is close enough to unity so bubble point is 30 degF\"\n", "print \" And compositions in the vapor phase are the values given in the above table corresonding to the temperature 30 deg F i.e.\"\n", "print \" y_methane = %f y_bumath.tane = %f y_penmath.tane = %f\"%(y_a,y_b,y_c)\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Calculations for the various assumed temperatures are given in the table below\n", " Temperature \t\t y_a \t\t y_b \t\t\t y_c \t\t\t y \n", " 5.000000 \t\t 0.790000 \t\t 0.034800 \t\t 0.013200 \t\t 0.838000 \n", " 10.000000 \t\t 0.800000 \t\t 0.042000 \t\t 0.014300 \t\t 0.856300 \n", " 15.000000 \t\t 0.810000 \t\t 0.046000 \t\t 0.016500 \t\t 0.872500 \n", " 20.000000 \t\t 0.840000 \t\t 0.052000 \t\t 0.019250 \t\t 0.911250 \n", " 25.000000 \t\t 0.860000 \t\t 0.060000 \t\t 0.022000 \t\t 0.942000 \n", " 30.000000 \t\t 0.890000 \t\t 0.068000 \t\t 0.024750 \t\t 0.982750 \n", " 35.000000 \t\t 0.910000 \t\t 0.070000 \t\t 0.026000 \t\t 1.006000 \n", " For the temperature 30 deg F the summation of the mole fractions in the vapor phase is close enough to unity so bubble point is 30 degF\n", " And compositions in the vapor phase are the values given in the above table corresonding to the temperature 30 deg F i.e.\n", " y_methane = 0.910000 y_bumath.tane = 0.070000 y_penmath.tane = 0.026000\n" ] } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.15 Page: 199\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "n_sugar = 1. #[mol]\n", "n_water = 1000/18. #[mol]\n", "x_sugar = n_sugar/(n_sugar+n_water)\n", "x_water = n_water/(n_sugar+n_water)\n", "p_water = 1. #[atm]\n", "p_sugar = 0. #[atm]\n", "\n", "P = x_water*p_water+x_sugar*p_sugar #[atm]\n", "P_1 = 1. #[atm]\n", "p_water = P_1/x_water #[atm]\n", "T = 100.51 #[C]\n", "T_eb = T-100 #[C]\n", "\n", "print \"Vapour pressure of this solution at the 100C is %.3f atm\"%(P)\n", "print \"The temperature at which this solution will boil at 1 atm is %.2f C\"%(T)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Vapour pressure of this solution at the 100C is 0.982 atm\n", "The temperature at which this solution will boil at 1 atm is 100.51 C\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 8.16 Page: 201\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "from scipy.optimize import fsolve \n", "import math \n", "\n", "n_sugar = 1. #[mol]\n", "n_water = 1000/18. #[mol]\n", "x_sugar = n_sugar/(n_sugar+n_water)\n", "x_water = n_water/(n_sugar+n_water)\n", "\n", "\n", "p_sugar = 0\n", "p_ice_by_p_water = x_water\n", "\n", "\n", "def f(T): \n", "\t return 1+0.0096686*T+4.0176*10**(-5)*T**(2)-p_ice_by_p_water\n", "T = fsolve(f,0)\n", "\n", "print \"Freezing-point temperature of the given solution is %f C\"%(T)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Freezing-point temperature of the given solution is -1.842891 C\n" ] } ], "prompt_number": 34 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }