You are on page 1of 7

Valve Stroking to Control Water

Hammer Transients Using


D. N. Contractor
Dynamic Programming
Professor, Fluid transients in a pipeline caused by valve operation can be minimized by
Department of Civil Engineering operating the valve in an optimally prescribed manner, in a given time of closure
and Engineering Mechanics, (tc >2L/a). Dynamic programming is used to select the operation of the valve (i.e.,
The University of Arizona, set the valve-operating policy) over the time period t c so that the pressure rise at the
Tucson, Ariz. 85721 valve (the objective function) is minimized. Constraints on the valve closure policy
may also be specified, e.g., monotonic valve closure. Application of this method to
a simple pipeline with a reservoir at one end and a valve at the other end shows that
the pressure rise at the valve is lower than when the valve is closed linearly with time.
The benefits of dynamic programming are shown to be greatest when the time of
closure t c is small. The method has also been applied to valve opening, so that the
pressure drop at the valve is a minimum.

Introduction
Fluid transients in pipelines caused by valve operation can the total time of valve closure (tc = nL/a s) is divided into a
be controlled in many ways so as to result in lower maximum number of time stages. At each time stage, the valve can be
pressures in the pipeline. These methods which are capital- operated at any one of m discrete openings T, which range
intensive include the use of air chambers, surge tanks, relief from unity to zero. These m openings are the different states
valves and surge suppressors. Another effective way to control at which the system can be operated. At any given stage and
transients is to operate the valve in a prescribed manner so that state of the system, m values of the pressure in the pipeline
the magnitude of the transient pressures is reduced. This near the valve can be determined using the waterhammer
method is referred to as valve stroking. Numerical procedures equations and the m valve openings at the previous stage. Of
to close a valve in such a way as to limit the maximum pressure these m pressures, a single value has to be selected which gives
to a given value are available and have been verified ex- a minimum pressure rise from the previous stage to the present
perimentally [1-3]. These methods not only limit the max- stage. This procedure is repeated for all other states at this
imum pressure to a given value but also provide uniform flow stage and repeated again for all the remaining stages. At the
conditions in the pipe at the end of valve closure. Such final stage, the value of r is fixed and the final minimization
uniform flow conditions may be desirable and/or necessary in performed. Details of this procedure are given in the following
certain situations. On the other hand, there may be situations, sections. The best way of illustrating this procedure is by ap-
where it is desirable to minimize the maximum pressure in the plying it to a given pipeline system. Such a pipeline system is
pipeline even if there are pressure fluctuations at the end of shown in Fig. 1. This procedure remains basically the same,
valve closure. Thus, the problem in such situations can be when dealing with valve opening or when studying valve
defined as determining the gate-operating policy in a specified closure with constraints.
time period so as to minimize the maximum transient pressure,
with or without constraints. One method of solving this Waterhammer Equations
problem has been suggested by Driels [6]. He has developed a
computer program that minimizes the pressure rise when a Waterhammer in a pipeline is governed by the following
valve is closed in two stages. The two stages represent two suc- partial differential equations of continuity and momentum
cessive linear rates of valve operation to close the valve. A [3]:
simplex search algorithm is used to find the two speeds that dh dv
will minimize the pressure surge. He has shown that substan- - + • =0 (1)
g dx
tial reductions in pressure can be achieved.
Dynamic programming appears to be a viable technique dh dv
among the many optimization techniques available [4, 5]. In + J-V\V\ = 0 (2)
dx dt 2D
the application of dynamic programming to valve stroking,
Using the method of characteristics, this pair of partial dif-
ferential equations is converted to the following two pairs of
Contributed by the Pressure Vessels and Piping Division for publication in the ordinary differential equations:
JOURNAL OF PRESSURE VESSEL TECHNOLOGY. Manuscript received by the g dh dv f , , dx
Pressure Vessels and Piping Division, September 11, 1985; revised manuscript (3)
received April 17, 1986. (C+):— r - + —T- + ^rp\v\ = 0,—— = +a
K
' a dt dt 2D dt
94 / Vol. 109, FEBRUARY 1987 Copyright © 1987 by ASME Transactions of the ASME

Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use


h f = 34.1 ft (10.4 m)

-Total
Lit]

Pipe Diameter = 1 in. (25.4 mm)


Wave Speed = 2550 PPS (777 m/s)
140 ft. Darcy-Weisbach Friction f = .036
(42.7 m) Initial Velocity V 0 = 1.1 FPS (.335 m/s)

Ax = L/10

- L = 4030 f t . (1228 m)
Fig. 1 Pipeline system

1.0

.75

.25

STAGE (Time Counter J )


