{ "metadata": { "name": "", "signature": "sha256:3a66fd8d35a6b920ec6df68f36f6af53b925b694b7b276b4adb69f10c536acff" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 3 : Kinematics of Fluid Flow" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3.1 Page No : 78" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\n", "#Initialization of variables\n", "Q = 0.5 \t#cfs\n", "d1 = 8. \t#in\n", "d2 = 4. \t#in\n", "R = 2. \t#in\n", "h = 0.59 \t#in\n", "\t\n", "#calculations\n", "Aa = math.pi*(d1/12)**2 /4\n", "Va = Q/Aa\n", "Ab = 2*math.pi*R*h/144\n", "Vb = Q/Ab\n", "\t\n", "#Results\n", "print \"Average velocity at section A = %.2f fps \"%(Va)\n", "print \" Average velocity at section B = %.2f fps \"%(Vb)\n", "\n", "# rounding off error" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Average velocity at section A = 1.43 fps \n", " Average velocity at section B = 9.71 fps \n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3.2 Page No : 81" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\t\n", "#Initialization of variables\n", "Q = 0.5 \t#cfs\n", "d1 = 8. \t#in\n", "d2 = 4. \t#in\n", "R = 2. \t#in\n", "theta = 45.\t#degrees\n", "\t\n", "#calculations\n", "h = (1-math.cos(math.radians(theta))) \t#Multiply by r\n", "Aa = round(2*math.pi*h,2) \t#Multiply by r**2\n", "V = Q/Aa \t#divide by r**2\n", "aA = 0\n", "r = 0.167 \t#ft\n", "V1 = V/r**2\n", "dvbydx = round(V*2/r**3)\n", "aB = V1*dvbydx\n", "\n", "\n", "#Results\n", "#The answer varies a bit from the text due to rounding off error\n", "print \"Acceleration at A = %d since flow is steady\"%(aA)\n", "print \"Acceleration at B = %d ft/s**2\"%(aB)\n", "\n", "# rounding off error. please check." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Acceleration at A = 0 since flow is steady\n", "Acceleration at B = 1140 ft/s**2\n" ] } ], "prompt_number": 5 } ], "metadata": {} } ] }