Finite Volume Method For Water Hammer Simulation: June 2002

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/277938439

FINITE VOLUME METHOD FOR WATER HAMMER SIMULATION

Conference Paper · June 2002

CITATIONS READS
2 652

1 author:

Michał Szydłowski
Gdansk University of Technology
44 PUBLICATIONS   132 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Vistula river View project

Vistula Lagoon View project

All content following this page was uploaded by Michał Szydłowski on 09 June 2015.

The user has requested enhancement of the downloaded file.


TiASWiK’02 159

FINITE VOLUME METHOD FOR WATER HAMMER SIMULATION

Michał Szydłowski

Technical University of Gdańsk


Faculty of Hydro and Environmental Engineering
ul. Narutowicza 11/12, 80–952 Gdańsk

Abstract: The numerical solution of equations of one–dimensional unsteady water


flow in a pipeline is presented. The method reported here is based on finite volume
method (FVM). The fluxes of conserved variables between computational cells are
approximated using the Roe scheme of the Riemann problem solution. The proposed
scheme is implemented to analyse water hammer phenomenon in a single, horizontal
pipe. The computed results are compared to analytical solution of unsteady water flow
equations. A good agreement between these results is observed. However, the
measured experimental data are not represented properly by the numerical solution.
Copyright © TiASWiK 2002.

Keywords: water hammer, shocks , numerical simulation, finite volume method

1. INTRODUCTION can be artificially modified as a result of replacing the


origin partial differential equations by the set of
Numerical analysing of water hammer phenomenon equivalent differential equations (Ghidaoui and
involves solution of one–dimensional unsteady water Karney, 1994). Due to this transformation some
flow equations. This set of equations can be derived additional terms appear in equations and the solutions
from continuity and Navier–Stokes equations of origin and equivalent problem are not identical.
(Puzyrewski and Sawicki, 1987). The water flow Approximation of equations (1a,b) can add the
equations are usually presented in non–conservative numerical error (due to numerical dispersion and/or
form and for horizontal pipe they can be written as diffusion) to the solution distorting its consistence with
follows (Parmakian, 1955; Streeter and Lai, 1962) problem physical nature. Ghidaoui and Karney proved
∂h ∂ h a2 ∂ u that in the MOC schemes examined by them the
+u + =0 (1a) numerical errors are excluded when Courant number
∂t ∂x g ∂x
(Cr) is equal to unity. This condition can be exactly
∂u ∂u ∂h f satisfied only on fixed numerical grid and for constant
+u +g + uu = 0 (1b)
∂t ∂x ∂ x 2D wave celerity. When Cr<1 the schemes are dissipative
where u represents averaged value of flow velocity in x and celerity is artificially modified. The MOC
direction, h is a pressure expressed as a hydraulic head, properties presented above limit application of the
g is an acceleration due to gravity, a is a wave celerity, method to simplified problems simulation. In general,
D is a pipe diameter and f is Darcy–Weisbach friction the local value of wave celerity is never constant for
coefficient. The most widely used method to solve example due to water compressibility and elasticity of
hyperbolic equations (1a,b) is method of characteristics pipe material. Moreover the characteristic curves of
(MOC) (Bednarczyk, 1974; Wiggert and Sundquist, equations (1a,b) are not the strait lines when the local
1977, Goldberg and Wylie, 1983; Wichowski, 1998), value of flow velocity can not be neglected.
Unfortunately, equations (1a,b) approximated by MOC Additionally the celerity variation makes possible the
discontinuities (shocks) to appear in the solution. MOC
160 M. Szydłowski, Finite volume method for...

and large majority of finite element method (FEM) and  D p − p0 


finite difference method (FDM) schemes are not able to A = A0 1 +  (6)
 e E 