Fig. 2 Dynamic programming parameters

g dh dv f dx termediate nodes the C + a n d C - characteristic equations can


(C-):- +W>l'l=0, (4) be solved to give h and v at node i and time t + At in terms of
a dt dt ~dT h and v at adjacent nodes / + 1 and i - 1 and time t
These ordinary differential equations are approximated by
finite differences. The pipeline is subdivided into n' equal U + hi+,,, + • (c,-_ i,, - vi+!,)
reaches, resulting in («' + 1) pipe locations (nodes) at which
hi,t + £
[*• S
velocities and pressures are calculated. The first node
represents the reservoir boundary condition and the last node af At
l"/-i,J-"/+i,J»'i+i>rl)J/2 (5)
takes into account the conditions at the valve. At the in- g 2D <"/-

Nomenclature

a = wave velocity,2 m/s


A = valve area, m JM - time counter at valve closure
Cd = coefficient of discharge =
Q/{AsflgA~h) L = pipe length, m V0 =
initial velocity in pipe, m/s
f = Darcy-Weisbach friction m = no. of discrete gate openings Ax =
subdivision of pipe length L,m
coefficient n = tc/(L/a) At =
wave travel time = Ax/a, s
piezometric head, m t = time = (J- 1) At, s T =
dimensionless valve opening
/ = time counter or stage = tc = time of valve closure, = = (CdA)/{CdA)0
{t/At+\) {JM- 1) At, s v = velocity, m/s

Journal of Pressure Vessel Technology FEBRUARY 1987, Vol. 109/95

Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use


Table 1 Comparison of maximum pressure for different
times of closure
Max. pressure Max. pressure
fAt 1 from dyn. from linear Difference,
- - ^ i - u '"/-!./' + "/+!./ l"/ + i,,l)]/2 (6) programming, valve closure, ft(m)
JM ft (m) of water ft (m) of water of water
At the reservoir node (/= 1), the reservoir head ht is known <21 210.4(64.1) 210.4(64.1) 0.(0)
and the C— equation is used to determine the velocity c, 22 171.2(52.2) 208.2(63.5) 37.0(11.3)
32 172.3(52.3) 187.1(57.0) 14.8(4.7)
h\,t+M = HR (7) 42 157.0(47.9) 169.5(51.7) 12.5(3.8)
52 155.8(47.5) 162.6(49.6) 6.8(2.1)
62 153.3(46.7) 159.5(48.6) 6.2(1.9)
"I,I+AI = "2,I+ (.Hg - h2t)-—— vxt lc2,,l (8) 82 148.5(45.3) 153.8(46.9) 5.3(1.6)
a 2D
At the valve node (;' = « ' + 1), the C+ equation has to be
solved simultaneously with the equation for flow though a pressure rise at any other point in the pipeline instead of
valve, resulting in the solution to a quadratic equation. Let H0 minimizing at the valve. The objective function may consist of
be the head difference across the valve under steady state con- velocity changes or energy changes instead of pressure
ditions (see Fig. 1). The valve equation then becomes changes. The method can also handle any constraints that may
be deemed practical. Thus, it may be desirable to impose the
'n' +1,1 +Al ~ 'oTt + At\"n+l,t + AI'"o) (9) constraint that the valve shall only close monotonically. Or, it
may be that the gate-closing mechanism has a maximum rate
of closing and hence the policy must take this into account
Dynamic Programming Technique when determining the minimum pressure rise. The same
methodology can be applied to the case of gate opening so that
The dynamic programming technique is illustrated by ap- the pressure drop is minimized. The system shown in Fig. 1 is a
plying it to the pipeline system of Fig. 1. The pipeline is di- simple pipeline; however, the dynamic programming tech-
vided into ten equal reaches and the*"pressure and velocity nique could just as easily consider a series pipeline or a parallel
calculated at each of the 11 sections. When the valve is com- pipe system or a network or pipelines. In this case, the com-
pletely open, the velocity in the pipe is 1.1 fps (0.335 m/s). The plexity of the waterhammer solution increases and the com-
range of valve openings (from T = 1.0 for fully open to T = 0 puter excecution time will increase. Finally, if the number of
for fully closed) is subdivided into 50 equal divisions yielding stages and/or states of the system are increased excessively,
m = 51 and an increment in r of 0.02. The stages (time) and dynamic programming will suffer from the curse of dimen-
the states (7) of the system are shown in Fig. 2. At stage (7= 1), sionality and the execution cost will increase exponentially.
the valve is completely open ( T = 1.0) and steady uniform flow Despite this, dynamic programming will always be more effi-
conditions prevail in the pipeline. At stage (7=2), the velocity cient than complete enumeration.
and pressure in the pipeline at any one of the 51 states can be
obtained using the characteristic equations of waterhammer
and the valve setting T= 1.0 at stage 7 = 1. Since the valve set- Computer Results
ting at 7 = 1 is unique, no optimization is called for at 7 = 2 and A FORTRAN program was written making use of the
51 different values of v and h in the pipeline are calculated and dynamic programming techniques described in the last sec-
stored. tion. The data shown in Fig. 1 was input into the program.
At stage / = 3 , the hydraulic conditions in the pipe at any The program was run foFa time of valve closure tc equal to
given state T have to be obtained by an optimization pro- AL/a or JM= 41. The results of this run are shown in Fig. 3. It
cedure. This is so because there are 51 states of the system at can be seen that in order to minimize the pressure rise, the
7 = 2 that could possibly lead to any given state T at 7 = 3 . valve has to close in steps. At first, the valve closes from
Hence, 51 values of the pressure at the valve can be calculated T = 1 . 0 to T = 0 . 5 2 in one time-step At and remains approx-
using the characteristic waterhammer equations. Only one of imately at that opening till t = 2L/a s (7= 21). Then it closes to
these pressures has to be selected and the objective function T = 0 . 1 2 and gradually closes to T = 0 at t = 3.9L/a s (7=40).
used to select the pressure is the one that minimizes the The maximum pressure in the pipeline is seen to be 169.7 ft
pressure rise from J =2 to 7 = 3 . The state r at 7 = 2 which (51.7 m). If the valve were closed linearly with time in AL/a s,
results in the minimum pressure rise at the given state at 7 = 3 the maximum pressure head in the pipeline would have been
is noted and stored. The same procedure is repeated for each 170.8 ft (52.06m). Thus, in this case, it does not appear that
of the remaining 50 states at 7 = 3 , determining the minimum dynamic programming has helped too much. One of the
pressure rise and the state T at the previous stage 7 that gave reasons for this lies in the fact that when the valve is to be
rise to the minimum pressure rise. The same procedure is closed in AL/a s (7M=41) the gate opening at t = AL/a s
repeated for all stages except the last stage. At the last stage (7=41) is fixed and dynamic programming does not play a
JM, there is only one state, the final gate opening, to be con- part in the choice of T at that stage. If dynamic programming
sidered. The gate-closing policy can now be traced backwards was to choose ratt = AL/a s (7= 41) then the valve would have
through the different stages and minimum pressure rise for all to close at t = (AL/a + At) s (7M=42). If this were allowed to
the stages obtained. happen, then there would be another step closure of the valve
The results of the gate-closing policy can be entered into a between 7 = 4 1 and 7 = 4 2 , possibly reducing the maximum
basic waterhammer program and the pressures compared with pressure.
those predicted by dynamic programming. This is also done to Figure 4 shows the results of optimization in t = (AL/a + At)
examine the nature of the transients beyond the stage JM at s (JM= 42). It can be seen that the maximum pressure is 157 ft
which times the gate is kept at its final opening. The results of (47.9m) as compared to 169.7 ft (51.7m) for 7 M = 4 1 . Also,
the optimized gate-closing policy can be compared with other the curve for gate closing shows that the valve is closed in three
gate-closing schemes, e.g., linear gate closure. Such a com- abrupt movements at 7 = 1, 21 and 41. The pressure curve for
parison will provide a certain measure of sensitivity to the linear valve closure shows that the maximum pressure is 169.5
minimum pressure at the valve. ft (51.5 m). Thus, in this case, dynamic programming provid-
The method outlined above is quite general and any number ed a gate-closing policy that resulted in a considerably lower
of variations can be envisaged. Thus, one can minimize the maximum pressure. Subsequent runs were made for JM equal

