0% found this document useful (0 votes)
663 views114 pages

Transport Phenomena - R. S. Brodkey and H. C. Hershey

This document provides a list of 153 Scilab codes that were created as supplemental materials to accompany specific examples, equations, sections, and concepts from the textbook "Transport Phenomena" by R. S. Brodkey And H. C. Hershey. The codes are organized by chapter and labeled according to the example or section they relate to for easy reference back to the relevant part of the textbook. An introduction is also included to explain the naming conventions and relationship to the textbook.

Uploaded by

Sanika Talathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
663 views114 pages

Transport Phenomena - R. S. Brodkey and H. C. Hershey

This document provides a list of 153 Scilab codes that were created as supplemental materials to accompany specific examples, equations, sections, and concepts from the textbook "Transport Phenomena" by R. S. Brodkey And H. C. Hershey. The codes are organized by chapter and labeled according to the example or section they relate to for easy reference back to the relevant part of the textbook. An introduction is also included to explain the naming conventions and relationship to the textbook.

Uploaded by

Sanika Talathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 114

Scilab Textbook Companion for

Transport Phenomena
by R. S. Brodkey And H. C. Hershey1

Created by
Ankit Vijay
engineering
Chemical Engineering
IIT-BHU
College Teacher
Self
Cross-Checked by
Ganesh R

May 24, 2016

1 Funded by a grant from the National Mission on Education through ICT,


http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab
codes written in it can be downloaded from the ”Textbook Companion Project”
section at the website http://scilab.in
Book Description

Title: Transport Phenomena

Author: R. S. Brodkey And H. C. Hershey

Publisher: McGraw - Hill Book Company, New York

Edition: 1

Year: 1988

ISBN: 0-07-007963-3

1
Scilab numbering policy used in this document and the relation to the
above book.

Exa Example (Solved example)

Eqn Equation (Particular equation of the above book)

AP Appendix to Example(Scilab Code that is an Appednix to a particular


Example of the above book)

For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.

2
Contents

List of Scilab Codes 4

1 introduction to transport phenomena 5

2 molecular transport mechanisms 7

3 molecular transport and the general property balance 15

4 molecular transport and the general property balance 19

5 transport with a net convective flux 24

6 flow turbulence 31

7 integral methods of analysis 36

9 agitation 52

10 transport in ducts 55

11 heat and mass transfer in duct flow 71

12 transport past immersed bodies 82

13 unsteady state transport 93

14 estimation of transport coefficients 98

15 non newtonial phenomena 108

3
List of Scilab Codes

Exa 1.1 fundamental variables and units . . . . . . . . . . . . 5


Exa 1.2 The role of intermolecular forces . . . . . . . . . . . . 6
Exa 2.1 the analogous form . . . . . . . . . . . . . . . . . . . . 7
Exa 2.2 the analogous form . . . . . . . . . . . . . . . . . . . . 7
Exa 2.3 heat transfer . . . . . . . . . . . . . . . . . . . . . . . 8
Exa 2.5 heat transfer . . . . . . . . . . . . . . . . . . . . . . . 8
Exa 2.6 mass transfer . . . . . . . . . . . . . . . . . . . . . . . 9
Exa 2.7 mass transfer . . . . . . . . . . . . . . . . . . . . . . . 10
Exa 2.8 mass transfer . . . . . . . . . . . . . . . . . . . . . . . 11
Exa 2.9 momentum transfer . . . . . . . . . . . . . . . . . . . 12
Exa 2.11 diffusion coefficient . . . . . . . . . . . . . . . . . . . . 13
Exa 2.12 viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Exa 3.1 balance or conservation concept . . . . . . . . . . . . . 15
Exa 3.2 the balance equation in differential form . . . . . . . . 16
Exa 3.3 the balance equation in differential form . . . . . . . . 17
Exa 4.1 variable area transport . . . . . . . . . . . . . . . . . . 19
Exa 4.2 variable area transport . . . . . . . . . . . . . . . . . . 20
Exa 4.3 variable area transport . . . . . . . . . . . . . . . . . . 20
Exa 4.4 variable area transport . . . . . . . . . . . . . . . . . . 21
Exa 4.5 heat or mass transport with constant generation . . . 22
Exa 4.7 laminar flow in a tube . . . . . . . . . . . . . . . . . . 23
Exa 5.9 mass fluxes in stationary and convected coordinates . 24
Exa 5.10 total flux and ficks law . . . . . . . . . . . . . . . . . . 26
Exa 5.11 binary mass diffusion in gases . . . . . . . . . . . . . . 28
Exa 5.12 binary mass diffusion in gases . . . . . . . . . . . . . . 29
Exa 5.13 diffusion due to pressure gradient . . . . . . . . . . . . 30
Exa 6.1 the reynolds experiment . . . . . . . . . . . . . . . . . 31
Exa 6.2 transitional flow . . . . . . . . . . . . . . . . . . . . . 31

4
Exa 6.3 the equations for transport under turbulent conditions 32
Exa 6.5 the prandtl mixing theory . . . . . . . . . . . . . . . . 33
Exa 6.9 friction factor . . . . . . . . . . . . . . . . . . . . . . . 34
Exa 7.2 the integral mass balance . . . . . . . . . . . . . . . . 36
Exa 7.3 integral balance on an individual species . . . . . . . . 37
Exa 7.4 integral momentum balance . . . . . . . . . . . . . . . 38
Exa 7.5 integral momentum balance . . . . . . . . . . . . . . . 39
Exa 7.6 integral momentum balance . . . . . . . . . . . . . . . 40
Exa 7.7 integral energy balance . . . . . . . . . . . . . . . . . 41
Exa 7.8 integral energy balance . . . . . . . . . . . . . . . . . 42
Exa 7.10 the energy equation and the engineering bernoulli equa-
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Exa 7.11 the energy equation and the engineering bernoulli equa-
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Exa 7.12 the mechanical energy equation and the engineering bernoulli
equation . . . . . . . . . . . . . . . . . . . . . . . . . 44
Exa 7.13 the mechanical energy equation and the engineering bernoulli
equation . . . . . . . . . . . . . . . . . . . . . . . . . 45
Exa 7.14 the mechanical energy equation and the engineering bernoulli
equation . . . . . . . . . . . . . . . . . . . . . . . . . 46
Exa 7.15 manometers . . . . . . . . . . . . . . . . . . . . . . . . 47
Exa 7.16 manometers . . . . . . . . . . . . . . . . . . . . . . . . 47
Exa 7.18 manometers . . . . . . . . . . . . . . . . . . . . . . . . 48
Exa 7.19 buoyant forces . . . . . . . . . . . . . . . . . . . . . . 49
Exa 7.20 buoyant forces . . . . . . . . . . . . . . . . . . . . . . 50
Exa 7.21 variation of pressure with depth . . . . . . . . . . . . 50
Exa 7.22 variation of pressure with depth . . . . . . . . . . . . 51
Exa 9.3 scale up procedures for turbulent flow with a single test
volume . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Exa 9.4 scale up procedures for turbulent flow with a single test
volume . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Exa 9.5 scale up procedures for turbulent flow with a single test
volume . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Exa 10.1 laminar pipe flow . . . . . . . . . . . . . . . . . . . . . 55
Exa 10.2 turbulent pipe flow . . . . . . . . . . . . . . . . . . . . 56
Exa 10.3 pressure drop in rough pipes . . . . . . . . . . . . . . 57
Exa 10.4 pressure drop in rough pipes . . . . . . . . . . . . . . 57
Exa 10.5 von karman number . . . . . . . . . . . . . . . . . . . 59

5
Exa 10.6 von karman number . . . . . . . . . . . . . . . . . . . 60
Exa 10.7 the velocity head concept . . . . . . . . . . . . . . . . 60
Exa 10.8 pipe fittings and valves . . . . . . . . . . . . . . . . . 61
Exa 10.9 gases . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Exa 10.11 complex fluid flow systems . . . . . . . . . . . . . . . 64
Exa 10.12 complex fluid flow systems . . . . . . . . . . . . . . . 66
Exa 10.14 non circular conduits . . . . . . . . . . . . . . . . . . . 67
Exa 10.15 orifice meter . . . . . . . . . . . . . . . . . . . . . . . 68
Exa 10.16 venturi and nozzle . . . . . . . . . . . . . . . . . . . . 69
Exa 10.17 pitot tube . . . . . . . . . . . . . . . . . . . . . . . . . 70
Exa 11.1 conduction . . . . . . . . . . . . . . . . . . . . . . . . 71
Exa 11.2 the resistance concept . . . . . . . . . . . . . . . . . . 72
Exa 11.3 the resistance concept . . . . . . . . . . . . . . . . . . 73
Exa 11.5 heat and mass transfer during turbulent flow . . . . . 74
Exa 11.6 heat and mass transfer during turbulent flow . . . . . 76
Exa 11.7 double pipe heat exchangers simple solutions . . . . . 77
Exa 11.8 double pipe heat exchangers simple solutions . . . . . 78
Exa 11.9 double pipe heat exchangers simple solutions . . . . . 78
Exa 11.10 multipass heat exchangers equipment . . . . . . . . . . 79
Exa 12.2 the laminar boundary layer . . . . . . . . . . . . . . . 82
Exa 12.3 turbulent boundary layer . . . . . . . . . . . . . . . . 83
Exa 12.5 heat and mass transfer during boundary layer flow past
a flat plate . . . . . . . . . . . . . . . . . . . . . . . . 83
Exa 12.10 stokes flow past a sphere . . . . . . . . . . . . . . . . . 84
Exa 12.11 drag coefficient correlations . . . . . . . . . . . . . . . 85
Exa 12.12 drag coefficient correlations . . . . . . . . . . . . . . . 86
Exa 12.13 drag coefficient correlations . . . . . . . . . . . . . . . 86
Exa 12.14 liquid solid fluidization . . . . . . . . . . . . . . . . . . 87
Exa 12.15 liquid solid fluidization . . . . . . . . . . . . . . . . . . 89
Exa 12.16 single cyclinder heat transfer . . . . . . . . . . . . . . 90
Exa 12.17 single cyclinder heat transfer . . . . . . . . . . . . . . 91
Exa 13.1 heat transfer with negligible internal resistance . . . . 93
Exa 13.6 generalized chart solution for finite slab and cyclinder 94
Exa 13.7 generalized chart solution for finite slab and cyclinder 95
Exa 13.9 semi infinite slab . . . . . . . . . . . . . . . . . . . . . 96
Exa 13.10 cyclinder . . . . . . . . . . . . . . . . . . . . . . . . . 96
Exa 14.1 kinetic theory of gases . . . . . . . . . . . . . . . . . . 98
Exa 14.2 non uniform gas theory . . . . . . . . . . . . . . . . . 99

6
Exa 14.3 non uniform gas theory . . . . . . . . . . . . . . . . . 100
Exa 14.4 non uniform gas theory . . . . . . . . . . . . . . . . . 101
Exa 14.5 non uniform gas theory . . . . . . . . . . . . . . . . . 103
Exa 14.6 empirical correlations for gases . . . . . . . . . . . . . 104
Exa 14.7 viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Exa 14.8 thermal conductivity . . . . . . . . . . . . . . . . . . . 105
Exa 14.9 diffusion coefficient . . . . . . . . . . . . . . . . . . . . 106
Exa 15.1 rheological characteristics of material time independant
behaviour . . . . . . . . . . . . . . . . . . . . . . . . . 108
Exa 15.2 capillary viscometer . . . . . . . . . . . . . . . . . . . 109
Exa 15.3 capillary viscometer . . . . . . . . . . . . . . . . . . . 109
Exa 15.4 capillary viscometer . . . . . . . . . . . . . . . . . . . 110

7
Chapter 1

introduction to transport
phenomena

Scilab code Exa 1.1 fundamental variables and units

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 1 . 1 − pg6 ” ) ;
4 // g i v e n
5 v =0.01283; // [mˆ 3 ] − volume o f t a n k i n mˆ3
6 v =0.4531; // [ f t ˆ 3 ] − volume o f t a n k i n f t ˆ3
7 p =2; // [ atm ] − p r e s s u r e
8 T =1.8*300; // [ degR ] − t e m p e r a t u r e
9 R =0.73; // [ ( atm ∗ f t ˆ 3 ) / ( l b m o l ∗ degR ) ] − g a s c o n s t a n t
10 // u s i n g t h e e q u a t i o n o f s t a t e f o r an i d e a l g a s pv=
nRT
11 n =( p * v ) /( R * T ) ;
12 disp (n , ” no . o f moles , n=” ) ;
13 xN2 =0.5; // f r a c t i o m o f N2 i n t a n k
14 nN2 = xN2 * n ;
15 Ca = nN2 / v ;
16 printf ( ” \n\n Ca=%elb ∗ mol / f t ˆ3 ” , Ca ) ;

8
Scilab code Exa 1.2 The role of intermolecular forces

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 . 2 − pg9 ” ) ;
4 // g i v e n
5 // t h e t h r e e unknowns a r e x , y , z
6 // t h e t h r e e e q u a t i o n s a r e −
7 // x+y+z =1500
8 // ( 1 ) 0 . 0 5 ∗ x +0. 15 ∗ y +0. 40 ∗ z = 1 5 0 0 ∗ 0 . 2 5
9 // ( 2 ) 0 . 9 5 ∗ x +0. 00 ∗ y + 0 . 4 5 2 ∗ z = 1 5 0 0 ∗ 0 . 5 0
10 a =[1 1 1;0.05 0.15 0.40;0.95 0 0.452];
11 d =[1500;1500*0.25;1500*0.50];
12 ainv = inv ( a ) ;
13 sol = ainv * d ;
14 printf ( ” \n\n t h e amount o f c o n c e n t r a t e d HNO3 i s %fkg
\n t h e amount o f c o n c e n t r a t e d H2SO4 i s %fkg \n t h e
amount o f w a s t e a c i d s i s %fkg ” , sol (2) , sol (1) , sol
(3) ) ;

9
Chapter 2

molecular transport
mechanisms

Scilab code Exa 2.1 the analogous form

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 1 − pg28 ” ) ;
4 // g i v e n
5 deltax =0.1; // [m] − t h i c k n e s s o f c o p p e r b l o c k
6 T2 =100; // [ degC ] − temp on one s i d e o f c o p p e r b l o c k
7 T1 =0; // [ degC ] − temp on o t h e r s i d e o f t h e c o p p e r
block
8 k =380; // [W/mK] − t h e r m a l c o n d u c t i v i t y
9 // u s i n g t h e f o r m u l a ( q /A) ∗ d e l t a x=−k ∗ ( T2−T1 )
10 g = - k *( T2 - T1 ) / deltax ;
11 g1 =( g /(4.184*10000) ) ;
12 printf ( ” \n\n The s t e a d y s t a t e h e a t f l u x a c r o s s t h e
c o p p e r b l o c k i s \n q /A=%fW/mˆ2 \n o r i n a l t e r n a t e
u n i t s i s \n q /A=% f c a l /cm∗ s e c ” ,g , g1 ) ;

10
Scilab code Exa 2.2 the analogous form

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 2 − pg29 ” ) ;
4 // g i v e n
5 dely =0.1; // [m] − d i s t a n c e b e t w e e n two p a r r a l e l
plates
6 delUx =0.3; // [m/ s e c ] − v e l o c i t y o f a p l a t e
7 mu =0.001; // [ kg /m∗ s e c ] − v i s c o s i t y
8 // u s i n g t h e f o r m u l a t a u y x=F/A=−mu∗ ( delUx / d e l y )
9 tauyx = - mu *( delUx / dely ) ;
10 printf ( ” \n\n t h e momentum f l u x and t h e t h e f o r c e p e r
u n i t a r e a , ( which a r e t h e same t h i n g ) i s \n t a u y x=
F/A=%fN/mˆ2 ” , tauyx ) ;

Scilab code Exa 2.3 heat transfer

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 3 − pg30 ” ) ;
4 // g i v e n
5 tauyx = -0.003; // [ N/mˆ 2 ] − momentum f l u x
6 dely =0.1; // [m] − d i s t a n c e b e t w e e n two p a r r a l e l
plates
7 mu =0.01; // [ kg /m∗ s e c ] − v i s c o s i t y
8 // u s i n g t h e f o r m u l a t a u y x=F/A=−mu∗ ( delUx / d e l y )
9 delUx = -(( tauyx * dely ) / mu ) *100;
10 printf ( ” \n\n V e l o c i t y o f t h e t o p p l a t e i s \n d e l t a U x
=%fcm/ s e c ” , delUx ) ;

Scilab code Exa 2.5 heat transfer

11
1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 5 − pg31 ” ) ;
4 // g i v e n
5 d =0.0013; // [m] − d i a m e t e r o f t h e t u b e
6 delx =1; // [m] − l e n g t h o f t h e g l a s s t u b e
7 T2 =110.6; // [ degC ] − t e m p e r a t u r e on one end o f t h e
rod
8 T1 =0; // [ degC ] − t e m p e r a t u r e on o t h e r s i d e o f t h e
rod
9 k =0.86; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y
10 Hf =333.5; // [ J / g ] − h e a t o f f u s i o n o f i c e
11 // ( a ) u s i n g t h e e q u a t i o n ( q /A)=−k ∗ ( d e l t / d e l x )
12 A =( %pi * d ^2) /4;
13 q = A *( - k *( T2 - T1 ) / delx ) ;
14 printf ( ” \n\n ( a ) t h e h e a t f l o w i s \n q=%fJ / s e c ” ,q ) ;
15 // ( b ) d i v i d i n g t h e t o t a l h e a t t r a n s f e r i n 30 m i n u t e s
by t h e amount o f h e a t r e q u i r e d t o m e l t 1 g o f i c e
16 a = abs (( q *30*60) /333.5) ;
17 printf ( ” \n\n ( b ) t h e amount o r grams o f i c e m e l t e d i n
30 m i n u t e s i s %fg ” ,a ) ;

Scilab code Exa 2.6 mass transfer

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 6 − pg36 ” ) ;
4 // g i v e n
5 d =1.2*10^ -2; // [m] − d i a m e t e r o f t h e h o l e
6 Ca1 =0.083; // [ kmol /mˆ 3 ]
7 Ca2 =0; // [ kmol /mˆ 3 ]
8 L =0.04; // [m] − t h i c k n e s s o f t h e i r o n p i e c e
9 Dab =1.56*10^ -3; // [mˆ2/ s e c ] − d i f f u s i o n c o e f f i c i e n t
o f CO2
10 A =( %pi * d ^2) /4; // a r e a

12
11 // ( a ) u s i n g t h e f o r m u l a ( Na / )A=( Ja /A)=−Dab ( d e l C a /
delx )
12 intdCa = integrate ( ’ 1 ’ , ’ Ca ’ ,Ca2 , Ca1 ) ;
13 intdx = integrate ( ’ 1 ’ , ’ x ’ ,0 ,0.04) ;
14 g =( intdCa / intdx ) * Dab ;
15 printf ( ” \n\n ( a ) The m o l a r f l u x w i t h r e s p e c t t o
s t a t i o n a r y c o o r d i n a t e s i s \n ( Na/A)=%fkmol /mˆ2∗ s e c
” ,g ) ;
16 // u s i n g t h e f o r m u l a na /A=(Na/A) ∗Ma
17 Ma =44.01; // [ kg / mol ] − m o l c u l a r w e i g h t o f c o 2
18 na =( intdCa / intdx ) * Dab * Ma * A *(3600/0.4539) ;
19 printf ( ” \n\n The mass f l o w r a t e i s % f l b / h r ” , na ) ;

Scilab code Exa 2.7 mass transfer

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 7 − pg38 ” ) ;
4 // g i v e n
5 T =30+273.15; // [ K ] t e m p e r a t u r e
6 pA =3; // [ atm ] p a r t i a l p r e s s u r e o f t h e component A
7 R =0.082057; // [ atm∗mˆ3 ∗ / kmol ∗K ] g a s c o n s t a n t
8 // ( a ) u s i n g t h e e q u a t i o n Ca=n /V=pA / (R∗T)
9 Cco2 = pA /( R * T ) ;
10 Cco2 = Cco2 *(44.01) ;
11 printf ( ” \n\n ( a ) The c o n c e n t a r i o n o f Co2 e n t e r i n g i s
%fkg /mˆ3 ” , Cco2 ) ;
12 // ( b ) u s i n g t h e same e q u a t i o n a s a b o v e
13 pN2 =(0.79) *3; // [ atm ] p a r t i a l p r e s s u r e o f m i t r o g e n (
a s n i t r o g e n i s 79% i n a i r )
14 R =0.7302; // [ atm∗ f t ˆ3∗ l b / mol ∗R ] − g a s c o n s t a n t
15 T = T *(1.8) ; // [ R ] t e m p e r a t u r e
16 CN2 = pN2 /( R * T ) ;
17 printf ( ” \n\n ( b ) The c o n c e n t r a t i o n o f N2 e n t e r i n g i s
% f l b m o l / f t ˆ3 ” , CN2 ) ;

13
18 // ( c ) u s i n g t h e same e q u a t i o n a s a b o v e
19 nt =6;
20 nCo2 =4;
21 nO2 =2*(0.21) ;
22 nN2 =2*(0.79) ;
23 yCo2 = nCo2 / nt ;
24 yO2 = nO2 / nt ;
25 yN2 = nN2 / nt ;
26 R =82.057; // [ atm∗cmˆ3/ mol ∗K ] − g a s c o n s t a n t
27 T =30+273.15; // [ K ] − t e m p e r a t u r e
28 pCo2 =3* yCo2 ;
29 Cco2 = pCo2 /( R * T ) ;
30 printf ( ” \n\n ( c ) The c o n c e n t a r t i o n o f Co2 i n t h e
e x i t i s %fmol /cmˆ3 ” , Cco2 ) ;
31 // ( d ) u s i n g t h e same e q u a t i o n a s a b o v e
32 R =8.3143; // [ kPa ∗mˆ3/ kmol ∗K ] − g a s c o n s t a n t
33 pO2 =3*( yO2 ) *(101.325) ; // [ kPa ] − p a r t i a l p r e s s u r e
34 CO2 = pO2 /( R * T ) ;
35 printf ( ” \n\n ( d ) The c o n c e n t r a t i o n o f O2 i n t h e e x i t
s t r e a m i s %fkmol /mˆ3 ” , CO2 ) ;

Scilab code Exa 2.8 mass transfer

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 8 − pg39 ” ) ;
4 // g i v e n
5 delx =0.3 -0; // [m] − l e n g t h
6 d =0.05 -0; // [m] − d i a m e t e r
7 A =( %pi * d ^2) /4; // [mˆ 2 ] − a r e a ;
8 R =8.314*10^3; // [ N∗m/ kmol ∗K ] − g a s c o n s t a n t
9 xco1 =0.15; // mole p r c e n t o f c o i n one t a n k
10 xco2 =0; // mole p e r c e n t o f c o i n o t h e r t a n k
11 p2 =1; // [ atm ] − p r e s s u r e i n one t a n k
12 p1 = p2 ; // [ atm ] − p r e s s u r e i n o t h e r t a n k

14
13 D =0.164*10^ -4; // [mˆ2/ s e c ] − d i f f u s i o n c o e f f i c i e n t
14 T =298.15; // [ K ] − t e m p e r a t u r e
15 // u s i n g t h e f o r m u l a ( Na/A) =( Ja /A)=−D∗ ( d e l c a / d e l x )
=−(D/R∗T) ∗ ( d e l p a / d e l x ) ;
16 delpa =( p2 * xco2 - p1 * xco1 ) *10^5; // [ N/mˆ 2 ] − p r e s s u r e
difference
17 Na = -(( D * A ) /( R * T ) ) *( delpa / delx ) ;
18 disp ( Na )
19 printf ( ” \n\n The i n i t i a l r a t e o f mass t r a n s f e r o f
c o 2 i s %ekmol / s e c ” , Na ) ;
20 printf ( ” \n\n I n o r d e r f o r t h e p r e s s u r e t o r e m a i n a t
1atm , a d i f f u s i o n o f a i r must o c c u r which i s i n
t h e o p p o s i t e d i r e c t i o n and e q u a l t o %ekmol / s c e ” ,
Na ) ;

Scilab code Exa 2.9 momentum transfer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 2 . 9 − pg44 ” ) ;
4 // g i v e n
5 A =5; // [mˆ 2 ] − a r e a o f t h e p l a t e s
6 Ft =0.083 // [ N ] − f o r c e on t h e t o p p l a t e
7 Fb = -0.027; // [ N ] − f o r c e on t h e bottom p l a t e
8 ut = -0.3; // [m/ s e c ] − v e l o c i t y o f t h e t o p p l a t e
9 ub =0.1; // [m/ s e c ] − v e l o c i t y o f t h e bottom p l a t e
10 dely =0.01; // [m]
11 delux = ut - ub ; // [m/ s e c ]
12 // u s i n g t h e f o r m u l a t a u y x=F/A=−mu( d e l u x / d e l y )
13 tauyx =( Ft - Fb ) / A ;
14 mu = tauyx /( - delux / dely ) ; // [ Ns /mˆ 2 ]
15 mu = mu *10^3; // [ cP ]
16 printf ( ” \n\n The v i s c o s i t y o f t o u l e n e i n c e n t i p o s e
i s %fcP ” , mu ) ;

