4 M ODELLING A PPROACH
4.4 Data Assimilation & Data Handling
4.5.1 Data Preparation
73
4.5 Model Construction
1- Model Selection
2- Software selection
3 – Network Representation
Project Definition
Skeletonization
4 – Data Assimilation &
Data Handling
Drawings &
Schematics
Documentation
Site Visits
5- Model Construction
Variable Assignment
& Data Input
Regression
Hydraulic Calculations
6-Model Calibration, Verification &
Application
7- Analysis & Display of Results
The network representation was built upon the existing skeletonized system. The link-node analysis method outline in Section 4.3 was followed in order to lay the foundations of a working, accurate mathematical representation of the physical system. All pipes that are separated by a node, as well as each node itself, were individually named in order to avoid confusion in coding and in the reporting of the data. The operational flowchart of the model is presented in Figure 23.
74 The a parameter is solely dependent on the physical parameters of the system. It is calculated using Equation [19] and the required physical parameters, for use within the Joukowsky Equation (1898) (Equation [14]).
2
1
(1 )
i p
F R
a d
E E s
[19]
4.5.1.3 Initialization
Vector initializations (creation of arrays of zeros) are aimed at increasing the computational speed of the program. The pre-allocation of the vectors allows for the circumvention of a vector size increase with every (time) step ahead in the approaching loop.
75
vnum=vnum+1
Start
Initialization:Initial Conditions -Set valve positions - Set tank initial volumes Initialization:Time Config -Set start time - Set timestep length -Set simulation duration -set timeloop counter (t) to 0
Initialization:Data Input Qchar,ρ,µ,l,dh, E, etc Co-ordinates for gv/sv plots Find number of increments (tinc)
Initialize vectors for speed
Least sqaures linear regression For vnum=1:12
No Coefficients for:
- 10 sleeve valve plots -1 globe valve plot Vnum=12
Yes Fitting of k parameter to EPANET results
Set 24h time
For t=1:tinc
Set current reservoir demand
Integrate BPT & reservoir volumes by Euler Method
Set reservoir draws (toggle) from trunk main (yes/no)
Set BPT globe & sleeve valve positions (control philosophy)
Find cumulative globe valve resistance (AD+WR)
For pm=1:5 For sv=1:6 Interpolate to get flow for sv valve position at
point pm
No pm=5 Yes
No sv=6 Yes
5 co-ordinate pairs for sv
Least sqaures linear regression pm=pm+1
sv=sv+1 Coefficients for correlation of
Q vs. P plots for:
-3xAD Sleeve vales -3xWR Sleeve vales
Set tolerance for AD & WR hydraulic loops(ɛ ) Reset count parameters (j,h) for loops
t=1
No Yes
Initial guess PADint
PADint(t-1)=PADint(t-1)
Calculate flow through globe valves and line (Qa,jAD) & flow through sleeve valves (Qb,jAD) for
PADint+PADint2
Get PADint2. α% greater than PADint
Calculate minimization function for Qa,jAD (FminA)
& Qb,jAD (FminB)
FminA<ɛ No
Yes Get next-guess PADint by
Newton-Raphson Method
t=1
No Yes
Initial guess QWRjw
QWRjw=QWRjw(t-1)
Calculate friction factor for each line (Colebrook-White eq.)
Find flows in each line leading to WR from AD by back-substitution
Calculate pressure drop in each line (Darcy- Weisbach equation) and total pressure drop
FWRminA<ɛ No
Yes Get next-guess QWRjw by
Newton-Raphson Method
Calculate flows in lines leading from AD to WR
Calculate waterhammer overpressures by Joukowsky equation and steel pipe analogy
t=tinc No
Yes Store data in Excel (xlswrite1)
Plot graphs t=t+1
No t=1 Yes
Calculate cumulative globe valve pressure drop + total line pressure losses (Δpsv1)
Calculate sleeve valve pressure drop (Δpsv2)
Calculate Calculate FminwA & FminwB
Get QWRjw2 αw% greater than QWRjw
vnum=vnum+1
Start
Initialization:Initial Conditions -Set valve positions - Set tank initial volumes Initialization:Time Config -Set start time - Set timestep length -Set simulation duration -set timeloop counter (t) to 0
Initialization:Data Input Qchar,ρ,µ,l,dh, E, etc Co-ordinates for gv/sv plots Find number of increments (tinc)
Initialize vectors for speed
Least sqaures linear regression For vnum=1:12
No Coefficients for:
- 10 sleeve valve plots -1 globe valve plot Vnum=12
Yes Fitting of k parameter to EPANET results
Set 24h time
For t=1:tinc
Set current reservoir demand
Integrate BPT & reservoir volumes by Euler Method
Set reservoir draws (toggle) from trunk main (yes/no)
Set BPT globe & sleeve valve positions (control philosophy) – restricted movement
speed
Find cumulative globe valve resistance (AD+WR)
For pm=1:5 For sv=1:6 Interpolate to get flow for sv valve position at
point pm
No pm=5 Yes
No sv=6 Yes
5 co-ordinate pairs for sv
Least sqaures linear regression pm=pm+1
sv=sv+1 Coefficients for correlation of
Q vs. P plots for:
-3xAD Sleeve vales -3xWR Sleeve vales Set tolerance for AD & WR hydraulic loops(ɛ )
Reset count parameters (j,h) for loops
t=1
No Yes
Initial guess PADint
PADint(t-1)=PADint(t-1)
Calculate flow through globe valves and line (Qa,jAD
) & flow through sleeve valves (Qb,jAD
) for PADint+PADint2
Get PADint2. α% greater than PADint
Calculate minimization function for Qa,jAD
(FminA)
& Qb,jAD
(FminB)
FminA<ɛ No
Yes Get next-guess PADint by
Newton-Raphson Method
t=1
No Yes
Initial guess PWRint
PWRint(t-1)=PWRint(t-1)
Calculate flow through globe valves and line (Qa,jWR
) & flow through sleeve valves (Qb,jWR
) for PWRint+PWRint2
Get PWRint2. α% greater than PWRint
Calculate minimization function for Qa,jWR
(FWRminA) & Qb,jWR
(FWRminB)
FWRminA<ɛ No
Yes Get next-guess PWRint by
Newton-Raphson Method
Calculate flows in lines leading from AD to WR
Calculate waterhammer overpressures by Joukowsky equation and steel pipe analogy
t=tinc No
Yes Store data in Excel (xlswrite1)
Plot graphs t=t+1
No t=1 Yes
Figure 23 - Flowchart of the program operation, with the Darcy-Weisbach Equation (left) and the regression-type calculation (right).
76