handle such phenomenon. Finally, numerical schemes
applied to solve equations (1a,b) generally don’t satisfy In the equations (4,5,6) E and K denote the elasticity
the mass and momentum conservation condition due to module of pipe material and water, respectively, and e
non–conservative form of equations. To avoid above is the thickness of the pipe wall. Equation (2) can be
disadvantages the equations in conservative form rewritten as
should be solved using the scheme based on FVM. This ∂U
+ divF + S = 0 (7)
grid method requires an approximation of conserved ∂t
variables fluxes between computational cells. In order To integrate the equations system (7) in space by FVM
to calculate the fluxes the Godunov idea of the the one–dimensional domain x should be discretized
Riemann problem solution (Godunov, 1959) is widely into set of N line segment cells (Fig. 1). Each cell is
used. Such approach originally developed to solve the defined by its centre point and each flow variable is
Euler equations and then applied to Saint–Venant averaged and constant inside the cell.
equations (Glaister, 1993; Ambrosi; 1995, Szydłowski,
1998) can be generally used to solve any hyperbolic
equations system of conservation laws. The Godunov cell 1 cell 2 cell i-1 cell i cell i+1 cell N-1 cell N

scheme for water–hammer simulation was proposed by


Guinot (2000). In the present paper the Roe (1981) x=0
x1 x2 x i-1 xi x i+1 x N-1 xN
x=L
x
∆xi
scheme of Riemann problem solution is used to solve cell-interface i+1/2

the unsteady pipe flow equations.


Fig. 1. Discretization of one–dimensional calculation
domain
2. FINITE VOLUME DISCRETIZATION OF
WATER–HAMMER EQUATIONS Integration of equation (7) and applying the
Ostrogradski–Gauss theorem (Bronsztejn and
The system of equations describing the unsteady water Siemiendiajew, 1973) yield for each cell i
flow in the pipeline can be written in conservative form ∂ Ui
∆xi + ∫ (Fn )dB + ∫ Sdx = 0 (8)
as follows (Puzyrewski and Sawicki, 1987) ∂t B ∆x i i
∂U ∂F
+ +S = 0 (2) where ∆xi is the length of cell i and Bi represents the
∂t ∂ x
cell boundary. The first term of equation (8) represents
where time evolution of conserved variables p and q inside the
 a2    cell i. The surface integral represents the total normal
   0 
flux through the boundary of the cell. The last term is
 p
U =   , F =  A , S= 
an integral of source term. All integrals in equation (8)
 2    (3a,b,c)
q  q  f qq  can be substituted by corresponding sums of two
 Ap + 
 ρA    components as follows
 2 ρAD 
∂ Ui
In the vectors of variables U, fluxes F and sources S ∆xi + (Fi +1 / 2 − Fi −1 / 2 ) + (S i +1 / 2 + S i −1 / 2 )∆xi = 0 (9)
symbols p and q denote the pressure and the mass ∂t
discharge, respectively, ρ is the water density The fluxes F and source terms S must be estimated at
depending on the pressure, A is the area of pipe cross– cell interfaces (at the boundaries between two
section, D is the pipe diameter, f is Darcy–Weisbach neighbouring cells). In order to solve equation (9) the
friction coefficient and a denotes the local value of numerical scheme should be completed by the time
wave celerity. Assuming water compressibility and integration technique. Finally, the algebraic equations
pipe material elasticity the wave celerity can be defined must be solved for each cell i.
as (Puzyrewski and Sawicki, 1987)
1
a= (4)
1 D 3. THE FLUX COMPUTATION ALGORITHM
ρ + 
 K eE 
In order to calculate the flux Fi+1/2 the solution of
where water density and cross–sectional area can be approximate Riemann problem (Godunov, 1959)
expressed as the linear functions of pressure proposed by Roe (1981) can be applied. The full
 p − p0  computation procedure is available in the literature
ρ = ρ 0 1 +  (5)
 K  (Roe, 1981; Toro, 1997), so in this paper only some
significant to solution of water hammer equations
details are presented.

160
TiASWiK’02 161

The original problem (2) neglecting the source term Applying the Roe idea of approximate Riemann
can be transformed to the following form problem solution the numerical flux at i+1/2 cell–
∂U ∂U interface can be expressed as
+A =0 (10) 1 1
∂t ∂x Fi +1 / 2 = (FL + FR ) − A ∆U (18)
where U is the same as in equation (2) and jacobian 2 2
A=∂F/∂U can be written as where subscripts L and R denote left and right side of
i+1/2 cell–interface, ∆U is an increment of pressure
 a2  and mass discharge between cells i and i+1. Values of
