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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
{
"metadata": {
"name": "",
"signature": "sha256:da3557673ab31ece618ad10f5b0d3ef78112ff36bd0b260e508d99211060a1c9"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4:WORK AND HEAT"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex4.1:PG-96"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1\n",
"#work done during different processes\n",
"import math\n",
"\n",
"P1=200 #initial pressure inside cylinder in kPa\n",
"V2=0.1 #in m^3\n",
"V1=0.04 #initial volume of gas in m^3\n",
"\n",
"W1=P1*(V2-V1) #work done in isobaric process in kJ\n",
"print\"\\n hence,the work done during the isobaric process is\",round(W1,2),\"kJ. \\n\"\n",
"\n",
"W2=P1*V1*math.log(V2/V1) #work done in isothermal process in kJ\n",
"print\"\\n hence,the work done in isothermal process is\",round(W2,2),\"kJ. \\n\"\n",
"\n",
"P2=P1*(V1/V2)**(1.3) #final pressure according to the given process\n",
"W3=(P2*V2-P1*V1)/(1-1.3)\n",
"print\"\\n hence,the work done during the described process is\",round(W3,2),\"kJ. \\n\"\n",
"\n",
"W4=0 #work done in isochoric process\n",
"print\"\\n hence,the work done in the isochoric process is\",round(W4,3),\"kJ. \\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" hence,the work done during the isobaric process is 12.0 kJ. \n",
"\n",
"\n",
" hence,the work done in isothermal process is 7.33 kJ. \n",
"\n",
"\n",
" hence,the work done during the described process is 6.41 kJ. \n",
"\n",
"\n",
" hence,the work done in the isochoric process is 0.0 kJ. \n",
"\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex4.3:PG-99"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 3\n",
"\n",
"#work produced\n",
"\n",
"Psat=190.2 #in kPa\n",
"P1=Psat #saturation pressure in state 1\n",
"vf=0.001504 #in m^3/kg\n",
"vfg=0.62184 #in m^3/kg\n",
"x1=0.25 #quality\n",
"v1=vf+x1*vfg #specific volume at state 1 in m^3/kg\n",
"v2=1.41*v1 #specific volume at state 2 in m^3/kg\n",
"P2=600 #pressure in state 2 in kPa from Table B.2.2\n",
"m=0.5 #mass of ammonia in kg\n",
"W=m*(P1+P2)*(v2-v1)/2 #woork produced by ammonia in kJ\n",
"print \"The final pressure is\",round(P2),\"kPa\\n\"\n",
"print \"hence,work produced by ammonia is\",round(W,2),\"kJ\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The final pressure is 600.0 kPa\n",
"\n",
"hence,work produced by ammonia is 12.71 kJ\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex4.4:PG-100"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 4\n",
"\n",
"#calculating work done\n",
"\n",
"v1=0.35411 #specific volume at state 1 in m^3/kg\n",
"v2=v1/2 \n",
"m=0.1 #mass of water in kg\n",
"P1=1000 #pressure inside cylinder in kPa\n",
"W=m*P1*(v2-v1) #in kJ\n",
"print \"the work in the overall process is\",round(W,1),\"kJ\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the work in the overall process is -17.7 kJ\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex4.7:PG-108"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 7\n",
"#heat transfer\n",
"k=1.4 #conductivity of glass pane in W/m-K\n",
"A=0.5 #total surface area of glass pane\n",
"dx=0.005 #thickness of glasspane in m\n",
"dT1=20-12.1 #temperature difference between room air and outer glass surface temperature in celsius\n",
"Q=-k*A*dT1/dx #conduction through glass slab in W\n",
"h=100 #convective heat transfer coefficient in W/m^2-K \n",
"dT=12.1-(-10) #temperature difference between warm room and colder ambient in celsius\n",
"Q2=h*A*dT #heat transfer in convective layer in W\n",
"#result\n",
"print \"the rate of heat transfer in the glass and convective layer is\",round(Q2),\"kW.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the rate of heat transfer in the glass and convective layer is 1105.0 kW.\n"
]
}
],
"prompt_number": 1
}
],
"metadata": {}
}
]
}
|