summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F_Douglas/Chapter_24.ipynb
blob: ef4fb92560cf73a29d20f5c26a92a8b197233164 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
 "metadata": {
  "name": "",
  "signature": "sha256:0997b77d100b3345365d77881e9dcf23833d271e3f7741c8fb4ad6c260c5ffc6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 24: Positive Displacement Machines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24.1, Page 860"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "H_at  =  10.3;\n",
      "Hs  =  1.5;\n",
      "Hd  =  4.5;\n",
      "Ls  =  2;\n",
      "Ld  =  15;\n",
      "g  =  9.81;\n",
      "Ds  =  0.4;                                                              #  Diameter  of  stroke\n",
      "Db  =  0.15;                                                            #  Diameter  of  bore\n",
      "Dd  =  0.05;                                                            #  Diameter  of  discharge  and  suction  pipe\n",
      "nu  =  0.2;\n",
      "f  =  0.01;\n",
      "abs_pump_pressure  =  2.4;\n",
      "\n",
      " #Calculations\n",
      "A  =  math.pi*(Db)**2/4;\n",
      "a  =  math.pi*(Dd)**2/4;\n",
      "r  =  Ds/2;\n",
      "W  =  2*math.pi*nu;\n",
      "Hsf  =  0;  \n",
      "def  H_suck(n):\n",
      "    y  =  H_at  -  Hs  +(-1)**n*(L/g)*(A/a)*W**2*r;  \n",
      "    return y\n",
      "\n",
      "def  H(n,DischargeOrSuction):\n",
      "    if(DischargeOrSuction  ==  1):\n",
      "        y  =  H_at  -  Hs  +(-1)**n*(Ls/g)*(A/a)*W**2*r;\n",
      "    elif(DischargeOrSuction  ==  2):\n",
      "        y  =  H_at  +  Hd  +(-1)**n*(Ld/g)*(A/a)*W**2*r;\n",
      "    else:\n",
      "        print \"There  is  something  wrong  :\"\n",
      "    return y\n",
      "\n",
      "def  H_mid(DischargeOrSuction,uA):\n",
      "    if(DischargeOrSuction  ==  1):\n",
      "        Hsf  =  4*f*Ls/(2*Dd*g)*(uA/a)**2;\n",
      "        y  =  H_at  -  Hs  -  Hsf;\n",
      "    elif(DischargeOrSuction  ==  2):\n",
      "        Hsf  =  4*f*Ld/(2*Dd*g)*(uA/a)**2;\n",
      "        y  =  H_at  +  Hd  +  Hsf;\n",
      "    else:\n",
      "        print \"There  is  something  wrong  :\"\n",
      "    return y\n",
      "\n",
      "Hs_start  =  H(1,1);                #  Inertia  head  negative  hence  n  =  1\n",
      "Hs_end    =  H(2,1);                #  Inertia  head  positive  hence  n  =  2\n",
      "Hd_start  =  H(1,2);\n",
      "Hd_end    =  H(2,2);\n",
      "u  =  W*r;\n",
      "Hs_mid  =  H_mid(1,u*A);\n",
      "slip  =  0.04;\n",
      "Hd_mid  =  H_mid(2,u*A);\n",
      "suction   = [Hs_start,  Hs_end,  Hs_mid];\n",
      "discharge = [Hd_start,  Hd_end,  Hd_mid];\n",
      "suction1=[0,0,0]\n",
      "discharge1=[0,0,0]\n",
      "for c in range(3):\n",
      "    suction1[c]   =round(suction[c],2)\n",
      "    discharge1[c] =round(discharge[c],2)\n",
      "W_max  =  (abs((abs_pump_pressure  -  H_at  +  Hs)*(g/Ls)*(a/A)*(1/r)))**0.5;\n",
      "W_max_rev  =  W_max/(2*math.pi)*60;                      #  maximum  rotation  speed  in  rev/min\n",
      "\n",
      "header  =  \"Start   End   Mid\";\n",
      "\n",
      "print \"\\n!----Part(a)----!  Head at \\n\",header\n",
      "print suction1\n",
      "print \"\\n!----Part(b)----!  Head at \\n\",header\n",
      "print discharge1\n",
      "print \"\\n!----Part(c)----1 \\nDrive speed for s eperation (rev/min) :\",round(W_max_rev)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "!----Part(a)----!  Head at \n",
        "Start   End   Mid\n",
        "[8.22, 9.38, 8.38]\n",
        "\n",
        "!----Part(b)----!  Head at \n",
        "Start   End   Mid\n",
        "[10.45, 19.15, 17.93]\n",
        "\n",
        "!----Part(c)----1 \n",
        "Drive speed for s eperation (rev/min) : 40.0\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24.2, Page 863"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Example  24.2  \n",
      "\n",
      " #Initializing  the  variables\n",
      "H_friction  =  2.4;\n",
      "H_at  =  10.3;\n",
      "Hs  =  1.5;\n",
      "L  =2;\n",
      "f  =  0.01;\n",
      "d  =  0.05;\n",
      "g  =  9.81;                                 #  Diameter  of  stroke\n",
      "Db  =  0.15;                                #  Diameter  of  bore\n",
      "r  =  0.2;\n",
      "\n",
      " #Calculations\n",
      "A  =  math.pi*(Db)**2/4;\n",
      "a  =  math.pi*(d)**2/4;\n",
      "W=  (((H_at  -  Hs  -    H_friction  )*(2*d*g/(4*f*L)))**0.5)*(a/A)*(math.pi/r); # in rad/s\n",
      "W_rev  =  W/(2*math.pi)*60;                 #  maximum  rotation  speed  in  rev/min\n",
      "# IMPORTANT : In book conversion from rad/s to rev/min is wrong, so answer will be diffrent from book\n",
      " \n",
      "print \"speed in          (rad/s)  :\",round(W,2)\n",
      "print \"Increase in speed (rev/min):\",round(W_rev-40,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "speed in          (rad/s)  : 15.46\n",
        "Increase in speed (rev/min): 107.65\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}