0 
A= A (11) pressure p and mass discharge q needed to calculate
 A 2q 
 the elements of matrix A from equation (12) can be
ρA 
evaluated as follows
In the approximate Roe solution of the Riemann p + pR q + qR
problem the equation system (10) is linearized by p= L , q= L (19a,b)
2 2
replacing the jacobian A by averaged matrix A . The If the conserved variables UR and UL necessary to
both forms of jacobian matrix must be diagonalizable estimate flux (18) are equal to cell–centre parameters
in the Roe approach. The above condition means that (Ui and Ui+1) then the numerical scheme is of first–
following equation must be satisfied order accuracy in space. In order to ensure the second–
A=RΛL (12) order accuracy approximation a function extrapolation
where Λ is a diagonal matrix containing the technique can be imposed. In the scheme presented
eigenvalues of matrix A, whereas R and L contain here function values are extrapolated from the cell
associated right and left eigenvectors. The eigenvalues centre–point to the cell–interface by MUSCL
λi of matrix A can be evaluated by solution of reconstruction technique (van Leer, 1979).
characteristic equation (Coulson and Jeffrey, 1982)
A − λI = 0 (13)
4. TIME INTEGRATION SCHEME AND
where I is the identity matrix. Considering jacobian
BOUNDARY CONDITIONS
matrix (11) the roots of (13) are equal to
λ1 = u − u 2 + a 2 (14a) In order to complete the solution of equation (9) a
numerical scheme of time integration must be
λ2 = u + u 2 + a 2 (14b)
implemented. For given computational cell i equation
where u=q/(ρA) is the flow velocity. The (9) can be written in another vector form
corresponding right (r) and left (l) eigenvectors can be ∂ Ui
calculated solving following equations (Coulson and = Xi (20)
Jeffrey, 1982) ∂t
Ari = λi ri (i = 1,2) (15a) where vector X containing all the terms of equation (9)
except for the time derivatives can be expressed as
l i A = λi l i (i = 1,2) (15b)
(F − Fi −1 / 2 ) (
Solution of equations (15a,b) for water–hammer X i = − i +1 / 2 − S i +1 / 2 + S i −1 / 2 ) (21)
problem yields following right and left eigenvectors, ∆xi
respectively where source terms at the both cell–interfaces can
 1  be set equal to averaged values Si+1/2=(Si+Si+1/2)/2 and
  Si–1/2=(Si–1+Si)/2, respectively. The solution of equation
r1 =  A  2 2 
(16a)
 2  u − u + a   (20) can be obtained by integration in the time
a  increment 〈t, t+∆t〉. The general time integration
 1  scheme, defining a new function values can be written
 
r2 =  A  2 2 
(16b) as follows
 2  u + u + a  t + ∆t
a  Ui
n +1 n
= U i + ∫ X i dt (22)
 A t
a2  2 u + u + a
2 2  
where superscripts n and n+1 denote previous and next
l1 =  a    (17a)
2A u 2 + a 2   time level on the numerical grid. Scheme (22) can be
 −1  realized in explicit or implicit way. In the present work
 A 2 
the two–step explicit scheme is applied
 − 2  u − u + a  
2
a2
l2 =  a   (17b) p n
U i = U i + 0.5∆tX i
n
(23a)
2A u2 + a2  1 
 
n +1 n p
Ui = U i + ∆tX i (23b)
162 M. Szydłowski, Finite volume method for...