15
Scilab code Exa 2.11 diffusion coefficient

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 1 1 − pg51 ” ) ;
4 // g i v e n
5 po =1; // [ atm ] − p r e s s u r e
6 p =2; // [ atm ] − p r e s s u r e
7 To =0+273.15; // [ K ] − t e m p e r a t u r e
8 T =75+273.15; // [ K ] − t e m p e r a t u r e
9 Do =0.219*10^ -4; // [mˆ2/ s e c ] ;
10 n =1.75;
11 // u s i n g t h e f o r m u l a D=Do ∗ ( po / p ) ∗ (T/To ) ˆ n
12 D = Do *( po / p ) *( T / To ) ^ n ;
13 printf ( ” \n\n The d i f f u s i o n c o e f f i c i e n t o f w a t e r
v a p o u r i n a i r a t %fatm and %fdegC i s \n D=%emˆ2/
s e c ” ,p ,T -273.15 , D ) ;

Scilab code Exa 2.12 viscosity

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 2 . 1 2 − pg52 ” ) ;
4 // g i v e n
5 T =53+273.15; // [ K ] − t e m p e r a t u r e
6 mu1 =1.91*10^ -5;
7 mu2 =2.10*10^ -5;
8 T1 =313.15; // [ K ] − t e m p e r a t u r e
9 T2 =347.15; // [ K ] − t e m p e r a t u r e
10 // f o r a i r
11 // u s i n g l i n e a r i n t e r p o l a t i o n o f t h e v a l u e s i n t a b l e
2.2

16
12 function b = f ( a )
13 b = log ( mu1 / a ) / log ( T1 ) ;
14 endfunction
15 function y = g ( a )
16 y = log ( mu2 ) - log ( a ) -f ( a ) * log ( T2 ) ;
17 endfunction
18 a1 =10^ -7;
19 A = fsolve ( a1 , g ) ;
20 B=f(A);
21 // u s i n g t h e f o r m u l a l n (mu)=lnA+Bln ( t )
22 mu = %e ^( log ( A ) + B * log ( T ) ) *10^3; // [ cP ]
23 printf ( ” \n\n t h e v i s c o s i t y o f a i r a t %fdegC i s %fcP ”
,T -273.15 , mu ) ;
24 // s i m i l a r l y f o r w a t e r
25 BdivR =1646;
26 A =3.336*10^ -8;
27 mu = A * %e ^( BdivR / T ) *10^5 // [ cP ]
28 printf ( ” \n\n t h e v i s c o s i t y o f w a t e r a t %fdegC i s
%fcP ” ,T -273.15 , mu ) ;

17
Chapter 3

molecular transport and the


general property balance

Scilab code Exa 3.1 balance or conservation concept

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 3 . 1 − pg65 ” ) ;
4 // g i v e n
5 a =0.0006; // [mˆ 2 ] − a r e a
6 l =0.1; // [m] − l e n g t h
7 // ( a ) u s i n g t h e f o u r i e r law
8 deltax =0.1; // [m] − t h i c k n e s s o f c o p p e r b l o c k
9 T2 =100; // [ degC ] − temp on one s i d e o f c o p p e r b l o c k
10 T1 =0; // [ degC ] − temp on o t h e r s i d e o f t h e c o p p e r
block
11 k =380; // [W/mK] − t h e r m a l c o n d u c t i v i t y
12 // u s i n g t h e f o r m u l a ( q /A) ∗ d e l t a x=−k ∗ ( T2−T1 )
13 g = - k *( T2 - T1 ) / deltax ;
14 printf ( ” \n\n ( a ) The s t e a d y s t a t e h e a t f l u x a c r o s s
t h e c o p p e r b l o c k i s \n q /A=%5eJ ∗mˆ−2∗ s e c ˆ−1 ” ,g ) ;
15 // ( b )
16 V = a * l ; // [mˆ 3 ] − volume
17 // u s i n g t h e o v e r a l l b a l a n c e e q u a t i o n w i t h t h e

18
a c c u m u l a t i o n and g e n e r a t i o n term
18 Qgen =1.5*10^6; // [ j ∗mˆ−3∗ s e c ˆ −1]
19 SIx =( g *a - Qgen * V ) / a ;
20 printf ( ” \n\n ( b ) t h e f l u x a t f a c e 1 i s %5ej ∗mˆ−2∗ s e c
ˆ −1;\ n t h e n e g a t i v e s i g n i n d i c a t e s t a h t t h e h e a t
f l u x i s from r i g h t t o l e f t ( n e g a t i v e x d i r e c t i o n ” ,
SIx ) ;

Scilab code Exa 3.2 the balance equation in differential form

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 3 . 2 − pg68 ” ) ;
4 // g i v e n
5 syms x ;
6 SIx2 = -3.8*10^5; // [ j ∗mˆ−2∗ s e c ˆ −1] − f l u x a t x = 0 . 1 , i
. e through f a c e 2
7 Qgen =1.5*10^6; // [ j ∗mˆ−3∗ s e c ˆ −1] − u n i f o r m
g e n e r a t i o n i n t h e volume
8 T2 =100+273.15; // [ K ] t e m p e r a t u r e a t f a c e 2
9 x2 =0.1; // [m]
10 k =380; // [W/mK] − t h e r m a l c o n d u c t i v i t y
11 // u s i n g t h e e q u a t i o n d e r ( S I x ) ∗ x=S I x+c 1 ; where c 1 i s
tyhe constant of i n t e g r a t i o n
12 c1 =( Qgen * x2 ) - SIx2 ;
13 disp ( c1 )
14 SIx = Qgen *x - c1 ;
15 disp ( SIx , ” S I x=” ) ;
16 printf ( ” \n where S I x i s i n u n i t s o f j mˆ−2 s e c ˆ−1
and x i s i n u n i t s o f m” ) ;
17 // u s i n g t h e e q u a t i o n −k ∗T=d e r ( S I x ) ∗ xˆ2− c 1 ∗ x+c 2 ;
where c 2 i s t h e c o n s t a n t o f i n t e g r a t i o n
18 c2 = - k * T2 -( Qgen *( x2 ) ^2) /2+ c1 * x2 ;
19 T = -( Qgen / k ) * x ^2+( c1 / k ) *x -( c2 / k ) ;
20 disp (T , ”T=” ) ;

19
21 printf ( ” \n where T i s i n u n i t s o f k e l v i n (K) ” ) ;

Scilab code Exa 3.3 the balance equation in differential form

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 3 . 3 − pg69 ” ) ;
4 // g i v e n
5 syms t x ;
6 hf1 = -270; // [ J / s e c ] − h e a t f l o w a t f a c e 1
7 hf2 = -228; // [ J / s e c ] − h e a t f l o w a t f a c e 2
8 Qgen =1.5*10^6; // [ J ∗mˆ−3∗ s e c ˆ −1] g e n e r a t i o n p e r
u n i t volume p e r u n i t t i m e
9 v =6*10^ -5; // [mˆ 3 ] volume
10 Cp =0.093; // [ c a l ∗ gˆ−1∗Kˆ −1] h e a t c a p a c i t y o f c o p p e r
11 sp =8.91; // s p e c i f i c g r a v i t y o f c o p p e r
12 a =0.0006; // [mˆ 2 ] − a r e a
13 // ( a ) u s i n g t h e o v e r a l l b a l a n c e
14 acc = hf1 - hf2 + Qgen * v ;
15 printf ( ” \n\n ( a ) t h e r a t e o f a c c u m u l a t i o n i s %fJ / s e c
\n\n ” , acc ) ;
16 // ( b )
17 SIx1 = hf1 / a ;
18 SIx2 = hf2 / a ;
19 x1 =0;
20 // s o l v i n g f o r t h e c o n s t a n t o f i n t e g r a t i o n c 1 i n t h e
e q u a t i o n [ d e l ( p∗ cp ∗T) / d e l t −d e r ( S I x ) ] ∗ x=−S I x+c 1 ;
21 c1 =0+ SIx1 ;
22 x2 =0.1;
23 g =( -( SIx2 ) + c1 ) / x2 + Qgen ;
24 SIx = c1 -( g - Qgen ) * x ;
25 disp ( SIx , ” S I ( x )=” ,” ( b ) ” ) ;
26 // s o l v i n g f o r c o n s t a n t o f i n t e g r a t i o n c 3 i n t h e
e q u a t i o n p∗ cp ∗T=g ∗ t+c 3
27 T2 =100+273.15;

20
28 t2 =0;
29 p = sp *10^3; // [ kg /mˆ 3 ] − d e n s i t y
30 cp = Cp *4.1840; // [ J ∗ kg ˆ−1∗Kˆ −1]
31 c3 = p * cp * T2 - g * t2 ;
32 T =( g *(10^ -3) /( p * cp ) ) * t + c3 /( p * cp ) ;
33 disp (T , ”T=” ) ;
34 // s o l v i n g f o r c o n s t a n t o f i n t e g r a t i o n c 2 i n t h e
e q u a t i o n −k ∗T=d e r ( S I x ) ∗ xˆ2− c 1 ∗ x+c 2
35 k =380; // [ w/mˆ1∗Kˆ 1 ]
36 x2 =0.1;
37 c2 = k * T +(3.5*10^5) * x2 ^2 -(4.5*10^5) * x2 ;
38 function y = T (t , x )
39 y =( -(3.5*10^5) * x ^2+(4.5*10^5) * x +87.7* t
+1.00297*10^5) / k ;
40 endfunction
41 // a t f a c e 1 ;
42 x1 =0;
43 t1 =60; // [ s e c ]
44 T1 = T ( t1 , x1 ) ;
45 disp ( T1 , ”T=” ,” a t f a c e 1 ” ) ;
46 // a t f a c e 2
47 x2 =0.1;
48 t2 =60; // [ s e c ]
49 T2 = T ( t2 , x2 ) ;
50 disp ( T2 , ”T=” ,” a t f a c e 2 ” ) ;

21
Chapter 4

molecular transport and the


general property balance

Scilab code Exa 4.1 variable area transport

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 4 . 1 − pg99 ” ) ;
4 // g i v e n
5 id =2.067; // [ i n ] − i n s i d e d i a m e t e r
6 t =0.154; // [ i n ] − w a l l t h i c k n e s s
7 od = id +2* t ; // [ i n ] − o u t e r d i a m e t e r
8 a =1.075; // [ i n ˆ 2 ] − w a l l s e c t i o n a l a r e a o f m e t a l
9 A = a *(1/144) ; // [ f t ˆ 2 ] − w a l l s e c t i o n a l a r e a o f
m e t a l i n f t ˆ2
10 deltaz =5/12; // [ f t ] − l e n g t h o f t r a n s f e r i n z
direction
11 T2 =10+273.15; // [ K ] − t e m p e r a t u r e a t t h e t o p
12 T1 =0+273.15; // [ K ] − t e m p e r a t u r e a t t h e bottom
13 q = -3.2; // [ Btu / h r ] − h e a t t r a n s f e r r e d
14 deltaT =( T2 - T1 ) +8; // [ degF ]
15 k = -( q / A ) /( deltaT / deltaz ) ;
16 printf ( ” \n\n k o r r e c t=%fBtu hˆ−1 f t ˆ−1 degF ˆ −1=17.17
W mˆ−1 Kˆ−1” ,k ) ;

22
17 Alm =(2* %pi * deltaz *(( od - id ) /(2*12) ) ) / log ( od / id ) ; // [
f t ˆ 2 ] l o g mean a r e a
18 disp ( Alm )
19 kincorrect = k *( A / Alm ) ;
20 printf ( ” \n\n k i n c o r r e c t =%fBtu hˆ−1 f t ˆ−1 degF
ˆ −1=0.529 W mˆ−1 Kˆ−1” , kincorrect ) ;
21 errorf =( k - kincorrect ) / kincorrect ;
22 disp ( errorf , ” e r r o r f a c t o r i s −” ) ;

Scilab code Exa 4.2 variable area transport

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 4 . 2 − pg100 ” ) ;
4 // g i v e n
5 T1 =0; // [ degC ]
6 T2 =10; // [ degC ]
7 km =17.17; // [W/m∗K ]
8 l =1; // [m]
9 r2 =1.1875;
10 r1 =1.0335;
11 deltaT = T1 - T2 ;
12 // u s i n g t h e f o r m u l a Qr=−km ∗ ( ( 2 ∗ p i ∗ l ) / l n ( r 2 / r 1 ) ) ∗
deltaT ;
13 Qr = - km *((2* %pi * l ) / log ( r2 / r1 ) ) * deltaT ;
14 printf ( ” \n\n q r=%fW\n t h e p l u s s i g n i n d i c a t e s t h a t
t h e h e a t f l o w i s r a d i a l l y o u t from t h e c e n t e r ” , Qr
);

Scilab code Exa 4.3 variable area transport

1 clc ;
2 warning ( ’ o f f ’ ) ;

23
3 printf ( ” \n\n e x a m p l e 4 . 3 − pg100 ” ) ;
4 // g i v e n
5 km =9.92; // [ Btu / h∗ f t ∗ degF ]
6 Alm =0.242*(12/5) ; // [ f t ˆ 2 ]
7 T1 =0; // [ degC ]
8 T2 =10; // [ degC ]
9 deltaT =( T1 - T2 ) *1.8; // [ degF ]
10 r2 =1.1875;
11 r1 =1.0335;
12 deltar =( r2 - r1 ) /12; // [ f t ]
13 // u s i n g t h e f o r m u l a Qr/Alm=−km∗ ( d e l t a T / d e l t a r )
14 Qr =( - km *( deltaT / deltar ) ) * Alm ;
15 printf ( ” \n\n q r=%fBtu /h ” , Qr ) ;
16 // i n S I u n i t s
17 Alm =0.177; // [mˆ 2 ]
18 T1 =0; // [ degC ]
19 T2 =10; // [ degC ]
20 km =17.17; // [W/m∗K ]
21 r2 =1.1875;
22 r1 =1.0335;
23 deltaT = T1 - T2 ;
24 deltar =( r2 - r1 ) *0.0254; // [m]
25 // u s i n g t h e same f o r m u l a
26 Qr =( - km *( deltaT / deltar ) ) * Alm ;
27 printf ( ” \n\n q r=%fW” , Qr ) ;

Scilab code Exa 4.4 variable area transport

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 4 . 4 − pg101 ” ) ;
4 // g i v e n
5 x1 =0; // [ cm ]
6 x2 =30; // [ cm ]
7 p1 =0.3; // [ atm ]

24
8 p2 =0.03; // [ atm ]
9 D =0.164; // [ amˆ2/ s e c ]
10 R =82.057; // [ cmˆ3∗ atm / mol ∗K ]
11 T =298.15; // [ K ]
12 // u s i n g t h e f o r m u l a Nax∗ i n t ( dx /Ax ) =−(D/RT) ∗ i n t ( 1 ∗
dpa )
13 a = integrate ( ” 1 / ( ( %pi / 4 ) ∗(10 −( x / 6 ) ) ˆ 2 ) ” ,” x ” ,x1 , x2 ) ;
14 b = integrate ( ” 1 ” ,” p” ,p1 , p2 ) ;
15 Nax = -(( D /( R * T ) ) * b ) / a ;
16 printf ( ” \n\n Nax=%6emol / s e c=%3emol / h \n t h e p l u s
s i g n i n d i c a t e s d i f f u s i o n t o t h e r i g h t ” ,Nax , Nax
*3600) ;

Scilab code Exa 4.5 heat or mass transport with constant generation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 4 . 5 − pg105 ” ) ;
4 // g i v e n
5 syms r ;
6 ro =0.5; // [ i n c h ] − o u t s i d e r a d i u s
7 ro =0.0127; // [m] − o u t s i d e r a d i u s i n m
8 Tg =2*10^7; // [ J /mˆ3∗ s e c ] − h e a t g e n e r a t e d by
e l e c t r i c current
9 Tw =30; // [ degC ] − o u t s i d e s u r f a c e t e m p e r a t u r e
10 km =17.3; // [W/m∗K ] − mean c o n d u c t i v i t y
11 // u s i n g t h e f o r m u l a T=Tw+(Tg /4∗km) ∗ ( r o ˆ2− r ˆ 2 )
12 T = Tw +( Tg /(4* km ) ) *( ro ^2 - r ^2) ;
13 disp (T , ”T=” ) ;
14 printf ( ” \n where r i s i n m e t e r s and T i s i n degC ” ) ;
15 function y = t ( r )
16 y = Tw +( Tg /(4* km ) ) *( ro ^2 - r ^2) ;
17 endfunction
18 printf ( ” \n\n a t t h e c e n t r e l i n e ( r =0) , t h e maximum
t e m p e r a t u r e i s %fdegC . At t h e o u t s i d e , t h e

25
t e m p e r a t u r e r e d u c e s t o t h e boundary c o n d i t i o n
v a l u e o f %fdegC . The d i s t r i b u t i o n i p a r a b o l i c
b e t w e e n t h e s e 2 l i m i t s ” ,t (0) ,t (0.0127) ) ;

Scilab code Exa 4.7 laminar flow in a tube

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 4 . 7 − pg119 ” ) ;
4 // g i v e n
5 r =10^ -3; // [m] − r a d i u s
6 l =1; // [m] − l e n g t h
7 Q =10^ -7; // [mˆ3/ s ] − f l o w r a t e
8 deltap = -10^6; // [ N/mˆ2=Pa ] − p r e s s u r e d i f f e r e n c e
9 spg =1.1;
10 pwater =1000; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r a t 4 degC
11 pfluid = spg * pwater ;
12 mu =( r * -( deltap ) *( %pi * r ^3) ) /((4* Q ) *(2* l ) ) ;
13 mupoise = mu *10;
14 mucentipoise = mupoise *100;
15 printf ( ” \n\n mu=%fNsMˆ−2= % f p o i s e=%fcP ” ,mu , mupoise ,
mucentipoise ) ;

26
Chapter 5

transport with a net convective


flux

Scilab code Exa 5.9 mass fluxes in stationary and convected coordinates

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 5 . 9 − pg166 ” ) ;
4 // g i v e n
5 v =1; // [ cm/ s e c ] − volume v e l o c i t y o r b u l k v e l o c i t y
6 vol =1; // [ cm ˆ 3 ] − volume
7 na =2; // m o l e s o f a
8 nb =3; // m o l e s o f b
9 nc =4; // m o l e s o f c
10 mma =2; // m o l e c u l a r w e i g h t o f a
11 mmb =3; // m o l e c u l a r w e i g h t o f b
12 mmc =4; // m o l e c u l a r w e i g h t o f c
13 ma = na * mma ; // [ g ] w e i g h t o f a
14 mb = nb * mmb ; // [ g ] w e i g h t o f b
15 mc = nc * mmc ; // [ g ] w e i g h t o f c
16 NabyA =2+2; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
17 NbbyA = -1+3; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x

27
18 NcbyA =0+4; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
19 NtbyA = NabyA + NbbyA + NcbyA ; // [ mol /cmˆ2∗ s ] − t o t a l
molar f l u x
20 // on a mass b a s i s , t h e s e c o r r e s p o n d s t o
21 nabyA =4+4; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
22 nbbyA = -3+9; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
23 ncbyA =0+16; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
24 ntbyA = nabyA + nbbyA + ncbyA ; // [ g /cmˆ2∗ s ] − t o t a l mass
flux
25 // c o n c e n t r a t i o n s a r e e x p r e s s e d i n m o l a r b a s i s
26 CA = na / vol ; // [ mol /cm ˆ 3 ]
27 CB = nb / vol ; // [ mol /cm ˆ 3 ]
28 CC = nc / vol ; // [ mol /cm ˆ 3 ]
29 CT = CA + CB + CC ; // [ mol /cm ˆ 3 ] − t o t a l c o n c e n t r a t i o n
30 // d e n s i t i e s a r e on a mass b a s i s
31 pa = ma / vol ; // [ g /cm ˆ 3 ]
32 pb = mb / vol ; // [ g /cm ˆ 3 ]
33 pc = mc / vol ; // [ g /cm ˆ 3 ]
34 pt = pa + pb + pc ; // [ g /cm ˆ 3 ]
35 Ua = NabyA / CA ; // [ cm/ s e c ] ;
36 Ub = NbbyA / CB ; // [ cm/ s e c ] ;
37 Uc = NcbyA / CC ; // [ cm/ s e c ] ;
38 // t h e same r e s u l t w i l l be o b t a i n e d from d i v i d i n g
mass f l u x by d e n s i t y
39 Uz =( pa * Ua + pb * Ub + pc * Uc ) /( pa + pb + pc ) ;
40 printf ( ” \n\n Uz=%fcm/ s e c ” , Uz ) ;
41 Uzstar =( NtbyA / CT ) ;
42 printf ( ” \n\n Uz∗=%fcm/ s e c ” , Uzstar ) ;
43 printf ( ” \n\n f o r t h i s e x a m p l e b o t h Uz and Uz∗ a r e
s l i g h t l y g r e a t e r t h a n t h e volume v e l o c i t y o f 1cm/
s e c , b e c a u s e t h e r e i s a n e t m o l a r and mass
d i f f u s i o n i n the p o s i t i v e d i r e c t i o n . ”);

28
Scilab code Exa 5.10 total flux and ficks law

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 5 . 1 0 − pg171 ” ) ;
4 // g i v e n ( from e x a m p l e 5 . 9 )
5 na =2; // m o l e s o f a
6 nb =3; // m o l e s o f b
7 nc =4; // m o l e s o f c
8 mma =2; // m o l e c u l a r w e i g h t o f a
9 mmb =3; // m o l e c u l a r w e i g h t o f b
10 mmc =4; // m o l e c u l a r w e i g h t o f c
11 ma = na * mma ; // [ g ] w e i g h t o f a
12 mb = nb * mmb ; // [ g ] w e i g h t o f b
13 mc = nc * mmc ; // [ g ] w e i g h t o f c
14 NabyA =2+2; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
15 NbbyA = -1+3; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
16 NcbyA =0+4; // [ mol /cmˆ2∗ s ] − m o l a r f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
17 NtbyA = NabyA + NbbyA + NcbyA ; // [ mol /cmˆ2∗ s ] − t o t a l
molar f l u x
18 // on a mass b a s i s , t h e s e c o r r e s p o n d s t o
19 nabyA =4+4; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
20 nbbyA = -3+9; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
21 ncbyA =0+16; // [ g /cmˆ2∗ s ] ; − mass f l u x = d i f f u s i n g
f l u x +c o n v e c t e d f l u x
22 // c o n c e n t r a t i o n s a r e e x p r e s s e d i n m o l a r b a s i s
23 CA = na / vol ; // [ mol /cm ˆ 3 ]
24 CB = nb / vol ; // [ mol /cm ˆ 3 ]
25 CC = nc / vol ; // [ mol /cm ˆ 3 ]

29
26 CT = CA + CB + CC ; // [ mol /cm ˆ 3 ] − t o t a l c o n c e n t r a t i o n
27 // d e n s i t i e s a r e on a mass b a s i s
28 pa = ma / vol ; // [ g /cm ˆ 3 ]
29 pb = mb / vol ; // [ g /cm ˆ 3 ]
30 pc = mc / vol ; // [ g /cm ˆ 3 ]
31 Ua = NabyA / CA ; // [ cm/ s e c ] ;
32 Ub = NbbyA / CB ; // [ cm/ s e c ] ;
33 Uc = NcbyA / CC ; // [ cm/ s e c ] ;
34 U =( pa * Ua + pb * Ub + pc * Uc ) /( pa + pb + pc ) ;
35 Ustar =( NtbyA / CT ) ;
36 // t h e f l u x e s r e l a t i v e t o mass a v e r a g e v e l o c i t i e s
are found as f o l l o w s
37 JabyA = CA *( Ua - U ) ; // [ mol /cmˆ2∗ s e c ]
38 JbbyA = CB *( Ub - U ) ; // [ mol /cmˆ2∗ s e c ]
39 JcbyA = CC *( Uc - U ) ; // [ mol /cmˆ2∗ s e c ]
40 printf ( ” \n\n f l u x e s r e l a t i v e t o mass a v e r a g e
v e l o c i t i e s a r e −” ) ;
41 printf ( ” \n\n Ja /A=%fmol /cmˆ2∗ s e c ” , JabyA ) ;
42 printf ( ” \n Jb /A=%fmol /cmˆ2∗ s e c ” , JbbyA ) ;
43 printf ( ” \n Jc /A=%fmol /cmˆ2∗ s e c ” , JcbyA ) ;
44 jabyA = pa *( Ua - U ) ; // [ g /cmˆ2∗ s e c ]
45 jbbyA = pb *( Ub - U ) ; // [ g /cmˆ2∗ s e c ]
46 jcbyA = pc *( Uc - U ) ; // [ g /cmˆ2∗ s e c ]
47 printf ( ” \n\n j a /A=%fg /cmˆ2∗ s e c ” , jabyA ) ;
48 printf ( ” \n j b /A=%fg /cmˆ2∗ s e c ” , jbbyA ) ;
49 printf ( ” \n j c /A=%fg /cmˆ2∗ s e c ” , jcbyA ) ;
50 // t h e f l u x e s r e l a t i v e t o m o l a r a v e r a g e v e l o c i t y a r e
found as f o l l o w s
51 JastarbyA = CA *( Ua - Ustar ) ; // [ mol /cmˆ2∗ s e c ]
52 JbstarbyA = CB *( Ub - Ustar ) ; // [ mol /cmˆ2∗ s e c ]
53 JcstarbyA = CC *( Uc - Ustar ) ; // [ mol /cmˆ2∗ s e c ]
54 printf ( ” \n\n f l u x e s r e l a t i v e t o m o l a r a v e r a g e
v e l o c i t i e s a r e −” ) ;
55 printf ( ” \n\n Ja ∗/A=%fmol /cmˆ2∗ s e c ” , JastarbyA ) ;
56 printf ( ” \n Jb ∗/A=%fmol /cmˆ2∗ s e c ” , JbstarbyA ) ;
57 printf ( ” \n Jc ∗/A=%fmol /cmˆ2∗ s e c ” , JcstarbyA ) ;
58 jastarbyA = pa *( Ua - Ustar ) ; // [ g /cmˆ2∗ s e c ]
59 jbstarbyA = pb *( Ub - Ustar ) ; // [ g /cmˆ2∗ s e c ]

