{ "metadata": { "name": "", "signature": "sha256:6d9acec694eaa6247956671e6c927c80e0d17b9873ff1364d6a6878fb63313c8" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 14 : Equilibrium With Gravity Or Centrifugal Force Osmotic Equilibrium Equilibrium With Surface Tension" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.1 Page: 379\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "T = 300. #[K] Temperature of the natural gas well\n", "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n", "z_1 = 0 #[m]\n", "y_methane_surf = 85./100 #[mol%]\n", "y_ethane_surf = 10/100. #[mol%]\n", "y_propane_surf = 5/100. #[mol%]\n", "P = 2. #[MPa] Total equilibrium pressure \n", "z_2 = 1000. #[m] Depth of the well \n", "\n", "M_methane = 16./1000 #[kg/mol]\n", "M_ethane = 30./1000 #[kg/mol]\n", "M_propane = 44./1000 #[kg/mol]\n", "\n", "g = 9.81 #[m/s**(2)]\n", "\n", "f_methane_1 = y_methane_surf*P #[MPa]\n", "f_ethane_1 = y_ethane_surf*P #[MPa]\n", "f_propane_1 = y_propane_surf*P #[MPa]\n", "\n", "f_methane_2 = f_methane_1*math.exp((-M_methane*g*(z_1-z_2))/(R*T)) #[MPa]\n", "f_ethane_2 = f_ethane_1*math.exp((-M_ethane*g*(z_1-z_2))/(R*T)) #[MPa]\n", "f_propane_2 = f_propane_1*math.exp((-M_propane*g*(z_1-z_2))/(R*T)) #[MPa]\n", "\n", "P_2 = (f_methane_2 + f_ethane_2 + f_propane_2 ) #[MPa]\n", "\n", "y_methane_2 = f_methane_2/P_2\n", "y_ethane_2 = f_ethane_2/P_2\n", "y_propane_2 = f_propane_2/P_2\n", "\n", "print \"The mol fraction of the methane at the depth 1000m is %f\"%(y_methane_2)\n", "print \"The mol fraction of the ethane at the depth 1000m is %f\"%(y_ethane_2)\n", "print \"The mol fraction of the propane at the depth 1000m is %f\"%(y_propane_2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mol fraction of the methane at the depth 1000m is 0.840351\n", "The mol fraction of the ethane at the depth 1000m is 0.104461\n", "The mol fraction of the propane at the depth 1000m is 0.055187\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.2 Page: 380\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "T = 288. #[K] Atmospheric temperature \n", "R = 8.314 #[J/(mol*K)] universal gas consmath.tant\n", "z_2 = 15000. #[m] Thickness of the atmosphere\n", "z_1 = 0. #[m] Surface\n", "y_N2_1 = 0.79\n", "y_O2_1 = 0.21\n", "M_N2 = 28./1000 #[kg/mol]\n", "M_O2 = 32./1000 #[kg/mol]\n", "\n", "g = 9.81 #[m/s**(2)]\n", "\n", "a = math.exp(-(M_N2-M_O2)*g*(z_2-z_1)/(R*T))\n", "yi2_by_yi1 = 1/(y_N2_1 + y_O2_1/a)\n", "\n", "print \" Concentration of the nitrogen at the top of atmosphere with respect to the concentration of nitrogen \\\n", " at the surface of the earth is yi2_by_yi1 = %0.2f\"%(yi2_by_yi1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Concentration of the nitrogen at the top of atmosphere with respect to the concentration of nitrogen at the surface of the earth is yi2_by_yi1 = 1.05\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.3 Page: 381\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "T = 288. #[K] Atmospheric temperature \n", "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n", "z_2 = 10. #[m] Height of the reactor\n", "z_1 = 0. #[m] Surface\n", "g = 9.81 #[m/s**(2)] Accelaration due to gravity\n", "\n", "y_N2_1 = 0.79\n", "y_O2_1 = 0.21\n", "M_N2 = 28./1000 #[kg/mol]\n", "M_O2 = 32./1000 #[kg/mol]\n", "\n", "a = math.exp(-(M_N2-M_O2)*g*(z_2-z_1)/(R*T))\n", "yi2_by_yi1 = 1/(y_N2_1 + y_O2_1/a)\n", "\n", "print \" Concentration of the nitrogen at the top of reactor with respect to the concentration of nitrogen \\\n", " at the bottom of reactor is yi2_by_yi1 = %f\"%(yi2_by_yi1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Concentration of the nitrogen at the top of reactor with respect to the concentration of nitrogen at the bottom of reactor is yi2_by_yi1 = 1.000034\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.4 Page: 382\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "T = 300. #[K] Temperature of the centrifuge\n", "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n", "y_UF6_238_1 = 0.993 # Mole fraction of UF6 with 238 isotope of uranium in feed\n", "y_UF6_235_1 = 0.007 # Mole fraction of UF6 with 235 isotope of uranium in feed\n", "M_UF6_238 = 352./1000 #[kg/mol] Molecular weight of UF6 with 238 isotope of uranium\n", "M_UF6_235 = 349./1000 #[kg/mol] Molecular weight of UF6 with 235 isotope of uranium\n", "r_in = 2./100 #[m] Interanal raddi of the centrifuge\n", "r_out = 10./100 #[m] outer raddi of the centrifuge\n", "f = 800. #[revolution/second] Rotational frequency of centrifuge\n", "\n", "a = math.exp((M_UF6_235-M_UF6_238)*(2*3.141592*f)**(2)*(r_out**(2)-r_in**(2))/(2*R*T))\n", "\n", "A = 1./(y_UF6_235_1 + y_UF6_238_1/a)\n", "\n", "B = 1./A\n", "\n", "print \"The ratio of the mole fraction of UF6 with uranium 235 isotope) at the 2 cm radius to\\\n", " that at the 10 cm radius is %0.3f\"%(B)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The ratio of the mole fraction of UF6 with uranium 235 isotope) at the 2 cm radius to that at the 10 cm radius is 1.156\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.5 Page: 384\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "x_water_1 = 0.98 # mole fraction of water in phase 1 i.e. in seawater\n", "x_water_2 = 1. # mole fraction of water in the phase 2 i.e. in water \n", "R = 10.73 #[(psi*ft**(3))/(lbmol*R)] Universal gas consmath.tant\n", "T = 500. #[R] temperature\n", "v_water_1 = 18/62.4 # [ft**(3)/(lbmol)]\n", "\n", "\n", "\n", "\n", "\n", "delta_P = (-(R*T)*math.log(x_water_1))/v_water_1#[psi]\n", "\n", "print \"The pressure difference between the two phases is %0.1f psi\"%(delta_P)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The pressure difference between the two phases is 375.7 psi\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.6 Page: 386\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "T = 100. #[C] Temperature of the outside\n", "P_outside = 1. #[atm]\n", "T = 0.05892 #[N/m] From metric steam table (7, page 267)\n", "\n", "\n", "d_1 = 0.001 #[m]\n", "\n", "delta_P_1 = (4*T)/d_1 #[Pa]\n", "\n", "d_2 = 10**(-6) #[m]\n", "\n", "delta_P_2 = (4*T)/d_2 #[Pa]\n", "\n", "d_3 = 0.01*10**(-6) #[m]\n", "delta_P_3 = (4*T)/d_3 #[Pa]\n", "\n", "print \"Pressure difference with the change in radius of the drop of the water is given as in the following table\"\n", "print \" Diameter of the droplet d_iin meter Pressure difference P_inside - P_outside in atm\"\n", "print \" %0.2e %0.2e\"%(d_1,delta_P_1) \n", "print \" %0.2e %0.2e\"%(d_2,delta_P_2) \n", "print \" %0.2e %0.2e\"%(d_3,delta_P_3) \n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Pressure difference with the change in radius of the drop of the water is given as in the following table\n", " Diameter of the droplet d_iin meter Pressure difference P_inside - P_outside in atm\n", " 1.00e-03 2.36e+02\n", " 1.00e-06 2.36e+05\n", " 1.00e-08 2.36e+07\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.7 Page: 387\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "import math \n", "\n", "P_NBP = 1. #[atm]\n", "Temp =273.15+100 #[C] Temperature\n", "D = 0.01*10**(-6) #[m] Diameter of the condensation nuclei( due to impurity )\n", "T = 0.05892 #[N/m] Surface tension between water drops and gas\n", "R = 8.314 #[J/(mol*K)]\n", "\n", "\n", "v_water_liquid = 1/958.39*0.018 #[m**(3)/mol]\n", "\n", "\n", "\n", "I = math.exp(v_water_liquid*(4*T/D)/(R*Temp))\n", "\n", "P_gas_minus_P_NBP = (I-1)*P_NBP #[atm]\n", "delta_P = P_gas_minus_P_NBP*1.01325 #[bar]\n", "\n", "delta_P_1 = delta_P*100*0.1450377 #[psi]\n", "\n", "print \"The equilibrium pressure at which the steam begin to condence at this temperature on \\\n", " the nuclei is %f psi above the normal boiling point.\"%(delta_P_1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The equilibrium pressure at which the steam begin to condence at this temperature on the nuclei is 2.253760 psi above the normal boiling point.\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.8 Page: 388\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "from scipy.integrate import quad \n", "\n", "Temp = 273.15+100 #[K] Temperature of the water drop\n", "R = 8.314 #[J/(mol*K)] Universal gas consmath.tant\n", "D = 0.01*10**(-6) #[m] Diameter of the water drop\n", "P_g = 0.15 #[bar] guage pressure\n", "T = 0.05892 #[N/m] Surface tension between water drop and gas\n", "\n", "\n", "v_water_liquid = 0.018/958.39 #[m**(3)/mol]\n", "P_NBP = 1.013 #[bar]\n", "P_gas = 1.013+0.15 #[bar]\n", "\n", "P_1 = P_gas + 4*T/D #[bar]\n", "\n", "def f2(P): \n", "\t return v_water_liquid*P**(0)\n", "\n", "delta_g_1 = quad(f2,P_NBP,P_1)[0]\n", "\n", "\n", "\n", "def f3(P): \n", "\t return (R*Temp)/P\n", "\n", "delta_g_2 = quad(f3,P_NBP,P_gas)[0]\n", "\n", "\n", "delta_g = (delta_g_1 - delta_g_2) \n", "\n", "\n", "print \"The liquid can lower its free energy %0.2f J/mol by Changing to gas,\"%(delta_g)\n", "print \"So that even at 0.15 bar above the normal boiling point, a drop of this small size is unstable and will quickly evaporate.\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The liquid can lower its free energy 14.25 J/mol by Changing to gas,\n", "So that even at 0.15 bar above the normal boiling point, a drop of this small size is unstable and will quickly evaporate.\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ " Example 14.9 Page: 390\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "from scipy.optimize import fsolve \n", "import math \n", "\n", "Temp = 904.7 #[R] Temperature of the pure liquid water \n", "P_NBP = 400. #[psia] Saturation pressure of the pure liquid water at the given temperature\n", "T = 1.76*10**(-4) #[lbf/inch] Surface tension of water\n", "R = 10.73 #[(psi*ft**(3))/(lbmol*R)]\n", "\n", "v_water_liquid = 18*0.01934 #[ft**(3)/lbmol]\n", "D = 10**(-5.) #[inch]\n", "\n", "\n", "def f(p): \n", "\t return v_water_liquid*(p - P_NBP)-(R*Temp)*math.log((p+4*T/D)/P_NBP)\n", "P_liquid = fsolve(f,300)\n", "\n", "P_inside = P_liquid + 4*T/D #[psia]\n", "\n", "print \"The liquid pressure at which these boiling nuclei will begin to grow and intiate boiling is %0.1f psia\"%(P_liquid)\n", "print \"At this external pressure the pressure inside the bubble is %0.1f psia\"%(P_inside)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The liquid pressure at which these boiling nuclei will begin to grow and intiate boiling is 328.6 psia\n", "At this external pressure the pressure inside the bubble is 399.0 psia\n" ] } ], "prompt_number": 17 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }