summaryrefslogtreecommitdiff
path: root/Heat_Transfer_In_SI_Units_by_J_P_Holman/10-Heat_Exchangers.ipynb
blob: 7994572390ad642a665a810d491a56f799a3e1cc (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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 10: Heat Exchangers"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.10: off_design_calculation_of_exchanger_in_example_10_4.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.10\n\n\n');\n",
"// off-design calculation of exchanger in example 10-4  \n",
"// Example 10.10 (page no.-544-546) \n",
"// solution\n",
"\n",
"m_dot_c = 68;// [kg/min] water flow rate\n",
"T1 = 35;// [degree celsius] initial temperature \n",
"T2 = 75;// [degree celsius] final temperature\n",
"Toe = 110;// [degree celsius] oil entering temperature \n",
"Tol = 75;// [degree celsius] oil leaving temperature\n",
"Cc = 4180;// [J/kg degree celsius] water specific heat capacity\n",
"Ch = 1900;// [J/kg degree celsius] heat capacity of oil\n",
"U = 320;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"A = 15.814568;// [square meter] area of heat exchanger (from example 10-4)\n",
"// the flow rate of oil is calculated from the energy balance for the original problem:\n",
"m_dot_h = m_dot_c*Cc*(T2-T1)/(Ch*(Toe-Tol));// [kg/min]\n",
"// the capacity rates for the new conditions are calculated as \n",
"C_h = m_dot_h*Ch/60;// [W/degree celsius]\n",
"C_c = m_dot_c*Cc/60;// [W/degree celsius]\n",
"// so that the water (cold fluid) is the minimum fluid, and \n",
"C_min_by_C_max = C_c/C_h;\n",
"NTU_max = U*A/C_c;\n",
"// from figure 10-13(page no.-542) or table 10-3(page no.-543) the effectiveness is \n",
"E = 0.744;\n",
"// and because the cold fluid is the minimum, we can write \n",
"dT_cold = E*(Toe-T1);// [degree celsius]\n",
"// and the exit water temperature is \n",
"Tw_exit = T1+dT_cold;// [degree celsius]\n",
"// the total heat transfer under the new flow conditions is calculated  as \n",
"m_dot_c = 40;// [kg/min]\n",
"q = m_dot_c*Cc*dT_cold/60;// [W]\n",
"printf('exit water temperature is %f degree celcius',Tw_exit);\n",
"printf('\n\n the total heat transfer under the new flow conditions is %f kW',q/1000);\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.11: cross_flow_exchanger_with_both_fluid_unmixed.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.11\n\n\n');\n",
"// cross-flow exchanger with both fluid unmixed  \n",
"// Example 10.11 (page no.-547-549) \n",
"// solution\n",
"\n",
"pa = 101325;// [Pa] pressure of air\n",
"Ti = 15.55;// [degree celsius] initial temperature of air\n",
"Tf = 29.44;// [degree celsius] final temperature of air\n",
"Thw = 82.22;// [degree celsius] hot water temperature\n",
"U = 227;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"S = 9.29;// [square meter] total surface area of heat exchanger\n",
"R = 287;// [] universal gas constant\n",
"Cc = 1006;// [J/kg degree celsius] specific heat of air \n",
"Ch = 4180;// [J/kg degree celsius] specific heat of water\n",
"// the heat transfer is calculated from the energy balance on the air. first, the inlet air density is \n",
"rho = pa/(R*(Ti+273.15));// [kg/cubic meter]\n",
"// so the mass flow of air (the cold fluid) is \n",
"mdot_c = 2.36*rho;// [kg/s]\n",
"// the heat transfer is then \n",
"q = mdot_c*Cc*(Tf-Ti);// [W]\n",
"// from the statement of the problem we do not know whether the air or water is the minimum fluid. a trial and error procedur must be used with figure  10-15(page no.-545) or table 10-3(page no.-543).\n",
"// we assume that the air is the minimum fluid and then check out our assumption. then\n",
"Cmin = mdot_c*Cc;// [W/degree celsius]\n",
"NTU_max = U*S/Cmin;\n",
"// and the effectiveness based on the air as the minimum fluid is \n",
"E = (Tf-Ti)/(Thw-Ti);\n",
"// entering figure 10-15, we are unable to match these quantities with the curves. this require that the hot fluid be the minimum. we must therefore assume values for the water flow rate until we are able to match the performance as given by figure 10-15 or table 10-3. we first note that\n",
"Cmax = mdot_c*Cc;// [W/degree celsius]           (a)\n",
"// NTU_max = U*S/Cmin;                            (b)\n",
"// E = dT_h/(Thw-Ti)                             (c)\n",
"// dT_h = q/Cmin                                 (d)\n",
"\n",
"// now we assume different values for Cmin abd calculate different-different values for NTU_max, dT_h, and E\n",
"\n",
"// for \n",
"Cmin_by_Cmax1 = 0.5;\n",
"Cmin1 = Cmin_by_Cmax1*Cmax;// [W/degree celsius]\n",
"NTU_max1 = U*S/Cmin1;\n",
"dT_h1 = q/Cmin1;// [degree celsius]\n",
"E1_c1 = dT_h1/(Thw-Ti);// calculated\n",
"E1_t1 = 0.65;// from table \n",
"\n",
"// for \n",
"Cmin_by_Cmax2 = 0.25;\n",
"Cmin2 = Cmin_by_Cmax2*Cmax;// [W/degree celsius]\n",
"NTU_max2 = U*S/Cmin2;\n",
"dT_h2 = q/Cmin2;// [degree celsius]\n",
"E1_c2 = dT_h2/(Thw-Ti);// calculated\n",
"E1_t2 = 0.89;// from table \n",
"\n",
"// for \n",
"Cmin_by_Cmax3 = 0.22;\n",
"Cmin3 = Cmin_by_Cmax3*Cmax;// [W/degree celsius]\n",
"NTU_max3 = U*S/Cmin3;\n",
"dT_h3 = q/Cmin3;// [degree celsius]\n",
"E1_c3 = dT_h3/(Thw-Ti);// calculated\n",
"E1_t3 = 0.92;// from table \n",
"\n",
"// we estimate the water-flow rate as about\n",
"Cmin = 660;// [W/degree celsius]\n",
"mdot_h = Cmin/Ch;// [kg/s]\n",
"// the exit water temperature is accordingly\n",
"Tw_exit = Thw-q/Cmin;// [degree celsius]\n",
"printf('the exit water temperature is %f degree celsius',Tw_exit);\n",
"printf('\n\n the heat transfer is %f kW',q/1000);"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.12: comparison_of_single_or_two_exchanger_options.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.12\n\n\n');\n",
"// comparison of single- or two-exchanger options  \n",
"// Example 10.12 (page no.-549-551) \n",
"// solution\n",
"\n",
"mdot_c = 1.25;// [kg/s] water flow rate\n",
"Ti = 35;// [degree celsius] initial temperature of water\n",
"Tf = 80;// [degree celsius] final temperature of water\n",
"Toi = 150;// [degree celsius] initial temperature of oil\n",
"Tof = 85;// [degree celsius] final temperature of oil\n",
"U = 850;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"Cp_water = 4180;// [] specific heat of water\n",
"Cp_oil = 2000;// [J/kg degree celsius]  \n",
"// we calculate the surface area required for both alternatives and then compare costs. for the one large exchanger \n",
"q = mdot_c*Cp_water*(Tf-Ti);// [W]\n",
"mdot_c_into_Cp_water = mdot_c*Cp_water;// [W/degree celsius]\n",
"mdot_h_into_Cp_oil = q/(Toi-Tof);// [W/degree celsius]\n",
"Cmin = mdot_h_into_Cp_oil;// [W/degree celsius]\n",
"Cmax = mdot_c_into_Cp_water;// [W/degree celsius]\n",
"// so that oil is the minimum fluid:\n",
"Eh = (Toi-Tof)/(Toi-Ti);\n",
"Cmin_by_Cmax = Cmin/Cmax;\n",
"// from figure 10-13(page no.-542), \n",
"NTU_max = 1.09;\n",
"A = NTU_max*Cmin/U;// [square meter]\n",
"// we now wish to calculate the surface-area requirement for the two small exchanger because U*A and Cmin are the same for each exchanger. \n",
"// this requires that the effectiveness be the same for each exchanger. thus,\n",
"// E1 = (Toi-Toe_1)/(Toi-Ti) = E2 = (Toi-Toe_2)/(Toi-Tw2)                                            (a)\n",
"// where the nomenclature for the temperatures is indicated in the sketch. because the oil flow is the same in each exchanger and the average exit oil temperature must be 85 degree celsius, we may write\n",
"// (Toe_1+Toe_2)/2 = 85                                                                              (b)\n",
"// an energy balance on the second heat exchanger gives\n",
"// mdot_c_into_Cp_water*(Tf-Tw2) = mdot_h_into_Cp_oil*(Toi-Toe_2)/2                                  (c)\n",
"// we now have three equations (a),(b), and (c) which may be solved for the three unknowns Toe_1, Toe_2, and Tw2. \n",
"// eliminating Tw2, and Toe_1 from equation (a) by the help of equation (b) and (c)\n",
"deff('[y] = H(Toe_2)','y = (Toi-(170-Toe_2))/(Toi-Ti) - (Toi-Toe_2)/(Toi-(Tf-(mdot_h_into_Cp_oil*(Toi-Toe_2)/(mdot_c_into_Cp_water*2))))');\n",
"Toe_2 = fsolve(1,H);// [degree celsius]\n",
"Toe_1 = (170-Toe_2);// [degree celsius]\n",
"Tw2 = (Tf-(mdot_h_into_Cp_oil*(Toi-Toe_2)/(mdot_c_into_Cp_water*2)));// [degree celsius]\n",
"// the effectiveness can then be calculated as \n",
"E1 = (Toi-Toe_1)/(Toi-Ti);\n",
"E2 = E1;\n",
"// from figure 10-13(page no.-542), we obtain \n",
"NTU_max = 1.16;\n",
"// so that \n",
"A1 = NTU_max*Cmin/(U*2);// [square meter]\n",
"printf('we have find that %f square meter of area is required for each of small exchangers, or a total of %f square meter',A1,2*A1);\n",
"printf('\n\n the area required in the one larger exchanger is %f square meter',A);\n",
"printf('\n\n the cost per unit area is greater so that the most economical choice would be the single larger exchanger ');"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.13: shell_and_tube_exchangeras_air_heater.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.13\n\n\n');\n",
"// shell and tube exchangeras air heater  \n",
"// Example 10.13 (page no.-551-552) \n",
"// solution\n",
"\n",
"To = 100;// [degree celsius] temperature of hot oil\n",
"m_dot_a = 2;// [kg/s] flow rate of air\n",
"T1 = 20;// [degree celsius] initial temperature of air \n",
"T2 = 80;// [degree celsius] final temperature of air\n",
"Cp_o = 2100;// [J/kg degree celsius] specific heat of the oil\n",
"Cp_a = 1009;// [J/kg degree celsius] specific heat of the air\n",
"m_dot_o = 3;// [kg/s] flow rate of oil\n",
"U = 200;// [W/square meter] overall heat transfer coefficient\n",
"// the basic energy balance is m_dot_o*Cp_o*(To-Toe) = m_dot_a*Cp_a*(T2-T1)\n",
"Toe = To-m_dot_a*Cp_a*(T2-T1)/(m_dot_o*Cp_o);// [degree celsius]\n",
"// we have\n",
"m_dot_h_into_Ch = m_dot_o*Cp_o;// [W/degree celsius]\n",
"m_dot_c_into_Cc = m_dot_a*Cp_a;// [W/degree celsius]\n",
"// so the air is minimum fluid\n",
"C = m_dot_c_into_Cc/m_dot_h_into_Ch;\n",
"// the effectiveness is \n",
"E = (T2-T1)/(To-T1);\n",
"// now we may use either figure 10-16(page no.-546) or the analytical relation from table 10-4(page no.-543) to obtain NTU. \n",
"// for this problem we choose to use the table \n",
"NTU = -(1+C^(2))^(-1/2)*log((2/E-1-C-(1+C^2)^(1/2))/(2/E-1-C+(1+C^2)^(1/2)));\n",
"// now, we calcuate the area as \n",
"A = NTU*m_dot_c_into_Cc/U;// [square meter]\n",
"printf('area required for the heat exchanger is %f square meter',A);\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.14: ammonia_condenser.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.14\n\n\n');\n",
"// ammonia condenser  \n",
"// Example 10.14 (page no.-552-553) \n",
"// solution\n",
"\n",
"Ta = 50;// [degree celsius] temperature of entering ammonia vapour\n",
"Tw1 = 20;// [degree celsius] temperature of entering water\n",
"q = 200;// [kW] total heat transfer required\n",
"U = 1;// [kW/square meter degree celsius] overall heat transfer coefficient\n",
"Tw2 = 40;// [degree celsius] temperature of exiting water\n",
"Cw = 4.18;// [kJ/kg degree celsius] specific heat of water\n",
"// the mass flow can be calculated from the heat transfer with\n",
"m_dot_w = q/(Cw*(Tw2-Tw1));// [kg/s]\n",
"// because this is the condenser the water is the minimum fluid and \n",
"C_min = m_dot_w*Cw;// [kW/degree celsius]\n",
"// the value of NTU is obtained from the last entry of table 10-4(page no.-543), with\n",
"E = 0.6;// effectiveness\n",
"NTU = -log(1-E);\n",
"// so that area is calculated as \n",
"A = C_min*NTU/U;// [square meter]\n",
"// when the flow rate is reduced in half the new value of NTU is \n",
"NTU1 = U*A/(C_min/2);\n",
"// and the effectiveness is computed from the last entry of table 10-3(page no.-543):\n",
"E1 = 1-exp(-NTU1);\n",
"// the new water temperature difference is computed as \n",
"dT_w = E1*(Ta-Tw1);// [degree celsius]\n",
"// so that the heat transfer is \n",
"q1 = C_min*dT_w/2;// [kW]\n",
"printf('the area to achieve a heat exchanger effectiveness of 60%% with an exit water temperature of 40 degree celsius is %f square meter',A);\n",
"printf('\n\n by reducing the flow rate we have lowered the heat transfer by %d percent',(q-q1)*100/q);\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.15: crossflow_exchanger_as_energy_conservation_device.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.15\n\n\n');\n",
"// crossflow exchanger as energy conservation device  \n",
"// Example 10.15 (page no.-553-555) \n",
"// solution\n",
"\n",
"q = 210000;// [W] heat to be removed from atmospheric air\n",
"m_dot_h = 1200/60;// [kg/s] hot air flow rate\n",
"m_dot_c = m_dot_h;// [kg/s] cold air flow rate\n",
"Ta1 = 25;// [degree celsius] atmospheric air temperature \n",
"Ta2 = 0;// [degree celsius] temperature of air entering from out-door conditions \n",
"U = 30;// [W/m degree celsius] overall heat transfer coefficient\n",
"Cp = 1005;// [J/kg degree celsius] specific heat of air\n",
"\n",
"//*************calculation 1. the design value for the area of the heat exchanger **************//\n",
"\n",
"// the hot and cold fluids have the same flow rate \n",
"// and \n",
"Ch = m_dot_h*Cp;// [W/degree celsius]\n",
"Cc = m_dot_c*Cp;// [W/degree cslsius]\n",
"Cmin_by_Cmax = 1;// for use in table 10-3(page no.-543)\n",
"// the energy balance gives q = Ch*dT_h = Cc*dT_c\n",
"// and \n",
"dT_h = q/Ch;// [degree celsius]\n",
"dT_c = q/Cc;// [degree celsius]\n",
"// the heat exchanger effectiveness is \n",
"E = dT_h/(Ta1-Ta2);\n",
"// consulting table 10-3(page no.-543) for a cross flow exchanger with both fluids unmixed, and inserting the value \n",
"C = 1;\n",
"// we have \n",
"deff('[y] = f(N)','y = E-1+exp(N^(0.22)*(exp(-N^(0.78))-1))');\n",
"N = fsolve(1,f);\n",
"// solving above to get the value of NTU\n",
"// area is \n",
"A = N*Ch/U;// [square meter]\n",
"printf('the design value for the area of heat exchanger is %f square meter',A);\n",
"\n",
"//*************calculation 2. the percent reduction in heat transfer rate if the flow rate is reduced by 50% while keeping the inlet temperatures and   value of U constant ******************//\n",
"\n",
"// we now examine the effect of reducing the flow rate by half, while keeping the inlet temperatures and value of U the same. \n",
"// note that the flow rate of both fluids is reduced because they are physically the same fluid. this means that the value of Cmin_by_Cmax will remain the same at a value of 1.0.\n",
"// the new value of Cmin is \n",
"Cmin = Cc/2;// [W/degree celsius] \n",
"// so that NTU is \n",
"N = U*A/Cmin;\n",
"// equation (b) may be used for the calculation of effectiveness \n",
"E = 1-exp(N^(0.22)*(exp(-N^(0.78))-1));\n",
"// the temperature difference for each fluid is then \n",
"dT = E*(Ta1-Ta2);// [degree celsius]\n",
"// the resulting heat transfer is then \n",
"q_dot = m_dot_c*Cp*dT/2;// [W]\n",
"printf('\n\nthe percent reduction in heat transfer rate if the flow rate is reduced by 50%% is %f ',(q-q_dot)*100/q);\n",
"\n",
"//*************calculation 3. the percent reduction in heat transfer rate if the flow rate is reduced by 50% and the value of U varies as mass flow to   the 0.8 power, with the same inlet temperature conditions\n",
"\n",
"// finally, we examine the effect of reducing the flow rate by 50 percent coupled with reduction in overall heat-transfer coefficient under the assumption that U varies as m_dot^(0.8) or, correspondingly, as Cmin^(0.8)\n",
"// still keeping the area constant, we would find that NTU varies as N = U*A/Cmin ~ C^(0.8)*C^(-1) = C^(-0.2)\n",
"// our new value of N under these conditions would be \n",
"N1 = 0.8*(Cmin/Cc)^(-0.2);\n",
"// inserting this value in equation (b) above for the effectiveness \n",
"E1 = 1-exp(N1^(0.22)*(exp(-N1^(0.78))-1));\n",
"// the corresponding temperature difference in each fluid is \n",
"dT = E1*(Ta1-Ta2);// [degree celsius]\n",
"// the heat transfer is calculated as \n",
"q1 = Cmin*dT;// [W]\n",
"printf('\n\n the percent reduction in heat transfer is %f ',(q-q1)*100/q);"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.16: heat_transfer_coefficient_in_compact_exchanger.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.16\n\n\n');\n",
"// heat-transfer coefficient in compact exchanger   \n",
"// Example 10.16 (page no.-556-557) \n",
"// solution\n",
"\n",
"p = 101325;// [Pa] pressure of air\n",
"T = 300;// [K] temperature of entering air\n",
"u = 15;// [m/s] velocity of air\n",
"// we obtain the air properties from table A-5(page no.-607) \n",
"rho = 1.1774;// [kg/cubic meter] density of air\n",
"Cp = 1005.7;// [J/kg degree celsius] specific heat of air\n",
"mu = 1.983*10^(-5);// [kg/m s] viscosity of air\n",
"Pr = 0.708;// prandtl number\n",
"// from figure 10-19(page no.-557) we have\n",
"Ac_by_A = 0.697;\n",
"sigma = Ac_by_A;\n",
"Dh = 3.597*10^(-3);// [m] \n",
"// the mass velocity is thus \n",
"G = rho*u/sigma;// [kg/square meter s]\n",
"// and the reynolds number is \n",
"Re = Dh*G/mu;\n",
"// from figure 10-19(page no.-557) we can read\n",
"St_into_Pr_exp_2_by_3 = 0.0036;\n",
"// and the heat transfer coefficient is \n",
"h = St_into_Pr_exp_2_by_3*G*Cp*(Pr)^(-2/3);// [W/square meter degree celsius]\n",
"printf('heat-transfer coefficient is %f W/square meter degree celsius',h);\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.17: transient_response_of_thermal_energy_storage_system.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.17\n\n\n');\n",
"// transient response of thermal-energy storage system\n",
"// Example 10.17 (page no.-559-562)\n",
"// solution\n",
"\n",
"Rinf = 0.176;// [degree celsius square meter/W] overall R value of material\n",
"A = 2.25;// [square meter] inlet flow area\n",
"l = 3;// [m] rock bed length\n",
"// properties of the rock are:\n",
"rho_r = 1281.4;// [kg/cubic meter]\n",
"Cr = 0.880;// [kJ/kg degree celsius]\n",
"kr = 0.87;// [W/m degree celsius]\n",
"Ti = 5;// [degree celsius] initial temperature of rock bed\n",
"Ta = 40;// [degree celsius] air temperature \n",
"Tinf = Ta;// [degree celsius]\n",
"p = 101.325;// [kPa] pressure of air\n",
"Ts = 5;// [degree celsius] surrounding temperature\n",
"v1 = 0.3;// [m/s] inlet velocity 1\n",
"v2 = 0.9;// [m/s] inlet velocity 2\n",
"Cpa = 1.004;// [kJ/kg degree celsius]\n",
"R = 0.287;// [kJ/kg K] universal gas constant\n",
"// it can be seen that the axial energy conduction is small compared to the mass energy transport.\n",
"// for a 35 degree celsius temperature difference over a 0.6 length \n",
"dx = l/5;// [m]\n",
"q_cond = kr*A*(Ta-Ti)/dx;// [W]                                                (a)\n",
"// the density of air at 40 degree celsius\n",
"rho_a = p/(R*(Ta+273));// [kg/cubic meter]                                     (b)\n",
"// and the mass flow rate at 0.3 m/s is \n",
"mdot_a = rho_a*A*v1;// [kg/s]                                                    (c)\n",
"// the corresponding energy transport for a temperature difference of 35 degree celsius is \n",
"q = mdot_a*Cpa*(Ta-Ti);// [kW]                                                   (d)\n",
"// and this is much larger than the value in equation (a).\n",
"// we now write an energy balance for one of the axial nodes as \n",
"// energy transported in - energy transported out - energy lost to surroundings = rate of energy accumulation of node\n",
"// or mdot_a*Cpa*(Tm_o^(t)-Tm^(t)) - (Tm^(t)-Tinf)*P*dx/Rinf = rho_r*Cr*dVr*(Tm^(t+1)-Tm^(t))/dt                      (e)\n",
"// where the exit temperature from node m is assumed to be the rock temperatre of that node(Tm^(t)). equation (e) may be solved to give \n",
"// Tm^(t+1) = F*mdot_a*Cpa*Tm_o^(t) + [1-F*(mdot_a*Cpa-P*dx/Rinf)]*Tm^(t) + F*P*dx*Tinf/Rinf                      (f)\n",
"// where\n",
"//          F = dt/(rho_r*Cr*dVr)\n",
"// here P is perimeter and dx is the increment.\n",
"P = 4*1.5;// [m]\n",
"// the stability requirement is such that the coefficient on the Tm^(t) terms cannot be negative. using dx = 0.6m, we find that the maximum value of \n",
"dx = 0.6;// [m]\n",
"Fmax = 6.4495*10^(-4);\n",
"// which yields a maximum time increment of \n",
"tmax = 0.54176;// [h]\n",
"// with a velocity of 0.9 m/s the maximum time increment for stability is\n",
"tmax_v2 = 0.1922;// [h]\n",
"// for the calculations we select the following values of dt with the resultant values of F:\n",
"\n",
"// for v1\n",
"dt1 = 0.2;// [h]\n",
"F1 = 2.38095*10^(-4);\n",
"// for v2\n",
"dt2 = 0.1;// [h]\n",
"F2 = 1.190476*10^(-4);\n",
"\n",
"// with the appropriate properties and these values inserted into equation(f) there results\n",
"// for v1\n",
"// Tm^(t+1) = F1*mdot_a*Cpa*Tm_o^(t) + [1-F1*(mdot_a*Cpa+P*dx/Rinf)]*Tm^(t) + F1*P*dx*Tinf/Rinf                    (g)\n",
"// for v2\n",
"// Tm^(t+1) = F2*mdot_a*Cpa*Tm_o^(t) + [1-F2*(mdot_a*Cpa+P*dx/Rinf)]*Tm^(t) + F2*P*dx*Tinf/Rinf                    (h)\n",
"\n",
"// the energy storage relative to 5 degree celsius can then be calculated from \n",
"E_t = 0;\n",
"i = 1;\n",
"T1 = 40;\n",
"T2 = 5;\n",
"T3 = 5;\n",
"T4 = 5;\n",
"T5 = 5;\n",
"    for i = 1:100\n",
"    T2 = (F2*mdot_a*Cpa*1000*T1 + [1-F2*(mdot_a*Cpa*1000-P*dx/Rinf)]*T2 + F2*P*dx*Tinf/Rinf);\n",
"    T3 = (F2*mdot_a*Cpa*1000*T2 + [1-F2*(mdot_a*Cpa*1000-P*dx/Rinf)]*T3 + F2*P*dx*Tinf/Rinf);\n",
"    T4 = (F2*mdot_a*Cpa*1000*T3 + [1-F2*(mdot_a*Cpa*1000-P*dx/Rinf)]*T4 + F2*P*dx*Tinf/Rinf);\n",
"    T5 = (F2*mdot_a*Cpa*1000*T4 + [1-F2*(mdot_a*Cpa*1000-P*dx/Rinf)]*T5 + F2*P*dx*Tinf/Rinf);\n",
"    Temp(i,:) = [T1 T2 T3 T4 T5];\n",
"    E_t = (dt1/F1)*[(T1-5)+(T2-5)+(T3-5)+(T4-5)+(T5-5)];\n",
"    val(i) = i;\n",
"    val1(i) = E_t;\n",
"    end\n",
"\n",
"E_t = 0;\n",
"i = 1;\n",
"T1 = 40;\n",
"T2 = 5;\n",
"T3 = 5;\n",
"T4 = 5;\n",
"T5 = 5;\n",
"    for i = 1:100\n",
"    T2 = (F1*mdot_a*Cpa*1000*T1 + [1-F1*(mdot_a*Cpa*1000-P*dx/Rinf)]*T2 + F1*P*dx*Tinf/Rinf);\n",
"    T3 = (F1*mdot_a*Cpa*1000*T2 + [1-F1*(mdot_a*Cpa*1000-P*dx/Rinf)]*T3 + F1*P*dx*Tinf/Rinf);\n",
"    T4 = (F1*mdot_a*Cpa*1000*T3 + [1-F1*(mdot_a*Cpa*1000-P*dx/Rinf)]*T4 + F1*P*dx*Tinf/Rinf);\n",
"    T5 = (F1*mdot_a*Cpa*1000*T4 + [1-F1*(mdot_a*Cpa*1000-P*dx/Rinf)]*T5 + F1*P*dx*Tinf/Rinf);\n",
"    Temp(i,:) = [T1 T2 T3 T4 T5];\n",
"    E_t = (dt1/F1)*[(T1-5)+(T2-5)+(T3-5)+(T4-5)+(T5-5)];\n",
"    val2(i) = i;\n",
"    val3(i) = E_t;\n",
"    end\n",
"plot(val,val1,val2,val3);\n",
"legend('v = 0.3m/s','v = 0.9m/s');\n",
"xlabel('time(h)');\n",
"ylabel('E(t) kJ ');\n",
"printf('the result of the calculations are shown in the accompanying figure');\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.18: variable_properties_analysis_of_a_duct_heater.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.18\n\n\n');\n",
"// variable-properties analysis of a duct heater\n",
"// Example 10.18 (page no.-562-564)\n",
"// solution\n",
"\n",
"d = 0.3;// [m] diameter of duct\n",
"Tma = 700;// [K] temperature of hot air\n",
"E = 0.6;// emissivity of outside duct surface\n",
"Tinf = 20+273;// [K] room temperature\n",
"// air properties at 700 K\n",
"rho = 0.5030;// [kg/cubic meter] density of air\n",
"mu = 3.332*10^(-5);// [kg/m s] viscosity of air\n",
"k = 0.05230;// [W/m degree celsius] heat transfer coefficient\n",
"Pr = 0.684;// prandtl no. of air\n",
"A = %pi*d^(2)/4;// [square meter] area of duct\n",
"sigma = 5.669*10^(-8);// [W/square meter K^(4)]\n",
"P = %pi*d;// [m]\n",
"Cp = 1083.5;// [J/kg degree celsius]\n",
"// this is a problem where a numerical solution must be employed.\n",
"// we choose a typical section of the duct with length dx and perimeter P as shown inn figure example 10-18A(page no.-562) and make the energy balances.\n",
"// we assume that resistance of the duct wall is negligible. \n",
"// inside the duct the energy balance is \n",
"// mdot_a*Cp*Tma = hi*P*dx*(Tma-Tmw)+mdot_a*Cp*Tm_po_a               (a)\n",
"// where hi is the convection heat transfer coefficient on the inside which may be calculated from(the flow is turbulent)\n",
"// Nu = hi*d/k = 0.023*Re_d^(0.8)*Pr^(0.3)                            (b)\n",
"// with the properties evaluated at the bulk temperature of air(Tma). the energy balance for the heat flow through the wall is\n",
"// qconv_i = qconv_o+qrad_o\n",
"// or, by using convection coefficients and radiation terms per unit area,\n",
"// hi*(Tma-Tmw) = hc*(Tmw-Tinf)+sigma*E*(Tmw^(4)-Tinf^(4))             (c)\n",
"// where the outside convection coefficient can be calculated from the free convection relation \n",
"// hc = 0.27*((Tmw-Tinf)/d)^(1/4)                                      (d)\n",
"// inserting this relation in equation (c) gives\n",
"// hi*(Tma-Tmw) = 0.27*(Tmw-Tinf)^(5/4)/d^(1/4)+sigma*E*(Tmw^(4)-Tinf^(4))              (e)\n",
"// equation (a) may be solved for Tm_po_a to give\n",
"// Tm_po_a = (1-hi*P*dx/(mdot_a*Cp))_m*Tma + (hi*P*dx/(mdot_a*Cp))_m*Tmw                  (f)\n",
"\n",
"// for \n",
"x=180;\n",
"mdot_a = [0.14 0.45 0.68];// [kg/s]\n",
"for i = 1:3\n",
"\n",
"v = mdot_a(i)/(A*rho);// [m/s]\n",
"Re_d = d*v*rho/mu;\n",
"hi = k*0.023*Re_d^(0.8)*Pr^(0.3)/d;// [W/square meter degree celsius]\n",
"\n",
"\n",
"for dx = 1:1:179\n",
"    for Tmw = 295:1:715\n",
"        Z = (hi/dx)*(Tma-Tmw)-0.27*(Tmw-Tinf)^(5/4)/d^(1/4)-sigma*E*(Tmw^(4)-Tinf^(4));\n",
"        if (Z>0 & Z<40) then\n",
"            Tmw_new = Tmw;\n",
"        end\n",
"    end\n",
"    for Tm_po_a = 275:1:715\n",
"        X = Tm_po_a-(1-(hi/dx)*P*dx/(mdot_a(i)*Cp))*Tmw_new + ((hi/dx)*P*dx/(mdot_a(i)*Cp))*Tmw_new;\n",
"        if (X>0 & X<5) then\n",
"            Tm_po_a_new = Tm_po_a;\n",
"        end\n",
"    end\n",
"    q_by_A = (hi/dx)*(Tma-Tmw_new);// [W/square meter]\n",
"    val1(dx,i) = q_by_A;\n",
"    val(dx) = dx;\n",
"    val2(dx,i) = Tmw_new;\n",
"    val3(dx,i) = Tm_po_a_new;\n",
"end\n",
"end\n",
"scf(1);\n",
"plot(val,val1(:,1),val,val1(:,2),val,val1(:,3));\n",
"legend('mdot_a=0.14','mdot_a=0.45','mdot_a=0.68');\n",
"xlabel('Duct Length x,m');\n",
"ylabel('Local Heat Flux q / A,W / m^2');\n",
"xgrid();\n",
"title('Heat Flux');\n",
"\n",
"scf(2);\n",
"plot(val,val2(:,1),val,val2(:,2),val,val2(:,3));\n",
"legend('Tw=0.14','Tw=0.45','Tw=0.68');\n",
"xlabel('Duct Length x,m');\n",
"ylabel('Local Wall Temperature Tw K');\n",
"xgrid();\n",
"title('Temperature Profile');\n",
"\n",
"scf(3);\n",
"plot(val,val3(:,1),val,val3(:,2),val,val3(:,3));\n",
"legend('Ta=0.14','Ta=0.45','Ta=0.68');\n",
"xlabel('Duct Length x,m');\n",
"ylabel('Local Air Temperature Ta K');\n",
"xgrid();\n",
"title('Temperature Profile');\n",
"printf('plots are shown as :');"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.1: overall_heat_transfer_coefficient_for_pipe_in_air.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.1\n\n\n');\n",
"// overall heat transfer coefficient for pipe in air   \n",
"// Example 10.1 (page no.-520-522) \n",
"// solution\n",
"\n",
"Tw = 98;// [degree celsius] temperature of hot water \n",
"k_p = 54;// [W/m degree celsius] heat transfer coefficient of pipe\n",
"Ta = 20;// [degree celsius] atmospheric air temperature\n",
"u = 0.25;// [m/s] water velocity\n",
"// from appendix A the dimensions of 2-in schedule 40 pipe are \n",
"ID = 0.0525;// [m]\n",
"OD = 0.06033;// [m]\n",
"// the properties of water at 98 degree celsius are \n",
"rho = 960;// [kg/cubic meter] \n",
"mu = 2.82*10^(-4);// [kg/m s]\n",
"k_w = 0.68;// [W/m degree celsius]\n",
"Pr = 1.76;// prandtl number\n",
"// the reynolds number is \n",
"Re = rho*u*ID/mu;\n",
"// and since turbulent flow is encountered, we may use equation(6-4):\n",
"Nu = 0.023*Re^(0.8)*Pr^(0.4);\n",
"hi = Nu*k_w/ID;// [W/square meter degree celsius]\n",
"// for unit length of pipe the thermal resistance of the steel is \n",
"Rs = log(OD/ID)/(2*%pi*k_p);\n",
"// again, on a unit length basis the thermal resistance on the inside is \n",
"Ai = %pi*ID;// [square meter]\n",
"Ri = 1/(hi*Ai);\n",
"Ao = %pi*OD;// [square meter]\n",
"// the thermal resistance for outer surface is as yet unknown but is written, for unit lengths, is  Ro = 1/(ho*Ao)              (a)\n",
"// from table 7-2(page no.-339), for laminar flow, the simplified relation for ho is \n",
"// ho = 1.32*(dT/d)^(1/4) = 1.32*((To-Ta)/OD)^(1/4)                                                                              (b)\n",
"// where To is the unknown outside pipe surface temperature. we designate the inner pipe surface as Ti and the water temperature as Tw; then the energy balance requires \n",
"// (Tw-Ti)/Ri = (Ti-To)/Rs = (To-Ta)/Ro                                                                                          (c)\n",
"// combining equations (a) and (b) gives \n",
"// (To-Ta)/Ro = %pi*OD*1.32*(To-Ta)^(5/4)/OD^(1/4)\n",
"// this relation may be introduced into equation (c) to yield two equations with the two unknowns Ti and To:\n",
"\n",
"// (Tw-Ti)/Ri = (Ti-To)/Rs              (1)\n",
"// (Ti-To)/Rs = %pi*OD*1.32*(To-Ta)^(5/4)/OD^(1/4)             (2)\n",
"// this is a non-linear equation which can be solved as \n",
"for Ti = 50:0.001:100\n",
"    Q = ((Ti-(Ti-(Tw-Ti)*(Rs/Ri)))/Rs)-(%pi*OD*1.32*((Ti-(Tw-Ti)*(Rs/Ri))-Ta)^(5/4)/OD^(1/4));\n",
"    if Q>0 & Q<6 then\n",
"        Tinew = Ti;\n",
"    else\n",
"        Ti = Ti;\n",
"    end\n",
"end\n",
"Ti = Tinew;// [degree celsius]\n",
"To = (Ti-(Tw-Ti)*(Rs/Ri));// [Degree celsius]\n",
"// as a result, the outside heat transfer coefficient and thermal resistance are\n",
"ho = 1.32*((To-Ta)/OD)^(1/4);// [W/square meter degree celsius]\n",
"Ro = 1/(OD*7.91*%pi);// \n",
"// the overall heat transfer coefficient based on the outer area is written in terms of these resistances as \n",
"Uo = 1/(Ao*(Ri+Ro+Rs));// [W/area degree celsius]\n",
"// in this calculation we used the outside area for 1.0 m length as  Ao\n",
"// so \n",
"Uo = Uo;// [W/square meter degree celsius]\n",
"printf('overall heat transfer coefficient is %f W/square meter degree celsius',Uo);\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.2: overall_heat_transfer_coefficient_for_pipe_exposed_to_steam.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.2\n\n\n');\n",
"// overall heat transfer coefficient for pipe exposed to steam\n",
"// Example 10.2 (page no.-523-524) \n",
"// solution\n",
"\n",
"p = 101325;// [Pa] pressure of steam\n",
"Tg = 100;// [degree celsius] temperature of steam\n",
"// we have already determined the inside convection heat-transfer coefficient in example(10.1) as \n",
"hi = 1961;// [W/square meter]\n",
"// the water film properties are \n",
"rho = 960;// [kg/cubic meter] density\n",
"mu_f = 2.82*10^(-4);// [kg/m s]\n",
"kf = 0.68;// [W/m degree celsius]\n",
"hfg = 2255*10^(3);// [J/kg]\n",
"g = 9.8;// [m/s^(2)] acceleration due to gravity\n",
"d = 0.06033;// [m] diameter of the pipe\n",
"// the convection coefficient for condensation on the outside of the pipe is obtained by using equation(9-12)\n",
"// h_o = 0.725*[(rho^(2)*g*hfg*kf^(3))/(mu_f*d*(Tg-To))]^(1/4)                            (a)\n",
"Ao = %pi*d;// [square meter] outside area\n",
"// outside thermal resistance per unit length is \n",
"// R_o = 1/(h_o*A_o)                                                                         (b)\n",
"// the energy balance requires \n",
"// [Tg-To]/R_o = [To-Ti]/R_s = [Ti-Tw]/R_i                                                  (c)\n",
"// from example 10.1 we have\n",
"Ri = 3.092*10^(-3);\n",
"Rs = 4.097*10^(-4);\n",
"Tw = 98;// [degree celsius]\n",
"// equation (b) and (c) may be combined to give \n",
"// (Tg-To)^(3/4)/3403 = (To-Ti)/Rs              (1)\n",
"// (To-Ti)/Rs = (Ti-Tw)/Ri             (2)\n",
"// this is a non-linear equation which can be solved as\n",
"for Ti = 98.1:0.01:99.75\n",
"    P = ((Tg-(Ti+Rs*(Ti-Tw)/Ri))^(3/4))*3403-(((Ti+Rs*(Ti-Tw)/Ri)-Ti)/Rs);\n",
"    if P>(-10) & P<0 then\n",
"        Tinew = Ti;\n",
"    else\n",
"        Ti = Ti;\n",
"    end\n",
"    \n",
"end\n",
"Ti = Tinew;// [degree celsius]\n",
"To = (Ti+Rs*(Ti-Tw)/Ri);// [degree celsius]\n",
"// the exterior heat-transfer coefficient and thermal resistance then become\n",
"ho = 0.725*[(rho^(2)*g*hfg*kf^(3))/(mu_f*d*(Tg-To))]^(1/4);// [W/square meter degree celsius]\n",
"Ro = 1/(ho*Ao);\n",
"// based on unit length of pipe, the overall heat transfer coefficient is \n",
"Uo = 1/(Ao*(Ri+Ro+Rs));// [W/area degree celsius]\n",
"// since Ao and the R's were per unit length\n",
"// so \n",
"Uo = Uo;// [W/square meter degree celsius]\n",
"printf('overall heat transfer coefficient is %f W/square meter degree celsius',Uo);\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.3: influence_of_fouling_factor.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.3\n\n\n');\n",
"// influence of fouling factor\n",
"// Example 10.2 (page no.-524-525) \n",
"// solution\n",
"\n",
"// the fouling factor influences the heat transfer coefficient on the inside of the pipe. we have\n",
"Rf = 0.0002;\n",
"// using \n",
"h_clean = 1961;// [W/square meter degree celsius]\n",
"// we obtain \n",
"hi = 1/[Rf+(1/h_clean)];// [W/square meter degree celsius]\n",
"printf('the percent reduction because of fouling factor is %f ',(h_clean-hi)*100/h_clean);"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.4: calculation_of_heat_exchanger_size_from_known_temperatures.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.4\n\n\n');\n",
"// calculation of heat exchanger size from known temperatures\n",
"// Example 10.4 (page no.-532-533) \n",
"// solution\n",
"\n",
"m_dot = 68;// [kg/min] water flow rate \n",
"U = 320;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"T1 = 35;// [degree celsius] initial temperature \n",
"T2 = 75;// [degree celsius] final temperature\n",
"Toe = 110;// [degree celsius] oil entering temperature \n",
"Tol = 75;// [degree celsius] oil leaving temperature\n",
"Cw = 4180;// [J/kg degree celsius] water specific heat capacity\n",
"// the total heat transfer is determined from the energy absorbed by the water:\n",
"q = m_dot*Cw*(T2-T1);// [J/min]\n",
"q = q/60;// [W]\n",
"// since all the fluid temperatures are known, the LMTD can be calculated by using the temperature scheme in figure 10-7b(page no.-530)\n",
"dT_m = ((Toe-Tol)-(T2-T1))/log((Toe-Tol)/(T2-T1));// [degree celsius]\n",
"// then, since  q = U*A*dT_m\n",
"A = q/(U*dT_m);// [square meter] area of heat-exchanger\n",
"printf('area of heat-exchanger is %f square meter ',A);"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.5: shell_and_tube_heat_exchanger.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.5\n\n\n');\n",
"// shell-and-tube heat exchanger\n",
"// Example 10.5 (page no.-533-534) \n",
"// solution\n",
"\n",
"// to solve this problem, we determine a correction factor from figure 10-8 to be used with the LMTD calculated on the basis of counterflow exchanger.\n",
"// the parameters according to the nomenclature of figure 10-8(page no.-532) are \n",
"T1 = 35;// [degree celsius]\n",
"T2 = 75;// [degree celsius]\n",
"t1 = 110;// [degree celsius]\n",
"t2 = 75;// [degree celsius]\n",
"P = (t2-t1)/(T1-t1);\n",
"R = (T1-T2)/(t2-t1);\n",
"// so the correction factor is \n",
"F = 0.81;// from figure 10-10(page no.-534)\n",
"// and the heat transfer is q = U*A*F*dT_m\n",
"// so that. from example 10-4 we have \n",
"U = 320;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"q = 189493.33;// [W]\n",
"dT_m = 37.44;// [degree celsius]\n",
"A = q/(U*F*dT_m);// [square meter]\n",
"printf('area required for this exchanger is %f square meter',A)\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.6: design_of_shell_and_tube_heat_exchanger.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.6\n\n\n');\n",
"// design of shell-and-tube heat exchanger\n",
"// Example 10.5 (page no.-534-536) \n",
"// solution\n",
"\n",
"m_dot_c = 3.8;// [kg/s] water flow rate\n",
"Ti = 38;// [degree celsius] initial temperature of water\n",
"Tf = 55;// [degree celsius] final temperature of water\n",
"m_dot_h = 1.9;// [kg/s] water flow rate entering the exchanger\n",
"Te = 93;// [degree celsius] entering water temperature\n",
"U = 1419;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"d = 0.019;// [m] diameter of tube\n",
"v_avg = 0.366;// [m/s] average water velocity in exchanger\n",
"Cc = 4180;// [] specific heat of water\n",
"Ch = Cc;// [] specific heat \n",
"rho = 1000;// [kg/cubic meter] density of water\n",
"// we first assume one tube pass and check to see if it satisfies the conditions of this problem. the exit temperature of the hot water is calculated from\n",
"dTh = m_dot_c*Cc*(Tf-Ti)/(m_dot_h*Ch);// [degree celsius]\n",
"Th_exit = Te-dTh;// [degree celsius]\n",
"// the total required heat transfer is obtained for the cold fluid is \n",
"q = m_dot_c*Cc*(Tf-Ti);// [W]\n",
"// for a counterflow exchanger, with the required temperature \n",
"LMTD = ((Te-Tf)-(Th_exit-Ti))/log((Te-Tf)/(Th_exit-Ti));// [degree celsius]\n",
"dTm = LMTD;// [degree celsius]\n",
"A = q/(U*dTm);// [square meter]\n",
"// using the average water velocity in the tubes and the flow rate, we calculate the total area with\n",
"A1 = m_dot_c/(rho*v_avg);// [square meter]\n",
"// this area is the product of number of tubes and the flow area per tube:\n",
"n = A1*4/(%pi*d^(2));// no. of tubes\n",
"n = ceil(n);// rounding of value of n because no. of pipe is an integer value\n",
"// the surface area per tube per meter of length is \n",
"S = %pi*d;// [square meter/tube meter]\n",
"// we recall that the total surface area required for a one tube pass exchanger was calculated above .\n",
"// we may thus compute the length of tube for this type of exchanger from \n",
"L = A/(S*n);// [m]\n",
"// this length is greater than the allowable 2.438 m, so we must use more than one tube pass. when we increase the number of passes, we correspondingly increase the total surface area required because of the reduction in LMTD caused by the correction factor F.\n",
"// we next try two tube passes. from figure 10-8(page no.-532) \n",
"F = 0.88;\n",
"A_total = q/(U*F*dTm);// [square meter]\n",
"// the number of tubes per pass is still 37 because of the velocity requirement. for the two pass exchanger the total surface area is now related to the length by\n",
"L1 = A_total/(2*S*n);// [m]\n",
"// this length is within the 2.438 m requirement, so the final design choice is \n",
"printf('number of tubes per pass = %f',n);\n",
"printf('\n\n number of passes = 2');\n",
"printf('\n\n length of tube per pass = %f m',L1);\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.7: cross_flow_exchanger_with_one_fluid_mixed.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.7\n\n\n');\n",
"// cross flow exchanger with one fluid mixed \n",
"// Example 10.7 (page no.-537) \n",
"// solution\n",
"\n",
"m_dot = 5.2;// [kg/s] mass flow rate\n",
"T1 = 130;// [degree celsius] temperature of entering steam\n",
"T2 = 110;// [degree celsius] temperature of leaving steam\n",
"t1 = 15;// [degree celsius] temperature of entering oil\n",
"t2 = 85;// [degree celsius] temperature of leaving oil\n",
"c_oil = 1900;// [J/kg degree celsius] heat capacity of oil\n",
"c_steam = 1860;// [J/kg degree celsius] heat capacity of steam\n",
"U = 275;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"//the total heat transfer may be obtained from an energy balance on the steam \n",
"q = m_dot*c_steam*(T1-T2);// [W]\n",
"// we can solve for the area from equation (10-13). the value of dT_m is calculated as if the exchanger were counterflow double pipe,thus\n",
"dT_m = ((T1-t2)-(T2-t1))/log((T1-t2)/(T2-t1));// [degree celsius]\n",
"// t1,t2 is representing the unmixed fluid(oil) and T1,T2 is representing the mixed fluid(steam) so that:\n",
"// we calculate \n",
"R = (T1-T2)/(t2-t1);\n",
"P = (t2-t1)/(T1-t1);\n",
"// consulting figure 10-11(page no.-534) we find \n",
"F = 0.97;\n",
"// so the area is calculated from \n",
"A = q/(U*F*dT_m);// [square meter]\n",
"printf('surface area of heat exchanger is %f square meter',A);"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.8: effects_of_off_design_flow_rates_for_exchanger_in_previous_example.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.8\n\n\n');\n",
"// effects of off-design flow rates for exchanger in example 10-7 \n",
"// Example 10.8 (page no.-537-538) \n",
"// solution\n",
"\n",
"// we did not calculate the oil flow in example 10-7 but can do so now from \n",
"q = 193;// [kW]\n",
"c_oil = 1.9;// [J/kg degree celsius] heat capacity of oil\n",
"t1 = 15;// [degree celsius] temperature of entering oil\n",
"t2 = 85;// [degree celsius] temperature of leaving oil\n",
"m_dot_o = q/(c_oil*(t2-t1));// [kg/s]\n",
"// the new flow rate will be half this value \n",
"m_dot_o = m_dot_o/2;// [kg/s]\n",
"// we are assuming the inlet temperatures remain the same at 130 degree celsius for the steam and 15 degree celsius for the oil.\n",
"// the new relation for the heat transfer is q = m_dot_o*c_oil*(Teo-15) = m_dot_s*cp*(130-Tes)                       (a)\n",
"// but the exit temperatures, Teo and Tes are unknown. furthermore, dT_m is unknown without these temperatures, as are the values of R and P from figure  10-11(page no.-535). this means we must use an iterative procedure to solve for the exit temperatures using equation (a) and   q = U*A*F*dT_m          (b)\n",
"// the general procedure is to assume values of the exit temperatures until the q's agree between equations(a) and (b).\n",
"printf('the objective of this example is to show that an iterative procedure is required when the inlet and outlet temperatures are not known or easily calculated');\n",
"printf('\n\n there is no need to go through this iteration because it can be avoided by using the techniques described in section 10-6');\n",
""
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.9: off_design_calculation_using_E_NTU_method.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clear;\n",
"clc;\n",
"printf('\t\t\tExample Number 10.9\n\n\n');\n",
"// off-design calculation using E-NTU method  \n",
"// Example 10.9 (page no.-542-544) \n",
"// solution\n",
"\n",
"m_dot_o = 0.725;// [kg/s] oil flow rate\n",
"m_dot_s = 5.2;// [kg/s] steam flow rate\n",
"t1 = 15;// [degree celsius] temperature of entering oil\n",
"T1 = 130;// [degree celsius] temperature of entering steam\n",
"c_oil = 1900;// [J/kg degree celsius] heat capacity of oil\n",
"c_steam = 1860;// [J/kg degree celsius] heat capacity of steam\n",
"// for the steam \n",
"Cs = m_dot_s*c_steam;// [W/degree celsius]\n",
"// for the oil\n",
"Co = m_dot_o*c_oil;// [W/degree celsius]\n",
"// so the oil is minium fluid. we thus have\n",
"C_min_by_C_max = Co/Cs;\n",
"U = 275;// [W/square meter degree celsius] overall heat transfer coefficient\n",
"A = 10.83;// [square meter] surface area of heat exchanger\n",
"NTU = U*A/Co;\n",
"// we choose to use the table and note that Co(minimum) is unmixed and Cs(maximum) is mixed so that the first relation in the table 10-3(page no.-543)  applies.\n",
"// we therfore calculate E(effectiveness) as \n",
"E = (1/C_min_by_C_max)*{1-exp(-C_min_by_C_max*(1-exp(-NTU)))};\n",
"// if we were using figure 10-14(page no.-544) we would have to evaluate \n",
"C_mixed_by_C_unmixed = Cs/Co;\n",
"// and would still determine \n",
"E = 0.8;// approximately\n",
"// now, using the effectiveness we can determine the temperature difference of the minimum fluid(oil as)\n",
"dT_o = E*(T1-t1);// [degree celsius]\n",
"// so that heat transfer is \n",
"q = m_dot_o*c_oil*(dT_o);// [W]\n",
"q_initial = 193440;// [W] heat transfer when oil flow rate is 100 %\n",
"printf('we find a reduction in the oil flow rate of 50 %% causes a reduction in heat transfer of only %f %%',(q_initial-q)*100/q_initial);\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
""
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}