30
60 jcstarbyA = pc *( Uc - Ustar ) ; // [ g /cmˆ2∗ s e c ]
61 printf ( ” \n\n j a ∗/A=%fg /cmˆ2∗ s e c ” , jastarbyA ) ;
62 printf ( ” \n j b ∗/A=%fg /cmˆ2∗ s e c ” , jbstarbyA ) ;
63 printf ( ” \n j c ∗/A=%fg /cmˆ2∗ s e c ” , jcstarbyA ) ;

Scilab code Exa 5.11 binary mass diffusion in gases

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 5 . 1 1 − pg176 ” ) ;
4 // g i v e n
5 T =0+273.15; // [ K ] − t e m p e r a t u r e i n K e l v i n s
6 pa2 =1.5; // [ atm ] − p a r t i a l p r e s u u r e o f a a t p o i n t 2
7 pa1 =0.5; // [ atm ] − p a r t i a l p r e s s u r e o f a a t p o i n t 1
8 z2 =20; // [ cm ] − p o s i t i o n o f p o i n t 2 from r e f e r e n c e
point
9 z1 =0; // [ cm ] − p o s i t i o n o f p o i n t 1 from r e f e r e n c e
point
10 p =2; // [ atm ] − t o t a l p r e s s u r e
11 d =1; // [ cm ] − d i a m e t e r
12 D =0.275; // [ cmˆ2/ s e c ] − d i f f u s i o n c o e f f i c i e n t
13 A =( %pi *(( d ) ^2) ) /4;
14 R =0.082057; // [ atm∗mˆ3∗ kmol ˆ−1∗Kˆ −1] − g a s c o n s t a n t
15 // ( a ) u s i n g t h e f o r m u l a Na/A=−(D/ (R∗T) ) ∗ ( ( pa2−pa1 )
/ ( z2−z 1 ) )
16 Na =( -( D /( R * T ) ) *(( pa2 - pa1 ) /( z2 - z1 ) ) ) *( A ) /(10^6) ;
17 printf ( ” \n\n Na=%ekmol / s e c \n The n e g a t i v e s i g n
i n d i c a t e s d i f f u s i o n from p o i n t 2 t o p o i n t 1 ” , Na ) ;
18 pb2 =p - pa2 ;
19 pb1 =p - pa1 ;
20 // ( b ) u s i n g t h e f o r m u l a Na/A=((D∗p ) / (R∗T∗ ( z2−z 1 ) ) ) ∗
l n ( pb2 / pb1 )
21 Na =((( D * p ) /( R * T *( z2 - z1 ) ) ) * log ( pb2 / pb1 ) ) *( A ) /(10^6) ;
22 printf ( ” \n\n Na=%ekmol / s e c ” , Na ) ;
23 printf ( ” \n The i n d u c e d v e l o c i t y i n c r e a s e s t h e n e t

31
t r a n s p o r t o f A by t h e r a t i o o f 1 0 . 6 ∗ 1 0 ˆ − 1 0 t o
4.82∗10ˆ −10 or 2 . 2 t i m e s . This i n c r e s e i s
e q u i v a l e n t t o 120 p e r c e n t ” ) ;

Scilab code Exa 5.12 binary mass diffusion in gases

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 5 . 1 2 − pg178 ” ) ;
4 // g i v e n
5 T =0+273.15; // [ K ] − t e m p e r a t u r e i n K e l v i n s
6 pa2 =1.5; // [ atm ] − p a r t i a l p r e s u u r e o f a a t p o i n t 2
7 pa1 =0.5; // [ atm ] − p a r t i a l p r e s s u r e o f a a t p o i n t 1
8 z2 =20; // [ cm ] − p o s i t i o n o f p o i n t 2 from r e f e r e n c e
point
9 z1 =0; // [ cm ] − p o s i t i o n o f p o i n t 1 from r e f e r e n c e
point
10 p =2; // [ atm ] − t o t a l p r e s s u r e
11 d =1; // [ cm ] − d i a m e t e r
12 D =0.275; // [ cmˆ2/ s e c ] − d i f f u s i o n c o e f f i c i e n t
13 A =( %pi *(( d ) ^2) ) /4;
14 R =0.082057; // [ atm∗mˆ3∗ kmol ˆ−1∗Kˆ −1] − g a s c o n s t a n t
15 k =0.75;
16 // u s i n g t h e f o r m u l a ( Na/A) =−(D/ (R∗T∗ ( z2−z 1 ) ) ) ∗ l n
((1 −( pa2 / p ) ∗(1 − k ) ) /(1 −( pa1 /p ) ∗(1 − k ) ) )
17 NabyA = -( D /( R * T *( z2 - z1 ) ) ) *(2*0.7854) * log ((1 -( pa2 / p )
*(1 - k ) ) /(1 -( pa1 / p ) *(1 - k ) ) ) /(10^6) ;
18 printf ( ” \n\n ( Na/A)=%ekmol / s e c ” , NabyA ) ;
19 printf ( ” \n Note t h a t t h i s a n s w e r i s l a r g e r t h a n t h e
r a t e f o r e q u i m o l a r c o u n t e r d i f f u s i o n but s m a l l e r
tahn the r a t e f o r d i f f u s i o n through a s t a g n a n t
f i l m . Sometimes t h e r a t e f o r d i f f u s i n t h r o u g h a
s t a g n a n t f i l m can be c o n s i d e r e d a s an u p p e r bound
, i f k t i e s b e t w e e n z e r o and one ” ) ;

32
Scilab code Exa 5.13 diffusion due to pressure gradient

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 5 . 1 3 − pg184 ” ) ;
4 // g i v e n
5 l =4; // [m] − l e n g t h o f t h e t u b e
6 id =1.6*10^ -3; // [m] − i n s i d e d i a m e t e r
7 Nkn =10; // − k n u d s e n no .
8 Ma =92; // − m o l e c u l a r w e i g h t o f g a s
9 mu =6.5*10^ -4; // [ kg /m∗ s e c ] − v i s c o s i t y
10 T =300; // [ K ] − t e m p e r a t u r e
11 R =8314; // [ kPa ∗mˆ3∗ kmol ˆ−1∗Kˆ −1] − g a s c o n s t a n t
12 lambdaA = Nkn * id ; // [m] mean f r e e p a t h
13 // f o r c a l c u l a t i n g p r e s s u r e u s i n g t h e f o r m u l a lamdaA
=32∗(mu/p ) ∗ ( (R∗T) / ( 2 ∗ p i ∗Ma) ) ˆ ( 1 / 2 )
14 p =32*( mu / lambdaA ) *(( R * T ) /(2* %pi * Ma ) ) ^(1/2) ;
15 patm = p /(1.01325*10^5) ;
16 printf ( ” \n\n p=%fkg /m∗ s e c ˆ2=%fPa=%eatm” ,p ,p , patm ) ;
17 printf ( ” \n The v a l u e o f 10 f o r t h e k n u d s e n number i s
on t h e b o r d e r b e t w e e n Knudsen d i f f u s i o n and
t r a n s i t i o n f l o w ”);

33
Chapter 6

flow turbulence

Scilab code Exa 6.1 the reynolds experiment

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 6 . 1 − pg200 ” ) ;
4 // g i v e n
5 q =50; // [ g a l / min ] − v o l u m e t r i c f l o w r a t e
6 d =2.067/12; // [ f t ] − d i a m e t e r
7 A =0.02330; // [ f t ˆ 2 ] − f l o w a r e a
8 p =0.99568*62.43; // [ l b / f t ˆ 3 ] − d e n s i t y o f w a t e r a t
86 degF
9 mu =0.8007*6.72*10^ -4; // [ l b / f t ∗ s e c ] − v i s c o s i t y o f
w a t e r a t 86 degF
10 u = q /(60*7.48* A ) ;
11 // u s i n g t h e f o r m u l a Nre=d∗u∗p /mu ;
12 Nre =( d * u * p ) / mu ;
13 disp ( Nre , ” Nre=” ) ;
14 printf ( ” \n Hence t h e f l o w i s t u r b u l e n t . Note a l s o
t h a t Nre i s d i m e n s i o n l e s s ” ) ;

Scilab code Exa 6.2 transitional flow

34
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 6 . 2 − pg202 ” ) ;
4 // g i v e n
5 p =0.99568*62.43; // [ l b / f t ˆ 3 ] − d e n s i t y of water at
86 degF
6 mu =0.8007*6.72*10^ -4; // [ l b / f t ∗ s e c ] − v i s c o s i t y o f
w a t e r a t 86 degF
7 u =4.78; // [ f t / s e c ] − f r e e s t r e a m v e l o c i t y
8 Nre =5*10^5; // t h e l o w e r l i m i t f o r t h e t r a n s i t i o n
r e y n o l d s number r a n g e i s s u b s t i t u t e d
9 x =( Nre * mu ) /( p * u ) ;
10 disp (x , ” x ” ) ;
11 printf ( ” \ nThus t h e t r a n s i t i o n c o u l d s t a r a t a b o u t
% f f t . The r e y n o l d s number a t t h e u p p e r end o f t h e
t r a n s i t i o n r a n g e i s %e . The v a l u e o f x a t t h i s
l o c a t i o n i s ten times then the value obtained
a b o v e i . e % f f t ” ,x , Nre *10 , x *10) ;

Scilab code Exa 6.3 the equations for transport under turbulent condi-
tions

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 6 . 3 − pg212 ” ) ;
4 // g i v e n
5 t =[0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
0.10 0.11 0.12];
6 Ux =[3.84 3.50 3.80 3.60 4.20 4.00 3.00 3.20 3.40
3.00 3.50 4.30 3.80];
7 Uy =[0.43 0.21 0.18 0.30 0.36 0.28 0.35 0.27 0.21
0.22 0.23 0.36 0.35];
8 Uz =[0.19 0.16 0.17 0.13 0.09 0.10 0.16 0.15 0.13
0.18 0.17 0.18 0.17];
9 // u s i n g t h e f o r m u l a AREA=( d e l t a t / 2 ) ∗ ( U1+U13 +2∗(U2+

35
U3+U4+U5+U6+U7+U8+U9+U10+U11+U12 ) )
10 // f o r Uxmean
11 deltat =0.01;
12 T = t (13) -t (1) ;
13 AREA =( deltat /2) *( Ux (1) + Ux (13) +2*( Ux (2) + Ux (3) + Ux (4) +
Ux (5) + Ux (6) + Ux (7) + Ux (8) + Ux (9) + Ux (10) + Ux (11) + Ux
(12) ) ) ;
14 Uxmean = AREA / T ;
15 disp ( Uxmean , ”Uxmean=” ) ;
16 // f o r Uymean
17 deltat =0.01;
18 T = t (13) -t (1) ;
19 AREA =( deltat /2) *( Uy (1) + Uy (13) +2*( Uy (2) + Uy (3) + Uy (4) +
Uy (5) + Uy (6) + Uy (7) + Uy (8) + Uy (9) + Uy (10) + Uy (11) + Uy
(12) ) ) ;
20 Uymean = AREA / T ;
21 disp ( Uymean , ”Uymean=” ) ;
22 // f o r Uzmean
23 deltat =0.01;
24 T = t (13) -t (1) ;
25 AREA =( deltat /2) *( Uz (1) + Uz (13) +2*( Uz (2) + Uz (3) + Uz (4) +
Uz (5) + Uz (6) + Uz (7) + Uz (8) + Uz (9) + Uz (10) + Uz (11) + Uz
(12) ) ) ;
26 Uzmean = AREA / T ;
27 disp ( Uzmean , ”Uzmean=” ) ;
28 U =( Uxmean ^2+ Uymean ^2+ Uzmean ^2) ^(1/2) ;
29 disp (U , ”U=” ) ;

Scilab code Exa 6.5 the prandtl mixing theory

1 clc ;
2 warning ( ’ o f f ’ ) ;
3 printf ( ” \n\n e x a m p l e 6 . 5 − pg232 ” ) ;
4 // g i v e n
5 UzmaxbyU =24.83;

36
6 roUbyv =2312;
7 Re =100000;
8 // u s i n g t h e f o r m u l a Et / v = 9 5 . 5 ∗ ( ( r / r o ) / s l o p e ) −1
9 // from f i g 6 . 6 a t Re =100000
10 rbyro =[0 0.040 0.100 0.200 0.300 0.4 0.5 0.6 0.7 0.8
0.9 0.960 1];
11 slope =[0 0.105 0.112 0.126 0.144 0.168 0.201 0.252
0.336 0.503 1.007 2.517 94.59];
12 for i =2:13
13 Etbyv ( i ) =95.5*(( rbyro ( i ) ) / slope ( i ) ) -1;
14 end
15 clf ;
16 xtitle ( ” eddy v i s c o s i t y r a t i o v e r s u s d i m e n s i o n l e s s
r a d i u s ” ,” r / r o ” ,” Et / v ” ) ;
17 plot ( rbyro , Etbyv ) ;

Scilab code Exa 6.9 friction factor

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 6 . 9 − pg258 ” ) ;
4 // g i v e n
5 spg =0.84;
6 p =0.84*62.4; // [ l b f / f t ˆ 3 ] − d e n s i t y
7 dP =80*144; // [ l b f / f t ˆ 2 ] − p r e s s u r e
8 dz =2000; // [ f t ] − l e n g t h o f p i p e
9 gc =32.174; // [ ( lbm ∗ f t ) / ( l b f ∗ s e c ˆ 2 ) ] − g r a v i t a t i o n a l
conversion constant
10 dpbydz = - dP / dz ;
11 do =2.067/12; // [ f t ]
12 U =2000*(1/24) *(1/3600) *(42) *(1/7.48) *(1/0.02330) ;
13 // u s i n g t h e f o r m u l a f =(( do / 2 ) ∗(−dp / dz ) ∗ g c ) / ( p ∗ (U)
ˆ2)
14 f =(( do /2) *( - dpbydz ) * gc ) /( p *( U ) ^2)
15 disp (f , ” f=” ) ;

37
38
Chapter 7

integral methods of analysis

Scilab code Exa 7.2 the integral mass balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 2 − pg273 ” ) ;
4 // g i v e n
5 id =4; // [m] − i n s i d e d i a m e t e r
6 h =2; // [m] − w a t e r l e v e l
7 ro =0.03; // [m] − r a d i u s o f e x i t h o l e
8 rt = id /2; // [m] − i n s i d e r a d i u s
9 g =9.80665; // [m/ s e c ˆ 2 ] − g r a v i t a t i o n a l a c c e l e r a t i o n
10 // u s i n g t h e e q u a t i o n dh /h ˆ ( 1 / 2 ) =−(( r o ˆ 2 ) / ( r t ˆ 2 ) )
∗ ( 2 ∗ g ) ˆ ( 1 / 2 ) d t and i n t e g r a t i n g b e t w e e n h=2 and h
=1
11 t1 = integrate ( ’ ( 1 / h ˆ ( 1 / 2 ) ) ∗ ( 1 / ( − ( ( r o ˆ 2 ) / ( r t ˆ 2 ) ) ∗ ( 2 ∗ g )
ˆ ( 1 / 2 ) ) ) ’ , ’ h ’ ,2 ,1) ;
12 printf ( ” \n\n Time r e q u i r e d t o remove h a l f o f t h e
c o n t e n t s o f t h e t a n k i s \n t=% f s e c=%fmin ” ,t1 , t1
/60) ;
13 // i n t e g r a t i n g b e t w e e n h=2 and h=0
14 t2 = integrate ( ’ ( 1 / h ˆ ( 1 / 2 ) ) ∗ ( 1 / ( − ( ( r o ˆ 2 ) / ( r t ˆ 2 ) ) ∗ ( 2 ∗ g )
ˆ ( 1 / 2 ) ) ) ’ , ’ h ’ ,2 ,0) ;
15 printf ( ” \n\n Time r e q u i r e d t o empty t h e t a n k f u l l y

39
i s \n t=% f s e c=%fmin ” ,t2 , t2 /60) ;

Scilab code Exa 7.3 integral balance on an individual species

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 3 − pg274 ” ) ;
4 // g i v e n
5 // c o m p o s i t i o n o f f u e l g a s
6 nH2 =24;
7 nN2 =0.5;
8 nCO =5.9;
9 nH2S =1.5;
10 nC2H4 =0.1;
11 nC2H6 =1;
12 nCH4 =64;
13 nCO2 =3.0;
14 // c a l c u l a t i n g t h e t h e o r i t i c a l amount o f O2 r e q u i r e d
15 nO2theoreq =12+2.95+2.25+0.30+3.50+128;
16 // s i n c e f u e l g a s i s b u r n e d w i t h 40% e x c e s s O2 , t h e n
O2 r e q u i r e d i s
17 nO2req =1.4* nO2theoreq ;
18 nair = nO2req /0.21; // a s amount o f O2 i n a i r i s 21%
19 nN2air = nair *(0.79) ; // a s amount o f N2 i n a i r i s 79
%
20 nN2 = nN2 + nN2air ;
21 nO2 = nO2req - nO2theoreq ;
22 nH2O =24+0+0.2+3.0+128;
23 nCO2formed =72.1;
24 nCO2 = nCO2 + nCO2formed ;
25 nSO2 =1.5;
26 ntotal = nSO2 + nCO2 + nO2 + nN2 + nH2O ;
27 mpSO2 =( nSO2 / ntotal ) *100;
28 mpCO2 =( nCO2 / ntotal ) *100;
29 mpO2 =( nO2 / ntotal ) *100;

40
30 mpN2 =( nN2 / ntotal ) *100;
31 mpH2O =( nH2O / ntotal ) *100;
32 printf ( ” \n\n g a s N2
O2 H2O CO2
SO2” ) ;
33 printf ( ” \n\n m o l e s %f %f
%f %f %f ” ,nN2 , nO2 , nH2O , nCO2 , nSO2 ) ;
34 printf ( ” \n\n mole p e r c e n t %f %f
%f %f %f ” , mpN2 , mpO2 , mpH2O , mpCO2 ,
mpSO2 ) ;

Scilab code Exa 7.4 integral momentum balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 4 − pg280 ” ) ;
4 // g i v e n
5 id =6; // [ i n c h ] − i n l e t d i a m e t e r
6 od =4; // [ i n c h ] − o u t l e t d i a m e t e r
7 Q =10; // [ f t ˆ3/ s e c ] − w a t e r f l o w r a t e
8 alpha2 = %pi /3; // [ r a d i a n s ] − a n g l e o f r e d u c t i o n o f
elbow
9 alpha1 =0;
10 p1 =100; // [ p s i ] − a b s o l u t e i n l e t p r e s s u r e
11 p2 =29; // [ p s i ] − a b s o l u t e o u t l e t p r e s s u r e
12 S1 =( %pi *(( id /12) ^2) ) /4;
13 S2 =( %pi *(( od /12) ^2) ) /4;
14 U1 = Q / S1 ;
15 U2 = Q / S2 ;
16 mu =6.72*10^ -4; // [ l b ∗ f t ˆ−1∗ s e c ˆ −1]
17 p =62.4; // [ l b / f t ˆ 3 ]
18 Nrei =(( id /12) * U1 * p ) /( mu ) ;
19 disp ( Nrei , ” Nre ( i n l e t )=” ) ;
20 Nreo =(( od /12) * U2 * p ) /( mu ) ;
21 disp ( Nreo , ” Nre ( o u t l e t )=” ) ;

41
22 // t h u s
23 b =1;
24 w1 = p * Q ; // [ l b / s e c ] − mass f l o w r a t e
25 w2 = w1 ;
26 gc =32.174;
27 // u s i n g t h e e q u a t i o n (w/ g c ) ∗ ( ( U1 ) ∗ ( c o s ( a l p h a 1 ) ) −(U2
) ∗ ( c o s ( a l p h a 2 ) ) )+p1 ∗ S1 ∗ c o s ( a l p h a 1 )−p2 ∗ S2 ∗ c o s (
a l p h a 2 )+Fextx =0;
28 Fextx = -( w1 / gc ) *(( U1 ) *( cos ( alpha1 ) ) -( U2 ) *( cos ( alpha2 )
) ) - p1 *144* S1 * cos ( alpha1 ) + p2 *144* S2 * cos ( alpha2 ) ;
29 disp ( Fextx , ” Fext , x=” ) ;
30 Fexty = -( w1 / gc ) *(( U1 ) *( sin ( alpha1 ) ) -( U2 ) *( sin ( alpha2 )
) ) - p1 *144* S1 * sin ( alpha1 ) + p2 *144* S2 * sin ( alpha2 ) ;
31 disp ( Fexty , ” Fext , y=” ) ;
32 printf ( ” \n\n t h e f o r c e s Fxt , x and Fext , y a r e t h e
f o r c e s e x e r t e d on t h e f l u i d by t h e e l b o w . Fext , x
a c t s t o t h e l e f t and Fext , y a c t s i n t h e p o s i t i v e
y d i r e c t i o n . Note t h a t t h e e l b o w i s h o r i z a n t a l , and
g r a v i t y a c t s i n the z d i r e c t i o n ”);

Scilab code Exa 7.5 integral momentum balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 5 − pg 282 ” ) ;
4 // g i v e n
5 Fextx = -2522; // [ l b ] − f o r c e i n x d i r e c t i o n
6 Fexty =2240; // [ l b ] − f o r c e i n y d i r e c t i o n
7 // t h e f o r c e e x e r t e d by t h e e l b o w on t h e f l u i d is
t h e r e s o l u t i o n o f Fext , x and Fext , y , t h e r e f o r e
8 Fext =(( Fextx ) ^2+( Fexty ) ^2) ^(1/2) ;
9 alpha =180+( atan ( Fexty / Fextx ) ) *(180/ %pi ) ;
10 printf ( ” \n\n t h e f o r c e h a s a m a g n i t u d e o f % f l b and a
d i r e c t i o n o f %f from t h e p o s i t i v e x d i r e c t i o n ( i n
t h e s e c o n d q u a d r a n t ” , Fext , alpha ) ;

42
Scilab code Exa 7.6 integral momentum balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 6 − pg283 ” ) ;
4 // g i v e n
5 id =6; // [ i n c h ] − i n l e t d i a m e t e r
6 od =4; // [ i n c h ] − o u t l e t d i a m e t e r
7 Q =10; // [ f t ˆ3/ s e c ] − w a t e r f l o w r a t e
8 alpha2 = %pi /3; // [ r a d i a n s ] − a n g l e o f r e d u c t i o n o f
elbow
9 alpha1 =0;
10 p1 =100; // [ p s i ] − a b s o l u t e i n l e t p r e s s u r e
11 p2 =29; // [ p s i ] − a b s o l u t e o u t l e t p r e s s u r e
12 patm =14.7; // [ p s i ] − a t m o s p h e r i c p r e s s u r e
13 p1gauge = p1 - patm ;
14 p2gauge = p2 - patm ;
15 S1 =( %pi *(( id /12) ^2) ) /4;
16 S2 =( %pi *(( od /12) ^2) ) /4;
17 U1 = Q / S1 ;
18 U2 = Q / S2 ;
19 p =62.4; // [ l b / f t ˆ 3 ]
20 b =1;
21 w1 = p * Q ; // [ l b / s e c ] − mass f l o w r a t e
22 w2 = w1 ;
23 gc =32.174;
24 // u s i n g t h e e q u a t i o n F p r e s s=p 1 g a u g e ∗ S1−p 2 g a u g e ∗ S2 ∗
cos ( alpha2 ) ;
25 Fpressx = p1gauge *144* S1 - p2gauge *144* S2 * cos ( alpha2 ) ;
26 Fpressy = p1gauge *144* S1 * sin ( alpha1 ) - p2gauge *144* S2 *
sin ( alpha2 ) ;
27 wdeltaUx =( w1 / gc ) *(( U2 ) *( cos ( alpha2 ) ) -( U1 ) *( cos (
alpha1 ) ) ) ;
28 wdeltaUy =( w1 / gc ) *(( U2 ) *( sin ( alpha2 ) ) -( U1 ) *( sin (

43
alpha1 ) ) ) ;
29 Fextx = wdeltaUx - Fpressx ;
30 Fexty = wdeltaUy - Fpressy ;
31 Fext =(( Fextx ) ^2+( Fexty ) ^2) ^(1/2) ;
32 alpha =180+( atan ( Fexty / Fextx ) ) *(180/ %pi ) ;
33 printf ( ” \n\n The f o r c e h a s a m a g n i t u d e o f % f l b and a
d i r e c t i o n o f %f from t h e p o s i t i v e x d i r e c t i o n ( i n
t h e s e c o n d q u a d r a n t ” , Fext , alpha ) ;
34 printf ( ” \n\n A l s o t h e r e i s a f o r c e on t h e e l b o w i n
t h e z d i r e c t i o n owing t o t h e w e i g h t o f t h e e l b o w
p l u s the weight o f the f l u i d i n s i d e ”);

Scilab code Exa 7.7 integral energy balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 7 − pg293 ” ) ;
4 // g i v e n
5 Uo =1; // [m/ s e c ]
6 // u s i n g Ux/Uo=y / yo
7 // a s s u m i n g any p a r t i c u l a r v a l u e o f yo w i l l not
c h a n g e t h e answer , t h e r e f o r e
8 yo =1;
9 Uxavg = integrate ( ’ ( Uo∗ y ) / yo ’ , ’ y ’ ,0 , yo ) ;
10 Ux3avg = integrate ( ’ ( ( Uo∗ y ) / yo ) ˆ3 ’ , ’ y ’ ,0 , yo ) ;
11 // u s i n g t h e f o r m u l a a l p h a =(Uxavg ) ˆ3/ Ux3avg
12 alpha =( Uxavg ) ^3/ Ux3avg ;
13 disp ( alpha , ” a l p h a=” ) ;
14 printf ( ” \n\n Note t h a t t h e k i n e t i c c o r r e c t i o n f a c t o r
a l p h a h a s t h e same f i n a l v a l u e f o r l a m i n a r p i p e
f l o w as i t has f o r laminar f l o w between p a r a l l e l
p l a t e s . ”);

