summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter18.ipynb
blob: 696c7fa6338ad088147a726b93a22287302e5cd6 (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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 18 - Refrigeration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1: pg 612"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 18.1\n",
      " (a) The coefficient of performance of the refrigerator is  =   4.49\n",
      " (b) The mass flow of refrigerant/h is (kg) =  166.94\n",
      " (c) The mass flow of water required is (kg/h) =  579.74\n",
      "The answer is a bit different due to rounding off error in textbook\n"
     ]
    }
   ],
   "source": [
    "#pg 612\n",
    "print('Example 18.1');\n",
    "\n",
    "# aim : To determine\n",
    "# (a) the coefficient of performance\n",
    "# (b) the mass flow of the refrigerant\n",
    "# (c) the cooling water required by the condenser\n",
    "import math\n",
    "from math import log\n",
    "# given values\n",
    "P1 = 462.47;# pressure limit, [kN/m**2]\n",
    "P3 = 1785.90;# pressure limit, [kN/m**2]\n",
    "T2 = 273.+59;# entering saturation temperature, [K]\n",
    "T5 = 273.+32;# exit temperature of condenser, [K]\n",
    "d = 75*10**-3;# bore, [m]\n",
    "L = d;# stroke, [m]\n",
    "N = 8;# engine speed, [rev/s]\n",
    "VE = .8;# olumetric efficiency\n",
    "cpL = 1.32;# heat capacity of liquid, [kJ/kg K]\n",
    "c = 4.187;# heat capacity of water, [kj/kg K]\n",
    "\n",
    "# solution\n",
    "# from given table\n",
    "# at P1\n",
    "h1 = 231.4;# specific enthalpy, [kJ/kg]\n",
    "s1 = .8614;# specific entropy,[ kJ/kg K\n",
    "v1 = .04573;# specific volume, [m**3/kg]\n",
    "\n",
    "# at P3\n",
    "h3 = 246.4;# specific enthalpy, [kJ/kg]\n",
    "s3 = .8093;# specific entropy,[ kJ/kg K\n",
    "v3 = .04573;# specific volume, [m**3/kg]\n",
    "T3= 273+40;# saturation temperature, [K]\n",
    "h4 = 99.27;# specific enthalpy, [kJ/kg]\n",
    "# (a)\n",
    "s2 = s1;# specific entropy, [kJ/kg k]\n",
    "# using s2=s3+cpv*log(T2/T3)\n",
    "cpv = (s2-s3)/log(T2/T3);# heat capacity, [kj/kg k]\n",
    "\n",
    "# from Fig.18.8\n",
    "T4 = T3;\n",
    "h2 = h3+cpv*(T2-T3);# specific enthalpy, [kJ/kg]\n",
    "h5 = h4-cpL*(T4-T5);# specific enthalpy, [kJ/kg]\n",
    "h6 = h5;\n",
    "COP = (h1-h6)/(h2-h1);# coefficient of performance\n",
    "print ' (a) The coefficient of performance of the refrigerator is  =  ',round(COP,2)\n",
    "\n",
    "# (b)\n",
    "SV = math.pi/4*d**2*L;# swept volume of compressor/rev, [m**3]\n",
    "ESV = SV*VE*N*3600;# effective swept volume/h, [m**3]\n",
    "m = ESV/v1;# mass flow of refrigerant/h,[kg]\n",
    "print ' (b) The mass flow of refrigerant/h is (kg) = ',round(m,2)\n",
    "\n",
    "# (c)\n",
    "dT = 12;# temperature limit, [C]\n",
    "Q = m*(h2-h5);# heat transfer in condenser/h, [kJ]\n",
    "# using Q=m_dot*c*dT, so\n",
    "m_dot = Q/(c*dT);# mass flow of water required, [kg/h]\n",
    "print ' (c) The mass flow of water required is (kg/h) = ',round(m_dot,2)\n",
    "\n",
    "print 'The answer is a bit different due to rounding off error in textbook'\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2: pg 614"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 18.2\n",
      " (a) The mass flow of R401 is (kg/h) =  592.6\n",
      " (b) The dryness fraction of R401 at the entry to the evaporator is  =  0.244\n",
      " (c) The power to driving motor is (kW) =  5.86\n",
      " (d) The ratio of heat transferred from condenser to the power required to the motor is  =   4.74 :1\n"
     ]
    }
   ],
   "source": [
    "#pg 614\n",
    "print('Example 18.2');\n",
    "\n",
    "# aim : To determine\n",
    "# (a) the mass flow of R401\n",
    "# (b) the dryness fraction of  R401 at the entry to the evaporator\n",
    "# (c) the power of driving motor\n",
    "# (d) the ratio of heat transferred from condenser to the power required to the motor\n",
    "from math import log\n",
    "# given values\n",
    "P1 = 411.2;# pressure limit, [kN/m^2]\n",
    "P3 = 1118.9;# pressure limit, [kN/m^2]\n",
    "Q = 100*10**3;# heat transfer from the condenser,[kJ/h]\n",
    "T2 = 273+60;# entering saturation temperature, [K]\n",
    "\n",
    "# given\n",
    "# from given table\n",
    "# at P1\n",
    "h1 = 409.3;# specific enthalpy, [kJ/kg]\n",
    "s1 = 1.7431;# specific entropy,[ kJ/kg K\n",
    "\n",
    "# at P3\n",
    "h3 = 426.4;# specific enthalpy, [kJ/kg]\n",
    "s3 = 1.7192;# specific entropy,[ kJ/kg K\n",
    "T3 = 273.+50;# saturation temperature, [K]\n",
    "h4 = 265.5;# specific enthalpy, [kJ/kg]\n",
    "# (a)\n",
    "s2 = s1;# specific entropy, [kJ/kg k]\n",
    "# using s2=s3+cpv*log(T2/T3)\n",
    "cpv = (s2-s3)/log(T2/T3);# heat capacity, [kj/kg k]\n",
    "\n",
    "# from Fig.18.8\n",
    "h2 = h3+cpv*(T2-T3);# specific enthalpy, [kJ/kg]\n",
    "Qc = h2-h4;# heat transfer from condenser, [kJ/kg]\n",
    "mR401 = Q/Qc;# mass flow of R401, [kg]\n",
    "print ' (a) The mass flow of R401 is (kg/h) = ',round(mR401,1)\n",
    "\n",
    "# (b)\n",
    "hf1 = 219;# specific enthalpy, [kJ/kg]\n",
    "h5 = h4;\n",
    "# using h5=hf1+s5*(h1-hf1),so\n",
    "x5 = (h5-hf1)/(h1-hf1);# dryness fraction\n",
    "print ' (b) The dryness fraction of R401 at the entry to the evaporator is  = ',round(x5,3)\n",
    "\n",
    "# (c)\n",
    "P = mR401*(h2-h1)/3600/.7;# power to driving motor, [kW]\n",
    "print ' (c) The power to driving motor is (kW) = ',round(P,2)\n",
    "\n",
    "# (d)\n",
    "r = Q/3600./P;# ratio\n",
    "print ' (d) The ratio of heat transferred from condenser to the power required to the motor is  =  ',round(r,2),\":1\"\n",
    "\n",
    "#  End\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}