{
 "metadata": {
  "name": "",
  "signature": "sha256:a19443db3b3cc7d7784951a18a27973d385afbd40e88ac5039bbf1ebefefa4a7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16 : Mass Transfer"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.1 page : 276"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "T = 25.+273;                        # Temperature in degK\n",
      "p = 1.;                             # Pressure in atm\n",
      "Va = 18.9;                         # Molecular volume of water vapour in cm**3/gm-mol\n",
      "Vb = 29.9;                         # Molecular volume of air in cm**3/gm-mol  \n",
      "Ma = 18.;                           # Molecular weight of water vapour in gm/mol\n",
      "Mb = 29.;                           # Molecular weight of air in gm/mol\n",
      "\n",
      "# Calculations \n",
      "Dab = 0.0043*(T**1.5)*math.sqrt((1/Ma)+(1/Mb))/(p*(Va**(1./3)+Vb**(1./3))**2);\n",
      "\n",
      "# Results\n",
      "print \"The diffusion coefficient is %.3f cm**3/sec \"%(Dab);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diffusion coefficient is 0.200 cm**3/sec \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.2 page : 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "# Variables\n",
      "T = 25.+273;                        # Temperature in degK\n",
      "p = 1.;                             # Pressure in atm\n",
      "Va = 96.;                           # Molecular volume of benzene in cm**3/gm-mol\n",
      "Vb = 29.9;                         # Molecular volume of air in cm**3/gm-mol \n",
      "Ma = 78.;                           # Molecular weight of benzene in gm/mol\n",
      "Mb = 29.;                           # Molecular weight of air in gm/mol\n",
      "\n",
      "# Calculations \n",
      "Dab = 0.0043*(T**1.5)*math.sqrt((1/Ma)+(1/Mb))/(p*(Va**(1./3)+Vb**(1./3))**2);\n",
      "\n",
      "# Results\n",
      "print \"The diffusion coefficient is %.3f cm**3/sec \"%(Dab);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diffusion coefficient is 0.082 cm**3/sec \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.3 page : 283"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "x = 0.1/12;                            # thickness of still air layer in ft\n",
      "T = 77.+460;                            # temperature in degR\n",
      "p = 1.;                                 # Atmospheric pressure in atm\n",
      "pa1 = 0.3;                             # Pressure of ammonia in still air in atm\n",
      "pb1 = p-pa1;                           # pressure of air in atm\n",
      "pa2 = 0;                               # pressure of ammonia in the absorption plane\n",
      "pb2 = p-pa2;                           # pressure of air in absorption plane\n",
      "\n",
      "# Calculations \n",
      "pbm = (pb2-pb1)/(math.log(pb2/pb1));          # Logarithmic mean pressure\n",
      "D = 0.914;                             # Diffusion coefficient for ammonia\n",
      "R = 0.729;                             # Gas consmath.tant in ft**3-atm/lb-mole-degR\n",
      "N = D*p*(pa1-pa2)/(R*T*x*pbm);\n",
      "\n",
      "# Results\n",
      "print \"The amount of ammonia diffusing through the stagnant air is %.1f lb-mol/hr-ft**2\"%(N);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of ammonia diffusing through the stagnant air is 0.1 lb-mol/hr-ft**2\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.4 page : 287"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "ri = 3./96;                            # Inner radius of pipe in ft\n",
      "ro = 1./24;                            # Outer radius of pipe in ft\n",
      "Ca1 = 0.0003;                         # Concentration at the inner hose of pipe in lb-mol/ft**2\n",
      "Ca2 = 0;                              # Concentration at the outer surface\n",
      "\n",
      "# Calculations \n",
      "D = 0.7*10**-5;                        # Diffusion coefficient of hydrogen in rubber in ft**2/hr\n",
      "N = 2*math.pi*D*(Ca1-Ca2)/math.log(ro/ri);     # Rate of diffusion in lb-mol/hr\n",
      "\n",
      "# Results\n",
      "print \"The rate of diffusion iof hydrogen in rubber is %.2f*10**-8 lb-mole/hr\"%(N*10**8);\n",
      "\n",
      "# note : rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate of diffusion iof hydrogen in rubber is 4.59*10**-8 lb-mole/hr\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.5 page : 296"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "u = 0.0437;                             # Vismath.cosity in lb/hr-ft\n",
      "rho = 0.077;                            # Density in lb-ft**2\n",
      "D = 0.992;                              # Diameter of pipe in ft\n",
      "v = 4.*3600;                             # Velocity in ft/sec\n",
      "L = 6./12;                               # Length of pipe parallel to direction of air flow in ft \n",
      "p = 14.7;                               # Atmospheric pressure in psi \n",
      "T = 460.+65;                             # Temperature in degR\n",
      "\n",
      "# Calculations \n",
      "# Heat transfer equation for laminar flow of a flat surface\n",
      "Nre = L*v*rho/u;                        # Reynolds number\n",
      "Ns = u/(rho*D);                         # Schimdt mumber\n",
      "Nnu = 0.662*(Ns)**(1./3)*math.sqrt(Nre);       # Nusselt number\n",
      "hmc = Nnu*D/L;                          # Heat transfer coefficient\n",
      "pv1 = 0.144;                            # Vapour pressure at 40% humidity\n",
      "pv2 = 0.252;                            # Vapour pressure at saturation\n",
      "pa1 = p-pv1;                            # Absolute pressure of air at 40% rel. humidity in psi\n",
      "pa2 = p-pv2;                            # Absolute pressure of saturated air in psi\n",
      "pbm = (pa1+pa2)/2;                      # Log mean pressure in psi\n",
      "R = 1544.;                               # Universal gas consmath.tant in ft**3-psi/lbmol-degR\n",
      "N = hmc*p*(pa1-pa2)*144/(R*T*pbm);\n",
      "\n",
      "# Results\n",
      "print \"The amount of water evaporated per hour is %.4f lb mol/hr-ft**2\"%(N);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of water evaporated per hour is 0.0024 lb mol/hr-ft**2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.6 page : 297"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "u = 0.047;                              # Vismath.cosity in lb/hr-ft\n",
      "rho = 0.069;                            # Density in lb-ft**2\n",
      "D = 0.992;                              # Diameter of pipe in ft\n",
      "v = 7.5*3600;                           # Velocity in ft/sec\n",
      "L = 2.;                                  # Length of pipe parallel to direction of air flow in ft \n",
      "M = 0.992;                              # Molecular weight\n",
      "p = 14.696;                             # Atmospheric pressure in psi \n",
      "T = 460.+65;                             # Temperature in degR\n",
      "M = 29.;                                 # molecular weight of air\n",
      "M2 = 18.;                                # Molecular weight of water vapour\n",
      "A = 4.;                                  # Area of water surface in ft**2\n",
      "\n",
      "# Calculations \n",
      "# Heat transfer equation for laminar flow of a flat surface\n",
      "Nre = L*v*rho/u;                        # Reynolds number\n",
      "\n",
      "# Assuming the case that of a fluid flowing parallel to a flat plate , jm = 0.0039\n",
      "jm = 0.0039;\n",
      "Ns = u/(rho*D);                         # Schimdt mumber\n",
      "Gm = v*rho/M;                           # Mole flow rate\n",
      "pv1 = 0.672;                            # Vapour pressure at 40% humidity\n",
      "pv2 = 0.600;                            # Vapour pressure at saturation\n",
      "pa1 = p-pv1;                            # Absolute pressure of air at 40% rel. humidity in psi\n",
      "pa2 = p-pv2;                            # Absolute pressure of saturated air in psi\n",
      "pbm = (pa1+pa2)/2;                      # Log mean pressure in psi\n",
      "hmp = jm*Gm/(pbm*144*Ns**(2./3));             # Heat transfer coefficient in lbmol/ft**2-hr-psi\n",
      "N = hmp*(pv1-pv2)*144;                # Mass transfer rate in lb mol/hr-ft**2\n",
      "W = N*A*M2;\n",
      "\n",
      "# Results\n",
      "print \"The amount of water evaporated per hour is %.3f lb mol/hr-ft**2\"%(W);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of water evaporated per hour is 0.119 lb mol/hr-ft**2\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.7 page : 300"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "u = 3.82*10**-7;                          # Vismath.cosity in lb-sec/ft**2\n",
      "rho = 2.3*10**-3;                         # Density in lbsec**2/ft**4\n",
      "A = 1.;                                   # Area in ft**2\n",
      "Cp = 0.24;                               # Specific heat capacity in abtu/lbm-degF\n",
      "v = 4.*3600;                              # Velocity in ft/sec\n",
      "k = 0.015;                               # Thermal conductivity in Btu/hr-ft-degF\n",
      "p = 14.7;                                # Atmospheric pressure in psi \n",
      "M = 29.;                                  # Avg. molecular weight of air\n",
      "T1 = 70.+460;                             # Temperature of still air in degF\n",
      "T2 = 90.+460;                             # temperature of surface of water in degF\n",
      "L = 1.;                                   # For characteristic of 1 ft    \n",
      "D = 0.992;                               # Diffusivity in ft**2/sec \n",
      "      \n",
      "# Calculations                         \n",
      "# Heat transfer equation for laminar flow of a flat surface\n",
      "Ngr = 32.2*L**3*((T2/T1)-1)/(u/rho)**2;    # Grasshops number\n",
      "Npr = u*3600*Cp*32.2/k;                  #  Prandtls number\n",
      "Nnu = 0.75*(Ngr*Npr)**.25;                # Nusselt number\n",
      "h = Nnu*k/L;                             # Heat transfer coefficient\n",
      "Ns = u*3600/(rho*D);                     # Schimdt mumber\n",
      "hmc = h*D*(Ns/Npr)**0.25/k;               # Heat transfer coe\n",
      "pv1 = 0.18;                              # Vapour pressure at 40% humidity\n",
      "pv2 = 0.69;                              # Vapour pressure at saturation\n",
      "pa1 = p-pv1;                             # Absolute pressure of air at 40% rel. humidity in psi\n",
      "pa2 = p-pv2;                             # Absolute pressure of saturated air in psi\n",
      "pbm = (pa1+pa2)/2;                       # Log mean pressure in psi\n",
      "R = 1544;                                # Universal gas consmath.tant in ft**3-psi/lbmol-degR\n",
      "T = (T1+T2)/2;                           # Average temperature in degR\n",
      "N = hmc*p*(pv2-pv1)*144/(R*T*pbm)*18;    # mass transfer rate in lbmol/hr-ft**2\n",
      "\n",
      "# Results\n",
      "print \"The amount of water evaporated per hour is %.4f lb mol/hr-ft**2\"%(N);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of water evaporated per hour is 0.0873 lb mol/hr-ft**2\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.8 page : 303"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Td = 70.+460;                               # Dry bulb temperature in degR\n",
      "Tw = 60.+460;                               # Wet bulb temperature in degR\n",
      "a = 0.26;                                  # Ratio of coefficients ie. h/hmw from table \n",
      "L = 1059.9;                                # Latent heat Btu/lbmol\n",
      "p = 14.7;                                  # Atmospheric pressure in psi\n",
      "pa = 0.259;                                # Partial pressure of water in psi\n",
      "Ma = 18.;                                   # Molecular weight of water vapour \n",
      "Mb = 29.;                                   # Molecular weight of air\n",
      "\n",
      "# Calculations \n",
      "Wwb = pa*Ma/(Mb*(p-pa));                   # Absolte dry bulb humidity of air\n",
      "Wdb = Wwb-(a*(Td-Tw)/L);                   # Absolte dry bulb humidity of air\n",
      "\n",
      "# Results\n",
      "print \"The humidity of air at dry conditions is %.5f lbm/lbm of dry air\"%(Wdb);\n",
      " \n",
      "# rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The humidity of air at dry conditions is 0.00868 lbm/lbm of dry air\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.9 page : 305"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "v = 20.;                                 # Velocity of air ammonia mixture in ft/sec\n",
      "Npr = 0.72;                             # Prandtls number\n",
      "Ns = 0.60;                              # Schimdt number\n",
      "pbm = 14.7;                             # math.log mean pressure in psi\n",
      "Mm = 29.;                                # Molecular weight of mixture\n",
      "Mv = 17.;                                # Molecular weight of ammonia \n",
      "Ma = 29.;                                # Molecular weight of air\n",
      "Cp = 0.24;                              # specific heat capacity in Btu/lbm-degF\n",
      "h = 8.;                                  # Heat transfer coefficient\n",
      "p = 1.;                                  # Atospheric pressure in atm\n",
      "\n",
      "# Calculations \n",
      "hmp = h*Mv*(Npr/Ns)**(2./3)/(Cp*p*Ma);   # Mass transfer coefficient based on pressure\n",
      "\n",
      "# Results\n",
      "print \"The mass transfer coefficient based on pressure is %.1f lbm/hr-ft**2-atm\"%(hmp);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass transfer coefficient based on pressure is 22.1 lbm/hr-ft**2-atm\n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}