44
Scilab code Exa 7.8 integral energy balance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 8 − pg293 ” ) ;
4 // g i v e n
5 Q =0.03; // [mˆ3/ s e c ] − v o l u m e t r i c f l o w r a t e
6 id =7; // [ cm ] − i n s i d e d i a m e t e r
7 deltaz = -7; // [m] − l e n g t h o f p i p e
8 T1 =25; // [ degC ] − l o w e r e s i d e t e m p e r a t u r e
9 T2 =45; // [ degC ] − h i g h e r s i d e t e m p e r a t u r e
10 g =9.81; // [m/ s e c ˆ 2 ] − a c c e l e r a t i o n due t o g r a v i t y
11 deltaP =4*10^4; // [ N/mˆ 2 ] − p r e s s u r e l o s s due t o
friction
12 p =1000; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r
13 w=Q*p;
14 C =4184; // [ J / kg ∗K) − h e a t c a p a c i t y o f w a t e r
15 deltaH = w * C *( T2 - T1 ) ;
16 // u s i n g t h e f o r m u l a Qh=d e l t a H+w∗ g ∗ d e l t a z
17 Qh = deltaH + w * g * deltaz ;
18 printf ( ” \n\n t h e duty on h e a t e x c h a n g e r i s \n Q=%6eJ
/ s e c ” , Qh ) ;

Scilab code Exa 7.10 the energy equation and the engineering bernoulli
equation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 0 − pg298 ” ) ;
4 // g i v e n
5 d =0.03; // [m] − d i a m e t e r
6 g =9.784; // [m/ s e c ] − a c c e l e r a t i o n due t o g r a v i t y
7 deltaz = -1;
8 // u s i n g t h e e q u a t i o n ( 1 / 2 ) ∗ ( U3ˆ2/ a l p h a 3 −U1ˆ2/ a l p h a 1
)+g ∗ d e l t a z =0

45
9 // a s s u m i n g
10 alpha1 =1;
11 alpha3 =1;
12 // a l s o s i n c e t h e d i a m e t e r o f t h e t a n k f a r e x c e e d s
the diameter of the hose , the v e l o c i t y at point
1 must be n e g l i g i b l e when compared t o t h e
v e l o c i t y at point 3
13 U1 =0;
14 U3 =( -2* g * deltaz +( U1 ^2) / alpha1 ) ^(1/2) ;
15 p =1000; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r
16 S3 =( %pi /4) *( d ) ^2
17 w = p * U3 * S3 ;
18 printf ( ” \n\n t h e mass f l o w r a t e i s \n w=%fkg / s e c ” ,w )
;
19 // t h e minimum p r e s s u r e i n t h e s i p h o n t u b e i s a t t h e
p o i n t 2 . B e f o r e t h e r e s u l t o f 3 . 1 3 kg / s e c i s
accepted as the f i n a l value , the p r e s s u r e at
p o i n t 2 must be c a l c i l a t e d i n o r d e r t o s e e i f t h e
w a t e r might b o i l a t t h i s p o i n t
20 // u s i n g d e l t a p=p ∗ ( ( U3 ˆ 2 ) /2+g ∗ d e l t a z )
21 deltap = p *(( U3 ^2) /2+ g * deltaz ) ;
22 p1 =1.01325*10^5; // [ N/mˆ 2 ] − i s e q u a l t o
atmospheric pressure
23 p2 = p1 + deltap ;
24 vp =0.02336*10^5;
25 if p2 > vp then
26 printf ( ” \n\n t h e s i p h o n can o p e r a t e s i n c e t h e
p r e s s u r e at p o i n t 2 i s g r e a t e r than the v a l u e
a t which t h e l i q u i d b o i l s ” ) ;
27 else
28 printf ( ” \n\n t h e s i p h o n c a n t o p e r a t e s i n c e t h e
p r e s s u e r at p o i n t 2 i s l e s s than the v a l u e at
which t h e l i q u i d b o i l s ” ) ;
29
30 end

46
Scilab code Exa 7.11 the energy equation and the engineering bernoulli
equation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 1 − pg300 ” ) ;
4 // g i v e n
5 sp =1.45; // s p e c i f i c g r a v i t y o f t r i c h l o r o e t h y l e n e
6 pwater =62.4; // [ l b / f t ˆ 3 ] − d e n s i t y o f w a t e r
7 p = sp * pwater ;
8 d1 =1.049; // [ i n c h ] − d e n s i t y o f p i p e a t p o i n t 1
9 d2 =0.6; // [ i n c h ] − d e n s i t y o f p i p e a t p o i n t 2
10 d3 =1.049; // [ i n c h ] − d e n s i t y o f p i p e a t p o i n t 3
11 // u s i n g t h e f o r m u l a U1∗ S1=U2∗ S2 ; we g e t U1=U2 ∗ ( d2 /
d1 ) ;
12 // t h e n u s i n g t h e b e r n o u l l i e q u a t i o n d e l t a p / p = ( 1 / 2 )
∗ ( U2ˆ2−U1 ˆ 2 ) ;
13 deltap =4.2*(144) ; // [ l b / f t ˆ 2 ] − p r e s s u r e d i f f e r e n c e
14 U2 =((2*( deltap / p ) *(1/(1 -( d2 / d1 ) ^4) ) ) ^(1/2) ) *(32.174)
^(1/2) ;
15 // u s i n g t h e f o r m u l a w=p∗U2∗S
16 w = p * U2 *(( %pi /4) *(0.6/12) ^2) ;
17 w1 = w /(2.20462) ;
18 printf ( ” \n\n t h e mass f l o w r a t e i s \n w=% f l b / s e c \n
o r i n S I u n i t s \n w=%fkg / s e c ” ,w , w1 ) ;

Scilab code Exa 7.12 the mechanical energy equation and the engineering
bernoulli equation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 2 − pg301 ” ) ;

47
4 // g i v e n
5 Q =50/(7.48*60) ; // [ f t / s e c ] − v o l u m e t r i c f l o w r a t e
of water
6 d1 =1; // [ i n c h ] − d i a m e t e r o f p i p e
7 deltaz = -5; // [ f t ] − d i s t a n c e b e t w e e n end o f p i p e
and t a n k
8 g =32.1; // [ f t / s e c ] − a c c e l e r a t i o n due t o g r a v i t y
9 Cp =1; // [ Btu / l b ∗F ] − h e a t c a p a c i t y o f w a t e r
10 p =62.4; // [ l b / f t ˆ 3 ] − d e n s i t y o f w a t e r
11 S1 =( %pi /4) *( d1 /12) ^2;
12 U1 = Q / S1 ;
13 w=p*Q;
14 U2 =0;
15 gc =32.174;
16 // u s i n g t h e f o r m u l a d e l t a H =(w/ 2 ) ∗ ( ( U2 ) ˆ2 −(U1 ) ˆ 2 )+w∗
g∗ d e l t a z
17 deltaH = -( w /(2* gc ) ) *(( U2 ) ^2 -( U1 ) ^2) -w *( g / gc ) * deltaz ;
18 disp ( deltaH ) ;
19 deltaH = deltaH /778; // c o n v e r t i n g from f t l b / s e c t o
Btu / s e c
20 deltaT = deltaH /( w * Cp ) ;
21 printf ( ” \n\n The r i s e i n t e m p e r a t u r e i s %fdegF ” ,
deltaT ) ;

Scilab code Exa 7.13 the mechanical energy equation and the engineering
bernoulli equation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 3 − pg303 ” ) ;
4 // g i v e n
5 deltaz =30; // [ f t ] − d i s t a n c e b e t w e e n p r o c e s s and
the h o l d i n g tank
6 Q =100; // [ gpm ] − v o l u m e t r i c f l o w r a t e o f w a t e r
7 p1 =100; // [ p s i g ]

48
8 p2 =0; // [ p s i g ]
9 g =32.1; // [ f t / s e c ] − a c c e l e r a t i o n due t o g r a v i t y
10 sv =0.0161; // [ f t ˆ3/ l b ] − s p e c i f i c volume o f w a t e r
11 p =1/ sv ; // [ l b / f t ˆ 3 ] − d e n s i t y o f w a t e r
12 e =0.77; // e f f i c i e n c y o f c e n t r i f u g a l pump
13 deltap =( p1 - p2 ) *(144) ; // [ l b f / f t ˆ 2 ]
14 gc =32.174;
15 // u s i n g t h e e q u a t i o n d e l t a p / p+g ∗ ( d e l t a z )+Ws=0;
16 Wst = - deltap /p -( g / gc ) *( deltaz ) ;
17 // u s i n g t h e f o r m u l a f o r e f f i c i e n c y e=Ws( t h e o r i t i c a l
) /Ws( a c t u a l )
18 // t h e r e f o r e
19 Wsa = Wst / e ;
20 // t h e c a l u l a t e d s h a f t work i s f o r a u n i t mass f l o w
r a t e o f water , t h e r f o r e f o r g i v e n f l o w r a t e
m u l t i p l y i t by t h e f l o w r a t e
21 w =( Q * p ) /(7.48*60) ;
22 Wsactual = Wsa * w ;
23 power = - Wsactual /(778*0.7070) ;
24 printf ( ” \n\n t h e r e q u i r e d h o r s e p o w e r i s %fhp ” , power )
;

Scilab code Exa 7.14 the mechanical energy equation and the engineering
bernoulli equation

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 4 − pg304 ” ) ;
4 // g i v e n
5 p1 =5; // [ atm ] − i n i t i a l p r e s s u r e
6 p2 =0.75; // [ atm ] − f i n a l p r e s s u r e a f t e rexpansion
through turbine
7 T =450; // [ K ] − t e m p e r a t u r e
8 y =1.4; // cp / cv f o r n i t r o g e n
9 // u s i n g t h e e q u a t i o n Ws=−(y / ( y −1) ) ∗ ( p1 / d e n s i t y 1 ) ∗ ( (

49
p2 / p1 ) ˆ ( ( y −1) / y ) −1)
10 R =8314; // g a s c o n s t a n t
11 p1bydensity = R * T ;
12 Ws = -( y /( y -1) ) *( p1bydensity ) *(( p2 / p1 ) ^(( y -1) / y ) -1) ;
13 printf ( ” \n\n t h e s h a f t work o f t h e g a s a s i t e x p a n d s
t h r o u g h t h e t u r b i n e and t r a n s m i t s i t s m o l e c u l a r
e n e r g y t o t h e r o t a t i n g b l a d e s i s \n Ws=%eJ/ kmol ” ,
Ws ) ;

Scilab code Exa 7.15 manometers

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 5 − pg311 ” ) ;
4 // g i v e n
5 T =273.15+25; // [ K ] − t e m p e r a t u r e
6 R =8.314; // [ kPa ∗mˆ3/ kmol ∗K ] − g a s c o n s t a n t
7 p =101.325; // [ kPa ] − p r e s s u r e
8 M =29; // m o l e c u l a r w e i g h t o f g a s
9 pa =( p * M ) /( R * T ) ;
10 sg =13.45; // s p e c i f i c g r a v i t y
11 pm = sg *1000;
12 g =9.807; // [m/ s e c ˆ 2 ] − a c c e l e r a t i o n due t o g r a v i t y
13 deltaz =15/100; // [m]
14 // u s i n g t h e e q u a t i o n p2−p1=d e l t a p =(pm−pa ) ∗ g ∗ d e l t a z
15 deltap = -( pm - pa ) * g * deltaz ;
16 printf ( ” \n\n t h e p r e s s u r e d r o p i s %eN/mˆ2 ” , deltap ) ;
17 printf ( ” \n t h e minus s i g n means t h e u p s t r e a m
p r e s s u r e p1 i s g r e a t e r t h a n p2 , i . e t h e r i s a
p r e s s u r e drop . ”);

Scilab code Exa 7.16 manometers

50
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 6 − pg312 ” ) ;
4 // g i v e n
5 T =536.67; // [ degR ] ; − t e m p e r a t u r e
6 R =10.73; // [ ( l b f / i n ˆ2∗ f t ˆ 3 ) ∗ l b ∗ mol ˆ−1∗degR ] − g a s
constant
7 p =14.696; // [ l b f / i n ˆ 2 ] ;
8 g =9.807*3.2808; // [ f t / s e c ˆ 2 ] − a c c e l e r a t i o n due t o
gravity
9 M =29; // m o l e c u l a r w e i g h t o f g a s
10 pa =( p * M ) /( R * T ) ;
11 sg =13.45; // s p e c i f i c g r a v i t y
12 pm = sg *62.4;
13 deltaz =15/(2.54*12) ; // [ f t ]
14 gc =32.174;
15 // u s i n g t h e e q u a t i o n p2−p1=d e l t a p =(pm−pa ) ∗ g ∗ d e l t a z
16 deltap =( pm - pa ) *( g / gc ) * deltaz ;
17 printf ( ” \n\n t h e p r e s s u r e d r o p i s % f l b f / f t ˆ2 ” , deltap
);

Scilab code Exa 7.18 manometers

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 1 8 − pg315 ” ) ;
4 // g i v e n
5 at =0.049; // [ i n ˆ 2 ] − c r o s s s e c t i o n a l area of the
manometer t u b i n g
6 aw =15.5; // [ i n ˆ 2 ] − c r o s s s e c t i o n a l a r e a o f t h e
well
7 g =32.174; // [ f t / s e c ˆ 2 ] − a c c e l e r a t i o n due t o
gravity
8 gc =32.174;
9 sg =13.45; // [ s p e c i f i c g a r v i t y o f m e r c u r y

51
10 p =62.4; // [ l b / f t ˆ 3 ] − d e n s i t y o f w a t e r ;
11 pm = sg * p ;
12 deltaz_waterleg =45.2213;
13 // u s i n g t h e e q u a t i o n A( w e l l ) ∗ d e l t a z ( w e l l )=A( t u b e ) ∗
d e l t a z ( tube )
14 deltazt =70; // [ cm ]
15 deltazw = deltazt *( at / aw ) ;
16 deltaz = deltazt + deltazw ;
17 deltap_Hg = - pm *( g / gc ) *( deltaz /(2.54*12) ) ;
18 disp ( deltap_Hg ) ;
19 deltazw =45.2213; // [ cm ]
20 deltap_tap = deltap_Hg + p *( g / gc ) *( deltazw /(12*2.54) ) ;
21 printf ( ” \n\n d e l t a p t a p=%f l b f / f t ˆ2 ” , deltap_tap ) ;
22 printf ( ” \ n d e l t a p i s n e g a t i v e and t h e r e f o r e p1 i s
g r e a t e r t h a n p2 ” ) ;

Scilab code Exa 7.19 buoyant forces

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 1 9 − pg317 ” ) ;
4 // g i v e n
5 p =749/760; // [ atm ]
6 T =21+273.15; // [ K ]
7 R =82.06; // [ atm∗cmˆ3/K ] − g a s c o n s t a n t
8 v =( R * T ) / p ; // [ cmˆ3/ mole ] − m o l a r volume
9 M =29; // [ g / mole ] − m o l e c u l a r w e i g h t
10 pair = M / v ;
11 m_air =53.32; // [ g ]
12 m_h2o =50.22; // [ g ]
13 ph2o =0.998; // [ g /cm ˆ 3 ] − d e n s i t y o f w a t e r
14 V =( m_air - m_h2o ) /( ph2o - pair ) ; // [ cm ˆ 3 ]
15 density = m_air / V ;
16 printf ( ” \n\n The d e n s i t y o f c o i n i s \n d e n s i t y=%fg /
cmˆ3 ” , density ) ;

52
17 printf ( ” \n\n C o n s u l t i n g a handbook i t i s s e e n t h a t
t h i s r e s u l t i s c o r r e c t d e n s i t y f o r g o l d ”);

Scilab code Exa 7.20 buoyant forces

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 2 0 − pg318 ” ) ;
4 // g i v e n
5 P =749/760; // [ atm ] − p r e s s u r e
6 T =21+273.15; // [ K ] − t e m p e r a t u r e
7 poak =38*(1/62.4) ; // [ g /cm ˆ 3 ] − d e n s i t y o f oak
8 pbrass =534/62.4; // [ g /cm ˆ 3 ] − d e n s i t y o f b r a s s
9 m_brass =6.7348; // [ g ]
10 pair =0.001184; // [ g /cm ˆ 3 ] − d e n s i t y o f a i r
11 // u s i n g t h e f o r m u l a m oak=m b r a s s ∗((1 −( p a i r / p b r a s s )
) /(1 −( p a i r / poak ) ) )
12 m_oak = m_brass *((1 -( pair / pbrass ) ) /(1 -( pair / poak ) ) ) ;
13 printf ( ” \n\n m oak=%fg ” , m_oak ) ;

Scilab code Exa 7.21 variation of pressure with depth

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 2 1 − pg320 ” ) ;
4 // g i v e n
5 T =545.67; // [ degR ] − t e m p e r a t u r e
6 R =1545; // [ T o r r ∗ f t ˆ3/ degR ∗ mole ] − g a s c o n s t a n t
7 M =29; // [ g / mole ] − m o l e c u l a r w e i g h t
8 g =9.807; // [m/ s e c ˆ 2 ] − a c c e l e r a t i o n due t o g r a v i t y
9 gc =9.807;
10 po =760; // [ T o r r ] − p r e s s u r e
11 deltaz =50; // [ f t ]

53
12 // u s i n g t h e e q u a t i o n p=po ∗ exp ( −( g / g c ) ∗M∗ ( d e l t a z /R∗T
))
13 p = po * %e ^( -( g / gc ) * M *( deltaz /( R * T ) ) ) ;
14 printf ( ” \n\n p=%fTorr \n Thus , t h e p r e s s u r e d e c r e a s e
f o r an e l e v a t i o n o f 50 f t i s v e r y s m a l l ” ,p ) ;

Scilab code Exa 7.22 variation of pressure with depth

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 7 . 2 2 − pg321 ” ) ;
4 // g i v e n
5 To =545.67; // [ degR ] − a i r t e m p e r a t u r e a t b e a c h
level
6 betaa = -0.00357; // [ degR / f t ] − c o n s t a n t
7 R =1545; // [ T o r r ∗ f t ˆ3/ degR ∗ mole ] − g a s c o n s t a n t
8 M =29;
9 deltaz =25000; // [ f t ]
10 // u s i n g t h e e q u a t i o n l n ( p / po ) =((M) / (R∗ b e t a a ) ) ∗ l n ( To
/ ( To+b e t a a ∗ d e l t a z )
11 p = po * exp ((( M ) /( R * betaa ) ) * log ( To /( To + betaa * deltaz ) ) ) ;
12 printf ( ” \n\n p=%fTorr ” ,p ) ;
13 // u s i n g t h e e q u a t i o n T=To+b e t a a ∗ d e l t a z
14 T = To + betaa * deltaz ;
15 printf ( ” \n\n T=%fdegR ” ,T ) ;

54
Chapter 9

agitation

Scilab code Exa 9.3 scale up procedures for turbulent flow with a single
test volume

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 9 . 3 − pg389 ” ) ;
4 Nblades =4; // no . o f b l a d e s
5 d =9/12; // [ f t ] − d i a m e t e r o f t h e i m p e l l e r
6 dt =30/12; // [ f t ] − d i a m e t e r o f t h e t a n k
7 Nbaffles =4; // no . o f b a f f l e s
8 h =30; // [ i n c h ] − h e i g h t o f u n i t
9 mu =10; // [ cP ] − v i s c o s i t y o f f l u i d
10 sg =1.1; // s p e c i f i c g r a v i t y o f f l u i d
11 s =300; // [ rpm ] − s p e e d o f a g i t a t o r
12 CbyT =0.3;
13 V =( %pi * dt ^3) /4; // volume o f t a n k i n f t ˆ3
14 V1 = V *7.48; // [ g a l ] − volume o f t a n k i n g a l l o n s
15 mu = mu *(6.72*10^ -4) ; // [ l b / f t ∗ s e c ]
16 p = sg *62.4; // [ l b / f t ˆ 3 ] − d e n s i t y o f f l u i d
17 N = s /60; // [ r p s ] − i m p e l l e r s p e e d i n r e v o l u t i o n s p e r
second
18 Nre =(( d ^2) * N * p ) / mu ;
19 disp ( Nre , ” Nre=” ) ;

55
20 printf ( ” \n\n T h e r e f o r e t h e a g i t a t o r o p e r a t e s i n t h e
t u r b u l e n t r e g i o n ”);
21 Npo =1.62;
22 gc =32.174;
23 P =( Npo *( p *( N ^3) *( d ^5) ) ) /( gc *550) ;
24 Cf =63025;
25 Tq =( P / s ) * Cf ;
26 PbyV = P / V ;
27 PbyV1 = P / V1 ;
28 TqbyV = Tq / V ;
29 TqbyV1 = Tq / V1 ;
30 printf ( ” \n\n The power p e r u n i t volume and t h e
t o r q u e p e r u n i t volume i s \n P/V=%f hp / f t ˆ3=%f hp
/ g a l \n Tq/V=%f i n ∗ l b / f t ˆ3=%f i n ∗ l b / g a l ” , PbyV ,
PbyV1 , TqbyV , TqbyV1 ) ;

Scilab code Exa 9.4 scale up procedures for turbulent flow with a single
test volume

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 9 . 4 − pg391 ” ) ;
4 // g i v e n
5 Tpilot =30;
6 Tlab =10;
7 N1 =690;
8 N2 =271;
9 D2 =3;
10 D1 =1;
11 n =( log ( N1 / N2 ) ) /( log ( D2 / D1 ) ) ;
12 V =12000/7.48; // [ f t ˆ 3 ]
13 T =((4* V ) / %pi ) ^(1/3) ; // [ f t ]
14 R =12.69/(30/12) ;
15 N3 = N2 *(1/ R ) ^ n ; // [ rpm ] − i m p e l l e r s p e e d i n t h e
reactor

56
16 disp ( N3 , ” i m p e l l e r s p e e d i n rpm=” ) ;
17 D3 =0.75* R ; // [ f t ] − r e a c t o r i m p e l l e r d i a m e t e r
18 disp ( D3 , ” r e a c t o r i m p e l l e r d i a m e t e r i n f t =” ) ;
19 P =0.1374*(( N3 / N2 ) ^3) *( R ^5) ;
20 disp (P , ” power i n hp=” ) ;
21 Cf =63025;
22 Tq =( P / N3 ) * Cf ; // [ i n c h ∗ l b ]
23 disp ( Tq , ” t o r q u e i n i n c h ∗ l b=” ) ;
24 printf ( ” \n\n At t h i s p o i n t , t h e d e s i g n i s c o m p l e t e .
A s t a n d a r d s i z e i m p e l l e r would be c h o s e n a s w e l l
a s a s t a n d a r d s i z e motor ( 7 . 5 hp o r 10 hp ) ” ) ;

Scilab code Exa 9.5 scale up procedures for turbulent flow with a single
test volume

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 9 . 5 − pg 393 ” ) ;
4 // g i v e n
5 n =[0.5 0.6 0.7 0.8 0.9 1.0];
6 D2 =3.806;
7 D1 =0.25;
8 R = D2 / D1 ;
9 N1 =690;
10 N2 = N1 *(( D1 / D2 ) ^ n ) ;
11 P1 =9.33*10^ -3; // [ hp ]
12 P2 = P1 * R ^(5 -3* n ) ;
13 printf ( ” \n\n n N, rpm
P , hp ” ) ;
14 for i =1:6
15 printf ( ” \n %f %f %f ” ,n ( i ) ,
N2 ( i ) , P2 ( i ) ) ;
16 end

57
Chapter 10

