{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 6 : Boiling and condensation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.1 Page No : 177"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "So a bubble nucleus that has been detached from a cavity will not collapse in the liquid if it is larger than 1.89 micrometer \n",
      "The superheat of the liquid is 9 C\n"
     ]
    }
   ],
   "source": [
    "from scipy.optimize import fsolve \n",
    "import math \n",
    "import warnings\n",
    "warnings.filterwarnings('ignore', 'The iteration is not making good progress')\n",
    "# Variables\n",
    "#(a)\n",
    "Tsat = 350            \t\t\t#K, saturated temp.\n",
    "Tl = Tsat+5           \t\t\t#K, liquid temp.\n",
    "#By antoine eqn.\n",
    "T = Tl-273            \t\t\t#C, \n",
    "\n",
    "# Calculations and Results\n",
    "pl = math.exp(4.22658-(1244.95/(T+217.88)))\n",
    "ST = 26.29-0.1161*T   \t\t\t#dyne/cm, Surface tension of liquid\n",
    "ST_ = ST*10**-3        \t\t\t#N/m  Surface tension of liquid\n",
    "Lv = 33605            \t\t\t#kj/kgmol, molar heat of vaporization\n",
    "R = 0.08314           \t\t\t#m**3  bar/kgmol K, gas math.cosmath.tant\n",
    "r = (2*ST_*R*Tsat**2)/((Tl-Tsat)*pl*(Lv*10**3))\n",
    "print \"So a bubble nucleus that has been detached from a cavity will not collapse in \\\n",
    "the liquid if it is larger than %.2f micrometer \"%(r*10**6)\n",
    "\n",
    "#(b)\n",
    "r1 = 10**-6       \t\t\t#m\n",
    "#pl1 = exp(4.22658-(1244.95/(Tl_-273+217.88)))   \t\t\t#vapour pressure\n",
    "#ST1 = 0.02629-1.161*10**-4(Tl_-273)              \t\t\t#surface tension\n",
    "\n",
    "def f(Tl): \n",
    "    return (Tl-Tsat)-2*(0.02629-1.161*10**-4*(Tl-273))*R*Tsat**2/(r1*Lv*10**3)\n",
    "Tl = fsolve(f,0.1)\n",
    "T_ = (Tl-273.5)-(Tsat-273)\n",
    "print \"The superheat of the liquid is %d C\"%(T_)\n",
    "\n",
    "# note : answers are slightly different because of rounding off error."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.2 Page No : 180"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total rate of boiling of water is 69 kg/h \n",
      "Qs2 compares reasonably well with the Qs1\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "d = 0.35                   \t\t\t#m, diameter of pan\n",
    "p = 1.013                  \t\t\t#bar, pressure\n",
    "T1 = 115.                   \t\t\t#C, bottom temp.\n",
    "T2 = 100.                   \t\t\t#C, boiling temp.\n",
    "Te = T1-T2                 \t\t\t#C, excess temp.\n",
    "#For Water\n",
    "mu1 = 2.70*10**-4           \t\t\t#Ns/m**2, vismath.cosity\n",
    "cp1 = 4.22                 \t\t\t#kj/kg C, specific heat\n",
    "rho1 = 958.                 \t\t\t#kg/m63. density\n",
    "Lv1 = 2257.                 \t\t\t#kj/kg, enthalpy of vaporization \n",
    "s1 = 0.059                 \t\t\t#N/m , surface tension\n",
    "Pr1 = 1.76                 \t\t\t#Prandtl no.\n",
    "#For saturated steam\n",
    "rho2 = 0.5955\n",
    "#For the pan\n",
    "Csf = 0.013               \t\t\t#consmath.tant\n",
    "n = 1.                     \t\t\t#exponent\n",
    "g = 9.8                   \t\t\t#m/s**2, gravitational consmath.tant\n",
    "\n",
    "# Calculations and Results\n",
    "#from eq. 6.6  \t\t\t#heat flux\n",
    "Qs1 = mu1*Lv1*(g*(rho1-rho2)/s1)**(1./2)*(cp1*Te/(Csf*Lv1*(Pr1)**n))**3\n",
    "Rate = Qs1/Lv1             \t\t\t#kg/m**2 s. rate of boiling\n",
    "Ap = math.pi/4*d**2            \t\t\t#m**2, pan area\n",
    "Trate = Rate*Ap           \t\t\t#kg/s, Total rate of boiling\n",
    "Trate_ = Trate*3600.5     \t\t\t#kg/h. Total rate of boiling\n",
    "print \"total rate of boiling of water is %.0f kg/h \"%(Trate_)\n",
    "\n",
    "#umath.sing Lienhard's eq.,   \t\t\t#critical heat flux\n",
    "Qmax = 0.149*Lv1*rho2*(s1*g*(rho1-rho2)/(rho2)**2)**(1/4)\n",
    "#by Mostinski eq.\n",
    "Pc = 221.2                \t\t\t#critical pressure\n",
    "Pr = p/Pc                 \t\t\t#reduced pressure\n",
    "hb = 0.00341*(Pc)**(2.3)*Te**(2.33)*Pr**(0.566)     \t\t\t#boiling heat transfer coefficient\n",
    "hb_ = hb/1000              \t\t\t#kW/m**2 C boiling heat transfer coefficient\n",
    "Qs2 = hb_*(Te)\n",
    "print \"Qs2 compares reasonably well with the Qs1\"\n",
    "\n",
    "# note: rounding off error."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.3 Page No : 181"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The boilins rate is 63 kg/m**2 h\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "A = 12.5673\n",
    "B = 4234.6\n",
    "pv = 1.813\n",
    "T1 = 200.                 \t\t\t#C, tube wall temp.\n",
    "#For methanol\n",
    "Tc = 512.6               \t\t\t#K, critical temp.\n",
    "w = 0.556                \t\t\t#acentric factor\n",
    "Zra = 0.29056-0.08775*w\n",
    "R = 0.08314             \t\t\t#m**3bar/gmol K, universal gas consmath.tant\n",
    "Pc = 80.9               \t\t\t#bar, critical temp.\n",
    "Mw = 32.                 \t\t\t#g, molecular wt\n",
    "\n",
    "#Calculation\n",
    "#Estimation of liquid and vapour properties \n",
    "#from antoine eq.\n",
    "T = B/(A-math.log(pv))       \t\t\t#K, boiling point\n",
    "Te = (T1+273)-T         \t\t\t#K, excess temp.\n",
    "Tm = ((T1+273)+T)/2     \t\t\t#K, mean temp.\n",
    "#Liquid properties\n",
    "#(a)\n",
    "Tr = T/Tc              \t\t\t#K, reduced temp.\n",
    "#from Rackett technique\n",
    "Vm = R*Tc*(Zra)**(1+(1-Tr)**(2/7))/Pc      \t\t\t#m**3/kg mol, molar volume\n",
    "rhol = Mw/Vm                             \t\t\t#kg/m**3, density of satorated liquid density\n",
    "#(b)\n",
    "#from Missenard technique\n",
    "T2 = 348.               \t\t\t#K,given data temp.\n",
    "T3 = 373.               \t\t\t#K,given data temp.\n",
    "Cp2 = 107.5            \t\t\t#j/g mol K specific heat at T2\n",
    "Cp3 = 119.4            \t\t\t#j/g mol K specific heat at T3\n",
    "#By linear interpolation at T = 353.7 K\n",
    "Cp = Cp2+(Cp3-Cp2)*((T-T2)/(T3-T2))    \t\t\t#kj/kg mol C, specific heat at T = 353.7 K\n",
    "Cp_ = Cp*0.03125                       \t\t\t#kj/kg C\n",
    "#(c)Surface tension at given temp.(K)\n",
    "T4 = 313.\n",
    "St4 = 20.96\n",
    "T5 = 333.\n",
    "St5 = 19.4\n",
    "#By linear interpolation at T = 353.7 K\n",
    "S = 17.8                               \t\t\t#dyne/cm, surface temp.\n",
    "#(d) liquid vismath.cosity\n",
    "T6 = 298.               \n",
    "MUt6 = 0.55                           \t\t\t#cP, liquid vismath.cosity at temp = 298\n",
    "MU = ((MUt6)**-0.2661+((T-T6)/233))**(-1/0.2661)       \t\t\t#cP\n",
    "#(e)Prandtl no. a,b,c are consmath.tant\n",
    "a = 0.3225\n",
    "b = -4.785*10**-4\n",
    "c = 1.168*10**-7\n",
    "kl = a+b*T+c*T**2                     \t\t\t#W/m C, thermal conductivity\n",
    "Prl = Cp_*1000*MU*10**-3/kl           \t\t\t#Prandtl no.\n",
    "#(f)heat of vaporization at 337.5 K\n",
    "Lv = 1100.                            \t\t\t#kj/kg, enthalpy of vaporization\n",
    "\n",
    "#Properties of methanol vapour at Tm\n",
    "#(a)\n",
    "Vm1 = R*Tm/pv                      \t\t\t#m**3/kg mol, molar volume\n",
    "rhov = Mw/Vm1                      \t\t\t#kg/m**3, density of vapour\n",
    "#(b) a1,b1,c1,d1 are math.cosmath.tants\n",
    "a1 = -7.797*10**-3\n",
    "b1 = 4.167*10**-5\n",
    "c1 = 1.214*10**-7\n",
    "d1 = -5.184*10**-11\n",
    "#thermal conductivity of vapour\n",
    "kv = a1+b1*Tm+c1*Tm**2+d1*Tm**3    \t\t\t#W/m C\n",
    "#(c)heat capacity of vapour,  a2,b2,c2,d2 are math.cosmath.tants\n",
    "a2 = 21.15\n",
    "b2 = 7.092*10**-2\n",
    "c2 = 2.589*10**-5\n",
    "d2 = -2.852*10**-8\n",
    "#heat capacity of vapour,      in kj/kh mol K\n",
    "Cpv = a2+b2*Tm+c2*Tm**2+d2*Tm**3\n",
    "\n",
    "#(d)vismath.cosity of vapour\n",
    "T7 = 67.\n",
    "MUt7 = 112.\n",
    "T8 = 127.\n",
    "MUt8 = 132.\n",
    "#from linear inter polation at Tm\n",
    "MUv = 1.364*10**-5              \t\t\t#kg/m s\n",
    "\n",
    "#from Rohsenow's eq.\n",
    "Csf = 0.027                   \t\t\t#consmath.tant\n",
    "n = 1.7                       \t\t\t#exponent value\n",
    "#from eq. 6.6\n",
    "g = 9.8                       \t\t\t#m/s**2, gravitational consmath.tant\n",
    "#heat flux   \t\t\t#kW/m**2\n",
    "Q = MU*10**-3*Lv*(g*(rhol-rhov)/S*10**-3)**(1./2)*(Cp_*Te/(Csf*Lv*(Prl)**n))**3\n",
    "#from eq. 6.11\n",
    "#from eq 6.11,  critical heat flux\n",
    "Qmax = 0.131*Lv*(rhov)**(1./2)*(S*10**-3*g*(rhol-rhov))**(1./4)\n",
    "#dimensionless radius r_\n",
    "r = 0.016\n",
    "r_ = r*(g*(rhol-rhov)/(S*10**-3))**(1./2)\n",
    "#peak heat flux\n",
    "Qmax1 = Qmax*(0.89+2.27*math.exp(-3.44*math.sqrt(r_)))\n",
    "#from eq. 6.12\n",
    "#heat transfer coefficient hb\n",
    "d = 0.032                        \t\t\t#m, tube diameter\n",
    "hb = 0.62*((kv**3)*rhov*(694-rhov)*g*(Lv*10**3+0.4*Cpv*Te)/(d*MUv*Te))**(1./4)\n",
    "Qb = hb*Te                      \t\t\t#kw/m**2, heat flux\n",
    "BR = Qb*10**-3/Lv                \t\t\t#kg/m**2s, boilng rate \n",
    "\n",
    "# Results\n",
    "print \"The boilins rate is %.0f kg/m**2 h\"%(BR*3600)\n",
    "\n",
    "# note : rounding off error."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.4 Page No : 188"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The total tube length is 0.393 m\n"
     ]
    }
   ],
   "source": [
    "import math \n",
    "\n",
    "# Variables\n",
    "W1 = 200.              \t\t\t#kg/h, rate of entering toluene\n",
    "muv = 10.**-5           \t\t\t#kg/m s, vismath.cosity of toluene vapour\n",
    "mul = 2.31*10**-4      \t\t\t#kg/m s, vismath.cosity of  benzene\n",
    "rhol = 753.            \t\t\t#kg/m**3, density of benzene\n",
    "rhov = 3.7            \t\t\t#kg/m**3, density of toluene vapour\n",
    "Cpl = 1968.            \t\t\t#j/kg C, specific heat of benzene\n",
    "kl = 0.112            \t\t\t#W/m C, thermal conductivity of benzene\n",
    "T1 = 160.              \t\t\t#C tube wall temp.\n",
    "T2 = 120.              \t\t\t#C , saturated temp.\n",
    "Te = T1-T2            \t\t\t#C, excess temp.\n",
    "Lv = 3.63*10**5        \t\t\t#j/kg, enthalpy of vaporization\n",
    "s = 1.66*10**-2        \t\t\t#N/m, surface tension\n",
    "\n",
    "#Calculation of hc & hb\n",
    "w = 0.125             \t\t\t#m, mean step size\n",
    "d = 0.0211            \t\t\t#, internal diameter of tube\n",
    "G = W1/(3600*math.pi/4*(d**2))         \t\t\t#kg/m**2 s, mass flow rate\n",
    "Re1 = G*(1-w)*d/mul              \t\t\t#Reynold no. \n",
    "Prl = Cpl*mul/kl                 \t\t\t#Prandtl no.\n",
    "#from eq. 6.23\n",
    "x = (w/(1-w))**(0.9)*(rhol/rhov)**(0.5)*(muv/mul)**0.1  \t\t\t#let x = 1/succepsibility\n",
    "#from eq. 6.22               \n",
    "F = 2.35*(x+0.231)**0.736        \t\t\t#factor signifies 'liquid only reynold no.' to a two phase reynold no.\n",
    "#from eq. 7.21\n",
    "Re2 = 10**-4*Re1*F**1.25          \t\t\t#Reynold no.\n",
    "#from eq. 6.18\n",
    "S = (1+0.12*Re2**1.14)**-1        \t\t\t#boiling supression factor\n",
    "#from eq. 6.15\n",
    "hc = 0.023*Re1**(0.8)*Prl**(0.4)*(kl/d)*F  \t\t\t#W/m**2 C, forced convection boiling part\n",
    "#from eq. 6.16\n",
    "mulv = (1/rhov)-(1/rhol)              \t\t\t#m**3/kg, kinetic vismath.cosity of liquid vpaour\n",
    "dpsat = Te*Lv/((T2+273)*mulv)         \t\t\t#N/m**2, change in saturated presssure \n",
    "#nucleate boiling part hb\n",
    "hb = 1.218*10**-3*(kl**0.79*Cpl**0.45*rhol**0.49*Te**0.24*dpsat**0.75*S/(s**0.5*mul**0.29*Lv**0.24*rhov**0.24))\n",
    "h = hc+hb                            \t\t\t#W/m**2 C, total heat transfer coefficient\n",
    "\n",
    "#calculation of required heat transfer area\n",
    "a = 5.                              \t\t\t#%, persentage change in rate of vaporization\n",
    "W2 = W1*a/100                      \t\t\t#kg/h, rate of vaporization\n",
    "W2_ = W2/3600                      \t\t\t#kg/s\n",
    "Q = W2_*Lv                         \t\t\t#W,heat load\n",
    "A = Q/(h*Te)                       \t\t\t#m**2, area of heat transfer\n",
    "l = A/(math.pi*d)                      \t\t\t#m, required length of tube\n",
    "#from table 6.2\n",
    "Tl = 0.393\n",
    "\n",
    "# Results\n",
    "print \"The total tube length is %.3f m\"%(Tl)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.5 Page No : 195"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total rate of condensation is 33.08 kg/h\n"
     ]
    }
   ],
   "source": [
    "from scipy.optimize import fsolve \n",
    "import math \n",
    "\n",
    "# Variables\n",
    "rhol = 483.                         \t\t\t#kg/m**3, density of liquid propane\n",
    "mul = 9.1*10**-5                    \t\t\t#P ,vismath.cosity of liquid propane\n",
    "kl = 0.09                          \t\t\t#W/m K, thermal conductivity of liquid propane\n",
    "Lv = 326.                           \t\t\t#kj/kg. enthalpy of vaporization\n",
    "Cpl = 2.61                         \t\t\t#kj/kg K, specific heat of liquid propane\n",
    "T1 = 32.\n",
    "T2 = 25.                            \t\t\t#C, surface temp.\n",
    "p1 = 11.2\n",
    "rhov = 24.7                       \t\t\t#kg/m**3, density of vapour\n",
    "g = 9.8\n",
    "h = 0.3\n",
    "\n",
    "#Calculation\n",
    "Lv1 = Lv+0.68*Cpl*(T1-T2)\n",
    "#h = 0.943*(g*Lv1*10**3*rhol*(rhol-rhov)*kl**3/(mul*L*(T1-T2)))**(1/4)\n",
    "#Q = h*(L*1)*(T1-T2)\n",
    "#m = Q/(Lv1*10**3) = 1.867*10**-2*L**(3/4)\n",
    "Ref = 30.\n",
    "#from the relation  4*m/mu = Re\n",
    "L = (Ref*mul/(4*1.867*10**-2))**(4./3)\n",
    "m = 1.867*10**-2*L**(3./4)        \t\t\t#rate of condensation for laminar flow\n",
    "#from eq. 6.32\n",
    "#Nu1 = h_/kl*(mul**2/(rhol*(rhol-rhov)*g))**(1/3) = Ref/(1.08*(Ref)**(1.22)-5.2)\n",
    "Lp = h-L        \t\t\t#length of plate over which flow is wavy\n",
    "A = Lp*1         \t\t\t#m**2 area of condensation\n",
    "\n",
    "\n",
    "def f(h1): \n",
    "    return h1/kl*(mul**2/(rhol*(rhol-rhov)*g))**(1./3)-(29.76+0.262*h1)/(1.08*(29.76+0.262*h1)**(1.22)-5.2)\n",
    "h1 = fsolve(f,1000)\n",
    "m2 = m+h1*A*(T1-T2)/(Lv1*10**3)\n",
    "Ref1 = 4*m2/mul\n",
    "m2 = m+h1*A*(T1-T2)/(Lv1*10**3)\n",
    "\n",
    "# Results\n",
    "print \"Total rate of condensation is %.2f kg/h\"%(m2*3600)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.6 Page No : 199"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rate of condensation is 45.7 kg/h \n",
      "Rate of condensation is 1052 kg/h  \n",
      "thus there will be increase in the calculated rate of heat transfer and in rate of condensation as 1.188 percent\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "#data fot TCE\n",
    "T1 = 87.4                         \t\t\t#C, normal boiling point\n",
    "T2 = 25.                           \t\t\t#C, surface temp.\n",
    "Lv = 320.8                        \t\t\t#kj/kg, heat of vaporization\n",
    "cp = 1.105                        \t\t\t#kj/kg C, specific heat\n",
    "mu = 0.45*10**-3                   \t\t\t#P. liquid vismath.cosity\n",
    "k = 0.1064                        \t\t\t#W/m C, thermal conductivity\n",
    "rhol = 1375.                       \t\t\t#kg/m**3, liquid density\n",
    "rhov = 4.44                       \t\t\t#kg/m**3, density of vapour\n",
    "Tm = (T1+T2)/2.                    \t\t\t#C, mean film temp.\n",
    "d = 0.0254                        \t\t\t#m, outside diameter of tube\n",
    "l = 0.7                           \t\t\t#m, length\n",
    "g = 9.8                           \t\t\t#m/s**2, gravitational consmath.tant\n",
    "\n",
    "# Calculations and Results\n",
    "#(a) from eq. 6.34\n",
    "Lv1 = Lv+0.68*cp*(T1-T2)\n",
    "h = 0.728*(g*Lv1*10**3*rhol*(rhol-rhov)*k**3/(mu*d*(T1-T2)))**(1./4)\n",
    "A = math.pi*d*l                       \t\t\t#m**2, area of tube\n",
    "Q = h*A*(T1-T2)                   \t\t\t#W, rate of heat transfer\n",
    "m = (Q/Lv1)/1000                  \t\t\t#kg/s rate of condensation\n",
    "print \"Rate of condensation is %.1f kg/h \"%(m*3600)\n",
    "\n",
    "#(b)   from eq. 6.35\n",
    "N = 6.                             \t\t\t#No. of tubes in vertical tire\n",
    "h1 = 0.728*(g*Lv1*10**3*rhol*(rhol-rhov)*k**3/(N*mu*d*(T1-T2)))**(1./4)\n",
    "TN = 36.                           \t\t\t#total no. of tubes\n",
    "TA = TN*math.pi*d*l                    \t\t\t#m**2, total area\n",
    "Q1 = h1*TA*(T1-T2)                   \t\t\t#W, rate of heat transfer\n",
    "m1 = (Q1/Lv1)/1000.                  \t\t\t#kg/s rate of condensation\n",
    "print \"Rate of condensation is %.0f kg/h  \"%(m1*3600)\n",
    "#from chail's corelation\n",
    "h2 = (1+0.2*cp*(T1-T2)*(N-1)/(Lv1))\n",
    "print \"thus there will be increase in the calculated rate of\\\n",
    " heat transfer and in rate of condensation as %.3f percent\"%(h2)\n",
    "\n",
    "# note : rounding off error."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6.7 Page No : 201"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fraction of input vapour condensed is 52.7\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "Gv = 20.                  \t\t\t#kg/m**2 s, mass flow rate of benzene\n",
    "di = 0.016               \t\t\t#m, tube diameter\n",
    "muv = 8.9*(10**-6)        \t\t\t#P, vismath.cosity\n",
    "Lv = 391.                 \t\t\t#kj/kg., enthalpy of vaporization\n",
    "cpl = 1.94               \t\t\t#kj/kg C, specific heat\n",
    "Tv = 80.                  \t\t\t#C, normal boiling point of benzene\n",
    "Tw = 55.                  \t\t\t#C, wall temp.\n",
    "g = 9.8                  \t\t\t#m/s**2, gravitational consmath.tant\n",
    "rhol = 815.               \t\t\t#kg/m**3, density of benzene\n",
    "rhov = 2.7               \t\t\t#kg/m**3, density of benzene vapour\n",
    "kl = 0.13                \t\t\t#W/m C, thermal conductivity\n",
    "mu = 3.81*10**-4          \t\t\t#P, vismath.cosity of benzene\n",
    "l = 0.5                  \t\t\t#m, length  of tube\n",
    "\n",
    "#calculation\n",
    "Rev = di*Gv/muv          \t\t\t#Reynold no. of vapour\n",
    "#from eq. 6.38\n",
    "Lv1 = Lv+(3./8)*cpl*(Tv-Tw)\n",
    "#heat transfer corfficient , h\n",
    "h = 0.555*(g*rhol*(rhol-rhov)*kl**3*Lv1*10**3/(di*mu*(Tv-Tw)))**(1./4)\n",
    "Aavl = math.pi*di*l          \t\t\t#m**2, available area\n",
    "Q = Aavl*h*(Tv-Tw)       \t\t\t#W, rate of heat transfer\n",
    "m = Q/(Lv1*10**3)         \t\t\t#kg/s, rate of condensation of benzene\n",
    "Ratei = Gv*(math.pi/4)*di**2   \t\t\t#kg/s rate of input of benzene vapour\n",
    "n = m/Ratei              \n",
    "\n",
    "# Results\n",
    "print \"fraction of input vapour condensed is %.1f\"%(n*100)\n",
    "\n",
    "# note : rouding off error."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}