Fluid mechncs by Mcdonald

Embed Size (px)

Citation preview

  • 8/7/2019 Fluid mechncs by Mcdonald

    1/116

    Scilab Code for

    Introduction to Fluid Mechanics

    by Fox and McDonald1

    Created byEswar Prasad

    4th Year StudentB.E. (Mech. Engg.)

    National Institute of Technology, Trichy

    College Teacher and ReviewerShivraj Deshmukh

    Ph.D studentIIT Bombay

    29 June 2010

    1Funded by a grant from the National Mission on Education through ICT,http://spoken-tutorial.org/NMEICT-Intro. This Textbook companion and scilabcodes written in it can be downloaded from the website www.scilab.in

  • 8/7/2019 Fluid mechncs by Mcdonald

    2/116

    Book Details

    Authors: Robert W. Fox and Alan T. McDonald

    Title: Introduction to Fluid Mechanics

    Publisher: John Wiley & Sons

    Edition: 5th

    Year: 2001

    Place: New Delhi

    ISBN: 9971-51-355-2

    1

  • 8/7/2019 Fluid mechncs by Mcdonald

    3/116

    Contents

    List of Scilab Code 4

    1 Introduction 101.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2 Fundamental Concepts 12

    2.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    3 Fluid Statics 14

    3.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    4 Basic Equations in Integral form for a Control Volume 23

    4.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    5 Introducton to Differential Analysis of Fluid Motion 38

    5.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    6 Incompressible Inviscid Flow 42

    6.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    6.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    7 Dimensional Analysis and Simlitude 49

    7.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    2

  • 8/7/2019 Fluid mechncs by Mcdonald

    4/116

    8 Internal Incompressible Viscous Flow 55

    8.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    9 External Incompressible Viscous Flow 66

    9.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    10 Fluid Machinery 75

    10.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7510.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    11 Introduction to Compressible Flow 95

    11.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9511.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

    12 Steady One-Dimensional Compressible Flow 100

    12.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10012.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    3

  • 8/7/2019 Fluid mechncs by Mcdonald

    5/116

    List of Scilab Code

    1.01 1.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.01d 1.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 101.02 1.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.02d 1.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 112.02 2.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.02d 2.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 133.01 3.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.01d 3.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 153.03 3.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.03d 3.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 173.04 3.04.sci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.04d 3.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 183.05 3.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.05d 3.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 203.06 3.06.sci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.06d 3.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 203.07 3.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.07d 3.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 214.01 4.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.01d 4.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 244.02 4.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.02d 4.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 254.03 4.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.03d 4.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    4.04 4.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.04d 4.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 274.05 4.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.05d 4.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    4

  • 8/7/2019 Fluid mechncs by Mcdonald

    6/116

    4.06 4.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    4.06d 4.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 284.07 4.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.07d 4.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 294.08 4.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.08d 4.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 304.09 4.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.09d 4.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 304.10 4.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.10d 4.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 314.11 4.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.11d 4.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    4.12 4.12.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.12d 4.12-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 344.14 This is some example . . . . . . . . . . . . . . . . . . . . . 344.14d 4.14-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 354.16 4.16.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.16d 4.16-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 364.17 4.17.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.17d 4.17-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 365.02 5.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.02d 5.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    5.07 5.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.07d 5.07d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.08 5.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.08d 5.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 405.09 5.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.09d 5.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 416.01 6.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.01d 6.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 426.02 6.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436.02d 6.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 436.03 6.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    6.03d 6.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 446.04 6.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.04d 6.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 446.05 6.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456.05d 6.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    5

  • 8/7/2019 Fluid mechncs by Mcdonald

    7/116

    6.06 6.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    6.06d 6.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 466.08 6.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466.08d 6.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 476.09 6.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476.09d 6.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 487.04 7.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.04d 7.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 507.05 7.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507.05d 7.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 517.06 7.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.06d 7.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    8.01 8.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558.01d 8.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 568.02 8.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568.02d 8.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 578.04 8.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578.04d 8.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 578.05 8.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588.05d 8.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 588.06 8.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598.06d 8.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 59

    8.07 8.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.07d 8.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 608.08 8.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.08d 8.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 618.09 8.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628.09d 8.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 628.10 8.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.10d 8.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 638.11 8.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648.11d 8.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 649.01 9.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    9.01d 9.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 669.04 9.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679.04d 9.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 689.05 9.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689.05d 9.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    6

  • 8/7/2019 Fluid mechncs by Mcdonald

    8/116

    9.06 9.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    9.06d 9.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 709.07 9.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709.07d 9.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 709.08 9.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719.08d 9.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 729.09 9.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729.09d 9.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . . 7410.01 10.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7510.01d 10.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 7610.02 10.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7610.02d 10.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 77

    10.03 10.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7710.03d 10.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 7810.06 10.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7910.06d 10.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 8010.07 10.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.07d 10.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 8110.08 10.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8210.08d 10.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 8510.11 10.11.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8610.11d 10.11-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 88

    10.12 10.12.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9110.12d 10.12-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9210.14 10.14.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9210.14d 10.14-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9310.16 10.16.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9310.16d 10.16-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9411.01 11.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9511.01d 11.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9611.03 11.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9611.03d 11.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9711.04 11.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    11.04d 11.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 9912.01 12.01.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10012.01d 12.01-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10112.02 12.02.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10212.02d 12.02-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 103

    7

  • 8/7/2019 Fluid mechncs by Mcdonald

    9/116

    12.03 12.03.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    12.03d 12.03-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10412.04 12.04.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10412.04d 12.04-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10512.05 12.05.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10612.05d 12.05-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10612.06 12.06.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10712.06d 12.06-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10812.07 12.07.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10812.07d 12.07-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 10912.08 12.08.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11012.08d 12.08-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 111

    12.09 12.09.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11112.09d 12.09-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 11312.10 12.10.sce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11312.10d 12.10-data.sci . . . . . . . . . . . . . . . . . . . . . . . . . 115

    8

  • 8/7/2019 Fluid mechncs by Mcdonald

    10/116

    List of Figures

    3.1 Output graph of S 3.01 . . . . . . . . . . . . . . . . . . . . . 16

    4.1 Output graph of S 4.11 . . . . . . . . . . . . . . . . . . . . . 33

    7.1 Output graph of S 7.05 . . . . . . . . . . . . . . . . . . . . . 52

    9.1 Output graph of S 9.08 . . . . . . . . . . . . . . . . . . . . . 73

    10.1 Output graph of S 10.03 . . . . . . . . . . . . . . . . . . . . 7910.2 Output graph of S 10.07 . . . . . . . . . . . . . . . . . . . . 8310.3 Output graph-1 of S 10.08 . . . . . . . . . . . . . . . . . . . 8610.4 Output graph-2 of S 10.08 . . . . . . . . . . . . . . . . . . . 8710.5 Output graph-1 of S 10.11 . . . . . . . . . . . . . . . . . . . 8910.6 Output graph-2 of S 10.11 . . . . . . . . . . . . . . . . . . . 89

    10.7 Output graph-3 of S 10.11 . . . . . . . . . . . . . . . . . . . 9011.1 Output graph of S 11.03 . . . . . . . . . . . . . . . . . . . . 98

    9

  • 8/7/2019 Fluid mechncs by Mcdonald

    11/116

    Chapter 1

    Introduction

    1.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    1.2 Scilab Code

    Example 1.01 1.01.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+1.01data . sc i 3 exec ( f i l e na me )4 / / H e a t a d d e d d u r i n g t h e p r o c e s s ( i n k J ) :

    5 Q12=mcp (T2T1)6 p r i n t f ( \n\nRESULTS\n\n )7 p r i n t f ( \n\nHea t a dd ed d u r in g t h e p r o c e s s : %f kJ\n\n ,

    Q12/1000)

    Example 1.01d 1.01-data.sci

    1 / / M a s s o f o x y g e n p r e s e n t ( i n k g ) :

    2 m=0.95;

    10

  • 8/7/2019 Fluid mechncs by Mcdonald

    12/116

    3 / / I n i t i a l t e m p e r a t u r ( i n K ) :

    4

    T1=300;5 / / F i n a l t e m p e r a t u r e o f o x y g e n ( i n K ) :

    6 T2=900;7 / / P r e s s u r e o f o x y g e n ( i n k P a ) :

    8 p=150;9 / / S p e c i f i c h e a t a t c o n s t a n t p r e s s u r e ( i n J / k g K ) :

    10 c p = 9 0 9 . 4 ;

    Example 1.02 1.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+1.02data . sc i 3 exec ( f i l e na me )4 / / S p e e d a t w h i c h t h e b a l l h i t s t h e g r o u n d ( i n m / s e c ) :

    5 V=sqrt (mg/k(1%e(2k/m(y0 ) ) ) )6 / / T e r m i n a l s p e e d ( i n m / s e c ) :

    7 Vt=sqrt (mg/k )8 / / R a t i o o f a c t u a l s p e e d t o t h e t e r m i n a l s p e e d :

    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 wh ich t he b a l l h i t s he gr oun d : %f

    m/sec \n\n ,V)12 p r i n t f ( \n\n Ra ti o o f a c tu a l s pe ed t o t he t e rm i na l s pe ed

    : %f\n\n , r )

    Example 1.02d 1.02-data.sci

    1 / / M a s s o f b a l l ( i n k g ) :

    2 m=0.2;3 / / H e i g h t f o m w h i c h b a l l i s d r o p p e d ( i n m ) :

    4 y0=500;5 / / V a l u e o f k :

    6 k=2104;7 / / A c c l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    8 g = 9 . 8 1 ;

    11

  • 8/7/2019 Fluid mechncs by Mcdonald

    13/116

    Chapter 2

    Fundamental Concepts

    2.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    2.2 Scilab Code

    Example 2.02 2.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+2.02data . sc i 3 exec ( f i l e na me )4

    5 / / 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 :

    6 u1=u/100/454/32.23 0 . 57 / / K i n e m a t i c v i s c o s i t y ( i n m / s e c 2 ) :

    8 v=u1/SG/d ( 0 . 3 0 5 ) 29

    / / S h e a r s t r e s s o n t h e u p p e r p l a t e ( l b f / f t 2 ) :10 tu=u1U/D100011 / / S h e a r s t r e s s o n t h e l o w e r p l a t e ( i n P a )

    12 tl=tu 4 . 4 5 / 0 . 3 0 5 213 p r i n t f ( \n\nRESULTS\n\n )

    12

  • 8/7/2019 Fluid mechncs by Mcdonald

    14/116

    14 p r i n t f ( \n\ n Vi sc os it y i n u ni ts o f l bf 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\n K in em a ti c 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\n Sh ea r s t r e s on t he u pe er p l a t e : %f l b f / f t

    2\n\n , t u )17 p r i n t f ( \n\n Sea r s t r e s s on t he l ow er p l a t e : %f Pa\n\n ,

    t l )

    Example 2.02d 2.02-data.sci

    1 / / M a s s o f o x y g e n p r e s e n t ( i n k g ) :

    2 m=0.95;3 / / I n i t i a l t e m p e r a t u r ( i n K ) :

    4 T1=300;5 / / F i n a l t e m p e r a t u r e o f o x y g e n ( i n K ) :

    6 T2=900;7 / / P r e s s u r e o f o x y g e n ( i n k P a ) :

    8 p=150;9 / / S p e c i f i c h e a t a t c o n s t a n t p r e s s u r e ( i n J / k g K ) :

    10 c p = 9 0 9 . 4 ;

    13

  • 8/7/2019 Fluid mechncs by Mcdonald

    15/116

    Chapter 3

    Fluid Statics

    3.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    When we execute S 3.01, we get Fig. 3.1.

    3.2 Scilab Code

    Example 3.01 3.01.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+3.01data . sc i 3 exec ( f i l e na me )4 / / T u b e d i a m e t e r ( i n mm ) :

    5 D=1:25;6 D1=D/10007 [m n]= s i z e (D1)8

    f o r i =1:n9 / / C h a n g e i n l i q u i d l e v e l f o r w a t e r ( i n mm ) :

    10 dhw( i ) =4STw cosd ( thetaw ) /dw/g/D1( i ) ;11 / / C h a n g e i n l i q u i d l e v e l f o r m e r c u r y ( i n mm ) :

    12 dhm( i )=4STm cos d ( thetam ) /dm/g /D1( i ) ;

    14

  • 8/7/2019 Fluid mechncs by Mcdonald

    16/116

    13 end ;14

    15 / / P l o t t i n g t u b e d a i m e t e r a n d w a t e r l e v e l :

    16 plot (D11000 ,dhw, o )17 / / P l o t t i n g t u b e d a i m e t e r a n d m e r c u r y l e v e l :

    18 plot (D1100 0 ,dhm, )19 leg en d ([ Water ; Mercury ]) ;20 x t i t l e ( L i q u i d l e v e l v s Tube d i a m e te r , L i q u i d l e v e l ( i n

    mm) , Tube di am et er ( i n mm) )

    Example 3.01d 3.01-data.sci

    1 / / S u r f a c e t e n s i o n o f w a t e r ( i n mN / m ) :

    2 STw=72.8103;3 / / S u r f a c e T e n s i o n o f m e r c u r y ( i n mN / m ) :

    4 STm=37510 3;5 / / C o n t a c t a n g l e f o r w a t e r :

    6 thetaw=0;7 / / C O n t a c t a n g l e f o r m e r c u r y :

    8 thetam=140;9 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    10 dw=1;11

    / / D e n s i t y o f m e r c u r y ( i n k g / m 3 ) :12 dm=13.6;13 / / A c c e l e r a t i o n d e t o g r a v i t y ( i n m / s e c ) :

    14 g = 9 . 8 1 ;

    Example 3.03 3.03.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+3.03data . sc i 3 exec ( f i l e na me )

    4 / / P r e s s u r e d i f f e r e n c e ( i n l b f / i n 2 ) :5 dp=gd(d1+SGmd2SGod3+SGmd4+d5)/12/1446 p r i n t f ( \n\nRESULTS\n\n )7 p r i n t f ( \n\n P re s su r e d i f f e r e n c e b etw een A and B : %f l b f

    / i n 2\n\n ,dp)

    15

  • 8/7/2019 Fluid mechncs by Mcdonald

    17/116

    Figure 3.1: Output graph of S 3.01

    16

  • 8/7/2019 Fluid mechncs by Mcdonald

    18/116

    Example 3.03d 3.03-data.sci

    1 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n f t / s e c 2 ) :

    2 g = 3 2 . 2 ;3 / / S p e c i f i c g r a v i t y o f m e r c u r y :

    4 SGm=13.6;5 / / S p e c i f i c g r a v i t y o f o i l :

    6 SGo=0.88;7 / / S p e c i f i c g r a v i t y o f w a t e r :

    8 SGw=1;9 / / D e n s i t y o f w a t e r ( i n s l u g / f t 3 ) :

    10 d = 1 . 9 4 ;11 / / H e i g h t s o f l i q u i d i n v a r i o u s t u b e s ( i n i n c h e s ) :

    12 d1=10;13 d2=3;14 d3=4;15 d4=5;16 d5=8;

    Example 3.04 3.04.sci

    1 pa thn am e= 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 lename=pathname+filesep ()+3.04data . sc i 3 exec ( f i l e na me )4 / / A s s u m i n g 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 w i t h a l t i t u d e :

    5 / / T e m p e r a t u r e g r a d i e n t ( i n F / f t ) :

    6 m=(T1T 2) /( z 2z1 )7 / / V a l u e o f g / ( m R ) :

    8 v=g/m/R/32.29 / / P r e s s u r e a t V a i l P a s s ( i n i n c h e s o f H g ) :

    10 p12=p1 ((T2+460)/(T1+460))v11 / / P e r c e n t a g e c h a n g e i n d e n s i t y :

    12 pc1=(p12/p1(T1+460)/(T2+460)1)10013 / / A s s u m i n g d e n s i t y i s c o n s t a n t :

    14 / / P r e s s u r e a t V a i l P a s s ( i n i n c h e s o f H g ) :

    15 p22=p1(1( g( z2z 1 ) / ( R32 .2 ) /(T1+460)) )

    17

  • 8/7/2019 Fluid mechncs by Mcdonald

    19/116

    16 / / P e r c e n t a g e c h a n g e i n d e n s i t y :

    17

    pc2=0;18 / / A s s u m i n g t e m p e r a t u r e i s c o n s t a n t :

    19 / / P r e s s u r e a t V a i l P a s s ( i n i n c h e s o f H g ) :

    20 p32=p1%e(g( z2z 1 ) / ( R32 .2 ) /(T2+460))21 / / P e r c e n t a g e c h a n g e i n d e n s i t y :

    22 pc3=(p32/p1(T1+460)/(T1+460)1)10023 / / F o r a n a d i a b a t i c a t m o s p h e r e :

    24 p42=p1( ( 62+460) /( 80+460) ) ( k /( k1) )25 / / P e r c e n t a g e c h a n g e i n d e n s i t y :

    26 pc4=(p42/p1(T1+460)/(T2+460)1)10027 p r i n t f ( \n\nRESULTS\n\n )28 p r i n t f ( \n\n1 ) I f t em pe ra tu re 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\ t At mo s ph er i c p r e s s u r e a t V a i l P as s : %f

    i n ch e s o f Hg\n\n , p12)30 p r i n t f ( \n\n\ t P e r ce n t a g e c ha ng e i n d e n s i t y wr t D en ver :

    %f p e r c e n t\n\n , pc1 )31 p r i n t f ( \n\n2 ) I f d en s it y i s c on st an t\n\n )32 p r i n t f ( \n\n\ t At mo s ph er i c p r e s s u r e a t V a i l P as s : %f

    i n ch e s o f Hg\n\n , p22)33 p r i n t f ( \n\n\ t P e r ce n t a g e c ha ng e i n d e n s i t y wr t D en ver :

    %f p e r c e n t\n\n , pc2 )34 p r i n t f ( \n\n3 ) I f t em pe ra tu re i s c on st a nt \n\n )35 p r i n t f ( \n\n\ t At mo s ph er i c p r e s s u r e a t V a i l P as s : %f

    i n ch e s o f Hg\n\n , p32)36 p r i n t f ( \n\n\ t P e r ce n t a g e c ha ng e i n d e n s i t y wr t D en ver :

    %f p e r c e n t\n\n , pc3 )37 p r i n t f ( \n\n4 ) Fo r an a d i a b a t i c a tm os ph er e\n\n )38 p r i n t f ( \n\n\ t At mo s ph er i c p r e s s u r e a t V a i l P as s : %f

    i n ch e s o f Hg\n\n , p42)39 p r i n t f ( \n\n\ t P e r ce n t a g e c ha ng e i n d e n s i t y wr t D en ver :

    %f p e r c e n t\n\n , pc4 )

    Example 3.04d 3.04-data.sci

    1 / / E l e v a t i o n o f D e n v e r ( i n f t ) :

    2 z1=5280;

    18

  • 8/7/2019 Fluid mechncs by Mcdonald

    20/116

    3 / / P r e s s u r e a t D e n v e r ( i n mm o f H g ) :

    4

    p1=24. 8;5 / / T e m p e r a t u r e a t D e n v e r ( i n F ) :

    6 T1=80;7 / / E l e v a t i o n a t V a i l P a s s ( i n f t ) :

    8 z2=10600;9 / / T e m p e r a t u r e a t V s i l P a s s ( i n F ) :

    10 T2=62;11 / / V a l u e o f R i n f t l b f / l b m R ) :

    12 R=53.3;13 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n f t / s e c 2 ) :

    14 g = 3 2 . 2 ;15 / / V a l u e o f a d i a b a t i c c o n s t a n t :

    16 k = 1 . 4 ;

    Example 3.05 3.05.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+3.05data . sc i 3 exec ( f i l e na me )4 / / N e t f o r c e o n t h e g a t e ( i n k N ) :

    5 Fr=dgw(DL+L2/2 si nd ( th et a ) )6 / / C e n t r e o f p r e s s u r e :

    7 / / C a l c u l a t i o n f o r y c o o r d i n a t e :

    8 yc=D/ s i n d ( t h e t a )+L/29 / / A r e a ( i n m 2 ) :

    10 A=Lw11 / / M o m e n t o f i n e r t i a o f r e c t a n g u l a r g a t e ( i n m 4 ) :

    12 Ixx=wL3/1213 / / y c o o r d i n a t e ( i n m ) :

    14 y=yc+Ixx/A/yc15 / / C a l c u l a t i o n f o r x c o o r d i n a t e :

    16 Ixy=0

    17 xc=w/218 / / x c o o r d i n a t e ( i n m ) :

    19 x=xc+Ixy/A/xc20 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 t he g a te : %f kN\n\n , Fr/1000)

    19

  • 8/7/2019 Fluid mechncs by Mcdonald

    21/116

    22 p r i n t f ( \n\n C oo r di n at e 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 )

    Example 3.05d 3.05-data.sci

    1 / / L e n g t h o f g a t e ( i n m ) :

    2 L=4;3 / / W i d t h o f g a t e ( i n m ) :

    4 w=5;5 / / D e p t h o f g a t e u n d e r w a t e r ( i n m ) :

    6 D=2;7 / / D e n s i t y o f w a t e r ( i n k g / m 3 :

    8 d=999;9 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    10 g = 9 . 8 1 ;11 / / A n g l e o f g a t e w i t h h o r i z o n t a l :

    12 t he t a=30;

    Example 3.06 3.06.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+3.06data . sc i

    3 exec ( f i l e na me )4 / / F o r c e r e q u i r e d t o k e e p t h e d o o r s h u t ( i n l b f ) :

    5 function y=f (z) ,y=b/Lp0z+db/L(Lzz 2) , endfunction6 Ft=intg (0 ,L , f )7 p r i n t f ( \n\nRESULTS\n\n )8 p r i n t f ( \n\n Fo rc e r e q u i r e d t o k ep t h e d oo r s h ut : %. 1 f

    l b f\n\n , Ft)

    Example 3.06d 3.06-data.sci

    1 / / P r e s s u r e a p l l i e d o n t h e d o o r ( i n p s f g ) :

    2 p0=100;3 / / L e n g t h o f d o o r ( i n f e e t ) :

    4 L=3;5 / / B r e a d t h o f t h e d o o r ( i n f e e t ) :

    20

  • 8/7/2019 Fluid mechncs by Mcdonald

    22/116

    6 b=2;7

    / / D e n s i t y o f l i q i u i d ( i n l b f / f t 3 ) :8 d=100;

    Example 3.07 3.07.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+3.07data . sc i 3 exec ( f i l e na me )4 / / H o r i z o n t a l c o m p o n e n t o f r e s u l t a n t f o r c e ( i n k N ) :

    5 Frh=0.5dgwD26 / / L i n e o f a c t i o n o f F r h ( i n m ) :

    7 y1=0.5D+wD 3 / 1 2 / ( 0 . 5D)/(wD)8 / / V e r t i c a l c o m p o n e n t o f r e s u l t a n t f o r c e ( i n k N ) :

    9 function y=q ( x ) , y=dgw(Dsqrt ( ax ) ) , endfunction10 Frv=intg (0 ,D2/a , q)11 / / L i n e o f a c i o n o f F r v ( i n m ) :

    12 function k=f ( x ) , k=dgw/Frvx(Dsqrt ( ax ) ) ,endfunction

    13 xa=intg (0 ,D2/a , f )14 / / F o r c e r e q u i r e d t o k e e p t h e g a t e i n e q u i l i b r i u m ( i n k N )

    :

    15

    Fa=1/l ( xa Frv+(Dy1 )Frh)16 p r i n t f ( \n\nRESULTS\n\n )17 p r i n t f ( \n\n Force r e qu i r ed t o keep t he g at e a t

    e q u i l i b r i u m : %f kN\n\n ,Fa/100 0)

    Example 3.07d 3.07-data.sci

    1 / / W i d t h o f g a t e ( i n m ) :

    2 w=5;3 / / D e p t h o f w a t e r ( i n m ) :

    4 D=4;

    5 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) ;

    6 d=999;7 / / A c c e l r a t i o n d e t o g r a v i t y ( i n m / s e c 2 ) :

    8 g = 9 . 8 1 ;9 / / V a l u e o f a ( i n m ) :

    21

  • 8/7/2019 Fluid mechncs by Mcdonald

    23/116

    10 a=4;11

    / / P o i n t w h e r e f o r c e a c t s ( i n m ) :12 l =5;

    22

  • 8/7/2019 Fluid mechncs by Mcdonald

    24/116

    Chapter 4

    Basic Equations in Integral

    form for a Control Volume

    4.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    When we execute S 4.11, we get Fig. 4.1.

    4.2 Scilab Code

    Example 4.01 4.01.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.01data . sc i 3 exec ( f i l e na me )4 / / I f I = i n t e g r a l o f ( pV . d A ) :

    5 / / F o r s y s t e m : I c s = I A 1 + I A 2 + I A 3 + I A 4 .

    6

    / / F o r a r e a 17 IA1=dV1A18 / / F o r a r e a 3 : I A 2 = d V 3 A 3 = m 3

    9 IA3=m310 / / F o r a r e a 4 : I A 4 =d V 4 A 4 =d Q 4

    23

  • 8/7/2019 Fluid mechncs by Mcdonald

    25/116

    11 IA4=dQ412

    / / F o r a r e a 2 :13 IA2=IA1IA3IA414 / / V e l o c i t y a t s e c t i o n 2 ( i n f t / s e c ) :

    15 V2=IA2/d/A216 / / V 2 i s i n t h e n e g a t i v e y d i r e c t i o n

    17 p r i n t f ( \n\nRESULTS\n\n )18 p r i n t f ( \n\n Ve lo ci ty a t s e c ti o n 2 : %. 0 f j f t / s e c \n\n ,

    V2)

    Example 4.01d 4.01-data.sci

    1 / / A r e a o f 1 ( i n f t 2 ) :

    2 A1=0.2;3 / / A r e a o f 2 ( i n f t 2 ) :

    4 A2=0.5;5 / / A r e a o f 3 ( i n f t 2 ) :

    6 A3=0.4;7 / / A r e a o f 4 ( i n f t 2 ) :

    8 A4=0.4;9 / / D e n s i t y o f w a t e r ( i n s l u g / f t 3 ) :

    10 d = 1 . 9 4 ;11 / / M a s s f l o w r a t e o u t o f s e c t i o n 3 ( i n s l u g / s e c ) :

    12 m3=3.88;13 / / V o l m e f l o w r a t e i n s e c t i o n 4 ( i n f t 3 / s e c ) :

    14 Q4=1;15 / / V e l o c i t y a t 1 ( i n f t / s e c ) :

    16 V1=10;

    Example 4.02 4.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.02data . sc i

    3 exec ( f i l e na me )4 / / I f I = i n t e g r a l o f ( pV . d A ) :

    5 / / F o r s y s t e m : I C S = I a b + I b c + I c d + I d a

    6 / / B u t I C S = 0

    7

    24

  • 8/7/2019 Fluid mechncs by Mcdonald

    26/116

    8 / / F o r A a b :

    9

    function p=f (y) ,p=dUwy 0 , endfunction10 IAab=intg (0 , t , f )11

    12 / / F o r A c d :

    13 function q=g(y) ,q=dUw(2y/ t(y/t ) 2) , endfunction14 IAcd=intg (0 , t , g )15

    16 / / M a s s f l o w r a t e a c r o s s s u r f a c e b c ( i n k g / s e c ) :

    17 mbc=(IAabIAcd)/100018 p r i n t f ( \n\nRESULTS\n\n )19 p r i n t f ( \n\nMass f l ow r a t e a c r o s s s u r f a c e bc : %. 4 f kg /

    s e c \n\n , mbc)

    Example 4.02d 4.02-data.sci

    1 / / F l o w v e l o c i t y a h e a d o f t h e p l a t e ( i n m / s e c ) :

    2 U=30;3 / / B o u n d a r y l a y e r t c k n e s s a t l o c a t i o n d ( i n mm ) :

    4 t=5;5 / / D e n s i t y o f f l u i d a i r ( i n k / m 3 ) :

    6 d = 1 . 2 4 ;7

    / / P l a t e w d t h p e r p e n d i c u l a r t o t h e p l a t e ( i n m ) :8 w=0.6;

    Example 4.03 4.03.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.03data . sc i 3 exec ( f i l e na me )4 / / R a t e o f c h a n g e o f a i r d e n s i t y i n t a n k ( i n ( k g / m 3 ) / s ) :

    5 r=dvA/V/1066 p r i n t f ( \n\nRESULTS\n\n )7 p r i n t f ( \n\nRate o f c ha ng e o f a i r d e n s i t y i n t an k : %. 3 f

    kg/m3\n\n , r )8 p r i n t f ( \n\nThe d e ns i t y d e c re a s es a s i s i n d i ca t e d b y

    t he n e ga t iv e s i g n\n\n )

    25

  • 8/7/2019 Fluid mechncs by Mcdonald

    27/116

    Example 4.03d 4.03-data.sci

    1 / / V o l u m e o f t a n k ( i n m 3 ) :

    2 V=0.05;3 / / P r e s s u r e o f a i r ( I n k P a ) :

    4 p=800;5 / / T e m p e r a t u r e o f t a n k ( i n C ) :

    6 T=15;7 / / V e l o c i t y o f l e a v i g a i r ( i n m / s e c ) :

    8 v=311;9 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    10 d = 6 . 1 3 ;11 / / A r e a o f v a l v e e x i t ( i n mm 2 ) :

    12 A=65;

    Example 4.04 4.04.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.04data . sc i 3 exec ( f i l e na me )4 / / 1 ) C o n t r o l V o l u m e s e l e c t e d s o t h a t a r e a o f l e f t

    s u r f a c e i s e q u a l t o t h e a r e a o f t h e r i g h t s u r f a c e

    5

    u1=15;6 / / F o r c e o f s u p p o r t o n c o n t r o l v o l u m ( i n k N ) :

    7 function y=f (A) ,y=u1dV, endfunction8 Rx1=intg (0 ,0 .0 1 , f )9 / / H o r i z o n t a l f o r c e o n s u p p o r t ( i n k N ) :

    10 Kx=Rx111 / / 2 ) C o n t r o l v o l u m e s a r e s e l e c t e d d o t h a t t h e a r e a o f

    t h e l e f t a n d r i g h t s u r f a c e s a r e e q u i a l t o t h e a r e a

    o f t h e p l a t e

    12

    13 function z=g (A) , z=u1dV, endfunction

    14 Fsx=intg ( 0 , 0 . 0 1 , g )15 / / N e t f o r c e o n p l a t e : F x =0 = Bx p a A p + R x

    16 / / R x = p a A p + B x

    17 / / F r o m t h e a b o v e , i t i s o b t a i n e d t h a t :

    18 Rx2=2.25

    26

  • 8/7/2019 Fluid mechncs by Mcdonald

    28/116

    19 / / H o r i z o n t a l f o r c e o n s u p p o r t ( i n k N ) :

    20

    Kx2=Rx221 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 ta l f o r c e on s u p po r t : %. 3 f kN\n\n ,

    Kx/1000)

    Example 4.04d 4.04-data.sci

    1 / / V e l o c i t y o f w a t e r l e a v i n g t h e n o z l e ( i n m / s e c ) :

    2 V=15;3 / / A r e a o f n o z z l e ( i n m 2 ) :

    4 A=0.01;5 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    6 d=999;

    Example 4.05 4.05.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.05data . sc i 3 exec ( f i l e na me )4 / / W e i g h t o f w a t e r i n t h e t a n k ( i n l b f ) :

    5 d1=62. 4;

    6 WH2O=d1Ah7 v=5;8 / / T o t a l b o d y f o r c e i n n e g a t i v e y d i r e c t i o n ( l b f ) :

    9 function y=f (A) ,y=vd2V1 , endfunction10 F=intg (0 ,A1, f )11 / / F o r c e o f s c a l e o n c o n t r o l v o l u m e ( i n k N ) :

    12 Ry=W+WH2OF13 p r i n t f ( \n\nRESULTS\n\n )14 p r i n t f ( \n\n S c a l e R ea di ng : %. 3 f l b f \n\n ,Ry)

    Example 4.05d 4.05-data.sci

    1 / / H e i g h t o f t h e c o n t a i n e r ( i n f t ) :

    2 l =2;3 / / A r e a o f c r o s s s e c t i o n ( i n f t 2 ) :

    27

  • 8/7/2019 Fluid mechncs by Mcdonald

    29/116

    4 A=1;5

    / / W e i g h t o f c o n t a i n e r ( i n l b f ) :6 W=5;7 / / W a t e r d e p t h ( i n f t ) :

    8 h = 1 . 9 ;9 / / A r e a o f o p e n i n g 1 ( i n f t 2 ) :

    10 A1=0.1;11 / / V e l o c i t y a t o p e n i n g 1 ( i n f t / s e c ) :

    12 V1=5;13 / / A r e a o f o p e n i n g 2 ( i n f t 2 ) :

    14 A2=0.1;15 / / A r e a o f o p e n i n g 1 ( i n f t 2 ) :

    16 A3=0.1;17 / / D e n s i t y o f w a t e r ( i n s l u g / f 3 ) :

    18 d2=1. 94;

    Example 4.06 4.06.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.06data . sc i 3 exec ( f i l e na me )4 / / X c o m p o n e n t o f r e a c t i o n f o r c e p e r u n i t w i d t h o f t h e

    g a t e ( i n N / m ) :

    5 Rxw=(d(V22D2V12D1) )(dg /2(D12D22))6 / / H o r i z o n t a l f o r c e e x e r t e d p e r u n t w i d t h o n t h e g a t e ( i n

    N / m ) :

    7 Kxw=Rxw8 p r i n t f ( \n\nRESULTS\n\n )9 p r i n t f ( \n\n H o ri z o nt a l f o r c e e x e rt e d p er un t w id th on

    the gate : %.3 f kN/m\n\n ,Kxw/1 00 0)

    Example 4.06d 4.06-data.sci

    1 / / D i a m e t e r o f c h a n n e l ( i n m ) :

    2 D1=1.5;3 / / V e l c i t y o f f l o w i n c h a n n e l ( i n m / s e c ) :

    4 V1=0.2;5 / / D i a m e t e r a t s e c t i o n 2 ( i n m ) :

    28

  • 8/7/2019 Fluid mechncs by Mcdonald

    30/116

    6 D2=0.0563;7

    / / V e l o c i t y a s e c t i o n 2 ( i n m / s e c ) :8 V2=5.33;9 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    10 d=999;11 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    12 g = 9 . 8 1 ;

    Example 4.07 4.07.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.07data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y a t s e c t i o n 1 ( i n m / s e c ) :

    5 V1=V2A2/A16 / / G a u g e p r e s s u r e ( i n k P a ) :

    7 p1g=p1patm8 u1=V1; u2=V2 ;9 / / R e a c t i o n f o r c e c o m p o n e n t i n t h e x d i r e c t i o n ( i n N ) :

    10 Rx=p1 gA1u1dV1A111 / / R e a c t i o n f o r c e c o m p o n e n t i n t h e y d i r e c t i o n ( i n N ) :

    12 Ry=u2dV2A213 p r i n t f

    ( \n\nRESULTS\n\n )14 p r i n t f ( \n\n Force t o h ol d elbow a c t in g t o t he l e f t : %. 3

    f kN\n\n ,Rx/100 0)15 p r i n t f ( \n\n F or ce t o h o l d e lb ow a c t i n g d ownwards : %. 3 f

    N\n\n ,Ry)

    Example 4.07d 4.07-data.sci

    1 / / P r e s s u r e a t i n l e t t o t h e e l b o w ( i n N / m 2 ) :

    2 p1=2. 21105;3 / / A r e a o f c r o s s s e c t i o n ( i n m 2 ) :

    4 A1=0.01;5 / / V e l o c i t y a t s e c t o n 2 ( i n m / s e c ) :

    6 V2=16;7 / / A r e a o f c r o s s s e c t i o n o f s e c t i o n 2 ( i n m 2 ) :

    8 A2=0.0025;

    29

  • 8/7/2019 Fluid mechncs by Mcdonald

    31/116

    9 / / A t m o s p h e r i c p r e s s u r e ( i n k P a ) :

    10

    patm=1.012105;

    Example 4.08 4.08.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.08data . sc i 3 exec ( f i l e na me )4 / / T e n s i o n r e q u i r e d t o p u l l t h e b e l t ( i n l b f ) :

    5 T=Vbelt m/32. 26 p r i n t f ( \n\nRESULTS\n\n )7 p r i n t f ( \n\n Tens ion r e q ui r e d t o p u l l t he b e l t : %. 3 f l b f

    \n\n ,T)

    Example 4.08d 4.08-data.sci

    1 / / V e l o c i t y o f c o n v e y o r b e l t ( i n f t / s e c ) :

    2 Vbelt=3;3 / / V e l o c i t y o f s a n d a l l i n g o n t o b e l t ( i n f t / s e c ) :

    4 Vsand=5;5 / / F l o w r a t e ( i n l b m / s e c ) :

    6 m=500;

    Example 4.09 4.09.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.09data . sc i 3 exec ( f i l e na me )4 / / M i n i m u m g a u g e p r e s s u r e r e q u i r e d ( i n l b f / i n 2 ) :

    5 pg=8/%pi2d/D14Q 2((D1/D2)41) 1446 p r i n t f ( \n\nRESULTS\n\n )7 p r i n t f ( Minimum g au g e p r e s s u r e r e q u i r e d : %. 3 f l b f / i n 2

    , p g )

    Example 4.09d 4.09-data.sci

    1 / / N o z z l e i n l e t d i a m e t e r ( i n i n c h e s s ) :

    30

  • 8/7/2019 Fluid mechncs by Mcdonald

    32/116

    2 D1=3;3

    / / N o z z l e e x i t d i a m e t e r ( i n i n c h e s ) :4 D2=1;5 / / D e s i r e d v o l u m e f l o w r a t e ( i n f t 3 / s e c ) :

    6 Q=0.7;7 / / D e n s i t y o f w a t e r ( i n s l u g / f t 3 ) :

    8 d = 1 . 9 4 ;

    Example 4.10 4.10.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.10data . sc i 3 exec ( f i l e na me )4 u1=VU5 u2=(VU) c osd ( t he t a )6 v2=(VU) sin d ( the ta )7 V1=VU8 V2=V19 / / X c o m p o n e n t o f m o m e n t e q u a t i o n ( i n N ) :

    10 function y=f (A) ,y=u1(dV1) , endfunction11 function z=g (A) , z=u2dV2 , endfunction12 Rx=intg ( 0 ,A, f )+intg (0 ,A, g )13

    14 / / Y c o m p o n e n t o f m o m e n t e q u a t i o n ( i n N ) :

    15 function a=h (A) , a=v2dV1 , endfunction16 Ry=intg (0 ,A,h ) / / T h i s i s a f t e r n e g l e c t i n g w e i g h t o f

    v a n e a n d t h e w a t e r .

    17 p r i n t f ( \n\nRESULTS\n\n )18 p r i n t f ( \n\n Net f o r c e o n t h e v an e : %. 3 f i +%. 2 f j kN\n\n

    ,Rx/1000,Ry/1000)

    Example 4.10d 4.10-data.sci

    1 / / V a n e t u r n i n g a n g l e :

    2 t he t a=60;3 / / S p e e d o f v a n e ( i n m / s e c ) :

    4 U=10;5 / / A r e a o f n o z z l e ( i n m 2 ) :

    31

  • 8/7/2019 Fluid mechncs by Mcdonald

    33/116

    6 A=0.003;7

    / / F l o w v e l o c i t y o f w a t e r ( i n m / s e c ) :8 V=30;9 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    10 d=999;

    Example 4.11 4.11.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.11data . sc i 3 exec ( f i l e na me )4 / / E v a l u a t i n g t h e v a l u e o f V b :

    5 Vb=V(1cosd ( the ta ) )dA/M6 / / V a l u e o f U / V f o r v a r i o u s v a l u e s o f t

    7 t =0:2 0;8 [m n]= s i z e ( t )9 f o r i =1:n10 U V( i )=Vb t ( i ) /(1+Vb t ( i ) ) ;11 end

    12

    13 / / P l o t t i n g U / V v s t :

    14 plot ( t , U V )15

    x t i t l e ( U/V vs t , t ( in se c ) , U/V )

    Example 4.11d 4.11-data.sci

    1 / / M a s s o f v a n e a n d c a r t ( i n k g ) :

    2 M=75;3 / / T u r n i n g a n g l e o f v a n e :

    4 t he t a=60;5 / / S p e e d o f w a t e r l e a v i n g n o z z l e h o r i z o n t a l l y ( i n m / s e c ) :

    6 V=35;7 / / E x i t a r e a o f n o z z l e ( i n m ) :

    8 A=0.003;9 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    10 d=999;

    32

  • 8/7/2019 Fluid mechncs by Mcdonald

    34/116

    Figure 4.1: Output graph of S 4.11

    33

  • 8/7/2019 Fluid mechncs by Mcdonald

    35/116

    Example 4.12 4.12.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.12data . sc i 3 exec ( f i l e na me )4 / / A c c e l e r a t i o n o f r o c k e t a t t = 0 ( i n m / s e c 2 ) :

    5 Veme/M0g6 / / V e l o c i t y o f r o c k e t a t t = 1 0 ( i n m / s e c ) :

    7 function y=f ( t ) , y=Veme/(M0me t )g , endfunction8 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 lo c i ty o f r o c k et a t t = 10: %. 1 f m/ s e c \n\n

    ,Vcv)

    Example 4.12d 4.12-data.sci

    1 / / I n i t i a l m a s s o f t h r o c k e t ( i n k g ) :

    2 M0=400;3 / / R a t e o f f u e l c o n s u m p t i o n ( i n k g / s e c ) :

    4 me=5;5 / / E x h a u s t v e l o c i t y ( i n m / s e c ) :

    6 Ve=3500;7 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    8 g = 9 . 8 1 ;9 / / T i m e a f t e r w h i c h v e l o c i t y i s t o b e c a l c u l a t e d ( i n s e c )

    :

    10 t=10;

    Example 4.14 4.14.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.14data . sc i 3 exec ( f i l e na me )

    4 / / A r e a o f j e t ( i n mm 2 ) :

    5 Ajet=%pi/4D26 / / J e t s p e e d r e l a t i v e t o t h e n o z z l e ( i n m / s e c ) :

    7 Vr el=Q/2/ Aj et 106/60/10008 / / V a l u e o f w R i n m / s e c :

    34

  • 8/7/2019 Fluid mechncs by Mcdonald

    36/116

    9 wR=wR2%pi/60/100010

    / / F r i c t i o n t o r q u e a t p i v o t ( i n Nm ) :11 Tf=R( V r e lc o s d ( a l p h a )wR) dQ/1000/60/100012 p r i n t f ( \n\nRESULTS\n\n )13 p r i n t f ( \n\n Je t s pe ed r e l a t i v e t o e ac h n o z z l e : %. 2 f m/

    s e c \n\n , Vr el )14 p r i n t f ( \n\ n F r i c t i o n t o rq u e a t p i v ot : %. 5 f Nm\n\n , Tf)

    Example 4.14d 4.14-data.sci

    1 / / I n l e t g a u g e p r e s s u r e ( i n k P a ) :

    2 p=20;3 / / V o l u m e f l o w r a t e o f w a t e r t h r o u g h t h e s p r i n k l e r ( i n l /

    m i n ) :

    4 Q=7.5;5 / / S p e e d o f r o t s t i o n o f s p r i n k l e r ( i n r p m ) :

    6 w=30;7 / / D i a m e t e r o f j e t f s p r i n k l e ( i n mm ) :

    8 D=4;9 / / R a d i u s o f s p r i n k l e r ( i n mm ) :

    10 R=150;11 / / S u p p l y p r e s s u r e t o s p r i n k l e r ( i n k P a ) :

    12

    p=20;13 / / A n g l e a t w h i c h j e t i s s p r a y e d w r t h o r i z o n t a l :

    14 al pha=30;15 / / D e n s i t y o f w a t e r ( i n k g / m ) :

    16 d=999;

    Example 4.16 4.16.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.16data . sc i 3 exec ( f i l e na me )

    4 / / V e l o c i t y a t e x i t ( i n f t / s e c ) :

    5 V2=mR(T2+460)/A2/p2/1446 / / A s p o w e r i n p u t i s t o CV , Ws = 6 0 0

    7 / / R a t e o f h e a t t r a n s f e r ( i n B t u / s e c ) :

    8 Q=Ws550/778+mcp (T2T1)+mV 22/2/32. 2/778

    35

  • 8/7/2019 Fluid mechncs by Mcdonald

    37/116

    9 p r i n t f ( \n\nRESULTS\n\n )10

    p r i n t f ( \n\nRate o f h ea t t r a n s f e r : %. 3 f Btu / s e c\n\n ,Q)

    Example 4.16d 4.16-data.sci

    1 / / P r e s s u r e a t e n t r y ( i n p s i a ) :

    2 p1=14. 7;3 / / T e m p e r a t u r e a t e n t r y ( i n F ) :

    4 T1=70;5 / / P r e s s u r e a t e x i t ( i n p s i a ) :

    6 p2=50;7 / / T e m p r a t u r e a e x i t ( i n F ) :

    8 T2=100;9 / / C r o s s s e c t i o n a l a r e a o f t h e p i p e a t e x i t ( i n f t 2 ) :

    10 A2=1;11 / / M a s s f l o w r a t e ( i n l b f / s e c ) :

    12 m=20;13 / / P o w e r i n p u t t o t h e c o m p r e s s o r ( i n h p ) :

    14 Ws=600;15 / / V a l u e o f c p ( i n B t u / l b m R ) :

    16 c p = 0 . 2 4 ;17 / / V a l u e o f g a s c o n s t a n t ( i n f t l b f / ( l b m R ) )

    18

    R=53.3;

    Example 4.17 4.17.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+4.17data . sc i 3 exec ( f i l e na me )4 / / D e n s i t y o f t a n k ( i n k g / m 3 ) :

    5 d=(p1+patm ) /R/T6 / / M a s s f l o w r a t e o f a i r i n t o t h e t a n k ( i n k g / s e c ) :

    7 m=dVcv r/R/T1000

    8 p r i n t f ( \n\nRESULTS\n\n )9 p r i n t f ( \n\nMass f lo w r a t e o f a i r i n t o t he ta nk : %. 3 f g

    / s e c \n\n ,m)

    Example 4.17d 4.17-data.sci

    36

  • 8/7/2019 Fluid mechncs by Mcdonald

    38/116

    1 / / V o l u m e o f t a k ( i n m 3 ) :

    2

    V=0.1;3 / / T e m p e r a t u r e o f l i n e a n d t a n k ( i n K ) :

    4 T=293;5 / / I n i t i a l t a n k g a u g e p r e s s u r e ( i n N / m 2 ) :

    6 p1=1105;7 / / A b s o l u t e l i n e p r e s s u r e ( i n N / m 2 ) :

    8 p=2106;9 / / R a t e o f r i s e o f t e m p e r a t u r e a f t e r o p e n i n g o f t h e

    v a l v e ( i n C / s e c ) :

    10 r =0.0 5;11 / / A t m o s p h e r i c p r e s s u r e ( i n N / m 2 ) :

    12 patm=1.01105;13 / / G a s C o n s t a n t ( i n Nm / ( k g K ) ) :

    14 R=287;15 / / V a l u e o f c v ( i n Nm / k g K ) :

    16 cv=717;

    37

  • 8/7/2019 Fluid mechncs by Mcdonald

    39/116

    Chapter 5

    Introducton to Differential

    Analysis of Fluid Motion

    5.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    5.2 Scilab Code

    Example 5.02 5.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+5.02data . sc i 3 exec ( f i l e na me )4 / / R a t e o f c h a n g e o f d e n s i t y w i t h t i m e ( i n k g / m 3 s ) :

    5 r=dV/L6 p r i n t f ( \n\nRESULTS\n\n )7

    p r i n t f ( \n\nRa te o f c ha ng e o f d e n s i t y w it h t im e : %. 1 f kg/m3s\n\n , r )

    Example 5.02d 5.02-data.sci

    38

  • 8/7/2019 Fluid mechncs by Mcdonald

    40/116

    1 / / D i s t a n c e f p i s t o n f r o m c l o s e d e n d o f t h e c y l i n d e r a t

    t h e g i v e i n s t a n t ( i n m ) :2 L=0. 15;3 / / D e n s i t y o f g a s ( i n k g / m 3 ) :

    4 d=18;5 / / V e l o c i t y o f p i s t o n ( i n m / s e c ) :

    6 V=12;

    Example 5.07 5.07.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+5.07data . sc i 3 exec ( f i l e na me )4 / / A t p o i n t b , u = 3 mm / s e c

    5 u=3;6 / / D i s p l a c e m e t o f b ( i n mm ) :

    7 xb=u t8 / / R a t e o f a n g u l a r d e f o r m a t i o n ( i n s 1 ) :

    9 def=U/h10 / / R a t e o f r o t a t i o n ( i n s 1 ) :

    11 r o t =0.5U/h12 p r i n t f ( \n\nRSULTS\n\n )13

    p r i n t f ( \n\nRa te o f a n g u la r d e f or m a ti 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 , ro t )

    Example 5.07d 5.07d

    1 / / V a l u e o f ( i n mm / s e c ) :

    2 U=4;3 / / V a l u e o f h ( i n mm ) :

    4 h=4;5 / / T me a t w h i c h t o f i n d p o s i t i o n ( i n s e c ) :

    6 t =1.5 ;

    Example 5.08 5.08.sce

    39

  • 8/7/2019 Fluid mechncs by Mcdonald

    41/116

    1 pa thn am e= 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 lename=pathname+filesep ()+5.08data . sc i 3 exec ( f i l e na me )4 / / V a l u e o f T :

    5 T=log ( 3/2) /A6 x 0 = 1 : 2 ;7 y 0 = 1 : 2 ;8 f o r i =1:29 f o r j =1:210 / / F o r X c o o r d i n a t e :

    11 X( i ) ( j )=x0 ( i ) %e(AT)12 / / F o r Y c o o r d i n a t e :

    13 Y( i ) ( j )=y0 ( j ) %e(AT)14 end

    15 end

    16 plot (X,Y)17 / / R a t e s o f l i n e a r d e f o r m a t i o n i n X d i r e c t i o n :

    18 Ax=0.3;19 / / R a t e o f l i n e a r d e f o r m a t i o n i n t h e y d i r e c t i o n :

    20 Ay=0.3;21 / / R a t e o f v o l u m e d i l a t i o n ( s 1 ) :

    22 v=AA23 / / A r e a o f a b c d :

    24 A1=1;25 / / A r e a o f a b c d :

    26 A2=(33/2)(4/32/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 ef or ma ti on 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\nAr ea of abc d and a , b , c , d :%. 1 f m2 , %. 1 f m\

    n\n ,A1, A2)

    Example 5.08d 5.08-data.sci

    1 / / V a l u e o f A ( i n s e c 1 ) :

    2 A=0.3;

    40

  • 8/7/2019 Fluid mechncs by Mcdonald

    42/116

    Example 5.09 5.09.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+5.09data . sc i 3 exec ( f i l e na me )4 / / V o l u m e f l o w r a t e ( i n m 3 / s e c ) :

    5 Q=dg si nd ( th et a )b( h / 1 0 0 0 ) 31000/u/36 p r i n t f ( RESULTS )7 p r i n t f ( \n\nVolume f l ow r at e : %. 4 f m3/s e c \n\n ,Q)

    Example 5.09d 5.09-data.sci

    1 / / T h i c k n e s s o f w a t e r f i l m ( i n mm ) :

    2 h=1;3 / / W i d t h o f s u r f a c e ( i n m ) :

    4 b=1;5 / / A n g l e o f i n c l i n a t i o n o f s u r f a c e :

    6 t he t a=15;7 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    8 d=999;9 / / A c c e l e r a t i o n d u t o g r a v i t y ( i n m / s e c 2 ) :

    10 g = 9 . 8 1 ;11

    / / V i s c o s i t y ( k g /m s ) :12 u=103;

    41

  • 8/7/2019 Fluid mechncs by Mcdonald

    43/116

    Chapter 6

    Incompressible Inviscid Flow

    6.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    6.2 Scilab Code

    Example 6.01 6.01.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.01data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y o f f l o w ( i n m / s e c ) :

    5 V=sqrt (dw/ log ( ( r+w) / r )g/dap/1000)6 / / V o l u m e f l o w r a t e ( i n m 3 / s e c ) :

    7 Q=V( dw)8 p r i n t f ( \n\nRESULTS\n\n )9

    p r i n t f ( \n\nVolume f l ow r at e : %. 3 f m3/s e c \n\n ,Q)

    Example 6.01d 6.01-data.sci

    1 / / D e p t h o f t h e d u c t ( i n m ) :

    42

  • 8/7/2019 Fluid mechncs by Mcdonald

    44/116

    2 d = 0 . 3 ;3

    / / W i d t h o f t h e d u c t ( i n m ) :4 w=0.1;5 / / I n n e r r a d i u s o f t h e b e n d ( i n m ) :

    6 r =0.2 5;7 / / P r e s s u r e d i f f e r e n c e b e t w e e n t h e t a p s ( i n mm o f H g ) :

    8 p=40;9 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    10 dw=999;11 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    12 g = 9 . 8 ;13 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    14 da=1. 23;

    Example 6.02 6.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.02data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y o f f l o w ( i n m / s e c ) :

    5 V=sqrt (2dwgp/1000SG/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)

    Example 6.02d 6.02-data.sci

    1 / / P r e s s u r e d i f e r e n c e ( i n mm o f m e c u r y ) :

    2 p=30;3 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    4 dw=1000;5 / / A c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    6 g = 9 . 8 1 ;7 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    8 da=1. 23;9 / / S p e c i f i c g r a v i t y o f m e r c u r y :

    10 SG=13.6;

    Example 6.03 6.03.sce

    43

  • 8/7/2019 Fluid mechncs by Mcdonald

    45/116

    1 pa thn am e= 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 lename=pathname+filesep ()+06.03data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y o f f l w a t t h e i n l e t ( i n m / s e c ) :

    5 V1=Ae/AiV26 / / G a u g e p r e s s u r e r e q u i r e d a t t h e i n l e t ( i n k P a ) :

    7 p=0.5da (V22V12)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 t he i n l e t : %. 3 f

    kPa\n\n ,p /1000)

    Example 6.03d 6.03-data.sci

    1 / / A r e a o f n o z z l e a t i n p u t ( i n m 2 ) :

    2 A i = 0 . 1 ;3 / / A r e a o f n o z z l e a t e x i t ( i n m 2 ) :

    4 Ae=0.02;5 / / O u t l e t v e l o c i t y o f f l o w ( i n m / s e c ) :

    6 V2=50;7 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    8 da=1. 23;

    Example 6.04 6.04.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.04data . sc i 3 exec ( f i l e na me )4 / / S p e e d o f w a t e r a t e x i t ( i n m / s e c ) :

    5 V2=sqrt ( 2gz )6 / / 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 ( k P a ) :

    7 pA=p1+dg(0 l ) 0. 5dV228 p r i n t f ( \n\nRESULTS\n\n )9 p r i n t f ( \n\n Sp eed o f w at er 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 re s su r e a t p o i nt A i n t he f l ow : %3f kPa\n\

    n ,pA/1 000 )

    Example 6.04d 6.04-data.sci

    44

  • 8/7/2019 Fluid mechncs by Mcdonald

    46/116

    1 / / L e n g t h o f t u b e a b o v e s u r f a c e ( i n m ) :

    2

    l =1;3 / / D e p t h o f e x i t b e l o w w a t e r s u r f a c e ( i n m ) :

    4 z=7;5 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    6 g = 9 . 8 1 ;7 / / D e n s i t y o f w a t e r ( i n k g / m 3 ) :

    8 d=999;9 / / A t m o s p h e r i c p r e s s u r e ( i n N / m 2 ) :

    10 p1=1. 01105;

    Example 6.05 6.05.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.05data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y o f f l o w a t t h e e x i t ( i n f t / s e c ) :

    5 V2=sqrt ( 2g(DuDd/12))6 / / V o l u m e f l o w r a t e / w i d t h ( f t 2 / s e c ) :

    7 Q=V2Dd/128 p r i n t f ( \n\nRESULTS\n\n )9 p r i n t f ( \n\n V el o ci ty o f f lo w a t t he 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 / w i dt h : %. 3 f f t 2/ s e c \n\n ,

    Q)

    Example 6.05d 6.05-data.sci

    1 / / D e p t h o f w a t e r a t t h e u p s t r e a m ( o n f e e t ) :

    2 Du=1.5;3 / / D e p t h o f w a t e r a t t h e v e n a c o n t r a c t a d o w n s t r e a m f r o m

    t h e g a t e ( i n i n c h e s ) :

    4 Dd=2;5 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n f t / s e c 2 ) :

    6 g = 3 2 . 2 ;

    Example 6.06 6.06.sce

    45

  • 8/7/2019 Fluid mechncs by Mcdonald

    47/116

    1 pa thn am e= 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 lename=pathname+filesep ()+06.06data . sc i 3 exec ( f i l e na me )4 / / P r e s s u r e o f a i r a t 1 0 0 0 m ( i n N / m 2 ) :

    5 p=P1pa6 / / D e n s i t y o f a i r a t 1 0 0 0 m ( i n k g / m 3 ) :

    7 d=D1da8 / / S t a g n a t i o n p r e s s u r e a t A ( i n k P a ) :

    9 p0A=p+0.5d(V1000/3600) 210 / / S t a t i c p r e s s u r e a t B ( i n k P a ) :

    11 pB=p+d/ 2( (V1000/3600)2Vb2)12 p r i n t f ( \n\nRESULTS\n\n )13 p r i n t f ( \n\n S t ag n a ti 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)

    Example 6.06d 6.06-data.sci

    1 / / S p e e d o f p l a n e ( i n k m / h r ) :

    2 V=150;3 / / S p e e d a t p o i n t B r e l a t i v e t o t h e w i n g ( i n m / s e c ) :

    4

    Vb=60;5 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    6 da=1. 23;7 / / A t m o s p h e r i s p r e s s u r e ( i n N / m 2 ) :

    8 pa=1. 01105;9 / / A t 1 0 0 0 m ,

    10 / / p / p S L :

    11 P1=0.8870;12 / / d / d S L :

    13 D1=0.9075;

    Example 6.08 6.08.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.08data . sc i 3 exec ( f i l e na me )

    46

  • 8/7/2019 Fluid mechncs by Mcdonald

    48/116

    4 / / V e l o c i t y o f f l o w a t e x i t ( i n f t / s e c ) :

    5

    V4=sqrt ( 2g( z3 0) )6 / / M a s s f l o w r a t e o f w a t e r ( i n s l u g / s e c ) :

    7 m=dV4A4/1448 / / R i s e i n t e m p e r a t u r e b e t w e e n p o i n t s 1 a n d 2 ( i n R ) :

    9 T=Q3413/3600/m/32.210 p r i n t f ( \n\nRESULTS\n\n )11 p r i n t f ( \n\n Ri se i n t em pe ra tu re b etw een p o i n t s 1 and 2 :

    %. 3 f R\n\n ,T)

    Example 6.08d 6.08-data.sci

    1 / / A r e a o f c r o s s s e c t i o n o f t h e n o z z l e ( i n i n 2 ) :

    2 A4=0.864;3 / / C a p a c i t y o f h e a t e r ( i n kW ) :

    4 Q=105 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n f t / s e c 2 ) :

    6 g = 3 2 . 2 ;7 / / W a t e r l e v e l i n r e s e r v o i r a b o v e d a t u m l i n e ( i n f t ) :

    8 z3=10;9 / / D e n s i t y o f w a t e r ( I n s l u g / f t 3 ) :

    10 d = 1 . 9 4 ;

    Example 6.09 6.09.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+06.09data . sc i 3 exec ( f i l e na me )4 t=0:55 / / V a l u e o f s q r t ( 2 g h ) :

    6 x=sqrt (2gh )7 / / V a l u e o f 1 / 2 L s q r t ( 2 g h ) :

    8 y=1/2/Lx

    9 [m n]= s i z e ( t )10 i =1:n ;11 / / V e l o c i t y ( i n m / s e c ) :

    12 V2=xtanh ( y t ( i ) )13 plot ( t ,V2) ;

    47

  • 8/7/2019 Fluid mechncs by Mcdonald

    49/116

    14 x t i t l e ( S t r e a m l i n e f l o w f ro m 1 t o 2 , Time ( i n s ) , V2 (

    in m/ se c ) )

    Example 6.09d 6.09-data.sci

    1 / / D e p t h t o w h i c h w a t e r i s f i l l e d ( i n m ) :

    2 h=3;3 / / L e n g t h o f p i p e ( i n m ) :

    4 L=6;5 / / D i a m e t e r o f p i p e ( i n mm ) :

    6 D=150;7 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n m / s e c 2 ) :

    8 g = 9 . 8 1 ;

    48

  • 8/7/2019 Fluid mechncs by Mcdonald

    50/116

    Chapter 7

    Dimensional Analysis and

    Simlitude

    7.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    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

    7.2 Scilab Code

    Example 7.04 7.04.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+7.04data . sc i 3 exec ( f i l e na me )4 / / V e l o c i t y o f p r o t o t y p e i n f t / s e c

    5 Vp1=Vp6080/36006

    / / R e y n o l d s n u m b e r o f p r o t o t y p e :7 Rep=Vp1Dp/vp8 / / R e p = R e m

    9 / / T h e r e f o r e :

    10 Rem=Rep ;

    49

  • 8/7/2019 Fluid mechncs by Mcdonald

    51/116

    11 / / V e l o c i t y o f a i r f o r w i n d t u n n e l ( i n f t / s e c ) :

    12

    Vm=Remvm/(Dm/12)13 / / D r a g f o r c e o n p r o t o t y p e ( i n l b f ) :

    14 Fp=Fm(dp/dm) (Vp1/Vm) 2(Dp/(Dm/1 2) ) 215 p r i n t f ( \n\nRESULTS\n\n )16 p r i n t f ( \n\n Te st s pe ed 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 ot o ty p e : %. 3 f l b f \n\n ,Fp)

    Example 7.04d 7.04-data.sci

    1 / / D i a m e t e r o f t h e p r o t o t y p e ( i n f t ) :

    2 Dp=1;3 / / S p e e d o f t o w i n g o f p r o t o t y p e ( i n k n o t s ) :

    4 Vp=5;5 / / D i a m e t e r o f m o d e l ( i n i n c h e s ) :

    6 Dm=6;7 / / D r a g f o r m o d e l a t t e s t c o n d i t i o n ( i n l b f ) :

    8 Fm=5.58;9 / / D e n s i t y o f s e a w a t e r a t 5 C f o r p r o t o t y p e ( i n s l u g / f t

    3 ) :

    10 dp=1. 99;11 / / K i n e m a t i c v i s c o s i t y a t 5 C f o r p r o t o t y p e ( i n f t 2 / s e c )

    :

    12 vp=1.69105;13 / / D e n s i t y o f a i r a t S TP f o r m o d e l ( i n s l u g / f t 3 ) :

    14 dm=0.00238;15 / / K i n e m a t i c v i s c o s i t y o f a i r a t S TP f o r m o d e l ( i n f t 2 /

    s e c ) :

    16 vm=1.57104;

    Example 7.05 7.05.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+7.05data . sc i 3 exec ( f i l e na me )4 / / W i d t h o f t h e m o d e l ( i n m ) :

    5 wm=Swp0 . 3 0 4 86 / / A r e a o f m o d e l ( i n m 2 ) :

    50

  • 8/7/2019 Fluid mechncs by Mcdonald

    52/116

  • 8/7/2019 Fluid mechncs by Mcdonald

    53/116

    Figure 7.1: Output graph of S 7.05

    9 / / A i r s p e e d i n w i n d t u n n e l ( i n m / s e c ) :

    10 V=[18 2 1. 8 26 3 0. 1 35 3 8. 5 4 0. 9 4 4. 1 4 6 . 7 ] ;11 / / D r a g f o r c e ( i n N ) :

    12 Fd =[ 3. 1 4 .4 1 6 .0 9 7 .9 7 1 0. 7 1 2. 9 1 4. 7 1 6. 9 1 8 . 9 ] ;13 / / K i n e m a t i c v i s c o s i t y ( i n m 2 / s e c ) :

    14 v=1.46105;15 / / D e n s i t y o f a i r ( i n k g / m 3 ) :

    16 d = 1 . 2 3 ;17 / / S p e e d o f p r o t o t y p e ( i n k m / h r ) : \

    18 Vp=100;

    52

  • 8/7/2019 Fluid mechncs by Mcdonald

    54/116

    Example 7.06 7.06.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+7.06data . sc i 3 exec ( f i l e na me )4 / / T h e s a m e p u m p i s u s e d f o r b o t h t h e c o n d i t i o n s . H e n c e :

    5 D2=D1 ;6 / / T h e s a m e w a t e r i s u s e d f o r b o t h t h e c o n d i t i o n s . H e n c e

    :

    7 d2=d1 ;8 / / F l o w r a t e a t c o n d i t i o n 2 ( i n g p m ) :

    9 Q2=Q1N2/N1(D2/D1)310 / / H e a d a t c o n d i t i o n 1 ( i n f t ) :

    11 H1=(N1sqrt (Q1)/Nscu1) (4/3)12 / / H e a d a t c o n d i t i o n 1 ( i n f t ) :

    13 H2=H1(N2/N1) 2(D2/D1)214 / / P u m p o u t p u t p o w e r a t c o n d i t i o n 1 ( i n h p ) :

    15 P1=d1gQ1H 1/7. 48/60/55016 / / P u m p o u t p u t p o w e r a t c o n d i t i o n 2 ( i n h p ) :

    17 P2=P1( d2/d1) (N2/N1) 3(D2/D1)518 / / R e q u i r e d i n p u t p o w e r ( i n h p ) :

    19 Pin=P2/Effp20 / / S p e c i f i c s p e e d a t c o n d i t i o n 2 :

    21 Nscu2=N2sqrt (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 o u tp u t p ow er 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\nR e qui r e d i nput pow er : %. 3 f hp\n\n\n , P in )27 p r i n t f ( \n\ n S p e c i f i c s pe ed a t c o n di t i o n 2 : %. 3 f \n\n\n ,

    Nscu2)

    Example 7.06d 7.06-data.sci

    1 / / E f f i c i n c o f p u m p :

    2 Effp =0.8 ;

    53

  • 8/7/2019 Fluid mechncs by Mcdonald

    55/116

    3 / / D e s i g n s p e c i f i c s p e e d ( i n r p m ) :

    4

    Nscu1=2000;5 / / I m p e l l e r d i a m e t e r ( i n i n c h e s ) :

    6 D1=8;7 / / O p e r t i o n s p e d a t e s i g n p o i n t f l o w c o n d i t i o n ( i n r p m ) :

    8 N1=1170;9 / / F l o w r a t e a t d e s i g n p o i n t f l o w c o n d i t i o n ( i n g p m ) :

    10 Q1=300;11 / / D e n s i t y o f w a t e r ( i n s l u g / f t 3 ) :

    12 d1=1. 94;13 / / A c c e l e r a t i o n d u e t o g r a v i t y ( i n f t 2 / s e c ) :

    14 g = 3 2 . 2 ;15 / / W o r k i n g s p e e d 2 ( i n r p m ) :

    16 N2=1750;

    54

  • 8/7/2019 Fluid mechncs by Mcdonald

    56/116

    Chapter 8

    Internal Incompressible Viscous

    Flow

    8.1 Discussion

    When executing the code from the editor, use the Execute File into Scilabtaband not the Load in Scilabtab

    The .sci files of the respective problems contain the input parameters ofthe question

    8.2 Scilab Code

    Example 8.01 8.01.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+8.01data . sc i 3 exec ( f i l e na me )4 / / L e a k a g e f l o w r a t e ( i n mm 3 / s e c ) :

    5 Q=%pi/12Da 3( p1p2 ) 103/u/L6 / / V e l o c i t y o f f l o w ( i n m / s e c ) :

    7

    V=Q/%pi /D/a /1 00 08 / / S p e c i f i c g r a v i t y o f S AE 1 0 W o i l :

    9 SG=0.92;10 / / R e y n o l d s N u m b e r :

    11 Re=SGdwVa/u/1000

    55

  • 8/7/2019 Fluid mechncs by Mcdonald

    57/116

    12 / / A s R e < 1 4 0 0 , f l o w i s l a m i n a r .

    13

    p r i n t f ( \n\nRESULTS\n\n )14 p r i n t f ( \n\nLeak age f l ow r at e : %. 3 f mm3/s e c \n\n ,Q)

    Example 8.01d 8.01-data.sci

    1 / / O p e r a t i o n p r e s s u r e o f h y d r a u l i c s y s t e m ( i n k P a ) :

    2 p1=20000;3 / / O p e r a t i o n t e m p e r a t u r e o f h y d r a u l i c s y s t e m ( i n C ) :

    4 T=55;5 / / P i s t o n d i a m e t e r ( i n mm ) :

    6 D=25;7 / / V i s c o s i t y o f S A E 1 0 W a t 5 5 C ( i n k g / ( m s ) :

    8 u = 0 . 0 1 8 ;9 / / M e a n r a d i a l c l e a r a n c e o f a c y l i n d e r ( i n mm ) :

    10 a = 0 . 0 0 5 ;11 / / G a u g e p r e s s u r e o n l o w e r p r e s s u r e s i d e o f p i s t o n ( i n

    k P a ) :

    12 p2=1000;13 / / L e n t h o f p i s t o n ( i n mm ) :

    14 L=15;15 / / D e n i t y o f w a t e r ( i n k g / m 3 ) :

    16

    dw=1000;

    Example 8.02 8.02.sce

    1 pa thn am e= 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 lename=pathname+filesep ()+8.02data . sc i 3 exec ( f i l e na me )4 / / S h e a r s t r e s ( i n l b f / f t 2 ) :

    5 Tyx=uN2%pi/60D/2/( a/2)6 / / T o r q e ( i n i n c h e s l b f ) :

    7 T=%pi/2TyxD2L/144

    8 / / P o w e r d i s s i p a t e d i n t h e b e a r i n g ( i n h p ) :

    9 P=TN/602%pi/12/55010 / / R e y n o l d s n u m b e r :

    11 Re=SGpN2%pi/601 . 5 a/2/u/14412 p r i n t f ( \n\nRESULTS\n\n )

    56

  • 8/7/2019 Fluid mechncs by Mcdonald

    58/116

    13 p r i n t f ( \n\nTorque : %.3 f inc hesl 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 ri n g : %. 3 f hp\n\n ,P)

    Example 8.02d 8.02-data.sci

    1 / / t e m p e r a t u r e f o o p e r a t i o n ( i n F ) :

    2 T=210;3 / / D i a m e t e r o f t e b e a r i n g ( i n i n c h e s ) :

    4 D=3;5 / / D i a m e t r a l c l e a r a n c e ( i n i n c h e s ) :

    6 a = 0 . 0 0 2 5 ;7 / / L e n g t h o f s h a f t ( i n i n h e s ) :

    8 L=1. 25;9 / / S p e e d o f r o t a t i o n o f t h e s h a f t ( i n r p m ) :

    10 N=3600;11 / / V i s c o s i t y o f t h e o i l ( i n l b f s / f t 2 ) :

    12 u=2.01104;13 / / S p e c i f i c g r a v i t y o f S A E 1 0 W :

    14 SG=0.92;15 / / D e n s i t y o f w a t e r ( i n s l u g / f t