transport in ducts

Scilab code Exa 10.1 laminar pipe flow

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 − pg405 ” ) ;
4 T =30; // [ degC ] − t e m p e r a t u r e
5 d =8.265*10^ -4; // [m] − d i a m e t e r o f t h e capillary
viscometer
6 deltapbyL = -0.9364; // [ p s i / f t ] − p r e s s u r e d r o p p e r
unit length
7 deltapbyL = deltapbyL *(2.2631*10^4) ; // [ kg /mˆ2∗ s e c ˆ 2 ]
− p r e s s u r e drop per u n i t l e n g t h
8 Q =28.36*(10^ -6) *(1/60) ;
9 p =(0.88412 -(0.92248*10^ -3) * T ) *10^3; // [ kg /mˆ 3 ] −
density
10 s =( %pi *( d ^2) ) /4;
11 U=Q/s;
12 tauw =( d /4) *( - deltapbyL ) ;
13 shearrate =(8* U ) / d ;
14 mu = tauw /( shearrate ) ;
15 printf ( ” \n\n The v i s c o s i t y i s \n mu=%f kg /m∗ s e c=%f
cP ” ,mu , mu *10^3) ;
16 printf ( ” \n\n F i n a l l y , i t i s i m p o r t a n t t o c h e c k t h e

58
r e y n o l d s number t o make s u r e t h e a b o v e e q u a t i o n
a p p l i e s ”);
17 Nre =( d * U * p ) /( mu ) ;
18 disp ( Nre , ” Nre=” ) ;
19 printf ( ” \n\n The f l o w i s w e l l w i t h i n t h e l a m i n a r
r e g i o n and t h e r e f o r e t h e a b o v e e q u a t i o n a p p l i e s ” )
;

Scilab code Exa 10.2 turbulent pipe flow

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 2 − pg407 ” ) ;
4 Nreold =1214;
5 Uold =0.8810;
6 Nre =13700;
7 U = Uold *( Nre / Nreold ) ;
8 Lbyd =744;
9 // u s i n g t h e newton r a p h s o n method t o c a l c u l a t e the
v a l u e o f f from t h e e q u a t i o n − 1 / ( f ˆ ( 1 / 2 ) ) =4∗ l o g (
Nre ∗ ( f ˆ ( 1 / 2 ) ) ) −0.4
10 f =0.007119;
11 p =(0.88412 -(0.92248*10^ -3) * T ) *10^3; // [ kg /mˆ 3 ] −
density
12 tauw =(1/2) * p *( U ^2) * f ;
13 deltap = tauw *(4) *( Lbyd ) ;
14 d =0.03254/12; // [ f t ]
15 L = Lbyd * d ;
16 printf ( ” \n\n P r e s s u r e d r o p i s \n −d e l t a p=%e N/mˆ2=%f
kpa =130 p s i ” , deltap , deltap *10^ -3) ;
17 printf ( ” \n\n A p r e s s u r e d r o p o f 130 p s i on a t u b e o f
l e n g t h o f %f f t i s h i g h and shows t h e
i m p r a c t i c a l i t y o f f l o w s a t h i g h r e y n o l d s number
i n s m a l l e r t u b e s ” ,L ) ;

59
Scilab code Exa 10.3 pressure drop in rough pipes

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 3 − pg414 ” ) ;
4 // g i v e n
5 u =1/60; // [m/ s e c ] − v e l o c i t y
6 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
7 mu =1*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y
8 d =6*10^ -2; // [m] − i n s i d e d i a m e t e r o f t u b e
9 L =300; // [m] − l e n g t h o f t h e t u b e
10 Nre =( d * u * p ) /( mu ) ;
11 disp ( ” t h e r e f o r e t h e f l o w i s l a m i n a r ” ,Nre , ” Nre=” ) ;
12 f =16/ Nre ;
13 disp ( f ) ;
14 deltap =(4* f ) *( L / d ) *(( p *( u ^2) ) /2) ;
15 printf ( ” \n\n −d e l t a p=%f N/mˆ2 = %f kPa = %e p s i ” ,
deltap , deltap *10^ -3 , deltap *1.453*10^ -4) ;

Scilab code Exa 10.4 pressure drop in rough pipes

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 4 − pg415 ” ) ;
4 // g i v e n
5 d =6*10^ -2; // [m] − i n s i d e d i a m e t e r o f t u b e
6 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
7 // f o r smooth p i p e
8 Nre =[10^4 10^5];
9 f =[0.0076 0.0045];
10 mu =10^ -3; // [ kg /mˆ2∗ s ]
11 U =( Nre * mu ) /( d * p ) ;

60
12 L =300; // [m] − l e n g t h o f t h e t u b e
13 for i =1:2
14 deltap ( i ) =(4* f ( i ) ) *( L / d ) *(( p *( U ( i ) ^2) ) /2) ;
15 end
16 disp ( ” f o r smooth p i p e ” ) ;
17 printf ( ” Nre −d e l t a p ” ) ;
18 printf ( ” \n %f %f ” , Nre (1) , deltap (1)
);
19 printf ( ” \n %f %f \n ” , Nre (2) , deltap
(2) ) ;
20 // f o r c o m m e r c i a l s t e e l
21 Nre =[10^4 10^5];
22 f =[0.008 0.0053];
23 U =( Nre * mu ) /( d * p ) ;
24 L =300; // [m] − l e n g t h o f t h e t u b e
25 for i =1:2
26 deltap ( i ) =(4* f ( i ) ) *( L / d ) *(( p *( U ( i ) ^2) ) /2) ;
27 end
28 disp ( ” f o r c o m m e r c i a l s t e e l p i p e ” ) ;
29 printf ( ” Nre −d e l t a p ” ) ;
30 printf ( ” \n %f %f ” , Nre (1) , deltap (1)
);
31 printf ( ” \n %f %f \n ” , Nre (2) , deltap
(2) ) ;
32 // f o r c a s t i r o n p i p e
33 Nre =[10^4 10^5];
34 f =[0.009 0.0073];
35 U =( Nre * mu ) /( d * p ) ;
36 L =300; // [m] − l e n g t h o f t h e t u b e
37 for i =1:2
38 deltap ( i ) =(4* f ( i ) ) *( L / d ) *(( p *( U ( i ) ^2) ) /2) ;
39 end
40 disp ( ” f o r c a s t i r o n p i p e ” ) ;
41 printf ( ” Nre −d e l t a p ” ) ;
42 printf ( ” \n %f %f ” , Nre (1) , deltap (1)
);
43 printf ( ” \n %f %f ” , Nre (2) , deltap (2) ) ;

61
Scilab code Exa 10.5 von karman number

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 5 − pg417 ” ) ;
4 // g i v e n
5 L =300; // [m] − l e n g t h o f p i p e
6 d =0.06; // [m] − i n s i d e d i a m e t e r
7 deltap =147*10^3; // [ Pa ] − p r e s s u r e t h e pump can
supply
8 ebyd =0.000762; // r e l a t i v e r o u g h n e s s
9 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
10 mu =1*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y
11 tauw =( d *( deltap ) ) /(4* L ) ;
12 // u s i n g t h e h i t and t r i a l method f o r e s t i m a t i o n of
flow velocity
13 // l e t
14 f =0.005;
15 U =((2* tauw ) /( p * f ) ) ^(1/2) ;
16 Nre =( d * U * p ) / mu ;
17 // from t h e g r a p h v a l u e o f f a t t h e a b o v e c a l c u l a t e d
r e y n o l d s no . and t h e g i v e n r e l a t i v e r o u g h n e s s ( e /
d)
18 f =0.0054;
19 U =((2* tauw ) /( p * f ) ) ^(1/2) ;
20 Nre =( d * U * p ) / mu ;
21 // from t h e g r a p h v a l u e o f f a t t h e a b o v e c a l c u l a t e d
r e y n o l d s no . and t h e g i v e n r e l a t i v e r o u g h n e s s ( e /
d)
22 f =0.0053;
23 U =((2* tauw ) /( p * f ) ) ^(1/2) ;
24 Nre =( d * U * p ) / mu ;
25 // from t h e g r a p h v a l u e o f f a t t h e a b o v e c a l c u l a t e d
r e y n o l d s no . and t h e g i v e n r e l a t i v e r o u g h n e s s ( e /

62
d)
26 f =0.0053;
27 // At t h i s p o i n t t h e v a l u e o f f i s deemed unchanged
from t h e l a s t i t e r a t i o n . Hence , t h e v a l u e s
obtained a f t e r the t h i r d i t e r a t i o n are the
converged values
28 printf ( ” \n\n The maximum f l o w v e l o c i t y i s \n U=%f m/
s e c ” ,U ) ;

Scilab code Exa 10.6 von karman number

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 6 − pg419 ” ) ;
4 // g i v e n
5 L =300; // [m] − l e n g t h o f p i p e
6 d =0.06; // [m] − i n s i d e d i a m e t e r
7 deltap =147*10^3; // [ Pa ] − p r e s s u r e t h e pump can
supply
8 ebyd =0.000762; // r e l a t i v e r o u g h n e s s
9 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
10 mu =1*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y
11 Nvk =(( d * p ) / mu ) *(( d *( deltap ) ) /(2* L * p ) ) ^(1/2) ;
12 disp ( Nvk , ” von karman no .− ” ) ;
13 // From t h e f i g a t g i v e n von karman no and r e l a t i v e
roughness the value of f is −
14 f =0.0055;
15 Nre = Nvk /( f ^(1/2) )
16 U =( Nre * mu ) /( d * p ) ;
17 printf ( ” \n\n U=%f m/ s e c ” ,U ) ;

Scilab code Exa 10.7 the velocity head concept

63
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 7 − pg422 ” ) ;
4 // g i v e n
5 L =300; // [m] − l e n g t h o f p i p e
6 d =0.06; // [m] − i n s i d e d i a m e t e r
7 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
8 mu =1*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y
9 Nre =[10^4 10^5];
10 U =( Nre * mu ) /( d * p ) ;
11 velocityhead =( U ^2) /2;
12 N =( L / d ) /45; // no o f v e l o c i t y h e a d s
13 deltap = p * N *( velocityhead ) ;
14 for i =1:2
15 disp ( Nre ( i ) ,” Nre=” ) ;
16 printf ( ” \n\n v e l o c i t y head =%f mˆ2/ s e c ˆ2 ” ,
velocityhead ( i ) ) ;
17 printf ( ” \n\n −d e l t a p = %f kPa = %f p s i ” , deltap ( i
) *10^ -3 , deltap ( i ) *1.453*10^ -4) ;
18 end

Scilab code Exa 10.8 pipe fittings and valves

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 8 − pg439 ” ) ;
4 // g i v e n
5 mu =6.72*10^ -4; // [ l b / f t ∗ s e c ] − v i s c o s i t y
6 p =62.4; // [ l b / f t ˆ 3 ] − d e n s i t y
7 S =0.03322; // [ f t ˆ 2 ] − f l o w a r e a
8 d =0.206; // [ f t ]
9 e =1.5*10^ -4; // a b s o l u t e r o u g h n e s s f o r s t e e l p i p e
10 ebyd = e / d ;
11 Nre =10^5;
12 // f r i c t i o n f a c t o r a s r e a d from f i g i n book f o r t h e

64
g i v e n r e y n o l d s no . and r e l a t i v e r o u g h n e s s i s −
13 f =0.0053;
14 U =( Nre * mu ) /( p * d ) ;
15 Q=U*S;
16 gc =32.174;
17 // ( a ) e q u i v a l e n t l e n g t h method
18 deltapbyL = f *(4/ d ) *( p *( U ^2) ) *(1/(2* gc ) ) *(6.93*10^ -3) ;
19 // u s i n g L=L p i p e+ L f i t t i n g s +L l o s s ;
20 Lfittings =2342.1* d ;
21 kc =0.50; // due t o c o n t r a c t i o n l o s s
22 ke =1; // due t o e n l a r g e m e n t l o s s
23 Lloss =( kc + ke ) *(1/(4* f ) ) * d ;
24 Lpipe =137;
25 L = Lpipe + Lfittings + Lloss ;
26 deltap = deltapbyL * L ;
27 patm =14.696; // [ p s i ] − a t m o s p h e r i c p r e s s u r e
28 p1 = patm + deltap ;
29 printf ( ” \n\n ( a ) The i n l e t p r e s s u r e i s \n p1=%f p s i ” ,
p1 ) ;
30 // ( b ) l o s s c o e f f i c i e n t method
31 // u s i n g t h e e q u a t i o n d e l t a p / p=−(F p i p e+ F f i t t i n g s +
Floss )
32 L =137;
33 kfittings =52.39;
34 sigmaF =((4* f *( L / d ) ) + kc + ke + kfittings ) *(( U ^2) /(2* gc ) ) ;
35 deltap =( p * sigmaF ) /(144) ;
36 p1 = patm + deltap ;
37 printf ( ” \n\n ( b ) The i n l e t p r e s s u r e i s \n p1=%f p s i ” ,
p1 ) ;
38 printf ( ” \n\n Computation o f t h e p r e s s u r e d r o p by t h e
l o s s c o e f f i c i e n t method d i f f e r s from t h e
e q u i v a l e n t l e n g t h method by l e s s t h a n 1 p s i ” ) ;

Scilab code Exa 10.9 gases

65
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 9 − pg443 ” ) ;
4 // g i v e n
5 L1 =50; // [m] − l e n g t h o f f i r s t p i p e
6 L2 =150; // [m] − l e n g t h o f s e c o n d p i p e
7 L3 =100; // [m] − l e n g t h o f t h i r d p i p e
8 d1 =0.04; // [m] − d i a m e t e r o f f i r s t p i p e
9 d2 =0.06; // [m] − d i a m e t e r o f s e c o n d p i p e
10 d3 =0.08; // [m] − d i a m e t e r o f t h i r d p i p e
11 deltap = -1.47*10^5; // [ kg /m∗ s e c ] − p r e s s u r e d r o p
12 mu =1*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y
13 p =1000; // [ kg /mˆ 3 ] − d e n s i t y
14 // f o r b r a n c h 1
15 S =( %pi *( d1 ^2) ) /4;
16 Nvk =(( d1 * p ) / mu ) *( -( d1 * deltap ) /(2* L1 * p ) ) ^(1/2) ;
17 f =(1/(4* log10 ( Nvk ) -0.4) ) ^2;
18 U =((( - deltap ) / p ) *( d1 / L1 ) *(2/4) *(1/ f ) ) ^(1/2) ;
19 w1 = p * U * S ;
20 printf ( ” \n\n For f i r s t b r a n c h w1=%f kg / s e c ” , w1 ) ;
21 // f o r b r a n c h 2
22 S =( %pi *( d2 ^2) ) /4;
23 Nvk =(( d2 * p ) / mu ) *( -( d2 * deltap ) /(2* L2 * p ) ) ^(1/2) ;
24 f =(1/(4* log10 ( Nvk ) -0.4) ) ^2;
25 U =((( - deltap ) / p ) *( d2 / L2 ) *(2/4) *(1/ f ) ) ^(1/2) ;
26 w2 = p * U * S ;
27 printf ( ” \n\n For s e c o n d b r a n c h w2=%f kg / s e c ” , w2 ) ;
28 // f o r b r a n c h 3
29 S =( %pi *( d3 ^2) ) /4;
30 Nvk =(( d3 * p ) / mu ) *( -( d3 * deltap ) /(2* L3 * p ) ) ^(1/2) ;
31 f =(1/(4* log10 ( Nvk ) -0.4) ) ^2;
32 U =((( - deltap ) / p ) *( d3 / L3 ) *(2/4) *(1/ f ) ) ^(1/2) ;
33 w3 = p * U * S ;
34 printf ( ” \n\n For t h i r d b r a n c h w3=%f kg / s e c ” , w3 ) ;
35 // t o t a l f l o w r a t e w=w1+w2+w3
36 w = w1 + w2 + w3 ;
37 printf ( ” \n\n t o t a l f l o w r a t e i s w=%f kg / s e c ” ,w ) ;

66
Scilab code Exa 10.11 complex fluid flow systems

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 1 − pg 447 ” ) ;
4 // g i v e n
5 sp =1.1;
6 p = sp *62.4; // [ l b / f t ˆ 3 ] − d e n s i t y
7 mu =2*6.72*10^ -4; // [ l b / f t ∗ s e c ] − v i s c o s i t y
8 Q =400; // [ gpm ] − v o l u m e t r i c f l o w r a t e
9 e =1.5*10^4; // r o u g h n e s s o f s t e e l p i p e
10 gc =32.174;
11 kexit =1;
12 kentrance =0.5;
13 // 4 i n s c h e d u l e p i p e
14 d =4.026/12; // [ f t ]
15 U4 = Q /39.6; // [ f t / s e c ]
16 Lgv =13.08;
17 Lglv =114.1;
18 Le =40.26;
19 Lpipe_4 =22;
20 Lfittings_4 = Lgv + Lglv + Le ;
21 Lloss =0;
22 L_4 = Lpipe_4 + Lfittings_4 + Lloss ;
23 Nre_4 =( d * U4 * p ) / mu ;
24 f =0.00475;
25 Fpipe_4 =((4* f * L_4 ) / d ) *( U4 ^2) *(1/(2* gc ) ) ;
26 Floss_4 =(( kentrance +0) *( U4 ^2) ) /(2* gc ) ;
27 // 5 i n s c h e d u l e p i p e
28 d =5.047/12;
29 U5 = Q /62.3;
30 Lgv =10.94;
31 Le =75.71;
32 Lpipe_5 =100;

67
33 Lfittings_5 = Lgv + Le ;
34 Lloss =0;
35 L_5 = Lpipe_5 + Lfittings_5 + Lloss ;
36 Nre =( d * U5 * p ) / mu ;
37 f =0.00470;
38 Fpipe_5 =((4* f * L_5 ) / d ) *( U5 ^2) *(1/(2* gc ) ) ;
39 Floss_5 =(( kexit +0) *( U5 ^2) ) /(2* gc ) ;
40 // 6 i n s c h e d u l e p i p e
41 d =6.065/12;
42 U6 = Q /90;
43 Lgv =6.570;
44 Le =30.36;
45 Lpipe_6 =4;
46 Lfittings_6 = Lgv + Le ;
47 Lloss =0;
48 L_6 = Lpipe_6 + Lfittings_6 + Lloss ;
49 Nre =( d * U6 * p ) / mu ;
50 f =0.00487;
51 Fpipe_6 =((4* f * L_6 ) / d ) *( U6 ^2) *(1/(2* gc ) ) ;
52 kc =0.50;
53 Floss_6 = kc *(( U6 ^2) /(2* gc ) ) ;
54 Ffittings =0;
55 deltap_6 = p *( Fpipe_6 + Ffittings + Floss_6 ) ;
56 // 3/4 i n 18 g a u g e t u b e
57 d =0.652112/12;
58 L_3by4 =15;
59 U_3by4 =( Q *0.962) /100;
60 Floss_3by4 =100*( kexit + kentrance ) *(( U_3by4 ^2) /2) ;
61 Nre = d * U_3by4 * p *(1/ mu ) ;
62 // c l e a r l y t h e f l o w i s t u r b u l e n t
63 f =0.08*(( Nre ) ^( -1/4) ) +0.012*(( d ) ^(1/2) ) ;
64 deltap_3by4 =((4* f * p * L_3by4 ) / d ) *(( U_3by4 ^2) /(2* gc ) ) ;
65 Fpipe_3by4 =100*((4* f * L_3by4 ) / d ) *(( U_3by4 ^2) /(2* gc ) ) ;
66 deltap_spraysystem =25; // [ p s i ]
67 Fspraysystem =( deltap_spraysystem / p ) *(144) ;
68 delta_p =[ p *( kexit + kentrance ) ]*[( U_3by4 ^2) /(2* gc ) ];
69 Fpipe = Fpipe_4 + Fpipe_5 + Fpipe_6 ;
70 Floss = Floss_4 + Floss_5 + Floss_6 + Floss_3by4 ;

68
71 ws =0+([(15^2) -0]/[2* gc ]) +38.9+382.5;
72 w =( Q * p ) /(7.48) ;
73 Ws =( ws * w ) /(33000) ;
74 efficiency =0.6;
75 Ws_actual = Ws / efficiency
76 printf ( ” \n\n The power s u p p l i e d t o t h pump i s \n
W a c t u a l = %f ” , Ws_actual ) ;

Scilab code Exa 10.12 complex fluid flow systems

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 2 − pg454 ” ) ;
4 // g i v e n
5 kexit =1;
6 kentrance =0.5;
7 Q =400; // [ gpm ] − v o l u m e t r i c f l o w r a t e
8 gc =32.174;
9 // f o r 4 i n c h p i p e
10 d =4.026; // [ i n c h ]
11 L =22; // [ f t ]
12 Lbyd =( L *12) /( d ) ;
13 // a d d i n g t h e c o n t r i b u t i o n s due t o f i t t i n g s
14 Lbyd = Lbyd +3*13+340+4*30;
15 N = Lbyd /45;
16 N = N + kentrance +0;
17 U4 = Q /39.6; // [ f t / s e c ]
18 Fpipe_4 =( N *( U4 ^2) ) /(2* gc ) ;
19 printf ( ” \n\n F ( 4 i n . p i p e s ) = %f f t ∗ l b f / lbm ” , Fpipe_4 )
;
20 // f o r 5 i n c h p i p e
21 L =100; // [ f t ]
22 d =5.047; // [ i n c h ]
23 Lbyd =( L *12) /( d ) ;
24 // v a l v e s c o n t r i b u t e s 26 d i a m e t e r s and s i x e l b o w s

69
c o n t r i b u t e 30 d i a m e t e r s e c a h ; t h e r e f o r e
25 Lbyd = Lbyd +26+6*30;
26 N = Lbyd /45; // no . o f v e l o c i t y h e a d s
27 N = N + kexit + kentrance ;
28 U5 = Q /62.3;
29 Fpipe_5 =( N *( U5 ^2) ) /(2* gc ) ;
30 printf ( ” \n\n F ( 5 i n . p i p e s ) = %f f t ∗ l b f / lbm ” , Fpipe_5 )
;
31 // f o r 6 i n c h p i p e
32 d =6.065; // [ i n c h ]
33 L =5; // [ f t ]
34 Lbyd =( L *12) /( d ) ;
35 // a d d i n g t h e c o n t r i b u t i o n s due t o f i t t i n g s
36 Lbyd = Lbyd +1*13+2*30;
37 N = Lbyd /45;
38 N = N +0+ kentrance ;
39 U6 = Q /90;
40 Fpipe_6 =( N *( U6 ^2) ) /(2* gc ) ;
41 printf ( ” \n\n F ( 6 i n . p i p e s ) = %f f t ∗ l b f / lbm ” , Fpipe_6 )
;
42 F_largepipes = Fpipe_4 + Fpipe_5 + Fpipe_6 ;
43 printf ( ” \n\n F ( l a r g e p i p e s ) = %f f t ∗ l b f / lbm ” ,
F_largepipes ) ;

Scilab code Exa 10.14 non circular conduits

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 4 − pg459 ” ) ;
4 // g i v e n
5 l =0.09238;
6 rh =0.1624* l ;
7 L =300;
8 de =4* rh ;
9 p =1000; // [ kg /mˆ 3 ]

70
10 mu =10^ -3; // [ kg /m∗ s e c ]
11 Uavg =1.667;
12 Nre =( de * Uavg * p ) / mu ;
13 f =0.0053;
14 deltap =((4* f * L ) / de ) *( p *( Uavg ^2) *(1/2) ) ;
15 printf ( ” \n\n −d e l t a p = %e kg /m∗ s = %e N/mˆ2 = %f kPa
” , deltap , deltap , deltap *10^ -3) ;

Scilab code Exa 10.15 orifice meter

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 5 − pg466 ” ) ;
4 // g i v e n
5 Q =400; // [ gpm ]
6 p =1.1*62.4; // [ lbm / f t ˆ 3 ]
7 mu =2*(6.72*10^ -4) ; // [ l b / f t ∗ s e c ]
8 e =1.5*10^4;
9 // 4 i n c h s c h e d u l e p i p e
10 d =0.3355;
11 S =( %pi *( d ^2) ) /4;
12 U4 = Q /39.6;
13 ebyd = e / d ;
14 w =3671/60;
15 pm =13.45*62.4;
16 g =32.1;
17 gc =32.174;
18 deltaz =2.5;
19 deltap =( g / gc ) *( pm - p ) *( deltaz ) ;
20 betaa =((1) /(1+[(2* p * gc ) *( deltap ) ]*(((0.61* S ) / w ) ^2) ) )
^(1/4) ;
21 d2 = betaa * d ;
22 Nre2 =(4* w ) /( %pi * d2 * mu ) ;
23 a =(1/30) *4.026;
24 b =(1/4) *(2.013 -1.21) ;

71
25 c =(1/8) *(2.42) ;
26 if a < b then
27 if a < c then
28 opt = a ;
29 else
30 opt = c ;
31 end
32 else
33 if b < c then
34 opt = b ;
35 else
36 opt = c ;
37 end
38 end
39 printf ( ” \n\n The p e r t i n e n t o r i f i c e d e t a i l s a r e \n
o r i f i c e d i a m e t e r = %f i n \n c o r n e r t a p s , s q u a r e
e d g e \n o r i f i c e p l a t e n o t o v e r %f i n t h i c k ” , d2 *12 ,
opt ) ;

