209
NOTE TO USERS This reproduction is the best copy available.

NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

NOTE TO USERS

This reproduction is the best copy available.

Page 2: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 3: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The Development of a Simulation Mode1 of

Pipeline Network Systems with Check Valve

Tianhe Wen

A Thesis

in the Depamnent of

Mechanical Engineering

Faculty of Engineering and Computer Science

Presented in Partial Fulfiiiment of the Requirements

for the Degree of Master of Applied Science at

Concordia University

Montreal, Quebec, Canada

Q Tianhe Wen, 2001

Page 4: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

uisiins and Acquisitions et Bib mgraphii Setvices services bibliographiques "9

The author bas granted a non- L'auteur a accordé une licence non exclusive licence allowing the exclusive pemiettant a la National h i of Canada to Bibiiothéque nationale du Canada de reproduce, Ioau, distribute or seii reproduire, prêter, distri'buer ou copies of this thesis in microform, vendre des copies de cette thèse sous paper or electronic formats. la foxme de microfi&e/film, de

reproduction snr papier ou sur format élec~onique.

The author retains omership of the L'auteur conserve la propriété du copyright in this thesis. Neither the droit d'anîeur qni protège cette thèse. thesis nor substantiai exûacts fiom it Ni la îhèse ni des extraits substantiels may be printed or otherwise de celle-ci ne doivent être imprimés reproduced without the author's ou autrement reproduits sans son permission. autorisation.

Page 5: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

ABSTRACT

The Development of a Simulation Model of Pipeline Network Systems with Check Valve

Tianhe Wen

The objetive of this thesis is to design and implement a software package to

rnodel and simutate pipeline netwark systerns with check valves. The application package

is written under the window's environment to provide the hydraulic engineer a user

friendly interface for case of simulation and anaiysis without requiring to write code.

Discussion of the phenomenon of hydraulic transients, derivation of the

differentiai equations, cornparison of drfferent kinds of anaiysis methods, and

investigation of the method of characteristics solution and basic boundary conditions are

ai1 established. The check vdve dynamic equation is investigated for the analysis of

pipeline transients, and formuIae for flow torque acting on the valve discs are derived by

introducing the orifice sequence model. Dynamic behavior of pumps is considered during

the pipeline transients, and the analysis of this behavior combines the method of

charactenstics with check valve dynarnics, pump characteristic and pump boundary

conditions both for pump failure and pump start up. Numericd solutions to pipeline

transients, check vaive dynamicq and pump characteristic are established. Finally, the

impIementation into a working simulation program of a dynamic model for pipeline

network systerns with check vaives is desaibed, and a user guide for the software

HyrioAmlps and HyrioGruphic is presented.

Page 6: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

ACKNOLEDGMENTS

The author wishes to express bis gratitude to his supewisors Dr. J. V. Svoboda

and Dr. H. Hong, for their guidance and inspiration throughout the author's graduate

studies.

The author appreciates îhe cooperation and support given by Mr. D. Barday,

former President of Ritepro Inc. A h , the author would like to express his gratitude to

Mr. P. Major, the Chief Engineer of Ritepro Inc., for his technical assistance throughout

the research.

Page 7: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Table of Contents

Chapter 1 Introduction .................................................................................................... 1

1.1 Summary ...................*~..*..................*..................*.*.*..............~................................. I

7 ..................................................................... 1.2 Classification of Hydrriulic Transients ,

1 3 Classification of Check valves ................................................................................. 3

1.4 Review of Previous Work ..................................................................................... 5

.......................................................................................... 1.4.1 HydrauIic Transients 5

.................................................................................... 1.4.2 Check Valves D ynamics 6

1.4.3 Cornputer Pro-pn Simulation of Transients in Pipelines and

Check Valves ..................................................................................................... 7

.......................................................................................................... 1.5 Thesis OutIine S

Chnpter 2 Transients in Pipelines ............................................................................... 11

............................................................................................................ 2.1 introduction I I

2.2 Basic Equations of Tnnsients in Piperines ...................................................... 13

2.2.1 Continuity Equation ......................................................................................... 13

2.2.2 Equation of motion .................................... .. 15

.................................. 2.3 Cornparison of Method of Transient Andysis in Pipelines 16

............................................................................... 2.4 The Method of Chancreristic 17

2.4.1 Introduction ..................................................................................................... 17 . .

2.4.2 Charactensuc Equations ............................................................................... 18

.................................................................... 2.4.3 Finite Difference FormuIations 20

2.4.4 Basic . Boundary Condiaons ............................................................................. 23

................................................................................................ 2.4.4. I Reservoir 2 4

........................................................................................ 2.4.4.3 Series Ji~nmon 25

..................................................................................... 2.4.4.3 Branch Junmon 26

2.4.4.4 Valve or O+ce ....................................................................................... 29

..................................................................... 2.4.5 Boundary Conditions for Pump 31

2.4.5.1 Introduction ............................................................................................ 31

Page 8: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

................................................. 2.4.5.2 Boundary Cundirionsfbr Pwnp Failure 32

................................................ 2.4.5.3 Borurdary Condition for Pwnp Sran Up 37

Chapter 3 Check Valve Dynarnics ................................................................................ 39

3.1 Introduction ........................................................................................................... 39

....................................................................... 3.2 Check Vdve Differentid Equation 40

3.3 Component Torque ................................................................................................ 41

3.3.1 Countenveight Torque ............................................................................... 42

3.3.2 Spring Torque ............................................................................................... 43

3.4 Check Valve Flow Torque ................................................................................... 45

.................................................................................................... 3.4.1 Introduction 45

........................................................................... 3.4.2 Check Vdve Pressure Drop 46

.............. 3.4.2.1 Coefficient ofResistance of a Wafer Swing-Disk Check Valve 47

........................................... 3.4.2.2 Coeftrcient ufResistmce of Fonvard Flow 50

3.4.2.3 Coefficient ofResistance orReverse Flow 53 \ ............................................. 34.3 Swing-Disk Check Vaive Flow Twque .................................................. 54

3.5 Boundq Condition for Check Vdve .................................................................. 57

Chapter 4 Simulation and M d 1 of Pipeline Nework

Transients with Check Vaive System .......................................................... 59

4.1 inuoduction .......................................................................................................... 59

42 Algebraic Solution to a Piping System ................................................................ 60

............................. 4.2.1 Aigbn ic Representation and Continuous Ston- Data 60

........................................................................................................ 4.2.2 Indexing 63

4.2.3 Simulation of Piping System ........................................................ 6 6

............................................. 4 3 Numerical Mode1 and SimuIation for Check Vdve 68

4.3.1 Check Valve Dynamic S ystem Model .......................................................... 68

4.32 The Runge-Kutta Numericd Soiution to

the Check Valve Dynamic Equation ............................................................ 70

4.4 Newton-Raphson Solution m h p Boundvy Condition ................................... 73

Page 9: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 5 Software Implementation of Tnnsients in

Pipeline Nenkrork and Check Valve S ystem ............................................ 77 ........................................................................................................... 5.1 Introduction 77

5.2 Anaiysis for Hydro-Andysis Software Package .............................................. 78 . * ...................................................................................... 5.2.1 ProbIem Description 78

5.2.2 Input Parameters ............................................................................................ 79

5.2.3 Output Requirement .................................... ............................................... 81

5.3 Software Design .................................... f.. .......................................................... 83

5.3.1 Algorithm for the Hydro-Analysis ................................................................ 83

................................................................................... 5.3.2 Hiemhical Dia-pm 84

5.3.3 Object Oriented Programming Design for Hydro-Analysis .......................... 87

........................... 5.3.3.1 Major Class Description for Grapliic User btreface 87

........................................... 5.3.3.2 Class Description of Transients Simdation 92

.................................................... 5.3.3.3 Class Description of Graphic Oritprrt 97

5.4 Introduction to HydroAnaiysis S o b m ............................................................. 98

................................................................................................... 5.4.1 Overview 98

........................ 5.4.2 User Guide for Software Procm Package Hydrohalysis 100

...................................................................................... 5.4.2. 1 Gening sraned 100

5.4.2.2 Setting Sysrern Parmeren ................................................................... 100

................................................................... 5.4.2.3 Getting Simrilarion Output 112

.................................................................................................. Chapter 6 Conclusion 116

6.1 Summary .......................................................................................................... 116

.............................................................................. 6.2 Suggestions for Future Work 120

REFERENCES ........................................................................................................... 122

....................... APPENDIX A: Reviews of Method of Transient Analysis in Pipelines 127

............................................................................ APPENDK B: himp Characteristics 138

................................................................................ APPENDX C: Simulation ResuIts 143

............................................. APPENDIX D: Head Files for Software Hydro-Anaiysis 155

vii

Page 10: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

List of Figures

.................................................. Fig . 2.2.1 Notation for Continuity and Motion Equation 13

Fig . 2.4.1 Chmctenstic Lines in x-t Plane ....................................................................... 20

.................................................. Fig . 2.4.2 The x-t Finite Difference Grid .... .................... 21

......................... Fig . 2.4.3 Reservoir Boundq: (a) Upstream end; (b) Downstream end 24

Fig . 2.4.4 Series Junction .................................................................................................. 26

.......................................................... Fig . 2.4.5 B ranching Junction ...................... .... 27

Fig . 2.4.6 Valve in line ................................. .... .......................................................... 30

Fig . 2.4.7 Pump and Valve in Pipeline Systems ........................................................ 32

........................................... Fig . 2.4.8 Approximation of Pump Curve by a Scraight Line 34

Fig . 2.3.9 Pump Start Up .................................................................................................. 38

Fig . 3.2.1 Schematic of Check Vaive ............................................................................... 40

Fig . 3.3.1 Counterweight .................................................................................................. 42

Fig . 3.3.2 Cylindrical Helical Bending spring ................................................................. 43

.................................................................. Fig . 3.3.3 Cylindrical HelicaI Torsion Spring 44

............................ Fig . 3.4.1 Orifice Mode1 for Wafer-Type Swing-Disc Check Valve -45

Fig . 3.4.2 Orifice Sequence Mode1 ................... .. ........................................................ 31

Fig . 3.4.3 Unsteady Fiow Through an Check Valve ..................................................... 54

Fig . 4.1.1 Block Diamm of Pump. Check Valve and Pipelines ........................ .. ...... 59

......................... Fig . 4.1. I x-t Diagram for Algebraic Representations in Series Sysrrm 61

Fig . 4.2.2 Branching System with Pump and Check Valve ............................................. 64

......................................................................... Fig . 4.2.3 indexing of Branching System 65

Fig. 4-24 Fiowchart of Piping System Simulation .......................................................... 67

Fig . 4.3.1 Fiowchart of Check Vdve Numerical Simulation ........................................... 69.

Fig . 4.4.1 Newton-Raphson Solution for Pump ...................... ... ................................. 75

Fig. 5.3.1.1 Flow Chart of Hydro-AnaIysis ..... ,. .......................................................... 53

Fig . 5.3.2.1 (a) Hienrchical Diagram for Hydro-hdysis ............................................. 85

.................................. Fïg . 5.3.2.1 (b) Hiemhical Diagnm for Grapphic User interface 85

................................... Fig . 5.3.2.1 (c) Hiemhical Diagram for Tmsients Simulation 86

............................................. Fig . 5.3.2.1 (d) Hierarchical Diagnm for Output Graphic 86

Page 11: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig . 53.3.1 The operation and attributes oFCM~nFrame ................... ........ ......... 87

Fig . 5.3.3.2 Operation of CChildFme ........................................................................... 88

Fig . 5.33.3 Operation of ChydroAnalysisView .................................. ., ..,., ................. 88

Fig . 5.3.3.4 The operation and mibutes of CFrontPageFonnView ............................. 89

Fig . 53.3.5 Opencion of CHydroAndysisApp ...................................... .. ........ 90

. ...........*.................*..... Fig 5.3.3.6 Operation of Chydro AnaiysisDac .... .................. 90

Fig. 53.3.7 The operation and atiiibutes of PlotPnntoutDlg ................................... 91

................................... Fip . 53.3.8 The operation and attributes of Pipe ... .......... 92

................................................ . Fig 5.3.3.9 Operation of PipeNeQCv & PipeNet2NoCv 93

........................................................... . Fig 5.3.3.10 Opention & Attributes of PumpFail 94

Fig- 5.3.3.1 1 Operation & Attributes of PurnpStrirt ........................................................ 95

...................................................... . Fig 5.3.3.12 Operation & Actributes of CheckVaIve 96

........................................................ . Fig 5.3.3.13 Description of HydroGmphic Classes 99

................................................................ Fig . 5.4.2.1 Main Window of HydroAndysis 101

Fig . 5.41.2 Dialog Box for Connection Panmeters ...................................................... 102

Fig 5.4.2.3 Didog BOX of Indexin: .............................................................................. 103

........................................................................... Fig . 5.4.2.4 Diaiog Box of Simulation 104

......................................................................... . Fig 5.4.2.5 Dialog Box of PLot & Print 105

......................................... Fr g. 5.4.1.6 Didog Box for Pump Check Vdve Panmeters 106

............................................................. . Fig 5.4.2.7 Diaiog Box of Pipeline Pumeters IO7

........................................................ . Fig 5.4.2.8 Didog Box of Reservoir Panmeters 108

................................................... . Fig 5.4.2.9 DiaIog Box of Conml Vdve Panmeters 108

Fig . 5.4.2.10 Didog Box of Junction Panmeters .......................................................... 109

................................................................................... . Fig 5.4.2.1 1 Menu File Window 110

...................................................... . . Fig 5.42.12 Save Mode1 As Window .. 111

................................................................................ Fig- 5.4.2.13 Open Mode1 Widow 112

........................................ . Eg 5.4.2.14 HydroGraphic Main Page (With Check Valve) 113

............................................................................ . Fig 5.4.2.15 Display of the Plot Dam 114

............................................ . Fig A i Circuit Represent of Lumped Parameter Method 130

.................................................................. . Fig A 2 BIock Diagram for Single Pipeline 134

Page 12: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig . B 1 Polar Diagram of 8 ......................................... 140

Fig . B 2 Complete Pump Chmcteristics ................................................................... 141

.... Fig . C 1 SimpIe Pump, Check Valve , and Pipe System ....................,.................... 144

.......................................... Fig . C 2 Indexing of Branching Systems ........................ ,. 151

Fig . C 3 Graphic Display of Branching System Wxthout Check Valve .......................... 152

............................... Fig . C 4 Gnphic Display of Branchin; System With Check Valve 152

Page 13: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Nomenclature

Cv, cvm

Area of pipe, Project a m of the disc and disc m.

Pump characteristics parameters, Project m a of the disc and disc a m

nomai to the flow Stream

Pump characteristics parameters

Area of valve opening

Wave speed

Constants to describe pump head-discharge cuve

Pipeline chmcteristics impedance

Known constants in compatibiIity equations

CaIculate prirameter in compatibility equations

Pipeline capacity

Name of characteristic equations

Vdve or orifice discharge coefficient

Known constants in compatibility equations

Nomd dng coefficient

Cdculate parameter in compatibility equations

Valve flow coefficients

Pipe diarneter

Disc forward and reverse flow forces

Friction Factor

Gnvitational acceleration

Pressure head

Rated pressure head of pump

Pump start up shutoff head

S tead state or mean pressure head

DimensionIess pressure head for pump fadure

I Moment of inerùa of rotating parts for pump

J Total moment of inertia for check valve

Page 14: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

I I

Q Qin

Qn

Moment of inertia of counter weight for check valve

Moment of inertia of the disc and arm assemble for check vdve

Bulk modulus of elasticity

Valve coefficient of resistance

Vdve coefficient of resistance; Disc fiction constant

Vdve coefficient of resistance

Fourth order Runge-Kutta parameters

Spring constant

Pipe length

Mass

Rotational speed of pump

Rated speed of pump

Number of reach in pipeline

Discharge

hfiow

Junction or nodal flow

Pipeline flow; Pump flow

Check vdve or valve Fiow

Pipeline resistance coefficient

Toque on pump or check vaIve; Time

S tead state torque of pump

Beiuing friction torque of check valve

Counterweight torque

Fiow toque of check valve

Rated toque of pump

Spring torque of check valve; Pump start up shutoff time

Weight torque due to rotating disc

Time

Velocity

DimensionIess velocity

VeIocity ; Weight

xii

Page 15: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

DimensionIess pump chriracteristics

Distance along the pipeline; Angular position in pump chamteristic curve

Characteristic impendence

Elevation of pipe above cimm

Dimensionless speed ntio for pump fidure; Torque ratio for pump s u up

Dimensionless toque ratio for pump failure

Specific weight of fiuid

Ange of torssonal sprinz

Pump efficiency

Opening of Check valve

Multiplier in characteristics method

Dimensionless flow ratio for pump faiIure

M a s density

Dimensionless valve opening

Angular velocity

Page 16: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 1

Introduction

1.1 Summary

A pipeline system is a combination of pipinp components with the objective of canying

incompressibIe or compressible fluid to one or several users. An industrial pipeline

system may be considered, for most of its operatinp time, to be in a steady srate of flow.

But a rapid velocity (or pressure) change, an accident or a non-normal operition in ri

pipeline system will resuit in a hydnulic uansient. This can shonen the life span of

certain pipeline components and even damage them.

Common txamples of the causes of transients in engineering sysrsms include:

1. Opening, closing of valves in a pipeline

2. Starting or stopping the pumps in ri purnpinz system

3. Starting-up a hydraulic turbine, accepting or rejecting load

4. Vibrations of the vanes of a mnner or an inpeller, or of the bIades of a fan.

Check valves are pieces of equipment which were originally developed and fitted

to pipelines in order to prevent the lines dnining backwards when pumps sropped - They

were sometirnes also used to prevent downstrem resetvoirs from empcying, in addition.

they prevent reverse rotation of pumps, thereby avoiding damage to seds and to the gear

of the dnving motor.

Page 17: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The undesired effects of flow reversai vary depending on the application. Some

examples where check valves are used include:

O In tank fiil-up applications, a check valve is instaiIed on a supply pipe which is beIow

the water Iine to prevent draining the tank in the case of flow supply pressure drop.

A check valve installed on the output of a pump would prevent high downstream

pressure from dnving the pump in reverse in the event of a power failure.

in an intermittent pumping application where the ffuid supply level is beIow the

pump, a check valve is instdIed at the foot of rhe inlet suction Iine to prevent draining

of the pipe ruid hence unnecessq priming of the system.

1.2 Classification of Hydra ulic Tra nsien ts

Hydnulic tmnsients may be classified into the foIlowing three categories:

I . Tnnsients in closed conduits

3. Tmsients in open channels

3. Combined free-surface-pressurÏzed tmsient fiows.

The analysis of transients in closed conduib may be further subdivided into two

types:

1. Distributed systems

2. Lumped systems

In distributed systems, the transient phenomenon occurs in the f o m of traveling

waves. Places in which such transients occur include water suppIy pipes. power plmi

conduits, and gas-uansmission lines.

Page 18: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In the analysis of lumped systems, any change in the flow conditions is assurned

to take place instantaneously throughout the system. Le.. the fi uid is considered as LÏ solid

body. Mathematically, transients in the distributed systems are represented by partial

differentid equations, whereas îhe transients in the lumped systerns are described by

ordinary differential equations. If oUa is much Iess than 1, then the system may &e

analyzed as a lumped system; otherwise, the system must be anafyzed as a disrributed

system. In the previous expression. CO= frequenp of oscillation. L = lrnyrh of riir

pipeline, and a = wave velociry.

In this thesis, discussion will focus mainly on transients in closed conduits.

1.3 Classification of Check valves

Some of the most commonly used check valves rire clusified here according ro openimg

principle.

A bal1 check valve consists of a bail insened into the flow to permit essentiaIly

unrestricted flow in the preferred direction. Flow in rhe reverse direction carries the bail

to the seat, immediately blocking the line. The valve may be spring or gravity Ioaded so

chat the minimal flow per opention is controllable. The bal1 check valve is used for hioh

