{
 "metadata": {
  "name": "ch2",
  "signature": "sha256:63ec039d8e0cb7cbcf7792965630fc54de76590123e48dd89f9e70d5575deae0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : Diffusion"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.1.a "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#  variable declaration    \n",
      "rA=.3798;\n",
      "rB=.3941;\n",
      "\n",
      "# Calculation\n",
      "rAB=(rA+rB)/2;                        #molecular seperation at collision \n",
      "ebyk_A=71.4;\n",
      "ebyk_B=195.2;\n",
      "ebyk_AB=(ebyk_A/ebyk_B)**.5;          #energy of molecular attraction\n",
      "pt=1.013*10**5;                       #absolute total pressure in pascal\n",
      "T=298;                                #absolute temperature in kelvin\n",
      "s=T/ebyk_AB;                          #collision function\n",
      "    #from chart f(T/ebyk_AB) = 0.5   let it be = x\n",
      "x=.5;                                 #collision function\n",
      "MA=28;                                #molecular weight of nitrogen\n",
      "MB=44;                                #molecular weight of carbondioxide\n",
      "Mnew=((1./MA)+(1./MB))**.5;\n",
      "Dab= 10**-4*(1.084-.249*(Mnew))*T**1.5*((Mnew))/(pt*x*rAB**2);\n",
      "\n",
      "# Result\n",
      "print \" the diffisivity of nitrogen-carbondioxide is :%f *10**-5 m**2/s\"%(Dab/10**-5)\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " the diffisivity of nitrogen-carbondioxide is :1.678856 *10**-5 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.1.b "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "#\"part(ii)\"\n",
      "rA=.3339;\n",
      "rB=.3711;\n",
      "\n",
      "# Calculation \n",
      "\n",
      "rAB=(rA+rB)/2;                        #molecular seperation at collision \n",
      "ebyk_A=344.7;\n",
      "ebyk_B=78.6;\n",
      "ebyk_AB=(ebyk_A/ebyk_B)**.5;          #energy of molecular attraction\n",
      "pt=200.*10**3;                        #absolute total pressure in pascal\n",
      "T=298.;                               #absolute temperature in kelvin\n",
      "s=T/ebyk_AB;                          #collision function\n",
      "    #from chart f(T/ebyk_AB) = 0.62   let it be = x\n",
      "x=0.62;                               #collision function\n",
      "MA=36.5;                              #molecular weight of hydrogen chloride\n",
      "MB=29;                                #molecular weight of air\n",
      "Mnew=((1./MA)+(1./MB))**.5;\n",
      "Dab=10.**-4*(1.084-.249*(Mnew))*T**1.5*((Mnew))/(pt*x*rAB**2);\n",
      "\n",
      " # Result\n",
      "print \"\\n the diffisivity of hydrogen chloride-air is :%f *10**-6 m**2/s\"%(Dab/10**-6)\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffisivity of hydrogen chloride-air is :8.488596 *10**-6 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.2 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "#  variable declaration    \n",
      "\n",
      "u=1.145*10**-3;                       #viscosity of water1.145cp\n",
      "v_a=5*.0148+12*.0037+1*.0074;         #by kopp's law\n",
      "t=288;                                #temperature of water in kelvin\n",
      "MB=18;                                #molecular weight of water\n",
      "phi=2.26;                             #association parameter for solvent-water\n",
      "\n",
      "# Calculation\n",
      "D_ab=(117.3*10**-18)*((phi*MB)**.5)*(t)/(u*(v_a)**.6);\n",
      "\n",
      " # Result\n",
      "print \"\\n the diffusivity of isoamyl alcohol is :%f *10**-9 m**2/s\"%(D_ab/10**-9)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffusivity of isoamyl alcohol is :0.652780 *10**-9 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "   \n",
      "\n",
      "pa1=(33./760)*1.013*10**5;              #vapour pressure of ccl4 at 273 in pascal\n",
      "pa2=0;\n",
      "d=1.59;  \n",
      "import math                             #density of liquid ccl4 in g/cm**3\n",
      "#considering o2 to be non diffusing and with \n",
      "T=273.;                                 #temperature in kelvin\n",
      "pt=(755./780)*1.013*10**5;              #total pressure in pascal\n",
      "z=.171;                                 #thickness of film\n",
      "a=.82*10**-4;                           #cross-sectional area of cell in m**2\n",
      "v=.0208;                                #volume of ccl4 evaporated \n",
      "t=10.;                                  #time of evaporation\n",
      "MB=154.;  \n",
      "\n",
      "# Calculation\n",
      "#molecular wght of ccl4\n",
      "rate=v*d/(MB*t);                        #.0208cc of ccl4 is evaporating in 10hrs \n",
      "Na=rate*10.**-3/(3600.*a);              #flux in kmol/m**2*S\n",
      "\n",
      "D_ab=Na*z*8314*273./(pt*(math.log((pt-pa2)/(pt-pa1))));    #molecular diffusivity in m**2/s\n",
      "\n",
      " # Result\n",
      "print \"the  diffusivity of ccl4 through oxygen:%.2f *10**-6 m**2/s\"%(D_ab/10.**-6)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the  diffusivity of ccl4 through oxygen:6.27 *10**-6 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.4 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "     \n",
      "\n",
      "z=.0305*10**-3;                   #wall thickness sorrounding the crystal\n",
      "x1=0.0229;\n",
      "w1=160.;                          #molecular weight of copper sulphate\n",
      "w2=18.;                           #molecular weight of water\n",
      "Dab=7.29*10**-10;                 #diffusivity of copper sulphatein m**2/s\n",
      "    #av=d/m\n",
      "    \n",
      "# Calculation    \n",
      "Mavg=x1*w1+(1-x1)*w2;             #average molecular wght of solution\n",
      "d1=1193;                          #density of copper sulphate solution\n",
      "av1=d1/Mavg;                      #value of (d/m) of copper solution\n",
      "\n",
      "    #for pure water\n",
      "d2=1000.;                         #density of water\n",
      "m2=18.;                           #molecular wght of water\n",
      "av2=d2/m2;                        #value of (d/m) of water\n",
      "allavg=(av1+av2)/2.;              #average value of d/m\n",
      "xa2=0;\n",
      "import math\n",
      "\n",
      "# Result\n",
      "Na=Dab*(allavg)*math.log((1-xa2)/(1-x1))/z;    #flux of cuso4 from crystal surface to bulk solution\n",
      "print \" the rate at which crystal dissolves :%f *10**-5 kmol/m**2*s\"%(Na/10**-5)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " the rate at which crystal dissolves :3.092260 *10**-5 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.5.a"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "  \n",
      "\n",
      "ya1=0.8;\n",
      "ya2=0.1;\n",
      "T=(273+35);                            #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                      #total pressure in pascal\n",
      "z=0.3*10**-3;                          #gas film thickness in m\n",
      "Dab=.18*10**-4;                        #diffusion coefficient in m**2/s\n",
      "R=8314;   #universal gas constant\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*(ya1-ya2)/(z*R*T)       #diffusion flux in kmol/m**2*s\n",
      "rate=Na*100*10**-4*3600*46;       #since molecular weight of mixture is 46\n",
      "\n",
      "# Result\n",
      "print \"\\n rate of diffusion of alcohol-water vapour :%f kg/hr \"%rate\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " rate of diffusion of alcohol-water vapour :2.751429 kg/hr \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.5.b"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "ya1=0.8;\n",
      "ya2=0.1;\n",
      "T=(273+35);                            #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                      #total pressure in pascal\n",
      "z=0.3*10**-3;                          #gas film thickness in m\n",
      "Dab=.18*10**-4;                        #diffusion coefficient in m**2/s\n",
      "R=8314;                                #universal gas constant\n",
      "import math\n",
      "#diffusion through stagnant film \n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);    #diffusion flux in kmol/m**2*s\n",
      "rate=Na*100*10**-4*3600*46;                     #since molecular weight of mixture is 46\n",
      "\n",
      "# Result\n",
      "print \"\\n rate of diffusion if water layer is stagnant :%f *10**-3 kg/s \"%(rate/(3600*10**-3))\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " rate of diffusion if water layer is stagnant :1.642207 *10**-3 kg/s \n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.6 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "T=298.;                       #temperature in kelvin\n",
      "pt=1.*1.013*10**5;            #total pressure in pascal\n",
      "ID=25.*10**-3;                #internal diameter in m of unvulcanised rubber in m\n",
      "OD=50.*10**-3;                #internal diameter in m of unvulcanised rubber in m\n",
      "Ca1=2.37*10**-3;              #conc. of hydrogen at the inner surface of the pipe in kmol/m**3\n",
      "Ca2=0;                        #conc. of hydrogen at 2\n",
      "Dab=1.8*10**-10;              #diffusion coefficient in cm**2/s\n",
      "l=2;                          #length of pipe in m\n",
      "import math\n",
      "\n",
      "# Calculation \n",
      "#    Va=Da*Sa*(pa1-pa2)/z;\n",
      "z=(50-25)*10**-3/2.;                        #wall thickness in m\n",
      "Va=Dab*(Ca1-Ca2)/z;                         #diffusion through a flat slab of thickness z \n",
      "Sa=2*3.14*l*(OD-ID)/(2*math.log(OD/ID));    #average mass transfer area of \n",
      "rate=Va*Sa;                                 #rate of loss of hydrogen by diffusion\n",
      "\n",
      "\n",
      "# Result\n",
      "\n",
      "print \"\\n rate of loss hydrogen by diffusion through a pipe of 2m length :%f*10**-12kmol/s\"%(rate/10.**-12)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " rate of loss hydrogen by diffusion through a pipe of 2m length :7.730099*10**-12kmol/s\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.7 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "   \n",
      "pa1=(1.5)*10**4;                #vapour pressure of ammonia at pt.1 \n",
      "pa2=(0.5)*10**4;                #vapour pressure of ammonia at pt.2\n",
      "Dab=2.3*10**-5                  #molecular diffusivity in m**2/s\n",
      "z=0.15;                         #diffusion path in m\n",
      "R=8314.;                        #universal gas constant    \n",
      "    #ammonia diffuses through nitrogen under equimolar counter diffusion\n",
      "T=298.;                         #temperature in kelvin\n",
      "pt=1.013*10**5;                 #total pressure in pascal\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*(pa1-pa2)/(z*R*T);       #flux in kmol/m**2*S\n",
      "\n",
      "# Result\n",
      "print \"the ammonia diffusion through nitrogen under equimolar \\\n",
      " counter diffusion:%f *10**-7 kmol/m**2*s\"%(Na/10**-7);\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the ammonia diffusion through nitrogen under equimolar  counter diffusion:6.188855 *10**-7 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "  \n",
      "\n",
      "z=0.4*10**-2;            #film thickness sorrounding the crystal\n",
      "xa1=0.0453;              #mole fraction of ethanol at pos.2\n",
      "xa2=0.02775;             #mole fraction of ethanol at pos.1\n",
      "w1=46;                   #molecular weight of ethanol\n",
      "w2=18;                   #molecular weight of water\n",
      "Dab=74*10**-5*10**-4;    #diffusivity of ethanol water sol.in m**2/s\n",
      "    #av=d/m\n",
      "    \n",
      "# Calculation     \n",
      "Mavg1=xa2*w1+(1-xa2)*w2;        #average molecular wght of solution at pos 1\n",
      "d1=0.9881*10**3;                # density of 6.8 wt%  solution\n",
      "av1=d1/Mavg1;                   #value of (d/m) of copper solution\n",
      "\n",
      "    #for pure water\n",
      "d2=972.8;                                   # density of 10.8 wt%  solution\n",
      "Mavg2=xa1*w1+(1-xa1)*w2;                    #average molecular wght of solution at pos.2\n",
      "av2=d2/Mavg2;                               #value of (d/m) of water\n",
      "\n",
      "allavg=(av1+av2)/2;                         #average value of d/m\n",
      "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z;   #steady state flux in kmol/m**2*s of ethanol water sol.\n",
      "\n",
      " # Result\n",
      "print \"\\n the rate at which crystal dissolves :%f *10**-5 kmol/m**2*s\"%(Na/10**-5)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the rate at which crystal dissolves :1.737360 *10**-5 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "#  variable declaration    \n",
      "\n",
      "            #basis : 100kg of mixture\n",
      "z=2*10**-3;                 #film thickness sorrounding the water\n",
      "xa1=0.0323;                 #mole fraction of ethanol at pos.2\n",
      "xa2=0.0124;                 #mole fraction of ethanol at pos.1\n",
      "w1=60.;                     #molecular weight of acetic acid\n",
      "w2=18.;                     #molecular weight of water\n",
      "Dab=0.000095;               #diffusivity of acetic water sol.in m**2/s\n",
      "    #av=d/m\n",
      "# Calculation    \n",
      "Mavg1=xa1*w1+(1-xa1)*w2;    #average molecular wght of solution at pos 1\n",
      "d1=1013.;                   # density of 10 % acid\n",
      "av1=d1/Mavg1;               #value of (d/m) of copper solution\n",
      "\n",
      "    #for pure water\n",
      "d2=1004;                    #density of 4% acid\n",
      "Mavg2=xa2*w1+(1-xa2)*w2;    #average molecular wght of solution at pos.2\n",
      "av2=d2/Mavg2;               #value of (d/m) of water\n",
      "\n",
      "allavg=(av1+av2)/2.;        #average value of d/m\n",
      "        #assuming water to be non diffusing\n",
      "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z;    #diffusion rate of acetic acid aacross film of non diffusing water sol.\n",
      "\n",
      " # Result\n",
      "print \"\\n diffusion rate of acetic acid aacross film of non diffusing water sol. :%f kmol/m**2*s\"%Na\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " diffusion rate of acetic acid aacross film of non diffusing water sol. :0.051508 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.10.a"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      " \n",
      "r=(50./2)*10**-3;       #radius pf circular tube\n",
      "pa1=190;                #vapour pressure of ammonia at pt.1 \n",
      "pa2=95;                 #vapour pressure of ammonia at pt.2\n",
      "Dab=2.1*10**-5          #molecular diffusivity in m**2/s\n",
      "z=1;\n",
      "R=760*22.414/273;       #universal gas constant in mmHg*m**3*K*kmol    \n",
      "    #carbondioxide and oxygen experiences equimolar counter diffusion \n",
      "T=298.;                 #temperature in kelvin\n",
      "\n",
      "# Calculation \n",
      "pt=(10.0/780)*1.013*10**5;      #total pressure in pascal\n",
      "Na=Dab*(pa1-pa2)/(z*R*T);       #flux in kmol/m**2*S\n",
      "rate=Na*(3.14*r**2);            #rate of mass transfer..(3.14*r**2)-is the area\n",
      "\n",
      "# Result\n",
      "print \"\\n the rate of mass transfer.:%f *10**-10 kmol/s\"%(rate/10**-10)\n",
      "  \n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the rate of mass transfer.:2.105552 *10**-10 kmol/s\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.10.b"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "    \n",
      "\n",
      "r=(50./2)*10**-3;          #radius pf circular tube\n",
      "pa1=(190.);                #vapour pressure of ammonia at pt.1 \n",
      "pa2=(95.);                 #vapour pressure of ammonia at pt.2\n",
      "Dab=2.1*10**-5             #molecular diffusivity in m**2/s\n",
      "R=760.*22.414/273;         #universal gas constant in mmHg*m**3*K*kmol    \n",
      "    #carbondioxide and oxygen experiences equimolar counter diffusion \n",
      "T=298.;                           #temperature in kelvin\n",
      "\n",
      "# Calculation\n",
      "pt=(10./780)*1.013*10**5;         #total pressure in pascal\n",
      "\n",
      "    #part (ii)\n",
      "#(ya-ya1)/(ya2-ya1)=(z-z1)/(z2-z1);\n",
      "z2=1;                        #diffusion path in m at pos.2\n",
      "z1=0;                        #diffusion path in m at pos.1\n",
      "z=.75;                       #diffusion at general z\n",
      "#pa=poly([0],'pa');          #calc. of conc. in gas phase\n",
      "x= 118.750000 #roots((pa-pa1)/(pa2-pa1)-(z-z1)/(z2-z1));\n",
      "\n",
      "# Result\n",
      "print \"\\n partial pressure of co2 at o.75m from the end where partial pressure is 190mmhg is:%f mmHg\"%x\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " partial pressure of co2 at o.75m from the end where partial pressure is 190mmhg is:118.750000 mmHg\n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.11.a"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "ya1=0.2;                            #initial mole fraction\n",
      "ya2=0.1;                            #final mole fraction\n",
      "T=298                               #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                   #total pressure in pascal\n",
      "z=0.2*10**-2;                       #gas film thickness in m\n",
      "Dab=.215*10**-4;                    #diffusion coefficient in m**2/s\n",
      "R=8314.;                            #universal gas constant\n",
      "#part (i)when N2 is non diffusing \n",
      "import math\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);    #diffusion flux in kmol/m**2*s\n",
      "\n",
      "\n",
      "# Result\n",
      "print \" diffusion flux if N2 is non diffusing :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " diffusion flux if N2 is non diffusing :5.176955 *10**-5 kmol/m**2*s \n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.11.b"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "ya1=0.2;\n",
      "ya2=0.1;\n",
      "T=(298);                            #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                   #total pressure in pascal\n",
      "z=0.2*10**-2;                       #gas film thickness in m\n",
      "Dab=.215*10**-4;                    #diffusion coefficient in m**2/s\n",
      "R=8314;                             #universal gas constant\n",
      "\n",
      "#part (ii) equimolar counter diffusion\n",
      "# Calculation\n",
      "Na=Dab*pt*(ya1-ya2)/(z*R*T)               #diffusion flux in kmol/m**2*s\n",
      "\n",
      " # Result\n",
      "print \" diffusion  flux of oxygen during equimolar counter-diffusion :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " diffusion  flux of oxygen during equimolar counter-diffusion :4.395331 *10**-5 kmol/m**2*s \n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "ya1=0.1;\n",
      "ya2=0;\n",
      "T=293.                              #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                   #total pressure in pascal\n",
      "z=0.2*10**-2;                       #gas film thickness in m\n",
      "Dab=.185*10**-4;                    #diffusion coefficient in m**2/s\n",
      "R=8314.;                            #universal gas constant\n",
      "    #part (i)when air is assumed to be stagnant and non-diffusing \n",
      "import math\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);    #diffusion flux in kmol/m**2*s\n",
      "mw=17;                                          #molecular weight of ammonia\n",
      "massflux=Na*mw;                                 #mass flux of given NH3\n",
      "print \" diffusion flux when total presssure is 1atm and air \\\n",
      " is non-diffusing :%f *10**-4 kg/m**2*s \"%(massflux/10**-4);\n",
      "    #part (ii) when pressure is increased to 10atm\n",
      "\n",
      "#Dab_1/Dab_2=pt_2/pt_1\n",
      "pt_2=10;                                         #final pressure  in atm\n",
      "pt_1=1;                                          #initially pressure was 1atm\n",
      "Dab_1=.185;                                      #initially diffusion coefficient was.185\n",
      "Dab_2=Dab_1*pt_1/pt_2;                           #for gases Dab is proportional to 1/pt\n",
      "Dab=Dab_2*10**-4;                                #new diffusion coefficient \n",
      "pt=pt_2*1.013*10**5;                             #new total pressure\n",
      "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);     #diffusion flux in kmol/m**2*s\n",
      "\n",
      "# Result\n",
      "print \"diffusion  flux when pressure is increased to 10atm :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
      "print \"so the rate of diffusion remains same on increasing the pressure\"\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " diffusion flux when total presssure is 1atm and air  is non-diffusing :6.889701 *10**-4 kg/m**2*s \n",
        "diffusion  flux when pressure is increased to 10atm :4.052765 *10**-5 kmol/m**2*s \n",
        "so the rate of diffusion remains same on increasing the pressure\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#  variable declaration     \n",
      "T=290.0;                    #temperature in kelvin\n",
      "z=2*10**-3;                 #film thickness sorrounding the water\n",
      "xa2=0.0092;                 #mole fraction of ethanol at pos.2\n",
      "xa1=0.0288;                 #mole fraction of ethanol at pos.1\n",
      "w1=60.0;                    #molecular weight of acetic acid\n",
      "w2=18.0;                    #molecular weight of water\n",
      "Dab=0.95*10**-9;            #diffusivity of acetic water sol.in m**2/s\n",
      "    #av=d/m\n",
      "# Calculation    \n",
      "Mavg1=xa1*w1+(1-xa1)*w2;       #average molecular wght of solution at pos 1\n",
      "d1=1012.0;                     # density of 10 % acid\n",
      "av1=d1/Mavg1;                  #value of (d/m) of copper solution\n",
      "\n",
      "    #for position 2\n",
      "d2=1003.0;                  #density of 4% acid\n",
      "Mavg2=xa2*w1+(1-xa2)*w2;    #average molecular wght of solution at pos.2\n",
      "av2=d2/Mavg2;               #value of (d/m) of water\n",
      "\n",
      "allavg=(av1+av2)/2;         #average value of d/m\n",
      "        \n",
      "        #assuming water to be non diffusing\n",
      "import math        \n",
      "Na=Dab*(allavg)*math.log((1-xa2)/(1-xa1))/z;    #diffusion rate of acetic acid aacross film of non diffusing water sol.\n",
      "\n",
      "# Result\n",
      "print \"diffusion rate of acetic acid aacross film of non diffusing water sol. :%f *10**-7 kmol/m**2*s\"%(Na/10.0**-7)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diffusion rate of acetic acid aacross film of non diffusing water sol. :5.088553 *10**-7 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "ya1=0.2;                          #molefraction at pos.1\n",
      "ya2=0.1;                          #molefraction at pos.2\n",
      "T=(293);                          #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                 #total pressure in pascal\n",
      "z=0.2*10**-2;                     #gas film thickness in m\n",
      "Dab=.206*10**-4;                  #diffusion coefficient in m**2/s\n",
      "R=8314;                           #universal gas constant\n",
      "        #for ideal gases volume fraction =mole fraction\n",
      "#part (i)when N2 is non diffusing \n",
      "import math\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);    #diffusion flux in kmol/m**2*s\n",
      "print \"\\n  diffusion flux if N2 is non diffusing :%f *10**-5 kmol/m**2*s \"%(Na/10**-5);\n",
      "#part (ii) equimolar counter diffusion\n",
      "\n",
      "Na=Dab*pt*(ya1-ya2)/(z*R*T)             #diffusion flux in kmol/m**2*s\n",
      "\n",
      "# Result\n",
      "print \"\\n  diffusion  flux of nitrogen during equimolar counter-diffusion :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "  diffusion flux if N2 is non diffusing :5.044891 *10**-5 kmol/m**2*s \n",
        "\n",
        "  diffusion  flux of nitrogen during equimolar counter-diffusion :4.283207 *10**-5 kmol/m**2*s \n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "pa1=0.2*10**5;            #partial pressure at pos.1\n",
      "pa2=0;                    #partial pressure at pos.2\n",
      "r=10./2;                  #radius of tank in which benzene is stored\n",
      "T=298.;                   #temperature  in kelvin\n",
      "pt=1*1.013*10**5;         #total pressure in pascal\n",
      "z=10*10**-3;              #gas film thickness in m\n",
      "Dab=.02/3600;             #diffusion coefficient in m**2/s\n",
      "R=8314.;                  #universal gas constant\n",
      "                          #benzene is stored in atank of dia 10m\n",
      "#part (i)when air is assumed to be stagnant\n",
      "import math\n",
      "\n",
      "# Calculation\n",
      "Na=Dab*pt*math.log((pt-pa2)/(pt-pa1))/(z*R*T);    #diffusion flux in kmol/m**2*s\n",
      "rate=Na*(3.14*r**2);                              #rate of loss of benzene if air is stagnant\n",
      "\n",
      " # Result\n",
      "print \"diffusion rate of loss of benzene :%f *10**-4 kmol/s \"%(rate/10**-4);\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diffusion rate of loss of benzene :3.921799 *10**-4 kmol/s \n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "ya2=0.1;                             #molefraction at pos.2\n",
      "ya1=0.8;                             #molefraction at pos.1\n",
      "T=(370.);                            #temperature  in kelvin\n",
      "pt=1*1.013*10**5;                    #total pressure in pascal\n",
      "z=0.1*10**-3;                        #gas film thickness in m\n",
      "Dab=.15*10**-2;                      #diffusion coefficient in m**2/s\n",
      "R=8314;                              #universal gas constant\n",
      "Area=10;                             #area of the film is 10m**2\n",
      "\n",
      "#for gase Dab=T**3/2\n",
      "#Dab1/Dab2=(T1/T2)**3/2\n",
      "import math\n",
      "T2=370.;                                        #final temperature in kelvin \n",
      "T1=298.;                                        #initial temperature in kelvin\n",
      "\n",
      "# Calculation\n",
      "Dab1=.15*10**-2;                               #initial diffusion coefficient \n",
      "Dab2=((T2/T1)**(3./2))*Dab1;                   #final diffusion coefficient\n",
      "Na=Dab2*pt*math.log((1-ya2)/(1-ya1))/(z*R*T);  #diffusion flux in kmol/m**2*s\n",
      "rate=Na*3600*46*Area;                          #rate of diffusion of alcohol-water vapour in kg/hour\n",
      "\n",
      " # Result\n",
      "print \" rate of diffusion of alcohol-water vapour  :%f *10**6 kg/hour \"%(rate/10**6)\n",
      "\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " rate of diffusion of alcohol-water vapour  :1.702149 *10**6 kg/hour \n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "ya2=0;                       #molefraction at pos.2\n",
      "ya1=0.1;                     #molefraction at pos.1\n",
      "T=(273);                     #temperature  in kelvin\n",
      "pt=1*1.013*10**5;            #total pressure in pascal\n",
      "z=2*10**-3;                  #gas film thickness in m\n",
      "Dab=.198*10**-4;             #diffusion coefficient in m**2/s\n",
      "R=8314;                      #universal gas constant\n",
      "       \n",
      "#for gase Dab=T**3/2\n",
      "#Dab1/Dab2=(T1/T2)**3/2\n",
      "import math\n",
      "T2=293;                        #final temperature in kelvin \n",
      "T1=273;                        #initial temperature in kelvin\n",
      "\n",
      "\n",
      "# Calculation\n",
      "Dab1=0.198*10**-4;               #initial diffusion coefficient \n",
      "Dab2=((T2/T1)**(3.0/2))*Dab1;    #final diffusion coefficient\n",
      "Na=Dab2*pt*math.log((1-ya2)/(1-ya1))/(z*R*T2);    #diffusion flux in kmol/m**2*s\n",
      "print \"  flux of diffusion of ammonia through inert film :%f *10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
      "\n",
      "#if pressure is also incresed from 1 to 5 atm\n",
      "#for gases Dab=(T**3/2)/pt;\n",
      "#Dab1/Dab2=(T1/T2)**3/2*(p2/p1)\n",
      "T2=293.;                    #final temperature in kelvin \n",
      "T1=273.;                    #initial temperature in kelvin\n",
      "pa2=5.;                     #final pressure in atm\n",
      "pa1=1;                      #initial pressure in atm \n",
      "p=pa2*1.013*10**5;\n",
      "Dab1=.198*10**-4;                              #initial diffusion coefficient\n",
      "Dab2=((T2/T1)**(3.0/2))*Dab1*(pa1/pa2);        #final diffusion coefficient\n",
      "Na=Dab2*p*math.log((1-ya2)/(1-ya1))/(z*R*T2);  #diffusion flux in kmol/m**2*s\n",
      "\n",
      " # Result\n",
      "print \"flux of diffusion of ammonia if temp. is 20 and pressure is 5 atm  :%f*10**-5 kmol/m**2*s \"%(Na/10**-5)\n",
      "print \"so there is no change in flux when pressure is changed\"\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "  flux of diffusion of ammonia through inert film :4.337554 *10**-5 kmol/m**2*s \n",
        "flux of diffusion of ammonia if temp. is 20 and pressure is 5 atm  :4.822834*10**-5 kmol/m**2*s \n",
        "so there is no change in flux when pressure is changed\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#  variable declaration  \n",
      "pa1=0.418*10**5;              #partial pressure initially\n",
      "pa2=0;                        #partial pressure of pure air\n",
      "r=10/2;                       #radius of tank in which benzene is stored\n",
      "T=(350);                      #temperature  in kelvin\n",
      "pt=1*1.013*10**5;             #total pressure in pascal\n",
      "z=2*10**-3;                   #gas film thickness in m\n",
      "Dab=.2*10**-4;                #diffusion coefficient in m**2/s\n",
      "R=8314;                       #universal gas constant\n",
      "r=0.2/2;                      #radius of open bowl is 0.2\n",
      "#when air layer is assumed to be stagnant of thickness 2mm\n",
      "import math\n",
      "\n",
      "# Calculation\n",
      "\n",
      "Na=Dab*pt*math.log((pt-pa2)/(pt-pa1))/(z*R*T); #diffusion flux in kmol/m**2*s\n",
      "rate=Na*(3.14*r**2)*18;  #rate of loss of evaporation\n",
      "\n",
      "# Result\n",
      "print \"\\n diffusion rate loss of evaporation :%f *10**-4 kg/s \"%(rate/10**-4)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " diffusion rate loss of evaporation :1.046972 *10**-4 kg/s \n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example  2.19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#  variable declaration  \n",
      "\n",
      "#stefan tube experiment\n",
      "import math\n",
      "Ml=92.;                        #molecular weight of toluene\n",
      "T=(312.4);                     #temperature  in kelvin\n",
      "pt=1*1.013*10**5;              #total pressure in pascal\n",
      "R=8314.;                       #universal gas constant\n",
      "t=275.*3600;                   #after 275 hours the level dropped to 80mm from the top\n",
      "zo=20.*10**-3;                 #intially liquid toluene is at 20mm from top\n",
      "zt=80.*10**-3;                 #finally liquid toluene is at 80mm from top\n",
      "#air is assumed to be satgnant \n",
      "d=850.;                     #density in kg/m**3\n",
      "pa=7.64*10**3;              #vapour pressure of toluene in at 39.4degree celcius \n",
      "\n",
      "# Calculation   \n",
      "cal=d/Ml;                  #conc. at length at disxtance l\n",
      "ca=pt/(R*T);               #total conc. \n",
      "xa1=pa/pt;                 #mole fraction of toluene at pt1 i.e before evaporation \n",
      "xb1=1-xa1;                 #mole fraction of air before evaporation i.e at pt1 \n",
      "xb2=1.;                    #mole fraction of air after evaporation i.e at pt.2\n",
      "xa2=0.;                    #mole fraction of toluene at point 2\n",
      "xbm=(xb2-xb1)/(math.log(xb2/xb1));\n",
      "#t/(zt-zt0) = (xbm*cal*(zt+zo))/(2*c*(xa1-xa2)*t);\n",
      "Dab=(xbm*cal*(zt**2-zo**2))/(2*ca*t*(xa1-xa2));\n",
      "\n",
      "# Result\n",
      "print \"\\n the diffusivity of the mixture in stefan tube of toluene in air is :%f*10**-5 m**2/s\"%(Dab/10**-5)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffusivity of the mixture in stefan tube of toluene in air is :0.915437*10**-5 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.20 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#  variable declaration  \n",
      "\n",
      "T=(360);                            #temperature  in kelvin\n",
      "pt=372.4/760;                       #total pressure in atm\n",
      "R=82.06;                            #universal gas constant\n",
      "Dab=0.0506;                         #diffusion coefficient in cm**2/s \n",
      "z=0.254;                            #gas layer thickness in cm\n",
      "vp=368.0/760;                       #vapour pressure of toluene in atm\n",
      "xtol=.3;                            #mole fractoin of toluene in atm\n",
      "pb1=xtol*vp;                        #partial pressure of toluene\n",
      "#since pb1 is .045263 bt in book it is rounded to 0.145\n",
      "\n",
      "# Calculation   \n",
      "pb2=xtol*pt;                  #parial pressure of toluene in vapour phase\n",
      "Na=Dab*(pb1-pb2)/(z*R*T);     #diffusion flux \n",
      "\n",
      "# Result\n",
      "print \"\\n the diffusion flux of a mixture of benzene and toluene %f*10**-8 gmol/cm**2*s\\n\"%(Na/10**-8)\n",
      "print \"\\nthe negative sign indicates that toluene is getting transferred from gas phase \\\n",
      "to liquid phase(hence the transfer of benzene is from liquid to gas phase)\"\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffusion flux of a mixture of benzene and toluene -1.171233*10**-8 gmol/cm**2*s\n",
        "\n",
        "\n",
        "the negative sign indicates that toluene is getting transferred from gas phase to liquid phase(hence the transfer of benzene is from liquid to gas phase)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#  variable declaration  \n",
      "\n",
      "Ml=92.;                     #molecular weight of toluene\n",
      "T=(303.);                   #temperature  in kelvin\n",
      "pt=1.*1.013*10**5;          #total pressure in pascal\n",
      "R=8314.;                    #universal gas constant\n",
      "t=275.*3600;                #after 275 hours the level dropped to 80mm from the top\n",
      "zo=20.*10**-3;              #intially liquid toluene is at 20mm from top\n",
      "zt=77.5*10**-3;             #finally liquid toluene is at 80mm from top\n",
      "    #air is assumed to be satgnant \n",
      "import math\n",
      "# Calculation   \n",
      "d=820.;                         #density in kg/m**3\n",
      "pa=(57.0/760)*1.0135*10**5;     #vapour pressure of toluene in at 39.4degree celcius \n",
      "cal=d/Ml;                       #conc. at length at disxtance l\n",
      "ca=pt/(R*T);                    #total conc. \n",
      "xa1=pa/pt;                      #mole fraction of toluene at pt1 i.e before evaporation \n",
      "xb1=1.-xa1;                     #mole fraction of air before evaporation i.e at pt1 \n",
      "xb2=1.;                         #mole fraction of air after evaporation i.e at pt.2\n",
      "xa2=0;                          #mole fraction of toluene at point 2\n",
      "xbm=(xb2-xb1)/(math.log(xb2/xb1));\n",
      "#t/(zt-zt0) = (xbm*cal*(zt+zo))/(2*c*(xa1-xa2)*t);\n",
      "Dab=(xbm*cal*(zt**2-zo**2))/(2*ca*t*(xa1-xa2));\n",
      "\n",
      "# Result\n",
      "print \"\\n the diffusivity of the mixture in stefan tube of toluene in air is :%f*10**-5 m**2/s\"%(Dab/10**-5)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffusivity of the mixture in stefan tube of toluene in air is :0.804587*10**-5 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 57
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#variation in liquid level with respect to time is given below\n",
      "%matplotlib inline\n",
      "t=[26,185,456,1336,1958,2810,3829,4822,6385]\n",
      "# let Zt-Zo= x;\n",
      "x=[.25,1.29,2.32,4.39,5.47,6.70,7.38,9.03,10.48]\n",
      "i=0;    \n",
      "y = [0,0,0,0,0,0,0,0,0]            #looping starts\n",
      "\n",
      "# Calculation   \n",
      "while(i<9):\n",
      "    y[i]=t[i]/x[i];                #for calculating the t/Zt-Zo value\n",
      "    i=i+1;\n",
      "from matplotlib.pyplot import *\n",
      "plot(x,y,\"o-\");\n",
      "show()\n",
      "#xtitle(\" Fig.2.2 Example 22 \",\"X--(zi-zo),cm  --->\",\"Y-- vs (t/(zi-zo))min/cm ---->\");\n",
      "slope=51.4385*60 *10**4;             #slope of the curve in 1/sec*m**2\n",
      "#slope = Cal *(xblm)/(2*Dab*C*(xa1-xa2))\n",
      "d=1540.;                       #density in kg/m**3\n",
      "Ml=154.;                       #molecular weight of toluene\n",
      "Cal=d/Ml ;                     #conc. at length at disxtance l in mol/m**3\n",
      "\n",
      "T=(321.);                      #temperature  in kelvin\n",
      "pt=1.;                         #total pressure in atm\n",
      "R=82.06;                       #universal gas constant\n",
      "C=pt/(R*T) *10**3;             #total conc. in kg mol/m**3\n",
      "\n",
      "pa=(282./760);             #vapour pressure of toluene \n",
      "xa1=pa/pt;                 #mole fraction of toluene at pt1 i.e before evaporation\n",
      "xb1=1.-xa1;                #mole fraction of air before evaporation i.e at pt1 \n",
      "xb2=1.;                    #mole fraction of air after evaporation i.e at pt.2\n",
      "xa2=0.;                    #mole fraction of toluene at point 2\n",
      "xblm=(xb2-xb1)/(math.log(xb2/xb1));         #log mean temp. difference\n",
      "Dab = Cal *(xblm)/(2*slope*C*(xa1-xa2));    #diffusivity coefficient\n",
      "\n",
      "# Result\n",
      "print \"\\n the diffusivity of the mixture by winklemann method  of toluene in air is :%f*10**-6 m**2/s\"%(Dab/10**-6)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n",
        "For more information, type 'help(pylab)'.\n"
       ]
      },
      {
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD9CAYAAAC2l2x5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X90VPWd//HnmERSRYFVMsEEOm5CDAMiKL9qLY1CgoWa\ng5WNxoopoN3KimD1Cyq1ghUyLN1jCUq31aCxug24dkkwGCLigIgakV8uYQ3QIPndCgRBDDHJ/f5x\ny0ggkAQmuTN3Xo9zcohzc2fe16Mv3vncz/18HIZhGIiIiO1cZHUBIiLSORTwIiI2pYAXEbEpBbyI\niE0p4EVEbEoBLyJiU20G/GeffcbQoUN9Xz169CArK4tDhw6RnJxMQkIC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kyBIDu3bszYMAAqqqqLK7K\nfyoqKlizZg333Xef7W6UHzlyhPfee4+pU6cCEB4eTo8ePSyuyn8uv/xyIiIiOH78OI2NjRw/frzV\nCRDBpCPP6ASj1q4vOTmZiy4yY3vkyJFUVFSc8z26NOArKyvpe8pi7e2dJx+M9u/fz7Zt2xg5cqTV\npfjNww8/zOLFi33/gdlJWVkZvXv3ZsqUKVx//fXcf//9HD9+3Oqy/Oaf/umfeOSRR+jXrx9XXXUV\nPXv2ZOzYsVaX5Xdne0bHjpYvX8748ePP+TNd+n+qHX+tb82xY8eYNGkSS5YsoXv37laX4xdvvvkm\nUVFRDB061HbdO0BjYyNbt25l+vTpbN26lUsvvTSof70/3b59+/jd737H/v37qaqq4tixY7z22mtW\nl9WpHA6HbTNnwYIFXHzxxdx9993n/LkuDfjT58mXl5e3ePLVDr755hvuuOMO7rnnHt/0UTvYvHkz\n+fn5XH311aSnp7N+/Xruvfdeq8vym9jYWGJjYxk+fDgAkyZNYuvWrRZX5T9btmzhxhtv5IorriA8\nPJyf/OQnbN682eqy/O7kMzpAi2d07OTll19mzZo17foLuksDftiwYezZs4f9+/fT0NDAihUrSE1N\n7coSOpVhGEybNg23282sWbOsLsevFi5cSHl5OWVlZeTm5nLLLbfwyiuvWF2W30RHR9O3b19KS0sB\nWLduHQMHDrS4Kv9JTEzkww8/5Ouvv8YwDNatW4c72Fbxa4ezPaNjF4WFhSxevJi8vDwiIyPbPqEz\np/m0Zs2aNUZCQoIRFxdnLFy4sKs/vlO99957hsPhMK677jpjyJAhxpAhQ4y33nrL6rL8zuv1Grfd\ndpvVZfjd9u3bjWHDhrV7ClqwWbRokW+a5L333ms0NDRYXdIFueuuu4w+ffoYERERRmxsrLF8+XLj\n4MGDxpgxY2wxTfL068vOzjbi4+ONfv36+fLlgQceOOd7OAzDhgOqIiISHFv2iYhIxyngRURsSgEv\nImJTCngREZtSwIuI2JQCXkTEpv4/Y/eFADqmRiMAAAAASUVORK5CYII=\n"
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the diffusivity of the mixture by winklemann method  of toluene in air is :9.202857*10**-6 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "d=0.001;\n",
      "area=3.14*(d/2)**2;     #area of the bulb\n",
      "T=298.;                  #temperature in kelvin \n",
      "p=1.013*10**5;          #total pressure of both the bulbs\n",
      "R=8314.;               #universal gas constant\n",
      "\n",
      "# Calculation   \n",
      "c=p/(R*T);            #total concentration\n",
      "Dab=.784*10**-4;      #diffusion coefficient in m**2/s\n",
      "xa1=0.8;             #molefraction of nitrogen gas at the 1 end\n",
      "xa2=0.25;            #molefraction of nitrogen gas at the 2nd end\n",
      "z=.15;               #distance between the bulbs\n",
      "\n",
      "    #rate=area*Na;\n",
      "rate=area*Dab*c*(xa1-xa2)/z;    #rate of transfer of hydrogen and hydrogen\n",
      "\n",
      "# Result\n",
      "print \"\\n the rate of transfer from 1 to 2 of  nitrogen and 2 to 1of hydrogen is :%f *10**-11kmol/s\"%(rate/10.0**-11)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the rate of transfer from 1 to 2 of  nitrogen and 2 to 1of hydrogen is :0.922657 *10**-11kmol/s\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "T=288;                          #temperature in kelvin\n",
      "Mb=32;                          #molecular weight of methanol\n",
      "phi=1.9;                        #association factor for solvent\n",
      "\n",
      "# Calculation   \n",
      "va=(14.8+(4*24.6))*10**-3        #solute(CCl4) volume at normal BP in m**3/kmol\n",
      "u=.6*10**-3;                     #viscosity of solution in kg/m*s\n",
      "Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6);    #diffusion coefficient in m**2/s\n",
      "\n",
      "# Result\n",
      "print \"\\ndiffusivity of methanol in carbon tetrachloride is :%f*10**-9 m**2/s\"%(Dab/10.0**-9)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "diffusivity of methanol in carbon tetrachloride is :1.622494*10**-9 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "T=288.0;                          #temperature in kelvin\n",
      "Mb=18.0;                          #molecular weight of methanol\n",
      "phi=2.26;                        #association factor for solvent\n",
      "\n",
      "# Calculation   \n",
      "va=(2*14.8+(6*3.7)+7.4)*10**-3    #solute(water) volume at normal BP in m**3/kmol\n",
      "u=1*10**-3;                     #viscosity of solution in kg/m*s\n",
      "Dab=(117.3*10**-18)*(phi*Mb)**0.5*T/(u*va**0.6);    #diffusion coefficient in m**2/s\n",
      "\n",
      "# Result\n",
      "print \"\\ndiffusivity of methanol in water is :%f*10**-9 m**2/s\"%(Dab/10**-9)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "diffusivity of methanol in water is :1.174865*10**-9 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "  \n",
      "u=20.*10**-6;                        #viscosity in Ns/m**2\n",
      "pt=2666.;                          #total pressure in N/m**2\n",
      "pa1=pt;                            #pressure at 1\n",
      "pa2=0;                             #pressure at 2\n",
      "mw=32.;                            #molecular weight of oxygen\n",
      "R=8314.;                           #universal law constant\n",
      "T=373.;                            #temp. in kelvin\n",
      "gc=1.;                   \n",
      "\n",
      "# Calculation   \n",
      "l=(3.2*u/pt)*((R*T)/(2*3.14*gc*mw))**0.5;#mean free path\n",
      "d=.2*10**-6;                        #pore diameter\n",
      "s=d/l;                             #value of dia/l\n",
      "        #hence knudsen diffusion occurs\n",
      "Na=0.093*20*273/(760*373*22414*10**-1);         #diffusion coefficient in kmol/m**2*s\n",
      "Dka=(d/3)*((8*gc*R*T)/(3.14*mw))**0.5;\n",
      "l1=Dka*(pa1-pa2)/(R*T*Na);                #length of the plate\n",
      "\n",
      "# Result\n",
      "print \"\\n the length of the plate is :%f m \"%l1\n",
      "\n",
      "\n",
      "        #for diffusion with hydrogen\n",
      "u=8.5*10**-6;                        #viscosity in Ns/m**2\n",
      "pt=1333;                          #total pressure in N/m**2\n",
      "pa1=pt;                            #pressure at 1\n",
      "pa2=0;                             #pressure at 2\n",
      "mw=2;                            #molecular weight of oxygen\n",
      "R=8314;                           #universal law constant\n",
      "T=298;                            #temp. in kelvin\n",
      "gc=1;                        \n",
      "l=(3.2*u/pt)*((R*T)/(2*3.14*gc*mw))**0.5;#mean free path\n",
      "d=.2*10**-6;                        #pore diameter\n",
      "s=d/l;                             #value of dia/l\n",
      "        #hence knudsen diffusion occurs\n",
      "Dka=(d/3)*((8*gc*R*T)/(3.14*mw))**0.5;\n",
      "Na=Dka*(pa1-pa2)/(R*T*l1);                #diffusion coefficient in kmol/m**2*s\n",
      "print \"\\n the diffusion coefficient is :%f *10**-4 kmol/m**2*s\"%(Na/10.0**-6)\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " the length of the plate is :0.035635 m \n",
        "\n",
        " the diffusion coefficient is :1.788175 *10**-4 kmol/m**2*s\n"
       ]
      }
     ],
     "prompt_number": 61
    }
   ],
   "metadata": {}
  }
 ]
}