{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Natural Convection System"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.1 Page No. 413"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 0.0551             # density in Ibm/cu.ft \n",
      "cp=0.2420               # specific heat BTU/(lbm-degree Rankine) \n",
      "v= 27.88e-5             # viscosity in sq.ft/s \n",
      "kf = 0.01944             # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
      "a = 1.457               # diffusivity in sq.ft/hr \n",
      "Pr = 0.689              # Prandtl Number\n",
      "T_inf=120.0+460.0           # wall temperature in degree R\n",
      "Tw=400.0+460.0              # inside wall temperature in degree R\n",
      "Beta=1/T_inf\n",
      "\n",
      "Beta_=0.00116\n",
      "gc=32.2\n",
      "L=1.0                     # length of wall in ft\n",
      "W=2.0                     # width in ft\n",
      "Gr=(gc*Beta_*(Tw-T_inf)*L**3)/v**2    # Grashof Number\n",
      "temperature_slope=0.505              #temperature slope from table 8.1 \n",
      "hL=(kf/L)*(4/3.0)*(Gr/4.0)**(1/4.0)*temperature_slope    \n",
      "A=L*W                   # cross sectional area in sq.ft\n",
      "qw=hL*A*(Tw-T_inf)\n",
      "\n",
      "print\"The heat transferred is\",round(qw,0),\"BTU/hr\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transferred is 558.0 BTU/hr\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.2 Page No. 414"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou1=1.295            # density in kg/cu.m\n",
      "cp1=1005.5            # specific heat in J/(kg*K) \n",
      "v1=12.59e-6           #  viscosity in sq.m/s  \n",
      "Pr1=0.713             # Prandtl Number \n",
      "kf1=0.02426           # thermal conductivity in W/(m.K)\n",
      "a1=0.17661e-4         # diffusivity in sq.m/s \n",
      "T_inf1=0           # inside and outside temperature in K\n",
      "Beta1=1/(T_inf1+273.0)  # volumetric thermal expansion coefficient at 295 K and 273 K\n",
      "\n",
      "rou2=1.177            # density in kg/cu.m\n",
      "cp2=1005              # specific heat in J/(kg*K) \n",
      "v2=15.68e-6           # viscosity in sq.m/s  \n",
      "Pr2=0.708             # Prandtl Number \n",
      "kf2=0.02624           # thermal conductivity in W/(m.K)\n",
      "a2=0.22160e-4         # diffusivity in sq.m/s \n",
      "T_inf2=22.0           # inside and outside temperature in K\n",
      "Beta2=1/(T_inf2+273.0)          # volumetric thermal expansion coefficient at 295 K and 273 K\n",
      "\n",
      "g=9.81\n",
      "t=0.005               # thickness of glass\n",
      "L=0.60                # window length in m\n",
      "k=0.81                # thermal conductivity of glass from appendix table B3\n",
      "Tw1=18\n",
      "Tw2=4\n",
      "Ra1=(g*Beta1*(Tw2-T_inf1)*L**3)/(v1*a1)\n",
      "hL1=(kf1/L)*(0.68+((0.67*((abs(Ra1)))**(1/4.0))/(1+(0.492/Pr1)**(9/16.0))**(4/9.0)))\n",
      "Ra2=(g*Beta2*(Tw1-T_inf2)*L**3)/(v2*a2)\n",
      "hL2=(kf2/L)*(0.68+((0.67*(abs(Ra2))**(1/4.0))/(1+(0.492/Pr2)**(9/16.0))**(4/9.0)))\n",
      "q1=(T_inf1-T_inf2)/((1/hL2)+(t/k)+(1/hL1))\n",
      "Tw2_=T_inf2-(q1/hL2)\n",
      "Tw1_=q1/hL1+T_inf1\n",
      "\n",
      "Ra1_=3.7*10**8\n",
      "hL1_=2.92\n",
      "Ra2_=2.31*10**8\n",
      "hL2_=2.80\n",
      "q2=(T_inf2-T_inf1)/((1/hL2_)+(t/k)+(1/hL1_))\n",
      "\n",
      "Tw2final=q2-T_inf2\n",
      "Tw1final=10.7\n",
      "\n",
      "print\"The heat loss is \",round(q2,1),\" W/sq.m\"\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat loss is  31.2  W/sq.m\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.3 Page No.419"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 0.0735     # density in Ibm/cu.ft \n",
      "cp=0.240        # specific heat BTU/(lbm-degree Rankine) \n",
      "v= 16.88e-5     # viscosity in sq.ft/s \n",
      "kf = 0.01516    # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
      "a = 0.859       # diffusivity in sq.ft/hr \n",
      "Pr = 0.708      # Prandtl Number\n",
      "Tw=90\n",
      "T_inf=70\n",
      "g=32.2\n",
      "L=5.5           # length in ft\n",
      "W=2+(4/12.0)      # width in ft\n",
      "Beta=1/(Tw+460.0) # volumetric thermal expansion coefficient in per degree Rankine\n",
      "Ra=(g*Beta*(Tw-T_inf)*L**3)/(v*a/3600)\n",
      "hc=(kf/L)*(0.825+((0.387*(Ra)**(1/6.0))/(1+(0.492/Pr)**(9/16.0))**(8/27.0)))**2\n",
      "q=hc*L*W*(Tw-T_inf)\n",
      "\n",
      "print\"The heat gained is %d BTU/hr\",round(q,0),\"BTU/hr\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat gained is %d BTU/hr 142.0 BTU/hr\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.4 Page no. 421"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "rou= 1123         # density in kg/m^3 \n",
      "cp= 1006.7        # specific heat in J/(kg*K) \n",
      "v= 17.204e-6      # vismath.cosity in m^2/s  \n",
      "Pr =0.703        # Prandtl Number \n",
      "kf= 0.02738       # thermal conductivity in W/(m.K)\n",
      "a = 0.2446e-4     # diffusivity in m^2/s \n",
      "g=9.81\n",
      "L=5.0\n",
      "theta=45\n",
      "T_inf=20.0           # ambient air temperature in degree C\n",
      "Tw=65              # roof surface temperature in degree C\n",
      "Beta=1/(T_inf+273.0) # volumetric thermal math.expansion coefficient in per K\n",
      "\n",
      "import math\n",
      "x=((3e5*math.exp(0.1368*math.cos(90-theta))*v*a)/(g*math.cos(theta)*Beta*(Tw-T_inf)))**(1/3.0)\n",
      "x=0.051\n",
      "print\"The Laminar-turbulent  transition length by Vliet equation is \",round(x,3),\"m\\n\\n\"\n",
      "lists=[0.02,0.04,0.051,0.051,0.1,1.0,3,5]\n",
      "Ra=[0,0,0,0,0,0,0,0]\n",
      "hc=[0,0,0,0,0,0,0,0]\n",
      "print\"_______________________________________________________\"\n",
      "print\"x(m)\\t\\tRaL\\t\\t\\thc(W/[m.K])\"\n",
      "print\"_______________________________________________________\"\n",
      "for i in range(0,8):\n",
      "    if lists[i]<x:\n",
      "        # Laminar Flow regime exists\n",
      "        Ra[i]=(g*math.cos(math.pi*45.0/180.0)*Beta*(Tw-T_inf)*lists[i]**3)/(v*a)\n",
      "        hc[i]=(kf/lists[i])*(0.68+(0.670*Ra[i]**(1/4.0))/(1+(0.492/Pr)**(9/16.0))**(4.0/9.0))\n",
      "        print lists[i],\"\\t\\t%.4g\"%Ra[i],\"\\t\\t%.3g\"%hc[i]\n",
      "    else:\n",
      "        # Turbulent Flow regime exists\n",
      "        Ra[i]=(g*Beta*(Tw-T_inf)*lists[i]**3)/(v*a)\n",
      "        hc[i]=(0.02738/lists[i])*(0.825+0.324*Ra[i]**(1/6.0))**2\n",
      "        print lists[i],\"\\t\\t%.4g\"%Ra[i],\"\\t\\t%.3g\"%hc[i]\n",
      "   \n",
      "print\"\\n\\nNOTE:\\nCalculation mistake in book in calculation of Ral and hc,when x=0.04(2nd step in loop)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Laminar-turbulent  transition length by Vliet equation is  0.051 m\n",
        "\n",
        "\n",
        "_______________________________________________________\n",
        "x(m)\t\tRaL\t\t\thc(W/[m.K])\n",
        "_______________________________________________________\n",
        "0.02 \t\t2.025e+04 \t\t9.32\n",
        "0.04 \t\t1.62e+05 \t\t7.52\n",
        "0.051 \t\t4.749e+05 \t\t7.3\n",
        "0.051 \t\t4.749e+05 \t\t7.3\n",
        "0.1 \t\t3.58e+06 \t\t6.39\n",
        "1.0 \t\t3.58e+09 \t\t4.99\n",
        "3 \t\t9.667e+10 \t\t4.73\n",
        "5 \t\t4.475e+11 \t\t4.66\n",
        "\n",
        "\n",
        "NOTE:\n",
        "Calculation mistake in book in calculation of Ral and hc,when x=0.04(2nd step in loop)\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.5 Page No. 424"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 0.0735           # density in lbm/cu.ft\n",
      "cp=0.240              # specific heat BTU/(lbm-degree Rankine) \n",
      "v= 16.88e-5           # viscosity in sq.ft/s \n",
      "kf = 0.01516          # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
      "a = 0.859             # diffusivity in sq.ft/hr \n",
      "Pr = 0.708            # Prandtl Number\n",
      "Tw=100.0              # temperature of outside surface temperature of oven in degree F\n",
      "T_inf=60.0            # ambient temperature  in degree F\n",
      "g=32.2\n",
      "L=2.0                  # length in ft\n",
      "W=2.0                  # width in ft\n",
      "\n",
      "Beta=1/(T_inf+460.0)      # volumetric thermal expansion coefficient in per degree Rankine\n",
      "Ra=(g*Beta*(Tw-T_inf)*L**3)/(v*a/3600.0)\n",
      "hc=(kf/L)*(0.68+(0.670*Ra**(0.25))/(1+(0.492/Pr)**(9/16.0))**(4/9.0))\n",
      "q1side=hc*L*W*(Tw-T_inf)\n",
      "Lc=0.5\n",
      "Ra_L=(g*Beta*(Tw-T_inf)*Lc**3)/(v*a/3600.0) # Rayleigh number based on characteristic length\n",
      "hc_L=(kf/Lc)*0.54*(Ra_L)**(1/4.0)\n",
      "qtop=hc_L*L*W*(Tw-T_inf)\n",
      "\n",
      "print\"The heat transferred from one side is \",round(q1side,1),\"BTU/hr\"\n",
      "print\"The heat transferred from top is \",round(qtop,0),\"BTU/hr\"\n",
      "\n",
      "if qtop < q1side:\n",
      "    \n",
      "    print\"More heat is transfered from side\" \n",
      "else:\n",
      "    print \"More heat is transfered top side\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transferred from one side is  93.7 BTU/hr\n",
        "The heat transferred from top is  138.0 BTU/hr\n",
        "More heat is transfered top side\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.6 Page No.427"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 1.177           # density in kg/cu.m\n",
      "cp= 1005.7           # specific heat in J/(kg*K) \n",
      "v= 15.68e-6          # viscosity in sq.m/s  \n",
      "Pr =0.708            #  Prandtl Number \n",
      "kf=0.02624       # thermal conductivity in W/(m.K)\n",
      "a=0.22160e-4    # diffusivity in sq.m/s \n",
      "g=9.81\n",
      "L=4.0             # length in m\n",
      "D=15/100.0        # diameter in m\n",
      "T_inf=5.0         # ambient air temperature in degree C\n",
      "Tw=50.0            # outside surface temperature in degree C\n",
      "\n",
      "import math\n",
      "Beta=1/(T_inf+273.0) # volumetric thermal expansion coefficient in per K\n",
      "Ra=(g*Beta*(Tw-T_inf)*D**3)/(v*a)\n",
      "hc_h=(kf/D)*(0.60+(0.387*Ra**(1/6.0))/(1+(0.559/Pr)**(9/16.0))**(8/27.0))**2\n",
      "As=math.pi*D*L\n",
      "q_hor=hc_h*As*(Tw-T_inf)\n",
      "hc_v=(kf/D)*0.6*(Ra*(D/L))**(1/4.0)\n",
      "q_ver=hc_v*As*(Tw-T_inf)\n",
      "q=round(q_ver,0)+round(q_hor,0)\n",
      "\n",
      "print\"The heat transferred from the horizontal length of 4 m is \",round(q_hor,0),\"W\"\n",
      "print\"The heat transferred from the vertical length of 4 m is \",round(q_ver,0),\"W\"\n",
      "print\"nThe total heat lost from the pipe is \",round(q,2),\"W\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transferred from the horizontal length of 4 m is  477.0 W\n",
        "The heat transferred from the vertical length of 4 m is  246.0 W\n",
        "nThe total heat lost from the pipe is  723.0 W\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.7 Page No. 430"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 0.0809          # density in lbm/cu.ft \n",
      "cp=0.240             # specific heat BTU/(lbm-degree Rankine) \n",
      "v= 13.54e-5          # viscosity in sq.ft/s \n",
      "kf = 0.01402         # thermal conductivity in BTU/(hr.ft.degree Rankine) \n",
      "a = 0.685            # diffusivity in sq.ft/hr \n",
      "Pr = 0.712           # Prandtl Number\n",
      "Tw=0                 # temperature of outside surface temperature of oven in degree F\n",
      "T_inf=70.0             # ambient temperature  in degree F\n",
      "g=32.2\n",
      "Beta=1/(T_inf+460.0)   # volumetric thermal expansion coefficient in per degree Rankine\n",
      "Lc=1/((1/1)+(1/1.2))\n",
      "Ra=(g*Beta*abs(Tw-T_inf)*Lc**3)/(v*a/3600.0)\n",
      "hc=(kf/Lc)*0.6*(Ra)**(1/4.0)\n",
      "\n",
      "print\"The value of convection coefficient is \",round(hc,2),\"BTU/(hr.sq.ft.degree R)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of convection coefficient is  1.11 BTU/(hr.sq.ft.degree R)\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.8 Page No.433"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "rou= 0.998                # density in kg/cu.m\n",
      "cp= 1009.0                # specific heat in J/(kg*K) \n",
      "v= 20.76e-6               # viscosity in sq.m/s  \n",
      "Pr =0.697                 # Prandtl Number \n",
      "kf= 0.03003               # thermal conductivity in W/(m.K)\n",
      "a = 0.2983e-4             # diffusivity in sq.m/s \n",
      "g=9.81\n",
      "T_inf=35                   # ambient air temperature in degree C\n",
      "Tw=100                     # surface temperature in degree C\n",
      "Beta=1/(T_inf+273.0)         # volumetric thermal expansion coefficient in per K\n",
      "rou_Al=2702                 # density in kg/cu.m\n",
      "k_Al=236                   # thermal conductivity in W/(m.K)\n",
      "cp_Al=896                  # specific heat in J/(kg*K) \n",
      "a_Al=97.5e-6               # diffusivity in sq.m/s \n",
      "b=46/100.0\n",
      "w=24/100.0\n",
      "\n",
      "zeta=((w*v**2)/(g*Beta*(Tw-T_inf)*Pr))**(1/4.0)\n",
      "L=1.54*(k_Al/kf)**(1/2)*zeta\n",
      "S=2.89*zeta\n",
      "q=(b*w*(Tw-T_inf)*1.3*(k_Al*kf)**(1/2.0))/(6*zeta)\n",
      "N=b/(2*S)\n",
      "\n",
      "print\"The heat transfer rate is \",round(q,0),\"W\"\n",
      "print\"The number of fins can be atmost\",round(N,0)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat transfer rate is  1423.0 W\n",
        "The number of fins can be atmost 27.0\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}