Professional Documents
Culture Documents
Created by
Eswar Prasad
4th Year Student
B.E. (Mech. Engg.)
National Institute of Technology, Trichy
29 June 2010
Edition: 5th
Year: 2001
ISBN: 9971-51-355-2
1
Contents
1 Introduction 10
1.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2 Fundamental Concepts 12
2.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 Fluid Statics 14
3.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2
8 Internal Incompressible Viscous Flow 55
8.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10 Fluid Machinery 75
10.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3
List of Scilab Code
1.01 1.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.01d 1.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.02 1.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.02d 1.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.02 2.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.02d 2.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.01 3.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.01d 3.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.03 3.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.03d 3.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.04 3.04.sci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.04d 3.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.05 3.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.05d 3.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.06 3.06.sci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.06d 3.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.07 3.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.07d 3.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.01 4.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.01d 4.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.02 4.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.02d 4.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.03 4.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.03d 4.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.04 4.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.04d 4.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.05 4.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.05d 4.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4
4.06 4.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.06d 4.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.07 4.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.07d 4.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.08 4.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.08d 4.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.09 4.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.09d 4.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.10 4.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.10d 4.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.11 4.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.11d 4.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.12 4.12.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.12d 4.12-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.14 This is some example . . . . . . . . . . . . . . . . . . . . . 34
4.14d 4.14-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.16 4.16.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.16d 4.16-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.17 4.17.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.17d 4.17-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.02 5.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.02d 5.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.07 5.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.07d 5.07d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.08 5.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.08d 5.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.09 5.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.09d 5.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.01 6.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.01d 6.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.02 6.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.02d 6.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.03 6.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.03d 6.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.04 6.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.04d 6.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.05 6.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.05d 6.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5
6.06 6.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.06d 6.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.08 6.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.08d 6.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.09 6.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.09d 6.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.04 7.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.04d 7.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.05 7.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.05d 7.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.06 7.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.06d 7.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.01 8.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.01d 8.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.02 8.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.02d 8.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.04 8.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.04d 8.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.05 8.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.05d 8.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.06 8.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.06d 8.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.07 8.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.07d 8.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.08 8.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.08d 8.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.09 8.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.09d 8.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.10 8.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.10d 8.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.11 8.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.11d 8.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 64
9.01 9.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
9.01d 9.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 66
9.04 9.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.04d 9.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.05 9.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.05d 9.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6
9.06 9.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.06d 9.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.07 9.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.07d 9.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.08 9.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.08d 9.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.09 9.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.09d 9.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 74
10.01 10.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.01d 10.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.02 10.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.02d 10.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.03 10.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.03d 10.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 78
10.06 10.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.06d 10.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.07 10.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.07d 10.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.08 10.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
10.08d 10.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.11 10.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.11d 10.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 88
10.12 10.12.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
10.12d 10.12-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 92
10.14 10.14.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
10.14d 10.14-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 93
10.16 10.16.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
10.16d 10.16-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 94
11.01 11.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
11.01d 11.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 96
11.03 11.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
11.03d 11.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 97
11.04 11.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
11.04d 11.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 99
12.01 12.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
12.01d 12.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 101
12.02 12.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
12.02d 12.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 103
7
12.03 12.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
12.03d 12.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 104
12.04 12.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
12.04d 12.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 105
12.05 12.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
12.05d 12.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 106
12.06 12.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
12.06d 12.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 108
12.07 12.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
12.07d 12.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 109
12.08 12.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
12.08d 12.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 111
12.09 12.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
12.09d 12.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 113
12.10 12.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
12.10d 12.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 115
8
List of Figures
9
Chapter 1
Introduction
1.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 1.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Heat added during the process ( in kJ ) :
5 Q12=m∗ cp ∗(T2−T1)
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ nHeat added d u r i n g t h e p r o c e s s : %f kJ\n\n” ,
Q12 /1000)
10
3 // I n i t i a l temperatur ( in K) :
4 T1=300;
5 // F i n a l temperature of oxygen ( in K) :
6 T2=900;
7 // P r e s s u r e of oxygen ( in kPa ) :
8 p=150;
9 // S p e c i f i c heat at constant pressure ( in J / k g −K ) :
10 cp = 9 0 9 . 4 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 1.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Speed at which the ball hits the ground ( in m/ s e c ) :
5 V=sqrt (m∗g/k∗(1−%eˆ(2∗ k/m∗(−y0 ) ) ) )
6 // T e r m i n a l speed ( in m/ s e c ) :
7 Vt=sqrt (m∗g/k )
8 // R a t i o of actual speed to the terminal speed :
9 r=V/Vt ;
10 p r i n t f ( ”\n\nRESULTS\n\n” )
11 p r i n t f ( ”\n\ nSpeed a t which t he b a l l h i t s he ground : %f
m/ s e c \n\n” ,V)
12 p r i n t f ( ”\n\ nRatio o f a c t u a l speed t o t he t e r m i n a l speed
: %f\n\n” , r )
1 // Mass of ball ( in kg ) :
2 m= 0 . 2 ;
3 // H e i g h t fom which ball is dropped ( in m) :
4 y0 =500;
5 // Value of k :
6 k=2∗10ˆ−4;
7 // A c c l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
8 g =9.81;
11
Chapter 2
Fundamental Concepts
2.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 2 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 2.02 − data . s c i ’
3 exec ( f i l e n a m e )
4
12
14 p r i n t f ( ”\n\ n V i s c o s i t y i n u n i t s o f l b f −s / f t ˆ 2 : %1. 8 f
$ l b f −s / f t ˆ2\n\n” , u1 )
15 p r i n t f ( ”\n\ nKinematic v i s c o s i t y : %1. 8 f m/ s e c ˆ2\n\n” , v )
16 p r i n t f ( ”\n\ nShear s t r e s on t h e upeer p l a t e : %f l b f / f t
ˆ2\n\n” , tu )
17 p r i n t f ( ”\n\ nSear s t r e s s on t h e l o w e r p l a t e : %f Pa\n\n” ,
tl )
13
Chapter 3
Fluid Statics
3.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
When we execute S 3.01, we get Fig. 3.1.
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Tube diameter ( in mm ) :
5 D= 1 : 2 5 ;
6 D1=D/1000
7 [m n]= s i z e (D1)
8 for i =1:n
9 // Change in liquid level for water ( in mm ) :
10 dhw( i ) =4∗STw∗ cosd ( thetaw ) /dw/g/D1( i ) ;
11 // Change in liquid level for mercury ( in mm ) :
12 dhm( i ) =4∗STm∗ cosd ( thetam ) /dm/g/D1( i ) ;
14
13 end ;
14
1 // S u r f a c e tension of water ( in mN / m ) :
2 STw=72.8∗10ˆ −3;
3 // S u r f a c e Tension of mercury ( in mN / m ) :
4 STm=375∗10ˆ −3;
5 // C o n t a c t angle for water :
6 thetaw =0;
7 // COntact angle for mercury :
8 thetam =140;
9 // D e n s i t y of water ( in kg /m ˆ 3 ) :
10 dw=1;
11 // D e n s i t y of mercury ( in kg /m ˆ 3 ) :
12 dm= 1 3 . 6 ;
13 // A c c e l e r a t i o n de to gravity ( in m/ s e c ) :
14 g =9.81;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.03 − data . s c i ’
3 exec ( f i l e n a m e )
4 // P r e s s u r e d i f f e r e n c e ( in lbf / in ˆ2) :
5 dp=g∗d∗(−d1+SGm∗d2−SGo∗d3+SGm∗d4+d5 ) /12/144
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ n P r e s s u r e d i f f e r e n c e between A and B : %f l b f
/ i n ˆ2\n\n” , dp )
15
Figure 3.1: Output graph of S 3.01
16
Example 3.03d 3.03-data.sci
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Assuming temperature varies li ne ar ly with altitude :
5 // T e m p e r a t u r e gradient ( in F/ ft ) :
6 m=(T1−T2) / ( z2−z1 )
7 // Value of g / ( m∗R ) :
8 v=g/m/R/ 3 2 . 2
9 // P r e s s u r e at Vail Pass ( in inches of Hg ) :
10 p12=p1 ∗ ( ( T2+460) / (T1+460) ) ˆv
11 // P e r c e n t a g e change in density :
12 pc1=(p12 /p1 ∗(T1+460) / (T2+460) −1)∗100
13 // Assuming density is constant :
14 // P r e s s u r e at Vail Pass ( in inches of Hg ) :
15 p22=p1 ∗(1 −( g ∗( z2−z1 ) / (R∗ 3 2 . 2 ) / (T1+460) ) )
17
16 // P e r c e n t a g e change in density :
17 pc2 =0;
18 // Assuming temperature is constant :
19 // P r e s s u r e at Vail Pass ( in inches of Hg ) :
20 p32=p1∗%eˆ(−g ∗( z2−z1 ) / (R∗ 3 2 . 2 ) / (T2+460) )
21 // P e r c e n t a g e change in density :
22 pc3=(p32 /p1 ∗(T1+460) / (T1+460) −1)∗100
23 // For an adiabatic atmosphere :
24 p42=p1 ∗((62+460) /(80+460) ) ˆ ( k / ( k−1) )
25 // P e r c e n t a g e change in density :
26 pc4=(p42 /p1 ∗(T1+460) / (T2+460) −1)∗100
27 p r i n t f ( ”\n\nRESULTS\n\n” )
28 p r i n t f ( ”\n\n1 ) I f t e m p e r a t u r e v a r i e s l i n e a r l y with
a l t i t u d e \n\n” )
29 p r i n t f ( ”\n\n\ tAtmospheric p r e s s u r e a t V a i l Pass : %f
i n c h e s o f Hg\n\n” , p12 )
30 p r i n t f ( ”\n\n\ t P e r c e n t a g e change i n d e n s i t y wrt Denver :
%f p e r c e n t \n\n” , pc1 )
31 p r i n t f ( ”\n\n2 ) I f d e n s i t y i s c o n s t a n t \n\n” )
32 p r i n t f ( ”\n\n\ tAtmospheric p r e s s u r e a t V a i l Pass : %f
i n c h e s o f Hg\n\n” , p22 )
33 p r i n t f ( ”\n\n\ t P e r c e n t a g e change i n d e n s i t y wrt Denver :
%f p e r c e n t \n\n” , pc2 )
34 p r i n t f ( ”\n\n3 ) I f t e m p e r a t u r e i s c o n s t a n t \n\n” )
35 p r i n t f ( ”\n\n\ tAtmospheric p r e s s u r e a t V a i l Pass : %f
i n c h e s o f Hg\n\n” , p32 )
36 p r i n t f ( ”\n\n\ t P e r c e n t a g e change i n d e n s i t y wrt Denver :
%f p e r c e n t \n\n” , pc3 )
37 p r i n t f ( ”\n\n4 ) For an a d i a b a t i c atmosphere \n\n” )
38 p r i n t f ( ”\n\n\ tAtmospheric p r e s s u r e a t V a i l Pass : %f
i n c h e s o f Hg\n\n” , p42 )
39 p r i n t f ( ”\n\n\ t P e r c e n t a g e change i n d e n s i t y wrt Denver :
%f p e r c e n t \n\n” , pc4 )
1 // E l e v a t i o n of Denver ( in ft ) :
2 z1 =5280;
18
3 // P r e s s u r e at Denver ( in mm of Hg ) :
4 p1 = 2 4 . 8 ;
5 // T e m p e r a t u r e at Denver ( in F) :
6 T1=80;
7 // E l e v a t i o n at Vail Pass ( in ft ) :
8 z2 =10600;
9 // T e m p e r a t u r e at Vsil Pass ( in F) :
10 T2=62;
11 // Value of R in f t − l b f / l b m −R ) :
12 R= 5 3 . 3 ;
13 // A c c e l e r a t i o n due togravity ( in ft / sec ˆ2) :
14 g =32.2;
15 // Value of adiabatic constant :
16 k =1.4;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Net force on the gate ( in kN ) :
5 Fr=d∗g∗w∗(D∗L+Lˆ2/2∗ s i n d ( t h e t a ) )
6 // C e n t r e of pressure :
7 // C a l c u l a t i o n for y coordinate :
8 yc=D/ s i n d ( t h e t a )+L/2
9 // Area ( in mˆ2) :
10 A=L∗w
11 // Moment of inertia of rectangular gate ( in mˆ4) :
12 Ixx=w∗Lˆ3/12
13 // y coordinate ( in m) :
14 y=yc+Ixx /A/ yc
15 // C a l c u l a t i o n for x coordinate :
16 Ixy=0
17 xc=w/2
18 // x coordinate ( in m) :
19 x=xc+Ixy /A/ xc
20 p r i n t f ( ”\n\nRESULTS\n\n” )
21 p r i n t f ( ”\n\nNet f o r c e on th e g a t e : %f kN\n\n” , Fr /1000)
19
22 p r i n t f ( ”\n\ nCoordinate o f c e n t r e o f p r e s s u r e : ( %0. 1 f , %0
. 1 f ) \n\n” , x , y )
1 // Length of gate ( in m) :
2 L=4;
3 // Width of gate ( in m) :
4 w=5;
5 // Depth of gate under water ( in m) :
6 D=2;
7 // D e n s i t y of water ( in kg /m ˆ 3 :
8 d=999;
9 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
10 g =9.81;
11 // Angle of gate with horizontal :
12 t h e t a =30;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // F o r c e required to keep the door shut ( in lbf ) :
5 function y=f ( z ) , y=b/L∗p0∗ z+d∗b/L∗(L∗z−z ˆ2 ) , endfunction
6 Ft=intg ( 0 , L , f )
7 p r i n t f ( ”\n\nRESULTS\n\n” )
8 p r i n t f ( ”\n\ nForce r e q u i r e d t o kep th e door shut : %. 1 f
l b f \n\n” , Ft )
20
6 b=2;
7 // D e n s i t y of l i q i u i d ( in lbf / ft ˆ3) :
8 d=100;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 3 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 3.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // H o r i z o n t a l component of resultant force ( in kN ) :
5 Frh =0.5∗d∗g∗w∗Dˆ2
6 // Line of action of Frh ( in m) :
7 y1 =0.5∗D+w∗Dˆ 3 / 1 2 / ( 0 . 5 ∗D) / (w∗D)
8 // V e r t i c a l component of resultant force ( in kN ) :
9 function y=q ( x ) , y=d∗g∗w∗(D−sqrt ( a∗x ) ) , endfunction
10 Frv=intg ( 0 ,Dˆ2/ a , q )
11 // Line of acion of Frv ( in m) :
12 function k=f ( x ) , k=d∗g∗w/ Frv ∗x ∗(D−sqrt ( a∗x ) ) ,
endfunction
13 xa=intg ( 0 ,Dˆ2/ a , f )
14 // F o r c e required to keep the gate in equilibrium ( in kN )
:
15 Fa=1/ l ∗( xa ∗ Frv+(D−y1 ) ∗Frh )
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\ nForce r e q u i r e d t o keep t h e g a t e a t
e q u i l i b r i u m : %f kN\n\n” , Fa /1000)
1 // Width of gate ( in m) :
2 w=5;
3 // Depth of water ( in m) :
4 D=4;
5 // D e n s i t y of water ( in kg /m ˆ 3 ) ;
6 d=999;
7 // A c c e l r a t i o n deto gravity ( in m/ s e c ˆ 2 ) :
8 g =9.81;
9 // Value of a ( in m) :
21
10 a =4;
11 // P o i n t where force acts ( in m) :
12 l =5;
22
Chapter 4
4.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
When we execute S 4.11, we get Fig. 4.1.
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // I f I= i n t e g r a l o f ( pV . dA ) :
5 // For system : I c s =IA1+IA2+IA3+IA4 .
6 // For area 1
7 IA1=−d∗V1∗A1
8 // For area 3: I A 2 = d ∗ V3 ∗ A3 =m3
9 IA3=m3
10 // For area 4: I A 4 =− d ∗ V 4 ∗ A 4 =− d ∗ Q 4
23
11 IA4=−d∗Q4
12 // For area 2:
13 IA2=−IA1−IA3−IA4
14 // V e l o c i t y at section 2( in ft / sec ) :
15 V2=IA2/d/A2
16 / / V2 is in the negative y direction
17 p r i n t f ( ”\n\nRESULTS\n\n” )
18 p r i n t f ( ”\n\ n V e l o c i t y a t s e c t i o n 2 : −%. 0 f j f t / s e c \n\n” ,
V2)
1 // Area of 1 ( in ft ˆ2) :
2 A1= 0 . 2 ;
3 // Area of 2 ( in ft ˆ2) :
4 A2= 0 . 5 ;
5 // Area of 3 ( in ft ˆ2) :
6 A3= 0 . 4 ;
7 // Area of 4 ( in ft ˆ2) :
8 A4= 0 . 4 ;
9 // D e n s i t y of water ( in slug / ft ˆ3) :
10 d=1.94;
11 // Mass flow rate out of section 3( in slug / sec ) :
12 m3= 3 . 8 8 ;
13 // Volme flow rate in section 4 ( in f t ˆ3/ sec ) :
14 Q4=1;
15 // V e l o c i t y at 1( in ft / sec ) :
16 V1=10;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // I f I= i n t e g r a l o f ( pV . dA ) :
5 // For system : ICS= Iab + I b c + I c d + Ida
6 // But I C S =0
7
24
8 // For Aab :
9 function p=f ( y ) , p=−d∗U∗w∗y ˆ 0 , endfunction
10 IAab=intg ( 0 , t , f )
11
12 // For Acd :
13 function q=g ( y ) , q=d∗U∗w∗(2∗ y/ t −(y/ t ) ˆ 2) , endfunction
14 IAcd=intg ( 0 , t , g )
15
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.03 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Rate of change of air density in tank ( in ( kg /m ˆ 3 ) / s ) :
5 r=−d∗v∗A/V/10ˆ6
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ nRate o f change o f a i r d e n s i t y i n tank : %. 3 f
kg /mˆ3\n\n” , r )
8 p r i n t f ( ”\n\nThe d e n s i t y d e c r e a s e s as i s i n d i c a t e d by
t he n e g a t i v e s i g n \n\n” )
25
Example 4.03d 4.03-data.sci
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // 1) Control Volume selected so that area of l e f t
surface is equal to the area of the right surface
5 u1 =15;
6 // F o r c e of support on control volum ( in kN ) :
7 function y=f (A) , y=−u1∗d∗V, endfunction
8 Rx1=intg ( 0 , 0 . 0 1 , f )
9 // H o r i z o n t a l force on support ( in kN ) :
10 Kx=−Rx1
11 // 2) Control volumes are selected do that the area of
the l e f t and right surfaces are equial to the area
of the plate
12
26
19 // H o r i z o n t a l force on support ( in kN ) :
20 Kx2=−Rx2
21 p r i n t f ( ”\n\nRESULTS\n\n” )
22 p r i n t f ( ”\n\ n H o r i z o n t a l f o r c e on s u p p o r t : %. 3 f kN\n\n” ,
Kx/1000)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Weight of water in the tank ( in lbf ) :
5 d1 = 6 2 . 4 ;
6 WH2O=d1∗A∗h
7 v=−5;
8 // T o t a l body force in negative y direction ( lbf ) :
9 function y=f (A) , y=−v∗d2∗V1 , endfunction
10 F=intg ( 0 , A1 , f )
11 // F o r c e of scale on control volume ( in kN ) :
12 Ry=W+WH2O−F
13 p r i n t f ( ”\n\nRESULTS\n\n” )
14 p r i n t f ( ”\n\ n S c a l e Reading : %. 3 f l b f \n\n” ,Ry)
1 // H e i g h t of the container ( in ft ) :
2 l =2;
3 // Area of cross section ( in ft ˆ2) :
27
4 A=1;
5 // Weight of container ( in lbf ) :
6 W=5;
7 // Water depth ( in ft ) :
8 h=1.9;
9 // Area of opening 1( in ft ˆ2) :
10 A1= 0 . 1 ;
11 // V e l o c i t y at opening 1( in ft / sec ) :
12 V1=−5;
13 // Area of opening 2( in ft ˆ2) :
14 A2= 0 . 1 ;
15 // Area of opening 1( in ft ˆ2) :
16 A3= 0 . 1 ;
17 // D e n s i t y of water ( in slug / f ˆ3) :
18 d2 = 1 . 9 4 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 / / X− c o m p o n e n t of reaction force per unit width of the
gate ( in N/m ) :
5 Rxw=(d ∗(V2ˆ2∗D2−V1ˆ2∗D1) ) −(d∗g /2∗(D1ˆ2−D2ˆ 2) )
6 // H o r i z o n t a l force exerted per unt width on the gate ( in
N/m ) :
7 Kxw=−Rxw
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\ n H o r i z o n t a l f o r c e e x e r t e d pe r unt width on
t he g a t e : %. 3 f kN/m\n\n” ,Kxw/1000)
1 // D i a m e t e r of channel ( in m) :
2 D1= 1 . 5 ;
3 // V e l c i t y of flow in channel ( in m/ s e c ) :
4 V1= 0 . 2 ;
5 // D i a m e t e r at section 2( in m) :
28
6 D2= 0 . 0 5 6 3 ;
7 // V e l o c i t y a section 2( in m/ s e c ) :
8 V2= 5 . 3 3 ;
9 // D e n s i t y of water ( in kg /m ˆ 3 ) :
10 d=999;
11 // A c c e l e r a t i o n due to gravity ( in m/ s e c 2 ) :
12 g =9.81;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y at section 1( in m/ s e c ) :
5 V1=V2∗A2/A1
6 // Gauge pressure ( in kPa ) :
7 p1g=p1−patm
8 u1=V1 ; u2=−V2 ;
9 // R e a c t i o n force component in the x d i r e c t i o n ( in N) :
10 Rx=−p1g ∗A1−u1∗d∗V1∗A1
11 // R e a c t i o n force component in the y d i r e c t i o n ( in N) :
12 Ry=u2∗d∗V2∗A2
13 p r i n t f ( ”\n\nRESULTS\n\n” )
14 p r i n t f ( ”\n\ nForce t o hold elbow a c t i n g t o th e l e f t : %. 3
f kN\n\n” ,Rx/1000)
15 p r i n t f ( ”\n\ nForce t o hold elbow a c t i n g downwards : %. 3 f
N\n\n” ,Ry)
29
9 // A t m o s p h e r i c pressure ( in kPa ) :
10 patm = 1 . 0 1 2 ∗ 1 0 ˆ 5 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.08 − data . s c i ’
3 exec ( f i l e n a m e )
4 // T e n s i o n required to pull the belt ( in lbf ) :
5 T=Vbelt ∗m/ 3 2 . 2
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ nTension r e q u i r e d t o p u l l th e b e l t : %. 3 f l b f
\n\n” ,T)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Minimum gauge pressure required ( in lbf / in ˆ2) :
5 pg=8/%pi ˆ2∗d/D1ˆ4∗Qˆ 2 ∗ ( (D1/D2) ˆ4−1) ∗144
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”Minimum gauge p r e s s u r e r e q u i r e d : %. 3 f l b f / i n ˆ2 ”
, pg )
30
2 D1=3;
3 // N o z z l e exit diameter ( in inches ) :
4 D2=1;
5 // D e s i r e d volume flow rate ( in f t ˆ3/ sec ) :
6 Q= 0 . 7 ;
7 // D e n s i t y of water ( in slug / ft ˆ3) :
8 d=1.94;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 0 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.10 − data . s c i ’
3 exec ( f i l e n a m e )
4 u1=V−U
5 u2=(V−U) ∗ cosd ( t h e t a )
6 v2=(V−U) ∗ s i n d ( t h e t a )
7 V1=V−U
8 V2=V1
9 //X component of moment equation ( in N) :
10 function y=f (A) , y=u1∗−(d∗V1) , endfunction
11 function z=g (A) , z=u2∗d∗V2 , endfunction
12 Rx=intg ( 0 ,A, f )+intg ( 0 ,A, g )
13
31
6 A= 0 . 0 0 3 ;
7 // Flow velocity of water ( in m/ s e c ) :
8 V=30;
9 // D e n s i t y of water ( in kg /m ˆ 3 ) :
10 d=999;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.11 − data . s c i ’
3 exec ( f i l e n a m e )
4 // E v a l u a t i n g the value of Vb :
5 Vb=V∗(1− cosd ( t h e t a ) ) ∗d∗A/M
6 // Value of U/V for various values of t
7 t =0:20;
8 [m n]= s i z e ( t )
9 for i =1:n
10 U V( i )=Vb∗ t ( i ) /(1+Vb∗ t ( i ) ) ;
11 end
12
13 // P l o t t i n g U/V vs t :
14 plot ( t , U V)
15 x t i t l e ( ’U/V vs t ’ , ’ t ( i n s e c ) ’ , ’U/V ’ )
32
Figure 4.1: Output graph of S 4.11
33
Example 4.12 4.12.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.12 − data . s c i ’
3 exec ( f i l e n a m e )
4 // A c c e l e r a t i o n of rocket at t =0( i n m/ s e c ˆ 2 ) :
5 Ve∗me/M0−g
6 // V e l o c i t y of rocket at t =10 ( in m/ s e c ) :
7 function y=f ( t ) , y=Ve∗me/ (M0−me∗ t )−g , endfunction
8 Vcv=intg ( 0 , t , f )
9 p r i n t f ( ”\n\nRESULTS\n\n” )
10 p r i n t f ( ”\n\ n V e l o c i t y o f r o c k e t a t t =10: %. 1 f m/ s e c \n\n”
, Vcv )
1 // I n i t i a l mass of th rocket ( in kg ) :
2 M0=400;
3 // Rate of fuel consumption ( in kg / s e c ) :
4 me=5;
5 // Exhaust v e l o c i t y ( in m/ s e c ) :
6 Ve=3500;
7 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
8 g =9.81;
9 // Time after which velocity is to be calculated ( in sec )
:
10 t =10;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.14 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Area of jet ( in mm ˆ 2 ) :
5 A j et=%pi /4∗Dˆ2
6 // J e t speed re la ti ve to the nozzle ( in m/ s e c ) :
7 V r e l=Q/2/ Aje t ∗10ˆ6/60/1000
8 // Value of w∗R in m/ s e c :
34
9 wR=w∗R∗2∗ %pi /60/1000
10 // F r i c t i o n torque at pivot ( in N−m ) :
11 Tf=R∗( V r e l ∗ cosd ( alpha )−wR) ∗d∗Q/1000/60/1000
12 p r i n t f ( ”\n\nRESULTS\n\n” )
13 p r i n t f ( ”\n\ nJet speed r e l a t i v e t o each n o z z l e : %. 2 f m/
s e c \n\n” , V r e l )
14 p r i n t f ( ”\n\ n F r i c t i o n t o r q u e a t p i v o t : %. 5 f N−m\n\n” , Tf )
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.16 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y at exit ( in ft / sec ) :
5 V2=m∗R∗(T2+460) /A2/p2 /144
6 // As power input is to CV , Ws = − 6 0 0
7 // Rate of heat t r a n s f e r ( in Btu / s e c ) :
8 Q=Ws∗550/778+m∗ cp ∗(T2−T1)+m∗V2ˆ 2 / 2 / 3 2 . 2 / 7 7 8
35
9 p r i n t f ( ”\n\nRESULTS\n\n” )
10 p r i n t f ( ”\n\ nRate o f hea t t r a n s f e r : %. 3 f Btu/ s e c \n\n” ,Q)
1 // P r e s s u r e at entry ( in psia ) :
2 p1 = 1 4 . 7 ;
3 // T e m p e r a t u r e at entry ( in F) :
4 T1=70;
5 // P r e s s u r e at exit ( in psia ) :
6 p2 =50;
7 // Temprature a exit ( in F) :
8 T2=100;
9 // C r o s s sectional area of the pipe at exit ( in ft ˆ2) :
10 A2=1;
11 // Mass flow rate ( in lbf / sec ) :
12 m=20;
13 // Power input to the compressor ( in hp ) :
14 Ws=−600;
15 // Value of cp ( in B t u / l b m −R ) :
16 cp = 0 . 2 4 ;
17 // Value of gas constant ( in f t − l b f / ( l b m −R ) )
18 R= 5 3 . 3 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 4 . 1 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 4.17 − data . s c i ’
3 exec ( f i l e n a m e )
4 // D e n s i t y of tank ( in kg /m ˆ 3 ) :
5 d=(p1+patm ) /R/T
6 // Mass flow rate of air into the tank ( in kg / s e c ) :
7 m=d∗V∗ cv ∗ r /R/T∗1000
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\nMass f l o w r a t e o f a i r i n t o t h e tank : %. 3 f g
/ s e c \n\n” ,m)
36
1 // Volume of tak ( in mˆ3) :
2 V= 0 . 1 ;
3 // T e m p e r a t u r e of line and tank ( in K) :
4 T=293;
5 // I n i t i a l tank gauge pressure ( in N/m ˆ 2 ) :
6 p1 =1∗10ˆ5;
7 // A b s o l u t e line pressure ( in N/m ˆ 2 ) :
8 p =2∗10ˆ6;
9 // Rate of rise of temperature after opening of the
valve ( in C/ s e c ) :
10 r =0.05;
11 // A t m o s p h e r i c pressure ( in N/m ˆ 2 ) :
12 patm = 1 . 0 1 ∗ 1 0 ˆ 5 ;
13 // Gas Constant ( in N−m / ( k g −K ) ) :
14 R=287;
15 // Value of cv ( in N−m / k g −K ) :
16 cv =717;
37
Chapter 5
Introducton to Differential
Analysis of Fluid Motion
5.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 5 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 5.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Rate of change of density with time ( in k g /mˆ3 − s ) :
5 r=−d∗V/L
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ nRate o f change o f d e n s i t y with time : %. 1 f
kg /mˆ3− s \n\n” , r )
38
1 // D i s t a n c e f piston from closed end of the cylinder at
the give instant ( in m) :
2 L= 0 . 1 5 ;
3 // D e n s i t y of gas ( in kg /m ˆ 3 ) :
4 d=18;
5 // V e l o c i t y of piston ( in m/ s e c ) :
6 V=12;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 5 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 5.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // At point b , u =3 mm / s e c
5 u=3;
6 // D i s p l a c e m e t of b( in mm ) :
7 xb=u∗ t
8 // Rate of angular deformation ( in s ˆ −1) :
9 d e f=U/h
10 // Rate of rotation ( in s ˆ −1) :
11 r o t =−0.5∗U/h
12 p r i n t f ( ”\n\nRSULTS\n\n” )
13 p r i n t f ( ”\n\ nRate o f a n g u l a r d e f o r m a t i o n : %. 1 f / s e c \n\n”
, def )
14 p r i n t f ( ”\n\ nRate o f r o t a t i o n : %. 1 f / s e c \n\n” , r o t )
1 // Value of ( in mm / s e c ) :
2 U=4;
3 // Value of h( in mm ) :
4 h=4;
5 / / Tme at which to find position ( in sec ) :
6 t =1.5;
39
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 5 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 5.08 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Value of T:
5 T=log ( 3 / 2 ) /A
6 x0 = 1 : 2 ;
7 y0 = 1 : 2 ;
8 for i =1:2
9 for j =1:2
10 // For X coordinate :
11 X( i ) ( j )=x0 ( i ) ∗%eˆ (A∗T)
12 // For Y coordinate :
13 Y( i ) ( j )=y0 ( j ) ∗%eˆ(−A∗T)
14 end
15 end
16 plot (X,Y)
17 // Rates of linear deformation in X direction :
18 Ax= 0 . 3 ;
19 // Rate of linear deformation in the y direction :
20 Ay= −0.3;
21 // Rate of volume d i l a t i o n ( s ˆ −1) :
22 v=A−A
23 // Area of abcd :
24 A1=1;
25 // Area of a ’b ’ c ’d ’:
26 A2=(3−3/2) ∗(4/3 −2/3)
27 p r i n t f ( ”\n\nRESULTS\n\n” )
28 p r i n t f ( ”\n\ nRates o f l i n e a r d e f o r m a t i o n i n X and Y
d i r e c t i o n : %. 1 f / s , %. 1 f / s \n\n” ,Ax , Ay)
29 p r i n t f ( ”\n\ nRate o f volume d i l a t i o n : %. 0 f / s e c \n\n” , v )
30 p r i n t f ( ”\n\ nArea o f abcd and a , b , c , d :%. 1 f mˆ 2 , %. 1 f mˆ\
n\n” ,A1 , A2)
1 // Value of A( in s e c ˆ −1) :
2 A= 0 . 3 ;
40
Example 5.09 5.09.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 5 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 5.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Volume flow rate ( in mˆ3/ sec ) :
5 Q=d∗g∗ s i n d ( t h e t a ) ∗b ∗( h /1000) ˆ3∗1000/ u/3
6 p r i n t f ( ”RESULTS” )
7 p r i n t f ( ”\n\nVolume f l o w r a t e : %. 4 f mˆ3/ s e c \n\n” ,Q)
1 // T h i c k n e s s of water film ( in mm ) :
2 h=1;
3 // Width of surface ( in m) :
4 b=1;
5 // Angle of in cl in at i on of surface :
6 t h e t a =15;
7 // D e n s i t y of water ( in kg /m ˆ 3 ) :
8 d=999;
9 // A c c e l e r a t i o n du to gravity ( in m/ s e c ˆ 2 ) :
10 g =9.81;
11 / / V i s c o s i t y ( k g / m− s ) :
12 u=10ˆ−3;
41
Chapter 6
6.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of flow ( in m/ s e c ) :
5 V=sqrt (dw/ log ( ( r+w) / r ) ∗g/da∗p /1000)
6 // Volume flow rate ( in mˆ3/ sec ) :
7 Q=V∗( d∗w)
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\nVolume f l o w r a t e : %. 3 f mˆ3/ s e c \n\n” ,Q)
42
2 d=0.3;
3 // Width of the duct ( in m) :
4 w= 0 . 1 ;
5 // I n n e r radius of the bend ( in m) :
6 r =0.25;
7 // P r e s s u r e difference between the taps ( in mm of Hg ) :
8 p=40;
9 // D e n s i t y of water ( in kg /m ˆ 3 ) :
10 dw=999;
11 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
12 g =9.8;
13 // D e n s i t y of air ( in kg /m ˆ 3 ) :
14 da = 1 . 2 3 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of flow ( in m/ s e c ) :
5 V=sqrt (2∗dw∗g∗p /1000∗SG/da )
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\ n V e l o c i t y o f f l o w : %. 3 f m/ s e c \n\n” ,V)
1 // P r e s s u r e d i f e r e n c e ( in mm of mecury ) :
2 p=30;
3 // D e n s i t y of water ( in kg /m ˆ 3 ) :
4 dw=1000;
5 // A c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
6 g =9.81;
7 // D e n s i t y of air ( in kg /m ˆ 3 ) :
8 da = 1 . 2 3 ;
9 // S p e c i f i c gravity of mercury :
10 SG= 1 3 . 6 ;
43
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.03 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of flwat the i n l e t ( in m/ s e c ) :
5 V1=Ae/ Ai∗V2
6 // Gauge pressure required at the i n l e t ( in kPa ) :
7 p=0.5∗ da ∗(V2ˆ2−V1ˆ 2 )
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\nGauge p r s s u r e r e q u i r e d a t th e i n l e t : %. 3 f
kPa\n\n” , p /1000)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Speed of water at exit ( in m/ s e c ) :
5 V2=sqrt (2∗ g∗ z )
6 // P r e s s u r e at point A in the f l o w ( kPa ) :
7 pA=p1+d∗g∗(0− l ) −0.5∗d∗V2ˆ2
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\ nSpeed o f water a t e x i t : %. 3 f m/ s e c \n\n” ,V2)
10 p r i n t f ( ”\n\ n P r e s s u r e a t p o i n t A i n t h e f l o w : %3f kPa\n\
n” ,pA/1000)
44
1 // Length of tube above surface ( in m) :
2 l =1;
3 // Depth of exit below water surface ( in m) :
4 z =7;
5 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
6 g =9.81;
7 // D e n s i t y of water ( in kg /m ˆ 3 ) :
8 d=999;
9 // A t m o s p h e r i c pressure ( in N/m ˆ 2 ) :
10 p1 = 1 . 0 1 ∗ 1 0 ˆ 5 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of flow at the exit ( in ft / sec ) :
5 V2=sqrt (2∗ g ∗(Du−Dd/12) )
6 // Volume flow rate / width ( f t ˆ2/ sec ) :
7 Q=V2∗Dd/12
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\ n V e l o c i t y o f f l o w a t t h e e x i t : %. 3 f f t / s e c \n
\n” ,V2)
10 p r i n t f ( ”\n\nVolume f l o w r a t e / width : %. 3 f f t ˆ2/ s e c \n\n” ,
Q)
45
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // P r e s s u r e of air at 1000 m( in N/m ˆ 2 ) :
5 p=P1∗pa
6 // D e n s i t y of air at 1000m( in kg /m ˆ 3 ) :
7 d=D1∗da
8 // S t a g n a t i o n pressure at A( in kPa ) :
9 p0A=p+0.5∗d ∗(V∗1000/3600) ˆ2
10 // S t a t i c pressure at B( in kPa ) :
11 pB=p+d / 2 ∗ ( (V∗1000/3600)ˆ2−Vbˆ 2)
12 p r i n t f ( ”\n\nRESULTS\n\n” )
13 p r i n t f ( ”\n\ n S t a g n a t i o n p r e s s u r e a t A: %. 3 f kPa\n\n” , p0A
/1000)
14 p r i n t f ( ”\n\ n S t a t i c p r e s s u r e a t B : %. 3 f kPa\n\n” ,pB
/1000)
1 // Speed of plane ( in km / h r ) :
2 V=150;
3 // Speed at point B r el at i ve to the wing ( in m/ s e c ) :
4 Vb=60;
5 // D e n s i t y of air ( in kg /m ˆ 3 ) :
6 da = 1 . 2 3 ;
7 // A t m o s p h e r i s pressure ( in N/m ˆ 2 ) :
8 pa = 1 . 0 1 ∗ 1 0 ˆ 5 ;
9 // At 1000m,
10 // p / pSL :
11 P1 = 0 . 8 8 7 0 ;
12 // d / dSL :
13 D1= 0 . 9 0 7 5 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.08 − data . s c i ’
3 exec ( f i l e n a m e )
46
4 // V e l o c i t y of flow at exit ( in ft / sec ) :
5 V4=sqrt (2∗ g ∗( z3 −0) )
6 // Mass flow rate of water ( in slug / sec ) :
7 m=d∗V4∗A4/144
8 // R i s e in temperature between points 1 and 2( in R) :
9 T=Q∗3413/3600/m/ 3 2 . 2
10 p r i n t f ( ”\n\nRESULTS\n\n” )
11 p r i n t f ( ”\n\ nRise i n t e m p e r a t u r e between p o i n t s 1 and 2 :
%. 3 f R\n\n” ,T)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 0 6 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 06.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 t =0:5
5 // Value of s q r t (2 gh ) :
6 x=sqrt (2∗ g∗h )
7 // Value of 1/2 L ∗ s q r t (2 gh ) :
8 y=1/2/L∗x
9 [m n]= s i z e ( t )
10 i =1:n ;
11 // V e l o c i t y ( in m/ s e c ) :
12 V2=x∗tanh ( y∗ t ( i ) )
13 plot ( t , V2) ;
47
14 x t i t l e ( ’ S t r e a m l i n e f l o w from 1 t o 2 ’ , ’ Time ( i n s ) ’ , ’V2(
i n m/ s e c ) ’ )
48
Chapter 7
7.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
When we execute S 7.05, we get Fig. 7.1.
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 7 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 7.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of prototype in ft / sec
5 Vp1=Vp∗6080/3600
6 // R e y n o l d s number of prototype :
7 Rep=Vp1∗Dp/vp
8 / / R e p =Rem
9 // T h e r e f o r e :
10 Rem=Rep ;
49
11 // V e l o c i t y of air for wind tunnel ( in ft / sec ) :
12 Vm=Rem∗vm/ (Dm/12)
13 // Drag force on prototype ( in lbf ) :
14 Fp=Fm∗( dp/dm) ∗(Vp1/Vm) ˆ2∗(Dp/ (Dm/12) ) ˆ2
15 p r i n t f ( ”\n\nRESULTS\n\n” )
16 p r i n t f ( ”\n\ nTest speed i n a i r : %. 3 f f t / s e c \n\n” ,Vm)
17 p r i n t f ( ”\n\nDrag f o r c e on p r o t o t y p e : %. 3 f l b f \n\n” , Fp)
1 // D i a m e t e r of the prototype ( in ft ) :
2 Dp=1;
3 // Speed of towing of prototype ( in knots ) :
4 Vp=5;
5 // D i a m e t e r of model ( in inches ) :
6 Dm=6;
7 // Drag for model at test condition ( in lbf ) :
8 Fm= 5 . 5 8 ;
9 // D e n s i t y of seawater at 5 C for prototype ( in slug / ft
ˆ3) :
10 dp = 1 . 9 9 ;
11 // K i n e m a t i c viscosity at 5 C for prototype ( in f t ˆ2/ sec )
:
12 vp =1.69∗10ˆ −5;
13 // D e n s i t y of air at STP for model ( in slug / ft ˆ3) :
14 dm= 0 . 0 0 2 3 8 ;
15 // K i n e m a t i c viscosity of air at STP for model ( in f t ˆ2/
sec ) :
16 vm=1.57∗10ˆ −4;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 7 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 7.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Width of the model ( in m) :
5 wm=S∗wp∗ 0 . 3 0 4 8
6 // Area of model ( in mˆ2) :
50
7 Am=Sˆ2∗Ap∗ 0 . 3 0 5 ˆ 2
8 [m n]= s i z e (V)
9 i =1:n
10 // Aerodynamic drag c o e f f i c i e n t () :
11 Cd=2.∗Fd ( i ) /d . / (V( i ) ) ˆ 2 / 0 . 0 3 0 5
12 // R e y n o l d s number :
13 Re=V( i ) ∗wm/v
14 plot ( Re , Cd) ;
15 a=gca ( )
16 a . data bounds = [ 1 0 0 0 0 0 , 0 . 4 ; 5 0 0 0 0 0 , 0 . 6 ]
17 x t i t l e ( ’ Aerodynamic drag c o e f f i c i e n t vs drag f o r c e ’ , ’
Reynolds number ’ , ’ Model Drag C o e f f . ’ )
18 // I t is seen that drag c o e f f i c i e n t becomes constant at
CD = 0 . 4 6 a b o v e Re = 4 ∗ 1 0 ˆ 5 at which speed of air is 4 0 m/
s
19 CDc= 0 . 4 6 ;
20 Va=40;
21 // Drag force ( in N) :
22 FDp=CDc/2∗d ∗(Vp∗5/18) ˆ2∗Ap∗ 0 . 3 0 5 ˆ 2
23 // Power required to pull prototype at 100 kmph ( i n W)
24 Pp=FDp∗Vp∗5/18
25 p r i n t f ( ”\n\nRESULTS\n\n” )
26 p r i n t f ( ”\n\ nSpeed above which Cd i s c o n s t a n t : %. 3 f m/
s e c \n\n” ,Va)
27 p r i n t f ( ”\n\nDrag Force : %. 3 f kN\n\n” ,FDp/1000)
28 p r i n t f ( ”\n\nPower r e q u i r e d t o p u l l p r o t o t y p e a t 100
kmph : %. 3 f kW\n\n” ,Pp/1000)
51
Figure 7.1: Output graph of S 7.05
52
Example 7.06 7.06.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 7 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 7.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // The same pump is used for both the c o n d i t i o n s . Hence :
5 D2=D1 ;
6 // The same water is used for both the conditions . Hence
:
7 d2=d1 ;
8 // Flow rate at condition 2( in gpm ) :
9 Q2=Q1∗N2/N1∗(D2/D1) ˆ3
10 // Head at condition 1( in ft ) :
11 H1=(N1∗ sqrt (Q1) / Nscu1 ) ˆ ( 4 / 3 )
12 // Head at condition 1( in ft ) :
13 H2=H1∗(N2/N1) ˆ2∗(D2/D1) ˆ2
14 / / Pump output power at condition 1( in hp ) :
15 P1=d1∗g∗Q1∗H1/ 7 . 4 8 / 6 0 / 5 5 0
16 / / Pump output power at condition 2( in hp ) :
17 P2=P1 ∗( d2/d1 ) ∗(N2/N1) ˆ3∗(D2/D1) ˆ5
18 // R e q u i r e d input power ( in hp ) :
19 Pin=P2/ E f f p
20 // S p e c i f i c speed at condition 2:
21 Nscu2=N2∗ sqrt (Q2) /H2ˆ ( 3 / 4 )
22 p r i n t f ( ”\n\nRESULTS\n\n\n” )
23 p r i n t f ( ”\n\nVolume f l o w r a t e a t c o n d i t i o n 2 : %. 3 f gpm\n
\n\n” ,Q2)
24 p r i n t f ( ”\n\nHead a t c o n d i t i o n : %. 3 f f t \n\n\n” ,H2)
25 p r i n t f ( ”\n\nPump output power a t c o n d i t i o n : %. 3 f hp\n\n
\n” , P2 )
26 p r i n t f ( ”\n\ nRequired i n p u t power : %. 3 f hp\n\n\n” , Pin )
27 p r i n t f ( ”\n\ n S p e c i f i c speed a t c o n d i t i o n 2 : %. 3 f \n\n\n” ,
Nscu2 )
1 // E f f i c i n c of pump :
2 Effp =0.8;
53
3 // D e s i g n s p e c i f i c speed ( in rpm ) :
4 Nscu1 =2000;
5 // I m p e l l e r diameter ( in inches ) :
6 D1=8;
7 // O p e r t i o n sped at esign point flow condition ( in rpm ) :
8 N1=1170;
9 // Flow rate at design point flow condition ( in gpm ) :
10 Q1=300;
11 // D e n s i t y of water ( in slug / ft ˆ3) :
12 d1 = 1 . 9 4 ;
13 // A c c e l e r a t i o n due to gravity ( in f t ˆ2/ sec ) :
14 g =32.2;
15 // Working speed 2( in rpm ) :
16 N2=1750;
54
Chapter 8
8.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Leakage flow rate ( in mm ˆ 3 / s e c ) :
5 Q=%pi /12∗D∗a ˆ3∗( p1−p2 ) ∗10ˆ3/ u/L
6 // V e l o c i t y of flow ( in m/ s e c ) :
7 V=Q/%pi/D/a /1000
8 // S p e c i f i c gravity of SAE 1 0W oil :
9 SG= 0 . 9 2 ;
10 // R e y n o l d s Number :
11 Re=SG∗dw∗V∗a/u /1000
55
12 // As Re < 1 4 0 0 , flow is laminar .
13 p r i n t f ( ”\n\nRESULTS\n\n” )
14 p r i n t f ( ”\n\ nLeakage f l o w r a t e : %. 3 f mmˆ3/ s e c \n\n” ,Q)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Shear stres ( in lbf / ft ˆ2) :
5 Tyx=u∗N∗2∗ %pi /60∗D/2/( a /2 )
6 // Torqe ( in inches −lbf ) :
7 T=%pi /2∗Tyx∗Dˆ2∗L/144
8 // Power dissipated in the bearing ( in hp ) :
9 P=T∗N/60∗2∗ %pi /12/550
10 // R e y n o l d s number :
11 Re=SG∗p∗N∗2∗ %pi / 6 0 ∗ 1 . 5 ∗ a /2/u/144
12 p r i n t f ( ”\n\nRESULTS\n\n” )
56
13 p r i n t f ( ”\n\ nTorque : %. 3 f i n c h e s −l b f \n\n” ,T)
14 p r i n t f ( ”\n\nPower d i s s i p a t e d i n t he b e a r i n g : %. 3 f hp\n\
n” ,P)
1 // t e m p e r a t u r e fo operation ( in F) :
2 T=210;
3 // D i a m e t e r of te bearing ( in inches ) :
4 D=3;
5 // D i a m e t r a l clearance ( in inches ) :
6 a =0.0025;
7 // Length of shaft ( in inhes ) :
8 L= 1 . 2 5 ;
9 // Speed of rotation of the shaft ( in rpm ) :
10 N=3600;
11 // V i s c o s i t y of the o i l ( in lbf −s / f t ˆ2) :
12 u=2.01∗10ˆ −4;
13 // S p e c i f i c gravity of SAE 1 0W :
14 SG= 0 . 9 2 ;
15 // D e n s i t y of water ( in slug / ft ˆ3)
16 p=1.94;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V i s c o s i t y of the l i q u i d ( in N− s / m ˆ 2 ) :
5 u=%pi /128∗ p ∗1000∗Dˆ4/Q/L/1000
6 // V e l o c i t y ( in m/ s e c )
7 V=Q/ ( %pi /4∗Dˆ2 ) /1000
8 // R e y n o l d s number :
9 Re=d∗V∗D/u /1000
10 p r i n t f ( ”\n\nRESULTS\n\n” )
11 p r i n t f ( ”\n\ n V i s c o s i t y o f f l u i d %. 3 f N−s /mˆ2\n\n” , u )
57
1 // Flow rate through capilarry viscometer ( in mm ˆ 3 / s e c ) :
2 Q=880;
3 // Tube length ( in m) :
4 L=1;
5 // Tube diameter ( in mm ) :
6 D= 0 . 5 ;
7 // P r e s s u r e drop ( in kPa ) :
8 p=1000;
9 // D e n s i t y of o il ( in kg /m ˆ 3 ) :
10 d=999;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // R e s e r v o i r depth required to maintain flow ( in m) :
5 D1=8∗Qˆ2/( %pi ) ˆ2/Dˆ4/ g ∗( f ∗L/D+K+1)
6 // R e y n o l d s number :
7 Re=4∗d∗Q/ ( ( %pi ) ∗u∗D)
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\ n R e s e r v o i r depth r e q u i r e d t o maintain f l o w :
%. 3 f m\n\n” ,D1)
58
13 // V i s c o s i t y ( in k g / m− s ) :
14 u=10ˆ−3;
15 // A c c e l e r a t i o n due to gravity ( in / sec ˆ2) :
16 g =9.8;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y of flow ( in ft / sec ) :
5 V=Q/24/3600/( %pi /4∗(D/12) ˆ2 ) ∗ 4 2 / 7 . 4 8
6 // Maximum spacing ( in ft ) :
7 L=2/ f ∗D/12∗( p2−p1 ) / (SG∗d ) /Vˆ2∗144
8 // Power needed at each pump ( i n hp ) :
9 Win=1/ E f f p ∗V∗%pi /4∗(D/12) ˆ2∗( p2−p1 ) /550∗144
10 p r i n t f ( ”\n\nRESULTS\n\n” )
11 p r i n t f ( ”\n\nMaximum s p a c i n g : %. 3 f f e e t \n\n” ,L)
12 p r i n t f ( ”\n\nPower needed a t each pump : %. 3 f hp\n\n” ,Win
)
59
15 // D e n s i t y ( in slug / ft ˆ3) :
16 d=1.94;
17 // V i s c o s i t y ( in lbf −sec ) :
18 u=3.5∗10ˆ −4;
19 // F r i c t i o n factor :
20 f =0.017;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y ( in ft / sec ) :
5 V2=sqrt (2∗ g∗ l / ( f ∗ ( ( L+l ) /D∗12+8)+1) )
6 // Volume flow rate ( in gpm ) :
7 Q=V2∗%pi ∗(D/12) ˆ 2 / 4 ∗ 7 . 4 8 ∗ 6 0
8 p r i n t f ( ”\n\nRESULTS\n\n” )
9 p r i n t f ( ”\n\nVolume low r a t e : %. 3 f \n\n” ,Q)
1 // H e i g h t of standpipe ( in ft ) :
2 l =80;
3 // Length of longest pipe ( in ft ) :
4 L=600;
5 // D i a m e t e r of pipe ( in inches ) :
6 D=4;
7 // F r i c t i o n factor :
8 f =0.031;
9 // A c c e l e r a t i o n due to gravityin ft / sec ˆ2) :
10 g =32.2;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.08 − data . s c i ’
3 exec ( f i l e n a m e )
60
4 // Value of dPmax ( i n psi ) :
5 dPmax=p1−p2
6 //Q in cubic feet / sec :
7 Q1= 1 5 0 0 / 6 0 / 7 . 4 8 ;
8 // I n i t i a l l y assume diameter to be 4 inches :
9 D=4;
10 // R e y n o l d s number :
11 Re=4∗Q1/%pi/v/D∗12
12 // For this value ,
13 f =0.012;
14 dP=8∗ f ∗L∗p∗Q1ˆ2/( %pi ) ˆ2/Dˆ 5 ∗ 1 7 2 8 ;
15 while (dP>dPmax)
16 dP=8∗ f ∗L∗p∗Q1ˆ2/( %pi ) ˆ2/Dˆ 5 ∗ 1 7 2 8 ;
17 i f (dP<dPmax)
18 break
19 else
20 D=D+1;
21 end
22 end
23 p r i n t f ( ”\n\nRESULTS\n\n” )
24 p r i n t f ( ”Minimum d i a m e t e r t h a t can be used :%. 1 f i n c h e s \n
\n” ,D)
1 // Length of Al tubing ( in ft ) :
2 L=500;
3 // Volume flow rate of pump output ( in gpm ) :
4 Q=1500;
5 // D i s c h a r g e pressure ( in psig ) :
6 p1 =65;
7 // S p r i n k l e r pressure ( in psig ) :
8 p2 =30;
9 // K i n e m a t i c v i s c o s i t y ( in f t ˆ2/ sec ) :
10 v =1.21∗10ˆ −5;
11 // D e n s i t y ( in slug / ft ˆ3) :
12 p=1.94;
61
Example 8.09 8.09.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Average velocity ( in ft / s ) :
5 V2=4/%pi∗Q/Dˆ2∗144
6 // R e y n o l d s number :
7 Re=V2∗D/v /12
8 // For this value ,
9 f =0.013;
10 // Power law exponent :
11 n=−1.7+1.8∗ log10 ( Re )
12 // Value of V/U :
13 v u=2∗n ˆ2/( n+1) /(2∗ n+1)
14 // Value of alpha :
15 a lpha =(1/ v u ) ˆ3∗2∗nˆ2/(3+n ) /(3+2∗n )
16 // Loss Coefficient for a square edged entrance :
17 K=2∗g∗h/V2ˆ2− f ∗L/D∗12− alpha ;
18 p r i n t f ( ”\n\nRESULTS\n\n” )
19 p r i n t f ( ”\n\ nLoss C o e f f i c i e n t f o r a s q u a r e edged
e n t r a n c e : %. 3 f \n\n” ,K)
62
Example 8.10 8.10.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 1 0 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.10 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y V1 ( i n m/ s ) :
5 V1=sqrt (2∗ g∗ z0 / 1 . 0 4 )
6 // Volume flow rate ( in mˆ3/ sec ) :
7 Q=V1∗%pi∗Dˆ2/4
8 K d i f f =1−1/A Rˆ2−Cp
9 // For 2 nd case :
10 // V e l o c i t y ( in m/ s ) :
11 V1=sqrt (2∗ g∗ z0 / 0 . 5 9 )
12 // Volume flow rate ( in mˆ3/ s ) :
13 Qd=V1∗%pi∗Dˆ2/4
14 // I n c r e a s e in discharge after addition of d i f f u s e r is :
15 dQ=(Qd−Q) /Q∗100
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\nVolume f l o w r a t e i n c a s e 1 : %. 3 f mˆ3/ s e c \n\n
” ,Q)
18 p r i n t f ( ”\n\nVolume f l o w r a t e i n c a s e 2 : %. 3 f mˆ3/ s e c \n\
n” ,Qd)
19 p r i n t f ( ”\n\ n I n c r e a s e i n d i s c h a r g e a f t e r a d d i t i o n o f
d i f f u s e r i s : %. 3 f p e r c e n t \n\n” ,dQ)
1 // N o z z l e exit diameter ( in mm ) :
2 D=25;
3 / / N / R1 value value :
4 N R=3;
5 / / AR value :
6 A R=2;
7 // S t a t i c head available from the main ( in m) :
8 z0 = 1 . 5 ;
9 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
10 g =9.8;
11 // Value of Cp :
63
12 Cp= 0 . 4 5 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 8 . 1 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 8.11 − data . s c i ’
3 exec ( f i l e n a m e )
4
5 // Value of K∗B ˆ 2 :
6 K B=Q/ ( %pi /4∗Dˆ 2 ) ∗ sqrt ( 0 . 5 ∗ d1/g/d2/h )
7 // Reynods number :
8 ReD1=4/%pi∗Q/D/v
9 / / By t r i a l and error method , the value of beta is fixed
at :
10 betta =0.66;
11 //K is then :
12 K=K B/ b e t t a ˆ2
13 // D i a m e t e r of o r i f i c e plate ( in m) :
14 Dt=b e t t a ∗D
15 // Value of p3 − p 2 ( i n N/m ˆ 2 ) :
16 P1=d1∗Qˆ2/( %pi /4∗Dˆ 2 ) ˆ 2 ∗ ( 1 / 0 . 6 5 / b e t t a ˆ2−1)
17 // Value of p1 − p 2 ( i n N/m ˆ 2 ) :
18 P2=d2∗g∗h
19 // Head loss between sections 1 and 3( in N−m / k g ) :
20 hLT=(P2−P1 ) /d1
21 // E x p r e s s i n g the permanent pressure as a fractio of the
meter d i f f e r e n t i a l :
22 C=(P2−P1 ) /P2
23 p r i n t f ( ”\n\n\nRESULTS\n\n” )
24 p r i n t f ( ”\n\ nDiameter o f t he o r i f i c e : %. 3 f m\n\n” , Dt )
25 p r i n t f ( ”\n\nHead l o s s between s e c i o n s 1 and 3 : %. 3 f N−m
/ kg \n\n” ,hLT)
64
4 D= 0 . 2 5 ;
5 // D e n s i t y of air ( in kg /m ˆ 3 ) :
6 d1 = 1 . 2 3 ;
7 // A c c e l e r a t i o n due to gravity ( in m/ s ˆ 2 ) :
8 g =9.8;
9 // D e n s i t y of water ( in kg /m ˆ 3 ) :
10 d2 =999;
11 / / Maxmum range of manometer ( in m) :
12 h=0.3;
13 // K i n e m a t i c v i s c o s i t y ( in mˆ2/ s ) :
14 v =1.46∗10ˆ −5;
65
Chapter 9
External Incompressible
Viscous Flow
9.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
When we execute S 9.08, we get Fig. 9.1.
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Change in static pressure between sections 1 and 2:
5 C=(((L−2∗d1 ) / (L−2∗d2 ) ) ˆ4−1) ∗ 1 0 0 ;
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\nChange i n s t a t i c p r e s s u r e between t he
s e c t i o n s 1 and 2 : %. 3 f p e r c e n t \n\n” ,C)
66
1 // Lengh of side of the test section ( in mm ) :
2 L=305;
3 // F r e e s t e a m speed at section 1( in m/ s e c ) :
4 U1=26;
5 // D i s p l a c e m e n t thickness at section 1( in mm ) :
6 d1 = 1 . 5 ;
7 // D i s p l a c m e n t thickness at section 2( in mm ) :
8 d2 = 2 . 1 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // R e y n o l d s number :
5 ReL=U∗L/v
6 / / FOR TURBULENT FLOW
7 // D i s t u r b a n c e thickness ( in m) :
8 dL1 =0.382/ReL ˆ 0 . 2 ∗ L
9 // D i s p l a c e m e n t thickness ( in m) :
10 function y=f ( n ) , y=dL1∗(1−n ˆ ( 1 / 7 ) )
11 endfunction
12 d l 1=intg ( 0 , 1 , f )
13 // Skin f r i c t i o n c o e f f i c i e n t :
14 Cf1 =0.0594/ReL ˆ 0 . 2
15 // Wall shear s t r e s s ( in N/m ˆ 2 ) :
16 tw1=Cf1 ∗ 0 . 5 ∗ d∗Uˆ2
17 // For LAMINAR FLOW :
18 // D i s t u r b a n c e thickness ( in m)
19 dL2=5/sqrt ( ReL ) ∗L
20 // D i s p l a c e m e n t thickness ( in m) :
21 d l 2 =0.344∗ dL2
22 // Skin f r i c t i o n c o e f f i c i e n t :
23 Cf2 =0.664/ sqrt ( ReL )
24 // Wall shear s t r e s s ( in N/m ˆ 2 ) :
25 tw2=Cf2 ∗ 0 . 5 ∗ d∗Uˆ2
26 / / COMPARISON OF VALUES WITH LAMINAR FLOW
27 // D i s t u r b a n c e thickness
67
28 D=dL1/dL2
29 // D i s p l a c e m e n t thickness
30 DS=d l 1 / d l 2
31 // Wall shear stress
32 WSS=tw1/tw2
33 p r i n t f ( ”\n\nRESULTS\n\n” )
34 p r i n t f ( ”\n\ n D i s t u r b a c e t h i c k n e s s : %. 3 f m\n\n” , dL1 )
35 p r i n t f ( ”\n\ nDisplacement t h i c k n e s s : %. 3 f m\n\n” , d l 1 )
36 p r i n t f ( ”\n\ nWall s h e a r s t r e s s : %f N/mˆ2\n\n” , tw1 )
37 p r i n t f ( ”\n\nCOMPARISON WIH LAMINAR FLOW\n\n\n” )
38 p r i n t f ( ”\n\n D i s t u r b a n c e t h i c k n e s : %. 3 f \n\n” ,D)
39 p r i n t f ( ”\n\ nDisplacement t h i c k n e s s : %. 3 f \n\n” ,DS)
40 p r i n t f ( ”\n\ nWall s h e a r s t r e s s : %. 3 f \n\n” ,WSS)
1 // V e o c i t y of flow ( in m/ s e c ) :
2 U=1;
3 // Length of flat plate ( in m) :
4 L=1;
5 // D e n s i t y of water ( in kg /m ˆ 3 ) :
6 d=999;
7 // K i n e m a t i c viscosity of water ( in mˆ2/ sec ) :
8 v=10ˆ−6;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Speed in m/ s :
5 U=s ∗ 6 0 7 6 ∗ 0 . 3 0 5 / 3 6 0 0
6 // R e y n o l d s number :
7 Re=U∗L/v
8 // Drag c o e f f i c i e n t :
9 Cd=0.455/ log10 ( Re ) ˆ2.58 −1610/Re
10 // Area ( in mˆ2) :
11 A=L∗(W+D)
68
12 // Drag force ( in N)
13 Fd=Cd∗A∗ 0 . 5 ∗ d∗Uˆ2
14 // Power required to overcome skin f r i c t i o n drag ( in W) :
15 P=Fd∗U
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\nDrag f o r c e : %f N\n\n” , Fd)
18 p r i n t f ( ”\n\nPower r e q u i r e d t o overcome s k i n f r i c t i o n
drag : %. 3 f W\n\n” ,P)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // V e l o c i t y in m/ s e c :
5 V=s ∗5/18
6 // R e y n o l d s number :
7 Re=d∗V∗D/u
8 // Value of Cd is obtained as :
9 Cd= 0 . 3 5 ;
10 // Area ( in mˆ2) :
11 A=L ˆ 2 ;
12 // Moment about the chimney base ( in N−m ) :
69
13 M0=Cd∗A∗D/4∗d∗Vˆ2
14 p r i n t f ( ”\n\nRESULTS\n\n” )
15 p r i n t f ( ”\n\ nBending moment a t t h e bottom o f th e chimney
: %. 3 f N−m\n\n” ,M0)
1 // D i a m e t e r of chimney ( in m) :
2 D=1;
3 // H e i g h t of chimney ( in m) :
4 L=25;
5 // Speed of wind ( in kmph ) :
6 s =50;
7 // D e n s i t y of air ( in kg /m ˆ 3 ) :
8 d=1.23;
9 // V i s c o s i t y of air ( in k g / ( m− s ) ) :
10 u=1.79∗10ˆ −5;
11 // P r e s s u r e ( in kPa ) :
12 p=101;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Time required to decelerate to 100 mph ( i n seconds ) :
5 t =(s1−s2 ) ∗2∗w/ ( s1 ∗ s2 ) /Cd/d/A/g ∗3600/5280
6 p r i n t f ( ”\n\nRESULTS\n\n” )
7 p r i n t f ( ”\n\nTime r e q u i r e d t o d e c e l e r a t e t o 100 mph : %. 3
f s e c o n d s \n\n” , t )
70
5 // Area of drag chute ( in ft ˆ2) :
6 A=25;
7 // Speed of dragster after deceleraton ( in mph ) :
8 s 2 =100;
9 // A c c e l e r a t i o n due to gravity ( in ft / sec ˆ2) :
10 g =32.2;
11 // D e n s i t y of air ( in slug / ft ˆ3) :
12 d=0.00238;
13 // Value of c o e f f i c i e n t of drag :
14 Cd= 1 . 4 2 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.08 − data . s c i ’
3 exec ( f i l e n a m e )
4 // P l o t t i n g velocity with drag force
5 V= 1 7 5 : 2 5 : 4 5 5 ;
6
7 [m n]= s i z e (V) ;
8 for i =1:n
9 CL( i ) =2∗W/p ∗(3600/V( i ) /5280) ˆ2/A;
10 Cd( i )=Cd0+CL( i ) ˆ2/ %pi/ a r ;
11 Fd ( i )=Cd( i ) /CL( i ) ∗W;
12 FD( i )=Fd ( i ) / 1 0 0 0 ;
13 end
14 plot (V,FD)
15 x t i t l e ( ’ F l i g h t speed vs t h r u s t ’ , ’ F l i g h t Speed ( i n mph) ’ ,
’ Drag Force ( i n 1000 l b f ) ’ )
16 // Optimum cuise speed at speed level is obtained to be
320 mph from the graph .
17 Vosl =320;
18 // R a t i o of speeds at 30000 ft and at sea level is given
by :
19 r=sqrt ( 1 / 0 . 3 7 5 ) ;
20 // S t a l l speed at 30000 ft is ( in mph ) :
21 Vs3=V s s l ∗ r ;
22 // Optimum Cruise speed at 30000 ft ( in mph ) :
71
23 Vo3=Vosl ∗ r ;
24 p r i n t f ( ”\n\nRESULTS\n\n” )
25 p r i n t f ( ”\n\nOptimum c r u i s e speed a t s e a l e v e l : %. 3 f mph
\n\n” , Vosl )
26 p r i n t f ( ”\n\ n S t a l l speed a t 30000 f t : %. 3 f mph\n\n” , Vs3 )
27 p r i n t f ( ”\n\nOptimum c r u i s e speed a t 30000 f t : %. 3 f \n\n”
, Vo3 )
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 9 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 9.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 // R e y n o l d s number :
5 // Value of wD / 2 V :
6 W=0.5∗N∗D/1000/V∗2∗ %pi /60
7 Red=V∗D/v ;
8 // For this value , CL is obtained as :
9 CL= 0 . 3 ;
10 // Aerodynamic l i f t ( in N) :
72
Figure 9.1: Output graph of S 9.08
73
11 FL=%pi /8∗CL∗(D/1000) ˆ2∗d∗Vˆ 2 ;
12 // Radius of curvature of the path in the ve rt ic a l plane
( in m) with topspin :
13 Rts=Vˆ2/( g+FL/ (m/1000) ) ;
14 // Radius of curvature without topspin ( in m) :
15 Rwts=Vˆ2/ g ;
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\ nAerodynamic l i f t a c t i n g on t h e b a l l :%. 3 f N\
n\n” ,FL)
18 p r i n t f ( ”\n\ nRadius o f c u r v a t u r e o f t he path when b a l l
has t o p s p i n :%. 3 f m\n\n” , Rts )
19 p r i n t f ( ”\n\ nRadius o f c u r v a t u r e o f t he path when b a l l
has t o p s p i n : %. 3 f m\n\n” , Rwts )
74
Chapter 10
Fluid Machinery
10.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
When S 10.03 is executed, we get Fig. 10.1. When S 10.07 is executed,
we get Fig. 10.2. When S 10.08 is executed, we get Fig. 10.3 and Fig. 10.4.
When S 10.11 is executed, we get Fig. 10.5 to Fig. 10.7.
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // I m p e l l e r exit width b2 ( i n feet ) :
5 b2=Q∗12/(2∗ %pi∗R2∗Vrb2 ∗ 7 . 4 8 ∗ 6 0 )
6 // Torque of the Shaft , Tshaft ( in ft − l b f ) :
7 T s h a f t=w∗R2ˆ2∗p∗Q∗2∗ %pi / 3 6 0 0 / 7 . 4 8 / 1 4 4
8 // Power , Wm ( i n hp ) :
9 Wm=w∗ T s h a f t ∗2∗ %pi /60/550
10 p r i n t f ( ”\n\nRESULTS\n\n” )
75
11 p r i n t f ( ”\n\ n I m p e l l e r e x i t width : %. 3 f f e e t \n\n” , b2 )
12 p r i n t f ( ”\n\ Torque i n p u t : %. 3 f f t −l b f \n\n” , T s h a f t )
13 p r i n t f ( ”\n\nPower : %. 3 f hp\n\n” ,Wm)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 U=0.5∗(Dh+Dt ) /2∗1200∗2∗ %pi /60
5 k=tand ( alpha1 )+co td ( b e t t a 1 )
6 Vn1=U/k
7 V1=Vn1/ cosd ( alpha1 )
8 Vt1=V1∗ s i n d ( alpha1 )
9 Vrb1=Vn1/ s i n d ( b e t t a 1 )
10 // Volume flow rate ( in mˆ3/ sec ) :
11 Q=%pi /4∗Vn1∗( Dtˆ2−Dhˆ2 )
12 k=(U−Vn1∗ cotd ( b e t t a 2 ) ) /Vn1
13 al pha2= atand ( k )
14 V2=Vn1/ cosd ( alpha2 )
15 Vt2=V2∗ s i n d ( alpha2 )
16 // Rotor Torque ( in N−m ) :
17 Tz=p∗Q∗(Dh+Dt ) /4∗( Vt2−Vt1 )
18 // Power required ( in W) :
19 Wm=w∗2∗ %pi /60∗Tz
76
20 p r i n t f ( ”\n\nRESULTS\n\n” )
21 p r i n t f ( ”\n\nVolume f l o w r a t e : %. 3 f mˆ3/ s e c \n\n” ,Q)
22 p r i n t f ( ”\n\ nRotor Torque : %. 3 f N−m\n\n” , Tz )
23 p r i n t f ( ”\n\nPower r e q u i r e d : %. 3 f W\n\n” ,Wm)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.03 − data . s c i ’
3 exec ( f i l e n a m e )
4 [ nQ mQ]= s i z e (Q) ;
5 [ nps mps]= s i z e ( ps ) ;
6 [ npd mpd]= s i z e ( pd ) ;
7 [ nI mI]= s i z e ( I ) ;
8 // C o r r e c t measured static pressures to he pump
centreline p1 , p2 ( i n psig ) :
9 j =1:mps ;
10 p1=ps ( j )+px∗g∗ z s /144
11 j =1:mpd ;
12 p2=pd ( j )+px∗g∗ zd /144
13 // The value of Pump head ( in feet ) :
77
14 j =1:mps ;
15 Hp=(p2 ( j )−p1 ( j ) ) / ( px∗g ) ∗144
16 // V a l u e s of Hydraulic Power delivered ( in hp ) :
17 j =1:mps ;
18 Wh=Q( j ) . ∗ ( p2 ( j )−p1 ( j ) ) / 7 . 4 8 / 6 0 ∗ 1 4 4 / 5 5 0
19 // V a l u e s of motor power output ( in hp ) :
20 j =1:mI ;
21 Pin=Effm∗ sqrt ( 3 ) ∗PF∗E∗ I ( j ) /746
22 // V a l u e s of Pump Effi ciecy :
23 j =1:mI ;
24 E f f p= Wh( j ) . / Pin ( j ) ∗100
25 // P l o t t i n g pump c h a r a c t e r i s t i c s :
26 plot (Q, Hp , ”−o” )
27 plot (Q, Pin , ”−+” )
28 plot (Q, Effp , ”−∗” )
29 x t i t l e ( ’Pump C h a r a c t e r i s t i c s ’ , ’ Volume f l o w r a t e ( i n
gpm) ’ , [ ’Pump E f f i c i n c y (%) ’,’ Pump Head ( i n
feet ) ’,’ Pump Power i n p u t ( i n hp ) ’ ])
30 l e g e n d ( ’Hp ’ , ’ Pin ’ , ’ E f f p ’ )
1 // Rate of flow in gm :
2 Q=[0 500 800 1000 1100 1200 1400 1 5 0 0 ] ;
3 // S u c t i o n pressure in psig :
4 ps =[ 0 . 6 5 0 . 2 5 −0.35 −0.92 −1.24 −1.62 −2.42 − 2 . 8 9 ] ;
5 // D i s c h a r g e pressure in psig :
6 pd = [ 5 3 . 3 4 8 . 3 4 2 . 3 3 6 . 9 33 2 7 . 8 1 5 . 3 7 . 3 ] ;
7 // Motor Current in amps :
8 I =[18 2 6 . 2 31 3 3 . 9 3 5 . 2 3 6 . 3 38 3 9 ] ;
9 // A c c e l e r a t i o n due to gravity in ft / s ˆ2:
10 g =32.2;
11 // Value of Zs in feet
12 z s =1;
13 // D e n s i t y of air in slug / ft ˆ3:
14 px = 1 . 9 4 ;
15 // Value of ZD in feet :
16 zd =3;
78
Figure 10.1: Output graph of S 10.03
79
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // S p e c i f i c speed in Us customary units :
5 Nscu=N∗Qus ˆ 0 . 5 / Hus ˆ 0 . 7 5
6 // C o n v e r s i o n to SI units :
7 w=1170∗2∗%pi / 6 0 ;
8 Qsi=Qus / 7 . 4 8 / 6 0 ∗ 0 . 3 0 5 ˆ 3 ;
9 Hsi=Hus ∗ 0 . 3 0 5 ;
10 // Energy per unit mass is :
11 h=g∗ Hsi ;
12 // S p e c i f i c speed in SI units :
13 N s s i=w∗ Qsi ˆ 0 . 5 / h ˆ 0 . 7 5
14 // C o n v e r s i o n to hertz :
15 whz=N/ 6 0 ;
16 // S p e c i f i c speed in European units :
17 Nseu=whz∗ Qsi ˆ 0 . 5 / 6 5 . 5 ˆ 0 . 7 5
18 // R e l a t i o n between s p e c i f i c speeds in Us customary
units and European units :
19 C o n v e r s i o n f a c t o r 1=Nscu/Nseu
20 // R e l a t i o n between s p e c i f i c speeds in Us customary
units and SI units :
21 C o n v e r s i o n f a c t o r 2=Nscu/ N s s i
22 p r i n t f ( ”\n\nRESULTS\n\n” )
23 p r i n t f ( ”\n\ n S p e c i f i c speed i n US customary u n i t s : %. 3 f
\n\n” , Nscu )
24 p r i n t f ( ”\n\ n S p e c i f i c speed i n SI u n i t s : %. 3 f \n\n” , N s s i
)
25 p r i n t f ( ”\n\ n S p e c i f i c s p e e d i n European u n i t s : %. 3 f \n\n”
, Nseu )
26 p r i n t f ( ”\n\ n R e l a t i o n between s p e c i f i c s p e e d s i n Us
customary u n i t s and European u n i t s : %. 3 f \n\n” ,
Conversionfactor1 )
27 p r i n t f ( ”\n\ n R e l a t i o n between s p e c i f i c s p e e d s i n Us
customary u n i t s and SI u n i t s : %. 3 f \n\n” ,
Conversionfactor2 )
80
1 // Head in Us customary units :
2 Hus = 2 1 . 9 ;
3 // Volume flow rate in US customary units :
4 Qus=300;
5 // Working seed in rpm :
6 N=1170;
7 // A c e l e r a t i o n due to graviy in m/ s ˆ 2
8 g =9.81;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Volume flow rate ( in gpm ) at shut off condition for N2
:
5 Q2so=N2/N1∗Q1so
6 // Volume flow ( in gpm ) rate at best e f f i c i e n c y for N2 :
7 Q2be=N2/N1∗Q1be
8 // R e l a t i o n between pump heads :
9 h e a d r e l a t i o n =(N2/N1) ˆ2
10 // Head ( in feet ) at shut off condition for N2 :
11 H2so=(N2/N1) ˆ2∗ H1so
12 // Head ( in feet ) at best e f f i c i e n c y condition for N2 :
13 H2be=(N2/N1) ˆ2∗ H1be
14 Q1=[Q1so Q1be ] ;
15 Q2=[Q2so Q2be ] ;
16 H1=[H1so H1be ] ;
17 H2=[H2so H2be ] ;
18 plot (Q1 , H1 , ”−o” )
19 plot (Q2 , H2 , ”−∗” )
20 x t i t l e ( ’ Comparison o f head f o r both c o n d i t i o n s ’ , ’ Volume
Flow Rate ’ , ’ Head ’ )
21 l e g e n d ( ’ 1170 ’ , ’ 1750 ’ )
81
1 // Volume flow rate ( in gpm ) at shut off condition for N1
:
2 Q1so =0;
3 // Volume flow ( in gpm ) rate at best e f f i c i e n c y for N1 :
4 Q1be=300;
5 // Head ( in feet ) at shut off condition for N1 :
6 H1so =25;
7 // Head ( in feet ) at best e f f i c i e n c y condition for N1 :
8 H1be =21.9
9 // O p e r a t i o n Speed 1:
10 N1=1170;
11 // O p e r a t i o n speed 2:
12 N2=1750;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.08 − data . s c i ’
3 exec ( f i l e n a m e )
4 // D i a m e t e r of pipe ( in feet ) :
5 Df= Di /12
6 // Area of crossection of pipe ( in ft ˆ2) :
7 A=%pi /4∗ Df ˆ2
8 // V e l o c i t y of flow ( in ft / sec ) :
9 V=Q/ 7 . 4 8 /A/60
10 // For water at T = 8 0 F , v i s c o s i t y = 0 . 9 2 7 e −5 f t ˆ2/ sec ,
Reynolds number :
11 Re=V∗Df/v
12 // F r i c t i o n loss Coefficient for this value of Re :
13 f =0.0237;
14 // For cast iron , roughness ( in feet ) :
15 e =0.00085
16 // e /D is :
17 e /Df
18 // T o t a l head loss ( in feet ) :
19 HL=K+f ∗(SE+OGV)+f ∗(L/Df )+1
20 // The heads are ( in feet ) :
82
Figure 10.2: Output graph of S 10.07
83
21 H1=patm ∗144/( p∗g )
22 Vh=Vˆ2/2/ g
23 // S u c t i o n head ( in feet ) :
24 Hs=H1+h−HL∗Vh
25 / / NPSHA ( i n feet ) :
26 NPSHA=Hs+Vh−Hv1
27 // For a flow rate of 1000 gpm , NPSHR ( i n feet ) for water
at 80 F
28 NPSHR=10
29 / / PLOTTING NPSHA AND NPSHR VERSUS VOLUME FLOW RATE :
30 // For 80 F
31 Qp= 0 : 1 0 0 : 1 5 0 0 ;
32 [ nQp mQp]= s i z e (Qp) ;
33 for j =1:mQp;
34 Vp( j )=Qp( j ) / ( 7 . 4 8 ∗A∗60) ;
35 Vhp( j ) =(Vp( j ) ) ˆ2/2/ g ;
36 Hs ( j )=H1+h−HL∗Vhp( j ) ;
37 end
38
39 for j =1:mQp;
40 NPSHAp1( j )=Hs ( j ) +(Vhp( j ) )−Hv1 ;
41 end
42
51 // For 180 F
52 for j =1:mQp;
53 NPSHAp2( j )=Hs ( j ) +(Vhp( j ) )−Hv2 ;
54 end
55 plot (Qp, NPSHAp2, ”−+” )
84
56 plot (Qh, NPSHRp, ”−o” )
57 x t i t l e ( ’ S u c t i o n head vs Flow r a t e ’ , ’ Volume f l o w r a t e (
gpm) ’ , ’ S u c t i o n Head ( f e e t ) ’ ) ;
58 l e g e n d ( ’NPSHA ’ , ’NPSHR ’ )
59 p r i n t f ( ”\n\nRESULTS\n\n” )
60 p r i n t f ( ”\n\nNPSHA a t Q=1000 gpm o f water a t 80 F : %. 2 f
f t \n\n” ,NPSHA)
61 p r i n t f ( ”\n\nNPSHR a t Q=1000 gpm o f water a t 80 F : %. 1 f
f t \n\n” ,NPSHR)
85
Figure 10.3: Output graph-1 of S 10.08
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 1 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.11 − data . s c i ’
3 exec ( f i l e n a m e )
4 [ nQ mQ]= s i z e (Q1) ;
5 [ np mp]= s i z e ( p1 ) ;
6 [ nP mP]= s i z e ( P1 ) ;
7 // Volume flow rate for fan 2( in cfm ) :
86
Figure 10.4: Output graph-2 of S 10.08
8 j =1:mQ;
9 Q2=Q1( j ) ∗(N2/N1) ∗(D2/D1) ˆ3
10 // P r e s s u r e values for fan 2( in inches of H2O ) :
11 j =1:mp;
12 p2=p1 ( j ) ∗( d2/d1 ) ∗ ( ( N2/N1) ˆ 2 ) ∗ ( ( D2/D1) ˆ 2)
13 // Power values for fan 2( in hp ) :
14 j =1:mP;
15 P2=P1 ( j ) ∗( d2/d1 ) ∗ ( ( N2/N1) ˆ 3 ) ∗ ( ( D2/D1) ˆ5 )
16 plot (Q2 , p2 )
17 x t i t l e ( ’ Performance c u r v e s ’ , ’ Volume f l o w r a t e ( i n cfm ) ’ ,
’ P r e s s u r e head ( i n i n c h e s o f water ) ’ )
18 p r i n t f ( ”\n\nType ( resume ) t o c o n t i n u e o r ( abort ) to
e x i t \n\n” )
19 pause
20 clf
21 plot (Q2 , P2 )
22 x t i t l e ( ’ Performance c u r v e s ’ , ’ Volume f l o w r a t e ( i n cfm ) ’ ,
’ Power ( i n hp ) ’ )
23 p r i n t f ( ”\n\nType ( resume ) t o c o n t i n u e o r ( abort ) to
87
e x i t \n\n” )
24 pause
25 clf
26 plot (Q2 , E f f )
27 x t i t l e ( ’ Performance c u r v e s ’ , ’ Volume f l o w r a t e ( i n cfm ) ’ ,
’ Eficiency ( in percentage ) ’ )
28 // S p e c i f i c speed of fan ( in US customary units ) at
operating point :
29 Nscu= 1 1 5 0 ∗ 1 1 0 0 0 0 ˆ 0 . 5 0 ∗ 0 . 0 4 5 ˆ 0 . 7 5 / 7 . 4 ˆ 0 . 7 5
30 // S p e c i f i c speed of fan ( in SI units ) at operating
point :
31 N s s i = 1 2 0 ∗ 3 1 1 0 ˆ 0 . 5 ∗ 0 . 7 2 1 ˆ 0 . 7 5 / 1 . 8 4 e3 ˆ 0 . 7 5
1 // D i a m e t e r of fan 1 ( in inches ) :
2 D1=36;
3 // O p e r a t i n g speed of fan 1( in rpm ) :
4 N1=600
5 // D e n s i t y of air used in fan 1( in lbm / f t ˆ 3 ) :
6 d1 = 0 . 0 7 5 ;
7 // D i a m e t e r of fan 2( in inches ) :
8 D2=42;
9 // O p e r a t i n g speed of fan 2( in rpm ) :
10 N2=1150;
11 // D e n s i t y of aif usd in fan 2( in lbm / f t ˆ 3 ) :
12 d2= 0 . 0 4 5 ;
13 // The following values are obtained from the given
graph
14 // V a l u e s of volume flow rate ( in cfm ) through fan 1:
15 Q1= [ 0 10000 20000 30000 40000 50000 6 0 0 0 0 ] ;
16 // V a l u e s of pressure ( in inches of H2O ) :
17 p1=[ 3 . 6 8 3 . 7 5 3 . 5 0 2 . 9 6 2 . 1 2 1 . 0 2 0 ] ;
18 // V a l u e s of power ( in hp ) :
19 P1=[ 1 1 . 1 1 5 . 1 1 8 . 6 2 1 . 4 2 3 . 1 2 3 . 1 2 1 . 0 ] ;
20 // E f f i c i e n c y ( in %) :
21 E f f =[0 37 59 65 57 34 0 ] ;
88
Figure 10.5: Output graph-1 of S 10.11
89
Figure 10.7: Output graph-3 of S 10.11
90
Example 10.12 10.12.sce
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 1 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.12 − data . s c i ’
3 exec ( f i l e n a m e )
4 // From given graph , for maximum delivery condition , Q
= 4 8 . 5 gpm .
5 // Volume of oil per revolution delivered by the pump ( i n
in ˆ3/ rev ) :
6 vc=Qe/N∗231
7 // V o l u m e t r i c Effciency of pump at max flow :
8 E f f v=vc / va
9 // O p e r a t i n g point of the pump is found to be at 1500
p s i g , Q = 4 6 . 5 gpm
10 // Power delivered by the f l u i d ( in hp ) :
11 Pf=Qo∗ po1 / 7 . 4 8 / 6 0 ∗ 1 4 4 / 5 5 0
12 // I n p u t power ( in hp ) :
13 Pi=Pf / E f f p
14 // The power delivered to the load ( in hp ) :
15 Pl=Q∗( po1 ) / 7 . 4 8 / 6 0 ∗ 1 4 4 / 5 5 0
16 // Power dissipated by t h r o t t l i n g ( in hp ) :
17 Pd=Pf−Pl
18 // The dissipation with the variable displacement pump (
in hp ) :
19 Pvd=Q∗( po2−po1 ) / 7 . 4 8 / 6 0 ∗ 1 4 4 / 5 5 0
20 // Power required for te load sensing pump if pump
pressure is 100 psi above that required by the load (
in hp ) :
21 P l s=Q∗ 1 0 0 / 7 . 4 8 / 6 0 ∗ 1 4 4 / 5 5 0
22 p r i n t f ( ”\n\nRESULTS\n\n” )
23 p r i n t f ( ”\n\nVolume o f o i l p er r e v o l u t i o n d e l i v e r e d by
t he pump : %. 3 f i n ˆ3/ r e v \n\n” , vc )
24 p r i n t f ( ”\n\ nRequired pump power i n p u t : %. 3 f hp\n\n” , Pi )
25 p r i n t f ( ”\n\nPower d e l i v e r d t o th e l o a d : %. 3 f hp\n\n” , Pl
)
26 p r i n t f ( ”\n\nPower d i s s i p a t e d by t h r o t t l i n g : %. 3 f hp\n\n
” ,Pd)
27 p r i n t f ( ”\n\nThe d i s s i p a t i o n with th e v a r i a b l e
91
d i s p l a c e m e n t pump : %. 3 f hp\n\n” , Pvd )
28 p r i n t f ( ”\n\nPower r e q u i r e d f o r t e l o a d s e n s i n g pump i f
pump p r e s s u r e i s 100 p s i above t h a t r e q u i r e d by t he
l o a d : %. 3 f hp\n\n” , P l s )
1 // O p e r a t i o n speed ( in rpm ) :
2 N=2000;
3 // Volume flow rate ( in gpm ) :
4 Q=20;
5 // P r e s s u r e ( in psig ) :
6 p=1500;
7 // A c t u a l Pump Displacement ( in ˆ3/ rev ) :
8 va = 5 . 9 ;
9 // Volume flow rate at operating condition ( in gpm ) :
10 Qo= 4 6 . 5 ;
11 // Volume flow rate at maximum delivery ( in gpm ) :
12 Qe = 4 8 . 5 ;
13 // P r e s s u r e at operation condition ( in psi ) :
14 po1 =1500;
15 // E f f i c i e n c y of pump at operating condition :
16 Effp =0.84;
17 // P r e s s u r e at operating condition case 2( in psig ) :
18 po2 =3000;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 1 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.14 − data . s c i ’
3 exec ( f i l e n a m e )
4 // P r o p e l l e r Thrust ( in MN ) :
5 Ft=P/V
6 // R e q u i r e d power input to the p r o p e l l e r ( in MW ) :
7 Pin=P/ E f f
8 // C a l c u l a t i n g value of D( in m) :
9 nD=V/J
10 D=(Ft ∗10ˆ6/ p / (nD) ˆ2/ Cf ) ˆ 0 . 5
92
11 // O p e r a t i n g speed ( in rpm ) is given by :
12 n=nD/D∗60
13 p r i n t f ( ”\n\nRESULTS\n\n” )
14 p r i n t f ( ”\n\ nDiameter o f t h e s i n g l e p r o p e l l e r r e q u i r e d
t o pwer t h e s h i p :%. 3 f m\n\n” ,D)
15 p r i n t f ( ”\n\ nOperating speed o f th e p r o p e l l e r : %. 3 f rpm\
n\n” , n )
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 0 . 1 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 10.16 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Tip speed ratio of windmill :
5 X=N∗2∗ %pi /60∗D/2/(V∗5/18)
6 // A c c o u n t i n g for w h i r l , max attainable e f f i c i e n c y is :
7 Efw = 0 . 5 3 ;
8 // K i n e t i c energy flux ( in W) is given by :
9 KEF=0.5∗p ∗(V∗5/18) ˆ3∗ %pi ∗(D/ 2 ) ˆ2
93
10 // A c t u a l Efficiency :
11 E f f a=Po/KEF
12 // The maximum possible thrust occurs for an
interference factor of :
13 amax = 0 . 5 ;
14 // Thrust ( in W) :
15 Kx=p ∗(V∗5/18) ˆ2∗ %pi ∗(D/ 2 ) ˆ2∗2∗amax∗(1−amax )
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\ nTip speed r a t i o o f w i n d m i l l :%. 3 f \n\n” ,X)
18 p r i n t f ( ”\n\ nActual E f f i c i e n c y : %. 3 f \n\n” , E f f a )
19 p r i n t f ( ”\n\ nActual Thrust : %. 3 f W\n\n” ,Kx)
1 // D i a m e t e r of windmill ( in m) :
2 D=26;
3 // O p e r a t i n g speed ( in rpm ) :
4 N=20;
5 // Wind speed ( in km / h r ) :
6 V=36;
7 // Power Output ( in W) :
8 Po=41000;
9 // Maximum e f f i c i e n c y occurs in following conditions :
10 // E f f i c i e n c y :
11 Eff =0.593;
12 // I n t e f e r e n c e Factor :
13 a =1/3;
14 // D e n s i t y of air ( in kg /m ˆ 3 ) :
15 p=1.23;
94
Chapter 11
Introduction to Compressible
Flow
11.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
When S 11.03 is executed, we get Fig. 11.1.
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 1 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 11.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // D e n s i t y of air at entry :
5 d1=p1 ∗10ˆ3/R/T1
6 // Area ( in mˆ2) :
7 A=m/d1/V1
8 // Change in enthalpy of air ( in kJ / kg ) :
9 dh=cp ∗(T2−T1)
10 // Change in internal energy of air ( in kJ / kg ) :
95
11 du=cv ∗(T2−T1)
12 // Change in entropy ( in k J / ( k g −K ) ) :
13 ds=cp ∗ log (T2/T1)−R/1000∗ log ( p2/p1 )
14 p r i n t f ( ”\n\nRESULTS\n\n” )
15 p r i n t f ( ”\n\nDuct Area : %. 3 f mˆ2\n\n” ,A)
16 p r i n t f ( ”\n\nChange i n e n t h a l p y o f a i r : %. 3 f kJ / kg\n\n” ,
dh )
17 p r i n t f ( ”\n\nChange i n i n t e r n a l e n e r g y o f a i r :%. 3 f kJ / kg
\n\n” , du )
18 p r i n t f ( ”\n\nChange i n e n t r o p y : %. 3 f kg−K\n\n” , ds )
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 1 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 11.03 − data . s c i ’
96
3 exec ( f i l e n a m e )
4 // V a l u e s of a l t i t u d e ( in m) :
5 Al = 0 : 1 0 0 0 : 1 5 0 0 0
6 [ nAl mAl]= s i z e ( Al ) ;
7 // V a l u e s of temperature at given a l t i t u d e s ( in K) :
8 T= [ 2 8 8 . 2 2 8 1 . 7 2 7 5 . 2 2 6 8 . 7 2 6 2 . 2 2 5 5 . 7 2 4 9 . 2 2 4 2 . 7
236.2 229.7 223.3 216.8 216.7 216.7 216.7 2 1 6 . 7 ] ;
9 [ nT mT]= s i z e (T) ;
10 // V a l u e s of speed of sound at these a l t i t u d e s ( in m/ s e c )
:
11 j =1:mT;
12 c=sqrt ( k∗R∗T( j ) )
13 // Speed of sound at sea l e v e l ( in m/ s e c ) :
14 c1=sqrt ( k∗R∗T( 1 ) )
15 plot ( c , Al )
16 x t i t l e ( ’ V a r i a t i o n o f sound speed with a l t i t u d e ’ , ’ Speed
o f sound (m/ s e c ) ’ , ’ A l t i t u d e (m) ’ )
17 p r i n t f ( ”\n\nRESULTS\n\n” )
18 p r i n t f ( ”\n\ nSpeed o f sound a t s e a l e v e l : %. 3 f m/ s e c \n\n
” , c1 )
1 // Value of k :
2 k =1.4;
3 // Gas Constant ( in K j / ( k g −K ) ) :
4 R=287;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 1 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 11.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Mach number at entry :
5 M1=V1/ sqrt ( k∗R∗T1)
6 // S t a g n a t i o n pressure at entry ( in kPa ) :
7 p01=p1 ∗(1+(k−1)/2∗M1ˆ 2 ) ˆ ( k / ( k−1) )
97
Figure 11.1: Output graph of S 11.03
98
8 // S t a g n a t i o n temperature at entry ( in K) :
9 T01=T1∗(1+(k−1)/2∗M1ˆ 2 )
10 // S t a t i c pressure at exit ( in kPa ) :
11 p2=p02 /(1+(k−1)/2∗M2ˆ 2 ) ˆ ( k / ( k−1) )
12 // T e m p e r a t u r e at exit ( in K) :
13 T2=T02/(1+(k−1)/2∗M2ˆ 2 )
14 // Change in entropy ( in k J / k g −K ) :
15 ds=cp ∗ log (T2/T1)−R/1000∗ log ( p2/p1 )
16 p r i n t f ( ”\n\nRESULTS\n\n” )
17 p r i n t f ( ”\n\ n S t a g n a t i o n p r e s s u r e a t e n t r y : %. 3 f kPa\n\n”
, p01 )
18 p r i n t f ( ”\n\ n S t a g n a t i o n t e m p e r a t u r e a t e n t r y : %. 3 f K\n\n
” , T01 )
19 p r i n t f ( ”\n\ n S t a t i c p r e s s u r e a t e x i t : %. 3 f kPa\n\n” , p2 )
20 p r i n t f ( ”\n\ nTemperature a t e x i t : %. 3 f K\n\n” ,T2)
21 p r i n t f ( ”\n\nChange i n e n t r o p y : %. 3 f kJ /kg−K\n\n” , ds )
1 // P r e s s u r e at entry ( in kPa ) :
2 p1 =350;
3 // T e m p e r a t u r e at entry ( in K)
4 T1=333;
5 // V e l o c i t y at entry ( in m/ s ) :
6 V1=183;
7 // Mach no . at exit :
8 M2= 1 . 3 ;
9 // S t a g n a t i o n pressure at exit ( in kPa ) :
10 p02 =385;
11 // S t a g n a t i o n temperature at exit ( in K) :
12 T02=350;
13 // Value of k :
14 k =1.4;
15 // Gas constant ( in N−m / k g −K )
16 R=287;
17 // S p e c i f i c heat at constant p r e s s u r e ( k J / ( k g −K ) :
18 cp =1;
99
Chapter 12
Steady One-Dimensional
Compressible Flow
12.1 Discussion
When executing the code from the editor, use the ’Execute File into Scilab’tab
and not the ’Load in Scilab’tab
The .sci files of the respective problems contain the input parameters of
the question
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 1 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.01 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Here the stagnation quantities are constant .
5 // Stagnation temperature ( in K) :
6 T0=T1∗(1+(k−1)/2∗M1ˆ 2 )
7 // S t a g n a t i o n pressure ( in kPa ) :
8 p0=p1 ∗((1+( k−1)/2∗M1ˆ 2 ) ˆ ( k / ( k−1) ) )
9 // F i n d i n g T2 / T1 :
10 T=t 2 / t 1
11 // T e m p e r a t u r e at exit ( in K) :
100
12 T2=T∗T1
13 // F i n d i n g p2 / p1 :
14 P=P2/P1
15 // P r e s s u r e at exit ( in kPa ) :
16 p2=P2∗p1
17 // D e n s i t y of air at exit ( in kg /m ˆ 3 ) :
18 d2=p2 ∗10ˆ3/R/T2
19 // V e l o c i t y of air at exit ( in m/ s e c ) :
20 V2=M2∗ sqrt ( k∗R∗T2)
21 // F i n d i n g A2 / A1 :
22 a=a2 / a1
23 // Area at exit ( in mˆ2) :
24 A2=a∗A1
25 p r i n t f ( ”\n\nRESULTS\n\n” )
26 p r i n t f ( ”\n\ n S t a g n a t i o n t e m p e r a t u r e : %. 3 f K\n\n” ,T0)
27 p r i n t f ( ”\n\ n S t a g a n t i o n p r e s s u r e : %. 3 f kPa\n\n” , p0 )
28 p r i n t f ( ”\n\ nTemperature a e x i t %. 3 f K\n\n” ,T2)
29 p r i n t f ( ”\n\ n P r e s s u r e a t e x i t : %. 3 f kPa\n\n” , p2 )
30 p r i n t f ( ”\n\ nDensity o f a i r a t e x i t : %. 3 f kg /mˆ3\n\n” , d2
)
31 p r i n t f ( ”\n\ n V e l o c i t y o f a i r a t e x i t : %. 3 f m/ s e c \n\n” ,V2
)
32 p r i n t f ( ”\n\ nArea a t e x i t : %. 3 f \n\n” ,A2)
101
13 // For the Mach no : 0 . 3 :
14 / / T / T0 :
15 t 1 =0.9823 ,
16 // p / p0 :
17 P1 = 0 . 9 3 9 5 ;
18 // d / d0 :
19 den1 = 0 . 9 5 6 4 ;
20 //A/A ∗ :
21 a1 = 2 . 0 3 5 ;
22 // For the Mach no : 0 . 8 :
23 // T / T0 :
24 t2 =0.8865;
25 // p / p0 :
26 P2 = 0 . 6 5 6 0 ;
27 // d / d0 :
28 den2 = 0 . 7 4 0 0 ;
29 //A/A ∗ :
30 a2 = 1 . 0 3 8 ;
31 // Gas Constant ( in N−m / k g −K ) :
32 R=287;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 2 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.02 − data . s c i ’
3 exec ( f i l e n a m e )
4 // C h e c k i n g for chocking :
5 c=pb/p0 ;
6 i f ( c <=0.528)
7 // choked
8 else
9 // Not choked
10 // T h e r e f o r e pressure at exit = back pressure
11 pe=pb ;
12 // Mach number at exit :
13 Me=((( p0/ pe ) ˆ ( ( k−1)/k ) −1) ∗ ( 2 / ( k−1) ) ) ˆ 0 . 5
14 // T e m p e r a t u r e at exit ( in K) :
15 Te=T0/(1+(k−1)/2∗Meˆ2 )
102
16 // V e l o c i t y at exit ( in m/ s e c ) :
17 Ve=Me∗ sqrt ( k∗R∗Te )
18 // D e n s i t y at exit ( in kg /m ˆ 3 ) :
19 de=pe ∗10ˆ3/R/Te
20 // Mass flow rate of a i r ( kg / s e c ) :
21 m=de ∗Ve∗Ae
22 end ;
23 p r i n t f ( ”\n\nRESULTS\n\n” )
24 p r i n t f ( ”\n\nMach number a t e x i t : %. 3 f \n\n” ,Me)
25 p r i n t f ( ”\n\nMass f l o w r a t e o f a i r : %. 3 f kg / s e c \n\n” ,m)
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 3 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.03 − data . s c i ’
3 exec ( f i l e n a m e )
4 // S a t u r a t i o n pressure ( in psia ) :
5 p0=p1 ∗(1+(k−1)/2∗M1ˆ 2 ) ˆ ( k / ( k−1) )
6 // C h e c k i n g for choking :
7 x=pb/p0 ;
8 i f ( x >0.528)
9 // Not choked
10 else
103
11 // choked
12 end
13 // As there is choking :
14 Mt=1;
15 // V e l o c i t y at entry :
16 V1=M1∗ sqrt ( k∗R∗(T1+460) ∗ 3 2 . 2 )
17 // D e n s i t y at the entry ( in lbm / f t ˆ 3 ) :
18 d1=p1 / (R∗(T1+460) ) ∗144
19 // Mass flow rate ( in lbm / s e c ) :
20 m=d1∗V1∗A1
21 // F i n d i n g the valueof A1 / A ∗ ;
22 A=1/M1∗((1+( k−1)/2∗M1ˆ 2 ) /(1+(k−1) /2 ) ) ˆ ( ( k+1) / ( 2 ∗ ( k−1) ) )
23 // For choked flow , A t =A ∗
24 At=A1/A
25 p r i n t f ( ”\n\nRESULTS\n\n” )
26 p r i n t f ( ”\n\nMach number a t t h r o a t : %. 3 f \n\n” ,Mt)
27 p r i n t f ( ”\n\nMass f l o w r a t e : %. 3 f lbm/ s e c \n\n” ,m)
28 p r i n t f ( ”\n\ nArea a t t h r o a t : %. 3 f f t ˆ2\n\n” , At )
104
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 4 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.04 − data . s c i ’
3 exec ( f i l e n a m e )
4 // T e m p e r a t u r e at the throat ( in K) :
5 Tt=T0/(1+(k−1)/2∗Mtˆ 2)
6 // P r e s s u r e at throat ( in kPa ) :
7 pt=p0 ∗( Tt/T0) ˆ ( k / ( k−1) )
8 // D e n s i t y at throat ( in kg /m ˆ 3 ) :
9 dt=pt ∗1000/R/Tt
10 // V e l o c i t y at the throat ( in m/ s ) :
11 Vt=Mt∗ sqrt ( k∗R∗Tt )
12 // Value of At /A ∗ :
13 Ax=1/Mt∗((1+( k−1)/2∗Mtˆ 2) /(1+(k−1) /2 ) ) ˆ ( ( k+1) / ( 2 ∗ ( k−1) )
)
14 // S t a g n a t i o n properties are constant
15 // As a result pressure at exit ,
16 pe=pb ;
17 // The Mach number at the exit is therefore given by
18 Me=sqrt ( ( ( p0/ pe ) ˆ ( ( k−1)/k ) −1) ∗2/( k−1) )
19 // C a l c u l a t i n g the value of Ae / A ∗ :
20 Ay=1/Me∗((1+( k−1)/2∗Meˆ2 ) /(1+(k−1) /2 ) ) ˆ ( ( k+1) / ( 2 ∗ ( k−1) )
)
21 // Value of A∗( in mˆ2) :
22 A s t a r=Ae/Ay
23 // Area at throat ( in mˆ2) :
24 At=Ax∗ A s t a r
25 p r i n t f ( ”\n\nRESULTS\n\n” )
26 p r i n t f ( ”\n\ nTemperature a t th e t h r o a t : %. 3 f K\n\n” , Tt )
27 p r i n t f ( ”\n\ n P r e s s u r e a t t h r o a t : %. 3 f kPa\n\n” , pt )
28 p r i n t f ( ”\n\ nDensity a t t h r o a t : %. 3 f kg /mˆ3\n\n” , dt )
29 p r i n t f ( ”\n\ n V e l o c i t y a t t h e t h r o a t : %. 3 f m/ s e c \n\n” , Vt )
30 p r i n t f ( ”\n\nMach number a t th e e x i t : %. 3 f \n\n” ,Me)
31 p r i n t f ( ”\n\ nArea a t t h r o a t : %. 3 f mˆ2\n\n” , At )
1 // S t a g n a t i o n temperature ( in K) :
2 T0=350;
105
3 // S t a g n a t i o n pressure ( in kPa ) :
4 p0 =1000;
5 // Back Pressure ( in kPa ) :
6 pb =954;
7 // Mach number at throat :
8 Mt= 0 . 6 8 ;
9 // Area at exit ( in mˆ2) :
10 Ae = 0 . 0 0 1 ;
11 // Value of k :
12 k =1.4;
13 // Gas Constant ( in N−m / k g −K ) :
14 R=287;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 5 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.05 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Mach number at the exit :
5 Me=sqrt ( ( ( p0/ pe ) ˆ ( ( k−1)/k ) −1) ∗2/( k−1) )
6 // T e m p e r a t u r e at exit ( in K) :
7 Te=T0/(1+(k−1)/2∗Meˆ2 )
8 // Mass flow rate ( in kg / s ) :
9 m=pe ∗1000∗Me∗ sqrt ( k/R/Te ) ∗Ae
10 p r i n t f ( ”\n\nRESULTS\n\n” )
11 p r i n t f ( ”\n\nMach number a t th e e x i t : %. 3 f \n\n” ,Me)
12 p r i n t f ( ”\n\nMass f l o w r a t e : %. 3 f kg / s e c \n\n” ,m)
1 // S t a g n a t i o n temperature ( in K) :
2 T0=350;
3 // S t a g n a t i o n pressure ( in kPa ) \
4 p0 =1000;
5 // P r e s s u r e at exit ( in kPa )
6 pe = 8 7 . 5 ;
7 // Back Pressure ( in kPa ) :
8 pb=50;
106
9 // Area at exit ( in mˆ2) :
10 Ae = 0 . 0 0 1 ;
11 // Gas Constant ( in N−m / k g −K )
12 R=287;
13 // Value of k :
14 k =1.4;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 6 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.06 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Mach umber at section 1:
5 M1=sqrt ( ( 2 / ( k−1) ∗ ( ( p0/p1 ) ˆ ( ( k−1)/k ) −1) ) )
6 // T e m p e r a t u r e at section 1( in K) :
7 T1=T0/(1+(k−1)/2∗M1ˆ 2 )
8 // D e n s i t y at section 1( in kg /m ˆ 3 ) :
9 d1=p1 ∗1000/R/T1
10 // V e l o c i t y at section1 ( in m/ s e c ) :
11 V1=M1∗ sqrt ( k∗R∗T1)
12 // Area at section 1( in mˆ2) :
13 A1=%pi /4∗Dˆ2
14 // Mass flow rate ( in kg / s e c ) :
15 m=d1∗A1∗V1
16 // Mach number at section 2:
17 M2=sqrt ( ( 2 / ( k−1) ) ∗ ( ( T0/T2) −1) )
18 // V e l o c i t y at section 2( in m/ s e c ) :
19 V2=M2∗ sqrt ( k∗R∗T2)
20 // D e n s i t y at section 2( in kg /m ˆ 3 ) :
21 d2=d1∗V1/V2
22 // P r e s s u r e at section 2( in kPa ) :
23 p2=d2 /1000∗R∗T2
24 // S t a g n a t i o n pressure at section 2( in kPa ) :
25 p02=p2 ∗(1+(k−1)/2∗M2ˆ 2 ) ˆ ( k / ( k−1) )
26 // F o r c e exerted on control volume by duct wall ( in N) :
27 F=(p2−p1 ) ∗1000∗A1+m∗(V2−V1)
28 p r i n t f ( ”\n\nRESULTS\n\n” )
29 p r i n t f ( ”\n\nMass f l o w r a t e : %. 3 f kg / s e c \n\n” ,m)
107
30 p r i n t f ( ”\n\ nLocal i s e n t r o p i c s t a g n a t i o n p r e s s u r e a t
s e c t i o n 2 :%. 3 f kPa\n\n” , p02 )
31 p r i n t f ( ”\n\ nForce e x e r t e d on c o n t r o l volume by duct
w a l l :%. 3 f N\n\n” ,F)
1 // D i a m e t e r of pipe ( in m) :
2 D=7.16∗10ˆ −3;
3 // S t a g n a t i o n pressure ( in kPa ) :
4 p0 =101;
5 // S t a g n a t i o n temperature ( in K) :
6 T0=296;
7 // P r e s s u r e at section 1( in kPa ) :
8 p1 = 9 8 . 5 ;
9 // T e m p e r a t u r e at section 2( in K) :
10 T2=287;
11 // Gas constant ( in N−m / k g −K ) :
12 R=287;
13 // Value of k :
14 k =1.4;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 7 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.07 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Mach number at section 1:
5 M1= sqrt ( 2 / ( k−1) ∗ ( ( p0 / ( p0+p1 ) ) ˆ ( ( k−1)/k ) −1) )
6 // T e m p e r a t u r e at section 1( in K) :
7 T1=T0/(1+(k−1) /2∗(M1) ˆ2 )
8 V1=M1∗ sqrt ( k∗R∗T1)
9 // P r e s s u r e at section 1( in kPa ) :
10 p1=g∗dHg∗(760 −18.9) ∗10ˆ−3
11 // D e n s i t y at section 1( in kg /m ˆ 3 ) :
12 d1=p1/R/T1
13 // At M1 = 0 . 1 9 0 ,
14 // ( p / p ∗) 1 :
108
15 P1=5.745
16 // ( f L m a x / Dh ) 1 :
17 F1=16.38
18 // Value of L13 ( in m) :
19 L13=F1∗D/ f
20 // Value of ( p/p ∗) 2:
21 P2=p2/p1∗P1
22 // For this value , Value of M2 is obtained as 0.4
23 M2= 0 . 4 ;
24 // For M=0.4 , fLmX /D = 2 . 3 0 9
25 F2=2.309
26 // Value of L23 ( in m) :
27 L23=F2∗D/ f
28 // Length of duct between section 1 and 2( in m) :
29 L12=L13−L23
30 p r i n t f ( ”\n\nRESULTS\n\n” )
31 p r i n t f ( ”\n\ nLength o f duct r e q u i r e d f o r c h o k i n g from
s e c t i o n 1 : %3f m\n\n” , L13 )
32 p r i n t f ( ”\n\nMach number s e c t i o n 2 : %. 3 f \n\n” ,M2)
33 p r i n t f ( ”\n\ Length o f duct between s e c t i o n 1 and 2 : %. 3 f
m\n\n” , L12 )
1 // S t a g n a t i o n temperature ( in K) :
2 T0=296;
3 // S t a g n a t i o n pressure ( in mm of Hg ) :
4 p0 =760;
5 // Gauge pressure at section 1( in mm of Hg ) :
6 p1 = −18.9;
7 // Gauge pressure at section2 ( in mm of Hg ) :
8 p2=−412;
9 // Mach number at 3:
10 M3=1;
11 // Gas constant :
12 R=287;
13 // D e n s i t y of m e r c u r y ( kg /m ˆ 3 ) :
14 dHg=13500;
109
15 // A c c e l e r a t i o n due to gravity ( in m/ s e c ˆ 2 ) :
16 g =9.8;
17 // F r i c t i o n factor :
18 f =0.0235;
19 // D i a m e t e r of tube ( in m) :
20 D=7.16∗10ˆ −3;
21 // Value of k :
22 k =1.4;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 8 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.08 − data . s c i ’
3 exec ( f i l e n a m e )
4 // D e n s i t y at section 1( in lbm / f t ˆ 3 ) :
5 d1=p1 ∗144/R/T1
6 // V e l o c i t y at section 2( in ft / sec ) :
7 V2=(p1−p2 ) ∗144/ d1/V1∗32.2+V1
8 // D e n s i t y at section 2( in lbm / f t 3 ) :
9 d2=d1∗V1/V2
10 // T e m p e r a t u r e at section 2( in R) :
11 T2=p2/d2/R∗144
12 // Mach number at section 2:
13 M2=V2/ sqrt ( k∗R∗ 3 2 . 1 6 ∗ T2)
14 // S t a g n a t i o n Temperature at section 2( in R) :
15 T02=T2∗(1+(k−1)/2∗M2ˆ 2 )
16 // S t a g n a t i o n pressure at section 2 ( in psia ) :
17 p02=p2 ∗( T02/T2) ˆ ( k / ( k−1) )
18 // Mach Number at section 1:
19 M1=V1/ sqrt ( k∗R∗ 3 2 . 1 6 ∗ T1)
20 // S t a g n a t i o n temperature at section 1( in R) :
21 T01=T1∗(1+(k−1)/2∗M1ˆ 2 )
22 // Energy added ( in Btu / lbm ) :
23 E=Cp∗( T02−T01 )
24 // Change in entropy ( in B t u / ( l b m −R ) ) :
25 dS=Cp∗ log (T2/T1) −(Cp−Cv) ∗ log ( p2/p1 )
26 p r i n t f ( ”\n\nRESULTS\n\n” )
27 p r i n t f ( ”\n\ n V e l o c i t y a t s e c t i o n 2 : %. 3 f f t / s e c \n\n” ,V2)
110
28 p r i n t f ( ”\n\ nDensity a t s e c t i o n 2 : %. 3 f lbm/ f t ˆ3\n\n” , d2
)
29 p r i n t f ( ”\n\ nTemperature a t s e c t i o n 2 : %. 3 f R\n\n” ,T2)
30 p r i n t f ( ”\n\ n S t a g n a t i o n Temperature a t s e c t i o n 2 : %. 3 f R
\n\n” , T02 )
31 p r i n t f ( ”\n\ n S t a g n a t i o n p r e s s u r e a t s e c t i o n 2 : %. 3 f p s i a
\n\n” , p02 )
32 p r i n t f ( ”\n\ nEnergy added : %. 3 f Btu/lbm\n\n” ,E)
33 p r i n t f ( ”\n\nChange i n e n t r o p y : %. 3 f Btu / ( lbm−R) \n\n” , dS
)
1 // T e m p e r a t u r e at section 1( in R) :
2 T1=600;
3 // P r e s s u r e at section 1( in psia ) :
4 p1 =20;
5 // P r e s s u r e at section 2( in psia ) :
6 p2 =10;
7 // V e l o c i t y at section 1( in ft / s ) :
8 V1=360;
9 // Cross − s e c t i o n a l area of the duct ( in ft ˆ2) :
10 A= 0 . 2 5 ;
11 // Gas Constant ( in f t − l b f / l b m −R ) :
12 R= 5 3 . 3 ;
13 // Value of k :
14 k =1.4;
15 // S p e c i f i c heat at constant presure ( in B t u / l b m −R ) :
16 Cp= 0 . 2 4 ;
17 // S p e c i f i c heat at constant volume ( in B t u / l b m −R ) :
18 Cv= 0 . 1 7 1 ;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 0 9 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.09 − data . s c i ’
3 exec ( f i l e n a m e )
4 // Mach nuber at section 1:
111
5 M1=V1/ sqrt ( k∗R∗T1)
6 // For these value of M1 and M2 , t h e following values are
obtained :
7 / / ( To / T0 ∗ ) 1 :
8 t01 =0.7934;
9 / / ( T0 / T0 ∗ ) 2 :
10 t02 =0.9787;
11 // ( p0 / p0 ∗) 1 :
12 P01 = 1 . 5 0 3 ;
13 // ( p0 / p0 ∗) 2 :
14 P02 = 1 . 0 1 9 ;
15 // (T/T ∗) 1 :
16 t1 =0.5289;
17 // (T/T ∗) 2 :
18 t2 =0.9119;
19 // ( p / p ∗) 1 :
20 P1 = 0 . 3 6 3 6 ;
21 // ( p / p ∗) 2 :
22 P2 = 0 . 7 9 5 8 ;
23 // (V/V ∗) 1 :
24 v1 = 1 . 4 5 5 ;
25 // (V/V ∗) 2 :
26 v2 = 1 . 1 4 6 ;
27 // Value of T2 / T1 :
28 t=t 2 / t 1
29 // T e m p e r a t u r e at section 2( in K) :
30 T2=t ∗T1
31 // Value of p2 / p1 :
32 p=P2/P1
33 // P r e s s u r e at section 2( in kPa ) :
34 p2=p∗p1
35 // Value of V2 / V1 :
36 v=v2 / v1
37 // V e l o c i t y at section 2( in m/ s e c ) :
38 V2=v∗V1
39 // D e n s i t y at section 2( in kg /m ˆ 3 ) :
40 d2=p2 ∗1000/R/T2
41 // At M1 , T / T0 = 0 . 5 5 5 6
112
42 T01=T1 / 0 . 5 5 5 6
43 // At M2 , T / T0 = 0 . 7 7 6 4
44 T02=T2 / 0 . 7 7 6 4
45 // Heat added ( in kJ / kg ) :
46 E=Cp∗( T02−T01 )
47 // Change in e n t r o p y ( k J / k g −K ) :
48 dS=Cp∗ log (T2/T1)−R∗ log ( p2/p1 ) /1000
49 p r i n t f ( ”\n\nRESULTS\n\n” )
50 p r i n t f ( ”\n\ nTemperature a t s e c t i o n 2 : %. 3 f K\n\n” ,T2)
51 p r i n t f ( ”\n\ n P r e s s u r e a t s e c t i o n 2 : %. 3 f kPa\n\n” , p2 )
52 p r i n t f ( ”\n\ n V e l o c i t y a t s e c t i o n 2 : %. 3 f m/ s e c \n\n” ,V2)
53 p r i n t f ( ”\n\ nDensity a t s e c t i o n 2 : %. 3 f kg /mˆ3\n\n” , d2 )
54 p r i n t f ( ”\n\ n S t a g n a t i o n t e m p e r a t u r e a t s e c t i o n 2 : %. 3 f K
\n\n” , T02 )
55 p r i n t f ( ”\n\ nHeat added : %. 3 f kJ / kg \n\n” ,E)
56 p r i n t f ( ”\n\nChange i n e n t r o p y : %. 3 f kJ / kg \n\n” , dS )
1 // T e m p e r a t u r e at section 1( in K) :
2 T1=333;
3 // P r e s s u r e at section 1( in kPa ) :
4 p1 =135;
5 // V e l o c i t y at section 1( in m/ s e c ) :
6 V1=732;
7 // Mach number at section 2:
8 M2= 1 . 2 ;
9 // Gas constant ( in N−m / k g −K ) :
10 R=287;
11 // Value of k :
12 k =1.4;
13 // S p e c i f i c heat at constant presure ( in N−m / k g −K ) :
14 Cp=1;
1 pathname=g e t a b s o l u t e f i l e p a t h ( ’ 1 2 . 1 0 . s c e ’ )
2 f i l e n a m e=pathname+f i l e s e p ( )+ ’ 12.10 − data . s c i ’
113
3 exec ( f i l e n a m e )
4 // D e n s i t y at section 1( in kg /m ˆ 3 ) :
5 d1=p1 ∗1000/R/T1
6 // Mach number at section 1:
7 M1=V1/ sqrt ( k∗R∗T1)
8 // S t a g n a t i o n temperature at section 1( in K) :
9 T01=T1∗(1+(k−1)/2∗M1ˆ 2 )
10 // S t a g n a t i o n pressure at section 1( in kPa ) :
11 p01=p1 ∗(1+(k−1)/2∗M1ˆ 2 ) ˆ ( k / ( k−1) )
12 // The following values are obtained from the appendix :
13 // po2 / p01 :
14 p0 = 0 . 7 2 0 9 ;
15 / / T2 / T1 :
16 T= 1 . 6 8 7 ;
17 // p2 / p1 :
18 p=4.5;
19 / / V2 / V1 :
20 V= 0 . 3 7 5 0 ;
21 // T e m p e r a t u r e at section 2 ( in K) :
22 T2=T∗T1
23 // P r e s s u r e at section 2( in kPa ) :
24 p2=p∗p1
25 // V e l o c i t y at section 2( in m/ s e c ) :
26 V2=V∗V1
27 // D e n s i t y at section 2 ( in kg /m ˆ 3 ) :
28 d2=p2 ∗1000/R/T2
29 // S t a g n a t i o n pressure at section 2( in kPa ) :
30 p02=p0∗ p01
31 // S t a g n a t i o n temperature at section 2( in K) :
32 T02=T01 ;
33 // Change in entropy ( in k J / ( k g −K ) ) :
34 dS=−R/1000∗ log ( p0 )
35 p r i n t f ( ”\n\nRESULTS\n\n” )
36 p r i n t f ( ”\n\ nTemperature a t s e c t i o n 2 : %. 3 f K\n\n” ,T2)
37 p r i n t f ( ”\n\ n P r e s s u r e a t s e c t i o n 2 : %. 3 f kPa\n\n” , p2 )
38 p r i n t f ( ”\n\ n V e l o c i t y a t s e c t i o n 2 : %. 3 f m/ s e c \n\n” ,V2)
39 p r i n t f ( ”\n\ nDensity a t s e c t i o n 2 : %. 3 f kg /mˆ3\n\n” , d2 )
40 p r i n t f ( ”\n\ n S t a g n a t i o n p r e s s u r e a t s e c t i o n 2 : %. 3 f kPa\
114
n\n” , p02 )
41 p r i n t f ( ”\n\nChange i n e n t r o p y : %. 3 f kg−K\n\n” , dS )
42 p r i n t f ( ”\n\ n S t a g n a t i o n t e m p e r a t u r e a t s e c t i o n 2 : %. 3 f K
\n\n” , T02 )
1 // T e m p e r a t u r e at section 1( in K) :
2 T1=278;
3 // P r e s s u r e at section 1( in kPa ) :
4 p1 =65;
5 // V e l o c i t y at section 1( in m/ s e c ) :
6 V1=668;
7 // Value of gas constant ( in N−m / k g −K ) :
8 R=287;
9 // Value of k :
10 k =1.4;
115