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
|
{
"metadata": {
"name": "",
"signature": "sha256:042171008edad2dcea90c81036564026ff0ecc789ee16d3a2ccb0122fde141e9"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 20: Pressure Transient Theory and Surge Control"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 20.3, Page 692"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from __future__ import division\n",
"import math\n",
"\n",
"\n",
" #Initializing the variables\n",
"c = 1250;\n",
"Dt = 0.02;\n",
"Dv = 0.5;\n",
"rho = 1000;\n",
"v =0.5;\n",
"\n",
" #Calculations\n",
"cDt = c*Dt;\n",
"Dp = rho*c*Dv;\n",
"DOv_DOt = Dv/Dt;\n",
"vDOv_DOt = v*Dv/cDt;\n",
"DOp_DOt = Dp/Dt;\n",
"vDOp_DOx = v*Dp/cDt;\n",
"Error = [vDOv_DOt*100/DOv_DOt ,vDOp_DOx*100/DOp_DOt];\n",
"print \"The percentage errors are :\",Error,\"\\nThese are very small hence can be neglected\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The percentage errors are : [0.04, 0.04] \n",
"These are very small hence can be neglected\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 20.5, Page 705"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from __future__ import division\n",
"import math\n",
"\n",
"\n",
" #Initializing the variables\n",
"f = 0;\n",
"Atunnel = 1.227;\n",
"Ashaft = 12.57;\n",
"Q =2;\n",
"L = 200;\n",
"g = 9.81; \n",
"\n",
" #Calculations\n",
"Zmax = (Q/Ashaft)*(Ashaft*L/(Atunnel*g))**0.5;\n",
"T = 2*math.pi*(Ashaft*L/(Atunnel*g))**0.5;\n",
"\n",
"print \"Peak water level (m) :\",round(Zmax,3)\n",
"print \"Mass Oscillation Period (s) :\",round(T,1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Peak water level (m) : 2.299\n",
"Mass Oscillation Period (s) : 90.8\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}
|