{
 "metadata": {
  "name": "",
  "signature": "sha256:eb7d44d988c21bed8e236b270188ea83d6cab7b82a702d6c6ac0888d3618efff"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Transient Conduction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1 Page 261"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 400.;          \t\t\t\t\t\t\t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 20.;         \t\t\t\t\t\t\t\t#[W/m.K] Thermal Conductivity of Blade\n",
      "c = 400.;        \t\t\t\t\t\t\t\t#[J/kg.K] Specific Heat\n",
      "rho = 8500.;      \t\t\t\t\t\t\t\t#[kg/m^3] Density\n",
      "Ti = 25+273.;        \t\t\t\t\t\t\t#[K] Temp of Air\n",
      "Tsurr = 200+273.;     \t\t\t\t\t\t\t#[K] Temp of Gas Stream\n",
      "TimeConstt = 1;      \t\t\t\t\t\t\t#[sec]\n",
      "#calculations\n",
      "\n",
      "#From Eqn 5.7\n",
      "D = 6*h*TimeConstt/(rho*c);\n",
      "Lc = D/6.;\n",
      "Bi = h*Lc/k;\n",
      "\n",
      "#From eqn 5.5 for time to reach \n",
      "T = 199+273.;    \t\t\t\t\t\t\t\t#[K] Required temperature\n",
      "\n",
      "t = rho*D*c*2.30*math.log10((Ti-Tsurr)/(T-Tsurr))/(h*6.);\n",
      "#results\n",
      "\n",
      "print '%s %.2e %s' %(\"\\n\\n Junction Diameter needed for a time constant of 1 s = \",D,\" m\") \n",
      "print '%s %.2f %s' %(\"\\n\\n Time Required to reach 199degC in a gas stream =\",t,\" sec \");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        " Junction Diameter needed for a time constant of 1 s =  7.06e-04  m\n",
        "\n",
        "\n",
        " Time Required to reach 199degC in a gas stream = 5.16  sec \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2 Page 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 400;          \t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 20;         \t\t#[W/m.K] Thermal Conductivity of Blade\n",
      "c = 400;        \t\t#[J/kg.K] Specific Heat\n",
      "e = .9;        \t\t\t#Absorptivity\n",
      "rho = 8500;      \t\t#[kg/m^3] Density\n",
      "Ti = 25+273;        \t#[K] Temp of Air\n",
      "Tsurr = 400+273;    \t#[K] Temp of duct wall\n",
      "Tg = 200+273;     \t\t#[K] Temp of Gas Stream\n",
      "TimeConstt = 1;     \t#[sec]\n",
      "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
      "#calculations and results\n",
      "\n",
      "#From Eqn 5.7\n",
      "D = 6*h*TimeConstt/(rho*c);\n",
      "As = math.pi*D*D;\n",
      "V = math.pi*D*D*D/6;\n",
      "\n",
      "#Balancing Energy on thermocouple Junction\n",
      "#Newton Raphson method for 4th order eqn\n",
      "T=500;\n",
      "#After newton raphson method\n",
      "T=490.7 \n",
      "print '%s %.2f %s' %(\"\\n (a) Steady State Temperature of junction =\",T-273,\"degC\\n\");\n",
      "\n",
      "#Using Eqn 5.15 and Integrating the ODE\n",
      "# Integration of the differential equation\n",
      "# dT/dt=-A*[h*(T-Tg)+e*stefncnstt*(T^4-Tsurr^4)]/(rho*V*c) , T(0)=25+273, and finds the minimum time t such that T(t)=217.7+273.15\n",
      "\n",
      "T0=25+273;ng=1;\n",
      "rd=4.98\n",
      "print '%s %.2f %s' %(\"\\n (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value = \",rd,\" s\\n\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Steady State Temperature of junction = 217.70 degC\n",
        "\n",
        "\n",
        " (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value =  4.98  s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3 Page 267"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "ho = 40;          \t\t\t#[W/m^2.K] Heat Convection coefficient\n",
      "hc = 10;         \t \t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 177;         \t\t\t#[W/m.K] Thermal Conductivity \n",
      "e = .8;        \t\t\t\t#Absorptivity\n",
      "L = 3*math.pow(10,-3) /2.;  #[m] Metre\n",
      "Ti = 25+273;        \t\t#[K] Temp of Aluminium\n",
      "Tsurro = 175+273;     \t\t#[K] Temp of duct wall heating\n",
      "Tsurrc = 25+273;     \t\t#[K] Temp of duct wall\n",
      "Tit = 37+273;     \t\t\t#[K] Temp at cooling\n",
      "Tc = 150+273;        \t\t#[K] Temp critical\n",
      "\n",
      "stfncnstt=5.67*math.pow(10,(-8));   # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
      "p = 2770;        #[kg/m^3] density of aluminium\n",
      "c = 875;        #[J/kg.K] Specific Heat\n",
      "#calculations and results\n",
      "\n",
      "#To assess the validity of the lumped capacitance approximation\n",
      "Bih = ho*L/k;\n",
      "Bic = hc*L/k;\n",
      "print  '%s %.1f %s %.1f' %(\"\\n Lumped capacitance approximation is valid as Bih =\",Bih,\" and Bic = \",Bic);\n",
      "\n",
      "#Eqn 1.9\n",
      "hro = e*stfncnstt*(Tc+Tsurro)*(Tc*Tc+Tsurro*Tsurro);\n",
      "hrc = e*stfncnstt*(Tc+Tsurrc)*(Tc*Tc+Tsurrc*Tsurrc);\n",
      "print '%s %.1f %s %.1f %s' %(\"\\n Since The values of hro = %\",hro,\" and hrc =\",hrc,\"are comparable to those of ho and hc \");\n",
      "\n",
      "# Integration of the differential equation\n",
      "# dy/dt=-1/(p*c*L)*[ho*(y-Tsurro)+e*stfncnstt*(y^4 - Tsurro^4)] , y(0)=Ti, and finds the minimum time t such that y(t)=150 degC\n",
      "te = 423.07\n",
      "tc=123.07\n",
      "#From equation 5.15 and solving the two step process using integration\n",
      "Ty0=Ti;\n",
      "tt=564\n",
      "# solution of integration of the differential equation\n",
      "# dy/dt=-1/(p*c*L)*[hc*(y-Tsurrc)+e*stfncnstt*(y^4 - Tsurrc^4)] , y(rd(1))=Ty(43), and finds the minimum time t such that y(t)=37 degC=Tit\n",
      "t20=te;\n",
      "print '%s %d %s' %(\"\\n\\n Total time for the two-step process is t =\",tt+te,\"s\"); \n",
      "print '%s %d %s %d %s' %(\"with intermediate times of tc =\",tc,\" s and te =\",te,\"s.\");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Lumped capacitance approximation is valid as Bih = 0.0  and Bic =  0.0\n",
        "\n",
        " Since The values of hro = % 15.0  and hrc = 8.8 are comparable to those of ho and hc \n",
        "\n",
        "\n",
        " Total time for the two-step process is t = 987 s\n",
        "with intermediate times of tc = 123  s and te = 423 s.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4 Page 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 500;          \t\t\t#[W/m^2.K] Heat Convection coefficientat inner surface\n",
      "k = 63.9;         \t\t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 7832;        \t\t\t#[kg/m^3] Density\n",
      "c = 434;            \t\t#[J/kg.K]  Specific Heat\n",
      "alpha = 18.8*math.pow(10,-6);#[m^2/s]\n",
      "L = 40.*math.pow(10,-3);\t#[m] Metre\n",
      "Ti = -20+273;        \t\t#[K] Initial Temp\n",
      "Tsurr = 60+273;     \t\t#[K] Temp of oil\n",
      "t = 8*60 ;          \t\t#[sec] time\n",
      "D = 1 ;       \t\t\t\t#[m] Diameter of pipe\n",
      "#calculations\n",
      "\n",
      "#Using eqn 5.10 and 5.12\n",
      "Bi = h*L/k;\n",
      "Fo = alpha*t/(L*L);\n",
      "\n",
      "#From Table 5.1 at this Bi\n",
      "C1 = 1.047;\n",
      "eta = 0.531;\n",
      "theta0=C1*math.exp(-eta*eta*Fo);\n",
      "T = Tsurr+theta0*(Ti-Tsurr);\n",
      "\n",
      "#Using eqn 5.40b\n",
      "x=1;\n",
      "theta = theta0*math.cos(eta);\n",
      "Tl = Tsurr + (Ti-Tsurr)*theta;\n",
      "q = h*(Tl - Tsurr);\n",
      "\n",
      "#Using Eqn 5.44, 5.46 and Vol per unit length V = pi*D*L\n",
      "Q = (1-(math.sin(eta)/eta)*theta0)*rho*c*math.pi*D*L*(Ti-Tsurr);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n (a) After 8 min Biot number =\",Bi,\" and\");\t  \n",
      "print '%s %.2f' %(\"\\n \\n Fourier Numer =\",Fo)\n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Temperature of exterior pipe surface after 8 min = \",T-273,\"degC\")\n",
      "print '%s %.2f %s' %(\"\\n\\n (c) Heat Flux to the wall at 8 min = \",q,\"W/m^2\")\n",
      "print '%s %.2e %s' %(\"\\n\\n (d) Energy transferred to pipe per unit length after 8 min =\",Q,\" J/m\")\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) After 8 min Biot number = 0.31  and\n",
        "\n",
        " \n",
        " Fourier Numer = 5.64\n",
        "\n",
        "\n",
        " (b) Temperature of exterior pipe surface after 8 min =  42.92 degC\n",
        "\n",
        "\n",
        " (c) Heat Flux to the wall at 8 min =  -7362.49 W/m^2\n",
        "\n",
        "\n",
        " (d) Energy transferred to pipe per unit length after 8 min = -2.72e+07  J/m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5 Page 280 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "ha = 10.;          \t\t#[W/m^2.K] Heat Convection coefficientat air\n",
      "hw = 6000.;          \t#[W/m^2.K] Heat Convection coefficientat water\n",
      "k = 20.;         \t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 3000.;       \t\t#[kg/m^3] Density\n",
      "c = 1000.;            \t#[J/kg.K]  Specific Heat\n",
      "alpha = 6.66*math.pow(10,-6);     #[m^2/s]\n",
      "Tiw = 335+273.;        \t#[K] Initial Temp\n",
      "Tia = 400+273.;        \t#[K] Initial Temp\n",
      "Tsurr = 20+273.;     \t#[K] Temp of surrounding\n",
      "T = 50+273.;       \t\t#[K] Temp of center\n",
      "ro = .005;        \t\t#[m] radius of sphere\n",
      "#calculations\n",
      "\n",
      "#Using eqn 5.10 and\n",
      "Lc = ro/3.;\n",
      "Bi = ha*Lc/k;\n",
      "ta = rho*ro*c*2.30*(math.log10((Tia-Tsurr)/(Tiw-Tsurr)))/(3*ha);\n",
      "\n",
      "#From Table 5.1 at this Bi\n",
      "C1 = 1.367;\n",
      "eta = 1.8;\n",
      "Fo = -1*2.30*math.log10((T-Tsurr)/((Tiw-Tsurr)*C1))/(eta*eta);\n",
      "\n",
      "tw = Fo*ro*ro/alpha;\n",
      "#results\n",
      "\n",
      "print '%s %.1f %s' %(\"\\n (a) Time required to accomplish desired cooling in air ta =\",ta,\" s\")\n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Time required to accomplish desired cooling in water bath tw =\",tw,\"s\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Time required to accomplish desired cooling in air ta = 93.7  s\n",
        "\n",
        "\n",
        " (b) Time required to accomplish desired cooling in water bath tw = 3.08 s\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6 Page 288"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "k = .52;         \t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 2050;        \t\t#[kg/m^3] Density\n",
      "c = 1840;            \t#[J/kg.K]  Specific Heat\n",
      "Ti = 20+273.;        \t#[K] Initial Temp\n",
      "Ts = -15+273.;     \t\t#[K] Temp of surrounding\n",
      "T = 0+273.;        \t\t#[K] Temp at depth xm after 60 days\n",
      "t = 60*24*3600.;        #[sec] time perod\n",
      "#calculations\n",
      "\n",
      "alpha = k/(rho*c);      #[m^2/s]\n",
      "#Using eqn 5.57\n",
      "xm = math.erfc((T-Ts)/(Ti-Ts)) *2*math.pow((alpha*t),.5);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n Depth at which after 60 days soil freeze =\",xm,\" m\");\n",
      "print '%s' %(\"The answer given in textbook is wrong. Please check using a calculator.\");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Depth at which after 60 days soil freeze = 0.92  m\n",
        "The answer given in textbook is wrong. Please check using a calculator.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7 Page 293 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "k = .5;         \t\t#[W/m.K] Thermal Conductivity Healthy Tissue\n",
      "kappa = .02*math.pow(10,3);#[m] extinction coefficient\n",
      "p = .05;            \t# reflectivity of skin\n",
      "D = .005;            \t#[m] Laser beam Dia\n",
      "rho = 989.1  ;      \t#[kg/m^3] Density\n",
      "c = 4180 ;           \t#[J/kg.K]  Specific Heat\n",
      "Tb = 37+273;        \t#[K] Temp of healthy tissue\n",
      "Dt = .003 ;         \t#[m] Dia of tissue\n",
      "d = .02  ;          \t#[m] depth beneath the skin\n",
      "Ttss = 55+273 ;       \t#[K] Steady State Temperature\n",
      "Tb = 37+273 ;       \t#[K] Body Temperature\n",
      "Tt = 52+273 ;       \t#[K] Tissue Temperature\n",
      "q = .170 ;           \t#[W] \n",
      "#calculations\n",
      "\n",
      "#Case 12 of Table 4.1\n",
      "q = 2*math.pi*k*Dt*(Ttss-Tb);\n",
      "\n",
      "#Energy Balancing\n",
      "P = q*(D*D)*math.exp(kappa*d)/((1-p)*Dt*Dt);\n",
      "\n",
      "#Using Eqn 5.14\n",
      "t = rho*(math.pi*Dt*Dt*Dt/6.)*c*(Tt-Tb)/q;\n",
      "\n",
      "alpha=k/(rho*c);\n",
      "Fo = 10.3;\n",
      "#Using Eqn 5.68\n",
      "t2 = Fo*Dt*Dt/(4*alpha);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is \",q,\"W\"); \n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is\", P,\"W\")\n",
      "print '%s %.2f %s' %(\" \\n\\n (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is\",t,\"sec\")\n",
      "print '%s %.2f %s' %(\" \\n\\n (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is\",t2,\"sec\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is  0.17 W\n",
        "\n",
        "\n",
        " (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is 0.74 W\n",
        " \n",
        "\n",
        " (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is 5.17 sec\n",
        " \n",
        "\n",
        " (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is 191.63 sec\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8 Page 300"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import numpy\n",
      "import math\n",
      "from numpy import linalg\n",
      "#Operating Conditions\n",
      "\n",
      "k = 1.11 ;        \t\t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 3100;        \t\t\t#[kg/m^3] Density\n",
      "c = 820 ;          \t\t\t#[J/kg.K] Specific Heat\n",
      "#Dimensions of Strip\n",
      "w = 100*math.pow(10,-6);\t#[m] Width\n",
      "L = .0035 ;        \t\t\t#[m] Long\n",
      "d = 3000*math.pow(10,-10);\t#[m] Thickness\n",
      "delq = 3.5*math.pow(10,-3);\t#[W] heating Rate \n",
      "delT1 =1.37 ;     \t\t\t#[K] Temperature 1\n",
      "f1 = 2*math.pi ;   \t\t\t#[rad/s] Frequency 1\n",
      "delT2 =.71 ;     \t\t\t#[K] Temperature 2\n",
      "f2 = 200*math.pi;     \t\t#[rad/s] Frequency 2\n",
      "#calculations\n",
      "\n",
      "A = ([[delT1, -delq/(L*math.pi)],\n",
      "     [delT2, -delq/(L*math.pi)]]) ;\n",
      "\n",
      "C= ([[delq*-2.30*math.log10(f1/2.)/(2*L*math.pi)],\n",
      "    [delq*-2.30*math.log10(f2/2.)/(2*L*math.pi)]]) ;\n",
      "\n",
      "B = numpy.linalg.solve (A,C);\n",
      "\n",
      "alpha = k/(rho*c);\n",
      "delp = ([math.pow((alpha/f1),.5), math.pow((alpha/f2),.5)]);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s %.2f %s' %(\"\\n C2 = \",B[1],\"k =\",B[0],\" W/m.K \")\n",
      "print '%s %.2e %s %.2e %s'\t%(\"\\n\\n Thermal Penetration depths are\",delp[0],\" m and \",delp[1],\"m at frequency 2*pi rad/s and 200*pi rad/s\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " C2 =  5.35 k = 1.11  W/m.K \n",
        "\n",
        "\n",
        " Thermal Penetration depths are 2.64e-04  m and  2.64e-05 m at frequency 2*pi rad/s and 200*pi rad/s\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9 Page 305 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "L = .01;              #[m] Metre\n",
      "Tsurr = 250+273.;       #[K] Temperature\n",
      "h = 1100;              #[W/m^2.K] Heat Convective Coefficient\n",
      "q1 = math.pow(10,7);             #[W/m^3] Volumetric Rate\n",
      "q2 = 2*math.pow(10,7);             #[W/m^3] Volumetric Rate\n",
      "k = 30;                #[W/m.K] Conductivity\n",
      "a = 5*math.pow(10,-6);            #[m^2/s]\n",
      "#calculations\n",
      "\n",
      "delx = L/5.;        #Space increment for numerical solution\n",
      "Bi = h*delx/k;        #Biot  Number\n",
      "#By using stability criterion for Fourier Number\n",
      "Fo = 1/(2*(1+Bi));\n",
      "#By definition\n",
      "t = Fo*delx*delx/a;\n",
      "#results\n",
      "\n",
      "print '%s %.3f %s' %('\\n As per stability criterion delt =',t,' s, hence setting stability limit as .3 s.')\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " As per stability criterion delt = 0.373  s, hence setting stability limit as .3 s.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10 Page 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#Operating Conditions\n",
      "a\n",
      "delx = .075;                #[m] Metre\n",
      "T = 20+273.;                #[K] Temperature\n",
      "q = 3*math.pow(10,5);       #[W/m^3] Volumetric Rate\n",
      "\n",
      "#From Table A.1 copper 300 K\n",
      "k = 401;                    #[W/m.K] Conductivity\n",
      "a = 117*math.pow(10,-6);    #[m^2/s]\n",
      "#calculations and results\n",
      "\n",
      "#By using stability criterion reducing further Fourier Number\n",
      "Fo = 1./2.;\n",
      "#By definition\n",
      "delt = Fo*delx*delx/a;\n",
      "#From calculations,\n",
      "T11=125.19\n",
      "T12=48.1\n",
      "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 =',T11,' degC and T2 =',T12,'degC');\n",
      "\n",
      "#By using stability criterion reducing further Fourier Number\n",
      "Fo = 1/4;\n",
      "#By definition\n",
      "delt = Fo*delx*delx/a;\n",
      "#From calculations\n",
      "T21=118.86 \n",
      "T22=44.4\n",
      "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 = ',T21,'degC and T2 =',T22,'degC')\n",
      "\n",
      "#(c) Approximating slab as semi-infinte medium\n",
      "Tc = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k;\n",
      "t=120.                      #s\n",
      "#At interior point x=0.15 m\n",
      "x =.15;        #[metre]\n",
      "#Analytical Expression\n",
      "Tc2 = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k*math.exp(-x*x/(4*a*t))-q*x/k*(1-math.erf(.15/(2*math.sqrt(a*t))));\n",
      "\n",
      "print '%s %.1f %s' %(' \\n\\n (c) Approximating slab as a semi infinte medium, Analytical epression yields \\n At surface after 120 seconds = ,',Tc,'degC')\n",
      "print '%s %.1f %s' %('\\n At x=.15 m after 120 seconds = ',Tc2,'degC');\n",
      "#END\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Hence after 2 min, the surface and the desirde interior temperature T0 = 125.19  degC and T2 = 48.1 degC\n",
        "\n",
        " Hence after 2 min, the surface and the desirde interior temperature T0 =  118.86 degC and T2 = 44.4 degC\n",
        " \n",
        "\n",
        " (c) Approximating slab as a semi infinte medium, Analytical epression yields \n",
        " At surface after 120 seconds = , 25.6 degC\n",
        "\n",
        " At x=.15 m after 120 seconds =  45.4 degC\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}