Skip to content

Commit f873023

Browse files
author
nice
committed
adding book
1 parent 728bf70 commit f873023

File tree

123 files changed

+208264
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+208264
-18
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Contributed By: pratik gandhi
2-
Course: bca
3-
College/Institute/Organization: Cybercom Creation
4-
Department/Designation: Developer
1+
Contributed By: Jai Mathur
2+
Course: mca
3+
College/Institute/Organization: IIT
4+
Department/Designation: System Admin
55
Book Title: Chemical Engineering Thermodynamics
6-
Author: P. Ahuja
7-
Publisher: PHI Learning Private Limited, New Delhi
8-
Year of publication: 2009
9-
Isbn: 9788120336377
6+
Author: Y. V. C. Rao
7+
Publisher: Universities Press
8+
Year of publication: 1997
9+
Isbn: 81-7371-048-1
1010
Edition: 1
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"metadata": {
3+
"name": "",
4+
"signature": "sha256:4f7d90cd7b10a2be32d6f9985c84b88b7895b54f53fda509a7ab6972ab90144a"
5+
},
6+
"nbformat": 3,
7+
"nbformat_minor": 0,
8+
"worksheets": [
9+
{
10+
"cells": [
11+
{
12+
"cell_type": "heading",
13+
"level": 1,
14+
"metadata": {},
15+
"source": [
16+
"Chapter 1 : Introduction"
17+
]
18+
},
19+
{
20+
"cell_type": "heading",
21+
"level": 3,
22+
"metadata": {},
23+
"source": [
24+
"Example 1.1 Page No : 6"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"collapsed": false,
30+
"input": [
31+
"\n",
32+
"\n",
33+
"# Variables\n",
34+
"weight = 981. \t\t\t #weight of payload in N\n",
35+
"gmoon = 1.62;\t\t\t #acceleration due to gravity on the moon in m/s**2\n",
36+
"g = 9.81;\t\t\t #acceleration due to gravity on earth\n",
37+
"\n",
38+
"# Calculations\n",
39+
"mass = weight/g; \t\t\t # Calculations of mass of the payload in kg (calculated as F = m*g)\n",
40+
"weightmoon = mass*gmoon;\t\t\t # Calculations of weight of payload on the moon in N\n",
41+
"\n",
42+
"# Results\n",
43+
"print ' The weight of payload on the moon = %d N'%(weightmoon);\n",
44+
"\n"
45+
],
46+
"language": "python",
47+
"metadata": {},
48+
"outputs": [
49+
{
50+
"output_type": "stream",
51+
"stream": "stdout",
52+
"text": [
53+
" The weight of payload on the moon = 162 N\n"
54+
]
55+
}
56+
],
57+
"prompt_number": 1
58+
},
59+
{
60+
"cell_type": "heading",
61+
"level": 3,
62+
"metadata": {},
63+
"source": [
64+
"Example 1.2 Page No : 7"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"collapsed": false,
70+
"input": [
71+
"\n",
72+
"\n",
73+
"# Variables\n",
74+
"l = 15.;\t\t\t #length of the child's head in cm\n",
75+
"b = 12.;\t\t\t #breadth of the child's head in cm\n",
76+
"p = 101325.;\t\t\t #atmospheric pressure in Pa\n",
77+
"\n",
78+
"# Calculations\n",
79+
"area = (l*b)/(10**4);\t\t\t # Calculations of area of the child's head in m**2\n",
80+
"force = p*area;\t\t\t # Calculations of force exerted on the child's head due to atmospheric air in N\n",
81+
"\n",
82+
"# Results\n",
83+
"print ' The force exerted on the childs head due to atmospheric air = %.2f N'%(force);\n",
84+
"\n"
85+
],
86+
"language": "python",
87+
"metadata": {},
88+
"outputs": [
89+
{
90+
"output_type": "stream",
91+
"stream": "stdout",
92+
"text": [
93+
" The force exerted on the childs head due to atmospheric air = 1823.85 N\n"
94+
]
95+
}
96+
],
97+
"prompt_number": 14
98+
},
99+
{
100+
"cell_type": "heading",
101+
"level": 3,
102+
"metadata": {},
103+
"source": [
104+
"Example 1.3 Page No : 7"
105+
]
106+
},
107+
{
108+
"cell_type": "code",
109+
"collapsed": false,
110+
"input": [
111+
"import math\n",
112+
"\n",
113+
"\n",
114+
"# Variables\n",
115+
"rho_water = 1000.;\t\t\t #density of water flowing through the pipeline in kg/m**3\n",
116+
"rho_manomtr = 1595.;\t\t #density of manometric fluid (carbon tetrachloride) in kg/m**3\n",
117+
"l = 40.;\t \t\t #length between the selected sections in cm\n",
118+
"theta = 45.\t\t\t #inclination of the manometer in degrees\n",
119+
"g = 9.81;\t \t\t #acceleration due to gravity in m/s**2\n",
120+
"\n",
121+
"# Calculations\n",
122+
"delp = (l/100.)*math.sin((theta*math.pi)/180.)*g*(rho_manomtr-rho_water); # Calculations of pressure drop between the required sections in Pa\n",
123+
"\n",
124+
"# Results\n",
125+
"print ' The pressure drop between the required sections = %.2f Pa'%delp\n",
126+
"\n"
127+
],
128+
"language": "python",
129+
"metadata": {},
130+
"outputs": [
131+
{
132+
"output_type": "stream",
133+
"stream": "stdout",
134+
"text": [
135+
" The pressure drop between the required sections = 1650.94 Pa\n"
136+
]
137+
}
138+
],
139+
"prompt_number": 13
140+
}
141+
],
142+
"metadata": {}
143+
}
144+
]
145+
}
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
{
2+
"metadata": {
3+
"name": ""
4+
},
5+
"nbformat": 3,
6+
"nbformat_minor": 0,
7+
"worksheets": [
8+
{
9+
"cells": [
10+
{
11+
"cell_type": "heading",
12+
"level": 1,
13+
"metadata": {},
14+
"source": [
15+
"Chapter 10 : Stability and phase transition in thermodynamic systems"
16+
]
17+
},
18+
{
19+
"cell_type": "heading",
20+
"level": 3,
21+
"metadata": {},
22+
"source": [
23+
"Example 10.2 Page No : 369"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"collapsed": false,
29+
"input": [
30+
"\n",
31+
"# Variables\n",
32+
"P = 2;\t\t\t #number of phases (no unit)\n",
33+
"C = 2;\t\t\t #number of components (no unit)\n",
34+
"\n",
35+
"# Calculations\n",
36+
"F = C+2-P\n",
37+
"\n",
38+
"# Results\n",
39+
"print \" The number of degrees of freedom = %d \"%(F);\n",
40+
"print \"Two intensive properties are required to be specified to\\\n",
41+
" describe the thermodynamic state of the system,and the fundamental relation in\\\n",
42+
" the Gibbs free energy representation for this system is of the type, G = GT,P,N1,N2\"\n",
43+
"\n"
44+
],
45+
"language": "python",
46+
"metadata": {},
47+
"outputs": [
48+
{
49+
"output_type": "stream",
50+
"stream": "stdout",
51+
"text": [
52+
" The number of degrees of freedom = 2 \n",
53+
"Two intensive properties are required to be specified to describe the thermodynamic state of the system,and the fundamental relation in the Gibbs free energy representation for this system is of the type, G = GT,P,N1,N2\n"
54+
]
55+
}
56+
],
57+
"prompt_number": 1
58+
},
59+
{
60+
"cell_type": "heading",
61+
"level": 3,
62+
"metadata": {},
63+
"source": [
64+
"Example 10.3 Page No : 370"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"collapsed": false,
70+
"input": [
71+
"\n",
72+
"import cmath\n",
73+
"import math\n",
74+
"\n",
75+
"# Variables\n",
76+
"T = 427.85;\t\t\t #temperature of n-octane vapour in K\n",
77+
"R = 8.314;\t\t\t #universal gas constant in J/molK\n",
78+
"Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n",
79+
"Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n",
80+
"w = 0.398;\t\t\t #acentric factor (no unit) \n",
81+
"\n",
82+
"# Calculations\n",
83+
"Pguess = 0.215\n",
84+
"\n",
85+
"\n",
86+
"Tr = T/Tc\n",
87+
"Pr = (Pguess*10**6)/(Pc*10**5)\n",
88+
"S = 0.37464+(1.54226*w)-(0.26992*w**2)\n",
89+
"alpha1 = (1+(S*(1-math.sqrt(Tr))))**2;\n",
90+
"a = (0.45724*R**2*Tc**2*alpha1)/(Pc*10**5)\n",
91+
"b = (0.07780*R*Tc)/(Pc*10**5);\t\t\t \n",
92+
"A = (a*Pguess*10**6)/(R*T)**2;\t\t\t \n",
93+
"B = (b*Pguess*10**6)/(R*T);\t\t\t \n",
94+
"alpha = -1+B\n",
95+
"beeta = A-(2*B)-(3*B**2)\n",
96+
"gaamma = -(A*B)+(B**2)+(B**3)\n",
97+
"p = beeta-(alpha**2)/3;\t\t\n",
98+
"q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n",
99+
"D = (((q)**2)/4)+(((p)**3)/27);\t\t\t \n",
100+
"\n",
101+
"\n",
102+
"if D>0:\n",
103+
" Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3);\n",
104+
" Z_l = Z;\n",
105+
" Z_v = Z;\n",
106+
"elif D == 0:\n",
107+
" Z1 = ((-2*(q/2))**(1./3))-(alpha/3);\t\t\t \n",
108+
" Z2 = ((q/2)**(1./3))-(alpha/3);\n",
109+
" Z3 = ((q/2)**(1./3))-(alpha/3);\n",
110+
" Z = [Z1 ,Z2, Z3];\n",
111+
" Z_l = min(Z);\n",
112+
" Z_v = max(Z);\n",
113+
"else:\n",
114+
" r = math.sqrt((-(p**3)/27));\t\t\t \n",
115+
" theta = math.acos((-(q)/2)*(1./r));\t\t\n",
116+
" Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n",
117+
" Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n",
118+
" Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3)\n",
119+
" Z = [Z1, Z2, Z3];\n",
120+
" Z_l = min(Z)\n",
121+
" Z_v = max(Z)\n",
122+
"\n",
123+
"\n",
124+
"phi_l = math.exp(Z_l-1-math.log(Z_l-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_l+(B*(1+math.sqrt(2))))/(Z_l+(B*(1-math.sqrt(2)))))));\n",
125+
"phi_v = math.exp(Z_v-1-math.log(Z_v-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_v+(B*(1+math.sqrt(2))))/(Z_v+(B*(1-math.sqrt(2)))))));\n",
126+
"fl = Pguess*phi_l;\t\t\t # Calculations of the fugacity of the liquid in MPa\n",
127+
"fv = Pguess*phi_v;\t\t\t # Calculations of the fugacity of the vapour in MPa\n",
128+
"tolerance = 1e-3;\t\t\t #defining the tolerance to compare fl and fv\n",
129+
"\n",
130+
"if abs(fl-fv)<tolerance:\n",
131+
" P = Pguess;\t\t\t\n",
132+
"else:\n",
133+
" Prevised = Pguess*(fl/fv)\n",
134+
"\n",
135+
"while abs(fl-fv)>tolerance:\n",
136+
" Tr = T/Tc\n",
137+
" Pr = (Prevised*10**6)/(Pc*10**5);\n",
138+
" S = 0.37464+(1.54226*w)-(0.26992*w**2)\n",
139+
" alpha1 = (1+(S*(1-math.sqrt(Tr))))**2;\n",
140+
" a = (0.45724*R**2*Tc**2*alpha1)/(Pc*10**5)\n",
141+
" b = (0.07780*R*Tc)/(Pc*10**5);\t\t\t \n",
142+
" A = (a*Prevised*10**6)/(R*T)**2;\t\t\n",
143+
" B = (b*Prevised*10**6)/(R*T);\t\t\t\n",
144+
" alpha = -1+B;\t\t\t \n",
145+
" beeta = A-(2*B)-(3*B**2);\n",
146+
" gaamma = -(A*B)+(B**2)+(B**3)\n",
147+
" p = beeta-(alpha**2)/3;\t\t\n",
148+
" q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n",
149+
" D = (((q)**2)/4)+(((p)**3)/27);\t\n",
150+
" \n",
151+
" if D > 0:\n",
152+
" Z=((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3); #One real root given by Eq.(3.32)\n",
153+
" Z_l=Z;\n",
154+
" Z_v=Z;\n",
155+
" elif D==0:\n",
156+
" Z1=((-2*(q/2))**(1./3))-(alpha/3); #Three real roots and two equal given by Eq.(3.33)\n",
157+
" Z2=((q/2)**(1./3))-(alpha/3);\n",
158+
" Z3=((q/2)**(1./3))-(alpha/3);\n",
159+
" Z=[Z1, Z2, Z3];\n",
160+
" Z_l=min(Z);\n",
161+
" Z_v=max(Z);\n",
162+
" else:\n",
163+
" r = math.sqrt((-(p**3)/27));\t\t\t \n",
164+
" theta = math.acos((-(q)/2)*(1./r));\t\t\n",
165+
" Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n",
166+
" Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n",
167+
" Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n",
168+
" Z = [Z1, Z2, Z3];\n",
169+
" Z_l = Z[0];\n",
170+
" Z_v = Z[1];\n",
171+
"\n",
172+
" phi_l = math.exp(Z_l-1-math.log(Z_l-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_l+(B*(1+math.sqrt(2))))/(Z_l+(B*(1-math.sqrt(2)))))));\n",
173+
" phi_v = math.exp(Z_v-1-math.log(Z_v-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_v+(B*(1+math.sqrt(2))))/(Z_v+(B*(1-math.sqrt(2)))))));\n",
174+
" fl = Prevised*phi_l;\t\n",
175+
" fv = Prevised*phi_v;\t\n",
176+
" Prevised = Prevised*fl/fv\n",
177+
"\n",
178+
"P = Prevised;\t\t\t\n",
179+
"\n",
180+
"# Results\n",
181+
"print \" The vapour pressure of n-octane at 427.85K = %.5f\"%P,\" MPa\"\n",
182+
"\n",
183+
"# Note: answer is slightly differnt because of rounding off error."
184+
],
185+
"language": "python",
186+
"metadata": {},
187+
"outputs": [
188+
{
189+
"output_type": "stream",
190+
"stream": "stdout",
191+
"text": [
192+
" The vapour pressure of n-octane at 427.85K = 0.21196 MPa\n"
193+
]
194+
}
195+
],
196+
"prompt_number": 34
197+
}
198+
],
199+
"metadata": {}
200+
}
201+
]
202+
}

0 commit comments

Comments
 (0)