The above scheme is of second–order accuracy in time This kind of verification is possible only for simplified
and its stability is restricted by the local value of the water flow case when wave celerity can be assumed
Courant number (Potter, 1977) constant. In the second test the numerical solution is
examined against experimental data.
u i + u i2 + ai2
Cr = ≤1 (24)
∆ xi / ∆t Test–case no 1
where subscript i denotes concerning cell. The water hammer phenomenon is analysed in single,
horizontal, frictionless pipe of length L=500m and
A consistent set of initial and boundary condition is diameter D=0,1 m. The downstream valve closure
required to complement the water hammer equations experiment is simulated (Fig. 3).
solution. All conditions must be imposed in accordance
with characteristics theory (Godunov, 1975). To start
the computation the initial values of pressure and mass
p
discharge must be known inside every computational h0 =ρ . 0g
0
cell at time t=0. Analysing the characteristic curves of
equations (2) (Fig. 2) it is seen that the boundary D

conditions at each domain boundary is required. u0

Unfortunately, there is no possibility to set any function L

value exactly at the boundary in FVM. It is impossible


because the grid nodes are located in the centre–points Fig. 3. Test–case no 1 geometry
of computational cells. To impose the boundary
condition the corresponding flux through the boundary As an initial condition the steady state is assumed. The
must be computed. In order to estimate the numerical initial values of pressure p0=0,5 MPa and velocity
flux through boundary of computational domain, the u0=0,4 m/s in the whole pipe are constant. At time
virtual cell outside the domain can be defined (Fig. 2). t=0,5 s the sudden and total valve closure at the
downstream of the pipe is executed. Due to this
_ t
+
_
+
manoeuvre the water hammer appears. The wave
celerity is constant and equal to 1000m/s. Additionally
the water incompressibility (ρ(t)=1000 kg/m3) and pipe
virtual cell 0
_
+
virtual cell N+1
material rigidity are assumed. The boundary conditions
cell 1 cell 2 cell N-1 cell N are kept constant during simulation. At the upstream
x=0 x=L
x boundary the pressure value equivalent to initial
hydraulic head is imposed. Due to closed valve there is
Fig. 2. The scheme to impose the boundary conditions no water flow (u=0 m/s) through the downstream
and the characteristic curves of equation (2) boundary. This pipe section is treated as the closed
boundary. The pipe was discretized with 500 cells
To calculate the fluxes by the Roe scheme the values of (∆x=1 m) and the simulation was carried out with time
variables U are necessary inside virtual cells 0 and step ∆t=0,0005 s. Such assumed numerical parameters
N+1. One of the parameters (pressure p or mass ensure the Courant number value equal to 0,5. The
discharge q) is known from boundary condition and numerical and analytical solution is presented in
second can be estimated using Riemann invariant. For Figure 4.
unsteady water flow equations (2) the unknown
function values inside left and right exterior cell can be p [MPa]
computed applying following Riemann invariants, 1.0
respectively (Puzyrewski and Sawicki, 1987)
0.8
p 0 + ρ 0 a 0 u 0 = R1 (25a)
0.6
p N +1 − ρ N +1 a N +1u N +1 = R N (25b)
where R1 and RN+1 are the Riemann invariants computed 0.4
using known function values from interior cells. 0.2

0.0
0 1 2 3 4 5 6 7 8 9 10
5. NUMERICAL RESULTS t [s]

In order to verify the numerical solution method Fig. 4. Test–case no 1 – analytical () and numerical
presented in this paper two test–cases are considered. solution obtained using dissipative (+) and non–
In the first one computed results are compared to dissipative (•) scheme
analytical solution of unsteady water flow equations.

162
TiASWiK’02 163

The pressure variation in time at the valve section is steady state friction term produces results absolutely
shown in this picture. In the calculated results obtained different from physical ones (Fig. 5a,c).
using the scheme of first–order accuracy the numerical
diffusion is observed. The wave fronts are strongly a)
smeared and the maximum pressure value is decreasing p [MPa]
in time. If scheme of second–order accuracy is applied 1.0
a quite good agreement with analytical solution is
0.8
observed. The maximum values of pressure and wave
period are properly reproduced. The steep wave fronts 0.6
are slightly smoothed due to replacing in solution the 0.4
function discontinuities by narrow regions where
0.2
parameters are continuous. The better agreement could
be ensured by numerical mesh refining. 0.0
0 1 2 3 4 5 6 7 8 9 10 11 12
t [s]
Test–case no 2
b)
In this test case the computed results are compared to p [MPa]
measured data. The physical experiment was performed
at hydraulic laboratory of Environmental Engineering 1.0