96/Vol. 109, FEBRUARY 1987 Transactions of the ASME


Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use
1701

1.0

.8

.4

.2

4 5

Time i n L/a Sees.


Fig. 3 Optimal valve closure in AUa s (JM = 41)

170
Optimal Gate-Closins Policy

Pressure Due to Optimal Policy

1.0

0.8

• 0.6

« •• 0.4

•• 0.2

Time in L/a Sees


Fig. 4 Optimal valve closure (JM = 42)

Journal of Pressure Vessel Technology FEBRUARY 1987, Vol. 109/97


Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use
Optimal Gate-Closing Policy

Pressure Due to Optimal Policy


1.0
Pressure-Linear T

0.8

•0.6

-0.4

0.2

5 6
Time i n L/a Sees
Fig. 5 Optimal valve closure for pipe with high friction

* X Optimal Gate-Closing Policy

O O Pressure-;Due to Optimal Policy


1.0
Pressure Due to Linear T

o.t

-0.6

0.4

0.2

-26

2 3 4 5 6
Time in L/a Sees.

Fig. 6 Optimal, monotonic valve closure for pipe with high friction

98/ Vol. 109, FEBRUARY 1987 Transactions of the ASME

Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use


1.0

X X Optimal Gate-opening Policy

O o Pressure Due to Optimal Policy

