summaryrefslogtreecommitdiff
path: root/Fluid_mechanics_by_Pao/Chapter_3.ipynb
blob: 8d368fbffee020711be8303db089b931c224f5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{
 "metadata": {
  "name": "",
  "signature": "sha256:dee9d655eeb9028db41fd96e05f9acf5955fd88886936fffc7d4e9aa14bb4a71"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 - Fluid Kinematics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1 - Pg 52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the mean velocity of flow at both the sections\n",
      "#Initialization of variables\n",
      "import math\n",
      "gam=0.0765 #lb/ft^3\n",
      "Q=100. #ft^3/sec\n",
      "d1=2.5 #ft\n",
      "d2=9. #in\n",
      "l=12. #ft\n",
      "#calculations\n",
      "A1=math.pi/4. *d1*d1\n",
      "V1=Q/A1\n",
      "A2=math.pi*l*d2/12.\n",
      "V2=Q/A2\n",
      "#results\n",
      "print '%s %.1f %s' %(\"Mean velocity of flow at section 1 =\",V1,\"ft/sec\")\n",
      "print '%s %.2f %s' %(\"\\n Mean velocity of flow at section 2 =\",V2,\"ft/sec\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mean velocity of flow at section 1 = 20.4 ft/sec\n",
        "\n",
        " Mean velocity of flow at section 2 = 3.54 ft/sec\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5 - Pg 60"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the horizontal and vertical components of velocity\n",
      "#Initialization of variables\n",
      "x=3. \n",
      "y=1.\n",
      "#calculations\n",
      "u=-3*y*y\n",
      "v=-6*x\n",
      "#results\n",
      "print '%s %d' %(\"Horizontal component of velocity = \",u)\n",
      "print '%s %d' %(\"\\n vertical component of velocity = \",v)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Horizontal component of velocity =  -3\n",
        "\n",
        " vertical component of velocity =  -18\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}