Department of Technical University of Warsaw. The 0.8


laboratory equipment details and measurement method 0.6
are described by Lewandowski and Makowski (2000).
In general, the experiment is similar to the previous one 0.4

(Fig. 3). The water hammer phenomenon is analysed in 0.2


circular, horizontal, steel pipe of length L=72 m and
0.0
diameter D=0,042 m. The thickness of pipe wall is 0 1 2 3 4 5 6 7 8 9 10 11 12
e=0,003 m. The elasticity modules of pipe material and t [s]
water are set E=2×1011 Pa and K=2×109 Pa, c)
respectively. The pipe friction coefficient f is defined p [MPa]
by Colebrook–White formula and calculated for 1.0
roughness coefficient k=0,08 mm. The initial condition
0.8
is imposed in accordance with experiment. Initially the
flow parameters are constant (steady state). The velocity 0.6
is equal to u0=0,38 m/s in the whole pipe. The pressure is 0.4
set equal to p0=0,51 MPa at the valve section and
0.2
increase along the pipe due to pressure losses defined as
0.0
∆x u 02 0 1 2 3 4 5 6 7 8 9 10 11 12
∆p = f ρ (26)
D 2 t [s]
The boundary condition during simulation are assumed d)
p [MPa]
as follows – at the upstream boundary the constant
value of pressure is imposed and downstream boundary 1.0
is treated as closed boundary after valve closure. That 0.8
manoeuvre begins at time t=0,38 s and goes on by
0.6
0,114 s. During this time the velocity at valve section is
interpolated between values 0,38 m/s and 0 m/s. The 0.4
pipe was discretized with 72 cells (∆x=1 m) and the 0.2
simulation was carried out with time step ∆t=0,0005 s,
0.0
what ensures the Courant number value approximately 0 1 2 3 4 5 6 7 8 9 10 11 12
equal to 0,6. The measured and calculated results of t [s]
pressure variation at valve section are presented in
Figure 5. Fig. 5. Test–case no 2 – measured (a) and calculated
pressure variation at valve section
One can find that unexpected results are obtained. The (b) frictionless case computed using non–
best agreement between experimental data and dissipative scheme
computed pressure values is observed when dissipative (c) steady state friction term case computed using
scheme is used (Fig. 5a,d). More accurate scheme non–dissipative scheme
applied to solve water hammer equations including (d) steady state friction term case computed using
dissipative scheme
164 M. Szydłowski, Finite volume method for...

In the laboratory measurements the strong energy REFERENCES