Pressure Due to Linear T

0.6

O-0.4

0.2

3 4 5
Time in L/a Sees.
Fig. 7 Optimal gate opening policy JM = 22

to 22, 32, 52, 62 and 82. The maximum pressures for each of straints can also be imposed, e.g., specifying a maximum rate
these cases and the maximum pressures for linear valve closure of valve closure.
in those times are given in Table 1. Finally, an application to gate opening is provided in Fig. 7.
It can be seen that the gate-closing policy obtained from The gate is to be opened in JM =22, and the gate-opening
dynamic programming results in much lower pressures than policy shows that the valve opens from T = 0 to T = 0.38 at J= 1
linear valve closures, especially for short times of closure. For and from 7 = 0.38 to T = 1 . 0 at 7=21. The lowest pressure
long times of closure, the rewards of dynamic programming reached is 89 ft (27.1m). If the valve is opened linearly in the
diminish and the computer costs of dynamic programming same time (JM=22\X the lowest pressure is 67 ft (20.4m). In
escalate rapidly as JM increases. both these cases, substantially steady flow is reached in 6L/a
The results shown in Figs. 3 and 4 indicate that the optimal s. Use of dynamic programming applied to gate opening can
gate-closing policy consists of closing the gate in steps at / = 1, be especially helpful, if water column separation can be avoid-
21 and 41 with the gate remaining more or less constant in be- ed at the valve. In any situation, where water column sepira-
tween those times. This pattern of gate closure is true for sim- tion is likely to occur, a constraint can be imposed limiting the
ple pipe systems with low or moderate frictional resistance. minimum pressure to a predetermined value.
With no frictional resistance both the gate opening T and the
pressure change in steps and remain constant in between the Discussion of Results
steps. If friction increases, the gate-closing policy changes
slightly because of the reflections returned at the valve due to The results of the optimal gate-closure policies described in
frictional effects. When the frictional effects are large, the the previous section can be explained in terms of the physical
gate-closing policy will still involve step movements; however, process of wave propagation. While it may be conjectured that
the valve will need to be opened between these steps changes. the optimal policy would turn out to be one in which the valve
Such a gate-closing policy is shown in Fig. 5, for the case of would have to be closed gradually and continuously, the op-
the Darcy-Weisbach friction factor / = 0.1 and JM= 42. The timal results indicate the opposite. Thus, the lowest maximum
maximum pressure head is equal to 160 ft (48.8m). The gate- pressure is obatined, when the valve closes instantaneously to
closing policy shows the abrupt gate movements at / = 1, 21 some opening r t . This creates a positive pressure surge that
and 41. However, the gate actually has to be opened from travels to the reservoir, gets reflected to a lower pressure and
T = 0.16 to r = 0.40 between J= 2 and / = 20 in order to prevent returns to the valve in 2L/a s. Upon arrival of this low
the reflected pressure waves from increasing the pressure at pressure at the valve, the valve is closed instantaneously to
the valve excessively. While this gate-closing policy is in- another opening T2. The pressure rise due to this closure
teresting, it may not be feasible or practical to operate the gate balances the low pressure of the returning wave, resulting in a
in that manner. When confronted with such a problem, net pressure that is the same as the pressure at the time of the
dynamic programming with one or more constraints can be first closure T{. In between the valve movements, the valve
used to obtain the minimum pressure. In this case, the con- opening remains essentially constant. This pattern of valve
straint can be superimposed, that the gate shall only close closure continues till the valve is completely closed in tc s. For
monotonically. The results of such a run are shown in Fig. 6. the case of frictionless flow, the graphical solution of
It can be seen that the valve closes monotonically and that the waterhammer can be used to obtain TU T2 • • • and hmax
maximum pressure of 165 ft (50.3m) is only slightly higher analytically. When friction is to be taken into account by
than the run without the constraint, 160 ft (48.8m). Other con- lumping its effects at one location, a trial and error procedure

Journal of Pressure Vessel Technology FEBRUARY 1987, Vol. 109/99


Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use
can be used to obtain r 1( T2 . . . and hmm. The case of valve waterhammer transients by valve stroking. A gate-operating
opening for a minimum pressure drop can also be studied us- policy in a given time tc can be obtained that will optimize an
ing graphical waterhammer. objective function with or without constraints. The objective
For the case of a pipe with high friction loss, the optimal function chosen is the pressure rise at the valve. Other, more
valve-closure policy is still one of abrupt closure at times At, appropriate objective functions can also be used instead of the
2L/a + At,4L/a + At. . . . However, between these times, the pressure rise at the valve. The gate-operating policy deter-
valve opening does not remain constant but actually opens to mined from dynamic programming appears to be one in which
keep the pressure rise to^a minimum. This is explained by the the gate is operated in steps with very little movement between
fact that frictional effects in the pipe produce reflections that the steps, except for the case of high friction. This method of
return to the valve and increase the pressure at the valve. In gate operation seems to take advantage of the wavelike nature
order to prevent this pressure rise from becoming excessive, of the phenomenon, i.e., the gate moves when the initial
the valve needs to be opened so that the pressure drops due to pressure rise gets reflected from the reservoir and returns to
valve opening will neutralize the pressure rise due to frictional the valve. The greatest benefit of dynamic programming is
effects. realized when the valve is closed in the minimum time
Since it has been established that for pipes with low or (JM= 22). As JM is increased, the cost of running the op-
moderate friction, the optimal valve closure is one of steps at timization program increases and the benefits of dynamic pro-
fixed time intervals, the whole optimization scheme can be gramming decrease. Any type of constraint on the objective
modified. Thus, for a closure time of 2L/a + At, it is only function can be superimposed to make the gate-operating
necessary to optimize one value of r; for a closure time of policy more realistic or practical. Examples of constraints
AL/a + At, it is necesary to optimize two values of T. An op- are: (a) that the valve shall close monotonically, and
timization technique other than dynamic programming will (b) that the valve shall not close faster than a given max-
clearly be more effective and efficient. The simplex algorithm, imum rate. Dynamic programming has been applied to gate
used by Driels [6] was utilized to study 2-stage, 3-stage and opening as well as gate closing. Even though the pipe system
step closure of valves by Contractor [7]. In this paper it is chosen in these applications is a simple pipeline, the same
shown that this optimization technique is simpler, more effi- techniques can be applied to more complicated systems, such
cient and entirely adequate for a single pipeline. It is also as series pipes, parallel pipes, branching pipelines, pipe net-
shown that the 3-stage closure for tc = 2L/a + At is exactly the works and pipelines with air chambers or surge tanks.
same as the step closure for the same tc, confirming that the
step closure does provide the minimum pressure rise. As the
pipeline becomes more complex, the dynamic programming
technique will be necessary once again to take into account the
reflections from different parts of the pipeline system. For References
these more complex systems, the simple policies of 2-stage, 1 Streeter, V. L., "Valve Stroking," ASCE Journal of the Hydraulics Divi-
3-stage and step closure of valve may prove inadequate. sion, Vol. 93, No. HY3, May 1967, pp. 81-98.
2 Propson, T. P., "Valve Stroking to Control Transient Flows in Liquid Pip-
Finally, this paper deals with the minimization of ing Systems," Ph.D. thesis, Department of Civil Engineering, The University of
waterhammer transients in the pipe. Another significant Michigan, Ann Arbor, Mich., 1970.
problem in pipeline design deals with the mechanical response 3 Wylie, E. B., and Streeter, V. L., Fluid Transients, McGraw-Hill, Inc.,
1978.
of the pipeline to a pressure transient. Pipelines have been 4 Wagner, H. M., Principles of Operations Research, Prentice-Hall, Inc.,
known to fail due to such transients. This problem is one that 1969.
will be studied in the near future with the purpose of studying 5 Stark, R. M., and Nicholls, R. L., Mathematical Foundations for Design,
the valve-closure policy that will minimize pipeline stress or McGraw-Hill, Inc., 1972.
displacement. 6 Driels, M., "Predicting Optimum Two-Stage Valve Closure," American
Society of Mechanical Engineers, ASME Paper No. 75-WA/FE-2, 1975.
7 Contractor, D. N., "Two and Three Stage Valve Closures to Minimize
Conclusions Waterhammer Transients," ASME Proceedings of the 1985 Pressure Vessels
and Piping Conference, P V P - V o l . 98-7, Fluid Structure Dynamics, June
Dynamic progamming has been applied to the control of 23-26, 1985, pp. 357-361.

100 / Vol. 109, FEBRUARY 1987 Transactions of the ASME


Downloaded From: http://pressurevesseltech.asmedigitalcollection.asme.org/ on 01/29/2016 Terms of Use: http://www.asme.org/about-asme/terms-of-use

You might also like