summaryrefslogtreecommitdiff
path: root/TRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'TRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb')
-rwxr-xr-xTRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb1902
1 files changed, 1902 insertions, 0 deletions
diff --git a/TRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb b/TRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb
new file mode 100755
index 00000000..006f8bc0
--- /dev/null
+++ b/TRANSPORT_PROCESSES_AND_UNIT_OPERATIONS/GeankoplisChapter04.ipynb
@@ -0,0 +1,1902 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0fc1c228b620788d89524e97706118d770bd4b5cefa6e66c9b45d50f744933c6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Principles of Steady-State Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1-1, Page number 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Loss Through Insulating Wall\n",
+ "\n",
+ "#Variable declaration\n",
+ "L = 0.0254 #Thickness of fibre insulating board\n",
+ "T1 = 352.7 #Temperature of hot face, \u00b0C\n",
+ "T2 = 297.1 #Temperature of cold face, \u00b0C\n",
+ "A = 1.0 #Suface area, m2\n",
+ "k = 0.048 #Thermal conductivity of fibre insulating board, W/(m.K)\n",
+ "\n",
+ "#Calculation\n",
+ "q = k*(T1-T2)/L\n",
+ "\n",
+ "#Result\n",
+ "print \"Heat loss per unit area:\", round(q,1), \"W/m2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat loss per unit area: 105.1 W/m2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2-1, Page number 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Length of tubing for Cooling Coil\n",
+ "from math import log, pi\n",
+ "\n",
+ "#Variable declaration \n",
+ "ri = 0.005 #Inside radius of tubing\n",
+ "ro = 0.02 #Outside radius of tubing\n",
+ "k = 0.151 #Thrmal conductivity of rubber tubing, W/mK\n",
+ "Ti = 274.9 #Inside wall temaperature, K\n",
+ "To = 297.1 #Outside wall temaperature, K\n",
+ "Q = 14.65 #Total heat tranfer rate, W\n",
+ "\n",
+ "#Calculation\n",
+ "Ai = 2*pi*ri*1.0\n",
+ "Ao = 2*pi*ro*1.0\n",
+ "Alm = (Ai-Ao)/(log(Ai/Ao))\n",
+ "Q1 = k*Alm*(To-Ti)/(ro-ri)\n",
+ "L = Q/Q1\n",
+ "\n",
+ "#Result\n",
+ "print \"Length of tubing required \",round(L,3) , \"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of tubing required 0.964 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3-1, Page number 223"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Flow Through an Insulated Wall of a Cold Sorage\n",
+ "\n",
+ "#Variable declaration\n",
+ "L1 = 0.0127 #Thickness of inner wall, m\n",
+ "L2 = 0.1016 #Thickness of middle wall, m\n",
+ "L3 = 0.0762 #Thickness of outer wall, m\n",
+ "k1 = 0.151 #Thermal conductivity of inner wall, W/mK\n",
+ "k2 = 0.0433 #Thermal conductivity of middle wall, W/mK\n",
+ "k3 = 0.768 #Thermal conductivity of outer wall, W/mK\n",
+ "A = 1.0 #Heat Area area, m2\n",
+ "Ti = 255.4 #Inner wall surface temperature, K\n",
+ "To = 297.1 #outer wall surface temperature, k\n",
+ "\n",
+ "#Calculation\n",
+ "R1 = L1/(k1*A) # Resistance of the inner wall, K/W\n",
+ "R2 = L2/(k2*A) # Resistance of the middle wall, K/W\n",
+ "R3 = L3/(k3*A) # Resistance of the outer wall, K/W\n",
+ "Rt = R1 + R2 + R3 \n",
+ "q = (Ti-To)/Rt\n",
+ "T2 = Ti - q*R1\n",
+ "\n",
+ "#Result\n",
+ "print 'Resistance offered by 1st wall %5.4f K/W'%(R1)\n",
+ "print 'Resistance offered by 2nd wall %5.4f K/W'%(R2)\n",
+ "print 'Resistance offered by 3rd wall %5.4f K/W'%(R3)\n",
+ "print 'Total Resistance of composite wall %5.4f K/W'%(Rt)\n",
+ "print \"Heat loss\",round(q,2),'W/m2'\n",
+ "print \"Temperature at interface between pine wood and cork\",round(T2,2), \"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance offered by 1st wall 0.0841 K/W\n",
+ "Resistance offered by 2nd wall 2.3464 K/W\n",
+ "Resistance offered by 3rd wall 0.0992 K/W\n",
+ "Total Resistance of composite wall 2.5297 K/W\n",
+ "Heat loss -16.48 W/m2\n",
+ "Temperature at interface between pine wood and cork 256.79 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3-2, Page number 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Loss from an Insulated pipe\n",
+ "from math import log, pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "ks = 21.63 #Heat transfer coefficient of the pipe (W/K.m)\n",
+ "ki = 0.2423 #Heat transfer coefficient of the insulation (W/K.m)\n",
+ "d1 = 0.0254 #Inner diameter of the pipe (m)\n",
+ "d2 = 0.0508 #Inner diameter of the insulation (m)\n",
+ "thks = 0.0254 \n",
+ "T1 = 811 #The wall temperature of the pipe (K)\n",
+ "T3 = 310.8 #The temperature of the outside wall of the insulation (k)\n",
+ "L = .305 #Length of the pipe (m)\n",
+ "\n",
+ "#Calculation\n",
+ "r1 =d1/2.\n",
+ "r2 = d2/2.\n",
+ "r3 = r2 + thks\n",
+ "A1 = 2*pi*r1*L\n",
+ "A2 = 2*pi*r2*L\n",
+ "A3 = 2*pi*r3*L\n",
+ "A12lm = (A1-A2)/log(A1/A2)\n",
+ "A23lm = (A2-A3)/log(A2/A3)\n",
+ "R12 = (r2-r1)/(ks*A12lm)\n",
+ "R23 = (r3-r2)/(ki*A23lm)\n",
+ "Q = (T1-T3)/(R12+R23)\n",
+ "T2 = T1 - Q*R12\n",
+ "\n",
+ "#Results\n",
+ "print \"Temperature of Interface\", round(T2,1) ,\"K\"\n",
+ "print \"Heat loss\", round(Q,1) ,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of Interface 805.5 K\n",
+ "Heat loss 331.4 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3-3, Page number 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Loss by Convection and Conduction and Overall U\n",
+ "from math import log, pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "di = 0.824 #Inner diameter of the pipe (m)\n",
+ "do = 1.05 #Outer diameter of the pipe (m)\n",
+ "thki = 1.5\n",
+ "hi = 1000 #Convective heat transfer coefficient (btu/h.ft2)\n",
+ "ho = 2. #Convective heat transfer coefficient on the outside (btu/h.ft2) \n",
+ "km = 26. #Mean thermal cunductivity of metal (btu/h.ft)\n",
+ "ki = 0.037 #Mean thermal cunductivity of insulation (btu/h.ft)\n",
+ "Ts = 267 #Surface temperature of the pipe (F)\n",
+ "Ta = 80 #Surrounding air temperature (F)\n",
+ "L = 1. \n",
+ "\n",
+ "#Calculation\n",
+ "ri = di/(12.*2.)\n",
+ "r1 = do/(12.*2.)\n",
+ "ro = r1 + thki/12.\n",
+ "Ai = 2*pi*ri*L\n",
+ "A1 = 2*pi*r1*L\n",
+ "Ao = 2*pi*ro*L\n",
+ "Ai1lm = (Ai-A1)/log(Ai/A1)\n",
+ "A1olm = (A1-Ao)/log(A1/Ao)\n",
+ "Ri1 = (r1-ri)/(km*Ai1lm)\n",
+ "R1o = (ro-r1)/(ki*A1olm)\n",
+ "Ri = 1./(hi*Ai)\n",
+ "Ro = 1./(ho*Ao)\n",
+ "Rt = Ri+Ri1+R1o+Ro\n",
+ "Q = (Ts-Ta)/(Rt)\n",
+ "Ui = 1./(Ai*Rt)\n",
+ "Q1 = Ui*Ai*(Ts-Ta)\n",
+ "\n",
+ "#Result\n",
+ "print \"Heat lost to the surrounding using resistance\",round(Q,1), \"Btu/hr\"\n",
+ "print \"Heat lost to the surrounding using Overall Heat TRansfer Coeff\",round(Q1,1), \"Btu/hr\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat lost to the surrounding using resistance 29.8 Btu/hr\n",
+ "Heat lost to the surrounding using Overall Heat TRansfer Coeff 29.8 Btu/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3-4, Page number 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Generation in a cylinder\n",
+ "from math import pi\n",
+ "#Variable declaration\n",
+ "i = 200. #Current through the wire, A\n",
+ "r = 0.001268 #radius of the wire, m\n",
+ "L = 0.91 #Length of wire, m\n",
+ "R = 0.126 #Resistance of stainless steel, ohm\n",
+ "Tw = 422.1 #Wall temperature of the wire, K\n",
+ "k = 22.5 #Thermal conductivity of steel, W/mK \n",
+ "\n",
+ "#Calculation\n",
+ "Q = i**2*R\n",
+ "qdot = Q/(pi*r**2*L)\n",
+ "To = Tw + qdot*r**2/(4*k)\n",
+ "\n",
+ "#Result\n",
+ "print \"Temperature at the centre of the wire\",round(To,1),\"K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature at the centre of the wire 441.7 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3-5, Page number 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Insulating an Electrical Wire and Critical Radius\n",
+ "from math import log, pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 1.5 #Diameter of electrical wire, mm\n",
+ "thki = 2.5 #Thickness of insulation, mm\n",
+ "Ta = 300. #Temrature of air, K\n",
+ "ho = 20. #Outside Heat transfer coefficient, W/m2.K\n",
+ "ki = 0.4 #Thermal conductivity of insulation, W/mK\n",
+ "Tw = 400. #Surface temperature of the wire, K\n",
+ "L = 1. #Length of wire, m\n",
+ "#Calculation\n",
+ "r1 = d*1e-3/2.\n",
+ "r2 = r1+thki*1e-3\n",
+ "r2c = ki/ho\n",
+ "A1 = 2*pi*r1*L\n",
+ "Q = ho*A1*(Tw-Ta)\n",
+ "\n",
+ "Qi = 2*pi*L*(Tw-Ta)/(log(r2/r1)/ki + 1./(ho*r2))\n",
+ "#Result\n",
+ "print \"(a) Critical radius of insulation\",round(r2c*1e3,1),\"mm\"\n",
+ "print \"(b) Heat Transfer rate without insulation\",round(Q,2),\"W/m\"\n",
+ "print \"(c) Heat Transfer rate with insulation\",round(Qi,2),\"W/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Critical radius of insulation 20.0 mm\n",
+ "(b) Heat Transfer rate without insulation 9.42 W/m\n",
+ "(c) Heat Transfer rate with insulation 32.98 W/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4-1, Page number 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Two dimenssional conduction by Graphical Proceedure \n",
+ "\n",
+ "#Variable declaration\n",
+ "T1 = 600. #Inside temperature, K\n",
+ "T2 = 400. #Outside temperature, K\n",
+ "k = 0.9 #Thermal conductivity, W/mK\n",
+ "L = 5. #Length of flue, m\n",
+ "N = 4 #Number of temperature subdivisions\n",
+ "M = 9.25 #\n",
+ "#Calculation\n",
+ "\n",
+ "Q = 4*(M*k*L*(T1-T2)/4.)\n",
+ "\n",
+ "#Result\n",
+ "print \"Heat Transfer Rate :\",round(Q), \"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Transfer Rate : 8325.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5-1, Page number 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heating of Air in Turbulent Flow\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tc = 477.6 #Average temperature of air, K\n",
+ "v = 7.62 #Velocity of air, m/s\n",
+ "di = 0.0254 #inner diameter, m \n",
+ "Ts = 488.7 #Steam temperature, K\n",
+ "muab = 2.6e-5 #Viscosity of air, Pa.s\n",
+ "ka = 0.03894 #Thermal conductivity of air, W/mK\n",
+ "Npr = 0.686\n",
+ "muw = 2.64e-5 #Viscosity of air at wall temperature, Pa.s\n",
+ "P = 206.8 #Pressure, kPa \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "rhoa =28.97*(1./22.414)*(P/101.325)*273.2/Tc\n",
+ "Nre = di*v*rhoa/muab\n",
+ "Nnu = 0.027*Nre**0.8*Npr**(1./3)*(muab/muw)**0.14\n",
+ "hL = Nnu*ka/di\n",
+ "q = hL*(Ts-Tc)\n",
+ "\n",
+ "#Result\n",
+ "print \"Average Heat Transfer Coefficient for L/D > 60\", round(hL,2), \"W/m2.K\"\n",
+ "print \"Heat Flux\", round(q,2), \"W/m2\"\n",
+ "print 'The answers different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Heat Transfer Coefficient for L/D > 60 63.36 W/m2.K\n",
+ "Heat Flux 703.33 W/m2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5-2, Page number 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Water Heated by Steam, Trial and Error Solution\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "di = 0.0266 #Inner diameter of the pipe (m)\n",
+ "do = 0.0334 #Outer diameter of the pipe (m)\n",
+ "L = 0.305 #Lenth of pipe, m\n",
+ "T = 65.6 #Average temperature of the steel pipe (deg C)\n",
+ "v = 2.44 #Velocity of the water flow (m/s)\n",
+ "Ts = 107.8 #Temperature of the steam (deg C)\n",
+ "ho = 10500. #Heat transfer coefficient on the steam side (W/m2.K)\n",
+ "# Properties of water at T=65.6\u00b0C\n",
+ "Npr = 2.72 #Prandtl number\n",
+ "rho = 980. #Density of water (kg/m3)\n",
+ "kw = 0.663 #Thermal conductivity of Water (W/m.K)\n",
+ "mu = 4.32e-4 #Viscosity of water (Pa.s)\n",
+ "k = 45. #Thermal conductivity of metal wall (W/m.K)\n",
+ "# Properties of water at T=80\u00b0C\n",
+ "muw = 3.56e-4\n",
+ "\n",
+ "#Calculation\n",
+ "#Part A\n",
+ "Nre = di*v*rho/mu\n",
+ "Nnu = 0.027*(Nre**0.8)*(Npr**(1./3))*(mu/muw)**0.14\n",
+ "hi = Nnu*kw/di\n",
+ "\n",
+ "#Part B\n",
+ "Ai = pi*di*L\n",
+ "Ao = pi*do*L\n",
+ "Am = pi*L*(do+di)/2\n",
+ "Ri = 1./(hi*Ai)\n",
+ "Ro = 1./(ho*Ao)\n",
+ "Rm = (do-di)/(2*k*Am)\n",
+ "SR = Ri+Ro+Rm\n",
+ "DelT = (Ts-T)\n",
+ "DelTw = Ri*DelT/SR\n",
+ "Tw = T + DelTw\n",
+ "\n",
+ "Ui = 1.0/(Ai*SR)\n",
+ "Q = Ui*Ai*DelT\n",
+ "#Result\n",
+ "print \"Inside Heat Transfer Coefficient:\", round(hi), \"W/m2.K\"\n",
+ "print \"The assumed temperature of water 80\u00b0C is comparable with Calculated\", round(Tw,2)\n",
+ "print \"Heat Transfer Rate\", round(Q),\"W\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inside Heat Transfer Coefficient: 13153.0 W/m2.K\n",
+ "The assumed temperature of water 80\u00b0C is comparable with Calculated 80.26\n",
+ "Heat Transfer Rate 4914.0 W\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5-3, Page number 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Liquid-Metal Heat Transfer Inside a Tube\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "mdot = 4. #Flowrate of liquid metal (kg/s)\n",
+ "di = 0.05 #Inner diameter of pipe (m)\n",
+ "Ti = 500. #Initial temperature of liquid entering (K)\n",
+ "To = 505. #Final temperature of liquid leaving (K)\n",
+ "mu = 7.1e-4 #Viscosity of the liquid (Pa.s) \n",
+ "rho = 7400. #Density of the liquid (kg/m3)\n",
+ "cp = 120. #Specific heat (J/kg.K)\n",
+ "k = 13. #Heat transfer coefficient (W/m.K)\n",
+ "delT = 30.\n",
+ "\n",
+ "#Calculation\n",
+ "Ac = pi*di**2/4.\n",
+ "G = mdot/Ac\n",
+ "Nre = di*G/mu\n",
+ "Npr = cp*mu/k\n",
+ "Npe = Nre*Npr\n",
+ "Nnu = 0.625*Npe**0.4\n",
+ "hL = Nnu*k/di\n",
+ "Q = mdot*cp*(To-Ti)\n",
+ "As = Q/(hL*delT) \n",
+ "L = As/(pi*di)\n",
+ "\n",
+ "#Result\n",
+ "print \"Heat Transfer coefficient\",round(hL,2),\"W/m2.K\"\n",
+ "print \"The Length of the tube required\",round(L,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Transfer coefficient 2512.75 W/m2.K\n",
+ "The Length of the tube required 0.203 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5-4, Page number 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Transfer Area and Log Mean Temperature Difference\n",
+ "from math import log\n",
+ "#Variable declaration \n",
+ "cpm = 2300. #Specific heat of the hydrocarbon oil (J/kg.K)\n",
+ "Ti = 371.9 #Initial temperature of the oil (K)\n",
+ "To = 349.7 #Final temperature of the oil (K)\n",
+ "mdotoil = 3630. #Flowrate of oil (kg/h)\n",
+ "mdotw = 1450. #Flowrate of water (kg/h)\n",
+ "cpw = 4187. #Specific heat of water (J/kg.K)\n",
+ "Twi = 288.6 #Temperature of the inlet water (K)\n",
+ "Ui = 340. #Overall heat tranfer coefficient (W/m2.K)\n",
+ "\n",
+ "#Calculations \n",
+ "Q = mdotoil*cpm*(Ti-To)/3600\n",
+ "Two = Twi + Q/((mdotw/3600)*cpw)\n",
+ " #Contercurrent\n",
+ "delT1 = To - Twi\n",
+ "delT2 = Ti - Two\n",
+ "deltLM = (delT1-delT2)/log(delT1/delT2)\n",
+ "Ai = Q/(Ui*deltLM)\n",
+ "#Result\n",
+ "print \"Heat lost by oil\",round(Q,1),\"W\"\n",
+ "print \"Outlet Temperature of cooling water\",round(Two,1),\"K\"\n",
+ "print \"Area required for cooling in Countercurrent flow:\",round(Ai,2),\"m2\"\n",
+ "\n",
+ " #Co-current/Parallel flow\n",
+ "delT1 = Ti - Twi\n",
+ "delT2 = To - Two\n",
+ "deltLM = (delT1-delT2)/log(delT1/delT2)\n",
+ "Ai = Q/(Ui*deltLM)\n",
+ "\n",
+ "#Result\n",
+ "print \"Area required for cooling in Co-current/Parallel flow:\",round(Ai,2),\"m2\"\n",
+ "print 'The answers different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat lost by oil 51485.5 W\n",
+ "Outlet Temperature of cooling water 319.1 K\n",
+ "Area required for cooling in Countercurrent flow: 2.66 m2\n",
+ "Area required for cooling in Co-current/Parallel flow: 2.88 m2\n",
+ "The answers different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5-5, Page number 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Laminar Heat Transfer and Trial and Error\n",
+ "from scipy import interpolate\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable declaration SI Units \n",
+ "Ti = 150. #Initial temperature of the hydrocarbon oil (F) \n",
+ "di = 0.0303 #Inside diameter of the pipe (ft)\n",
+ "L = 15. #Length of the tube (ft)\n",
+ "mdot = 80. #Flowrate of the oil (lbm/h)\n",
+ "Tw = 350. #Inside wall temperature of the wall (F)\n",
+ "Cp = 0.5 #Specific heat of oil (btu/lbm)\n",
+ "km = 0.083 #Thermal conductivity, Btu/(h.ft.\u00b0F) \n",
+ "T=[150,200,250,300,350] #Temperature of hydrocarbon oil, \u00b0F\n",
+ "mu=[6.5,5.05,3.8,2.82,1.95] #Viscosity of hydrocarbon oil, \u00b0F\n",
+ "cf = 2.4191 #Specific Heat of hydrocarbon oil, \u00b0F\n",
+ "\n",
+ "#Calculations \n",
+ "f = interpolate.interp1d(T,mu)\n",
+ "muw = cf*f(Tw)\n",
+ "Ac = pi*di**2/4.\n",
+ "G = mdot/Ac\n",
+ "Toass = 250.\n",
+ "xx = 1.2\n",
+ "#Calculation\n",
+ "while(xx > 0.0001):\n",
+ " Tb = int((Ti+Toass)/2.)\n",
+ " mub = cf*f(Tb)\n",
+ " Nre = di*G/mub\n",
+ " Npr = Cp*mub/km\n",
+ " Nnu = 1.86*(Nre*Npr*di/L)**(1./3)*(mub/muw)**0.14\n",
+ " h = Nnu*km/di\n",
+ " tau = h*pi*di*L/(mdot*Cp)\n",
+ " tau2 = tau/(1+tau/2.)\n",
+ " To = (tau*(Tw-Ti/2.)+Ti)/(1+tau/2.)\n",
+ " xx = abs((Toass - To)/Toass)\n",
+ " Toass = To\n",
+ "\n",
+ "#Result\n",
+ "print \"The outlet temperature of the oil\",round(Toass,0),\"\u00b0F\"\n",
+ "print \"The heat transfer coefficient calculated is\",round(h,2),\"Btu/(hr.ft2)\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The outlet temperature of the oil 255.0 \u00b0F\n",
+ "The heat transfer coefficient calculated is 20.03 Btu/(hr.ft2)\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6-1, Page number 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Cooling of Cooper Fin\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 0.051 #length of square fin, m\n",
+ "T = 82.2 #Temperature of fin, \u00b0C\n",
+ "Ta = 15.6 #Temperature of air, \u00b0C\n",
+ "P = 1. #Absolute Pressure of air, atm\n",
+ "v = 12.2 #Velocity of air, m/s\n",
+ "k = 0.028 #Thermal conductivity of air at 48.9\u00b0C, W/(m.K)\n",
+ "rho = 1.097 #Density of air at 48.9\u00b0C, kg/m3\n",
+ "mu = 1.95e-5 #viscosity of air at 48.9\u00b0C, W/(m.K)\n",
+ "Npr = 0.704 #Prandtl numbe for air at 48.9\u00b0C, W/(m.K)\n",
+ "\n",
+ "#Calculation\n",
+ "Tf = (T+Ta)/2.\n",
+ "Nre = l*v*rho/mu\n",
+ "Nnu = 0.664*Nre**0.5*Npr**(1./3.)\n",
+ "ha = Nnu*k/l\n",
+ "\n",
+ "Nnu = 0.0366*Nre**0.8*Npr**(1./3.)\n",
+ "hb = Nnu*k/l\n",
+ "#Result\n",
+ "print \" A) Heat Transfer Coeficient for Laminar Flow\", round(ha,1),\"W/(m2.K)\"\n",
+ "print \" B) Heat Transfer Coeficient for Turbulent Conditions\", round(hb,1),\"W/(m2.K)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " A) Heat Transfer Coeficient for Laminar Flow 60.7 W/(m2.K)\n",
+ " B) Heat Transfer Coeficient for Turbulent Conditions 77.2 W/(m2.K)\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6-2, Page number 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Cooling of Sphere\n",
+ "\n",
+ "#Variable declaration\n",
+ "d = 0.051 #Diameter of sphere, m\n",
+ "T = 82.2 #Temperature of fin, \u00b0C\n",
+ "Ta = 15.6 #Temperature of air, \u00b0C\n",
+ "P = 1. #Absolute Pressure of air, atm\n",
+ "v = 12.2 #Velocity of air, m/s\n",
+ "k = 0.028 #Thermal conductivity of air at 48.9\u00b0C, W/(m.K)\n",
+ "rho = 1.097 #Density of air at 48.9\u00b0C, kg/m3\n",
+ "mu = 1.95e-5 #viscosity of air at 48.9\u00b0C, W/(m.K)\n",
+ "Npr = 0.704 #Prandtl numbee for air at 48.9\u00b0C, W/(m.K)\n",
+ "hflat = 77.2 #Film coeff for heat transfer from flat plate, W/(m2.K)\n",
+ "\n",
+ "#Calculation\n",
+ "Tf = (T+Ta)/2.\n",
+ "Nre = d*v*rho/mu\n",
+ "Nnu = 2.+ 0.6*Nre**0.5*Npr**(1./3.)\n",
+ "h = Nnu*k/d\n",
+ "#Result\n",
+ "print \"Reynolds number\", round(Nre)\n",
+ "print \"Heat transfer coeffiecient\", round(h,1), \"W/(m2.K) is less than Heat Transfer coeff for flat plate in prevoius problem\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number 35003.0\n",
+ "Heat transfer coeffiecient 55.9 W/(m2.K) is less than Heat Transfer coeff for flat plate in prevoius problem\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6-3, Page number 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heating of air by a bank of tubes\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "do = 0.0254 #Outside Diameter of tube,m\n",
+ "L = 0.305 #Length of tube bank,m \n",
+ "Sn = 0.0381 #Normal Tube spacing, m\n",
+ "Sp = 0.0381 #Parallel tube spacing,m\n",
+ "Nt = 40 #Number of tubes in bank\n",
+ "Tw = 57.2 #Surface temperature of tubes, \u00b0C\n",
+ "Ti = 15.6 #Air inlet temperature, \u00b0C\n",
+ "To = 21.1 #Assumed oultet temperature of air, \u00b0C\n",
+ "P = 1. #Air Pressure, atm abs \n",
+ "v = 7.62 #Velocity of air, m/s\n",
+ "rho = 1.137 #Density of air, kg/m3\n",
+ "mu = 1.9e-5 #Viscosity of air, Pa.s\n",
+ "Cp = 1004.8 #Specific heat of air, kJ/(kg.K)\n",
+ "Npr = 0.705 #Prandtl number of air\n",
+ "k = 0.027 #Thermal conductivity of air,W/(m.K)\n",
+ "rho156 = 1.2224 #Density of air at 15.6\u00b0C, kg/m3\n",
+ "#Calculation\n",
+ "snd = Sn/do\n",
+ "spd = Sp/do\n",
+ "#From table 4.6-2 \n",
+ "C, m = 0.278, 0.620\n",
+ "er = 1.0\n",
+ "while er >= 0.2:\n",
+ " Tb = (Ti+To)/2.\n",
+ " Tf = (Tw+Tb)/2.\n",
+ " vmax = v*Sn/(Sn-do)\n",
+ " Nre = do*vmax*rho/mu\n",
+ " Nnu = C*Nre**m*Npr**(1./3.)\n",
+ " h = Nnu*k/do\n",
+ " #Correction factor for heat transfer coefficient from table4.3-3 for four transverse tubes\n",
+ " #is 0.9 \n",
+ " hc = 0.9*h\n",
+ " A =Nt*pi*do*L\n",
+ " Q = hc*A*(Tw-Tb)\n",
+ " Af = 10*Sn*L #Frontal Area\n",
+ " m = Af*v*rho156\n",
+ " delT = Q/(m*Cp)\n",
+ " Tout = Ti + delT\n",
+ " er = abs(To-Tout)\n",
+ " To = (To+Tout)/2\n",
+ " \n",
+ "#Result\n",
+ "print \"Total Heat transfer Rate\", round(Q),\"W\"\n",
+ "print 'The calculated outlet bulk gas temperature is %4.2f \u00b0C'%To\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Heat transfer Rate 5852.0 W\n",
+ "The calculated outlet bulk gas temperature is 21.04 \u00b0C\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7-1 Page Number 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Natural Convection from Vertical Wall of an Oven\n",
+ "\n",
+ "#Variable Declaration\n",
+ "H = 1. #Height of the wall (ft)\n",
+ "Tw = 450 #Temperature of the wall (deg F)\n",
+ "Tb = 100. #Temperature of the wall in contact (F)\n",
+ "L = 1. #Length of the wall (m)\n",
+ "k = 0.0198 #Heat transfer cofficient of the wall (btu/h.ft.F)\n",
+ "rho = 0.0541 #Density of air (lbm/ft3)\n",
+ "Pr = 0.69 #Prandtl number\n",
+ "mu = 0.0562 #Viscosity of air (cp)\n",
+ "g = 32.174 #Graitational accleration (ft/s2)\n",
+ "\n",
+ "#Calculations\n",
+ " #English Units\n",
+ "Tf = (Tw+Tb)/2.\n",
+ "beta = 1./(460.+Tf)\n",
+ "delT = Tw - Tb\n",
+ "Gr = L**3*rho**2*g*beta*3600**2*delT/(mu**2)\n",
+ "a = 0.59\n",
+ "m = 1./4.\n",
+ "Nu = a*(Gr*Pr)**m\n",
+ "h = k*Nu/L\n",
+ "A = L*H\n",
+ "Q = h*A*delT\n",
+ "\n",
+ "#Results\n",
+ "print \"In English Units\"\n",
+ "print \"The heat transfer cofficient is \",round(h,2),\"btu/h.ft2.F\"\n",
+ "print \"The heat transfer rate across the wall is \",round(Q),\"btu/h\"\n",
+ "\n",
+ " #SI Units\n",
+ "H = 0.305 #Height of the wall (m)\n",
+ "Tw = 505.4 #Temperature of the wall (K)\n",
+ "Tb = 311.0 #Temperature of the wall in contact (K)\n",
+ "L = 0.305 #Length of the wall (m)\n",
+ "k = 0.0343 #Thermal conductivity of the wall (W/(m.K)\n",
+ "rho = 0.867 #Density of air (kg/m3)\n",
+ "Pr = 0.69 #Prandtl number\n",
+ "mu = 2.32e-5 #Viscosity of air (cp)\n",
+ "g = 9.806 #Graitational accleration (m/s2)\n",
+ "\n",
+ "#Calculations\n",
+ "Tf = (Tw + Tb)/2\n",
+ "beta = 1./Tf\n",
+ "delT = Tw - Tb\n",
+ "Gr = L**3*rho**2*g*beta*delT/(mu**2)\n",
+ "a = 0.59\n",
+ "m = 1./4.\n",
+ "Nu = a*(Gr*Pr)**m\n",
+ "h = k*Nu/L\n",
+ "A = L*H\n",
+ "Q = h*A*delT\n",
+ "\n",
+ "#Results\n",
+ "print \"In SI Units\"\n",
+ "print \"The heat transfer cofficient is \",round(h,2),\"W/(m2.K)\"\n",
+ "print \"The heat transfer rate across the wall is \",round(Q,1),\"W\"\n",
+ "\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In English Units\n",
+ "The heat transfer cofficient is 1.24 btu/h.ft2.F\n",
+ "The heat transfer rate across the wall is 434.0 btu/h\n",
+ "In SI Units\n",
+ "The heat transfer cofficient is 7.05 W/(m2.K)\n",
+ "The heat transfer rate across the wall is 127.5 W\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7-2 Page Number 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Natural Convection and Simplified Equation\n",
+ "\n",
+ "#Variable Declaration\n",
+ "#From previous Example 4.7-1 Page Number 254\n",
+ "L = 0.305 #Length of the wall (m)\n",
+ "delT = 194.4 #Temperature diffrence (K)\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "A = 0.305*0.305 #Area of the wall (m2)\n",
+ "h = 1.37*(delT/L)**.25\n",
+ "Q = h*A*delT\n",
+ "\n",
+ "#Results\n",
+ "print \"The heat transfer coefficient calculated is \",round(h,2),\"W/m2/K\"\n",
+ "print \"The heat transfer rate across the wall is \",round(Q,2),\"W\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat transfer coefficient calculated is 6.88 W/m2/K\n",
+ "The heat transfer rate across the wall is 124.48 W\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7-3 Page Number 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Natural Convection in Enclosed Vertical Space\n",
+ "\n",
+ "#Variable Declaration\n",
+ "L = 0.6 #Length of the plate (m) \n",
+ "W = 0.4 #Width of the plates (m)\n",
+ "d = 0.03 #Distance between the plates (m)\n",
+ "T1 = 394.3 #Temperature at one side of the plate (k)\n",
+ "T2 = 366.5 #Temperature at the other side of the plate (k)\n",
+ "rho = 0.9295 #Density of air (kg/m3)\n",
+ "mu = 2.21e-5 #Viscosity of air (Pa.s)\n",
+ "k = 0.03219 #Heat transfer coefficient of wall (W/m.K)\n",
+ "Pr = 0.693 #Prandtl number\n",
+ "g = 9.806 #Gravitational accleration (m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "Tf = (T1 + T2)/2.\n",
+ "beta = 1/Tf\n",
+ "Gr = d**3*rho**2*g*beta*(T1-T2)/(mu**2)\n",
+ "h = k/d*0.2*(Gr*Pr)**(1./4.)/(L/d)**(1./9.)\n",
+ "A = L*W\n",
+ "Q = h*A*(T1-T2)\n",
+ "\n",
+ "#Results\n",
+ "print \"Heat Transfer Coefficient\", round(h,3),\"W/m2.K\"\n",
+ "print \"Heat Transfer Rate\", round(Q,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Transfer Coefficient 1.909 W/m2.K\n",
+ "Heat Transfer Rate 12.74 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8-1 Page Number 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Rate of Heat Transfer in a Jacketed Kettle \n",
+ "\n",
+ "#Variable Declaration\n",
+ "Tjs = 115.6 #Temperature of steam being condensed (deg C)\n",
+ "dki = 0.656 #Inside diameter of the kettle (m)\n",
+ "hk = 0.984 #Height of the kettle (m)\n",
+ "tw = 0.0032 #Thickness of the wall of the jacket (m)\n",
+ "k = 16.27 #Heat transfer coefficient of the wall (W/m.K)\n",
+ "hi = 10200. #Condensing steam cofficient (W/m2.K)\n",
+ "Tsat = 100. #Saturation temperature (deg C)\n",
+ "A = 1.0\n",
+ "\n",
+ "#Calculations\n",
+ "Twa = 110.\n",
+ "Ri = 1./(hi*A)\n",
+ "Rw = tw/(k*A)\n",
+ "Riw = Ri + Rw\n",
+ "\n",
+ "xx = 1.2\n",
+ "while(xx > 0.1):\n",
+ " delT = Twa - Tsat \n",
+ " ho = 5.56*delT**3\n",
+ " q = ho*delT\n",
+ " Ro = 1./(ho*A)\n",
+ " Rs = Riw + Ro\n",
+ " delTc = Ro*(Tjs-Tsat)/Rs\n",
+ " Tw = Tsat + delTc\n",
+ " xx = abs(Tw-Twa)\n",
+ " Twa = (Tw + Twa)/2.\n",
+ "#Results vary because more iterations are done\n",
+ "#Result\n",
+ "print \"Ri:%5.2e\" %Ri\n",
+ "print \"Rw:%5.2e\" %Rw\n",
+ "print \"Ro:%5.2e\" %Ro\n",
+ "print 'Wall Temperature: %4.1f'%Tw\n",
+ "print \"Boiling Heat Transfer Coefficient\", round(ho,1),\"W/(m2.K)\"\n",
+ "print \"Results vary because more iterations are done\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ri:9.80e-05\n",
+ "Rw:1.97e-04\n",
+ "Ro:3.28e-04\n",
+ "Wall Temperature: 108.2\n",
+ "Boiling Heat Transfer Coefficient 3051.0 W/(m2.K)\n",
+ "Results vary because more iterations are done\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8-2 Page Number 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Condensation on Vertical Tubes\n",
+ "from math import pi\n",
+ "#Variable Declaration English Units\n",
+ "Ps, Tsat = 10., 193 #Saturation Pressure ans temperature, psia and \u00b0F\n",
+ "L , do = 1., 1./12 #Lenght and ouside diameter of the tube, m\n",
+ "Tw = 187. #Wall temperature, \u00b0F\n",
+ "hv, hl = 1143.3, 161. #Latent heat of evaporation and enthalpy of liquid \n",
+ "vl,vg = 0.01657, 40.95 #specific volume of liquid and vapor, ft3/lbm\n",
+ "mul = 0.324 #Viscosity of liquid, lbm/(ft.hr)\n",
+ "kl = 0.390 #Thermal conductivity of liquid, Btu/(ft.hr.\u00b0F)\n",
+ "g = 32.174 #Gravitational acceleration, ft/s2\n",
+ "\n",
+ "#Calculation English Units\n",
+ "g = g*3600**2\n",
+ "mul = mul*2.4191\n",
+ "rhol , rhov = 1./vl , 1./vg\n",
+ "Tf = (Tw + Tsat)/2.\n",
+ "hfg = hv-hl\n",
+ "delT = Tsat - Tw\n",
+ "Nu = 1.13*(rhol**2*g*hfg*L**3/(mul*kl*delT))**(1./4)\n",
+ "h=Nu*kl/L\n",
+ "A = pi*do*L\n",
+ "Q = h*A*delT\n",
+ "mdot = Q/hfg\n",
+ "Re = 4*mdot/(pi*do*mul)\n",
+ "print \"Average heat transfer coefficient\",round(h,2),\"Btu/(h.ft2.\u00b0F)\"\n",
+ "print \"Reynolds number is,\", round(Re,1), \"hence flow is laminar\"\n",
+ "\n",
+ "#Variable Declaration SI Units\n",
+ "Ps, Tsat = 68.9, 89.44\n",
+ "L , do = 0.305, 0.0254\n",
+ "Tw = 86.11\n",
+ "hv, hl = 2657800, 374600\n",
+ "vl,vg = 0.01657/16, 40.95/16\n",
+ "mul = 3.24e-4\n",
+ "kl = 0.675\n",
+ "g = 9.806\n",
+ "\n",
+ "#Calculation SI Units\n",
+ "\n",
+ "rhol , rhov = 1./vl , 1./vg\n",
+ "Tf = (Tw + Tsat)/2.\n",
+ "hfg = hv-hl\n",
+ "delT = Tsat - Tw\n",
+ "Nu = 1.13*(rhol**2*g*hfg*L**3/(mul*kl*delT))**(1./4)\n",
+ "h=Nu*kl/L\n",
+ "A = pi*do*L\n",
+ "Q = h*A*delT\n",
+ "mdot = Q/hfg\n",
+ "Re = 4*mdot/(pi*do*mul)\n",
+ "\n",
+ "#Results\n",
+ "print \"Average heat transfer coefficient\",round(h,2),\"W/(m2.K)\"\n",
+ "print \"Reynolds number is,\", round(Re,1), \"hence flow is laminar\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average heat transfer coefficient 2353.51 Btu/(h.ft2.\u00b0F)\n",
+ "Reynolds number is, 73.4 hence flow is laminar\n",
+ "Average heat transfer coefficient 13354.93 W/(m2.K)\n",
+ "Reynolds number is, 73.3 hence flow is laminar\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9-1 Page Number 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Temperature Correction Factor for a Heat Exchanger\n",
+ "\n",
+ "#Variable Declration\n",
+ "mdotc = 2.52 #Mass flow rate of water, kg/s \n",
+ "Tci, Tco = 21.1, 54.4 #Inlet and outlet temperature of cold water, \u00b0C\n",
+ "Thi, Tho = 115.6, 48.9 #Inlet and outlet temperature of hot water, \u00b0C\n",
+ "Ao = 9.3 #Outside surface area of exchanger, m2\n",
+ "Cp = 4187. #mean specific heat of water, J/(kg.K)\n",
+ "\n",
+ "#Calculations\n",
+ "Qc= mdotc*Cp*(Tco-Tci)\n",
+ "delT1 = Thi-Tco\n",
+ "delT2 = Tho-Tci\n",
+ "delTLM = (delT1-delT2)/log(delT1/delT2)\n",
+ "Z = (Thi-Tho)/(Tco-Tci)\n",
+ "Y = (Tco-Tci)/(Thi-Tci)\n",
+ " #PART \"A\" 1-2 pass \n",
+ "Fta = 0.74 # correction factor for Z and Y values in part a from chart\n",
+ "delTMa = Fta*delTLM\n",
+ "Uoa = Qc/(Ao*delTMa)\n",
+ " #PArt \"B\" 2-4\n",
+ "Ftb = 0.94 # correction factor for Z and Y values in part b from chart\n",
+ "delTMb = Ftb*delTLM\n",
+ "Uob = Qc/(Ao*delTMb)\n",
+ "#Result\n",
+ "print \"PART A\"\n",
+ "print \"Mean Temperature Difference for 1-2 pass Heat Exchanger\", round(delTMa,1),\"\u00b0C or K\"\n",
+ "print \"Required Overall outside Heat Transfer coefficient for 1-2 pass\", round(Uoa,1),\"W/(m.K)\"\n",
+ "\n",
+ "print \"PART B\"\n",
+ "print \"Mean Temeperature Difference for 2-4 pass Heat Exchanger\", round(delTMb,1),\"\u00b0C or K\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "PART A\n",
+ "Mean Temperature Difference for 1-2 pass Heat Exchanger 31.3 \u00b0C or K\n",
+ "Required Overall outside Heat Transfer coefficient for 1-2 pass 1206.2 W/(m.K)\n",
+ "PART B\n",
+ "Mean Temeperature Difference for 2-4 pass Heat Exchanger 39.8 \u00b0C or K\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9-2 Page Number 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Effectiveness of Heat Exchanger\n",
+ "from math import exp\n",
+ "#Variable Declaration\n",
+ "mc, mh = 0.667, 2.85 #mass flow rate of cold water and hot oil,kg/s\n",
+ "cpc, cph = 4192., 1890. #Specific heat of cold water and hot oil,kJ/(kg.K)\n",
+ "Tci,Thi = 308., 383. #Inlet temperatures of cold water and hot oil, \u00b0C\n",
+ "U,A = 300., 15. #Overall heat transfer coefficient W/(m2.K) and Surface area, m2\n",
+ "\n",
+ "#Calcualtions\n",
+ "Cc = mc*cpc #(m*cp)C\n",
+ "Ch = mh*cph #(m*cp)H\n",
+ "if Cc > Ch:\n",
+ " Cmin = Ch\n",
+ " Cmax = Cc\n",
+ "else:\n",
+ " Cmin = Cc\n",
+ " Cmax = Ch\n",
+ "\n",
+ "NTU = U*A/Cmin\n",
+ "Cminbymax = Cmin/Cmax\n",
+ "\n",
+ "#Using figure \"a\" on page 274\n",
+ "Enum = 1. - exp(-NTU*(1-Cminbymax))\n",
+ "Eden = 1. - Cminbymax*exp(-NTU*(1-Cminbymax))\n",
+ "Tco= 350.\n",
+ "epsilon = Enum/Eden\n",
+ "\n",
+ "Q = epsilon*Cmin*(Thi-Tci)\n",
+ "Tco = Q/Cmin + Tci\n",
+ "\n",
+ "#Results \n",
+ "print \"Heat Tranfer Rate\", round(Q,2),\"W\" \n",
+ "print \"Outlet Temperature of cold fluid\", round(Tco,1),\"K\"\n",
+ "print 'The answers are different than book because book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.708413929951\n",
+ "Heat Tranfer Rate 148557.8 W\n",
+ "Outlet Temperature of cold fluid 361.1 K\n",
+ "The answers are different than book because book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10-1 Page Number 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Radiation to Metal Tube\n",
+ "import scipy.constants as sc\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable Declaration\n",
+ "do, L = 0.0254, 0.61 #Outside diameter of tube, and length, m \n",
+ "Ts = 588. #Surface temperature of the tube, K\n",
+ "ep = 0.6 #emmisivity of metal tube at 1088 K\n",
+ "Te = 1088. #Temperature of surrounding air, K\n",
+ "\n",
+ "#Calculations \n",
+ " #SI Units\n",
+ "A = pi*do*L\n",
+ "Q = ep*A*5.676e-8*(Ts**4-Te**4)\n",
+ "\n",
+ "print \"Heat Transferred to tube from the surrounding in SI units\", round(Q,1), \"W\"\n",
+ "\n",
+ "#Variable Declaration\n",
+ "do, L = 1./12, 2.0 #Outside diameter of tube, and length, ft \n",
+ "Ts = 600 #Surface temperature of the tube, \u00b0F\n",
+ "ep = 0.6 #emmisivity of metal tube at 1500 \u00b0F\n",
+ "Te = 1500. #Temperature of surrounding air, \u00b0F\n",
+ "\n",
+ "#Calculations \n",
+ " #English Units\n",
+ "A = pi*do*L\n",
+ "Q = ep*A*0.1714e-8*((Ts+460)**4-(Te+460)**4)\n",
+ "print \"Heat Transferred to tube from the surrounding in English units\", round(Q,1), \"Btu/hr\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Transferred to tube from the surrounding in SI units -2124.7 W\n",
+ "Heat Transferred to tube from the surrounding in English units -7266.9 Btu/hr\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10-2 Page Number 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Combined Covection Plus Radiation from a Tube\n",
+ "import scipy.constants as sc\n",
+ "from math import pi\n",
+ "\n",
+ "#Variable declaration\n",
+ "do, L = 0.0254, 0.61 #Outside diameter of tube, and length, m \n",
+ "Ts = 588. #Surface temperature of the tube, K\n",
+ "ep = 0.6 #emmisivity of metal tube at 1088 K\n",
+ "Te = 1088. #Temperature of surrounding air, K\n",
+ "\n",
+ "#Calculations\n",
+ "A = pi*do*L\n",
+ "hc = 1.32*((Te-Ts)/do)**0.25\n",
+ "hr = ep*5.676e-8*(Te**4-Ts**4)/(Te-Ts)\n",
+ "Q = A*(hc + hr)*(Ts-Te)\n",
+ "#Results\n",
+ "print \"Convective Heat Transfer Coefficient\",round(hc,2)\n",
+ "print \"Radiation Heat Transfer Coefficient\",round(hr,2)\n",
+ "print \"Heat Transferred to the tube from the surrounding\", round(Q,2), \"W\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Convective Heat Transfer Coefficient 15.64\n",
+ "Radiation Heat Transfer Coefficient 87.3\n",
+ "Heat Transferred to the tube from the surrounding -2505.23 W\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11-1 Page Number 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Radiation between Parallel Plated\n",
+ "import scipy.constants as sc\n",
+ "\n",
+ "#Variable declaration \n",
+ "ep1, ep2 = 0.8, 0.7 #emmissivities of plate 1 and 2\n",
+ "T1, T2 = 866.5, 588.8 #Temperatures of surface 1 and 2, K\n",
+ "\n",
+ "#Calculations PART \"SI\"\n",
+ "q12 = 5.676e-8*(T1**4-T2**4)/(1./ep1+1./ep2-1.)\n",
+ "q12b = 5.676e-8*(T1**4-T2**4)\n",
+ "#Results\n",
+ "print \"SI Units\"\n",
+ "print \"a) Heat Flux from Plate 1 to Plate 2\", round(q12,2),\"W/m2\"\n",
+ "print \"b) Heat Flux from Plate 1 to Plate 2 when both surfaces are balck body\", round(q12b,2),\"W/m2\"\n",
+ "#Variable declaration \n",
+ "\n",
+ "\n",
+ "#Calculations PART \"British\"\n",
+ "ep1, ep2 = 0.8, 0.7 #emmissivities of plate 1 and 2\n",
+ "T1, T2 = 1100, 600 #Temperatures of surface 1 and 2, \u00b0F\n",
+ "\n",
+ "q12 = 0.1714e-8*((T1+460)**4-(T2+460)**4)/(1./ep1+1./ep2 -1.)\n",
+ "q12b = 0.1714e-8*((T1+460)**4-(T2+460)**4)\n",
+ "\n",
+ "#Results\n",
+ "print \"English Units\"\n",
+ "print \"a) Heat Flux from Plate 1 to Plate 2\", round(q12,2),\"Btu/ft2.h\"\n",
+ "print \"b) Heat Flux from Plate 1 to Plate 2 when both surfaces are balck body\", round(q12b,2),\"Btu/ft2.h\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SI Units\n",
+ "a) Heat Flux from Plate 1 to Plate 2 14998.18 W/m2\n",
+ "b) Heat Flux from Plate 1 to Plate 2 when both surfaces are balck body 25175.52 W/m2\n",
+ "English Units\n",
+ "a) Heat Flux from Plate 1 to Plate 2 4758.29 Btu/ft2.h\n",
+ "b) Heat Flux from Plate 1 to Plate 2 when both surfaces are balck body 7987.12 Btu/ft2.h\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11-7 Page Number 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Gas Radiation to a Furnace Enclosure\n",
+ "import scipy.constants as sc\n",
+ "\n",
+ "#Variable Declaration\n",
+ "L = 0.3 #Inside length of cubical furnace, m \n",
+ "P = 1. #Pressure of gas inside furnace, atm\n",
+ "Tg = 1100. #Temperature of gas, K\n",
+ "Tw = 600. #Temperature of furnace wall, K \n",
+ "xco2 = 0.1 #mole fraction of CO2 \n",
+ "\n",
+ "#Calculations\n",
+ "Lbm = .60*L\n",
+ "pco2 = P*xco2\n",
+ "pgL = pco2*Lbm\n",
+ " #from figure 4.11-10\n",
+ "epg = 0.064\n",
+ "alphag600 = pgL*(Tw/Tg)\n",
+ "alphaguc = 0.048\n",
+ "alphagc = alphaguc*(Tg/Tw)**0.65\n",
+ "q = sc.sigma*(epg*Tg**4-alphagc*Tw**4)\n",
+ "A = L*L*6\n",
+ "Q = q*A\n",
+ "\n",
+ "#Results\n",
+ "print \"Heat Transfer rate in Gas radiation\", round(Q/1000,3), \"kW\"\n",
+ "print 'The answer is different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Transfer rate in Gas radiation 2.587 kW\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.12-1 Page Number 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heating a Non-Newtonian Fluid in Laminar Flow\n",
+ "from scipy.optimize import root\n",
+ "\n",
+ "#Variable Declaration\n",
+ "mdot = 7.56e-2 #Mass flow rate of non-Newtonian fluid, kg/s\n",
+ "di = 0.0254 #Inside Diameter of the tube, m\n",
+ "L = 1.524 #Length of the tube, m\n",
+ "Ti = 37.8 #Inlet temperature of the fluid, \u00b0C \n",
+ "Tw = 93.3 #Inside wall temperature, \u00b0C\n",
+ "rho = 1041. #density of fluid, kg/m3\n",
+ "cpm = 2.093e3 #specific heat of fluid, J/(kg.K)\n",
+ "k = 1.212 #Thermal conductivity of fluid, W/(m.K) \n",
+ "n = 0.4 #Rheological constants for fluid\n",
+ "K378 = 139.9 \n",
+ "K933 = 62.5\n",
+ "\n",
+ "#Calculations\n",
+ "Tbo = 54.4\n",
+ "Tb = (Ti + Tbo)/2.0\n",
+ "slope = (log(K378)-log(K933))/(Ti-Tw)\n",
+ "c = log(139.9)-slope*Ti\n",
+ "Kb = exp(slope*Tb+c)\n",
+ "Kw = exp(slope*Tw+c)\n",
+ "delta = (3.*n+1)/(4*n)\n",
+ "NGz = mdot*cpm/(k*L)\n",
+ "gamabw = Kb/Kw\n",
+ "Nu = 1.75*delta**(1./3)*NGz**(1./3)*gamabw**0.14\n",
+ "\n",
+ "ha = k*Nu/di\n",
+ "Tk = (2.*Tw-Ti)/2.\n",
+ "mT = 1./2\n",
+ "\n",
+ "f = lambda T: mdot*cpm*(T-Ti)-ha*pi*di*L*(Tk-mT*T)\n",
+ "sol = root(f,25)\n",
+ "Tbo = sol.x[0]\n",
+ "\n",
+ "#Results\n",
+ "print \"Gratez Number\", round(NGz,1)\n",
+ "print \"Heat Transfer Coefficient\", round(ha,1),\"W/m2.K\"\n",
+ "print \"Oultlet bulk temperature of the fluid\",round(Tbo,1),\"\u00b0C\" \n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gratez Number 85.7\n",
+ "Heat Transfer Coefficient 450.5 W/m2.K\n",
+ "Oultlet bulk temperature of the fluid 54.2 \u00b0C\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 4.13-1 Page Number 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Heat Transfer Coefficient in Agitated Vessel\n",
+ "\n",
+ "#Variable Declaration\n",
+ "Dt = 1.83 #Diameter of agitated vessel,m\n",
+ "Tl = 300. #Temperature of liquid to be heated, K\n",
+ "Da = 0.61 #Diameter of agitator vessel,m\n",
+ "N = 100. #RPM of agitator\n",
+ "Tw = 355.4 #Wall temperature of Jaket, K\n",
+ "rho = 961. #Density of liquid, kg/m3\n",
+ "cp = 2500. #Density of liquid, K/(kg.K)\n",
+ "k = 0.173 #Thermal conductivity of liquid, W/(m.K)\n",
+ "mu = 1.0 #Viscosity of liquid at 300K, Pa.s\n",
+ "muw = 0.084 #Viscosity of liquid at Wall temperature 355.5K, Pa.s\n",
+ "\n",
+ "#Calculations\n",
+ "Nre = Da**2*(N/60)*rho/mu\n",
+ "Npr = cp*mu/k\n",
+ "#for equation 4.13-1 a = 0.74, b=2/3\n",
+ "a = 0.74\n",
+ "b = 2./3\n",
+ "Nu = a*Nre**b*Npr**(1./3)*(mu/muw)**0.14\n",
+ "h = Nu*k/Dt\n",
+ "\n",
+ "#Results\n",
+ "print 'Reynolds number is %3.0f'%Nre\n",
+ "print 'Prandtl number is %5.0f'%Npr\n",
+ "print \"Heat transfer coefficient to the wall of jacket\",round(h,1),\"W/(m2.K)\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reynolds number is 596\n",
+ "Prandtl number is 14451\n",
+ "Heat transfer coefficient to the wall of jacket 170.7 W/(m2.K)\n",
+ "The answers are different than book, because of book uses rounded numbers\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 4.13-2 Page Number 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Fin efficiency and Heat Loss from Fin\n",
+ "\n",
+ "#Variable Declaration\n",
+ "k = 222. #W/(m.K)\n",
+ "r1 = 0.04 #Outer radius of tube, m\n",
+ "L = 0.04 #Fin length, m \n",
+ "To = 523.2 #Fin base temperature, K\n",
+ "Ta = 343.2 #Surrounding Temperature, K\n",
+ "t = 2./1000 #Thickness of fin, m\n",
+ "h = 30. #Surrounding convective coefficient, W/(m2.K)\n",
+ "\n",
+ "#Calculation\n",
+ "Lc = L + t/2\n",
+ "asbc = Lc*(h/k*t)**0.5\n",
+ "param = (Lc+r1)/r1\n",
+ "#From fig4.13-5 b for parameter and abscisa value eff = 0.89\n",
+ "eff = 0.89\n",
+ "Afc = 2*pi*((Lc+r1)**2-r1**2)\n",
+ "qf = eff*h*Afc*(To-Ta)\n",
+ "\n",
+ "#Result\n",
+ "print \"Efficiency of the fin is\", round(eff,4)\n",
+ "print \"Rate of Heat Loss\", round(qf,1),\"W\"\n",
+ "print 'The answers are different than book, because of book uses rounded numbers'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of the fin is 0.89\n",
+ "Rate of Heat Loss 149.8 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 4.15-1 Page Number 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Steady State Heat Conduction in Two Directions\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "D = 8.0 #Ouside dimention of square, m\n",
+ "Hi = 4.0 #Inside Height of chamber, m\n",
+ "Wi = 2.0 #Inside width of chamber, m\n",
+ "Ti = 600.0 #Inside Temperature of chamber, K\n",
+ "To = 300.0 #Outside Temperature of chamber, K\n",
+ "k = 1.5 #Thermal conductivity of material, W/(m.K)\n",
+ "Gl = Gw = 1.0 #Grid size in Height and width Directions, m\n",
+ "L = 1.0 #Length of Chamber, m\n",
+ "\n",
+ "#Calculations\n",
+ "np.set_printoptions(precision=1)\n",
+ "#Column indices used are one less than used in book\n",
+ "T0 = np.zeros(3)\n",
+ "T1 = np.zeros(3)\n",
+ "T2 = np.zeros(6)\n",
+ "T3 = np.zeros(6)\n",
+ "T4 = np.zeros(6)\n",
+ "T5 = np.zeros(6)\n",
+ " \n",
+ "def printT():\n",
+ " print 'Temperature at various nodes are as follows'\n",
+ " print 'T 2 3 4 5'\n",
+ " print 1,T1[1:2]\n",
+ " print 2,T2[1:2]\n",
+ " print 3,T3[1:5]\n",
+ " print 4,T4[1:5]\n",
+ "\n",
+ "\n",
+ "#Initialize\n",
+ "T0[2]=T1[2]=T2[2]=T2[3]=T2[4]=T2[5]=600. #INNER NODES \n",
+ "T0[0]=T1[0]=T2[0]=T3[0]=T4[0]=T5[0]=T5[1]=T5[2]=T5[3]=T5[4]=T5[5]=300 #outer nodes\n",
+ "T1[1]=T3[3]=450.\n",
+ "T2[1]=T3[1]=T3[2]=T4[4]=400.\n",
+ "T3[4]=500.\n",
+ "T4[1]=325.\n",
+ "T4[2]=350.\n",
+ "T4[3]=375.\n",
+ "T0[1]=T2[1]\n",
+ "T3[5]=T3[3]\n",
+ "T4[5]=T4[3]\n",
+ "\n",
+ "r = 1.2 #Initial value of residue\n",
+ "\n",
+ "#Calculations\n",
+ "while abs(r)>0.001:\n",
+ " r11 = T1[0]+T1[2]+T0[1]+T2[1]-4*T1[1]\n",
+ " T1[1]=(T1[0]+T1[2]+T0[1]+T2[1])/4\n",
+ " r21 = (T2[0]+T2[2]+T1[1]+T3[1]-4*T2[1])\n",
+ " T2[1]=T0[1]=(T2[0]+T2[2]+T1[1]+T3[1])/4\n",
+ " r31=(T3[0]+T3[2]+T2[1]+T4[1]-4*T3[1])\n",
+ " T3[1]=(T3[0]+T3[2]+T2[1]+T4[1])/4\n",
+ " r32 = T2[2]+T4[2]+T3[1]+T3[3]-4*T3[2]\n",
+ " T3[2] =(T2[2]+T4[2]+T3[1]+T3[3])/4\n",
+ " r33 = T3[2]+T3[4]+T2[3]+T4[3]-4*T3[3]\n",
+ " T3[3]=T3[5]=(T3[2]+T3[4]+T2[3]+T4[3])/4\n",
+ " r34 = T3[3]+T3[5]+T2[4]+T4[4]-4*T3[4]\n",
+ " T3[4]=(T3[3]+T3[5]+T2[4]+T4[4])/4\n",
+ " r41 = T4[0]+T4[2]+T3[1]+T5[1]-4*T4[1]\n",
+ " T4[1]=(T4[0]+T4[2]+T3[1]+T5[1])/4\n",
+ " r42 = T4[1]+T4[3]+T3[2]+T5[2]-4*T4[2]\n",
+ " T4[2]=(T4[1]+T4[3]+T3[2]+T5[2])/4\n",
+ " r43 = T4[2]+T4[4]+T3[3]+T5[3]-4*T4[3]\n",
+ " T4[3]=T4[5]=(T4[2]+T4[4]+T3[3]+T5[3])/4\n",
+ " r44 = T4[3]+T4[5]+T3[4]+T5[4]-4*T4[4]\n",
+ " T4[4] = (T4[3]+T4[5]+T3[4]+T5[4])/4\n",
+ " r = r11+r21+r31+r32+r33+r34+r41+r42+r43+r44\n",
+ " \n",
+ "#Results\n",
+ "print 'Recidue at convergence %10.8f'%r\n",
+ "printT()\n",
+ "Q1 = 4*k*(0.5*(T1[2]-T1[1]) + (T2[2]-T2[1]) + (T2[2]-T3[2]) + (T2[3]-T3[3]) + 0.5*(T2[4]-T3[4]))\n",
+ "Q2 = 4*k*(0.5*(T1[1]-T1[0]) + (T2[1]-T2[0]) + (T3[1]-T3[0]) + (T4[1]-T4[0]) + (T4[1]-T5[1])+(T4[2]-T5[2])+(T4[3]-T5[3])+0.5*(T4[4]-T5[4]))\n",
+ "print 'Heat transfer from inner surface %5.1f into the solid'%Q1\n",
+ "print 'Heat transfer from outer surface %5.1f out from solid'%Q2\n",
+ "Qavg = (Q1+Q2)*0.5\n",
+ "print \"Average Heat loss per unit chamber length\",round(Qavg,1),\"W/m\"\n",
+ "print 'Book is using rounded values of temperature throughout the iterations hence answers are different'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Recidue at convergence 0.00090090\n",
+ "Temperature at various nodes are as follows\n",
+ "T 2 3 4 5\n",
+ "1 [ 440.3]\n",
+ "2 [ 430.6]\n",
+ "3 [ 382. 459.2 483.7 489.5]\n",
+ "4 [ 338.2 370.9 386.3 390.5]\n",
+ "Heat transfer from inner surface 3369.8 into the solid\n",
+ "Heat transfer from outer surface 3369.8 out from solid\n",
+ "Average Heat loss per unit chamber length 3369.8 W/m\n",
+ "Book is using rounded values of temperature throughout the iterations hence answers are different\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file