{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9 : Computers and their application"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "example 9.1 page number 384"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "D = 38.*10**-3;    #in m\n",
      "U = 1.   #in m/s\n",
      "density = 998.   #in kg/cubic m\n",
      "viscosity = 8.*10**-4   #in Pa-s\n",
      "DC = 1.   #in m\n",
      "N = 10.\n",
      "e = 4.*10**-6;   #in m\n",
      "\n",
      "Re = (density*U*D)/viscosity;\n",
      "print  \"Reynolds number = %f\"%(Re)\n",
      "\n",
      "f = (4*math.log10((e/D)/3.7+(6.81/Re)**0.9))**-2;\n",
      "print \"friction factor = %f\"%(f);\n",
      "\n",
      "L = 3.14*DC*N;\n",
      "\n",
      "delta_Pstr = (2*f*U*density*L)/D;\n",
      "print \"pressure drop through straight pipe = %f Pa\"%(delta_Pstr)\n",
      "\n",
      "S = 1+3.54*(D/DC);\n",
      "print \"correction factor = %f\"%(S)\n",
      "\n",
      "delta_P = S*delta_Pstr\n",
      "print \"pressure drop of coil = %f Pa\"%(delta_P)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reynolds number = 47405.000000\n",
        "friction factor = 0.005330\n",
        "pressure drop through straight pipe = 8791.184173 Pa\n",
        "correction factor = 1.134520\n",
        "pressure drop of coil = 9973.774268 Pa\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "example 9.2 page number 384\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "U = 0.5   #in m/s\n",
      "N = 19.;\n",
      "DT = 0.026   #in m\n",
      "L = 2.7   #in m\n",
      "DS = 0.2   #in m\n",
      "e = 0.0002   #in m\n",
      "density = 836.  #in kg/cu m\n",
      "viscosity = 0.00032   #in Pa s\n",
      "Pr = 6.5;\n",
      "Prw = 7.6;\n",
      "\n",
      "HYDIA = (DS**2-N*DT**2)/(DS+N*DT);\n",
      "Re = HYDIA*U*density/viscosity;\n",
      "print  \"Reynolds number = %f\"%(Re)\n",
      "\n",
      "f = (4*math.log10((e/HYDIA)/3.7+(6.81/Re)**0.9))**-2;\n",
      "print \"friction factor = %f\"%(f);\n",
      "\n",
      "L = 3.14*DT*N;\n",
      "\n",
      "delta_Pstr = (2*f*U*density*L)/HYDIA;\n",
      "print \"pressure drop through straight pipe = %f Pa\"%(delta_Pstr)\n",
      "\n",
      "S = (Prw/Pr)**0.33;\n",
      "print \"correction factor = %f\"%(S)\n",
      "\n",
      "delta_P = S*delta_Pstr\n",
      "print \"pressure drop of coil = %f Pa\"%(delta_P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reynolds number = 51113.148415\n",
        "friction factor = 0.008158\n",
        "pressure drop through straight pipe = 270.362537 Pa\n",
        "correction factor = 1.052948\n",
        "pressure drop of coil = 284.677794 Pa\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "example 9.3 page number 385\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "MH = 10.   #in kg/s\n",
      "MC = 12.5  #in kg/s\n",
      "CPH = 4.2   #in kJ/kg\n",
      "CPC = 4.2   #in kJ/kg\n",
      "THI = 353.   #in K\n",
      "THO = 333.   #in K\n",
      "TCI = 300.   #in K\n",
      "U = 1.8    #in kW/sq m K\n",
      "\n",
      "Q = MH*CPH*(THI-THO);\n",
      "print \"heat load = %f J\"%(Q)\n",
      "\n",
      "TCO = Q/(MC*CPC)+TCI;\n",
      "print \"cold fluid outlet temperature = %f K\"%(TCO)\n",
      "\n",
      "\n",
      "DT1 = THI-TCO;\n",
      "DT2 = THO-TCO;\n",
      "\n",
      "LMTD = (DT1-DT2)/math.log(DT1/DT2);\n",
      "\n",
      "A = Q/(U*LMTD);\n",
      "print \"for co current flow area = %f sq m\"%(A);\n",
      "\n",
      "\n",
      "DT1 = THI-TCO;\n",
      "DT2 = THO-TCI;\n",
      "\n",
      "LMTD = (DT1-DT2)/math.log(DT1/DT2);\n",
      "\n",
      "A = Q/(U*LMTD);\n",
      "print \"for counter current flow area = %f sq m\"%(A);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "heat load = 840.000000 J\n",
        "cold fluid outlet temperature = 316.000000 K\n",
        "for co current flow area = 18.146440 sq m\n",
        "for counter current flow area = 13.347874 sq m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}