diff options
Diffstat (limited to 'Introduction_to_Heat_Transfer_by_S._K._Som/Chapter3.ipynb')
-rw-r--r-- | Introduction_to_Heat_Transfer_by_S._K._Som/Chapter3.ipynb | 440 |
1 files changed, 440 insertions, 0 deletions
diff --git a/Introduction_to_Heat_Transfer_by_S._K._Som/Chapter3.ipynb b/Introduction_to_Heat_Transfer_by_S._K._Som/Chapter3.ipynb new file mode 100644 index 00000000..55a11dc9 --- /dev/null +++ b/Introduction_to_Heat_Transfer_by_S._K._Som/Chapter3.ipynb @@ -0,0 +1,440 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Chapter 03:Multidimensional steady-state heat conduction" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.1:pg-92" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Introduction to heat transfer by S.K.Som, Chapter 3, Example 1\n", + "Temperature at the centre in Degree C is\n", + "T= 125.371641666\n" + ] + } + ], + "source": [ + "\n", + "\n", + " \n", + "import math\n", + " \n", + "print\"Introduction to heat transfer by S.K.Som, Chapter 3, Example 1\"\n", + "#Length and breadth is given as 1 unit (Gemoetry is Square)\n", + "L = 1;#length\n", + "#Problem can be divided into two modules\n", + "#Solution to module 1 is given by Eq. 3.21, considering the first three terms\n", + "#n is the looping parameter\n", + "#theta is the non dimensional temperature defined as ((T-100)/100) where T is actual temperature in degree Celcius.\n", + "#Initialising theta as zero\n", + "theta = 0;\n", + "for n in range(1,3):\n", + " theta = theta+((2/math.pi)*((math.sin((n*math.pi)/2)*math.sinh((n*math.pi)/2))*((-1)**(n+1)+1)))/(n*math.sinh(n*math.pi));\n", + " \n", + "#Solution to module 2 is given by Eq. 3.24, considering the first three terms\n", + "for n in range(1,3):\n", + " theta2 = theta+(((3*2)/math.pi)*((math.sin((n*math.pi)/2)*math.sinh((n*math.pi)/2))*((-1)**(n+1)+1)))/(n*math.sinh(n*math.pi));\n", + " \n", + "#Calculating value of temperature from the value of theta\n", + "#Temperature in degree celcius\n", + "print\"Temperature at the centre in Degree C is\"\n", + "T = theta*100+100\n", + "print\"T=\",T\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.2:pg-94" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Introduction to heat transfer by S.K.Som, Chapter 3, Example 2\n", + "Steady state non dimensional temperature is\n", + "theta=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi)) + math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))\n", + "theta= 0.597805223008\n", + "Temperature in K at centre point\n", + "T= 359.780522301\n" + ] + } + ], + "source": [ + " \n", + " \n", + " \n", + "import math\n", + " \n", + "print\"Introduction to heat transfer by S.K.Som, Chapter 3, Example 2\"\n", + "#Temperature in K at four edges are given\n", + "#Theta is non dimensional temperature defined as ((T-300)/100) where T is actual temperature in K.\n", + "#Given length as well as the breadth of square plate is ''a''\n", + "#Problem can be divided into two modules\n", + "#Solution to module 1 is given by Eq. 3.23\n", + "#Solution of first module is non dimensional temperature theta1\n", + "#theta1=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi))\n", + "#Solution to module 2 is given by Eq. 3.24\n", + "#Solution of second module is non dimensional temperature theta2\n", + "#theta2=math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))\n", + "#Therefore\n", + "print\"Steady state non dimensional temperature is\"\n", + "print\"theta=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi)) + math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))\"\n", + "#At the centre, x coordinate and y coordinate in unit are\n", + "#x=a/2, y=a/2\n", + "#Non dimensional temperature at centre point\n", + "theta = (2*math.sinh(math.pi/2))/math.sinh(math.pi)+math.sinh(math.pi/2)/math.sinh(math.pi);\n", + "#Temperature in K at centre point\n", + "print\"theta=\",theta\n", + "print\"Temperature in K at centre point\"\n", + "T = theta*100+300\n", + "print\"T=\",T\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.3:pg-96" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Introduction to heat transfer by S.K.Som, Chapter 3, Example 3\n", + "Temperatures at nodal points in degree K\n", + "T1 in degree K\n", + "[ 398.67699539 155.83601706 66.53320567 119.43598224 79.06693359\n", + " 40.99573505 14.15266777 9.19140047]\n", + "T2 in degree K\n", + "[ 77.91800853 232.60510053 92.0706763 39.53346679 80.21585865\n", + " 48.72486726 19.11393507 11.30646706]\n", + "T3 in degree K\n", + "[ 33.26660284 92.0706763 237.56636783 20.49786753 48.72486726\n", + " 82.33092523 46.76647228 21.51623292]\n", + "T4 in degree K\n", + "[ 14.15266777 38.22787014 93.53294456 9.19140047 22.61293411\n", + " 43.03246584 124.91948821 27.99199234]\n", + "T5 in degree K\n", + "[-0. -0. -0. -0. -0. -0. -0. -0.]\n", + "T6 in degree K\n", + "[-0. -0. -0. -0. -0. -0. -0. -0.]\n", + "T7 in degree K\n", + "[ 95.65671512 227.3827139 384.21098442 77.62207329 214.83157803\n", + " 554.32152494 100.40908695 109.12176865]\n", + "T8 in degree K\n", + "[ 24.51040125 60.30115763 114.75324223 18.87022369 50.97049352\n", + " 124.71059274 74.64531291 166.55931761]\n" + ] + } + ], + "source": [ + " \n", + "import math\n", + "import numpy\n", + " \n", + "print\"Introduction to heat transfer by S.K.Som, Chapter 3, Example 3\"\n", + "#internodal distance in x direction in m\n", + "deltax = 1.0/4;\n", + "#internodal distance in y direction in m\n", + "deltay = 1.0/4;\n", + "#Air temperature in degree K\n", + "Tinfinity = 400;\n", + "#Heat transfer coefficient in W/(m**2*K)\n", + "h = 10;\n", + "#T1, T2, T3, T4, T5, T6, T7, T8 are nodal temperatures in degree K.\n", + "#T is the temperature matrix and is transpose of [T1 T2 T3 T4 T5 T6 T7 T8]\n", + "#using Nodal Equations, we have Coefficeint Matrix A as\n", + "A = [[-4,1,0,0,1,0,0,0],[1,-4,1,0,0,1,0,0],[0,1,-4,1,0,0,1,0],[2,0,0,0,-4,1,0,0],[0,2,0,0,1,-4,1,0],[0,0,2,0,0,1,-4,1],[0,0,2,-6,0,0,0,1],[0,0,0,2,0,0,2,-6]]#Coefficient matrix B\n", + "B = [[-1200],[-600],[-600],[-600],[0],[0],[-1400],[-800]]\n", + "\n", + "\n", + "#Therefore the temperature matrix is\n", + "T = numpy.linalg.inv(A)*B;\n", + "#Temperature at nodal points in degree K\n", + "print\"Temperatures at nodal points in degree K\"\n", + "print\"T1 in degree K\"\n", + "T1 = T[0]\n", + "print T1\n", + "print\"T2 in degree K\"\n", + "T2 = T[1]\n", + "print T2\n", + "print\"T3 in degree K\"\n", + "T3 = T[2]\n", + "print T3\n", + "print\"T4 in degree K\"\n", + "T4 = T[3]\n", + "print T4\n", + "print\"T5 in degree K\"\n", + "T5 = T[4]\n", + "print T5\n", + "print\"T6 in degree K\"\n", + "T6 = T[5]\n", + "print T6\n", + "print\"T7 in degree K\"\n", + "T7 = T[6]\n", + "print T7\n", + "print\"T8 in degree K\"\n", + "T8 = T[7]\n", + "print T8\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.5:pg-98" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Introduction to heat transfer by S.K.Som, Chapter 3, Example 5\n", + "Temperatures at nodal points in degree C\n", + "T2 in degree C\n", + "[ 1.83976243e-36 4.79441040e-01 3.66134997e-01 3.07581515e-01\n", + " 5.38080937e-01]\n", + "T3 in degree C\n", + "[ 1.46972670e-67 1.92742646e+00 1.47191880e+00 1.23652483e+00\n", + " 1.07886949e+00]\n", + "T4 in degree C\n", + "[ 4.52446173e-92 1.47191880e+00 3.54032873e+00 2.97414801e+00\n", + " 1.67320356e+00]\n", + "T5 in degree C\n", + "[ 6.50142301e-108 1.23652483e+000 2.97414801e+000 5.91733919e+000\n", + " 2.36010173e+000]\n", + "T6 in degree C\n", + "[ 2.06473580e-113 1.16395938e+000 2.79961015e+000 5.57008016e+000\n", + " 3.18199172e+000]\n" + ] + } + ], + "source": [ + " \n", + "import math\n", + "import numpy\n", + " \n", + "print\"Introduction to heat transfer by S.K.Som, Chapter 3, Example 5\"\n", + "#Thermal conductivity of aluminium in W/(m*K)\n", + "k = 200.0\n", + "#Diameter in m\n", + "d = 20*(10**(-3));\n", + "#Length of fin in m\n", + "L = 0.2;\n", + "#Wall temperature in degree C\n", + "Tw = 400.0;\n", + "#Air temperature in degree C\n", + "Tinfinity = 30;\n", + "#Heat transfer coefficient in W/(m**2*K)\n", + "h = 40.0;\n", + "#internodal distance in x direction in m\n", + "deltax = L/5;\n", + "#Node 1 temperature is equal to wall temperature in degree C\n", + "T1 = Tw;\n", + "#using Nodal Equations, we have Coefficeint Matrix A as\n", + "A = [[2.064,-1,0,0,0],[-1,2.064,-1,0,0],[0,-1,2.064,-1,0],[0,0,-1,2.064,-1],[0,0,0,-1,1.032]]\n", + "#Coefficient matrix B\n", + "B = [401.92,1.92,1.92,1.92,0.96]\n", + "#T2, T3, T4, T5, T6 are nodal temperature in degree C\n", + "#T is the temperature matrix and is transpose of [T2 T3 T4 T5 T6]\n", + "#Therefore the temperature matrix is\n", + "T = numpy.linalg.inv(A)**B;\n", + "#Temperature at nodal points in degree C\n", + "print\"Temperatures at nodal points in degree C\"\n", + "print\"T2 in degree C\"\n", + "T2 = T[0]\n", + "print T2\n", + "print\"T3 in degree C\"\n", + "T3 = T[1]\n", + "print T3\n", + "print\"T4 in degree C\"\n", + "T4 = T[2]\n", + "print T4\n", + "print\"T5 in degree C\"\n", + "T5 = T[3]\n", + "print T5\n", + "print\"T6 in degree C\"\n", + "T6 = T[4]\n", + "print T6\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.6:pg-104" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Introduction to heat transfer by S.K.Som, Chapter 3, Example 6\n", + "Temperatures at nodal points in degree C\n", + "T1 in degree C\n", + "[ -0. -0. -0. 186.04651163 1.86046512\n", + " 2.79069767 1.86046512 0.46511628 74.41860465]\n", + "T2 in degree C\n", + "[ -0. -0. -0. 74.41860465 1.69263965\n", + " 3.56988732 2.51738192 0.62934548 157.39630784]\n", + "T3 in degree C\n", + "[ -0. -0. -0. 83.72093023 3.88875569\n", + " 4.80220571 3.06401343 0.76600336 65.85950611]\n", + "T4 in degree C\n", + "[ -0. -0. -0. 55.81395349 2.45504675\n", + " 5.7444258 4.10453129 1.02613282 77.58331335]\n", + "T5 in degree C\n", + "[ -0. -0. -0. 37.20930233 1.77415488\n", + " 4.6199952 7.34116519 1.8352913 51.37856629]\n", + "T6 in degree C\n", + "[ -0. -0. -0. 37.20930233 8.78446416\n", + " 4.92927356 2.18652601 0.5466315 33.8527931 ]\n", + "T7 in degree C\n", + "[ -0. -0. -0. 27.90697674 2.46463678\n", + " 9.98561496 3.49556461 0.87389115 35.69887317]\n", + "T8 in degree C\n", + "[ -0. -0. -0. 18.60465116 1.09326301\n", + " 3.49556461 10.57779909 2.64444977 25.17381923]\n", + "T9 in degree C\n", + "[ -0. -0. -0. 9.30232558 0.5466315\n", + " 1.74778231 5.28889954 11.32222489 12.58690961]\n" + ] + } + ], + "source": [ + " \n", + "import math\n", + " \n", + "print\"Introduction to heat transfer by S.K.Som, Chapter 3, Example 6\"\n", + "#Thermal conductivity of concrete in W/mK\n", + "k = 2;\n", + "#Length in m\n", + "L = 0.2;\n", + "#Breadth in m\n", + "b = 0.2;\n", + "#Depth in m\n", + "d = 0.2;\n", + "#Temperature of hot gas in chimney in degree C\n", + "Tg = 400;\n", + "#Air temperature in degree C\n", + "Tinfinity = 20;\n", + "#internodal distance in x direction in m\n", + "deltax = 0.1;\n", + "#internodal distance in y direction in m\n", + "deltay = 0.1;\n", + "#Heat transfer coefficient in W/(m**2*K)\n", + "h = 20;\n", + "#T1, T2, T3, T4, T5, T6, T7, T8, T9 are nodal temperatures in degree K.\n", + "#T is the temperature matrix and is transpose of [T1 T2 T3 T4 T5 T6 T7 T8 T9]\n", + "#using Nodal Equations, we have Coefficeint Matrix A as\n", + "A = numpy.array([[1,0,-4,2,0,1,0,0,0],[0,1,1,-4,1,0,1,0,0],[0,0,0,2,-4,0,0,2,0],[-3,1,1,0,0,0,0,0,0],[0,0,1,0,0,-3,1,0,0],[0,0,0,2,0,1,-6,1,0],[0,0,0,0,2,0,1,-6,1],[0,0,0,0,0,0,0,1,-2],[1,-4,0,2,0,0,0,0,0]]);\n", + "#Coefficient matrix B\n", + "B = numpy.array([0,0,0,-400,-20,-40,-40,-20,-400]);\n", + "#Therefore the temperature matrix is\n", + "T = numpy.linalg.inv(A)*B;\n", + "#Temperature at nodal points in degree C\n", + "print\"Temperatures at nodal points in degree C\"\n", + "print\"T1 in degree C\"\n", + "T1 = T[0]\n", + "print T1\n", + "print\"T2 in degree C\"\n", + "T2 = T[1]\n", + "print T2\n", + "print\"T3 in degree C\"\n", + "T3 = T[2]\n", + "print T3\n", + "print\"T4 in degree C\"\n", + "T4 = T[3]\n", + "print T4\n", + "print\"T5 in degree C\"\n", + "T5 = T[4]\n", + "print T5\n", + "print\"T6 in degree C\"\n", + "T6 = T[5]\n", + "print T6\n", + "print\"T7 in degree C\"\n", + "T7 = T[6]\n", + "print T7\n", + "print\"T8 in degree C\"\n", + "T8 = T[7]\n", + "print T8\n", + "print\"T9 in degree C\"\n", + "T9 = T[8]\n", + "print T9\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |