summaryrefslogtreecommitdiff
path: root/Engineering_&_Chemical_Thermodynamics/ch1.ipynb
blob: b3ff4f918b39b83ac16548ee363124ad1f3806b3 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 : Measured thermodynamic Properties and Other Basic Concepts"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3  Page No : 28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "P = 1.4 ; \t\t\t# [MPa]\n",
      "T = 333. \t\t\t#[K]\n",
      "T1 = 320. \t\t\t#[K]\n",
      "T2 = 360. \t\t\t#[K]\n",
      "P_low = 1. \t\t\t#[MPa]\n",
      "P_high = 1.5\n",
      "V_cap_T1_P1 = 0.2678\n",
      "V_cap_T2_P1 = 0.2873\n",
      "V_cap_T1_P1_5 = 0.1765\n",
      "V_cap_T2_P1_5 = 0.1899\n",
      "\n",
      "# Calculations\n",
      "#At P = 1 MPa\n",
      "V_cap_T333_P1 = V_cap_T1_P1 + (V_cap_T2_P1 - V_cap_T1_P1)*((T - T1)/(T2- T1))\n",
      "\n",
      "#Similarly at P=1.5 MPa\n",
      "V_cap_T333_P1_5 = V_cap_T1_P1_5 + (V_cap_T2_P1_5 - V_cap_T1_P1_5)*((T - T1)/(T2 - T1))\n",
      "\n",
      "#At T=333*C\n",
      "V_cap_P1_5 = V_cap_T333_P1_5 ;\n",
      "V_cap_P1 = V_cap_T333_P1 ;\n",
      "V_cap_P1_4 = V_cap_P1 + (V_cap_P1_5 - V_cap_P1)*((P - P_low)/(P_high - P_low)) ; \t\t\t#[m**3/kg]\n",
      "\n",
      "# Results\n",
      "print 'Required specific volume = %.5f m**3/kg'%(V_cap_P1_4);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required specific volume = 0.19951 m**3/kg\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4  Page No : 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "P = 1.4 ; \t\t\t#[MPa]\n",
      "P_low = 1 ;\t\t\t#[MPa]\n",
      "P_high = 1.5;\t\t\t#[MPa]\n",
      "\n",
      "#At T=333*C from interpolation we have\n",
      "v_cap_P1_5 = 0.18086 ;\t\t\t#[m**3/kg]\n",
      "v_cap_P1 = 0.27414 ;\t\t\t#[m**3/kg]\n",
      "\n",
      "# Calculations\n",
      "#Molar volume is inversely proportional to pressure\n",
      "v_cap_P1_4 = v_cap_P1 +(v_cap_P1_5 - v_cap_P1)*((1/P - 1/P_low)/(1/P_high - 1/P_low));\n",
      "x=(0.19951-v_cap_P1_4)/v_cap_P1_4*100 ;\n",
      "\n",
      "# Results\n",
      "print 'Specific volume m**3/kg) = %g m**3/kg'%(v_cap_P1_4);\n",
      "print 'Percentage difference = %.1f %%'%(x);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific volume m**3/kg) = 0.194186 m**3/kg\n",
        "Percentage difference = 2.7 %\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5 page no : 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# variables\n",
      "V1 =  1             # volume\n",
      "m1 =  2.5          # water\n",
      "Vv = 5.042         # m**3/kg\n",
      "Vt = .001023       # m**3/kg\n",
      "T_44632 = 145      # C\n",
      "T_39278 = 150        # C\n",
      "\n",
      "# Calculations\n",
      "v1 = V1/m1 \n",
      "x1 = (v1 - Vt)/(Vv - Vt)\n",
      "\n",
      "T2 = T_44632 + ( T_39278 - T_44632) * (( 0.4 - 0.44632)/(0.39278 - 0.44632))\n",
      "\n",
      "# Restuls\n",
      "print \"Approximately %.f %% of the mass of water in the vapor\"%(round(x1,2)*100)\n",
      "print \"Temperature T2 = %.1f C\"%T2\n",
      "\n",
      "# Note : Answer in book is wrong. Please calculate manually.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Approximately 8 % of the mass of water in the vapor\n",
        "Temperature T2 = 149.3 C\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}