Scilab code Exa 10.16 venturi and nozzle

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 6 − pg470 ” ) ;
4 // g i v e n
5 Q =400; // [ gpm ]
6 p =1.1*62.4; // [ lbm / f t ˆ 3 ]
7 mu =2*(6.72*10^ -4) ; // [ l b / f t ∗ s e c ]
8 e =1.5*10^4;
9 // 4 i n c h s c h e d u l e p i p e
10 d =0.3355;
11 S =( %pi *( d ^2) ) /4;
12 U4 = Q /39.6;
13 ebyd = e / d ;
14 w =3671/60;

72
15 pm =13.45*62.4;
16 g =32.1;
17 gc =32.174;
18 Nre =( d * U4 * p ) / mu ;
19 if Nre >10^4 then
20 c =0.98;
21 end
22 deltaz =2.5;
23 deltap =( g / gc ) *( pm - p ) *( deltaz ) ;
24 betaa =((1) /(1+[(2* p * gc ) *( deltap ) ]*((( c * S ) / w ) ^2) ) )
^(1/4) ;
25 d2 = betaa * d ;
26 printf ( ” \n\n The p e r t i n e n t r d e t a i l s o f t h e v e n t u r i
d e s i g n a r e \n T h r o a t d i a m e t e r = %f i n c h \n Approach
a n g l e = 25\ n D i v e r g e n c e a n g l e = 7 ” , d2 *12) ;

Scilab code Exa 10.17 pitot tube

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 0 . 1 7 − pg477 ” ) ;
4 // g i v e n
5 Uzmax =3.455; // [ f t / s e c ]
6 m =32;
7 a1 = -0.3527;
8 a2 = -0.6473;
9 rbyro =0.880;
10 UzbyUzmax =1+ a1 *( rbyro ^2) + a2 *( rbyro ^(2* m ) ) ;
11 Uz = Uzmax *( UzbyUzmax ) ;
12 Uzavg =(4/9) * Uzmax +(5/18) *( Uz + Uz ) ;
13 printf ( ” \n\n t h e a v e r a g e v e l o c i t y i s \n Uzavg = %f
f t / s e c \n\n Thus , i n t h i s e x a m p l e t h e r e i s an
i n h e r e n t e r r o r o f 5 . 5 p e r c e n t , e v e n b e f o r e any
e x p e r i m e n t a l e r r o r s a r e i n t r o d u c e d ” , Uzavg ) ;

73
Chapter 11

heat and mass transfer in duct


flow

Scilab code Exa 11.1 conduction

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 1 − pg497 ” ) ;
4 // g i v e n
5 K_drywall =0.28; // [ Btu / f t ∗ degF ] − t h e r m a l
c o n d u c t i v i t y o f dry w a l l
6 K_fibreglass =0.024; // [ Btu / f t ∗ degF ] − t h e r m a l
conductivity of fibre glass
7 K_concrete =0.5; // [ Btu / f t ∗ degF ] − t h e r m a l
conductivity of concrete
8 T4 =0; // [ degF ]
9 T1 =65; // [ degF ]
10 deltaT = T4 - T1 ; // [ degF ]
11 a =1; // [ f t ˆ 2 ] − a s s u m i n g a r e a o f 1 f t ˆ2
12 deltax1 =0.5/12; // [ f t ]
13 deltax2 =3.625/12; // [ f t ]
14 deltax3 =6/12; // [ f t ]
15 R1 = deltax1 /( K_drywall * a ) ; // [ h∗ degF / Btu ]
16 R2 = deltax2 /( K_fibreglass * a ) ; // [ h∗ degF / Btu ]

74
17 R3 = deltax3 /( K_concrete * a ) ; // [ h∗ degF / Btu ]
18 qx = deltaT /( R1 + R2 + R3 ) ;
19 q12 = - qx ;
20 q23 = - qx ;
21 q34 = - qx ;
22 deltaT1 =( - q12 ) * deltax1 *(1/( K_drywall * a ) ) ;
23 T2 = T1 + deltaT1 ;
24 deltaT2 =( - q23 ) * deltax2 *(1/( K_fibreglass * a ) ) ;
25 T3 = T2 + deltaT2 ;
26 deltaT3 =( - q34 ) * deltax3 *(1/( K_concrete * a ) ) ;
27 T4 = T3 + deltaT3 ;
28 printf ( ” \n\n T1 = %f degF \n T2 = %f degF \n T3 = %f
degF \n T4 = %f degF ” ,T1 , T2 , T3 , T4 ) ;

Scilab code Exa 11.2 the resistance concept

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 2 − pg501 ” ) ;
4 // g i v e n
5 r1 =(2.067/2) /(12) ; // [ f t ]
6 r2 = r1 +0.154/12; // [ f t ]
7 r3 = r2 +3/12; // [ f t ]
8 L =1; // [ f t ]
9 Ka =26; // [ Btu / h∗ f t ∗ degF ]
10 Kb =0.04; // [ Btu / h∗ f t ∗ degF ]
11 T1 =50; // [ degF ]
12 Ra =( log ( r2 / r1 ) ) /(2* %pi * L * Ka ) ;
13 Rb =( log ( r3 / r2 ) ) /(2* %pi * L * Kb ) ;
14 R = Ra + Rb ;
15 deltaT = -18; // [ degF ] − d r i v i n g f o r c e
16 Qr = -( deltaT /( R ) ) ;
17 disp ( Qr ) ;
18 deltaT1 =( - Qr ) *( Ra ) ;
19 T2 = T1 + deltaT1 ;

75
20 printf ( ” \n\n The i n t e r f a c e t e m p e r a t u r e i s \n T2 = %f
degF ” , T2 ) ;

Scilab code Exa 11.3 the resistance concept

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 3 − pg502 ” ) ;
4 // g i v e n
5 Ra =8.502*10^ -4; // [ h∗ degF ∗ Btu ˆ −1]
6 Rb =5.014; // [ h∗ degF ∗ Btu ˆ −1]
7 r1 =(2.067/2) /(12) ; // [ f t ]
8 r2 = r1 +0.154/12; // [ f t ]
9 r3 = r2 +3/12; // [ f t ]
10 d1 =2* r1 ;
11 d0 =2* r3 ;
12 h0 =25; // [ Btu / h∗ f t ˆ2∗ degF ]
13 h1 =840; // [ Btu / h∗ f t ˆ2∗ degF ]
14 L =1; // [ f t ] − c o n s i d e r i n g 1 f e e t l e n g t h
15 R0 =1/( h0 * %pi * d0 * L ) ;
16 R1 =1/( h1 * %pi * d1 * L ) ;
17 R = R0 + R1 + Ra + Rb ;
18 disp ( R ) ;
19 deltaT = -400; // [ degF ]
20 Qr = -( deltaT ) / R ;
21 disp ( Qr ) ;
22 // t h e h e a t l o s s c a l c u l a t e d a b o v e i s t h e h e a t l o s s
p e r f o o t . t h e r e f o r e f o r 500 f t
23 L =500;
24 Qr = Qr * L ;
25 printf ( ” \n\n t h e h e a t l o s s f o r a 500 f e e t p i p e i s \n
q r = %e Btu / h ” , Qr ) ;

76
Scilab code Exa 11.5 heat and mass transfer during turbulent flow

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 5 − pg521 ” ) ;
4 // g i v e n
5 Nre =50000;
6 d =0.04; // [m] − d i a m e t e r o f p i p e
7 // p h y s i c a l p r o p e r t i e s o f w a t e r
8 T1 =293.15; // [ K ]
9 T2 =303.15; // [ K ]
10 T3 =313.15; // [ K ]
11 p1 =999; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r a t
t e m p e r a t u r e T1
12 p2 =996.0; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r a t
t e m p e r a t u r e T2
13 p3 =992.1; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r a t
t e m p e r a t u r e T3
14 mu1 =1.001; // [ cP ] − v i s c o s i t y o f w a t e r a t
t e m p e r a t u r e T1
15 mu2 =0.800; // [ cP ] − v i s c o s i t y o f w a t e r a t
t e m p e r a t u r e T2
16 mu3 =0.654; // [ cP ] − v i s c o s i t y o f w a t e r a t
t e m p e r a t u r e T3
17 k1 =0.63; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y o f w a t e r
a t t e m p e r a t u r e T1
18 k2 =0.618; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y o f w a t e r
a t t e m p e r a t u r e T2
19 k3 =0.632; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y o f w a t e r
a t t e m p e r a t u r e T3
20 cp1 =4182; // [ J / kg ∗K ] − h e a t c a p a c i t y o f w a t e r a t
t e m p e r a t u r e T1
21 cp2 =4178; // [ J / kg ∗K ] − h e a t c a p a c i t y o f w a t e r a t
t e m p e r a t u r e T2
22 cp3 =4179; // [ J / kg ∗K ] − h e a t c a p a c i t y o f w a t e r a t
t e m p e r a t u r e T3
23 Npr1 =6.94; // p r a n d t l no . a t t e m p e r a t u r e T1
24 Npr2 =5.41; // p r a n d t l no . a t t e m p e r a t u r e T2

77
25 Npr3 =4.32; // p r a n d t l no . a t t e m p e r a t u r e T3
26 // ( a ) D i t t u s −B o e l t e r −t h i s c o r r e c t i o n e v a l u t e s a l l
p r o p e r t i e s a t t h e mean b u l k t e m p e r a t u r e , which i s
T1
27 kmb =0.603
28 h =( kmb / d ) *0.023*(( Nre ) ^(0.8) ) *(( Npr1 ) ^0.4) ;
29 printf ( ” \n\n ( a ) D i t t u s − B o e l t e r \n t h e h e a t t r a n s f e r
c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f Btu / f t ˆ2∗ h
ˆ−1∗ degF ” ,h , h *0.17611) ;
30 // ( b ) S e i d e r Tate−t h i s c o r r e l a t i o n e v a l u a t e s a l l
t h e p r o p e r t i e s s a v e muw a t t h e mean b u l k
temperature
31 h =( kmb / d ) *(0.027) *(( Nre ) ^0.8) *(( Npr1 ) ^(1/3) ) *(( mu1 /
mu3 ) ^0.14) ;
32 printf ( ” \n\n ( b ) S e i d e r Tate \n t h e h e a t t r a n s f e r
c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f Btu / f t ˆ2∗ h
ˆ−1∗ degF ” ,h , h *0.17611) ;
33 // ( c ) S l e i c h e r −Rouse e q u a t i o n
34 a =0.88 -(0.24/(4+ Npr3 ) ) ;
35 b =(1/3) +0.5* exp (( -0.6) * Npr3 ) ;
36 Nref = Nre *( mu1 / mu2 ) *( p2 / p1 ) ;
37 Nnu =5+0.015*(( Nref ) ^ a ) *(( Npr3 ) ^ b ) ;
38 h = Nnu *( kmb / d ) ;
39 printf ( ” \n\n ( c ) S l e i c h e r −Rouse e q u a t i o n \n t h e h e a t
t r a n s f e r c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f
Btu / f t ˆ2∗ hˆ−1∗ degF ” ,h , h *0.17611) ;
40 // ( d ) Colbum Analogy− t h e j f a c t o r f o r h e a t
transfer is calculated
41 jh =0.023*(( Nref ) ^( -0.2) ) ;
42 Nst = jh *(( Npr2 ) ^( -2/3) ) ;
43 U =( Nre * mu1 *10^ -3) /( d * p1 ) ;
44 h = Nst *( p1 * cp1 * U ) ;
45 printf ( ” \n\n ( d ) Colbum Analogy \n t h e h e a t t r a n s f e r
c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f Btu / f t ˆ2∗ h
ˆ−1∗ degF ” ,h , h *0.17611) ;
46 // ( e ) F r i e n d −M e t z n e r
47 f =0.005227;
48 Nnu =(( Nre ) *( Npr1 ) *( f /2) *(( mu1 / mu3 ) ^0.14) )

78
/(1.20+((11.8) *(( f /2) ^(1/2) ) *( Npr1 -1) *(( Npr1 )
^( -1/3) ) ) ) ;
49 h = Nnu *( kmb / d ) ;
50 printf ( ” \n\n ( e ) F r i e n d −M e t z n e r \n t h e h e a t t r a n s f e r
c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f Btu / f t ˆ2∗ h
ˆ−1∗ degF ” ,h , h *0.17611) ;
51 // ( f ) N u m e r i c a l a n a l y s i s
52 Nnu =320;
53 h = Nnu *( kmb / d ) ;
54 printf ( ” \n\n ( f ) N u m e r i c a l a n a l y s i s \n t h e h e a t
t r a n s f e r c o e f f i c i e n t i s \n h = %f W/mˆ2∗K = %f
Btu / f t ˆ2∗ hˆ−1∗ degF ” ,h , h *0.17611) ;

Scilab code Exa 11.6 heat and mass transfer during turbulent flow

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 6 − pg525 ” ) ;
4 // g i v e n
5 Tw =680; // [ K ] − t e m p e r a t u r e a t t h e w a l l
6 Tb =640; // [ K ] − t e m p e r a t u r e a t t h e b u l k
7 Tf =( Tw + Tb ) /2; // [ K ]
8 Nre =50000;
9 vmb =2.88*10^ -7;
10 vf =2.84*10^ -7;
11 Nref = Nre *( vmb / vf ) ;
12 k =27.48;
13 d =0.04;
14 // from t a b l e 1 1 . 3 t h e p r a n d t l no . i s
15 Npr =8.74*10^ -3
16 // c o n s t a n t h e a t f l o w
17 Nnu =6.3+(0.0167) *(( Nref ) ^0.85) *(( Npr ) ^0.93) ;
18 h = Nnu *( k / d ) ;
19 printf ( ” \n\n c o n s t a n t h e a t f l o w \n h = %f W/mˆ2∗K =
%f Btu / f t ˆ2∗ h∗ degF ” ,h , h *0.17611) ;

79
20 // c o n s t a n t w a l l t e m p e r a t u r e
21 Nnu =4.8+0.0156*(( Nref ) ^0.85) *(( Npr ) ^0.93) ;
22 h = Nnu *( k / d ) ;
23 printf ( ” \n\n c o n s t a n t w a l l t e m p e r a t u r e \n h = %f W/m
ˆ2∗K = %f Btu / f t ˆ2∗ h∗ degF ” ,h , h *0.17611) ;

Scilab code Exa 11.7 double pipe heat exchangers simple solutions

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 7 − pg536 ” ) ;
4 // g i v e n
5 di =0.620; // [ i n c h ] − i n t e r n a l d i a m e t e r
6 d0 =0.750; // [ i n c h ] − o u t e r d i a m e t e r
7 Ai =0.1623; // [ f t ˆ2/ f t ]
8 Ao =0.1963; // [ f t ˆ2/ f t ]
9 wc =12*(471.3/0.9425) ;
10 cp =1; // [ Btu / lbm ∗ degF ] − h e a t c a p a c i t y o f w a t e r
11 Tco =110;
12 Tci =50;
13 qtotal = wc * cp *( Tco - Tci ) ;
14 deltaH_coldwater =3.6*10^5;
15 deltaH_vapourization =1179.7 -269.59;
16 wh = deltaH_coldwater / deltaH_vapourization ;
17 hi =80; // [ Btu / h∗ f t ˆ2∗ degF ]
18 ho =500; // [ Btu / h∗ f t ˆ2∗ degF ]
19 km =26; // [ Btu / h∗ f t ∗ degF ]
20 Ui =1/((1/ hi ) +(( Ai * log ( d0 / di ) ) /(2* %pi * km ) ) +( Ai /( Ao * ho
)));
21 disp ( Ui )
22 deltaT1 =300 -50;
23 deltaT2 =300 -110;
24 LMTD =( deltaT1 - deltaT2 ) /( log ( deltaT1 / deltaT2 ) ) ;
25 A = qtotal /( Ui * LMTD ) ;
26 L = A / Ai ;

80
27 printf ( ” \n\n t h e l e n g t h o f t h e h e a t e x c h a n g e r i s \n
L = %f f t ” ,L ) ;

Scilab code Exa 11.8 double pipe heat exchangers simple solutions

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 8 − pg537 ” ) ;
4 // g i v e n
5 L =30; // [ f t ] − l e n g t h
6 Ai =0.1623* L ;
7 di =0.620; // [ i n c h ] − i n t e r n a l d i a m e t e r
8 d0 =0.750; // [ i n c h ] − o u t e r d i a m e t e r
9 Ao =0.1963* L ; // [ f t ˆ2/ f t ]
10 wc =12*(471.3/0.9425) ;
11 cp =1; // [ Btu / lbm ∗ degF ] − h e a t c a p a c i t y o f w a t e r
12 deltaH_coldwater =3.6*10^5;
13 deltaH_vapourization =1179.7 -269.59;
14 wh = deltaH_coldwater / deltaH_vapourization ;
15 hi =80; // [ Btu / h∗ f t ˆ2∗ degF ]
16 ho =500; // [ Btu / h∗ f t ˆ2∗ degF ]
17 km =26; // [ Btu / h∗ f t ∗ degF ]
18 Ui =1/((1/ hi ) +((( Ai / L ) * log ( d0 / di ) ) /(2* %pi * km ) ) +( Ai /(
Ao * ho ) ) ) ;
19 deltaT1 =300 -50;
20 deltaT = deltaT1 /( exp (( Ui * Ai ) /( wc * cp ) ) ) ;
21 Tsat =300;
22 Tc2 = Tsat - deltaT ;
23 printf ( ” \n\n T h e r e f o r e , t h e o u t l e t t e m p e r a t u r e o f
t h e c o l d f l u i d i s \n Tc2 = %f degF ” , Tc2 ) ;

Scilab code Exa 11.9 double pipe heat exchangers simple solutions

81
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 9 − pg538 ” ) ;
4 // g i v e n
5 Ai =4.869;
6 wc =6000;
7 cp =1;
8 Rf =0.002;
9 Uclean =69.685;
10 Udirty =1/( Rf +(1/ Uclean ) ) ;
11 deltaT1 =300 -50;
12 deltaT2 = deltaT1 /( exp (( Udirty * Ai ) /( wc * cp ) ) ) ;
13 Th2 =300;
14 Tc2 = Th2 - deltaT2 ;
15 printf ( ” \n\n t h e o u t l e t t e m p e r a t u r e i s \n Tc2 = %f
degF ” , Tc2 ) ;

Scilab code Exa 11.10 multipass heat exchangers equipment

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 1 . 1 0 − pg544 ” ) ;
4 // g i v e n
5 Ui =325; // [W/mˆ2∗K ] − o v e r a l l h e a t t r a n s f e r
coefficient
6 Thi =120; // [ degC ] − i n l e t t e m p e r a t u r e o f
hydrocarbon
7 Tho =65; // [ degC ] − o u t l e t t e m p e r a t u r e o f
hydrocarbon
8 Tci =15; // [ degC ] − i n l e t t e m p e r a t u r e o f w a t e r
9 Tco =50; // [ degC ] − o u t l e t t e m p e r t u r e o f w a t e r
10 cp =4184; // [ J / kg ∗K ] − h e a t c a p a c i t y o f w a t e r
11 ch =4184*0.45; // [ J / kg ∗K ] − h e a t c a p a c i t y o f
hydrocarbon
12 wc =1.2; // [ kg / s e c ] − mass f l o w r a t e o f w a t e r

82
13 wh =(( wc * cp ) *( Tco - Tci ) ) /(( ch ) *( Thi - Tho ) ) ;
14 qtotal = wc * cp *( Tco - Tci ) ;
15 // ( a ) − p a r a l l e l d o u b l e p i p e
16 F =1;
17 Thi =120; // [ degC ] − i n l e t t e m p e r a t u r e o f
hydrocarbon
18 Tho =65; // [ degC ] − o u t l e t t e m p e r a t u r e o f
hydrocarbon
19 Tci =15; // [ degC ] − i n l e t t e m p e r a t u r e o f w a t e r
20 Tco =50; // [ degC ] − o u t l e t t e m p e r t u r e o f w a t e r
21 deltaT1 = Thi - Tci ;
22 deltaT2 = Tho - Tco ;
23 LMTD =( deltaT2 - deltaT1 ) /( log ( deltaT2 / deltaT1 ) ) ;
24 Ai = qtotal /(( Ui * LMTD ) ) ;
25 printf ( ” \n\n ( a ) p a r a l l e l d o u b l e p i p e \n Ai = %f mˆ2
” , Ai ) ;
26 // ( b ) − c o u n t e r f l o w
27 F =1;
28 Thi =120; // [ degC ] − i n l e t t e m p e r a t u r e o f
hydrocarbon
29 Tho =65; // [ degC ] − o u t l e t t e m p e r a t u r e o f
hydrocarbon
30 Tco =15; // [ degC ] − i n l e t t e m p e r a t u r e o f w a t e r
31 Tci =50; // [ degC ] − o u t l e t t e m p e r t u r e o f w a t e r
32 deltaT1 = Thi - Tci ;
33 deltaT2 = Tho - Tco ;
34 LMTD =( deltaT2 - deltaT1 ) /( log ( deltaT2 / deltaT1 ) ) ;
35 Ai = qtotal /(( Ui * LMTD ) ) ;
36 printf ( ” \n\n ( b ) c o u n t e r f l o w \n Ai = %f mˆ2 ” , Ai ) ;
37 // ( c ) − 1−2 s h e l l and t u b e
38 Thi =120; // [ degC ] − i n l e t t e m p e r a t u r e o f
hydrocarbon
39 Tho =65; // [ degC ] − o u t l e t t e m p e r a t u r e o f
hydrocarbon
40 Tci =15; // [ degC ] − i n l e t t e m p e r a t u r e o f w a t e r
41 Tco =50; // [ degC ] − o u t l e t t e m p e r t u r e o f w a t e r
42 Z =( Thi - Tho ) /( Tco - Tci ) ;
43 nh =( Tco - Tci ) /( Thi - Tci ) ;

83
44 deltaT1 = Thi - Tco ;
45 deltaT2 = Tho - Tci ;
46 F =0.92;
47 LMTD =( F *( deltaT2 - deltaT1 ) ) /( log ( deltaT2 / deltaT1 ) ) ;
48 Ai = qtotal /(( Ui * LMTD ) ) ;
49 printf ( ” \n\n ( c ) 1−2 s h e l l and t u b e \n Ai = %f mˆ2 ”
, Ai ) ;
50 // ( d ) − 2−4 s h e l l and t u b e
51 Thi =120; // [ degC ] − i n l e t t e m p e r a t u r e o f
hydrocarbon
52 Tho =65; // [ degC ] − o u t l e t t e m p e r a t u r e o f
hydrocarbon
53 Tci =15; // [ degC ] − i n l e t t e m p e r a t u r e o f w a t e r
54 Tco =50; // [ degC ] − o u t l e t t e m p e r t u r e o f w a t e r
55 Z =( Thi - Tho ) /( Tco - Tci ) ;
56 nh =( Tco - Tci ) /( Thi - Tci ) ;
57 F =0.975;
58 LMTD =( F *( deltaT2 - deltaT1 ) ) /( log ( deltaT2 / deltaT1 ) ) ;
59 Ai = qtotal /(( Ui * LMTD ) ) ;
60 printf ( ” \n\n ( d ) 2−4 s h e l l and t u b e \n Ai = %f mˆ2 ”
, Ai ) ;

84
Chapter 12

transport past immersed bodies

Scilab code Exa 12.2 the laminar boundary layer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 2 − pg562 ” ) ;
4 p =1.2047*0.06243; // [ l b / f t ˆ 3 ]
5 mu =(18.17*10^ -6) *(0.6720) ; // [ l b / f t ∗ s e c ]
6 v = mu / p ;
7 x =2; // [ f t ]
8 U =6; // [ f t / s e c ]
9 Nre =( x * U ) / v ;
10 disp ( ” The R e y n o l d s number i s w e l l w i t h i n t h e l a m i n a r
r e g i o n ” ,Nre , ” Nre=” ) ;
11 del =5* x *( Nre ) ^( -1/2) ;
12 C1 =0.33206;
13 Cd =2* C1 *( Nre ) ^( -1/2) ;
14 L2 =2; // [ f t ]
15 L1 =1; // [ f t ]
16 b =1;
17 F =((2*( C1 ) * U * b ) ) *(( mu * p * U ) ^(1/2) ) *((( L2 ) ^(1/2) ) -(( L1
) ^(1/2) ) ) ;
18 gc =32.174;
19 F = F / gc ;

85
20 printf ( ” \n\n The v a l u e o f F p r o p e r l y e x p r e s s e d i n
f o r c e u n i t s i s \n F=%e l b f ” ,F ) ;

Scilab code Exa 12.3 turbulent boundary layer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 3 − pg569 ” ) ;
4 U =3; // [m/ s e c ]
5 x1 =1; // [m]
6 x2 =2; // [m]
7 p =1/(1.001*10^ -3) ; // [ kg /mˆ 3 ] ;
8 mu =1*10^ -3; // [ kg /m∗ s e c ]
9 Nre1 =( x1 * U * p ) /( mu ) ;
10 Nre2 =( x2 * p * U ) /( mu ) ;
11 tauw =(1/2) *( p *( U ^2) ) *((2* log10 ( Nre1 ) -0.65) ^( -2.3) ) ;
12 B =1700;
13 Cd =(0.455*( log10 ( Nre2 ) ) ^ -2.58) -( B /( Nre2 ) ) ;
14 Lb =2.0;
15 F =(1/2) *( p *( U ^2) ) *( Lb ) *( Cd ) ;
16 printf ( ” \n\n t h e d r a g on t h e p l a t e i s \n F = %f kg ∗m
/ s e c ˆ2 = %f N” ,F , F ) ;