viscositi Iiquids, in smdl size (ma. 2"') tmsport lines, and in hydraulic and pneumatic

power systems.

A piston check valve consists of a piston similar to a globe valve disc, which. in

normal operation, is kept suspended by the flow forces. The piston MIS by ,oravity when

the flow forces become insufficient or negative. This type may also be spring or gravi-

Page 19: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

loaded. The piston check valve is widely used for Iiquids and gases and is particularly

effective for high-pressure stearn services.

The swing-disk check valve consists of a disc inserted into the line and rotating

about a pivot shaft. In norrnd operation, the disc is kept open by the flow forces. The disc

closes due to p v i t y when the fluid forces becorne insufficient, Counterweights.

dashpors, or springs may be added to control the disc closing characteristics.

The swing-disc check valve is the rnost commonly used type in industrial

pipelines, in a wide range of pipe dimensions (from 2" to over 48" diameter) and

openting pressures. in the folIowing, the investigation is focused mriinly on the swing-

disc check valve.

The category of Swing-Disc Check Valves can be funher subdivided into the

following types:

1. Conventionai bore or reduced orifice swing check valves

2. Full bore swing check valves

3. Wafer swing check valves, which are essentialIy convenrioncil bore types. with

reduced length and weight and favorable economic and instaflntion characteristics.

The disc of the swing check valve can reach dimensions of over 100 cm diameter

and a weight of over 2 tons, for such I q e disk. counterweights become necessriry to

open the vaive in normal openting conditions and dmpers are required to reduce the

dynamic forces.

Page 20: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1.4 Review of Previous Work

1.4.1 Hydraulic Transients

The smdy of hydraulic transients began with the investigation of the propagation of

sound waves in air, the propagation of waves in shallow water, and the flow of water in

pipes.

In 1897, Joukowski conducted extensive experiments in Moscow on pipes chat

were, respectively, 7620 m long and 50 mm in diameter, 305 m long and 101.5 mm in

diameter, and 305 m long and 151.5 mm in diameter. Based on his experimental and

theoreticat studies. he published his clusic report [ I l on the basic thsory of the writsr

hammer. He developed a formula for wave velocity, ctiking inro consideration the

elasticity of both the water and the pipe walls. He also investigrited the relationship

0 tWO between the reduction of flow velocity and the resulting pressure rise by usin=

methods: the conservation of energy and the continuicy condition. He discusscd the

propagation of a pressure wave along the pipe and the retlection ot the pressure wrivrb

from the open end of a branch, and studied the effects of air chambers, surge tanks. and

spring safety vdves on water hammer pressures. FinalIy, he found that the pressure rise

was a maximum for closing times, Tc 1 2 L l a , in which L= length of the pipeline and a

= ~ v m e speed.

Allievi [ I l published the seneml theory of water hammer in 1902. He obtained an

expression of the pressure nse at the valve and presented charts for the pressure rise and

drop caused by a wi i fody closing or opening vaive. He dso studied the rhythmic

movement of a vdve. He proved that the pressure cannot exceed twice the static head

Page 21: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Based on Joukowski's theory, in 1920, Gibson [ l ] presenced a paper thnt

included, for the first time. nonlinear friction losses in the analysis. He also invented an

appmtus to measure the turbine discharge using the pressure-tirne history foIlowing ri

load rejection.

Schnyderc [ I l includcd complete pump characteristics in his analysis of water

hamrner in pipelines connected to centrifuga1 pumps. He was the t k t to include rhe

friction losses in the graphitai analysis .

Since 1951, sevent books [2-101 have been published on the subject. Several

rnethods of andysis have been developed, such as Method of Characteristics [4.7,33].

Lumped Parameter Method [ 14,151 in tirne domain, Four-Pole Equations Modeling

Method [6] and Transmission Line ModeIing Method r37.38.391 in frequency domain.

1.4.2 Check Valves Dynamics

The investigation of check valve dynamics and check valve related pressure s u r p have

been conducted by Pool. Fonvit and Cariton [ I l ] . Their work focused on modelinp the

check vaIve dynamics more accuntely in order to obtain better surge pressure

predictions. Swing-disc and tiitingdisc check valves were considered.

Csemniczky [12] studied the hydrauiic performance characteristics of pressure

drop and momentum for tiltingdisc check valves. He derived a semi-empiricai formula

describing the momentum acting on the disc shaft-

Hong and Svoboda 113, 141, in 1981, presented the cornputer mode1 of a swin_o

check vdve suitable for use in Iumped parameter pipe network simulation. The vaive is

Page 22: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

viewed as a variable resistor with a resistance king the function of the disc angle. The

fluid was treated as incompressible.

Cavazzoni [15], in 1983, used an Orifce Seqiience Mode1 to determine the

coefficients of resistance for check valves. The valve dynamic system was represented by

a second order, non-Iinear differential equation. Additional elements such as

counterweights and springs were exarnined and introduced, as additional ternis. into the

generai differentiai equation.

In 1983, Provoost El61 presented results of the study of the dynamic

characteristics of several types of check valves. he noted the importance of the local

reverse velocity and the decelention of the liquid during closure.

Significant contributions ware made by Thorley [17] in 1987. where valve

characreristics have been studied with a view to defining a boundriry condition for

computer coding and also to establish the 'right' type of check valve to use in a particular

installation.

1.4.3 Cornputer Program Simulation of Transients in Pipelines and Check

Valves

The arrivai of the 1960's and the advent of the high-speed digital computer begrin a new

era in transient anaIysis of pipelines and check valves. In 1967, Streeter and Wylie (41

showed the application of the computer to comptete a comprehensive hydraulic tnnsients

anaiysis. Watters [a] gave a FORTRAN program to soive simple pipe and pipe networks

in 1979, Cavazzoni [15] simulated pipes and check vaIves separacely by a FORTRLY

pro-gram in 1984. Hong [14] cornbined pipes simuIsition and check valves simulation rn

Page 23: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1983. in 1994, Cavazzoni developed a CU program [18] to solve transient flow in

pipeline networks systems using the finite element method. Sadfa designed the

FORTRAN program Cl81 to solve for the transient piping network flow in 1998.

Today the emphasis on pipeline transient analysis is almost entirely concentrated

on cornputer applications and window p m p m . lenkins [L91 developed a window

program HAMMER which simulates the effeccs of the water hammer in a reservoir and

pipeline system in which a valve at the downstream end is opened or closed by the user.

F a t [20] designed software Faast-3 which is an interactive, graphicat fini te-element

progrrirn for anaiyzing fluid flow in piping systems.

The objective of this thesis is to mode1 and sirnulate pipeline network systrms with check

valves. The study focuses on three major ares:

1. Analysis of hydnulic tmsients for pipeline network sytem

2. Analysis of check vdve dpamics, especiaily for swing-disc check valve dynnmics

3. Compter program implementation of combined pipelines and check valves

This study wiII begin by developing the governing equations for the transienc tlow

in closed conduits. In Chapter 2, conùnuiry and momentum equations will be incroduced.

Severai assumptions are made and then condensed into a simplified version. The

Page 24: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

chancteristics method will also be discussed in Chapter 2. Finally, basic boundary

conditions including valve and pump will be investigated in this chapter.

Chapter 3 will present the study of pressure drops across the check valve, and

ffow forces acting on the vdve disc. An orifice sequence mode1 will be developed. in

order to predict the pressure drop through a valve as a function of a disc angle, for direct

and reverse flows. Coefficients of resistance for the vdve and for the disc alone will bs

developed. and the disc flow torque will be investigated to determine a relationship

between drag forces and total torque. The check vaive dynamic system will be

represented by a second order, non-linear differential equation.

Chapter 4 wiI1 give the procedure for implementing computer simulation of

pipelines with check valves. This chapter will give consideration to the integrrition of the

pipelines simulation, check valves dynamics. and pump charticteri~tic analpih. Thr

solution to pipeline transient by the characteristic method, to check valve dynamics b)

the Runge-Kutta method, and to pump chancteristic equations by the Newton-Rriphson

method will also be discussed in this chapter. Some algorithms, tlow chart and code will

also be presented.

Chapter 5 will present anaiysis of the pipeline network systrrns Crom the vie\\

point of software engineering; design and implementation will be done using Objecr-

Orïented Pro,oramming techniques. The rinalysis will include some high-level dgorithrns.

hierarchical diagram and detail descriptions of the class and some objects. The user guide

for the software HydroAnnlysis and HvdroGrcrphic will also be given in this chapter.

Finally, Chapter 6 wi11 include results and the conclusion to this study in addition

to suggestions for hrther work.

Page 25: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Appendix A gives Ihc review of seved solution mehods used in hydrauiic

transient analysis. Most of the major methods used in the analysis are introduced. The

lumped parameter, Four-Pole Equacions Modeling, and transmission line methods are

then given in detail. Appendix B is the pump characteristics which wiil be used in rhis

study. Appendix C gives the extra simulation results of pump friilure and srart up.

Appendix D lises the head file for the program package HydrauAnaIysis and

HydnuGraphic.

Page 26: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 2 -

Transients in Pipelines

2.1 lntroduction

Fiows in pipes are usudly in an unsteady state. Aitering the rate of flow can cause large

pressure fluctuations which can endanger the integrity of the pipe. Such pressure

fluctuations are called pressure transients and the state of flow in which they occur is

called transient Jow.

In solid body mechanics, one may anniye the situation of a m a s when being

acted on by a force. The mass is considered to be concentnted at its center of +pvity and

Newton's second Iaw is applied, taking into account any fnctionai forces present. if the

force is not CO-linear through the center of ~ v i t y , angular momentum and mguIar

acceIentions must be considered, This technique cm be applied to a m a s of water with

equd validity but, if the m a s of water is very long and thin, as occurs in pipelines, such

an approach is unredistic. This is because of the fact that when a force is applied to a

long mass of water, that force is propagated through the water by wave action.

Consequently this process occurs over a finite period of time and so the entire mas

involved does not experieace the force at the same time. An analysis that takes account of

this effect is caüed an elasn*~ mlysis, whei~as the usuai method of andyzing soiid

bodies is said to be a ngid body analysis.

From the above, there are two basic methods for the andysis of unsteady flows:

ci@d column theory and elastic theory. Obviously the elastic theory is more accurate uian

Page 27: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

the rigid column theory. Therefore discussion will focus on the elastic theory in this

chapter.

2.2 Basic Eguations of Transients in Pipelines

Two equations are used to solve probIems of unsteady flow in pipes, one being a form of

the continuity equation and the other king a form of the momentum equation (or motion

equation). Since the flow velocity and pressure in transient fiows msiy be functions of

time ris well as distance, these equations are a set of panial differentid equations.

2.2.1 Continuity Equation

To derive the continuity equation, we apply the Reynolds vansport theorem [SI for the

conservation of mas. First, we chose the control surface and control volume as show in

Fig. 2.2.1. where x is the distance, V is the vdocity, and W is the veIocity of section

moving.

Applying Reynolds transport theorem to the above conuol volume gives

The above equation cm be simplifieci:

This equation holds for converging or diverging tubes as weil as for cyiindrical

Page 28: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

pipes on ri dope or horizontai. It is also valid for any fluid. and for ri$d or highly

deform;lbk tubes, as no sirnplifying ssurnptions have been required.

XI

2.2.1 isiotation for Continuity and Motion Equation

To write this equntion in terms of the variables of interest, as pressure p and

vclocity V, wwe express the derivatives of p md A in texms of p and V as following. The

first term in (2.2.2) takes into account the compressibility of the fluid. Pressure is

inmduced with the definition of bulk modulus ofelasticity of a fiuid.

This equation cm be wriaen as

The second tenn in (2.2.2) deds with the elasticity of the pipe wdl and its rate of

deformation with pressure. For prismatic tubes, area is a function of pressure only

Page 29: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Substituting (22.4) and (2.2.5) into (2.2.2) yields

Now we define (71: a' = P . . K d 4

where a is the speed with which a pressure wave tnveIs back and forth in an elastic

conduit filled with sli_ohtiy compressible fluid.

From (2.2.7), (2.2.6) becomes

In the above cquation,

The above equation cm be approximated by negecting the spatial variation of V

whenever both spaual and tirne-varying t e m appex in the s m e equation, because in

gened, spatiai variation is much less than time-varyinz variation. Sa that ((3.2.9)

So (2.2.8) is simpIifÎed as:

(23. LI)

It is a common pnctice in hydrauiïc engineering to compte pressures in a

pipeline in t e m of the piezometric head, H, above a specified ciam and use the

Page 30: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

dischq-e. Q. as the second vaiabIe instead of the fiow vehcity V

in whizh z = elevcltion of the pipe centeriine.

From (22.12), the dope term is usualIy smdl and mriy be ne~iected,

With the above assumption, (2.2.1 1) becornes

This is the sirnplified continuiry equntion.

2.2.2 Equation of Motion

For the equation of motion, the Reynolds Transport Theorern [SI for the conservation of

mornennim cm be used We c m obeain

'Ihe above equation can be simplifie&

wheref= Darcy-Weisbach friction factor. The above equation is valid for canverging or

divergïng pipe Bow.

dv av Similar rezrson as (2.2.10), (i.e., - = - ), and (3.2-16) reduces tu:

dr at

Page 31: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

From (1.2.13 we cm get the foliowing

JP a~ az - = pg(--- ax ) = pg(- - sin 8) a.t a.r a.r a.r

Substitution into (3.217)

Since Q=VA, we findly derive

which is the simptified hydnuIic-grade-line form of the equation of motion. It is

resuicted to less compressible fi uid (such as liquids), ff owin; rit a low veIocity.

2.3 Cornparison of Methods of Analyss

The continuiq and motion equations are the basis of hydnulic ansients anaiysis. They

are quasi-iinear, hyperbolic, partiai differentiai equations. A closed-form solution of these

equations is not available. However, by negiccting or l i n e d n g the noniinear t e m ,

seved methods have been used for nurnencdly inte-dng nonlinear, hyperboiic partiai

differentiai equations, such as method of chancteristics, finite-difference method, finite

eIement method, and linear eelement method.

The method of chancteristics converts the two partiai differentid equations of

motion and continuity into four total differer?tial equations. This method has become

Page 32: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

quite popular and is extensively used. For the andysis of systems having complex

boundary conditions, this rnethod has proven to be superior to other methods in severai

aspects, such as its stability, accuracy, easy of programming, and efficiency of

computations.

in the finitedifference method, the partial derivatives are replaced by finite

difference approximations such that the unknown conditions at a point at the end of a

time sep are expresseci in terms of the known conditions at the beginning of the tirne

step. Since the algebraic equations for the entire system are soIved simultaneously, the

anaIysis of complex boundary conditions by iterative procedures may require a large

amount of computing time. The Iinear element method and finite element method even

need 20 times more computation time to solve the same probIem [15]. But for complex

pipelines, the method of characteristics is supenor to the finite difference method, mainly

for its efficient handling of boundary conditions. Therefore, the method of characteristics

is chosen after cornparing with the above methods and with other methods such as the

lump parameter method and the transmission line rnethod, which reviewed in Appendix

A.

2.4 The Mefhod of Charactensfics [7,30,3 1,33 J

2.4.1 Introduction

In section 2.3, it was demonstrated that the method of chmeristics be superior to the

other method. Seved methods used for the solution of hydraulic transients wilI be

discussed and compared in Appendix A The details of the method of characteristics are

Page 33: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

presented in this section In this method, the partial differentiai equations will be

transformed into particular total differential equations. These total differential equations

will then be integrated to yield finite difference equations, and fiirthermore algebraic

equations, which can be conveniently handled. Simple, basic boundary conditions are

aiso discussed m this section.

2.4.2 Characteristic Equations

The motion and continuity equations (22.20) and (2.2.14) can be rewn'tten respectiveiy:

Let us consider a linear combination of Eq.(2.4.l) and (2.4.2) using a unknown multiplier

Any two real, distinct values of h will yieId two equations in tenns of the two dependent

variabIes H and Q that will be equivaient to Eq. (2.4.1) and (2.4.2). Appropriate seiection

of two particular values ofh Ieads to a simplification ofEq.(2.43).

if H = H(x, t) and Q = Q(x, t ) , then the total denvatives are

The unknown multiplieril is defined as

Page 34: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The soIution of Eq.(2.4.5) yields two pdcular values of A,

Substitution of these values of A into EqQ.4.3) le& to hvo pairs of equations which are

grouped and identified as C' and C- equations.

and

Thus hvo real values of A have been used to conven the originai two p h d

differentid equations to two totd differentid equations in the independent variable t.

However, a price has been paid for this simplification: Eq.(2.4.1) and (3.42) were vdid

everywhere in the x-t plane: in contrat Eq.(2.4.7) is valid ody dong the saight fine

given by Eq.(1.4.8), and (2.4.9) is vdid only dong the straight Iine given by Eq.(2.4.10).

1 in the x-t plane, Eq.(2.4.8) and (2.4.f 0) represent two stni$t lines having dopes k-.

a

These lines are caiIed the characteristic h e s as show in Fig 2.4.1.

Page 35: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 2.1.1 Characteristic Lines in x-4 Plane

24.3 Finite Difference Formulations

in pncrice. the pipeline is divided iria an even number of reaches, N, each Ar in 1en-h.

as shown in FÎg 2.43. Assuming that the values of Q ztnd Hat point A and B are known,

and we want ro determine their vdues ac point P, this nn be done by solving Eq42.4.7)

and (3.4.9) as foIIows.

By muitiplying the Iefr-hand side of E q . ( X i ) by dt and interping, we obtrirn

in which we use subscripts A and P CO indicrite locations in the x-t plane. For exanipIe,

4 and Qp are the head and discharge at point P.

Page 36: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 2.42 The x-t Finite Difference Grid

The hrst two inte-oral terms of Eq.(2.4.11) may be evduared erisily. However, this cruinot

be done for the third tem, because the variation of Q with respect to t is not explicidy

known. Thus an approximation must be introduced in this evdtution. A number of

options exist. The objective is to maintain a simpIe f o m that will provide reasoniibie

accuncy in generai unsteady fiow and that will hoId conditions steady during steady

fiow. It is therefore best to use the trapezoidd rule to maintain the l inev fom of the

in tep ted equations. It is of second-order accuracy, and is a satisfactory approximarion

for most problems.

~ Q I Q I ~ ~ = ~ Q ~ ;A I (2.4.12)

By substituting Eq.(2.4.12) into (2.4.11), and noting that Ar = +& , integntion dong the

characteristic iine AP, and simiiarly dong the characteristic Iine BP resuits in

Page 37: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

These two cornpatibility equations are algebmic relations that describe the [mien t

propagation of the piezornetric head and flow in a pipeline. By solving for 4, these

equations may be witten

in which B is n function of the physicai properties of the fiuid and the pipeline. often

clled the pipeline chmcteristic impedmce:

and R is the pipeline resistance coefficient:

The fiiction factor f mriy be a constant, or it may be adjusted with the Iocd Reynolds

number in accordance with the Moody dia-oram in each reach at each time sep during

cdculations.

The solution to a problem in Iiquid transients usually begins with steady-state

conditions at time zero, so that H and Q are known initiai vdues at each computing

section (Fi- 2-42), for t = O. The solution consists of finding H and Q for aitemare grid

points dong t = dt, then proceeding to r = 2&, and so on, until the desired time duntion

has been covered. At any interior grid intersection point, point P ac section i , the two

Page 38: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

compatibility equations are solved sirnul~eousty for the unknown Qi and Hi .

Eq.(2.4.15) and (2.4.Io) rnay be written in a simple form

C': Hi = C, - B,Qi (2.4.19)

C- : Hi =CM + BMQi (2.4.20)

Where

C p = Hi-[ + BQ,-, Bp = B+RI QI-[ 1 (2.4.2 1)

= Hl+, - BQi+l B M =B+RIQl+, I (1.4.22)

solving for Hi ruid Qi :

CP - c, B ~ + B ~

(1.4.34)

Thus the computation procedure uses the currenc values of H and Q at point i - I and i + 1 to cornpute their values at point i at one time interval Ar later. Usudly, the

startins values are known for a steady flow condition, which is calIed the boundary

condition. The discussion concerning the boundary conditions wiIl be presented in the

next section and in a later chapter.

2.4.4 Basic Boundary Conditions

In the last section, it was indicated that boundary conditions are required to determine the

transient-state head and discharge at the boundaries. Devices such as pump, vaive,

reservoir and junctions fom these boundaties. They may be Iocated at either end of a

Page 39: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

pipeline or at some intermediate point. if they are Iocated at the downstrem end (x = L),

fi:. 2.4.3, the C? characteristic equation (2.4.19) can be used, while if it is at the

upsmm en& the C chmeteristic q u h n (2.4.20) can be appIied. The folIowing are

typicai boundary condition equations:

2-4.41 Reservoir

1. Ar the upsrream end of the line: Fig 2.4.3a

Fig. 2.43 Reservoir Boundary: (a) Upstream end; (b) Domistream end

At a large upstream reservoir the elevation of the hydrauIic p d e iine nomdy cm be

assumed constant during a shortdurarion transient This boundary condition is described

as HI = HR, in which HK is the elevarion of the reservoir surface above the reference

Page 40: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

&tum. At e x h time step, Hf is known, and QI is determined by a direct solution of

Eq.(2.4.20)

The subscript 1 refers to the upstream section, at point P, Frg. 2.4.3a; Chi and Bbf are

variables in the computationd procedure but are dependent only on known values from

the previous time sep, in this case point B, section 3.

3. At the downstream of the line Fig. 2.436:

The boundq condition is described as: HNS = HR, Sirnilarly. Eq.(2.4.19) is used

where the subscript NS refers to point P. Cp and Bp c m be cdculated by the previous

time step.

This type of junction, althou* shown in fig. 2.4.4 as a diameter change, appIies equaiIy

well to a singie-diameter pipe with a change in roughness, thickness, or constraint

condition, or any combination of these possible variabies. At the junction (Fig. 2.4.4),

Eq.(2.4.19) is avaiIabIe forpipe 1, and Eq. (2.420) is available for pipe 2.

Page 41: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 2.4.4 Series junction

The continuity expression and the condition of a common hydraulic-grade-line

elevation provide nvo equations, as follows:

Q w s = Qz.1 Ht,a = Hii

where the fint subscript refers to the pipe number and the second one refea to the end

condition. By solving these equations simultmeously with Eq.(3.4,19) and (1.4.20). the

folIowing is obcriined:

2.4.4.3 Brancli Junction

A junction is visuahed as a point connection of elements in a system, at whic h there are

two variables: a nodal fiow, a, wbch may be zero, with inflow being positive, and a

Page 42: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

no&[ pressure or hyhuIic-pde-iine elevation. Fîg 2-45 shows a branching junction of

pipeline with a potential nodal flow Q,t.

Fie. 2.45 Brrinching Junction

There are two types of junctions or nodes:

1. A constant pressure

2. A constant ff ow

Referring to FI^. 2.4.5, a continuity equation is written at the junction summing

the inff ow,

in which the ZQ, is the summation of al1 instuitaneous pipeline flows. When minor

Iosses are negiected, we have

Page 43: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The compritibility equritions ;ire also avaiIabIe in erich pipe: Eq. (2.4.19) for pipe 1 and 2,

Eq. (24.20) for pipe 3 and 4.

For a junction with a known pressure head (unknown nodal flow), such as rit a

reservoir or pressure tank, the pipeline flows are determined directiy from appropriate

application of Eq(2.4.19) and (2.4.20), and the no& flow Q,, is then determined directly

from Eq.(2.4,29).

For a junction with known (may be zero), the compatibility equations are

writren in the following form:

The sumrnrition of these equations &es

and indudes ai1 the pipelines connected to the junction. Substitution into Eq.(2.439)

yieIds an equation form simiIar to the compatibiiity equations to compute the pressure

head:

Page 44: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

in which C, =- 1 Sc and B, = -. The compatibility equations then yield the tiow in each s 8 S B

pipe. This method mrty be applied to any number of pipes and c m be extended to non-

pipe elernents such as valves and pumps.

2.4.4.4 Valve or Orifice 132,361

Valves or orifices may be located within a given pipeline, between two different Iines, at

the reservoir, aat pipeline terminations, or in my number of other positions in systems.

Fig.2.4.6a shows a valve between two pipelines, and Fig. 2.4.6b shows a schematic

representation of the vdve with nodes a and b as the inrerconnectin_o junctions on both

sides of the valve.

Use of the steady state orifice equation negects my inertia effects from

accelerating or decelerating flow througJi the vdve opening and also implies that there is

no opportunity for a change in the volume of fluid stored in the valve body. For positive

flow, Fig 2,4.6b, with HI, NS = & and HtVi = 6, the orifice equation is

Q, =au =a. = ~ , & , / ~ (2.4.33)

in which AG is the area of vaive opening and Cd is the dischq-e coefficient.

For steady state flow, the simiiar equation is

Page 45: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

in which the subscript zero refers to steady conditions for each variable. A dimensionless

--t I l --tg! - Valve

Valve

Fig. 2.4.6 Valve in line

valve opening is useful in specifjklg valve motions as rt function of time and is defined ris

For the steady flow of Qo and the corresponding energ loss of &, t = 1, and for no flow

with the vaive closed, t = O. By dividing the unstendy Eq. (2.4.33) by the stendy strtte

flow Eq,(2.4.34), we obtain

a,, = a,, = Q" = - JH.-H, JH,

Applying Eq. (2.4.19) in pipe 1 and (3.420) in pipe 2, combined with Eq.(1.4.36), we

g=t

Page 46: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

in which

For flow in the negative direction the orifice equation is

and when combined with Eq(2.4.19) and (2.4.20), ive c m get

Once the flow is known, Eq.(2.4.19) and (24.20) cm be used to find the pressure head.

The above describes onIy the rnost basic b o u n d q conditions used in anaiyzing

pipelineîheck valve trmsients. The check vaIve boundq condition wilI be discussed

specificaiIy in cietail in Chapter 3.

2.4.5 Boundary Conditions for Pump

2.4.5.1 Introduction

The method of characteristic may be used to a n d s e the hydrauIic transients during

pump M u r e or s m Since the purnping head and discharge depend upon the pump

speed, transieni-state speed changes must be taken into consideration in the analysis. For

this purpose, specid boundary conditions for the pump end of a pipeline must be

deveIoped In this section, the dynamic behavior of pumps is considered. A method for

Page 47: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

the determination of the boundary conditions for the pump end is developed. This is

followed by discussions of pump failure and pump startup for single. series and prir~llel

pump connections.

2.4.5.2 Boundary Conditions for Pump FaiIure [7,8.25]

The dynamic behavior of a pump faiIure depends on the instantaneous pressure-tlow

response in the piping system, the rnomennim equation for the rotating masses. and the

pump characteristic curves as described in Appendix B. The primary element equations

are the torque-angular decelention equation describing the speed change in response to

the resisting torque, and an equation that describes head balance across the pump.

Purnp Vat ve

Fig.2.47 Pump and Valve in Pipeline Systems

Refemng to Fig 2.4.7, a pump with discharge valve in a pipeline system will be

used to iliustrate the handling of a pump faiIure. If h e nodai flows are zero and there is

no change in Iiquid stonge between nodes a and c, the instantaneous flow, Q, is the same

at the pipe ends and thmu,@ the pump and valve.

Page 48: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

With one pipe only at node a the nodd equation is the d cornpatibility equation

for pipe 1:

Fa =Ha-Cp+BpQ=O (2.4.4 1)

The comparable equation 3t node c is :

F, = He-Ch( -B,Q=O (2.4.42)

AC node b the equntion is: Q = Ql = Q3.

The element equation for the vaive is:

F , = H , - H , - A H , = O

w here

Q;?' For a conuol discharge valve, C, = - , as discussed in Sec. 3.1.4.4 (Eq. 2-4-38),

*Mo

wirh the head loss acmss the valve equal ro ma when the flow is Q, and r = 1. The

vdve position, 7 , is given as a function of t h e during the transient calculation.

1. Head Balance Eparion

The head balance reIritionship across the pump at any instant is

H a + H = H, (1.4.45)

in which H is the total dynamic head amss the pump. This total dynamic head is @en

by Eq(B.8) and (B.5)

H = H& = ~ ~ ( 2 +v2)w,

Page 49: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 2-48 Approximation of Pump Curve by a Straight Line

To use the cuve of WH in Eq.(2A.16), a suai@t line is used to replace the curve

of IVH for the proper vicinity of of .r. In Fg. 2.4.8 where x is the approximate location of

V ~c + tan-' - , obtained by extrapoiating v and u from previous cdcuIations, a süaight

cf

X line is defined through the two adjoining data points. as: i = - i 1.

Ar

ïkis is a integer arithmetic expression that 1oc;itss the subscript for the datrt point

to the left. Then (i - l)Ar, WH (i) and iAr? WH (i + 1) are the Cartesian coordinates of the

nvo data poines. B y substitution into WH = 4 + 41,

Now, we know the vdues of AI and A~J by the pump characteristics curve (or

tabuIar data). The Eq.(2.4.46) becornes

Page 50: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

H = H ~ ( $ + +)[4 +4(lr+m41)~ a

and the Eq,(2.4.45) becomes

The above equation reIatss the head on each side of the pump to the vanables a and v.

When cornbined with Eq. (2.4.41-2.4-43). noticing that Q = LQ,, the following

is obtained:

(2.4.50)

This equation contains unknown u and v only, ruid it is valid for convoi valves.

2. Speed Change Equation

The change in rotational speed of the pump depends on the unbdanced toque applied:

2

WRg : FV is the weight of mtating parts plus entrained ticpici, R, is the in which I=- g

dw radius of gyration of the rotating mas, o is the anguia. v e l o c i ~ in radians, and - is

di

the angular acceIeration. On the basis of Eq.(B.5), EqQ.4.51) may be wrinen as

Page 51: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In this equation,

y = specific wei@ of liquid

IR = pump efficiency at rated conditions.

N a=- T0 T

a. =- Po =- p z - N , NR TR TR

Eq.(Z4.53) is solved over two Ume step, by using an average vdue of $ during the time

step, and so ic become:

This cm be simplified to:

Referring to Fig. B.2, the characteristics toque equation is

Page 52: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

in which Bo and B, are found in the same rnanner as A. and Al, thrit is

v Fr = (aL +v')[B, + B,(Z + tan'' -)]+Bo -Cr& -a) =O a

This is the speed chanse equation in v and a

To develop the boundary conditions for a single pump, Eq.(1.4.41) to (2.4.44)

and (2.4.49) must be solved simultaneousIy , or Eq.(2.4.50) and (2.4.59) must be solved

directiy and simuit;ineously for v and u using the Newton-Raphson method [7].

2.3.5.3 Borindury CondihOn for Pump Start Up

Centrifugai pump stmup is usuaIly accomplished with the discharge vdve ctosed; as the

pump approaches operating speed, the valve is opened siowly.

Andysis for pump startup is generaily based on the assumption that the speed

rises from zero to NR IinearIy. Mer a reasonabIe Ts is selected, u is known:

Thus the pump speed is known during the transient conditions, and we do not

have to use the torque characteristics and the polar moment of inertia CO determine u

Page 53: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

at different time. This simpIifies the necessary compuntions considerably.

Fig. 2.42 Pump Shrt Up

in homologous form, the curve for the pump in Fig. 2-48 takes the form

in which Hs is the shutoff head, and a! and a2 are constant, normdly neytive, to descnbe

the pump chancteristic curve.

M e n Eq.(2.4.60) is combined with Eq.(2.4.19) and (2,420), the discharse may

If a check valve is put near a pump, one must consider the valve head Ioss and

simuleaneously solve EqQ.4.60) and (3.4.3)-

Page 54: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 3

Check Valve Dynamics

Check valves are placed in pipelines to prevent back flow. They are usually located at

pumping stations, but may ais0 be used at other locations in systems. Ideaily, when the

flow reverses at the location of the check valve, it closes, thus preventing back fiow.

More realistically, since the vaive position is controlled by the flow and valve dynamics,

closure occurs after some degree of back flow is established. This causes an

instantaneous stoppage of the reverse flow with the corresponding pressure rise. The

Iaqe pressure rises associated with the reduction of this reverse velocity accelerate the

ciosure, resuiting in hi_pher pressure which ultimately dams the moving element ont0 its

seat,

It is important to know the dynamic behavior of the check valve in the analysis of

pipeline transients. Dynamic torque or force equation is therefore required in the anaIysis

together with an energy equation to describe the losses across the valve which are

accrued by back flow pnor to its seaiing.

A swingdisk check val& typidly contains a relatively fieely moving part nich

as a disk, whose motion is dictated by severa! eIements including the movement of the

fluid, its weight, external forces such as a spring or counter weight, friction, and possibly

a damping device.

Page 55: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In this chapter, the check valve differential equation of motion wiH be introduced,

foliowed by a detailed discussion of various toque and forces such as ffow force and

pressure drop. An orifice sequence mode1 will be introduced for predicting the pressure

drop through a valve as a function of disk angIe. The disk flow torque will be

investigated and an equivaIent torque arm and a torque arm coefficient will be introduced

to derennine the disk torque thrit depends on coefficient of resistance and flow conditions.

3.2 Check Valve Diferenfial Equation [t 2, I 6, i 7 ]

For a s w i q check vaive, Fig. 3-21 provides a schematic in which 6 is the open angle of

the valve disk.

Fig. 3.2.1 Schematic of Check Valve

Page 56: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The clochvise moments about the pivot point are considered positive. The toque

equation becornes:

where J , is the moment of inertia of the disk and arrn zissembiy and J , is the moment

of inertia about the hinge for an atrached counter weight.

The torque due to the weight Wr of the rotating disk is given by T,,

Tw =W,L, cos8 (3.2.2)

& is the bearing friction torque. It may be a consrrint relsted to a frictional

coefficient, the pivot pin radius, and the submerged weizht of the gate, but is ais0 likely

to depend on at Ieast the angular velocity [21]. The friction toque would be of the fom

in which K, and K1 are constants ruid n an arbirnry but constant power.

T, is the countenrreight torque, TF is the flow torque, and Ts is the spring

toque. Some of the above torque cm be obtained by theoreticai denvation, some of it

c m only be abtained by expenment. h the next section, the toque components are

separately discussed.

3.3 Component Toque

The toque component 1151 includes the countL:rweiCht, extemal s p ~ g and others such

as dash-pot. They cause the toques which cm be easiIy determined h m vdve structure,

Page 57: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

dimension and material properties. In this section, only the normal components such as

counterweight and extemai spring are discussed.

Fig 33.1 Counterweight

33.1 Counterweight Torque

A counterweight is an auxiiiary, extema1 device, used to modiQ the static and dynamic

characteristics of a cIapper-hinge system. IL may be used:

1. to reduce the weight torque in the open position

2. to modify the weight torque in the closed position

3. to increase system inertia

The counterweight dynamic equation (referring Fig 3.3.1) is:

Page 58: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

d '6 rt t , L,' *(-?.) = WC Lc * sin(y +O)

di-

Referring to Eq.(3.2.1), the countenvei~ht inertial and countenveight torque m:

5 J , =m,L, (3.3 2)

T,, = WC L, * sin(y + 8) (3.3.3)

3.3.2 Spring Torque

Adding springs is the most common way of reducing the check valve closing time.

Springs are also used to increase, or to genente, a closing torque, when the disk is in a

near-closed position.

Fig 3 3 2 Cylindrical HeIicai Bending spring

There are two types of springs (Fig 3.3 -2 and Fig. 3 33):

Page 59: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1. CylindricaI heIical spring subject to bending

2. Cylindrical helical springs subject to torsion

(a) Torsional Sprin,o (b) Kinematic of Torsional Spring

Fi:. 3.3.3 Cylindrical Helical Torsion Spring

HeIical springs subject to bending (Frg. 3.3.2) do not require rigid pivot connections, or

extemal devices, yet they cannot be changed without removing the disk. The bending

spring contribution to the valve differentid equation is

T' = KI *(@-a,) (3.3.4)

in which

Ks is the spring constant

8, is the spring angu1a.r pre-Ioad

T, is the spring toque

Page 60: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

HeIicaI springs subject to torsion (Fig 3.3.3) require a rigid connection, but they

c m be easily inspected and chmged

The torsion spring torque is

TS = KS *ELS - L,,,)*L, +sinS,

in which, Ks is the spring constant and Lso is the sprins free length.

3.4 Check Valve Flow Torque

3.4.1 Introduction

With a pipethe in normal operating conditions, flow forces act on the disk surface,

keeping it in the open position. These flow forces are a combination of lift and d r g

effects. The magnitude and point of application of lift forces depend on the fluid-dynamic

characteristics of the disk and hinge and on the angle of anack u. The Mt forces increase

with the opening angle and reach a maximum for opening angies to 70'. Magnitude,

direction and point of appkation of iïfi forces depend on the pressure distribution on the

upper and [ower surfaces of the disk-hinge systems.

Page 61: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The magnitude of the drig forces my be detennined when the valve's total

pressure losses are known. There are two ways by which to detemhe h g forces: one is

the experimentai coefficient representation; the other is by which the orifice sequence

model, in which the drag forces cm be seen as the sum of five elementary components

comsponding to the five contractions and expansions of pipe.

In this section, the orifice sequence mode1 is introduced and used to determine the

pressure drop for fonvard and reverse flow. Aftenvard, the tlow toque for forward and

reverse flow cm be deterrnined.

3.4.2 Check Valve Pressure Drop

A wafer check valve (Fig.3.4.1) mny be modeied as a sequence of orifices in which the

valve's coefficient of resistance cm be assumed as a combination of the coefficient of

resistance of the elernentary conuactions and expansions.

Pressure drop and tiow through an elemenrxy contraction or expansion are

related by the following Darcy Formula:

We can substitute

into Eq(3.4.1) to obtain:

Page 62: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The flow rate c m be rewritten as:

Eq.(3 -4.4) becomes:

4": Refemng to (Eq.2.3.38): cV = - 2M

Complue Eq. 3-46 and Eq. 3.4.7:

In Eq. 3.4.5, the K is the coefficient of cesistance, and represents an equivalent

length, in pipe diarnerer of straight pipe:

1 K=-= L c*v2 /,=&

3.4.2.1 Coeflcient of Resistance o j a Wafer Swing-Disk Check Valve

Hong [14] studied the pressure losses tfirough a wafer vdve, using water as the fluid. The

check vdve was modeled as two restrictions in series. The upstream restriction was due

Page 63: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

to the orifice and the downstrem restriction was due Co the wide-open disc. Each

restriction was composed of an enmnce contraction fotIowed by an exit expansion (Fig.

3.4.1).

Resmcnon Resuicuon

(6) Orifice Mode1 for Wafm-type (a) Vdve georneuy Swingdisc Check Vdve

Fg. 3.1.1 Orifice Model for CVrifer-Type Swing-Disc Check Valve

The coefficients of resistance for the orifice and disc can be assumed as independe~t. The

overd1 nomdized resistmce coefficient is @en by:

Page 64: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

where & is the projected area of the disc and disc arm nomd to the flow srrem. Its

vaiue c m be cdculated as [14]:

- 2 L, X, (1 - COS 8) + 2do X, sin 0

where & and i, are the haIf widrh and cotai length of the disc ami and is the disc s h d t

displricement with respect to the seat plane, and Ki, and Kj are @en as:

AIso, we cm wrire Kz and & as:

Page 65: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Refemng to Eq. (3.4.9), another expression m3y be used to represent the resistmce

coefficient wben disc angIe greater thm 19.

where & is the equivalent length of the valve.

The vdue of the equivaient length for wder disk check valves depends on vaive

sizes and disc openins angles. For a widely open valve, the equivaient Iength of a wafer

check valve can be approximated as:

3.42.2 Coeficient of Resistance of Fomard Flow

Cavazzoni [15] had improved the above orifice mode1 with the following assurnptions

(Fig.3.4.2):

The valve's intemal geometry may be idedized as an orifice, the seat ma, and a

circuIar disc, and the verticd projection of disc and hinge (the disc am) area Four

characteristic surfaces can be identified and their area assumed to be the surface area of

four orifices in sequence. Ushg Fig. 3.4.2 notations:

Page 66: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

f do + (a) Valve Geometry (b) Disc Ideaikation (c) Sequence of Orifices

Fig 3.42 Orfice Sequence Mode1

= 0.7 (form coefficient)

The coefficient of resistance for each eIementary contraction and expansion can be

caIculated as foI1ows:

Page 67: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

and

the above formula is valid for :

For disc ange less than 19, the coefficient of resistrince m3y be considered as

Page 68: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

3.4.2.3 Coeflcient of Resistance of Reverse Flow

Using the s m e notations as Fig. 3.42, the elementq coefficients of resistance for a

reversed flow are:

The above formuIa is vdid for:

loO c e < 70°

For disc ange less than IO0 the coefficient of resistance may tx: considered as:

Page 69: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Now that the coefficient of resisnnce for forward and reverse flow has been

obtriined, Eq. (3.4.3) cm be used to detemirie the pressure drop for the forward and

reverse flow condition.

3.4.3 Swing-Disk Check Vaive Flow Torque

Fig3.43 shows the important panmeters for the unsteady flow condition through a

check valve. Due to the fluid forces acting qainst the valve disc, a [orque To is created

which acts on the disc shaft forcing the disc to swing with the angular veIocity w.

Fig 3.43 Unsteady Flow Tbrougti a Check ~ d v e

The reIative uniform fluid velocity VR with respect to the anguIar veIocity of the

disc forward flow is given by:

Page 70: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

where La is the hinge am length and Bis the disc opening angle.

w h m Qv is the flow thmugh the vdve and A2 is the orifice area. And v,* = - - 4

For reverse flow,

V, = V,' - Law cos 8

Qv and V,- = - . Where AI is the pipe area. 4

The flow force is acting normal to the disc center and is expressed in t e m of the

normal cimg coefficient CND:

F, = + pC,VDA,VR I VR I (3.4.37)

where AJ is the disc area and p is the density of water.

This may ais0 be written in the fom of Qv :

QZ FD = ~ ~ u x a l -

4

where is the total coefficient of mistance.

The fiow torque acting on the disc shaft for a wafer swing-disc check vaIve is

given as:

Tm = FD La (3.4.39)

For compIete description of the fiuid torque actin~ on the valve disc, the normal h g

coefficient musc be determined as a function of disc ange and pipe flow Reynoids

number. This may be obtained through experimentation.

If the orifice sequence mode1 is introduced, the h g force cm be seen as the sum

of five elementary components corresponding to the five contractions and expansions.

Page 71: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Now, the Toque Arm Coefficient (TAC) is introduced. It cm be obtained throua

experimentation [19J, or represented by the foliowing approximation:

0' <8<20" TAC = 0.74

20' < 6 < 70" TAC = 0,0209 * 8 + 0.322

The disc shaft toque cm be modified as:

T;,=TACL,*F,

For reverse flow, the flow force cm be written as:

and

FRC = FRI + FR? + FRj + FRI

The algebnic expression of TAC is:

o Y < e ~ 2 o = TAC = 0.65

20' c 8 < 4Y TAC= 0.01 l7*8 iO.416

45' < 8 < 70' TAC = 0.0583 * 8 - 1.6820 The reverse flow toque is:

Tm =TAC*LA * FK

Page 72: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

3.5 Boundary Condition for Check Valve [21,24]

If the check valve is Iocated iniine, refem'ng to section 2.4.4 and section 3.4.2, using

Eq. (3 .4.8), Eq. (2.4.40) becomes:

(3.5.2)

Once the flow is known, Eq.(2.4.19) and (2.4.20) can be used to find the pressure head.

If the check valve is Iocated near a pump, refemng to section 2.4.5.2, using

Eq43.4.8). Eq.(2.4.50) becomes:

(3.5.4)

K or is the coefficient of resistance, and may be obtained by using the

equation discussed in Sec. 3.4.2.1-3.4.2.3.

Page 73: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

It h s been demonstnted that a11 the toque represented in section 3 3 and

Eq.(3.2.1) are available for calculation and nuinericiil representation. Therefore, it is

possible to represent check valve dynmics by using a set of ordinxy differential

equations, which cm be solved using numericd techniques.

Page 74: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 4

Simulation and Mode1 of Pipeline Network

Transients with Check Valve System

4.1 Introduction

Experimentai investigation of pipeiine transients with n check vdve system would be

very expensive. In a large pipe and valve system, it also wouId be very difficuIt and time

consuming. As an alternative, an adequate cornputer simulation would be a valuable

substitution as a design aid and for system performance evaluation.

The complete numericd mode1 consists of the pipeline system model, rhe check

valve dpmics motel, and the pump characteristic model. me relation of these three

mode1 parts is shown in Fig. 4.1.1.

i Valve simulation i

Fig. 4.1 .l Block Diagram of Pump, Check Valve and Pipeline

Page 75: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The simulation of the pipeline, check valve and pump system mdces use of the

nuterid presented from chapters 1 and 3. In this Chapter, discussion focuses on the

solution of tLe proceeding chapters. The detailed soiution of the characteristic method for

o pipeline transient will be studied in section 4.7. The check vdve dynarnic equation wiI1

be solved by the Runge-Kutta method in section 43. The pump characteristic equation

will be solved by the Newton-Rdph method in section 4.4. In this chapter, an example of

a network pipeIine system will be presented, and the detailed flow chart and an d~orithm

for the system simulation will be discussed.

4.2 Algebraic Solution to a Piping System [33,34]

4.2.1 Algebraic Representation and Continuous Storage Data

The Ci and C' chmcteristic equations may be msformed into other f o m in which

time is a subscript, and in which the chmcteristic Iines extend to more than one reach,

eenemlly the full pipe len-gh. The equations are caiied Algebraic Eqrulrions. These C

equations may be used to solve most problems handled by the method of chanceeristics,

bur they have a form which is particuIarIy convenient for transient caiculations in piping

systems and networks.

The algebnic forms of the equations have the foIlowing properties:

t. They are compatibiiity equations appüed over one or more reaches of a pipe.

2. Tirne is indicated by an integer subsaïp~

Page 76: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 77: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

in which the first subscript indicaies section number and the second indicates the tirne

counter K = t / At. The pipeline characteristic impedance and resistance coefficient may

a be applied to the total pipe Iength, so that 3 = - fL and R = -

gA 2 g ~ ~ ' -

Refemng to Fig. 4.2.1, each of the variables H and Q is dimensioned to the size of

the maximum value KM in the entire system, K,tI = L/(a At) + 1. The integer K is used as

a counter for each time step, and Kp is used as a pointer to identify the position in vector

H or Q at which current values of the variables are stored. At each iteration when K is

incremented, so is Kp, the vaiue of the pointer. When Kp exceeds KW, the value is set

back to zero, so that it points ro the first position in the vector. In this example,

information must be retained in pipe 2 for N2 + 1 = 5 computationai steps. Since, for this

system, the characteristic Iines of pipe 2 extend bac k the farthest. KM = 5. B y starting the

.n diagram KLW -1 computational increments before the transient stms (Fig. 4.2.1), and

storing the steady state values, the equations miiy be solved at each pipe end with the

incorporation of boundaries and nodal conditions.

The advantages of these algebnic reprtsentations over the normal chancteristic

equations are:

1. They are normally appIied over several reaches, with no need to calculate the

transient at the intewening sections.

2. They are computationaUy efficient for solution of multipipe systems such as

networks, because intenor point caicdations are avoided-

3. They use a mal1 Ar = U(Na), so ttiat the boundary condition detail is preserved.

Page 78: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

But there are some disadvantages inherent in this method, because the characteristic lines

are generally extended over more thzin one reach, the friction term may be less ziccume

for hi@-friction systems. AIso, since the information must be retained h m time steps

extending bacbard in time more thm one time step, more computer storage is needed to

compIete the cdcuIntion. However, because of the sophistication of modem cornputers

which are used in these simulations, memory storage is not a cruciai issue. It therefore is

sensible to choose the algebraic equzitions to cdculate for the pipeline-check vdve

urinsient simulation.

4.2.2 lndexing [18]

If the alsebraic fom of the equations in multi-pipe systems is to be used, first the rnethod

for storing the system topology must be esnblished. This is cdIed the Utde-ring method.

An index vector is provided which offers one form of bookkeeping to describe the system

connection. It is oriented around the nodes of the system and, for each node, die

following information is aven: the node number, the number of elements attached to the

node, and an element number with a sign to indicate whether it is the upstream or

downstrearn end of the element, and the nurnber of the eIement section adjacent to the

node for each eIement attached.

The form of the index vector is:

1. node number (a node represents a connection point, such as a pump, vaive,

accumulator, resemoir, and pipe junction)

2, nurnber of elements (number of pipes connected to the node)

Page 79: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

3. element number (pipe number - sign for flow out h m the node

+ sign for flow into the node.)

4. element section nurnber adjacent ta the node

5. secund eIement number

6. element section number adjacent to the node

7. if there 3 or more elements connected to the node, then steps 5 and 6 are

repeated as needed

Fig. 4.2.2 Branching System with Pump and Cbeck Vaive

Page 80: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

@ -Node numba 1 -Section number 4

*lement nurnber

9e

Fig. 4.2.3 Indexhg of Branching Sgstem

Refemng to Fig. 4.2.2 and 4.2.3, for a check valve represented by node number 1;

there are two pipe elements connected to this node. The first is pipe number 1, in which

flow is out from the node by this eIemenr, so its sign is minus (-1) and the section number

for this pipe adjacent to the node is 1. Enement number 5 is the smdl length of pipe that

connects the pump to the check vaIve. Hoiv is inro the node by element 5 and the section

number adjacent to the node is 10.

The index for node 1 is:

1,2, -1, 1,5, 10

The above index describes that at node number 1 we have 2 elements. The first

element is -1, section nurnber 1; the second eIernent is 5, section number 10.

For the pipe branch represented by node 2, the index is:

2,3, 1,2 , -2,3, -3,s

The above index means that at node 2, thete are 3 eIements (pipes), pipe 1 is flow

into the node, the sign is positive, and the section number is 2. The other two pipes iire

Page 81: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

flow out of the node, so they are -2 and -3, and the section numbers are 3 and 5

respectively.

For the reservoir represented by end node 4, the index is:

4,1,3,6

The index indicates that node number 4 has 1 pipe element number 3 connected to

it, and the adjacent section is number 6.

The index vector does not provide ai1 of the information needed for transient

anrilysis, but it does give the necessary data to enable caiculations at junctions and

boundaries, especially in connection relationship. The physicd panmeters that describe

each element are needed, in addition to nodal information such as the nodal flow,

pressure, and elevation.

4.2.3 Simulation of Piping Systern

To compte ansient-state conditions in a pipins system, the shortest pipe in the system

is divided into a number of reaches so that a desired computationai time intervd, At. is

obtained [25,26] b y

The remaining pipes in the system are divided into reaches having equal lengths by usin_o

Eq. (42.3). If necessary, the wave velocities are adjusted to satisfy Eq. (423) so that

chrtncterîstics p a s through the grid points- Tbe steady-state discharge and pressure head

at al1 the sections are then cornputed, and tfieir vdues are saved or printed

Page 82: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The time is then incrernented, and the mnsient conditions are computed at dI the

interior points and at the bound;iries. This process is continued until transient conditions

for the required time rue computed. Fig. 4.2.4 show the ffowchiut of this procedure.

l 7 Save or Rint flow and Head

1 I~tore 4 as Q H for the systeml

Fig. 4.2.4 FIowchart of Piping System Simulation

Page 83: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

4.3 Numerical Model and Simulation for Check Valve

4.3.1 Check Valve Dynamic System Model

The complete numerical mode1 consists of the combination of a valve dynamics mode!

with a mode1 of the piping system in unsteady flow conditions. While the piping system

mode1 has been investigated in the last section, in this section the check valve numericd

mode1 is deveioped. The Runge-Kutta method is used to soIve the second order

differential equation, representing a gened valve systern operating under unsteady

conditions.

The check valve dynamic system is represented by a second order, nonlineu,

di fferential equntion, described in Section 3.3, Eq. (3.3.1). Before this dynmic equation

is solved, the relationships between the purnp and check valve, and the piping sysrem and

check valve. must be considered.

Fig. 4.1.1 shows these relations. The check vaIve dynamics requires information

for torque To and fiow m e QV initiai conditions. After simulation, the check valve disc

opening angle 8 and disc angular veIocity w can be obtained. men, h m the disc angie

information, the check valve coefficients of resistance K are calculated, Given the check

valve pressure drop Ap and the Eiow coefficient, the fi ow rate Qv through the check valve

is caiculated The fi ow torque To created at the disc arm is then calculated using the check

vdve Aow and coefficients of resistance. The total toque must indude the approprixe

components of the disc wei@t toque, counterwei@t torque, spring torque, b p e r

weight toque and the inertia. As described above, the flowchart for numericd simulation

Page 84: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

of the check valve is shown in Fig. 43.1.

- --

Cal1 from Piping or Pump simul I

Initiai Condition "--'

1 F o r w d Row 1 1 Reverse Flow 1 Coefficient of Resistance ~oeficienient of resistance 1

I

Flow Torque

Toool Torque 1 1 Totd Toque

Runge-Kutta Solution c

Fig 1.3.1 FIowchart of Check VaIve Numerid Simutation

Page 85: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

4.3.2 The RungeKutta Numerical Solution ta the Check Valve Dynamic

Equation

Tn section 32, the check valve differentid equation was described as a second order

ord inq differential equation. Refening to Eq. (3.2.1), it may be wrinen in the gened

form as a nonlinex function of torgue:

Therefore Eq. (4.3.1) cm be rewritten as:

where I is system total moment of inertia, and T is system total torque as a funcrion of

disc angiar velocity o, dise opening angle 19, and Ume t.

8 is disc opening angIe

w is disc mgular velocity

The system total moment of inertia are the sum of the moments of inertia of ai1

moving parts, incIuding dix, counterweight, darnper, and so forth. The system total

torque term T is represented by a set of relations describing:

Coefficient of resistance

Fiow toque

Countentrei@t effect

8 S pring effect

8 Damper effect

Page 86: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Valve geometric and dynamic parameters

The Runge-Kutta fourth order dgorithm [37,38] cm be applied to Eq. (4.3.2 and

4.33) simultaneousty.

Consider a first ordinary differentid equation with initial condition y(O),

We cm calculate y ,+, at the next time inmement r,,, = t, + h , with a known

value of y, at the previous time step r , . The founh order Runge-Kutta formula is written

as:

For Eq. (4.3.2), the fmt derivative vruiabies are:

h=hr y = 8 f ( Y J ) = WU)

and at the same time for Eq.(4.3.3), the second derivative variables are:

and the known initial condition are:

W ( I =O) =w, e(t = O) = e,

According to Eq. (4.3.5), the foIIowing is the C" code for the Runge-Kutta method:

Page 87: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

double KI. K. K3:M LI. U. U. L4. Tr, rhem rlreraR, 011regaR:

KI = ToJ * Dc //for coeficieiu of Eq. (4.3.3) LI=011lega WC //for coe@ien of Eq- (4.32) Tr=T+0.5*Dc tirera = itlrera * Pi /1 JO; 18th radimatr, û,,isatt+Dt rIietaR = rltera + 0.5 *LI; theraD = rheraR * 180/ Pi; // B ui degree 01negaR = Onrega + 0.5 * KI; // mis the angular velociry ar r. @ is ar r+Dr

Qcv = GerVult.eFlow ( Tr, rIretaD); ToJ = GerToraiïorque(Qcv, tlieraD, OmegaR);

K1= ToJ W r ; i2 =01negaR * DC

Tr = T + 0.5 *Dr; rlieraR = rhera + 0.5 *U; rIreraD = rlreraR *I8O/ Pi; OinegaR = Oniega + 0.5 * K2;

Qcv = GerValreFloiv ( Tr, r1tetaD); ToJ = GetTora~orque(Qcv, rlietaü, OmegaR):

K3 = ToJ * Dr; U =OmegaR -Dr:

T r = T + D c rhetaR = theta + LI; tIreraD = rhetaR ' l8O/ Pi; OmegaR = Oniega + K.3;

Qcv = Ger VaiveFlow ( Tr, tIteraD); ToJ = GerToraiïorque(Qcv, tiietaD. OmegaR);

KI = ToJ * Dc Li( = OmegaR * Dr;

/DisulngularVeloc@ = Omega + (KI + 2 * KI + 2 W + KJ) / 6; fdic.4ngieRad = rheta + (LI + 2 *LZ + 2 W + L.1) /6; Irhese nvo ~uriables will be rtored

in Sysrems

The above p r o c m can be cdled at a pump junction or a piping junction according to the

valve placement.

Page 88: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

4.4 Newton-Raphson Solution to Pump Boundary Condition m

in chapter 2, the head balance equation and speed change equation for the pump

conditions were derived as:

These equations can be solved simultaneously for a and v as following by using the

Newton-Raphson method:

As a first step in the solution a and v are approximated at the new time step by an

extrapolation of the previously computed values, two time stepq a, vo, and four tirne

steps, W. voo, eariier.

v=2v0 -Y, a=2ao -a, (4.4.2)

aF, aF, aF, aFr , ,Fr, -, - are waluated for this a. and v. Next the coefficients F, , - -

av aa a~ aa

The derivatives are:

Page 89: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

a4 v - =2afB0 +4[lr+tan4-)J-~,v+C, a ~ r a

Eq. (4.4.1) can be solved for ha and Av :

Lec a''' and v"' be the initiai estimated values, and cr"' and v"' be the d u e s

after first itention. Then, the foliowing equations yieId improved values of a and v :

= +

y") = y") +Av (4.4.9)

This procedure is repeated either a fned number of times or until the surn of the

absolute values of the corrections ba and Av is less than an acceptable tolerance (e-g.,

0.0002). The flowchart of Fig. 4.4.1 iIlustntes the above procedure.

Page 90: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Cal1 from Piping Systern G

4

Compute X, i, A,, 4, B,, Bo

I Compute FH, FT, and their

Derivauon Usine Eq.(4.4.3-6)

1 Compute AG Av Using Eq.( 4.4.7), (4.4.8) kk=kk+l

t

Compute Qp HP- C;= Fig. 4.4.1 Newton-Raphson Solution for Pwnp

Page 91: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In this chripter, the numerical aspect of algebnic representation for the chmcteristic

method, check valve dynlimics equrition, and pump boundary conditions has been

discussed An ekgant soIution for pipeline transient andysis wris shown to be achieved in

the use of algebnic sdution, continuous data stonge, and indexing for system topology.

A fiowchart and C++ code were given for ciex and direct illustration to the check valve

and pump dynmic simulation. The software des@ which irnplements this andysis will

be given in the foilowing chapter.

Page 92: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 5

Software lmplement of Transients in

Pipeline Network and Check Valve System

In the previous chapters, the main focus was on the theory and methods for dealing with

hydraulic transients. The basic equations, the methods of anaiysis, die specific solution,

and specific bound;iry conditions were investiszited. As well, pipeline configuration, the

pump charactenstics, and the check vdve dynamics were discussed. Hydnulic transients

in the pipeline network system are implemented by, and interacted with the pump and

check valve dynamic behavior and software progrm. Therefore, the following chapter

wiI1 focus on the andysis of the pipeline network system with a view of softwre

engineering and desi9 and coding for the Hydro-Andysis program package using

Object-Oriented Progmnming techniques.

The andysis, which inchdes the problem specification and requirement anaiysis,

simulation analysis, input and output analysis, and the user interface analysis wiIl be

performed in Section 5.3. The design will inciude hi$ Ievel dgorithm and hierarctiical

diagrans chat wiII be given in Section 5.3. Aiso in this section, C" pror- Ianguage

wiIl be used to perfom transient andysis. As weII. visual C? wüI be used to design the

user interfaces for user-friendIy input and pphics output. The introduction to a i l classes

used in this package wi11 be given in this section as well, and Section 5.4 wiii simulate a

Page 93: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

pipeline network system. What follows is an indepth step-by-step description of how to

use this sofnvare package.

5.2 Anaiysis for Hydru-Analysis Software Package

5.2.1 Problem Description

The application should input the pipeline connection information, the individual pipes,

pump, and vdve geometricd and characteristic data, and then simulate the system for a

period of time. Next it shouId determine the pressure at certain nodes and fiow nte at

certain sections dunng the occurrence of tmsients. After finishing the simulation, the

application should Save the output data, such as the Head (pressure) and Row nre with

respect to time, and aIso produce a -pphic output for the Head and Flow rate.

The pipeIine network transients anaiysis and simulation should combine the

pipeline tnnsients, pump and check valve dynamic simulation. This simulation should be

performed at different situations, such as in pump stm-up, pump failure, and cases in

which the convol valve is closed and when it is opened. The application can also handIe

different network connections: the senes system, the paraIlel system, the branch system,

and network system. It c m ded with diKerent pump anangements, including sinde

pump, senes pumps, the panlIeI pumps, and cornplex pumps. Findly, it c m simulate the

system for different sizes and types o i check valves.

Page 94: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

5.2.2 Input Parameters

As described in Section 4.2.2, the connect relationship for a nenvork pipeiine system is

&en by an index vectot. The flow direction for a pipe and the type of junctions should

be specified The input data for the connection, pipe, junction, pump, check valve, vdve

and reservoir is as follows:

The connection parmeters include:

1. Index data

2. Nurnber of index

3. Nurnber of pipes

4. Number of junctions

5. Nurnber of pumps

6. Upstream junction numbers of a pipe

7. Downstream junction numbers of a pipe

The junction parametes include:

1. Type of a junction

3. Junction hend

3. Junction fiow n te

4. Junction elevation

The pipeIine panmeters include:

1. Pipe

2. Pipe diameter

3. Pipe friction factorf

The pump parameters include:

Page 95: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1. Pump start up

3. Pump failure

3. Pump normal run

4. Pump stop

For the pump s tm up, the foIIowing musc be laiown:

Pump coefficient Ao, Ai, and A:

i Time to gain speed Ts

Pump shut off Head &

For the pump failure:

8 Rated pump flow rate

8 Rated pump head

Rated pump torque

- 8 Rated pump speed

Pump specific speed

. Pump chmcteristic data

For the pump normal opention:

Pump coefficient Ao, Ar, and Az

The check valve parameters inchde:

1. Check valve size

2. Pipe diameter

3. Disc weight

4. Hinge len,gh

Page 96: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

5. Auxi l iq device p m e r e r s such as counterweight, extension spring,

dash pot and so on

The control vdve parameters indude:

Vdve performance chmte r t

8 Valve closure time T,

The reservoir parameter is:

* Elevation of the reservoir

The simulation parameters are:

8 Sm time of simulation

Stop time of simulation

The output pumeters are:

Plot location

8 Pnnting or swing data location

For the pIot locations, the FolIowing must be known:

Junction number for head vs time

8 Pipe section nurnber for flow rate vs time

Findly, for the print out and save location, the foI1owing must be known:

Junction number for head vs. time (Maximum 3)

Pipe section number for flow rate vs. time (Ma.xhum 3)

5.2.3 Output Requirement

The output of the application incIudes the ۔le output and the p p h i c output

Page 97: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The file output gives the following &tx

1. Time

2. Flow rate at the pump element

3. Row rate at certain pipe locations (the pipe number are indicated by the user,

maximum 3)

4. Head at certain junctions (the junction numbers are in6icated by the user,

maximum 3)

5. Check vdve disc opening angle (il there are check vdves in this system)

The _mphic output should have the foIlowing Features:

1. Plot the Head vs. Time and Flow nre vs. Time simultmeousiy on the screen.

2. Display the following information:

pump start-up, pump failure, or pump normal nin

with or without the check valve

the pipe nurnber for the flow rate plot, the junction number for the head

ptot

3. A plot from which h e user my erisily obtain the data

4. Easy convol of pphic output display such as Iine type, color, and styIe

5.3.1 Algorithm for the Hydro-Analysis

The high level dgonthm c m be summarised as following

Page 98: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

begin the application

read data (infornrarion for rhe nenvork connection, pipe, junmon, pump, check valve, valve, reservoir) read infonnarion on saving resulrs mdplonUlg resrilts

consrnrcr the nenvork system derennine the initialjlow rare for each pipe and head for each junction srne and print the initial fiow rate, head and check valve disc angle

Wtile the tirne is less tlimt tirne marùnwn (the fime of simulation)

if the element is check valve do check valve dynamic malysis get check valve disc angle

end if

calcrilare the pipe elementjlow rare and head calctrlare the pump elementflow rate and head

srore theflow rate, Itead and check valve disc angle for next time srep use Save andprint rhejlow rate, head of indicared [ocarion and check valve disc

angle time increment for the na t xsrp

end while

graphic displq the resrdt offlow rare Vs. time and head Vx. time

end the application

Page 99: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 5.3.1.1 shows the flow chart of the above algorithm:

1 SW. save ni prim the initiai pmmm - --1

, S m savc and @nt KQ. 0

Fig 53.1.1 Flow Chart of Hydro-Analysis

5.3.2 Hierarchical Diagram

Before outIining the object-oriented-programming design, the hierarchicd d i a _ m for

the Hydra-Anaiysis (Fig. 5.3.2.1) is presented below:

Page 100: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

* I

t

T ransients G r a p h i c S irn u Iatio n O u t p u t

i b

G r a p h ic LJ ser I n terface

FigS.33.1 (a) Hierarchid Diagram for Hydro-Analysis

Fig. 53.2.1 (b) Hierarchical Diagram for Graphic User Interface

Page 101: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 53.2.1 (c) Hierarchical Diagram for Tmnsients Simulation

Fig. 532.1 (d) Hierarchical Diagram for Output Graphic

Page 102: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

5.3.3 Object-Oriented Programming Design for HydrctAnalysis

In this project, the Object Oriented Programming (OOP) [29] technique is used to design

the Graphic User Interface, Transént Anaiysis and Graphic output.

5.3.3.1 Major CIass Description for Graphic User Interface

This class provides an enclosed space on the desktop within which al1 application

interactions take place. This M e window is the frame to which the menu and

are attached.

Fig 5.3.3.1 The operation and attributes of CMainFrame

CChÎIdFrame is the frame bat hoIds the CHy&oAna£ysisyiew class and passes messages

and events to the CHyriiomZysisView class for processing or display.

Page 103: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.3.3.2 Operation of CChildFrame

This is the c i ss that displqs the visual representation of the document for the user. This

c lss passes input information to the CHydraAnalysisDoc clss and receives display

information from the CHydroAnuZysisDoc.

Fig 5.3.3.3 Operation of ChydroAnalysisView

Page 104: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The CFrontPageFomView cIss is the fom f m e . It holds visible objects attached to the

form. It is the base chss for views containhg conuols. It is used to provide form-based

documents in applications. It coordinates and intencts with the transient andysis (such as

PipeNet, Checkvalve, PrrmpFail, PrirnpSfan) clriss and p p h i c output application.

Fig 5.33.4 The operation and attributes of CFrontPageFormView

The CHydroAnafysisApp class mates dl of the other components in the application. It is

ais0 the class chat receives a11 event messages and then passes the messages to the

CFrontPageFomView and CHydroAndysisView classes.

Page 105: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 533.5 Operation of CHydroAnalysisApp

6. CHydroAnalysisDoc

The CHydroAnalysisDoc class houses the document. This is the location of al1 the data

structures necessary to house and manipulate the data that maices up the document. This

class receives input from the CHydroAnalysisVinv class and passes dis play information

to the CHydraAnalysisView class. Finally, this class is also responsibte for savins

and retrieving the document data from files.

Fig 53.3.6 Operation of CHydroAnalysisDoc

CInputParameterDlg indudes the following classes:

CIndcrPara-Dlg

Page 106: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig 5.33.7 The operation and attributes of PlotPrintoutDlg

Ail of these classes receive data which is inpuned via the diaiog box, and then

transfer the data to the CFronrPageFonnView cIass. Fry 5.33.7 is the operation and

attributes of one of these cIasses. Other cIasses perform simiIar operations but with

different attributes.

Page 107: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

' 5.3.3.2 C k s Description of Tratlsienb S i m u ~ o n

1. Pipe

The Pipe class is the base class for pipe simufation. It anaiyzes one element only. It cm

calculate flow rate Q md head H for each reach of pipe or pump. It aiso caiculates A, B,

and R, where A is the adjusted sound wave, B is the pipeline characteristic impedance,

and R is the pipeline resistance coefficient (referring to Eq. 2.4.17 and 2.4.18). Other

attribute such as Ndn, Nreach, and Nrip record number of down junctions. reach and up

junctions for this pipe.

Fïg. 5.3.3.8 shows the operation and amibures of the class Pipe. Pipelnitl ...)

obtains the data from the CFronrpageFormView class and transfers i c to PipeNeQCv.

VulveDoivnF-Hf) then proceeds to anaiyze the syscem if there is a control valve i n rhis

pipe.

Fig 533.8 The operation and attriiutes of Pipe

Page 108: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

2. PipeNet2Cv and PïpeNer2NoCv

* GetHNFt] - + GctO(iit.nt)

-T P p N a b l b v

f- + GctONri] - @ Inih'alF-Hri]

- + InitiaIFnitiaIFHri) !- * Pi~ipaluncF-Hkt. nt]

:- + P+iuncF-H~i. nt] i- * PipeNcUNOc<ait int [ J,. int. a. nt. kt*

:- + PipeNdZC<it. int [ L int. nt. nt. flcat.M[Lbat[LW[l.int[Lint[t

Fig5.3.3.9 Operation of PipeNet2Cv & PipeSeQNoCv

PipeNetXv class inheritance the class Pipe, PumpStart, PrimpFail and CheckVuIve. This

is the class that connects a11 pipes, pumps and check valves tosether, forming a whole

pipeline network system. PipeNerXv clas simuIates the system that includes check

valves, whiIe the cIass Pi'eNet2NoCv does not inchde the check vdve. The opemion of

these two classes is shown is Fig. 5.3.3.9.

PrimpFail ciass is another base ciass for pipeline network simuIation. It simply

concentrates the hydraulic transient mdysis during pump failure, interacting with the

class Pipe if there is no check vaive Iocated after pump, and clriss Checkvolve when there

is a check vaIve Iocated after h e pump. Referring to Fig.5.3.3.10, the operation is:

Page 109: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 53310 Operation & Attributes of PumpFhil

PwnpFailO and -PumpFail() are respectively, the construccor and destructor of

the PumpFail clus. PumpFail (int) ovedoads the consuuctor. Therefon. only when there

is a check valve dter the pump. PumpValveBC(int) wiil Anaiyze the sytem. Otherwix,

PipeIHQ(inr) will suffice.

The anributes:

A--the wave speed

M O , AL00 - dimesionless pump speeds 4 at successive tirne step

AR, XL-pipeline ma, len-gh

B-pipeiine impedance, referring to Eq. (2.3.17)

BEïûJ3ETA-p~vîous and currmr dimensionless toque

CK-valve Iuss coefficient in velocity head

DT- time step

DX-dimensionless purnp data spacing, rad

EL4evaéon of the pump node

F-Darcy-Weisbach fiction factor

G-gravitational acceletation

Page 110: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

K, Hp, Q, Qp, N-head and flow m e and speed during the transients

HR, QR, TR, RN-pump rated herid, ffow rate, torque and speed

KIT, KhrtAX-number and maximum number of Newton's method

TM-duration of transients

TOL-tolemce in Newton's method

V, VO, V00-dimensionless discharges at successive time steps

WB, WH-homoIogous torque and head data

WRR-rotational moment of pump

PrtmpSran class is a base class, it gets the data from CFrontpageFonnVierv clriss, and

then initializes the pump chmcteristic curve, so that the pump flow rate or head can be

determined by using this chmctenstic curve.

Referring to Eq. (3.3.60), the atmbutes A I and A2 are constants for the

chanctenstic curve, Hs is the pump shutoff Head, and Ts is the time for the pump to gain

speed. Jprmp is the initial element number for pump.

Fig. 5.33.11 Operation & Attributes of PumpStart

Page 111: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

5. CheckValve

The base class CheckValve performs the check vdve dynarnic anaiysis. The check valve

dynamic analysis considers opention of added cornponents, such as:

DiscTorqrteIfzoclt). Using the specifics discussed in Section 3.3, other appropriate

components cm be added.

Fig. 5.3.3.12 shows the opention of the Checkvaive class. CheckVdve(), and

-ClreckValve() are, respectively, the constmctor and desuuctor of this class.

CheckValvelnirCfzoar,inr) mates the check vdve with different vdve size and maximum

disc opening mgIe.

Fig. 53.3.12 Operation & Attributes of Checkvaive

Page 112: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Refemng to Eq. 32.1, before perfoming the check valve dynarnic anriIysis, the

flow torque TF, and the bearing friction torque Tb mut both be known. In this analysis,

the bearing friction torque will not be considered, becriuse it is a very small term

cornpared with other component terms such as the counterweight and spring.

The operation DirectFZu~v~uat), DirectTorqudrm(irtr), ReverseFlow(),

ReverseTorqneAm(inr), and FlorvTorqrie~oatJToarfroar) are al1 for the analysis of the

fiow torque TF in Section 3.4.3. GeomericParamerer(fioat) and

GetCoeficientsOjResistance() are used to determine the coefficients of resistance for the

check valve dynamic analysis, as discussed in Section 3.4.2. GetTotalTorqtreCJIoarJIoat),

GerJoverT~oatJloar), GerDischtgie() and ValveDynamicsCflUat,float,jloat$oat) are

invoked in the final srrise of the check vdvt dynlunics amiysis. Rk4(......) is used to

sohe the dynlimic equation by Runge-Kutm method. The attributes of this c l a s are

shown in Fig. 5.3.3.12, The meanines are clex and wiII not be discussed.

The p p h i c output application is separated from the HydroAnaiysis sofnvm package.

During a fun, the HydroAnalysis starts the HydroGnphic probpm and then sen& the

andysis results to it. HydroGtaphic receives the data and disptays the Head and FIow

Rate pIot.

In the Hydro-Graphic application, the classes CHydroGraphicApp,

CHydroGruphicDoc, CHydroGraphicView, and ChfainFrame have the same

Page 113: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

functionality as the CHydroAnalysisApp, CHydroAnu1ysisDoc, CHydroAnalysisVim, and

CMainFranre in the Hydro-Andysis.

QCBaseGraplz and QCBasePuge are two base classes for p p h i c output.

BuildGraph(PGRAPH-DEF,HDC) is used for initidizing the base p p h , and

BtrildPage(PPAGE-DEF) is used for initiaiizing the base page.

Class Graplrs is inherited h m the ciass QCBaseGraph.

BtrildGraph(PGRAPH-DEFJDC Mc) implements the plot. It gets the data from

HydroAnalysis application, and then plots two p p h s on the same page. The attributes of

this class are as ioI1ows: m-nGraplzNrrmber is the =ph number on the page;

nrgDynGrDesc is the pointer to p p h descriptions for dyamic p p h i c plotting, and

mqSraGrDesc is the pointer to p p h desaiprions for static p p h i c plotting.

CIass Pagel is inherited from class QCBasePage. BrrildPage(PPAGE-DEF)

impIements the page setting, indicating the page size, color, and position. The attributes

of this c I s s are as folIows: mqGraphl and mpGraplr2 are the p p h i c identity in this

same page. Fig 5.3.3.13 shows the description of HydroGraphic Class.

5.4 Introduction to HydroAnaiysis Software

5.4.1 Overview

HydroAnalysis is a pro- which simulates the hydraulic ansient in pipehe networks

with a check valve system. The program cm soIve the ansient fIow prob1em.s in simple,

branch and compIex pipetine systems.

Page 114: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

B-@ HydroGtaphic claset 5- CAboud)lg &-y CHydroGraphWQp @--y CHydroGraphidim El-V CHydroGraphkMi &-y CMainframe @-2 . . Graphs 1 . . -%+ . . BuikiGraph(PGRAPH-DEF, HDC hdc] . . i . . - . . + G r H i nNm] . . i . ;- . Q m-nGraphNumber . . i . . - . . QmgDynGrDesc . . . . i :- 9 mgÇtaGrDesc 6-Y Pagel i . &g+ . BuüdPagefPPffiE-DE0 . . i . I-- . + Pagel0 i . . - . . 0 "Pagel0 r . - . Q mgGtaphl i i- $ mgGraph2 E-Y . . QCBaseGraph

i - + BMldGraph$GWHgEF.HDCl E -y QCBasePage . . : - 0 BuadPage(PPAGEgEF] @a Globalt

Fig. 5.3.3.13 Description of HydroGraphic Classes

The pro-pn HydroAnalysis is cornpletely interactive using the hlicrosoft

WINDOW Gnphicd User Interface. ïhe user can set and change a11 of the parameters

which describe the pipeline network and check vaive system. The simulation of the

hydraulic üansients caused by pump start up, pump failure, or valve operation cm only

be undenaken once a11 of the parameters describing the pipeline, pump, check valve,

vdve and reservoir have been defined

M e n nmning the simulation, the pressure head at indicated junctions (node) and

flow rate at indicated pipe are both written to a text Ne at each time step. The He is

saved to the working directory, and the user can read and print it at any time later. The

Page 115: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

results of simulation crin be visualized as a -mph plotting the pressure head versus cime at

an indicated junction, and flow nte versus time for an indicated pipe.

The solution procedure adopted in the proe- does not make any allowance for

water column sepantion, which occurs when the pressure in the pipeline reaches the

saturated vapor pressure of the fluid, Therefore, c m should be taken when dedinz with

negative pressures produced by the pro-m. It should be noted that this procoram is to be

used strictly for liquid simulation, because the compressibility of the fluid was not

considered.

To run the Hydrohalysis probonm. the user will require a compueer sprem

running eirher Pvlicrosoft WNDOWS 95 or Iater, or WNDOWS NT 4.0 or later.

5.4.2 User Guide for Software Program Package HydraAnalysis

To simulate a pipeline network with an check vdve system, one needs only need to run

the appiication Hydrohalysis. The KydroGrapltic will be executed automaticdly during

the mnning of HydroAnaiysis. M e r starcing the application HydroAnaiysis, the main

window appem (see Fig.5.4.2.1).

5. A22 Seüing System Paranteters

1. Semng the Connection Parameters

Page 116: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Under the main window, one must set the connection parameter 6rst Pressing the button

Connecrion Pmameters, the foilowhg dialog box is displayai (Fig. 54-22):

-elemtnt number

Fig. 5.4.2.1 Main Window of HydroAnaiysis

Page 117: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.4.2.2 Diilog Box for Connection Parameten

The pipeIine network and check valve systern is displayed as shown in the main window

(Fig. 5.4.2.1). One may set the number of pipes, junctions, pumps index, and up and

down junction numbers of pipe and purnps as show in Dialog Box (Fig.S.4.22)- One

also must indicate the minimum reach number and sound speed. Normaîiy, the rninirnum

reach number is set to 2 or 3, and the somd speed is set between 1400 to 1550 mis for

water.

Page 118: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

2. Setîing Index, Plot, Print and SinricIaflon Parameters

R e f h g to Section 4.2.2, the index for this system is shown in Fig. 5.4. 2.3. It should be

noted that the non-pipe eIements should be numbered 1st. Any others pipe elements may

be numbered by the user.

Fig. 5.4.23 Diaiog Box of indering

The user must also choose the duation of simulation. Fig. 5.4.2.4 shows the Dialog Box

of Sidation Parameters. ïhe user must define the duration of the simulation before the

program will begin that simulation. It s h d d be noted the solution procedure used

Page 119: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

is based on the method of characteristics, and the computational tirne step is set at

the time it takes for an sound wave to traveI h m one reach to the next dong the pipe.

The program will save three pressure head records and three flow rate records at each

time step into file. The time duration cannot be set too large, because the size of the file

depends on the duration of the simulation which is selected by the user.

Fig. 5.4.2.4 Dialog Bor of Simulation

Fig 5.4.2.5 shows the Didog Box of Plot Print parameters. ïhe print and plot locations

are to be set by the user. The program will plot only one junction location for head and

one pipe location for flow rate, but will print (or save) a maximum of three Iocations for

head and three pipe locations for tlow rate.

After print out or display, if the user needs to print or display more locations, they

can do so by re&g to the main window and resetting the Plot and Print dialog box to

the desired parameter.

Page 120: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.4.25 Diaiog Box of Plot & Print

3. Setting Pump and Check Vaive Parameters

The pump-check valve parameter dialog box is show in Fig. 5.4.2.6. The user m u t set

the following data:

Check vaIve diameter: the user can set it by cboosing from a Iist box. if the user

checks the check box of WithOtctCheckVuIve, this list box will be greyed.

Set pump operation status: the user can choose h m the four radio buttons in the box.

1) If the user chooses pump start up, the fîrst group edit box d l appear, in which

the user cm set the pamp start up data such as Ts, Hs, AO, AI, and A2. The otfier

two boxes wüi be greyed See Fig. 5.4.2.6 in the Ieft coIumn.

Page 121: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

if the user chooses pump failure, the second group edit box will appear, and the

other two wiii be greyed. The user can set Rated pump flow, head, torque, and

speed. See the middle column of Fig. 5.4.2.6.

if the user chooses pump normal m, the 1st group edit box will appear, the user

will oaly need to set AO, AI, and A2 for this operation status. See the right column

of Fig. 542.6.

[f the user chooses the last radio button Pump Sbp, al1 of these three groups are

grayed, and the user is not required to set any data at al.

Fig. 5.4.2.6 Dirilog Box for P m p Check Vaive Parameters

Page 122: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

4. Setîing Pipe, Junction (Uode), Reservoir, and Control Valve Parmeters

The effect of transients in the pipeline will be different dqmding on the phpical

properties of the pipe, junctian, reservoir, and valve. It is assumeci at the staa of the

simuiation that steady state conditions exist in the pipeline network system, Fig. 5.4.2.7,

5.4.2.8, and 5.4.2.9 show the pipeline, reservok and junction parameters dialog box.

Fig. 5.4.2.7 Dialog Box of Pipeline Parameters

107

Page 123: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.4.2.8 Dialog Box of Resewok Parameters

if the transient5 in the pipeline are caused by the control valve closure or opening, the

valve opening and valve closure or open tirne can be defined by the user. The control

valve parmeters Dialog box is shown in Fig. 5.4.2.9,

Pig. 5.4.2.9 Dlaiog Box of Control Vaive Parameters

Page 124: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The steady state of flow will be controNed by the reservoir head, the diameter, length and

fiction factor of the pipeline, the junction type, the head, flow, and elevation of juuction,

and the initial vaive settings as showing in Fig. 5.4.2.10 .

Fig. 5.4.2.10 Dirilog Box of Junction Parameters

Page 125: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

5. Save Model to afile, open a modelfrom previousfiIe

After aii of the parameters are set by the user, it is recommended that the model be saved

to a file for later r e p d use. At the main window menu, under File, Save Model As. ..,

the Save As window appears, allowing the user to save the model at any directory

indicated by the user, by entering the file name and then swing. îhe user is not

required to give the file extension, because the systm will add the mod

extension automatically. PIease refer to Fig. 5.42.1 1 - 5.4.2.12.

Fig. 5.4.2.11 Mena File Wlndow

Page 126: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.4.2.12 Save Mode1 As Window

AAer the user saves the made1 as a model file, pressin ie main

window begins the simulation. Next tirne, if the user wishes to nui a simulation, he or she

can start with a New or Open the model file. Refening ta Fig. 5.4.2. t 1, under the File

menu, Open Model, the foliowing Open widow will display (Fig. 5.4.2.13).

It should be remembered that initial data must be set by the user before a

simulation can be started Therefore, the save fiuiction of this program is very usefid for

users who intend to do multiple simulations of the same system, and the user is only

required to open the exiting model.

Page 127: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.42.13 Open Model Wiadow

After the user finishes inputting al1 of the data settings and presses the START button

under the main window of HydroAnalysis, the HydroGraphic page will display. There are

two plots displayed in this page (Fig. 5.4.2.14). One graphs the Head (Pmme) versus

T ie , and the other graphs Flow Rate (Discharge) versus Tirne.

In the Head (Pressure) Vs Tirne Plot for this case, it is shown that this plot is for

Pump start, with check valve at the location of junction (Node) number 5. The Flow Rate

(Discharge) Vs ïime plot shows that the curve is at the location of Pipe Number 4, pump

staa, and with the check valve. The simulation results of simple pipe with pump faiiure

wili be shown in Appendix C. Sùnulation resuits of other example pipeline network

systems will aiso be illustrateci in this Appendix.

Page 128: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.4.2.14 EydroCraphic Main Page (With Check Vaive)

The user cm change display characteristics of the plot such as the line me or line

attributes by doubleclicking the plot field under the main page. The plot parameters

window will appear. The plot data can also be displayed on the screen by clicking the

Dota Button h m the plot parameters window, a list of data wiii display on the scmn.

The user can then copy the resuiting plot &ta to an Excel, Word or Text file, for further

anaIysis. (Fig. 5-4.2.15).

Page 129: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Fig. 5.42.15 Display of the Plot Data

The system saves Head (Pressure) and Flow Rate (Discharge) of a maximum of

three Iocations wtomaticaiiy. The user can open the fie containiag this data under the

defauit directory by using NotePaci or WordPad. The user can also plot other locations of

this system by closing the Main Page, retuming back to the Main Window, changing the

Plot Parameters, and restarting the sixdation.

Page 130: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In this chapter, analyses of the pcoblem, input, and output were fmt introduced;

next, the Hydro-Analysis and Hydro-Graphic software were implemented by us iq

dgorithms, hierrurhicd diagram, and description of major classes. A users guide was

provided, giving detailed demonsmtions for this software. This software mates an

effective simulation for hydraulic transients in pipelines with check vaIve systems. It h a

a user-fnendly graphie interface and aIlows a user plenty of choices for convenient

simulation and andysis of pipeline systerns.

Page 131: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Chapter 6

Conciusion

6.1 Summary

The purpose of this thesis was CO design and implement a software package to mode1 and

simulate pipeline networks including check valve systerns. This objective was achieved

by analyzing hydnulic transients for pipeline network systems, analyzing check valve

dynamics, and implementing rhe software package which combines the pipelines with

check valves.

After introducing the continuity and motion equations. Chapcer 2 obrriined the

= some Hÿdraulic-Grade-Line form of the equations of motion and continuity by usin,

assumptions and simplifications. The equations are most suitable to the hydrriuIic

transients analysis for pipeline network systems, but are restricted to less compressible

fluids flowing at a low velocity.

The method of analysis of hydrauiic trisient tlow in pipeline sysrcrnh tartec ci

with the equations of motion, continuity and other physical property relationships. From

these basic equations, different methods employing different restrictive assumptions have

evolved. The charzicteristics method was andyzed and compared to the lumped panmeter

method in the time domain, the four-pole equations and the tmsmission line modelins

method in the frequency domah

The method of characterisllcs h a severai advantages over ocher rnethods thrit m

particulady relevant for hydrautic transients problems. These include an explicit solution

Page 132: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

' and a procedure that is relatively simple with approximations. Therefore, it is par tic^ lrirly

suitable for the anaiysis of systems with complex boundary conditions.

Besides using the basic method of characteristics in this study, some improvement

has been added to this method. The Finire Difference Formulations and AIgebnic

Representation were combined to the rnethod of charactenstics. During the

implementation of the integrating chancreristic equation (2.4.7) and (24.9). the

trapezoidal rule was introduced for maintaining the linear form of the intsgrated

equations, at the same time keeping the second-order accuracy.At end of this chapter. the

introduction of the pump characteristic md the derivations of the boundary conditions for

pump faiiure and pump start up were inchded,

in Chapter 3, the check valve dynarnic equation was investigated for the analysis

of pipeline transiencs. The torque due to the weight of the rotliting Jisk. TV,, . the bearing

friction torque, Tb , the counterweight torque. T,.,, . the tlow torquc. TF . ancf the . ~p r ing

torque TI, were included in the dynarnical equation. The tlow torqus wris included in the

valve analysis, in which the orifice sequence mode1 was introduced. then determincd the

pressure drop for fotward and reverse now.

An important issue was CO determine the coeficient of resistance of a check valve.

The coefficient of resistance of the check valve is a function of the valve geornrrp and

disc opening angle. During the occurrence of uansient, the coefficient of resistance is

cdculated at each time step. Finaily. the check vaive boundary condition was introduced.

Chapter 4 presented the numericd model used to simulate pipeline network

transients including the check valve. This included the pipeline system model. check

valve dynamics model, and the pump characteristic model.

Page 133: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The pipeline system mode1 was developed based on the method of characteristics

which was investigated in Chapter 2. The solution was dgebraic. The use of continuous

data storage, connection index vector, and a fiowchart of the simulated procedure were

introduced.

The advantages of algebnic representations over the normal characreris~ic

equations can be summarized as:

They are norrnally applied over several reaches, with no need to cdculate the

transients at the intervening section; they are therefore a cornpucationrtlly

efficient solution for mukipipe systems such as networks.

0 They use a small Ar = LI(Na), so chat the boundary condition drtail is

presewed.

The variables H and Q of each time step are continuaily stored by using KM

(K,\,=U(a Ar) +/) which is the maximum size in the system, K which is used as a counter

for each time step, and Kp which is used as a pointer to identify the position in the veçror

H or Q at which current values of the variables are stored. At eüch iteration whrn k' is

incremented, so is Kp, the vaiue of the pointer. When Kp exceeds KM, the value Kp is set

back to O, so that it points to the first position in the vector. This procedure wiH save

much tonge space during computation.

The system topology musc be stored before starting the simulation. An indexing

method was introduced which offers one form of bookkeeping CO describe the system

connection. Ir was orïented around the nodes of the systern and, for each node. the

following information was given: the node number, the element number (sign) attached

to the node, and the eIement section number adjacent to node.

Page 134: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The check valve dynamic syscem rnodel was represented by a second order.

nonlinex, differentid equation. This equation c m be sulved using the fourth arder

Runge-Kutta algorithm. It must be solved simuitaneously with the pipeline sirnufation or

pump dynamic simulation. Check valve dyriamics need toque To and flow rate QV as

initiai conditions. At the end of each tirne step of simulation. the check valve d i x q i e 0

and disc angular veIocity o is obtained. Then, from the disc information. the check valve

coefficient of resistmce EL check valve pressure drop hP, and flow rate Qv are

calculated The flow toque To is caIcuIated by Qv and K. The above procedure is

illustmed by a flowchart in Fig.4.3.1.

The pump characteristic mode1 includes the head balance and speed change

equations. These equations crin be solved simuItaneously for u and v using 'itwton-

Raphson method. The flowchan of this solution was illustnted in Fig.4.4.I.

Chapter 5 described the irnplementation of the dynamic modei of pipeline

network systems with check valves into a working simulation pmsnm. This progrtim

inciudes three parts: Hydro-Analysis. User Graphic input. and User Gr~phic Output.

which were involved in two application. One wris the H~droAn~rlv.sï.s application {H>ctio-

Analysis and User Gnphic Input), and ttie other was the HydroGrciphic (User Gnphic

Output).

An overview of the prograrn was given including the andysis and the design of

the Hydro-Analysis and Hydro-Graphic applications. The analysis application consistsd

of probIem description. input and output requiremenc. The design wxs focusecf on rhr

dgorithrn, the hienrchicd diagram, major class descriptions, and their inter-relationship.

Page 135: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The user interface is essential in achieving the goals of this work. The Microsoft

Windows Graphic User Interface was used. The user could easiiy set and change dl of

the panmeters describing the pipeline network and check vaive system through a window

dialog box, button conuol, edit box, and other standard interface methods. This

application simulates hydraulic transients caused by pump failure, pump start up. or

control valve operation (closing, opening). It cm also be used in the system wirh or

without the check valve. The results of simulation can be visudized ris ri plot in whish

pressure (head) Vs. time at indicated junction and flow rate Vs. time rit indicated pipe.

The indicated pressure and flow rate can also be stored in text file which can be princed

or read at any time later.

In conclusion. the contributions of this thesis are:

Provided a hydnulic transient simulation package under the windon'b

environment with gnphics user interface for eue of use.

inchded pump dynamics. and check valve dynamics in the pipeline

transient analysis.

Improved algebraic representation and continuous data srorage to ihc

method of characteristics.

6.2 Suggestions for Future Work

The program HydroAnalysis is only the first step t o w d s the simulation of pipeline

systems with check valves. The solution procedure adopted in the p r o p m did not

consider the problem of water column separation. Although this only occurs when the

Page 136: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. pressure in the pipeline reaches the saturated vapor pressure of the fluid, it should be

considered in the rnethod of characteristics. Streeter and Wylie ['il introduced a procedure

in which the development, growth. and collapse of a cavity were considered as an internai

boundary condition. The pressure of column separation computed by using this approxh

was, however, found to be higher chan those measisured on a prototype. Therefcre. there

remains more work on this topic, especidIy in pro- irnplementation.

An expenmentiil aniilysis of the Orifice Sequence Mode1 for the check valve

dynarnic analysis is required. Experimentd nining is also necessary for progrrim

HvdroAnalysLr. Since al1 concepts and most dgorithms rire oniy considered for the

incompressible flows, compressibility will need to be inregrrited into the dynamic and

tmsients fl ow mode1 in the funire.

The user interfaces in this appIication onIy meet the basic requirement for thib

project, Throughout this thesis. great effort was made to fulfiII basic usable requiremrntb.

but thrre remains room for a grerit d r d more work in this area. .At pressnt. an indes

vector hris to be input through the window interface point by point. The complrxity u i the

pipeline networks system is lirnited by the size of mays which were used for panmeters

input of pipes. junctions, pumps, and valves. A well defined database shoutd be created to

store the pipe parmeters, pump chmcteristic data, and check valve panmerers. X

,srapphic user input should be introduced for the pipeline topoIogy data. so thac the user

would need onIy to dng in, and connect each elernent. and input parrimeters gnphicrilly.

Finaily. the gnphic output should be irnproved to display and store more plots as freely

chosen by the user.

Page 137: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

REFERENCES

1. Wood, F. M., "History of Water Hammef', Report No. 65, Department of Civil

Engineering, Queen's University a i Kingston, Ontario, Canada, April 1970.

2. Rich, G., 'Hydrauiic Transients*, McGraw-Hill Book Co., New York, 1951

3. Parmakian, J., 'Water Hammer Anaiysjs: Prentice-Hall, Inc,, Englewood

Cliffs, N.J., 1955.

4. Street, V.L., and Wylie, E. B., "Hydraulic Transientsn, McGraw-Hill Book Co.,

New York, 1967.

5. Fox, J. A., "Hydraulic Anaiysis of Unsteady Flow in P@e Networks", John

Wiley & Sons,lnc., New York, 19ï ï .

6. Watters, G. Z., "Modern Analys& and mntroi of Unsteady Flow in P@elines:

Ann Arbor Science Publications, Ann Arbor, Ml, 1979; 2"d ed., Butterworth,

Boston, London, 1983

7. Wylie, E. B and Streeter, V. L., Wuid Transients",cGraw-Hill Book Co.,

New York, 1983.

8. Chaudhry, M. H., 'Appiied Hydrauiic Analysis: 2nd ed., Van Nostrand

Reinhold Co., Princeton, N. J., 1987.

9. Fox, J. A., "Transient Flow in Paes, Open Channeis and Sewersny John Wiley

& Sons, Inc., New York, 1989.

Page 138: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1 0. Sharp, B. B. and Sharp D.B., " Water Hammer: pracfial solutions", Arnold

Publishers, London, 1996.

1 1. Pool, E. B., Polwit, A. J. and Catiton, J. L., 'Prediction of Surge Pressure from

Check Valve for Nuclear Loops" Paper 62-WA-219, Amer. Soc. of Mech.

Engrs, October 1962.

12,Csemniczky, J., 'Hydraulic Investigations of the Check Valves and Bufferfiy

Valves: Proceedings of the Fourth Conference on Fluid Machinery,

AKADEMIA, 1 972,PP. 293-305.

1 3. Hong, H. and Svoboda, J., "Modei of Swing-disc Check Valve Suitable for

Lumped Parameter P@ing Network Simulation", Report, Concordia University,

Montreal, Quebec, Canada, 1981.

14.Hong, H., "The Design of Wafer Swing-Disc Check Valves for OptLmal

Performance: Thesis of Master of Engineering in the Faculty of Engineering,

Concordia University, Montreal, Canada, 1983.

15.Cavazoni E. M, "Design Optimitation and Performance Evaluation of a

Gravity Check Valve for Gas Service", Thesis of Master of Engineering In the

Department of Mechanical Engineering, Concordia University, Montreal,

Quebec, Canada, 1 984.

16. Provoost,G.A., Cn'tical Analyss to Determine Dynamic Characteristics of

Non-Retum Valve: 4m Int. Conf. On Pressure Surges, Bath, 275-286,1983.

17.Thorley, A.R.D. 'Check Valves Beha~or under Transient Flow Conditions, a

State-of-Art Review", Tram A.S.M.E. J Fluids Engineering 11 1 178-183,

1987.

Page 139: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

18. Sidi Ould Sadfa, "Simulation for the Dynamic Response of a Transient

Hydraulic System: Project report. Dept. of Mechanical Engineering,

Aerospace Engineering, Concordia University, 1998

19. "Simulation of Water Hammer in Pipes with HAMMER",ersion 2.0

http~//www.civl.bee.qut.edu.au/projects/hamrner.htmI

20. "Faast Software for fluid transients: httpY/www.faast.com/

21. Thoriey, A.R.D., 'Dynamic Response of Check valves",-rn international

Conference On Pressure Surges, Bath, 231-242, 1983.

22.V. L. Streeter, and E. B. Wylie, "Fluid Mechanics: 8" ed., McGraw-Hill, New

York, 1985.

23.A. R. D. Thorley, "Fluid Transients in pbeline Systems: O. & L. George,

Herts, England, 199 1.

24.A. R. O. Thotley, and J. H. Oei, "Dynamic Behavior of a Swing Check Valve:

ProcSm int. Symp. Water Column Separation, IAHR, Obemach, Germany, Sept, 1 981

25. M. Suda, "Simulation of Valve CIosure aiter Pump Failure in PQeline", Journal

of Hydraulic Engineering, Vol. 117, No. 3, March 1991

26.Krasimir P. lvanov and Emil G. Boumaski, "Combhed Distributed and

Lumped Pôrametets Mode1 for Transient Flow Analysis in Complex Pîpe

Networks", Comput. Methods in Appl. Mech. Engrg. Vol. 130, 1996

27. B. Carnahan, H. A. Luther, and J. O. Wilkes, "Applied Numencai Methods",

John Wiley & Sons. Inc., New York, 1969.

Page 140: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

28. Shoichiro Nakamura, "Applied Numefical Methods wilh Soffware", prentice

Hall, lnc. New Jersey, 1991.

29. David Budgen, 'Software Design: Addison-Wesley, 1 994

30. B. W. Kamey and D. Mclnnis, "Efficient Calculation of transient Row in

Simple P@e Networks",ournal of Hydraulic Engineering, Vol. 118, No. 7,

Juiy 1992

31. M. S. Ghidaoui and B. W. Kamey, "Equivalent Diferential Equatiuns in

Fked-Gnd CharactenStics Method: JoumaI of Hydraulic Engineering, Vol.

120, No. 10, October 1994

32. 0. A. Mclnnis, B. W. Kamey and D. H. Axworîhy, "Efficient vaive

Representation in Fixed-Grid Characteristics Method: Journal of Hydraulic

Engineering, Vol. 123, No. 8, August 1997

33. B. W. Kamey and M. S. Ghidoui, "Flexible Discretization Algorithm for Fixed-

Gnd MOC in P@elines",ournal of Hydraulic Engineering, Vol. 123, No. I l ,

November 1997

34. P. Krus, K. Weddfelt and J. O. Palmberg, 'Fast pipeline Mudels for

Simulation of Hydraulic Systems",ournal of Dynarnic S ystems,

Measurement, and Control, Vol. 116, March 1994

35. T. Chen and R. F. Boucher, "Junction CharactenSfrCs of Energy Wave

Methods: Proc Instn. Mech. Engrs, Vol. 21 1 Part C, 1997

36.A. S. Elansary, W. Silva and M. H. Chaudhry, "Numerical and Expenmental

Investigation of Transient P@e Row", Journal of Hydraulic Research, Vol. 32,

No* 5,1994

Page 141: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

37. E. E Kitsios and R. F. Boucher, "Transmission Line Modeling of a Hydraulic

Position Control System", Proc Instn. Mech. Engrs, Vol. 200 No. 84, 1986

38. R. F. Boucher and E. E. Kiisios, "Simulation of Ruid Network Dynamics by

Transmisson Ene Modeling", Proc Instn. Mech. Engrs, Vol. 200 No. Cl, 1986

39. S. M. Beck , H. Haider and R. F. Boucher, "Transmission Lhe Modehg of

Simulated Drill Strings Undergoing Water hammef, Proc Instn. Mech. Engrs,

Vol. 209, Part C: Journal of Mechanical Engineering Science, 1995

Page 142: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Appendix A Review of Methods of Transients

Analysis in Pipelines

A 1. Introduction

There are two kinds of unsteady flow in pipes. One is the tr-ent msi flow that

represents the intermediate-flow condition when flow is changed corn one steady state to

another. The other is the osciIIatotyjlow that rnay be devetoped into a rtsonancr which

depends on the characteristics of the piping system and of the excitation,

A 2 Methods for Andyzing the Oscillatory Ftow

OsciIIatory flow may be andyzed either in the tirne domain or in the frequency bain.

In the tirne domain, one can use the Method of Characteristics. Using this method,

the partial diflerentiai equations describing the unsteady flow are converteci into ordinary

differential equations a d then solved. Analysis of the osciIIatory fiow by this method

assumes that the initial steady-state discharge and pressure head in the piping system are

equd to their mean values or equd to zero-flow condibons. The specified forcing

hnction is then imposed as a boundary condition, and the system is andyzed by

considering one fiequency at a hme. The disadvantage of this method is that it requires a

considerable amount of cornputer time. The main advantage is that the nodinear

relationships cm be inctuded in the analyses.

Page 143: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

In the frequency domain, there are two methods of malysis availabie:

1. Impedance Merhod

in this method, the Terminal Impedance, &, which is the ratio of the oscillatory

pressure head to the discharge, is computed by using the known boundary conditions. An

impedance d i a c m between @ and is plotteci. The frequencies at which lZtf is

m~ximum are the resonant frequencies of the system.

Because of the lengthy a1;ebraic equations involved, the method is suitable for

di@d computer analysis only.

2. Transfer Marrir Merhod

The second method for doing frequency andysis is the urinsfer matrix method. It

h a been used for analyzing stnrctud, mechanical vibrations and eIectrical systems. The

method is brtsed on the linearized equations and on sinusoidal fiow and pressure

fluctuations.

The m s f e r mauix method is simpler and more systematic thm the impedmce

method. This method is suitable for both hmd and di@mI computations.

A 3 Method for Anaiyzing Transient State Fiow

NI methods of analysis of transient flow in pipes stm with the equation of motion,

continuity, or energy and equations of state and other physical property relationships.

Page 144: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

From these basic equations seved different rnethods, each employing different

restrictive assumptions, have evoIved-

1. Method of characteristics [7,3 1,32,33] -

The characteristic rnethod of analysis tmforrns the partial differencial equations

of motion and continuity into ordinary differentiaI equations. It has several advantases

over other methods that are particuliiriy relevant in water hammer type pcoblems. These

inchde a f i n l y established stability criterion, an explicit solution so that different

elernents physicdly removed from one anothet in systems are handIed independently. and

a procedure that is relacively simple for approximations. Therefore. the method is

particuIarly suitable for the analysis of systems havins cornplex boundiiry conditions.

Its prirnary disadvantage is the requiremenc of strict adherencr CO chs tirne step-

distance interval reiationship. The method of characreristics has been discussed in detriil

in Section 2.4.

1. Lrimped Parameter Method 114,261

In the lumped-paramecer method, the pipe is divided into n-sections of equaI

Iength, where the fluid inertia, fluid capacirance and pipe elasticity and shear stress

becween the fluid and pipe wails are Iumped. Fig A 3.1 is a circuit represenrrttion of one

section of a pipeline. Between each consecutive node a Iumped mistance R and tluid

inertmce 1 represent, respectively, the friction losses and the fluid inertia in the

Page 145: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

correspondin3 sections, At each interior node a capacitmce C connects the node to

zround. C represents the sum of hdf the capcitance of adjacent lumps. t

With reference to Fig. A 1, the coupled non-Iinear differentid equiitions retating

pressure head H at each interior node to the Flow rate Q thmu* each section, are @ven

dQ 1 '- = -(Hi - H,,, - RP,?) i = 123, ..., n dt I

In which 1143

Section i-I Section i

Eig. A 1 Circuit Represent of Lumped parameter method

Page 146: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

where, f is the Darcy-Vieisbach friction factor, L is the length of the pipe, d, is the pipe

dimeter, A, is the pipe are& n is the section amount, a is the pressure wave propagation

speed for the fluid.

The lumped-panmeter method describes the system pressures and fiows by

coupled non-linear differential equations. This method may be satisfactory at very tow

frequencies and with a large enough n, but it requires excessive amounts of computer

time.

Frequency Domain

In order to derive the four-pole equations, the continuity and motion equations

cm be solved by using hplace transformation [22,23]. One cm obtain

In which E is the bulk ModuIus for the fluid and

Page 147: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Where, J,,($) is cdied BesseI functions of order n.

And

where, v is the viscosity.

where. a is cailed "viscosity factor".

An approximation over the whole frequency m g e is made, especinlly for the

We introduce the characterisric impedance 2, and the sonic velociry a

The equation (A?) and (A.3) cm be rewrinen as the following:

(A.9)

(A. 10)

Elimination of the pressure P h m the above

Page 148: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The solution of this second-order differentiril equlition

when .FU, at the input end of the pipe, P = PI and Q = QI, so:

(A. 12)

(A. 13)

Lettins P= Po and Q = Q, at .x = L, the output end of the pipe and inuaducing the wave

propa_oation time along the pipe Iine

Thefutir-pole eqrtarions are obtained as folIows:

We cm write above equation in the form of matrix

(A. 13)

(A. 15)

The block dia- shown in Fig. A2 cm be used to represent the dyamic behavior of

one single pipeline.

Page 149: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The four-pole equntion provides a pmctical solution in the frequency domriin. It is

very usehl for the andysis, synthesis and design of hydmutic pipelines.

Solutions in the time domain cm be found theoretically. By inverse Laplxe

msformation, the frequency domain c m be transformed into the time domain. However,

this procedure turns out to be exuemeIy complicated. The main difficulty cornes from the

frequency dependent friction factor N.

Fig A2 BIock Diaboram for Single Pipeline

n e use of four-poIe equritions may be considered for simulation. Using SimuIink

toolbox in Marlab, one m3y buiId black d i a c m for the single simple pipeIine; however,

for large and cornplex pipeline systems, ic remriins difficuit.

Transmission Line Modeling is essentidiy a hme-deIay rnethod, borrowing its

main concepts and fundamenuls of its cornputsitionai solution scheme h m the field of

electricaI power lines. In its eIemenrary fonn, a fhid nework is treated as a set of pipes

Page 150: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

(OC pipe secment) where waves travel wirh a pure time delay. Connecting the pipes are

junctions of various types at which the waves are scattered (transmitted, reflected and /or

attenuated).

Sirnilar to the four-pole equation system andysis, The transmission line equation

are obtained as fo1Iows:

(A. 16)

where P and m are pressure and mas Elow at stations 1 (upstream) and 2 (downstream),

T is the acoustic tirne delay between stations, 2, is the characteristic impehce and D is

the D opentor i.e., eTD ~ ( t ) = F(r + T) .

Equation (A.16) is remnged as:

(A. 17)

(A. 18)

The first and second bncketed terms of buth equations (A.17) and (A.18) represent

ri&tward (u) and IeftwYd (v) travelling waves respec tively,

(A. 19)

Equation (A.19) defines IL and v, che decolrpIed wave variabIes. The pressure and fiow are

thus simply determined from hem as

Page 151: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The relationship between u and v at each end of a transmission Iine may be confirmed

now by substituting for P and m in equation (A.16). giving

Since the e'TD is the delay opentor

Thus, ti and v waves are linexly related to right and teft going p and m waves. and

therefore underso onIy a time delay in the line.

To use TLiM method in network modeling, al[ lines are divided into a number of

identical time delay lengths (Ar) along which u ruid v waves travel unaltered. Each line is

modeled computationally by a pair of software resisters, one each for the left- and right-

going waves. A feature of the method is that al1 dyamic elernents are modeIed as

distributed elernents-nrimely as losstess tnnsmission lines. Inenance and capaciunce

are modeled by equivaient opened- or ciosed-end transmission Iine snibs of delay At.

Resistance (simpty, although not essentiaiIy, linear) is Iumped at the junctions where a11

wave transformation (via scattering or attenuation) is thus concenated. Thus the mode1

consists onIy of resistive junctions and transmission lines (using both actuai lines and

short stubs representing dynamic eiements). The system can be represented by a general

Page 152: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

scarzeriitg tnatrîr which acts on the incident wave vector to pmduce the reffected wave

vector.

If 4 represents incident waves and vi emergent waves from a junction, a matrïx S

c m be consmcted which contains a11 the junction scattering coefficients. This matrix

operates on the P vector of incident waves to produce a v vector of emergent waves. One

time step Iater this emergent vector of waves becomes the incident vector at the junction,

A forcing term F may be included as following:

[ v L = s[1dt+ F[P] (A.24)

where S is scanering matrix, F is the linear amy of forcing coefficients and [pl is the

forcing vector. Thus, the major concern is to find the scattering matrix S by studying

different pipe connections and different elements.

From the above anaiysis, this kind of method combines the lumped panmeter and

distributed p m e r e r modeIs, frequency domain analysis, and the time domain

impiement. It cm therefore be used to solve the problem of simple pipeline network. and

possible be extend for use in analyzing more complex systems.

There are other methods which may be used in hydraulic vansient malysis, such

as the graphical rvarer Irammer method in which friction is neglected in its theoreticai

development, but taken into account by correction.

Page 153: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Appendix B

Pump Characteristics

The reintionship between the pump discharge, Q, and the pumping head, H, must be

specified in a mathematical modet. The dischmge, Q, of a centrifuga1 pump is a function

of the rotationai speed, N, and the pumping herid, H, whereas transient-state speed

chanses depend upon the net toque, T, and the combined moment of inertia of the pump,

motor, ûnd liquid entnined in the pump impeller. Thus, four variables are involved in the

c h ~ t e ~ s t i c s , tiie pump dynamic head H, the discharge Q, toque ï, and the rotritional

speed N. Two of these variables may be considered independent (Le., for a given Q and

N, H and Tare determined from the characterisrics).

Since ffow conditions may be described for a turbine in the same manner as a

pump, we can use turbine chmctenstics to pump. For a @en geometricdly simitar

senes of turbine, with D representing the linex dimension, the homologous equation [8]

becomes:

where the subscripts L and 2 refer to two different-shed units of the homologous senes.

m e n resuicted to a parùcular unit, with the subscripts referrïng to two homologous

operating situations, Eq.(B. 1) reduces to

Page 154: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

The homologous theory assumes that efficiency does not change with the size of unit, so

that

Combination of Eq.(B.2) and (B.3) obtain:

Various variables at the point of best efficiency are referred to as rared conditions. By

using these vdues as a reference, the following nondimensional variables may be

de fined:

where the subscript R indicates the nted conditions.

On the bais of Eq.(B.5), the dimensionless-homologous relations may now be

expressed as

h - VS. - - VS. - v / 3 v h a P c r - vs. - - VS. - a' a a' u V' v v 2 v

h v According to the homologous theory, - vs. - is the head-discharge relation

a' Q!

B v for any speed a! of chat unit, and similarly - vs. - is the representation of the torque- a = ar

discharge relations for any speed a of that unit.

During normal pump opecation, h, j7, v, and u are aU positive. However, during

the transient-state conditions, they may become negative individualIy or in p u p s .

Page 155: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Becriuse the above relations m difficutt to handle, the following method may be used to

overcome this di fficulty.

12 v B v vs. tan-'- vs. tan-' -

a' + v' a a2+v= U

v It is noted that for a given - one clin deveIop h ti

from a pIot of - vs. U a' + v' a'

v - , so that homoIo_oous relacionships are preserved in Eq.p.7). a

/ &arc tan

Fig B.1 Polar Diagnm of 0

Page 156: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

If one had complete pump ditta for dl zones of opention, referring to Fig(8.1). a polar

v Ir diqmm of 8 =tan" - VS. r = and VS. r = ' would repmsenr the

U Q' + V' &Y' + V*

complete characteristics of the pump by two cIosed curves [7].

Pump Charactristics

Fig B.2 Cornpiete Pump Characteristics

v=O a=O v=O CGcO v=O

Turbine

Zone

vso ac0

O n/2 7r 3n/2 2R

Reversed Speed

Dissipation

Zone

v > O

uc0

Dissipation

Zone

v < o

a20

Normal

Zone

v 2 0

u20

Page 157: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

-1 v The angle 1 = + un - may also be plotred as an abscissa against WH(.r) or a

v To obtain the rectan_ouIar coordinate plot (Fig B.?), the 0 =tan-L- is an angle between

a!

- X and f 15 . It holds for al1 red vaiues of v andu except v=O and a=û at the same

time. The p m e t e r x varies from O to 3jr . We cm determine sets of vdues of H, Q, T,

and N, or K. Q, El, and efficiency q for various openting points throughout the zone.

Since To =- 'Hi for a purnp. and To = Q H y q for a turbine, T rnay be rl

deremined. Thus the four values II. 8, v, and ucan bs obtained, when nted values UR,

Th QR and NR are given. From Eq. (BA), .r, WH* and W,', may be determined for each

openting point.

Page 158: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Appendix C

Simulation Results

Page 159: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

1. Simple pump, check valve andpbe system simulation dvroig pump folure

Valve

Fig. C 1 Simple Pump, Check Valve, Pipe Systems

The results of the simulation are as foiiowing:

Page 160: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 161: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 162: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 163: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 164: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application
Page 165: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. US.54 145.286 145.O

147 147.397 ld?. 347 148.048 149 m 242 149.799 149.973 150.819 152 lll 114 es48 1S6.971 lS8.13

160.369 164.151 167.569 170.942 175.068 180.259 185.96

191.997 203.676 223.513 220.174 231.304 248.R1 2 6 7 . U 287.8% 356.854 495.251 7 71.036 lStQ.l6 3532.24 2472.14

-2O5, 948 -933,314 -2896.37 -1867 .O4

738.973 1448.46 3364.94 2365.86

-173.017 -865.447 -21 37.61 -1766.61 707.994 1384.13 3214.08 2269.69

-143.829 -004.385 -2594.07 -1614.95 680.452 1326.1

3077.33

Page 166: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

2. Branching system with check value and wiîhout check vabe simulation

Page 167: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Hg. C 3 Graphic Display of Branching System Without Check Valve

Fig C 4 Gnphic Display of Braacbing System With Check Valve

152

Page 168: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Simulation Result of Branchine Svstem without Check Valve: Tian Qnup 9 1 Q 2 4 3 Bn 1 Iin 2 Bn 3

0 1.14192~-007 1.14192~-007 1.56917 73 73 70

79.0731 79.0731 79 -0731 85.3492 85.3492 87.8811 103.604 10s. 11

120.606 l25.194 124.38 124.71

124 -721 118.672 118.168 121.235 lO6.Ol6 98.9lD9 84.4173 80 .a203 80.2193 86.2624 85.9322 87.8399 102.343 103.696 117.487 121.51

120. R 9 119.965 lZO.049 114.375 113.79

116.751 lOI.OSl 96.4724 0 4 0282 80 1446 80.7188 86.346 85.4775 86.649 99.3088 100.43 112.066 U S . 476 113.737 113.013 113.234 108.138 107.759 110.741 99.1493 93 .I417 83.3456 80.072 81.0431 86.1359 84.6693 85.1227 F5.7004 96 -6234 106. OX! lO8.851 lO6.567 lOS.8U6 lO6.213 LOl.8lI 101.72 lO4.7U

Page 169: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

SimuIation R d t s of Branchin~ Svstem With Check Valve: Tira

-Po 9 1 Q 2 4 3 Ba 1 Bn 2 9, 3 Theta

O 0-0.0007 1.56917 73 73 70 O O. 275 O 0-0.0935833 1.60888 73 79 -0731 70 O

Page 170: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

Appedix D

Head File for HydrauAnalysis And HydrauGraphic

Page 171: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / I / / / / / / / / / / / l / / / / / / / / / / / / / / / / / / / / / / / / / / / O ProntPageFormview.h : interface of class / / @ author: Tianhe Wea, 1999 / / @ Version:Z.O / / O Copyright: nitepro Inc. / / fi! Concordia University

#if -Ise-VER >= 1000 #praqma once #endif / / -MSC,VER >= 1000 / / FrontPageFormView.h : header file / 1 llinclude "DefineOData.hm / / l / / / / / / / / / / / / / / / / / I / / / / / / I / / / / / / / / / / / / / / / l / l / / / / / / l / l l l / / / / / / l / / / l l / / ~ l l / l / / / CFrontPageFonnView f a m view

/ / Farn Data public:

/ / f (2SXJiAT.i ( CFrontPaçef crrnView) enum ( IDE = IDD-FXONT-PAGE } :

/ / NOTE: the CTassWi=ard will adà data nenOers herp l / } 1 A"r x-DATA

/ / Attributes public :

RESEJZVIOR-DATA CONTROL-VALVE-DATA S ïXUiATION-DATA PIPE-LINE-DATA i m c ~ ION-MTA ~-cEECKCKVACVF~DATA PLOT-WINTOUT-DATA CONECTION-D&TA mEX-DATA / / Operations public :

ReserviorDaca; Contro llIalvData ;

SimulationData; pipeLineData [li] ; / / you have 17 pipes

JunctianData [16] ; / 1 sixteen naw Pump~eckValvData[3I; / / 3 now

?lotPrintout!lata; ConectionData; IndexData[ZOOI ;

Page 172: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / Ovezrides // ClassWizard generated virtual function overrides / / { ( A P X , V I K ~ (CFrontPageFormViewl protected: v i r t u a l void DoDataExchange(CDataEXchdnge~ pDX); / / DDX/DCV support v i r tua l BOOL PreCreateWhdow[CRUTESTRM:TL C S ) ;

/ / 1 ~AP]CVIRTOAL

/ / Imglementation protected:

virtual -CLrantPageFormView ( ) ; #ifdef -DEBUG

v i r t u a l void AssertValid t l const ; virtual void Dmp (CDumgCantexth dcl COU%;

#endi f

/ / m e r a t e c i message mag functians / / ( (AFX,MSG (CFrontPageForrnView) afxgisg void OnPipeLineParamLO; abcmg void onPipeLineParam2 [ 1 ; a-g void O ~ ~ e s e m x P a r a m l l ; afx_rnsg void OnSimulationParam( i ; a fx-mg vo id 0nJunc t i a n ~ a r d ( ) : a f x m g void afx_plsg void a f x m g void a f x m g void afx-msg void afx_rnsg void afx-mg void a fx-msg v~oid afx-nug void a f x m g voici ah-mg void

//({AFXJNSEXT,LOCA?IGN}} / / Microsoft Devela~er Szudio vil1 irsex ac!C:ional declaraticas L=&iatel.~ before the previous line.

Page 173: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / B CheckVa1ve.h: interface for the Checkvalve class. / / O author: Tianhe Wer, 1909 / / @ Version:2.O / / O Copyright: Ritepro Inc. / / @ Concordia University

tif JSC-VER >= 1000 tpragma once tendif / / JSC-VER >= 1000

#define KDIFECTTOT 1 #define KDIRECTSEAT 2 $define KDLRECTLNTERM 3 tdefine KDIRECTUZIT 4 #define DIRECTAW 5 tdefine KREVTOT 6 tdef ine KREVSEAT 7 #define KREVZNTERM 8 #define KREVEXIT 9 tdefine REVERSEAnM 10

tdef ine HAXWGLE 70

class Checkvalve

public: Checkvalve ( l ; vircual -CheckValve l ) ;

flaat fFLowTorcpe: float fDiscTorque; float fCTinPPorciue; float £TotalTorque; flcat fDiscAngularveiaci:y: float fDensity:

float fPipeDiameter;//Dt float f PipeAirea; floac fSeatDiameter; //D2 f loat f SeatArea; float EDiscDiamecer; / /DCL float fDiscArea: float fShaftOffSet;//DIs float fHingeLength;//ALA float ftiingeWidth;//2 . XD f loat fDis&iomentOf Inertia; 1 INN float EDiscWeight;//WV f loat EDiscCenterOfGravity; / / A X int iDiscMaxAngle;//TFIIAF float fDiscOfESetAnqle;//AETAV f loat fPipeFriction; flaat frxitinqûrif icei)iameter: f loat f IntermediateCrif iceDianecer; f loat EPipeToSeatR; floaç fIntarmediacËorificelK; float fEbùtingOrif icek;

Page 174: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

float fVa1veTocal.K; f loat fC'IWWeight; f loat ECTWLever ; float fCTWgle; f loat f c m 0 m ~ t O f Inertia; float f~pringkllUnitialAagie; f loat fSpringAnnlength; float fSpringPivot~hafaistance; float f~pringExtension; float fSpringExtensionFactor; float fRestedSpringLength; float fmtensionSpringTorque; float fCoilSpringFactor; / / Nm/o float fCoilSprFngInitia1Angle;//0 Cloat fCoilSpringTorque; //Filn

f loat f~oef f i c i e n t s ~ f R e s i s t a n c e [ ~ l [IO 1 ; f laat GeomeCricParameters ( f l0at) ; flaat DirectPlow(f1oat); f loat ReverseFlow ( ) ; f loat PTowTorque ( f loat, float , f loat l ; float DirectTorqueAm(int); float ~everseTorqueA.nn(int) ; f loat DiscTorque ( f loac) ; f loat CFrPTorqLte ( f loat ; float TorqueFromExtensionSgring(tioa:i; f loat TosqueFromCoilSpring ( f loat l ; float ValveDynamics ( f lca:, float, flcaci ; f loat ValveDynamics ( flcat, floac, Lloac, flaac) ; f laat GetDiscAngle ( 1 ; vcid checkValve1nic ( ftoat. int) ;

f loat GetCaeff iciencsCflesist~~ce ( ;

floac GecTotalTorque 1 float, f loati ; f loat GetValreFlow ( f loat, f laac, flcati ; n i d rkl(flcat *. floar,float,fioac -,floa:,Elcac ( * ) (flca:i,flca:[], flcz:

El, i n d ; f h a t R 3 4 (Eloac. f laac, f loat, float, f Ioat, f Ica:) ;

private: float mlscilnglelub;

Page 175: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / l / / / / l / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / l / / / / / / / / / / / / B Chi1dFrm.h : interface of the CChiIdFrame class / / @ author: T i e W e n , 1909 / / B Versi0a:P.O / / B Copyright: Ritepro Inc. / / @ Coacordia University

#praqma once #e?.dif / / JSCCVEK >= 1000

class CChiLdFrame : public (mDIChildWnd C

DECyLflE-DYNCFEATE ( CChi ldFrame 1 public :

CChildPrame ( 1 ;

/ I Attributes pub1 ic :

I / Operations public :

/ I fmpleneataticn public :

virtual -CChil&-rane ( ; iCifdef ,DESUG

virtual void irsser:Valid ( 1 co~s:: virtual voi5 C w (CZmpCanc&xth ec) cer,sr:

#endif

/ / Generated message map 2mccions protected:

/ I I IAFX-EG (CChildFrame) / / NOTE - he ClassUizazd wi l l a& and remove member functions

here. / / DO NOT EDIT what you see in these blacks of generat& code!

/ / 1 IAFX-KG DECLARE-MESSGEEMAP ( I

1 :

/ / E IAE'X-INSERT-WCATIONI 1 / / kficrosoft ~eve lopez Studio wi l l k e r z a&cional declarations immedia:ely before the previaus line.

Page 176: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / Q C0nectionPara.h : interface o f class / / Q author: Tianhe Wen, 1999 / / B Versioa:Z.O / / @ Copyxight: Ritepro fnc. / / @ Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

%if -MSC,VER >= 1000 tpragma once #endif / / -E(-jC-VER >= 1000 / / Canecti0nPara.h : header file

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / i / / / / / / / / / / / / / / / CConectionPara dialog

class CConectionPara : public CDialog t / / Construction public :

CConectionPara(C:JndT pParent = NULL); / / starrdard constlructo:

/ / Dialog Data / / ( (&.Y-DATA (CCcneccionPara) enum ( U3D = IDC,DLG,CONETCTION } : UTNT m-fNm*ige; UINT m,f NunJuc t ; UINT m-fNcmPumi~; UIm m-f Sumlzdex ; UINT m,nDowj?ipipe02 ; UïNT m-nDowJXpipe0 1 ; üINT m-nDowJNpipe0 3 ; UINT m-nDawZNpipeO4 ; UDJT m-nDowJXpipeOS; U Z m m~iDowJNpigeO6 ; üINT m-nDowJNpipe07 ; U m m-nDowJXpipe0 8 ; UINT m-nDowJNpipe0 9 ; U m m-nDowJNpipe1i.l; VINT m-nDowJNpipeL1; UIN'r m-nDowJNpipei2 ; UINT nl,nDowJNpipel3 ; UINT m~~DmJNpipe24 ;

DïNT m-nDowJNpipeT5 ; DINT m,aDawJNpipel6 ;

m-nDowJNpipei7 ; DINT m-nDowYNpipe18; U m iQnDowJNpipeT9 ; UrNT m-nDawJNpipe20 ; MNT m~DowJNpipe21; ûiîül? m_riDowJNpipe22 ; UINT m-nDawJNpipe23 ; DINT m-nDowJNpipe24 ; UINT III-nDowJNpipe25 ; D m m-rDowJNpipe26; tlZNT m-nDowJNpipe27 ;

Page 177: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

WINT m,nDowJNpipeZB; UINT m,nDoiJiJNpipeZ9: UINT m-oDowJNpipe30;

UINT f loat UINT UINT - UINT UINT UINT UINT UINT UINT OINT UINT UIN'r u m UINT OINT VINT UINT UIN'r UINT UINT UINT UINT UINT u m ri UZNT UINT u m OINT UINT //llAE

m-nlChReach; m-fSoundSpeed; m,nUpJNpipeOl; mm_nUpMpipeOl;nUpMpipe02; m-nUpJNpipe03; m-nUpJNpipe04; m-nUp3Np ipeO 5 ; in-nUpJNpipe06; 1~nUpJNpipeO7 ; m~nUpïNpipe08; mm,nUpJNpipeaS;nUpINpipe09 ; m-nUpJiUpipel0; mm,aUpJNgipelL;nUpJNBipelL; m-nUp&Vp igelt ; mm_nUp3Npiper3;nUpüNpipel 3 ; m-nUpJNpipel4 ; ~nUp3Npipel S ; m-nUpJNpipel6; ~nUplNpipel7; m-nUpTNpipel8 ; m-nUplNpipel9; m-nUpJNpipe20; m-nUpJNpipe21; m-nUpJNpipe22; m-nUpJNpipe23 ; m-nUpTNpipe24 ; m-nUpJXp ipe2 5 ; m-nUpJNp ipe2 6 ; m-nUpJNe ipe2 7 ; m-nUpJNp ipet E ; m-nUpJNpipet9; rn-nUpuI ipe3 O ;

x-DATA

/ / Overrides / / Classiiizazà generateë virrial fünction overrides / / { (AFX,VZRWAL ( CConectianParz~ protected: virtual void DoDataExchange{CDztaE;tchange* pDX); / / DDX/DDV supparl, / / 1 1 AEFX~mmArd

/ / lmplementation protected:

/ / Generated message nap Eunccions / / ( ( AE'X-MSG (~~onectiarr~aral'

/ / afx-msg void OnSutIn6exT ( 1 ; / / 1 1AE'X-EG DECZARECZAREMSsAG2-KAP ( 1

1;

/ / E CAl?X,INSERT~LOCXTIO~ 1 / / Microsof t Developez Studio will insert additional declarations imediately before the previous line.

Page 178: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / l / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / @ Cts1ValveDlg.h : interface oE class / / @ author: Tianhe Wen, 1999 / / @ Version:2.0 / / @ Copyright: Ritepro Tnc. / / @ Concordia University

#if JSC-VER >= LOO0 #pragma once #endif / / ,MçC-VER >= LOO0 / / CtrIValveD1g.h : header file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / CCtrlValveDlg dialog

class CCtrlValveDlg : public CDialaç E / / Construction public :

CCtrlValveDlg(CNndg parent = NCTLL); / / standard const,uctar

/ / Dialog Data / / [ [SX-DATA(CCtr1ValveDlgl enum ( IDD = IDD,DLG-CTIZL,V.~<vZ 1 ; f laac ~ E T a u l ; f loat m-fTau2 ; float m-fTau3 ; f loat m-fTauC : f loac m-fTau5 : float m-fTau6; f laat m-Eau7 ; long m-nTime; / / 1 I LFX-DATA

/ / Overrides / / ClassWizard qeneraced v i r c s l 5-xccicc cvetti&es / / f [AEX-VIXT'üX ( CCtzlValveDlc) protected: vittuaï void DoDataExchl~e (Ca:a3&ac~er pDX1; / / DDX/D!W support 1 / I ?AEX-VIXrn

/ / fmplementation pro tected:

/ / i iAF;CINSERTTLOCArrON} 1 / / Kicrosoft Developer Studia will insert additiollal declarations immediarely before the previaus line. #endif // !defined(AFXAFXCTRI;VALVED~G-E-76576583,COBD-llD2~B4E44OOAOC974979AA~WEDED1

Page 179: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / B D e f i n m a t a - h : interface of class / / Q author: Ti- WC?, 1999 / / B V e r s i o n : 2 . 0 / / @ C o p y r i g h t : R i t e p r o Inc. / / B C o n c o r d i a U n i v e r s i t y / / / / 1 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ~ / / / / / ' / / ~ / / / /

# ifndef DEFINEDDAT9.H # d e f i n e DEFINEI3DATA-H

typedef struct I Élaat fKeadR1; f Lou t fïieaadRS ; f l o a t fEeadR3; float faeadR4;

1 RESERVIOR-DATA ;

typedef struct ( float fTau[7] ; in t nTime:

1 CONTROL-VALVE-DATA;

typedef s t ruc t ( f l o a t fStartTime; f loat f S t o p T i m e ;

) SïXJïATICN-DATA ;

UINT E P r i n t o u t ? i p e t ; DINT EPrintoutPipe7; USNT f Printout3ipe3 ; U ï N T fPrintcut3unl; UINT f P r i n c o u c J u n 2 ; VINT fPrlntaucJun3 :

) PLOT-PRINTOUT-DATA;

typedef srruct ( UINT nNimiP i p e ;

UINT n N W ~ ? c t ; UINT mrmipump; UINT nNtmmdex; UINT nMih5each; f l a a t f Saunàçpeeü;

/ / int f I n d e u 1 2 0 0 I ; UZNT niJpJNPipe[QOl; UïNT nDwJNPipe [ 40 1 ;

} CONECTION-DATA;

typedef strict [

Page 180: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

typedef strucr ( f l o a t flliaxueter; f l o a t f t r i c t i o a ; f l a a t flenqth;

1 PIPE-LIUS,DATA;

typedef struct ( int nJunayyie; Eloat fElevacion; float fFlow; f l o a t fHead;

typedef s t r u c t ( int nPumpStatus; int ruliameter;

/ / s t a r tup , f a i l , noraal, stop / / always e f fec t ive , it is O hased index, it is noc

the r e a l diameter value //you se lec ted , bu t it is the posi t ion, s t a r t i n g £rom O , t h i s i s

t rue / / f o r the specified speecï a l sa

int nCheckvalve; f l o a t EAO; / / e f f ec t ive on s t a r tup f l o a t W; / / .............. f l o a t fA2; 1 1 . ............... f l o a t fEs; / / .............. f l o a t fTs; / / .................. f l o a t ff low; / / e f f ec t ive CR f a i l f l o a t fsead; / / ..................... f l o a t fTcrq; / / .................. f l o a t fspeed;

.............. i n t nSpecifiedSpeed; / / f l o a t fNo-malil0 ; / / e f f e r z k e c?, nornal floa: fNonialAl; f l o a t LirlcmalXZ;

1 m ~ c ~ ~ c K - ~ A L v E - ~ A T A ;

Page 181: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / Q Cr0ntWnd.h : interface cf cLass / / B author: Tianhe Wen, 1999 / / 4 Version:S.O / / Q Copyright: Ritepro Inc. / / @ Concordia University / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / l / / / / / / / / l / / / / / / ~ / / / / / / / / / / / / / /

#if JSC-VER >= 1000 #pragma ance #endif / / ,WC-VER >= LOOO / / Fr0ntWnd.h : header file / /

class CFroncWnd : public CWnd i / / Cons tructian public:

CFrontWnd ( ) ;

/ / Attributes pcblic :

/ / Operations public:

/ / Imglemeïtation public:

virtual -CFrcncWnâ ( 1 ;

/ / Generated message nap fuccions protected:

/ / ( iAFXXMSG (CFrontWndl afxmsg void OnPaFnt i ; / / 1 1AFX-MSG

1 / ( (&~-INSE3iTTLOCATION1 I / / Microsaf t Developer Stuc?ic w i l l inser t aocitianal 6eclaratians imediateLy before the previous line.

Page 182: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /~ / / / / / / / / / / / B HydroAnaiysis.h: main header f i l e for the HYDRûiWXYSIS application / / 4 author: Tianhe W e n , 1999 / / B Version:2.0 / / B Capyriqht: Ritepro ïnc. / / 4 Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

# i fnde f -AFXWINX- terror include 'scdafx.hl before ZDcluding this f i l e for PCI!

fiendi f

#inchde 'resource.hR / / main syaibols

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / CHydroAnalysisApp: 11 See HydroAnalysis.qp fcr the Mlenentaticn of tk i s class / /

//EEAFX-MSG(CE.:yCrcilnalysisApp) a f x s g void d~ppithout i ) ; / / NOTE - the ClassWiaard w i l l aOd. anà remove nember functions here. / / üû NOT EDIT w h t you seo in these blocks of generated ccde !

/ / ) l r n - M S G DECLARE~SSAGE-MaP ( 1

1;

/ / ( (ilFXilFXINSERTTLOCA?raM) 1 / / Microsoft Developcr Studio w i l l inser: a w t i o n a l &darations imte6iately before the previous l ine .

Page 183: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / // @ HydroAnalysisDoc,h : interface of the CRydroAnalysisDac class / / B author: Tianhe W e n , 1999 / / B Version:2.0 / / B Copyright: Ritepro Inc. / / 8 Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #if !de fin& (AFX,h~RO~YSIÇDOCÇDOCHHB66D4D61I49D1~1TD33BD3IIOOEO291l2S677LNCLUD~ -1 #define APX-~ROANALYsIÇWCÇWCEE366D4D61-49Dl-11D3,BD3I-OOEO2911S567-IN~ISD~

#if _MSC,VER >= 1000 Cpragma once #endif / / -MSC-VER >= 1000

elass ~~ydroiînalysisCoc : public CDocument C protected: / / create f r o m sezialization only

CIiydrodnalysisDacO; DECLAflZ-DYNGEATE (CEyàroanalysisDcc)

/ / Attributes pub1 ic :

/ / Operations public :

/ / Implementation public:

virtual -CEyeoAialy s isDx i 1 ; #ifdef -DEBUG

viztual void AssertValid() const; virtual void Dump (CuumpConcext& dc) cccsc:

#endi f

Page 184: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / B KydroAnalysisView-h : in te r face of the CEIydraAnalysisView c l a s s / / @ auchor: Tianhe Wen, 1999 / / @ Venion:2.0 / / B Copyright : Ritepro Inc. / / O Concordia University 1 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / I / / / / / l / / / / / / / ~ / / f / / / / / / / / / / / / / / / /

t i f -FISC-VEX >= 1000 ltpragma once #endif / / JSC-VER >= 1000

class CtiydrohnalysisView : public CView c protected: / / a e a t e Eram ser ia l izac ion oaly

CHydroAnalysisView i ; DECLARE-DYNCRZATE ( CEydroAnalysisView)

/ / Att r ibutes publ ic :

CIiydroAnalysisCocr GetTroCun@IItO;

/ 1 Opera t ions publ ic :

/ / Overrides / / Class!.lizard gerieraced vir t r ta l fucc-icn averr ides / / ( (~Fx-nnTuX (C5:rCroiinalysisVlew) public : v i r t u a l vc io CrSraw(C.C' p K ) ; I l ove-~i66er? :G &aw :Lis viod v i r t u a l =COL ?reCreateWindcwiWTES~ECT& CS) ; protected: v i r tuaf =COL ~n~repare?rinting(CPri~:I?.fc* pIn fe ) ; v i r t u a l voLd OrSegin?rinting(C=C' p K , ClrintIafo ' pf?fc) ; v i r t u a l void OrSndFrintinq (CD? PCC, Clr intInf or pxnfo) ; / / 1 1 A F L r n T d

/ / ïmplemenration public:

v i r t u a l ayc?roAnalysis~iewO; # i fdef -DESOG

v i r cua l voici as se r tVa l id0 const; vf rtual void Ctmg (CIXrmpC~nt~th dc) cars t ;

àendi f

/ / Generateci message map funccians procecced: .

/ / E CkLCJfSG iCSy&aAnalysisView) / / NOlZ - the ClassWizard w i l l a& axà remove member functioas h=e. / I DO NOT EDST w h t you see in these blocks of generated code ! / / 1 )AEX-EiG D E C L À R E C L À R E ~ ~ G E ~ ~ ( )

1;

Page 185: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

#i£ndef JEBUG / / debug version in EydroAnalysisView.cpp inl ina MydroAnalysisD4c8 CEydroAnalysisView: :GetDocument (

( seturn (CHydroAnalysisDac*lmqDacument; 1 #euclif

/ / ( {Am,INSERT,LOCXTXON) 1 / / Wcrosoft Developer Studio will insert additional declarations immediately before the previous line.

Page 186: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ ïndexPazaJ1g.h : header file / / Q aa tbr : Tlanhe Werr, 1999 / / O Version:2.0 / / B Copyright: Ritepro fnc. / / @ concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

#if ! def in&(APX,f?IDEX,~ARAARADLGARABB3OEFC8E22~C66L1D2~986A~4445~354OOOOOLYC5~~~~ èdefine AFX,~EXP~~DLGBOEFCBU,E3C6~?lD2,9~6L4445535400OO,LWLVC~~

#if ,üSC-VER s= 1000 #pragma once Rendif / / 3 C - V E R .= 1000

class C1adwara-DTg : public CDiaLog I / / constructicn public :

CIndexoara-Dlg [ mad* pParent = KXL) ; / I s t a n u d conçrructor

Page 187: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

i n t i n t int int int int i n t int int int int i n t blt int int int int

/ / ûuerrides / / Classwizard çenerateù virtual f u ~ c r i o n averrides / / ( (UX-VIITUAL (CIndexPara-Dlg 1 procected : virtual VOL& DaDataExcbge(CE)at&ck~qe* pDX); I l DDX/DDV support I l 1 } L=X_VTn?uAL

/ / Implementatian protecced:

before fie previous IFae.

Page 188: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / B Junction1Dlq.h : header f i l e / / @ author : Tianiïe \ien. 1999 / / I Versi0n:l.O / / @ Copyright: Ritapro Inc. / / @ - Ccncordia Univers i ty / / / / / / / / / / / / / / / / / / / / / l / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / f / / / / / / / / / / / / / /

# i f ,MSCCVER >= 1000 #pragma once #endif / / -MSC,VZ3 >= 1000 / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / CJunctioniDlg d ia log

class CJunctionlDlc : p u b l i c W i a l o g f / 1 Const-qction pub1 i c :

CJunctioni31ciCnlndo pParent = NOLL); / / s tandard ccns:zuc:or

/ / Dialog Data / / ( (AFX,D;iT: (CJunctionlDlg) equm f IDD = IDD-DLG-JlJNCTIONI }; EOOL m-Kbeckl : BQOL m-Kkeck2 ; EOOL m-Kkeck3 ; EOOL m-tCkeck4; ECOL m-tCheck5 ; EQOL ut-kCkeck6 ; BOOL m-kCkeck7 ; EOGL m-kCkeck8 ;

f loar m-fZlcr2 ; f l o a t m-fEle7r4; f l o a t m-fELevrS ; f l o a t m-fZe~r6; f l o a t m-fsf ov7 ; f l o a t m,f-rov% ; f l o a c m,f?lctrt: f l o a t m-fllcut ; f l o a t m-fFlcsr3 : f l o a t m-fFlcr4; f l o a t m-fr'lcu5 : f l o a t m-fFlor6; f l o a t m,f?lcr7; f l o a t m,f?lcr8 ; f l o a t rn,&*esci,l; f l o a t rn_Leac;3; f l o a t rn-fEez3 ; f l o a t s_LXeac',4 ; f l o a t m-EeaCJ ; f l o a t m-fEea56 ; f l o a t m-fuea57 7;

f l o a t m-fueaE2 ; //}}AFX,DATA

Page 189: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / Overrides / / ClçssWizard genezated virtua!. fwction cver-rides / / ( (MX-VIRTüAL (CJunctionlDlg) protected: virtual void DaDataExchangeiCDataExchaaqe* pDX1; / / DDX/DDV support / / 1 JAFX-rnTlJilL

/ / lmplementation protected:

/ / Geaerateü message map funccions / / t C~X,~G(CJunctianlDlgl

/ / NOTE: the ClassWizard will add m e m b e r functions here / / 1 Irn-MSG DECr;;\RE-KESSXGEEP139 [

1;

/ / ( (Li%-INSERT-LOCATION) 1 / / Mierosoft Developer Studio will insert additional declaracians intmediarely before tke previous line.

Page 190: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

c l a s s CMainFrame : public ~IPraxieWnd C

DECURE-DYNXMC ( WinFrane) public:

CHainFrame ( 1 ;

/ / Atvihu tes public: / / Operations public: / / Ove- ides

/ / ClassWizarc! ~ezeraced vi r tual cCwcticn cverrides / / [ (LFX-VIR?'UX IC2~ir,fr~v I v i r t u a l EOOL P:oCreateWinEow[~TFSTaUCT& CS) ;

/ / ) 1 &Y-VIBTUX / / Impleztencation public:

v i r t u a l -Ch(!infrane ( 1 : #Ffdef -DESUG

v i r t u a l voic! &ser:ValidO cocsc; v i r t u a l voie Gmp (CDurpconceut& dc) cons:;

#endif

protected: / / conczo~ bar &edCed m e e r s CStatusBar mJmdStatusEar: CToolSar m-wiaTocl9ar;

/ / Generated message map functions protected:

I I ( {~MSG(îXai r~Frane) ah-msg i n t OnCreate iL2CEATESTXTICT lpCreateSlxxt ) ;

/ / NOTE - the ClassWizazà w i l i add acld r m v e member functians heze. / / Dû NOT D I T w h t you see in these blocks of geceraced code! / / 1 1X'LFSG

DEaARE-MESSAG"s"sMX~ ( 1 private:

CFrontWnd* mgFrontWnd; 1; / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / I I f / I / / I / / / / / / / / / / / ~ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ( ~ k o X _ r n ~ T T L O W T I O N I 1 / / Kicrosoft Developer Studio w i L L iasert additional declara t ims imme&iateLy before the previous l ine.

Page 191: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / B Pipe-b: i n t e r f ace f o r the Pipe c lass . / / B author: Tianhe Wen, 1999 / / @ Version:Z.O / / @ Copyright: Ritepro Inc. / / @ Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

#define P I 3.1415427 Wdef ine DEGTOEWD 0 .Ol74533 Wdefine Ri\I3TODEG S7.2957?

class Pipe [ public:

Pipe(}; virrual -?ipe I ) ;

v o i s PipeInit(inc, inc , inc , f loac , f l o a t [ I , floa'c[I, floatil , int[l. i n t [ I ) ;

void PipoTuncF-Ei inci ; fLoat PipaluncEead ( 1 ;

vaid ValveDownF-a( f l o a t , i n t , const f l oa t [ l , f loat . Elaatl ; vair2 ValveTauDowEf( f l o a t , f l o a t , i n t , const f k a t (1, floac. f l o a t . f loac. f loa t l ;

f k a t PrmrpJunc ( 1 ; void ResvLQF-iiI: f l o a t ) ; f Loat ~eNo~EZead( f l o a t l ; f l c a t GetPlawliat) ; f l o a t GecEeadlintl ; void Refniriaiize( iati ; f l o a t TimeStep i 1 ;

Page 192: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

priva te : fLoat Q [NumRea&+l1: f loat H[NmReach+ll: f loat QpCNumRea~h+ll; float Hp[NumReach+ll:

Page 193: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ PipelD1g.h : header f i l e / / B author: Tianhe Wen, 1999 / / B Versioa:2.0 / / B Copyright: Ritepro Lnc. / / B Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

t i f -M!àC,VER >= 1000 tpraçma once lendi f II ,MÇc-m >= 1000 / / / /

class CPipeLDLg : public CDialag t / / Construction publ ic :

CPipelDlg(C:Jno* pParent = NCiLL) ; / / star.&rd canst,ruc:or

/ / Dialog Data / / ( (AEC-DATA (CPipelDlg) enum ( I 3 D = TDD,DLG,PIPI-LINEI 1: f l o a t m-EDianecerl : f l o a t m-fDiameter2 ; f l o a t m-fDiametez3 ; f l o a t ~n-fDianeter4; f l a a t m-fDiuecer5; f l o a t m-fDiamecer6: f l o a t m-fDiameter7 ; f l o a t m-fDiameter8 ; f l o a t m-fDianeter9 ; f l a a t n-fCr Lc=ienl; f l o a t ~ f i r i c c i o n 2 ; f l o a t m-fFriccion3 : f l o a t m,ffrFction4 ; f l o a t m-fFriccion5 ; f l o a t m-fYrfctian6; f l o a t m-ffrictionf ; f l a a t mJFricCion8 ; f l o a t xi-fFriction9 : f l o a t m-f L=çthl; f l o a t m-fLer,gthS; f l o a t m-fLerrgbch3 ; f l o a t ILI-ELegth4; f l o a t m-f Length5 ; f l o a t ntflengdr6; f l o a t m-ELezgth7; f l o a t m-Uezgth8 ; f l o a t m-flagth9 ; / / 1 )ilFX-DATA

;/ Overrides / / Classiiizazd generated v i r t u a l function overr ides

Page 194: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / [ f A t X I V f R ~ (CPipelDlgi pratected: virtual void DoData~xchange(CDataExdiaage* pDX1; / / DDX/DOV support / / 1 } .L%-VIRrn

/ / ïmplementation pro tected:

/ / Gaerated message map functions / / ( (.L=X-KSG (CPipelDlg) / / NOTE: the ClassWizard will add m e r n b e r functions here / / 1 l m - M Ç G DECLx_HEçSÀGEEW ( 1

1 :

/ / { (AFXJNSZ3T-LûCATION) ) / / Kicrasofc Develo~er Studio will insert addicional dechrations ixmtediately before the ~reviaus lhe.

Page 195: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ PigeNet2Cv.h: i n t e r f a c e f o r t he PipeNet2Cv class. / / @ author: Tianhe Wen, 1999 / / @ Version:2.0 / / @ Copyright: Ritepro fnc. / / @ Concordia Universi ty / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / l / / / / / / / / / / / / / / / / / f

# i f -MSC-VER >= 1000 lpragma once liendif / / ,kf!iC-VER >= 1000

Wdefine NtmiJ 20 Wdefine NirmP 20 Wdefine NZND 200 Wdefine KM 11

t inc lude *PmpStart . hg t inc lude 'CheckVa1ve.h"

c l a s s P i p e V e t X v : publ ie Pipe, publ ic PumpStarr, publ ic CheckValve

i public:

PipeXetXvi ; v i r t u a i -PipeNetXv ( ;

PipeNetetlCv(int, i n t [ ] . inc, i n t , i n t , i z t , Éloat, f l o a t [ ] . Éloat[J ,flcat [ ] , i n t [ I , i n t [ I , f l o a t l l , f l oac [ I , E ioa t [ J , i n t [ I , f l o a t , i n t , f 1aa t , f k a t , floa:, f l o a t ) ;

void Initial?-E ( i n t 1 ; void PipeJuncP-H(int,int); void PrrmpJuncF-H( flaat, int) ; void PumpfuncF-H(float, i n c , f l o a t ) ;

f l a a t Ge=(int) : f l a a t GetQN(int1; f l o a t -=t int , i n t ) ; f l o a t GetQiint , in t ) ; f l o a t Z[NrmtJI,CN[NdI .BN[N&] ,QE[N&+L],m[NIM)]; f l o a t CC[NWI [10] , E C [ W ] [ l a ] ; i n t Ntype[NumJI IF^ [NumJI ;

Page 196: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ PipeNet2NoCv.h: interface for the PipeNet2NoCv class. / / @ author: Tianhe Wen, 1999 / / 8 Version:2.0 / / 8 Copyright: Ritepro Inc. / / 8 Concordia University 11 / / / / / / / / / / / / / / / / / l / / I / / / / / / / / / / / / / / / I / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /

#if -SC-VER >= 1000 tpragma once #endif / / JSC-VER >= 1000 ldefine NumJ 20 ldefine N W 20 #define NIND 200 ldefine EM 11

class PipeVet2NoCv : public Pipe , public PumpSta:: { public :

PipeNecZNcCv i ;

Page 197: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / @ PlotPrincoutDlg.h : header file / / @ author: Tinnhe Wen, 1999 / / e Version:2.0 / / @ Copyright: Ritepro Inc. / / @ Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #if !deEined(AFXAFXPMTPRINTOUTDLGPKBS~SL888EO97711D2~986A,44455354OOOOOIMUUDEDED 1

#if ,MX-VER >= 1000 #pragma once Rendif / / -üSC,VER >= 1000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / PLo tPrintoutDlg dialog

class PlotPrintoutDlg : public CDialog ( / / Construction public :

PTotPrintoutDlg(CWnd* pParenc = NILLI; / / standard constructor

/ / Dialog Data / / ( (m-MTA(PlotPr i r r toutD1g) enum ( IDD = IDD-DLG-PLOTDLG 1; UINT m-fPlotJunNum; UINT m-fPiotPipeNum; UINT m-f PrintoutPigel; UINT m-fPrincoutPipe?; UXNT m-fPrintauc~ipe3 ; U f m m-f PrintaurJun2 : üîNT m-fPrintoucjun1; UINT nt-f PrintaucJun3 : / / ) }=-DATA

/ / Ove-rides / / ClassWizard generatd virtual fuocciao averrides / / ( (AFLVIRlWAL iPlotPrintoutDlg1 protecred: v;Lrtual void DoDataZxchançe (CData%ckattgeW pDX) ; / / DDX/DDV support / / l I A E ' X ~ v I a m

/ / ïm?lementation protected:

/ / Generaced message map furicticns / / ( (AFX-ESG(PlotPrintoutOLgl / / NOTE: the C l a s s W i ~ a ~ will add nesker functions here / / 1 lAFXAFXMsG DECLiLPEPEEESSAGEGEW { )

1 :

/ / I CLFXXIN!5ERTTLOCATION) } / / Kicosoft Developer Studio wFLl inset a&tional declarations immediately before the previous line.

Page 198: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ himpCheckValveD1g.h : header file / / @ author: Tianhe Wen. L999 / / B Version:2.0 / / B Copyright: Ritepra Inc. / / B Concardia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

#if -MSCCVER >= 1000 lgragma once #endif / / -MSC-VER >= LOO0 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ! / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / ChrmpCheckValveIllg d ia log

class CmÿapCheckValveDlq : public CDialoç ( 11 Cons cruet ion pub1 ic :

CPunqCheckVaLve9lg (Cd~d* pPkrerit = NüLL) ; / f staxiar6 c c n s t v c t o r

/ / Dialog Data / / { [AFX-DATA (CFunpCheckValve9lg) enum { IDD = IDD-DLG-PUYS-CEiECK-~nLVZ > : CComboBax n-Lis t S p e M ; CComboBox m-ListSpeeë?; CComùoBox p-ListSpeedl; CComboBox nJistDianeter3 ;

f l o a t m,f!!sPrnip3 ; Eloat m-fFlawPumpL ; f l o a t ~~fFlowPmrtp2 ;

f l o a t ri-fTlowPlmtp3 ; f l o a t m - f a e a d h n p l ; f l o a t m-fgeadPimrp2 ; f l o a t m-fgeadhrmp3 ; f l o a t m - f S p e e d 2 t m p l ; f l o a t m-fSpeecfPrmip2 : f l o a t m-fSpeeaPtmp3 ; f l u a t ~fTorqPimrgt ; f l o a t m-fTorq-Srmp2; f l o a t m-fTorqPuaip3 ; Eloat m-fTsPtrmp1; f l o a t mJTsPurnp2 ; f l o a t m-ETsPimrpi ; f l a a t m-fEump2AO ; f l o a t m-fEump3AO;

Page 199: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

f l o a t m-fPumpZAt: f l o a t ~ f P u m p 3 A l ; f l o a t 1q_f?mp2A2 ; f l o a t m,f3ump3XZ ; f l o a t m-fhÿnp2NorXO ; f l o a t m-fhmrp3NorAO ; f l o a t ~q_fPumpZNorAl; f l o a t nt-fh~ip3NorAl: f l o a t m-fPump2NorA2 ; f l o a t m-fFump3NorA2 ; i n t ~ n m t m p l s t a t u s ; iac ~nPMip2Sta tus ; inc m-nPump3Status; BOOL mJNoCheckValve ; / / 1 1 AFX-MTA

/ / Ovezides / / ClassWizard generated v i r t u a l fmc t ion overrides //{(m-WRTn;lL(CPumpcheckValveDlg1 protected: v k t u a l void DoDacaExchange(çDataExchange* pDX1; / / DDXIDDV support / / } }AFX-VIRTtTAL

public:

/ / i n d ~ ~ fo r the diameter, and speed i n t m-nS~eed3 ; inc m-nSpeed2 ; in t m-nspeedl ; i n t m-nDimeter3 ; Lac n-rLiianecer2 ; i r r t m-nDimecerl;

Page 200: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

void void void void void void vo id VQ i d

1;

ShovFaiiWndPl( BOdL bShow = TRDE); çbouÇtartupWndP2 ( BOOL bShow = TRUE) ; ShawNormalWndP2 ( B W L bShow = TRUE) ; ShowPailWndPZ( BoOL bShow = TRUE) ; ShowStaxtupWndP3( BOOL bShow = TRUE); ShowNormalWndP3 ( BWL bShow = l'RUE) ; ShowFailWndP3( BOOL bShow = TRUE); ShowCZieckvalvelWnd(5WL bShow ='l!RUE);

/ / { {AFX,INÇERTTLûCATION) 1 / / Piicrosoft Developer Studio will insert additional declarations ixnmediatefy befare the previous line.

llendif / / !&fined(~-~~C~VEDLGGHH76S765B44COBDBDIID2J4Z44OOAOC974979AALNCLm3E

D-1

Page 201: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / Q PrrnrpPail-h: in ter face for the P q F a i l elass- / / Q author: Tiaahe W e n , 1999 / / @ Varsian:Z.O / / @ Copyright: Ritepro Inc. / / B Concardia University / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / f / / / / / / / / / / / / / / / / / / / / / / / / / / /

class PlrmpFail I public :

PumpFail(1; h m i p f a i l ( intl ; virtual -PmpFailO;

public:

float A, XL, EL. D. F, CB.EZ(,TR.LV.HiL3, G.T.I.T3L.VZ.R.B,A~,~://V float DX,VO,VOO,i150,ZOO.DT,BETA,B~TO; float WHi891,WB[B91 .Q[SI , I ! [SI ,F!ptSI,PF~SI; i n t N,KIT, KMAX;

void PipeJHQ (int ; void PrmrpValve3C ( int i : vaid ~owcstzeanResoiv( f h a c , int ) ; void ReInitialize(Fnt1;

double Intezpclacec~falue (double, Fnc. h t ) ;

Page 202: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / @ hmigStk-t-D: interface f c r t k e PmpStart class. / / @ author: Tianhe W e n , 1999 / / e Version:2.0 / / B Copyright: Ritepro Inc. / / @ Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

# i f ,M!àC-VER >= LOO0 Bpragma once Bendif / / ,MSc_VEEC >= 1000

class PumpStart { public:

PumgStart Il ;

virtual -PumpStartO; void PumpStartInit ( Eloat, f laat, float, f lcat . i n t , int) ;

int Jpumg; f loat XS,AI,AZ.Ts;

Page 203: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / Q ReserviorD1q.h : header f i l e / / @ autior: Tiarihe Wen. 1999 / / @ Version:2-0 / / @ Copyright: Ritepro ïnc. / / e Concordia University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # i f !defined(AFX_KEç~~ORDLG~RR765765822COBDDlID2~4E4QOOAOC974979Ai\INCLUDWED) #define Anr,REç~~ORDLG-Kn76576582~CO9D9D1~22A4E4QOOAOC974979AAINCLUDED~

# i f -MSC,ïEX >= 1000 #pragma once lendif / / ,MSCCtZX >= 1000 / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / CRese-tviorDlq d ia lag

c l a s s CReservior3lg : public CDialog C / / Cons:,uction publie:

CXese,-vicrXg (C!Jndm pParenz = NULLI ; // s:ar.&xd consc-mcccr

/ / Dialcg Data / / ( (A=XJATX ICRese-~l0rDlg1 erium ( IDD = IDD-DLG,RES"aVOIR 1; Éloac m-fEieadi ; f l o a t rn-fSead2 ; f l o a t m-fSead3 ; f l a a c m-fEfead4 : / / ) 1 MX-EXX

/ / Overrides / / Class:iFzarC çezezatecf v i r t u a l functicr, overrides //((ÀFX,E-?~(CReserviorDlg) ~roree tec i : virtua' vcid DoDataExchange (CDataExùlancer pDX) ; / / DDX/DDV sugpcrr / / 1 1 &-x-mmAL

/ / Iatplenentaticn pro tected:

/ / Gerieraze4 message map functions / / ( ( k i - X S G (CReserviorDlgi / / NOTE: cke ClassWizard w i l l a& meaber functions here / / 1 ) iLfXJEG DEU;AREU;AREESSAGEGEKAP ( 1

1;

/ / ( (xC-INSEi(TTLCCATION1 1 / / K i c o s o f t Developer Studio w i l l inser: a d f i t i c m l declaracions inmieciiately before cke prevLous Une .

Page 204: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / / / r / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / P SimulatiouD1g.h : header file / / @ author: Tianhe Wen, 1999 / / Q Versi0n:Z.O / / @ Copyright: Ritepro Inc. / / B coacor&ia University / / / / / / / / / / j / l / / / / / ~ / / / / / / / / / / / / / r / / / / r / / / / / r / / r / / / / / / / / / ~ / / / / / / / / / / / / / / / #if !defiaed(~S~TIONtiLGLGRRDC9H7C92~CODl,llD2~4E4~OOAOC974979A~WctIJD~~) #&fine APX_S~TIONDT;GT;GRRDC9B7C921CODlIllD2-A4E4-OOAOC97499A,~NCL~~-

class CSimularionDlg : public COialoç i / / Consuuctian public:

CSimuLacicnDlg(Cdndl pParenc = NCTLLI; / / standardconstructor

/ / Ove--riees / / Classwi=azd generated virtital funceion a v ~ z i d e s / ( [MX-VInTUAL (CSimulacianDlql

protected: vircual voiü DoDataExcharrge(CDataExchango* pDX); / / DDXfCDV support / / 1 I MX-ViXTüAL

/ / Implenentatian protected:

Page 205: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / B HyàrcGraphic.h : main header f i l e for the BYflRM;IIAPHIC application / / @ Author: Tianhe Wen, 1999 / / @ Version: 1 . 5 // @ Copyright: Ritepro Ine. / / @ Concordian University / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

# i fnde f -AFXWïN-R- #error include ' sc2iifx.h' becore including this f i l e f c r E

tendif

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / f / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / MydraGraphicApp : / / See Hydr-oGraphic .cpp for the implene3cacion of t h i s c l a s s

class (JiybtoGraphicApp : ~uhlic Cdi~App I p&l ic :

EydroGraahFcApp ( I ; public : - EDATA m-hhtai ; / / &ta sec bmxiles

D A T A ~ h D a t a 2 ; real type rXeWa1s [ 8 1 ;

/ / Ovezzides / / ClassWFzard gezeracecl virtual f n c t i c n cverrides / / ( CAFX-VI,?TETIU; (CSydroGraghicApp 1 public: v i r t w l BOOL InitInst=ce ( ;

/ / } ) A E L v n r n

/ / Implernencation / / [ [AFX-Hsu ((ItfydraGraphicApp) a f x ~ g void OnAppAbout i ; / / NOTE - the ClassWizkrd w i l l a&? and remve m m b e z furrctions here. / / DO NOT EDIT w h t ycu s e e i?? these blockç o f generated cc6e !

/ I l lmAFX= DECLAREECLAREMESSAGEMESKAP ( )

1 : / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / i / / / / / / ~ / l / / / l / / /

before the previous l ine ,

Page 206: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / t3 Hy&oGraphicDoc.h : in te r face of the CHydroGraphicDoc c l a s s / / e Author: Tianhe Wen, 1999 / / B Version: 1.5 / / Q Copyright: Ritepro Inc. / / @ Concordian University

# i f ,MSC,VER >= 1000 Ypragma once #endif / / -USC,VER >= 1000

c l a s s CHy6roGraphicDoc : public Cilocinnent I protected: / / creace from se r i a l i za t i on only

CHydroGraphicDoc i 1 ; DECLARE-DYNGEATE (CE*ydroGraphicDoc 1

/ / Att r ibutes public :

/ / Operations pub1 ic :

/ / Overrides / / Class%i:ard ger.erated v i r m a l functicn o v ~ z z i 0 e s / / ( (X~lt2VInTTJiJ; (CuyckcGraphic9cci public: v i r t u a l void S e r i a l i ~ e ( C ~ c 3 i v e Ç a r ) : / / 1 1 xx-vrnma

/ / Implene!,?tacion gublic:

v i r t u r l -Cs:yùzoGraphic9ac ( ) ; t i f de f -DESUC

v i r t u a l void Assertval id0 cor.st; v i r t u a l vcid Durm(cDumpContextL dc) cons:;

B-dif

Page 207: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / / / i3 HydroGraphicView.h : i n t e r f ace of the CHydraGraphicView c l a s s / / @ Author: Tianhe Wen, 1999 / / @ Version: 1.5 / / e Copyright: Ritepro Inc. / / 0 Concordian University / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / f / / / / / / / /

/ / def ine graph c l a s s based on BaseGraph ...........................................................................

c l a s s Graphs : public QCBaseGraph I public: / / construccor

Graphs (int nNun) ; PGnXPE-DEF m-~DynGrDesc; / / pointer to pragk descrlgcor

PGRXPfiDEF msStaGrDesc ;

i nc rn-nGraphNurnber; / / graph n&er i n Fage

c l a s s Pape1 : ~iYlic CCsaseFaçe r praceere&:

vistual vaid Buildoage (??XEJE); / / user f-r.c=ion i n i t i a l i z i n ç Faqe p u h l i c :

Gra~hs. mçGraphl; Grapns* m-pGrap'r.2;

c l a s s EydroGraphicView r pub l ic CView I pratecced: / / creace f t c m s e r i a l i z a t i o n only

CEiydraGzaphicView ( ) ; DEFI-CYXXATE (CnydroGraphicView)

procected: Pagel *m-pgl; / / poin ter t o the pace objecc Pagel ' rn~Pg2; PFAGE-DEI mgEaq&esc;

PFPGE-DEF m~PageDesc2 ;

Page 208: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

/ / Attributes public:

CEIyüroGraphicDoc* GetDocument [ ) ; \

/ / Operations public :

/ / Overrides / / ClassWizard gezzeraced virtual function overrides //((Am-VIRTOXLi(3iyaZroGraphicView) public : virtual void OaDraw(CDCT pK); 11 overridderi CO draw this view virtual void OnInicialüpdate[void); virtual BWL PretreateWindow(CREXTfSTflUCT& CS); protected: virtual BWL OnPreparePrintiq(CPrintInfo* pInfo); virtual void OnBeginPriating(CDC1 pDC, CPrincInfo* pInfo); virtual void OnEndPrincing(CDC1 pK, CFrinrInfo* phfoi; virtual void GnPrinc (CD? p K , CPrintInfo* pInfa) ; / / ) ) ~ V I R T O A L

/ / fmplenentation public :

virtual -CIiydroGraphicView~ ) ; #ifdef ,DEBUG

virtual void AssercValidi) consc; vircual voic? Dm? (COumpConce-~cs cic) const:

Xendi f

protected:

/ / Generated messaçe nat: fÿr.c:ions prctecceà:

/ / ( (XEII,MSG (C9icizcGraphicVFer) afx-msg vcid CnSire(U1XT nFGe. i / /afx-msç vcil OnFileSat-e i) ; 11 1 ) ~ , M E G DECLÀR,t-MESSAGE - w (

private : Oiecc m,rc?riz',5ec::

l ;

#ifndef ,DrSUG / 1 Cehg vers i c n iri EydrcGrapBicr~iew. cw inline OiydroGraphic3oc* CydroGraphicView::CeflocmntO

{ r e c m (wcGrapilicDoc*) m-oEacmenc; 1 #endif

/ / / / / / / / / / / / / / / / / / / : / 1 / / 1 / / / / / / / / / 1 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / : / / / / 1 / ( (Ans_INSzRT,LOCATION) } / / Micrasoft Devetoper Studio will fnserc additional declaracions iamiediately before the previous lke.

#endif / / !def ined (i\FX,RYDR~rrRPfrI:CV12fJJBBFE3025~-4682211D3~HD 1,00E029T12567-IXLiTDD -)

Page 209: NOTE TO USERS - Library and Archives Canadacollectionscanada.gc.ca/obj/s4/f2/dsk3/ftp05/MQ64071.pdfrnodel and simutate pipeline netwark systerns with check valves. The application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / / / / 4 HainPnn-h : interface of the CXainFrauie class / / @ Author: Tianhe W e n , 1409 I l B Version: 1.5 / / @ Copyright: Ritepro Inc. / / @ Concordian University I I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #if !deEined(AFX,mINmM-nnf 63337SE9,46a2,1lD3,BD3 1-00E029112567,ITIC~u~m-) #def ine AFXAFX~-HHF63D25EI_46822L~~33BD31,00E029112SB7,INCLUDD- #if -MÇCCVEK >= 1000 ltpragma once Oendif / / JfSC-W >= 1000

class CMainFrame : cublic CmZFrameWnd ( protected: / / czeace from serializacion cnly

DECZARE-DYNCAEXTE I CEain?:ame 1 / / Attributes public : CMainFrameO ; / / Operations public:

procecteù: / / c m t r o l ka= &&ded s e e r s CStacusEar m_wndS:acüs8ar; CToolSar m-wnt2Taal9ar;

/ / Gezeraced message m g functicns protected:

/ / A ALEX-FSG(CMain="ranei afx-mâq Lit O n C r e a t e ( L P I ~ T E S ~ ~ lpCreateStrucr) ; afx-mg void OnDes'=tay( 1 ; ah-msg void OnTimer (m?F nIDEt-ertt) ;

/ / NOTE - the ClassWiza-+ uili a 2 ami ratme m&ez Fxictiocs here. / / W NOT EDIT w h t yau sep ic these Dlo=Ics of çeserated ccde! / / 1 1 XéT-VSG DECLARE-MSSXGZ-m i 1

1 : / 1 / / / / / / / / / / / / / / / / / / / / / I / / / / I I I / / I I I / / / / f / / / / / / / / / / / / ~ / / / / / ; / / / / / / l / l l / l / / l / / / / ( (&?XJNSERTTLOCATION~ I / / Kicosoft Develcper Studio w',ll inserr additional declaracians iaonediately hefare the previous iine. #eacEf / / !def~&(~-~~HHF63D2S~-46a24LlD3-BO3l-OOED29LI2S677ZL1I(J;UD~-)