dissipation is observed meanwhile the calculated
pressure damping is significantly slower. The presented Ambrosi, D. (1995). Approximation of shallow water
results prove that water flow equation (2) are devoid of equations by Roe’s Riemann solver. Int. Journal
term(s) describing additional energy dissipation for Numerical Methods in Fluids, 20, 157–168.
processes existing in water hammer phenomenon. Axworthy, D. H., Ghidaoui, M. S. and McInnis, D. A.
Several approaches completing considering equations (2000). Extended thermodynamics derivation of
are available in the literature. For instance Brunone, energy dissipation in unsteady pipe flow. Journal
et al. (1995) proposed the unsteady pressure loss model of Hydraulic Engineering, 126, 4, 276–287.
by adding an extra–term to steady state friction term in Bednarczyk, S. (1974). Ruch nieustalony w
the momentum equation. This additional term is przewodach pod ciśnieniem. Archiwum
proportional to values of flow velocity and Hydrotechniki, XXI(4), 553–581.
acceleration. The similar friction term modification Bronsztejn, I. N. and Siemiendiajew, K. A. (1973).
together with theoretical foundation is proposed by Matematyka – Poradnik encyklopedyczny, PWN,
Axworthy, et al (2000). Generally, it is proved that Warszawa.
unsteady friction models fit the measured data better Brunone, D., Golia, U. M. and Greco, M. (1995).
than models taking into consideration only steady state Effects of two–dimensionality on pipe transients
losses. However, it seems that proposed additional term modelling. Journal of Hydraulic Engineering, 121,
in momentum equation is not enough to represent all 12, 906–912.
energy dissipation processes existing in water hammer Coulson, C. A. and Jeffrey, A. (1982). Fale – modele
phenomenon. matematyczne, WNT, Warszawa.
Ghidaoui, M. S. and Karney, B. W. (1994). Equivalent
differential equations in fixed–grid characteristics
6. CONCLUSION method. Journal of Hydraulic Engineering, 120,
10, 1159–1175.
The numerical scheme for unsteady pipe flow Glaister, P. (1993). Flux difference splitting for open–
equations solution based on finite volume method was channel flows. Int. Journal for Numerical Methods
presented. The described scheme is an approximation in Fluids, 16, 629–654.
of second–order accuracy in space and time. That Godunov, S. K. (1959). A difference scheme for
property allows to avoid the numerical diffusion error numerical computation of discontinuous solution
in the solution contrary to method of characteristics. of hydrodynamic equations. Math. Sbornik, 47,
MOC schemes add usually the artificial dispersion 271–306.
terms to original problem equations if Courant number Godunov, S. K. (1975). Równania fizyki
is less than unity. The presented scheme is able to matematycznej, WNT, Warszawa.
handle the discontinuity (shocks) appearing in the Goldberg, D. E. and Wylie, E. B. (1983).
solution due to celerity variation. These advantages and Characteristics method using time–line
computational algorithm robustness allow to interpolations. Journal of Hydraulic Engineering,
recommend the examined scheme to solve the 109, 5, 670–683.
equations of unsteady water flow in the pipelines in the Guiont, V. (2000). Riemann solvers for water hammer
practical cases. simulations by Godunov method. Int. Journal for
Numerical Methods in Engineering, 49, 851–870.
The numerical scheme was successfully applied to Lewandowski, M. and Makowski, T. (2000). Wpływ
simulate simplified water hammer problem. The oporów ruchu na proces przepływu nieustalonego
computed results are in good agreement with analytical w rurociągu. MSc thesis, Technical University of
solution. The unexpected, significant disagreement Gdańsk.
between calculated results and measured data was Parmakian, J. (1955). Water–hammer analysis,
observed. Considering the simulation results it seems Prentice–Hal, INC New York.
that water hammer phenomenon is too complicated to Potter, D. (1977). Metody obliczeniowe fizyki, PWN,
be described by mathematical model (2). These Warszawa.
equations are devoid of some term(s) representing Puzyrewski, R. and Sawicki, J. (1987). Podstawy
additional energy dissipation processes, which have not mechaniki płynów i hydrauliki, PWN, Warszawa.
been recognized yet. Roe, P. L. (1981). Approximate Riemann solvers,
parameters vectors and difference schemes.
Journal of Computational Physics, 43, 357–372.
Streeter, V. and Lai, Ch. (1962). Water–hammer
analysis including fluid friction. Journal of
Hydraulic Division, 88, HY3, 79–111.

164
TiASWiK’02 165

Szydłowski, M. (1998). Numeryczna symulacja


przepływu wody ze swobodną powierzchnią w
warunkach ruchu szybkozmiennego z
nieciągłościami. PhD thesis, Technical University
of Gdańsk.
Toro, E. F. (1997). Riemann solvers and numerical
methods for fluid dynamics, Springer–Verlag,
Berlin.
van Leer, B. (1979). Towards the ultimate conservative
difference scheme v.a. second–order sequel to
Godunov’s method. Journal of Computational
Physics, 32, 101–136.
Wiggert, D. C. and Sundquist, M. J. (1977). Fixed–grid
characteristics for pipeline transients. Journal of
Hydraulic Division, 103, HY12, 1403–1417.
Wichowski, R. (1998). Analiza przepływów
nieustalonych w sieciach wodociągowych
pierścieniowych. Zeszyty Naukowe Politechniki
Gdańskiej, Gdańsk.

View publication stats

You might also like