Scilab code Exa 12.5 heat and mass transfer during boundary layer flow
past a flat plate

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 5 − pg576 ” ) ;
4 T =290; // [ K ] − t e m p e r a t u r e o f f l o w i n g w a t e r
5 U =3; // [m/ s e c ] − f r e e s t r e a m v e l o c i t y
6 Tfs =285; // [ K ] − t e m p e r a t u r e o f f r e e s t r e a m
7 vr =10^ -3; // [mˆ3/ kg ] − volume p e r u n i t mass

86
8 p =1/ vr ; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r a t T f s
9 mu =1225*10^ -6; // [ N∗ s e c /mˆ 2 ]
10 k =0.590; // [W/m∗K ]
11 Npr =8.70;
12 // ( a ) The l e n g t h o f l a m i n a r boundary
13 Nre =5*10^5;
14 xc =( Nre ) *( mu /( p * U ) ) ;
15 printf ( ” \n\n ( a ) The l e n g t h o f l a m i n a r boundary i s \
n xc = %f m” , xc ) ;
16 // ( b ) T h i c k n e s s o f t h e momentum boundary l a y e r and
t h e r m a l boundary l a y e r
17 del =5* xc *(( Nre ) ^( -1/2) ) ;
18 delh = del *(( Npr ) ^( -1/3) ) ;
19 printf ( ” \n\n ( b ) The t h i c k n e s s o f momentum boundary
l a y e r i s \n d e l = %e m\n The t h i c k n e s s o f t h e
h y d r y o d y n a m i c l a y e r i s \n d e l h = %e m” ,del , delh ) ;
20 // ( c ) L o c a l h e a t t r a n s f e r c o e f f i c i e n t
21 x =0.2042; // [ f t ]
22 hx =((0.33206* k ) /( x ) ) *(( Nre ) ^(1/2) ) *(( Npr ) ^(1/3) ) ;
23 printf ( ” \n\n ( c ) The l o c a l h e a t t r a n s f e r c o e f f i c i e n t
i s \n h = %f W/mˆ2∗K = %f Btu / h r ∗ f t ˆ2∗ degF ” ,hx ,
hx *0.17611) ;
24 // ( d ) Mean h e a t t r a n s f e r c o e f f i c i e n t
25 hm =2* hx ;
26 printf ( ” \n\n ( d ) The mean h e a t t r a n s f e r c o e f f i c i e n t
i s \n h = %f W/mˆ2∗K = %f Btu / h r ∗ f t ˆ2∗ degF ” ,hm , hm
*0.17611) ;

Scilab code Exa 12.10 stokes flow past a sphere

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 0 − pg590 ” ) ;
4 // g i v e n
5 T =293.15; // [ K ]

87
6 pp =999; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r
7 mu =0.01817*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y o f a i r
8 p =1.205; // [ kg /mˆ 3 ] − d e n s i t y o f a i r
9 d =5*10^ -6; // [m] − p a r t i c l e d i a m e t e r
10 g =9.80; // [m/ s e c ˆ 2 ]
11 rp = d /2;
12 Ut =((2* g *( rp ^2) ) *( pp - p ) ) /(9* mu ) ;
13 Nre =( d * Ut * p ) /( mu ) ;
14 // c l e a r l y t h e f l o w i s i n t h e s t o k e s law r e g i o n a t
t h i s low r e y n o l d s number ; t h e r e f o r e , t h e d r a g
force is
15 Fp =6* %pi * mu * rp * Ut ;
16 printf ( ” \n\n The d r a g f o r c e i s \n Fp = %e N” , Fp ) ;

Scilab code Exa 12.11 drag coefficient correlations

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 1 − pg591 ” ) ;
4 // g i v e n
5 T =293.15; // [ K ]
6 pp =999; // [ kg /mˆ 3 ] − d e n s i t y o f w a t e r
7 mu =0.01817*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y o f a i r
8 p =1.205; // [ kg /mˆ 3 ] − d e n s i t y o f a i r
9 d =5*10^ -6; // [m] − p a r t i c l e d i a m e t e r
10 g =9.80; // [m/ s e c ˆ 2 ]
11 rp = d /2;
12 Ut =((2* g *( rp ^2) ) *( pp - p ) ) /(9* mu ) ;
13 Nre =( d * Ut * p ) /( mu ) ;
14 t =(( -2*( rp ^2) * pp ) ) /(9* mu ) *( log (1 -0.99) ) ;
15 printf ( ” \n\n Time f o r t h e d r o p o f w a t e r i n p r e v i o u s
e x a m p l e from an i n i t i a l v e l o c i t y o f z e r o t o 0 . 9 9 ∗
Ut i s \n t = %e s e c ” ,t ) ;
16 printf ( ” \n\n I n o t h e r words , t h e d r o p a c c e l e r a t e s
almost i n s t a n t a n e o u s l y to i t s terminal v e l o c i t y ”)

88
;

Scilab code Exa 12.12 drag coefficient correlations

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 2 − pg 594 ” ) ;
4 // g i v e n
5 pp =1.13*10^4; // [ kg /mˆ 3 ] − d e n s i t y o f l e a d p a r t i c l e
6 p =1.22; // [ kg /mˆ 3 ] − d e n s i t y o f a i r
7 g =9.80; // [m/ s e c ˆ 2 ] − a c c e l e r a t i o n due t o g r a v i t y
8 d =2*10^ -3; // [m] − d i a m e t e r o f p a r t i c l e
9 mu =1.81*10^ -5; // [ kg /m∗ s e c ] − v i s c o s i t y o f a i r
10 // l e t u s assume
11 Cd =0.44;
12 Ut =((4* d * g *( pp - p ) ) /(3* p * Cd ) ) ^(1/2) ;
13 disp ( Ut )
14 Nre =( Ut * d * p ) /( mu ) ;
15 // from f i g 1 2 , 1 6 v a l u e o f Cd i s
16 Cd =0.4;
17 Ut =((4* d * g *( pp - p ) ) /(3* p * Cd ) ) ^(1/2) ;
18 Nre =( Ut * d * p ) /( mu ) ;
19 // Within t h e r e a d i b i l i t y o f t h e c h a r t Cd i s
unchanged and t h e r e f o r e t h e a b o v e o b t a i n e d Cd i s
the f i n a l answer
20 printf ( ” \n\n The t e r m i n a l v e l o c i t y i s \n Ut = %f m/
s e c ” , Ut ) ;

Scilab code Exa 12.13 drag coefficient correlations

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 3 − pg595 ” ) ;

89
4 // g i v e n
5 distance =1/12; // [ f t ]
6 time =60; // [ s e c ]
7 Ut = distance / time ;
8 mu =1.68; // [ l b / f t ∗ s e c ] − v i s c o s i t y
9 pp =58; // [ l b / f t ˆ 3 ] − d e n s i t y o f s p h e r e
10 p =50; // [ l b / f t ˆ 3 ] − d e n s i t y o f p o l y m e r s o l u t i o n
11 g =32; // [ f t / s e c ] − a c c e l e r a t i o n due t o g r a v i t y
12 rp =((9* mu ) *( Ut ) *((2* g ) ^( -1) ) *(( pp - p ) ^( -1) ) ) ^(1/2) ;
13 printf ( ” \n\n The r e q u i r e d p a r t i c l e d i a m e t e r would be
a b o u t %f i n c h ” , rp *2*12) ;
14 Nre =( rp *2* Ut * p ) /( mu ) ;
15 disp ( Nre , ” Nre=” ) ;
16 printf ( ” \n\n T h i s r e y n o l d s number i s w e l l w i t h i n t h e
s t o k e s law r e g i o n ; t h u s t h e d e s i g n i s
r e a s o n a b l e ”);

Scilab code Exa 12.14 liquid solid fluidization

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 4 − pg616 ” ) ;
4 // g i v e n
5 T =842; // [ degF ] − t e m p e r a t u r e
6 P =14.6; // [ p s i a ] − p r e s s u r e
7 p =0.487; // [ kg /mˆ 3 ] − d e n s i t y o f a i r
8 mu =3.431*10^ -5; // [ kg /m∗ s e c ] − v i s c o s i t y o f a i r
9 k =0.05379; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y
10 Npr =0.7025; // p r a n d t l no .
11 // ( a ) s t a t i c v o i d f r a c t i o n
12 mcoal =15*2000; // [ l b ] − mass o f c o a l
13 pcoal =94; // [ lbm / f t ˆ 3 ] − d e n s i t y o f c o a l
14 d =10; // [ f t ]
15 L =7; // [ f t ]
16 area =(( %pi *( d ^2) ) /4) ;

90
17 Vcoal = mcoal / pcoal ;
18 Vtotal = area * L ;
19 e =( Vtotal - Vcoal ) /( Vtotal ) ;
20 disp (e , ” ( a ) The v o i d f r a c t i o n i s E=” ) ;
21 // ( b ) minimum v o i d f r a c t i o n and bed h e i g h t
22 d =200; // [ um ] − p a r t i c l e d i a m e t e r
23 Emf =1 -0.356*(( log10 ( d ) ) -1) ;
24 // t h i s v a l u e s e e m s t o be a l o t t l e low and t h e r e f o r e
0 . 5 8 w i l l be u s e d
25 Emf =0.58;
26 Lmf =(( L ) *(1 - e ) ) /(1 - Emf ) ;
27 printf ( ” \n\n ( b ) The bed h e i g h t i s \n Lmf = %f f t ” ,
Lmf ) ;
28 // ( c ) Minimum f l u i d i z a t i o n v e l o c i t y
29 P1 =20; // [ p s i a ]
30 P2 =14.696; // [ p s i a ]
31 p1 =( p * P1 ) /( P2 ) ;
32 // t h e a r c h i m i d e s no . i s
33 g =9.78; // [m/ s e c ˆ 2 ]
34 Nar = p1 * g *(( d *10^ -6) ^3) *(1506 - p1 ) *((1/( mu ) ^2) ) ;
35 C1 =27.2;
36 C2 =0.0408;
37 Nremf =((( C1 ^2) + C2 * Nar ) ^(1/2) ) - C1 ;
38 Umf =( Nremf * mu ) /(( d *10^ -6) * p1 ) ;
39 printf ( ” \n\n ( c ) The minimum f l u i d i z a t i o n v e l o c i t y
i s \n Umf = %f m/ s e c ” , Umf ) ;
40 // ( d ) Minimum p r e s s u r e
41 deltapmf =(1506 - p1 ) *( g ) *(1 - Emf ) *(( Lmf *12*2.54) /(100) )
+ p1 * g * Lmf ;
42 printf ( ” \n\n ( c ) The minimum p r e s s u r e d r o p f o r
f l u i d i z a t i o n i s \n −d e l t a p m f = %e Pa” , deltapmf ) ;
43 // ( e ) P a r t i c l e s e t t l i n g v e l o c i t y
44 Cd =0.44;
45 Ut =(((8*(( d *10^ -6) /2) * g ) *(1506 - p1 ) ) /(3* p1 * Cd ) ) ^(1/2)
;
46 Nrep =( Ut * d *10^ -6* p1 ) /( mu ) ;
47 disp ( Nrep , ” Nrep=” ) ;
48 // c l e a r l y a t t h e p o i n t o f minimum v e l o c i t y f o r f a s t

91
f l u i d i z a t i o n , the terminal s e t t l i n g v e l o c i t y i s
n o t i n t h e r a n g e o f Newtons law . T h e r e f o r e t h e eq
. f o r t h e t r a n s i t i o n r e g i o n w i l l be t r i e d
49 Ut =((5.923/18.5) *((( d *10^ -6) * p1 ) /( mu ) ) ^(0.6) )
^(1/(2 -0.6) )
50 printf ( ” \n\n ( e ) The p a r t i c l e s e t t l i n g v e l o c i t y i s \
n Ut = %f m/ s e c ” , Ut ) ;
51 // ( f ) Bed t o w a l l h e a t t r a n s f e r c o e f f i c i e n t
52 Nrefb =( d *10^ -6) *2.5* Umf * p1 *(1/ mu ) ;
53 Nnufb =0.6* Npr *(( Nrefb ) ^(0.3) ) ;
54 hw = Nnufb *( k /( d *10^ -6) ) ;
55 printf ( ” \n\n ( f ) The bed t o w a l l h e a t t r a n s f e r
c o e f f i c i e n t i s \n hw = %f W/mˆ2∗K” , hw ) ;

Scilab code Exa 12.15 liquid solid fluidization

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 5 − pg618 ” ) ;
4 // g i v e n
5 pp =249.6; // [ l b / f t ˆ 3 ] − d e n s i t y o f c a t a l y s t
6 p =58; // [ l b / f t ˆ 3 ] − d e n s i t y o f l i q u i d
7 g =32.174; // [ f t / s e c ˆ 2 ]
8 gc =32.174;
9 Lmf =5; // [ f t ] − h e i g h t o f bed
10 mu =6.72*10^ -3; // [ lbm / f t ∗ s e c ] − v i s c o s i t y o f l i q u i d
11 dp =0.0157/12; // [ f t ] − d i a m e t e r o f p a r t i c l e
12 emf =0.45;
13 deltapmf =( pp - p ) *( g / gc ) *(1 - emf ) *( Lmf ) ;
14 Nar =( p * g * dp ^3) *( pp - p ) *(1/( mu ) ^2) ;
15 C1 =27.2;
16 C2 =0.0408;
17 Nremf =((( C1 ^2) + C2 * Nar ) ^(1/2) ) - C1 ;
18 Umf = Nremf *( mu /( dp * p ) ) ;
19 printf ( ” \n\n Minimum f l u i d i z a t i o n v e l o c i t y i s \n Umf

92
= %e f t / s e c ” , Umf ) ;

Scilab code Exa 12.16 single cyclinder heat transfer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 6 − pg624 ” ) ;
4 // g i v e n
5 d =24*10^ -6; // [m] − d i a m e t e r o f w i r e
6 T =415; // [ K ] − o p e r a t i n g t e m p e r a t u r e o f h o t w i r e
anemometer
7 P =0.1; // [W] − power c o n s u m p t i o n
8 L =250* d ;
9 Tair =385; // [ K ] − t e m p e r a t u r e o f a i r i n d u c t
10 A = %pi * d * L ;
11 Tfilm =( T + Tair ) /2;
12 // p r o p e r t i e s o f a i r a t T f i l m
13 p =0.8825; // [ kg /mˆ 3 ]
14 mu =2.294*10^ -5; // [ kg /m∗ s ]
15 cpf =1013; // [ J ∗ kg /K ]
16 kf =0.03305; // [W/m∗K ]
17 Npr =0.703;
18 h = P /( A *( T - Tair ) ) ;
19 Nnu =( h * d ) / kf ;
20 function y = func ( x )
21 y = Nnu -0.3 -((0.62*( x ^(1/2) ) *( Npr ^(1/3) ) )
/((1+((0.4/ Npr ) ^(2/3) ) ) ^(1/4) ) ) *((1+(( x
/(2.82*(10^5) ) ) ^(5/8) ) ) ^(4/5) ) ;
22 endfunction
23 // on s o l v i n g t h e a b o v e f u n c t i o n f o r x by u s i n g some
r o o t s o l v e r t e c h n i q u e l i k e Newton r a p h s o n method
, we g e t
24 x =107.7;
25 // o r
26 Nre =107.7;

93
27 y = func ( x ) ;
28 Um =( Nre * mu ) /( d * p ) ;
29 printf ( ” \n\n The v e l o c i t y i s \n Um = %f m/ s e c = %f
f t / s e c ” ,Um , Um *3.28) ;

Scilab code Exa 12.17 single cyclinder heat transfer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 2 . 1 7 − pg630 ” ) ;
4 // g i v e n
5 dt =0.75;
6 St =1.5* dt ;
7 Sl =3* dt ;
8 Lw =1; // [m]
9 N =12;
10 Stotalarea = N *( St /12) * Lw ;
11 Sminarea = N *(( St - dt ) /12) * Lw *0.3048;
12 // p r o p e r t i e s o f a i r a t 2 9 3 . 1 5 K
13 p =1.204; // [ kg /mˆ 3 ]
14 mu =1.818*10^ -5; // [ kg /m∗ s ]
15 cp =1005; // [ J ∗ kg /K ] ;
16 k =0.02560; // [ J / s ∗m∗K ]
17 Npr =( cp * mu ) / k ;
18 U_inf =7; // [m/ s e c ]
19 Umax = U_inf *( St /( St - dt ) ) ;
20 w = p * Umax * Sminarea ;
21 C_tubes =0.05983; // [mˆ2/m] − c i r c u m f e r e n c e o f t h e
tubes
22 N_tubes =96;
23 Atubes = N_tubes * C_tubes * Lw ;
24 Tw =328.15; // [ K ]
25 Tinf =293.15; // [ K ]
26 Tin =293.15; // [ K ]
27 Tout =293.15; // [ K ]

94
28 u =100;
29 while u >10^ -1
30 T =( Tin + Tout ) /2
31 Told = Tout ;
32 p = -(0.208*(10^ -3) ) +(353.044/ T ) ;
33 mu = -(9.810*(10^ -6) ) +(1.6347*(10^ -6) *( T ^(1/2) ) ) ;
34 cp =989.85+(0.05* T ) ;
35 k =0.003975+7.378*(10^ -5) * T ;
36 Npr =( cp * mu ) / k ;
37 dt =0.75*0.0254;
38 Gmax = w / Sminarea ;
39 Nre =( dt * Gmax ) / mu ;
40 h =0.27*( k / dt ) *( Npr ^0.36) *( Nre ^0.63) ;
41 h = h *0.98;
42 deltaT =( h * Atubes *( Tw - Tinf ) ) /( w * cp ) ;
43 Tout = Tin + deltaT ;
44 u = abs ( Tout - Told ) ;
45 end
46 T =( Tin + Tout ) /2
47 p = -(0.208*(10^ -3) ) +(353.044/ T ) ;
48 mu = -(9.810*(10^ -6) ) +(1.6347*(10^ -6) *( T ^(1/2) ) ) ;
49 dt =0.75;
50 dv =(4*( St * Sl -( %pi *( dt ^2) *(1/4) ) ) ) /( %pi * dt )
*(0.09010/3.547) ;
51 de = dv ;
52 Nre =( dv *24.72) / mu ;
53 dv = dv /(0.09010/3.547) ;
54 ftb =1.92*( Nre ^( -0.145) ) ;
55 Zt = Sl ;
56 Ltb =8* Sl ;
57 deltap =( ftb *(24.72^2) ) /(2* p *( dv / Ltb ) *(( St / dv ) ^0.4)
*(( St / Zt ) ^0.6) ) ;
58 printf ( ” \n\n −d e l t a p = %f kg /m∗ s = %f N/mˆ2 = %f
p s i a ” , deltap , deltap , deltap *(0.1614/1113) ) ;

95
Chapter 13

unsteady state transport

Scilab code Exa 13.1 heat transfer with negligible internal resistance

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 3 . 1 − pg651 ” ) ;
4 // g i v e n
5 h =12; // [W/mˆ2∗K ] − h e a t t r a n s f e r c o e f f i c e i n t
6 k =400; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y
7 // ( a ) f o r s p h e r e
8 r =5*10^ -2; // [m] − r a d i u s o f c o p p e r s p h e r e
9 Lc =((4* %pi *(( r ) ^3) ) /3) /(4* %pi *(( r ) ^2) ) ;
10 Nbi = h * Lc *(1/ k ) ;
11 printf ( ” \n\n ( a ) The b i o t no . i s \n Nbi = %e” , Nbi ) ;
12 // ( b ) f o r c y c l i n d e r
13 r =0.05; // [m] − r a d i u s o f c y c l i n d e r
14 L =0.3; // [m] − h e i g h t o f c y c l i n d e r
15 Lc =( %pi *(( r ) ^2) * L ) /(2* %pi * r * L ) ;
16 Nbi = h * Lc *(1/ k ) ;
17 printf ( ” \n\n ( b ) The b i o t no . i s \n Nbi = %e” , Nbi ) ;
18 // ( c ) f o r a l o n g s q u a r e r o d
19 L =.4; // [m] − l e n g t h o f c o p p e r r o d
20 r =0.05; // [m] − r a d i u s o f a c y c l i n d e r havimg same
c r o s s s e c t i o n a l area as that of square

96
21 x =(( %pi * r ^2) ^(1/2) ) ;
22 Lc =(( x ^2) * L ) /(4* x * L ) ;
23 Nbi = h * Lc *(1/ k ) ;
24 printf ( ” \n\n ( c ) The b i o t no . i s \n Nbi = %e” , Nbi ) ;

Scilab code Exa 13.6 generalized chart solution for finite slab and cyclin-
der

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 3 6 − pg684 ” ) ;
4 // g i v e n
5 d =1*0.0254; // [m]
6 Lr = d /2; // [m ] ;
7 Lz =(1.2/2) *(0.0254) ;
8 x = Lz ;
9 r = Lr ;
10 k =0.481;
11 h =20;
12 mr = k /( h * Lr ) ;
13 mz = k /( h * Lz ) ;
14 nr = r / Lr ;
15 nz = x / Lz ;
16 t =1.2; // [ s e c ]
17 alpha =1.454*10^ -4;
18 Xr =( alpha * t ) /( Lr ^2) ;
19 Xz =( alpha * t ) /( Lz ^2) ;
20 // u s i n g t h e a b o v e v a l u e o f m, n , X t h e v a l u e f o r Ycz
and Ycr from f i g 1 3 . 1 4 i s
21 Ycr =0.42;
22 Ycz =0.75;
23 Yc = Ycr * Ycz ;
24 T_infinity =400; // [ K ]
25 To =295;
26 Tc = T_infinity -( Yc *( T_infinity - To ) ) ;

97
27 printf ( ” \n\n The t e m p e r a t u r e t t h e c e n t r e i s \n Tc =
%f K” , Tc ) ;

Scilab code Exa 13.7 generalized chart solution for finite slab and cyclin-
der

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 3 7 − pg684 ” ) ;
4 // g i v e n
5 T_x0 =300; // [ K ]
6 Tw =400; // [ K ]
7 L =0.013; // [m]
8 alpha =2.476*(10^ -5) ; // [mˆ/ s e c ]
9 h =600; // [W/mˆ2∗K ]
10 pcp =3.393*(10^6) ; // [ J /mˆ3∗K ]
11 L =0.013; // [m]
12 deltax = L /10;
13 betaa =0.5;
14 deltat =0.03;
15 deltat = betaa *(( deltax ) ^2) *(1/ alpha ) ;
16 T_infinity =400; // [ K ]
17 // t o be s u r e t h a t t h e s o l u t i o n i s s t a b l e , i t is
c u s t o m a r y t o t r u n c a t e t h i s number
18 deltat =0.03; // [ s e c ]
19 // b e t a a=a l p h a ∗ d e l t a t ∗ ( ( 1 / d e l t a x ) ˆ 2 ) ;
20 for i =1:11
21 Told ( i ) =300;
22 end
23 a =((2* h * deltat ) /( pcp * deltax ) ) ;
24 b =((2* alpha * deltat ) /( pcp *(( deltax ) ^2) ) ) ;
25 for j =1:11
26 Tnew (1) =( T_infinity *0.08162) +( Told (1)
*(1 -0.08162 -0.8791) ) +( Told (2) *0.8791)
27 for k =1:9

98
28 Tnew ( k +1) =( betaa * Told ( k +2) ) +((1 -2* betaa ) *( Told ( k
+1) ) ) +( betaa * Told ( k ) ) ;
29 end
30 Tnew (11) =((2* betaa ) *( Told (10) ) )
31 Told = Tnew ;
32 end
33 disp ( Told ) ;

Scilab code Exa 13.9 semi infinite slab

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 13 9 − pg700 ” ) ;
4 // g i v e n
5 p =2050; // [ kg /mˆ 3 ] − d e n s i t y o f s o i l
6 cp =1840; // [ J / kg ∗K ] − h e a t c p a p a c i t y o f s o i l
7 k =0.52; // [W/m∗K ] − t h e r m a l c o n d u c t i v i t y o f s o i l
8 alpha =0.138*10^ -6; // [mˆ2/ s e c ]
9 t =4*30*24*3600; // [ s e c ] − no . o f s e c o n d s i n 4
months
10 Tx = -5; // [ degC ]
11 Tinf = -20; // [ degC ]
12 T0 =20; // [ degC ]
13 // from t h e f i g 1 3 . 2 4 t h e d i m e n s i o n l e s s d i s t a n c e Z
is
14 Z =0.46;
15 // t h e n t h e d e p t h i s
16 x =2*(( alpha * t ) ^(1/2) ) * Z
17 printf ( ” \n\n t h e d e p t h i s \n x = %f m = %f f t ” ,x , x
*(3.6/1.10) ) ;

Scilab code Exa 13.10 cyclinder

99
1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 3 . 1 0 − pg701 ” ) ;
4 // g i v e n
5 d =0.01; // [m] − d i a m e t e r o f c y c l i n d r i c a l porous
plug
6 D =2*10^ -9; // [mˆ2/ s e c ] − d i f f u s i o n c o e f f i c i e n t
7 t =60*60; // [ s e c ]
8 r = d /2;
9 m =0;
10 Ca_inf =0;
11 Ca_0 =10;
12 X =( D * t ) /(( r ) ^2) ;
13 // from f i g 1 3 . 1 4 t h e o r d i n a t e i s
14 Y =0.7;
15 Ca_c = Ca_inf - Y *( Ca_inf - Ca_0 ) ;
16 printf ( ” \n\n t h e c o n c e n t r a t i o n o f KCL a t t h e c e n t r e
a f t e r 60 min i s \n Ca = %f kg /mˆ3 ” , Ca_c ) ;

100
Chapter 14

estimation of transport
coefficients

Scilab code Exa 14.1 kinetic theory of gases

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 1 − pg726 ” ) ;
4 // g i v e n
5 T =40+273.15; // [ K ] − t e m p e r a t u r e
6 P =1; // [ atm ] − p r e s s u r e
7 sigma =3.711*10^ -10; // [m]
8 etadivkb =78.6; // [ K ]
9 A =1.16145;
10 B =0.14874;
11 C =0.52487;
12 D =0.77320;
13 E =2.16178;
14 F =2.43787;
15 Tstar = T /( etadivkb ) ;
16 // u s i n g t h e f o r m u l a s i =(A/ ( T s t a r ˆB) ) +(C/ exp (D∗ T s t a r
) ) +(E/ exp ( F∗ T s t a r )
17 si =( A /( Tstar ^ B ) ) +( C / exp ( D * Tstar ) ) +( E / exp ( F * Tstar ) ) ;
18 M =28.966; // [ kg / mole ] − m o l e c u l a r w e i g h t

101
19 // u s i n g t h e f o r m u l a mu= ( 2 . 6 6 9 3 ∗ ( 1 0 ˆ − 2 6 ) ) ∗ ( ( (M∗T)
ˆ ( 1 / 2 ) ) / ( ( sigma ˆ2) ∗ s i ) )
20 mu =(2.6693*(10^ -26) ) *((( M * T ) ^(1/2) ) /(( sigma ^2) * si ) ) ;
21 printf ( ” \n\n The v i s c o s i t y o f a i r i s \n mu=%eNs/mˆ2=
%fcp ” ,mu , mu *10^3) ;

Scilab code Exa 14.2 non uniform gas theory

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 2 . s c e − pg726 ” ) ;
4 T =40+273.15; // [ K ] − t e m p e r a t u r e
5 P =1; // [ atm ] − p r e s s u r e
6 // t h e r m a l c o n d u c t i v i t o f a i r
7 sigma =3.711*10^ -10; // [m]
8 etadivkb =78.6; // [ K ]
9 A =1.16145;
10 B =0.14874;
11 C =0.52487;
12 D =0.77320;
13 E =2.16178;
14 F =2.43787;
15 Tstar = T /( etadivkb ) ;
16 // u s i n g t h e f o r m u l a s i =(A/ ( T s t a r ˆB) ) +(C/ exp (D∗ T s t a r
) ) +(E/ exp ( F∗ T s t a r )
17 si =( A /( Tstar ^ B ) ) +( C / exp ( D * Tstar ) ) +( E / exp ( F * Tstar ) ) ;
18 // u s i n g t h e f o r m u l a K= ( 8 . 3 2 2 4 ∗ ( 1 0 ˆ − 2 2 ) ) ∗ ( ( ( T/M)
ˆ ( 1 / 2 ) ) / ( ( sigma ˆ2) ∗ s i ) )
19 M =28.966; // [ kg / mole ] − m o l e c u l a r w e i g h t o f a i r
20 k =(8.3224*(10^ -22) ) *((( T / M ) ^(1/2) ) /(( sigma ^2) * si ) ) ;
21 printf ( ” \n\n Thermal c o n d u c t i v i t y o f a i r i s \n k=%fW
/m∗K” ,k ) ;
22 printf ( ” \n\n Agreement b e t w e e n t h i s v a l u e and
o r i g i n a l v a l u e i s p [ o o r ; t h e Chapman−Enskog t h e o r y
i s i n e r r e o when a p p l i e d t o t h e r m a l c o n d u c t i v i t y

102
o f po ly a to mi c g a s e s ”);
23 // t h e r m a l c o n d u c t i v i t y o f a r g o n
24 sigma =3.542*10^ -10; // [m]
25 etadivkb =93.3; // [ K ]
26 A =1.16145;
27 B =0.14874;
28 C =0.52487;
29 D =0.77320;
30 E =2.16178;
31 F =2.43787;
32 Tstar = T /( etadivkb ) ;
33 // u s i n g t h e f o r m u l a s i =(A/ ( T s t a r ˆB) ) +(C/ exp (D∗ T s t a r
) ) +(E/ exp ( F∗ T s t a r )
34 si =( A /( Tstar ^ B ) ) +( C / exp ( D * Tstar ) ) +( E / exp ( F * Tstar ) ) ;
35 // u s i n g t h e f o r m u l a K= ( 8 . 3 2 2 4 ∗ ( 1 0 ˆ − 2 2 ) ) ∗ ( ( ( T/M)
ˆ ( 1 / 2 ) ) / ( ( sigma ˆ2) ∗ s i ) )
36 M =39.948; // [ kg / mole ] − m o l e c u l a r w e i g h t o f a r g o n
37 k =(8.3224*(10^ -22) ) *((( T / M ) ^(1/2) ) /(( sigma ^2) * si ) ) ;
38 printf ( ” \n\n Thermal c o n d u c t i v i t y o f a r g o n i s \n k=
%fW/m∗K” ,k ) ;
39 printf ( ” \n\n The t h e r m a l c o n d u c t i v i t y from Chapman−
Enskog t h e o r y a g r e e s c l o s e l y w i t h t h e
experimental value of 0 . 0 1 8 5 ; note that argon i s
a monoatomic g a s ” ) ;

Scilab code Exa 14.3 non uniform gas theory

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 3 − pg727 ” ) ;
4 T =40+273.15; // [ K ] − t e m p e r a t u r e
5 P =1; // [ atm ] − p r e s s u r e
6 Cp =1005; // [ J / kg ∗K ] − h e a t c a p a c i t y
7 M =28.966; // [ kg / mole ] − m o l e c u l a r w e i g h t
8 R =8314.3; // [ atm∗mˆ3/K∗ mole ] − g a s c o n s t a n t

103
9 // u s i n g t h e f o r m u l a Cv=Cp−R/M
10 Cv = Cp - R / M ;
11 y = Cp / Cv ;
12 mu =19.11*10^ -6; // [ kg /m∗ s e c ] − v i s c o s i t y o f a i r
13 // u s i n g t h e o r i g i n a l Eucken c o r r e l a t i o n
14 k_original = mu *( Cp +(5/4) *( R / M ) ) ;
15 printf ( ” \n\n From t h e o r i g i n a l Eucken c o r r e l a t i o n \n
k=%fW/m∗K” , k_original ) ;
16 // u s i n g t h e m o d i f i e d Eucken c o r r e l a t i o n
17 k_modified = mu *(1.32*( Cp / y ) +(1.4728*10^4) / M ) ;
18 printf ( ” \n\n From t h e m o d i f i e d Eucken c o r r e l a t i o n \n
k=%fW/m∗K” , k_modified ) ;
19 printf ( ” \n\n As d i s c u s s e d , t h e v a l u e from t h e
m o d i f i e d Eucken e q u a t i o n i s h i g h r e t h a n t h e
e x p e r i m e n t a l v a l u e ( 0 . 0 2 7 0 9 ) , and t h e v a l u e
p r e d i c t e d by t h e o r i g i n a l Eucken e q u a t i o n i s
l o w e r than the e x p e r i m e n t a l v a l u e , each b e i n g
about 3 p e r c e n t d i f f e r e n t , i n t h i s c a s e ”);

Scilab code Exa 14.4 non uniform gas theory

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 4 − pg728 ” ) ;
4 // g i v e n
5 D =7.66*10^ -5; // [mˆ2/ s e c ] − d i f f u s i o n coefficient
of the helium n i t r o g e n
6 P =1; // [ atm ] − p r e s s u r e
7 // ( a ) u s i n g t h e Chapman−Enskog
8 T (1) =323; // [ K ]
9 T (2) =413; // [ K ]
10 T (3) =600; // [ K ]
11 T (4) =900; // [ K ]
12 T (5) =1200; // [ K ]
13 Ma =4.0026;

104
14 sigma_a =2.551*10^ -10; // [m]
15 etaabykb =10.22; // [ K ]
16 Mb =28.016;
17 sigma_b =3.798*10^ -10; // [m]
18 etabbykb =71.4; // [ K ]
19 sigma_ab =(1/2) *( sigma_a + sigma_b ) ;
20 etaabbykb =( etaabykb * etabbykb ) ^(1/2) ;
21 Tstar = T /( etaabbykb ) ;
22 siD =[0 .720 5;0. 692 9;0. 6535 ;0.6 134 ;0.5 865] ;
23 patm =1;
24 // u s i n g t h e f o r m u l a Dab = 1 . 8 5 8 3 ∗ 1 0 ˆ − 2 7 ∗ ( ( (Tˆ 3 ) ∗ ( ( 1 /
Ma) +(1/Mb) ) ) ˆ ( 1 / 2 ) ) / ( patm ∗ s i g m a a b ∗ s i D )
25 Dab =(1.8583*(10^ -(27) ) *((( T ^3) *((1/ Ma ) +(1/ Mb ) ) )
^(1/2) ) ) /( patm *( sigma_ab ^(2) ) * siD )
26 printf ( ” \n\n ( a ) ” ) ;
27 for i =1:5;
28 printf ( ” \n a t T=%fK ; Dab=%emˆ2/ s e c ” ,T ( i ) , Dab ( i ) ) ;
29 end
30 // ( b ) u s i n g e x p e r i m e n t a l d i f f u s i o n c o e f f i c i e n t and
Chapman−Enskog e q u a t i o n
31 for i =1:4
32 D ( i +1) = D (1) *(( T ( i +1) / T (1) ) ^(3/2) ) *( siD (1) /( siD ( i
+1) ) ) ;
33 end
34 printf ( ” \n\n ( b ) ” ) ;
35 for i =1:5;
36 printf ( ” \n a t T=%fK ; Dab=%emˆ2/ s e c ” ,T ( i ) , Dab ( i ) ) ;
37 end
38 // ( c )
39 for i =1:4
40 Dab ( i +1) = D (1) *( T ( i +1) / T (1) ) ^(1.75) ;
41 end
42 printf ( ” \n\n ( c ) ” ) ;
43 for i =1:5;
44 printf ( ” \n a t T=%fK ; Dab=%emˆ2/ s e c ” ,T ( i ) , Dab ( i ) ) ;
45 end

105
Scilab code Exa 14.5 non uniform gas theory

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 5 − pg730 ” ) ;
4 // g i v e n
5 T =323; // [ K ] − t e m p e r a t u r e
6 P =1; // [ atm ] − p r e s s u r e
7 Dab_experimental =7.7*10^ -6; // [mˆ2/ s e c ]
8 DPM_A =1.9; // d i p o l e moment o f m e t h y l c h l o r i d e
9 DPM_B =1.6; // d i p o l e moment o f s u l p h u r d i o x i d e
10 Vb_A =5.06*10^ -2; // l i q u i d m o l a r volume o f m e t h y l
chloride
11 Vb_B =4.38*10^ -2
12 Tb_A =249; // n o r m a l b o i l i n g p o i n t o f m e t h y l
chloride
13 Tb_B =263; // n o r m a l b o i l i n g p o i n t o f s u l p h u r
dioxide
14 del_A =((1.94) *( DPM_A ) ^2) /( Vb_A * Tb_A ) ;
15 del_B =((1.94) *( DPM_B ) ^2) /( Vb_B * Tb_B ) ;
16 del_AB =( del_A * del_B ) ^(1/2) ;
17 sigma_A =(1.166*10^ -9) *((( Vb_A ) /(1+1.3*( del_A ) ^2) )
^(1/3) ) ;
18 sigma_B =(1.166*10^ -9) *((( Vb_B ) /(1+1.3*( del_B ) ^2) )
^(1/3) ) ;
19 etaabykb =(1.18) *(1+1.3*( del_A ^2) ) *( Tb_A ) ;
20 etabbykb =(1.18) *(1+1.3*( del_B ^2) ) *( Tb_B ) ;
21 sigma_AB =(1/2) *( sigma_A + sigma_B ) ;
22 etaabbykb =( etaabykb * etabbykb ) ^(1/2) ;
23 Tstar = T /( etaabbykb ) ;
24 sigmaDnonpolar =1.602;
25 sigmaDpolar = sigmaDnonpolar +(0.19*( del_AB ^2) ) / Tstar ;
26 patm =1;
27 Ma =50.488; // [ kg / mole ] − m o l e c u l a r w e i g h t o f m e t h y l

106
chloride
28 Mb =64.063; // [ kg / mole ] − m o l e c u l a r w e i g h t o f
sulphur dioxide
29 D_AB =(1.8583*(10^ -(27) ) *((( T ^3) *((1/ Ma ) +(1/ Mb ) ) )
^(1/2) ) ) /( patm *( sigma_AB ^(2) ) * sigmaDpolar ) ;
30 printf ( ” \n\n Dab=%emˆ2/ s e c ” , D_AB ) ;
31 printf ( ” \n\n The Chapman Enskog p r e d i c t i o n i s a b o u t
8 p e r c e n t h i g h e r ”);

Scilab code Exa 14.6 empirical correlations for gases

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 6 − pg732 ” ) ;
4 // g i v e n
5 T =423.2; // [ K ] − t e m p e r a t u r e
6 P =5; // [ atm ] − p r e s s u r e
7 Ma =4.0026; // [ kg / mole ] − m o l e c u l a r w e i g h t o f h e l i u m
8 Mb =60.09121; // [ kg / mole ] − m o l e c u l a r w e i g h t o f
propanol
9 Dab_experimental =1.352*10^ -5; // [mˆ2/ s e c ] −
experimental value of d i f f u s i o n c o e f f i c i e n t of
h e l i u m −p r o p o n a l s y s t e m
10 // t h e d i f f u s i o n v o l u m e s f o r c a r b o n , h y d r o g e n and
oxygen are −
11 Vc =16.5;
12 Vh =1.98;
13 Vo =5.48;
14 V_A =3* Vc +8* Vh + Vo ;
15 V_B =2.88;
16 patm =5;
17 // u s i n g t h e FSG c o r r e l a t i o n
18 Dab =(10^ -7) *((( T ^1.75) *((1/ Ma ) +(1/ Mb ) ) ^(1/2) ) /( patm
*(( V_A ) ^(1/3) +( V_B ) ^(1/3) ) ^2) ) ;
19 printf ( ” \n\n Dab=%emˆ2/ s e c ” , Dab ) ;

107
20 printf ( ” \n\n The FSG c o r r e l a t i o n a g r e e s t o a b o u t 2
p e r c e n t with the e x p e r i m e n t a l v a l u e ”);

Scilab code Exa 14.7 viscosity

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 7 − pg736 ” ) ;
4 // g i v e n
5 beta0 = -6.301289;
6 beta1 =1853.374;
7 clf ;
8 xtitle ( ” T e m p e r a t u r e v a r i a t i o n o f t h e viscosity of
w a t e r ” ,” ( 1 /T) ∗ 1 0 ˆ 3 ,Kˆ−1” ,” v i s c o s i t y , cP ” ) ;
9 x =[2.2 ,0.2 ,3.8] ’;
10 y =[( beta0 + beta1 * x ) ];
11 plot2d (x , y ) ;
12 // a t T=420;
13 T =420; // [ K ]
14 x =1/ T ;
15 y = beta0 + beta1 * x ;
16 mu = exp ( y ) ;
17 printf ( ” \n\n mu=%fcP ” , mu ) ;
18 printf ( ” \n\n The e r r o r i s s e e n t o be 18 p e r c e n t . AT
m i d r a n g e 3 2 0 (K) , t h e e r r o r i s a p p r o x i m a t e l y 4
p e r c e n t ”);

Scilab code Exa 14.8 thermal conductivity

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 8 − pg737 ” ) ;
4 // g i v e n

108
5 M =153.82; // [ kg / mole ] − m o l e c u l a r w e i g h t o f c c l 4
6 T1 =349.90; // [ K ] − t e m p e r a t u r e 1
7 T2 =293.15; // [ K ] − t e m p e r a t u r e 2
8 cp1 =0.9205; // [ KJ/ kg ∗K ] − h e a t c a p a c i t y a t
t e m p e r a t u r e T1
9 cp2 =0.8368; // [ KJ/ kg ∗K ] − h e a t c a p a c i t y a t
t e m p e r a t u r e T2
10 p1 =1480; // [ kg /mˆ 3 ] − d e n s i t y a t t e m p e r a t u r e T1
11 p2 =1590; // [ kg /mˆ 3 ] − d e n s i t y a t t e m p e r a t u r e T2
12 Tb =349.90; // [ K ] − n o r m a l b o i l i n g p o i n t
13 pb =1480; // [ kg /mˆ 3 ] − d e n s i t y a t n o r m a l b o i l i n g
point
14 cpb =0.9205; // [ KJ/ kg ∗K ] − h e a t c a p a c i t y a t n o r m a l
boiling point
15 k1 =(1.105/( M ^(1/2) ) ) *( cp1 / cpb ) *(( p1 / pb ) ^(4/3) ) *( Tb /
T1 ) ;
16 printf ( ” \n\n The e s t i m a t e d t h e r m a l c o n d u c t i v i t y a t
n o r m a l b o i l i n g p o i n t i s \n k=%f W∗mˆ−1∗Kˆ−1” , k1 ) ;
17 k2 =(1.105/( M ^(1/2) ) ) *( cp2 / cpb ) *(( p2 / pb ) ^(4/3) ) *( Tb /
T2 ) ;
18 printf ( ” \n\n The e s t i m a t e d t h e r m a l c o n d u c t i v i t y a t
t e m p e r a t u r e %f K i s \n k=%f W∗mˆ−1∗Kˆ−1” ,T2 , k2 ) ;
19 printf ( ” \n\n The e s t i m a t e d v a l u e i s 3 . 4 p e r c e n t
h i g h e r t h a n t h e e x p e r i m e n t a l v a l u e o f 0 . 1 0 2 9 W∗m
ˆ−1∗Kˆ−1” ) ;

Scilab code Exa 14.9 diffusion coefficient

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 4 . 9 − pg743 ” ) ;
4 // g i v e n
5 T =288; // [ K ] − t e m p e r a t u r e
6 M1 =60.09; // [ kg / mole ] − m o l e c u l a r w e i g h t o f
proponal

109
7 M2 =18.015; // [ kg / mole ] − m o l e c u l a r w e i g h t o f w a t e r
8 mu1 =2.6*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y o f p r o p o n a l
9 mu2 =1.14*10^ -3; // [ kg /m∗ s e c ] − v i s c o s i t y o f w a t e r
10 Vc =14.8*10^ -3; // [mˆ3/ kmol ] − m o l a r volume o f
carbon
11 Vh =3.7*10^ -3; // [mˆ3/ kmol ] − m l a r volume o f
hydrogen
12 Vo =7.4*10^ -3; // [mˆ3/ kmol ] − m o l a r volume o f
oxygen
13 Vp =3* Vc +8* Vh + Vo ; // m o l a r volume o f p r o p o n a l
14 phi =2.26; // a s s o c i a t i o n f a c t o r f o r d i f f u s i o n o f
proponal through water
15 Dab =(1.17*10^ -16*( T ) *( phi * M2 ) ^(1/2) ) /( mu2 *( Vp ^0.6) ) ;
16 printf ( ” \n\n The d i f f u s i o n c o e f f i c i e n t o f p r o p o n a l
t h r o u g h w a t e r i s \n Dab=%e mˆ2/ s e c ” , Dab ) ;
17 phi =1.5; // a s s o c i a t i o n f a c t o r f o r d i f f u s i o n o f
water through proponal
18 Vw =2* Vh + Vo ; // [ m o l a r volume o f w a t e r
19 Dab =(1.17*10^ -16*( T ) *( phi * M1 ) ^(1/2) ) /( mu1 *( Vw ^0.6) ) ;
20 printf ( ” \n\n The d i f f u s i o n c o e f f i c i e n t o f w a t e r
t h r o u g h p r o p a n o l i s \n Dab=%e mˆ2/ s e c ” , Dab ) ;

110
Chapter 15

non newtonial phenomena

Scilab code Exa 15.1 rheological characteristics of material time indepen-


dant behaviour

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 5 . 1 − pg760 ” ) ;
4 // g i v e n
5 r =[10 20 50 100 200 400 600 1000 2000]
6 tau =[2.2 3.1 4.4 5.8 7.4 9.8 11.1 13.9 17.0]
7 tau = tau *(10^ -4) ;
8 clf ;
9 xtitle ( ” b a s i c s h e a r d i a g r a m f o r t h e f l u i d ” ,” s h e a r
r a t e ” ,” s h e a r s t r e s s ” ) ;
10 plot2d ( ” l l ” ,r , tau ) ;
11 // t h e d a t a f a l l s n e a r l y on a s t r a i g h t l i n e
12 // from t h e g r a p h t h e s l o p e and t h e i n t e r c e p t a r e
13 slope =0.3841;
14 intercept =9.17046;
15 // from t h e r e l a t i o n t a u=K∗(− r ) ˆ n ;
16 K = exp ( intercept ) ;
17 n = slope
18 disp (K , ”K=” ,n , ” n=” ) ;
19 printf ( ” \n\n The f l u i d i s p s e u d o p l a s t i c , s i n c e t h e

111
slope is l e s s than 1 ”);

Scilab code Exa 15.2 capillary viscometer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 5 . 2 − pg774 ” ) ;
4 // g i v e n
5 a =[651 1361 2086 5089 7575 11140 19270 25030]
6 tau =[3.71 7.49 11.41 24.08 -35.21 46.25 77.50 96.68]
7 clf ;
8 xtitle ( ” c a p i l l a r y s h e a r d i a g r a m f o r p o l y i s o b u t y l e n e
L−80 i n c y c l o h e x a n e ” ,” p s e u d o s h e a r r a t e ” ,” w a l l
s h e a r s t r e s s ”);
9 plot2d ( ” l l ” ,a , tau ) ;
10 // from t h e g r a p h
11 betao = -4.3790154;
12 beta1 =0.8851;
13 K ’= exp ( betao ) ;
14 n ’= beta1 ;
15 printf ( ” \n\n The f i n a l r h e o l o g i c a l model i s \n tauw
= %f ∗ ( 8 ∗ Uz , avg / do ) ˆ %f ” ,K ’ ,n ’) ;

Scilab code Exa 15.3 capillary viscometer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 5 . 3 − pg774 ” ) ;
4 // g i v e n
5 // from e x a m p l e 1 5 . 2
6 n ’=0.8851;
7 K ’=0.01254;
8 n =n ’;

112
9 K =K ’/((3* n +1) /(4* n ) ) ;
10 disp (n , ” n=” ) ;
11 printf ( ” \n K = %f N/mˆ2 ” ,K ) ;

Scilab code Exa 15.4 capillary viscometer

1 clc ;
2 warning ( ” o f f ” ) ;
3 printf ( ” \n\n e x a m p l e 1 5 . 4 − pg775 ” ) ;
4 // g i v e n
5 a =[10 20 50 100 200 400 600 1000 2000];
6 tau =[2.24 3.10 4.35 5.77 7.50 9.13 11.0 13.52 16.40]
7 tau = tau *10^ -4;
8 clf ;
9 xtitle ( ” c a p i l l a r y s h e a r d i a g r a m f o r a c o m m e r c i a l
p o l y e t h y l e n e m e l t a t 190 degC ” ,” p s e u d o s h e a r r a t e ”
,” w a l l s h e a r s t r e s s ” ) ;
10 plot2d ( ” l l ” ,a , tau ) ;
11 // s u c h a p l o t s u g g e s t s a s e c o n d o r d e r p o l y n o m i l a
o f t h e t y p e y=b e t a o+b e t a 1 ∗ x+b e t a 2 ∗ x ˆ 2 ;
12 // where y=l n ( tauw ) and x=l n ( 8 ∗ Uz , avg / do )=l n ( a ) ;
13 // from t h e g r a p h
14 betao =8.96694;
15 beta1 =0.48452520;
16 beta2 =0.010923041;
17 n = beta1 +2* beta2 * a ;
18 phiw =((3* n +1) /(4* n ) ) *( a ) ;
19 mu = tau / phiw ;
20 printf ( ” \n\n 8∗Uz , avg / do n ( 3 ∗ n+1) / ( 4 ∗ n )
phiw mu” ) ;
21 for i =1:9
22 printf ( ” \n %f %f %f %f %f ”
,a ( i ) ,n ( i ) ,(3* n ( i ) +1) /(4* n ( i ) ) , phiw ( i ) , mu ) ;
23 end

113

You might also like