MATHEMATICAL COMPUTER MODELLING PERGAMON Mathematical and Computer Modelhng 34 (2001) 29-35
www elsevier nl/locate/mcm
The Application of a Conservative
Grid Adaptation Technique to
1D Shallow Water Equations
M J CASTRO
Dtpo Andlrsrs MatemAtrco, Umversrdad de MBaga Campus de Teatmos s/n 29080 Malaga, Spain
castro@anamat tie uma es P. GARCIA-NAVARRO
Department of Fluids Mechamcs, Unrversrty of Zaragoza, Zaragoza, Spain
(Receaved June 2000, accepted July 2000)
Abstract-In this contrlbutlon, we present an efficient conservative mesh adaptation algorithm apphed to 1D shallow water equations This algorithm is smtable for unsteady sltuatlons and dls- contmultles of the solutlons are well captured NumerIcal results are presented @ 2001 Elsevler Science Ltd All rights reserved
Keywords-Gnd adaptlvrty, Q-schemes of Roe and Van Leer, Imphcrt and exphclt TVD methods, Unsteady shallow water flows
1. INTRODUCTION
Numerical methods for predrctmg the water profile and discharge m steady as well as unsteady srtuatlons of hydraulic systems have become a common tool In particular, finite difference apphcatrons of numerical schemes have been widely reported
One of the bssrc problems m unsteady hydraulic systems 1s the locatron of solutron drscon- tmurtres and shocks In order to solve thus problem, an efficient conservatrve grid adaptation algorrthm applied to the resolution of the shallow water equations 1s presented
First, the equations to be solved are presented. They are essentially the well-known shallow water equations written m conservatrve form The drscretrsatron of the system 1s done usmg the numerical method proposed by Bermtidez-Vazquez m [l] A high-order method as the TVD- McCormack scheme (see [2,3]) has also been used to compare numerrcal solutrons
A posterzon error estimator to control the error of the numerical solutron 1s constructed using a metric tensor M (M being the solutron of a mmrmrsatron problem) Once M 1s computed, a simple version of an amsotroprc Delaunay algorithm for one-drmensronal domains 1s used to adapt the mesh A local conservatrve mterpolatron algorithm 1s used to guarantee conservatron of the variables durmg mesh adaptatron
The author 1s indebted to J Ma&s and E V&quez for many valuable dlscusslons This work has been supported by the Comnxon Intermmlsterial de Clencla y Tecnologia (C I C Y T ), ProJect MAR97-105~C02-01
0895-7177/01/$ - see front matter @ 2001 Elsevler Science Ltd All rights reserved Typeset by &&W PI1 SOS95-7177(01)00046-2
Fmally, numerical results are presented and comparisons with nonconservative mterpolatlon algorithms and other numerlcal schemes are given
2. SHALLOW
WATER EQUATIONS.
NUMERICAL
DISCRETISATION
Shallow water equations represent mass and momentum conservation along the direction of the mam fiow They constitute an adequate descrlptlon for most of the problems associated with open channel flow modelhng and can be written as the followmg system of equations
(1)
where
A 1s
the wetted cross-sectional area, Q 1s the discharge, g 1s the acceleration due to gravity, and 11 represents a hydrostatic pressure force terms
h(x,t)I1 =
(h -
77)%)
h7
(2)
0
and I, accounts for the pressure forces due to longltudmal width vanatlons,
s
h(+)I2 =
(h -
W’(x)
&
0B(z) 1s the breadth of the channel that 1s supposed to be locally rectangular The right--hand side of equation (1) also contams the sources and sinks of momentum arlsmg from the bed slope and frlctlon losses
The dlscretlsatlon of the system 1s done using the numerlcal method proposed by Bermtidez- Vgzquez m [l], that IS, an exphclt extension of the Q-scheme of Roe with upwmdmg m flux and source terms For more details, see [1,4,5] A high-order method as the TVD-McCormack scheme (see [2,3]) has also been used to compare numerical solutions
3. ERROR ESTIMATOR:
METRIC
COMPUTATION
A postenorz
error estimator to control the error of the numerlcal solution 1s constructed using a metric tensorM (M
being the solution of the followmg mmlmlsatlon problem) (see [6,7] for more details) find a metric tensorM, so
that the adapted Delaunay mesh constructed fromM
mmlmlses the mterpolatlon error
where Wn =
(A”, Qn)T 1s
the solution of the shallow water system at time t = t, and &[Wn] 1s a contmuous plecewlse linear mterpolatlon ofWn
over the mesh Z’h In general, this metric tensor 1s given m terms of the Hesslan matrlces of the variables In this particular case, asAn
and Q” W + E%, the metric tensor can be computed as
(3)
where
D2A”
and D2Qn are, respectively, the second derlvatlves ofA”
and Q”, eo IS a posltlve control parameter, and T:; a truncated function that avoids metric degeneration5, lfEg<2<E1, 2-,6’(z) = Eg, lf Z 560,
Conservative Grid Adaptation Technique 31
where, usually, EO = l/&,, and ~1 = l/1&,,, bemg 1,,, and 1,,,, the maximal and mmlmal allowed length for mesh edges, respectively
Note that
An
and Q” are unknowns as they are the solution of the problem at time t = t,, therefore, the metric tensorM 1s
approximated using the numerical solution at timet = t,,
Ax, Q;t
For more details and the extension to bldlmenslonal domains, see [6,7]4. CONSERVATIVE
MESH ADAPTATION
ALGORITHM
Once the metric tensor M 1s computed, the mesh 1s adapted using a amsotroplc Delaunay algorithm For eke-dlmenwonal meshes, the algorithm 1s simple (see [6,7]) let d, be the length of the edge a, with respect to the metric tensor
M
Three possible cases can be dlstmgulshedl If dz > &ax (&ax M 1 4), then a, 1s cut mto two edges The length of the new edges 1s computed and they are split until the length of all the new edges 1s smaller than
d,,,
l
If d, < dm (dmn x 0
6), then the edge a, 1s suppressed As this process implies that nelghbour edges change, we must check d then lengths are larger thand,,
In that case, the previous step 1s apphed to the correspondmg edgesl If d,,,, 5 d, 5 LX, a, 1s kept
One of the most difficult problems on mesh adaptation 1s the mterpolatlon of the numerlcal solution onto the adapted mesh This 1s crltlcal If the studied phenomena are unsteady A deficient mterpolatlon could spoil the good properties of the numerlcal scheme, as conservation and monotomclty The usual mterpolatlon operator m mesh adaptation 1s the linear one, but this operator, m general, 1s not conservative This means that, given the numerical solution of the shallow water equations over the mesh Th at time step 12,
(AZ, Q;t),
being
nh'[A;l],
J&C
[&El
a contmuous plecewlse linear mterpolatlon of(AZ, QK)
over the adaptedmesh,
TA,
at time t = t,In order to guarantee the conservation of variables during the mesh adaptation process, we propose the followmg mterpolatlon operator l-I&
[AK] 1s
the contmuous piecewise hnear function over the mesh Tht such as.L -%
&[A;]
(w;) = “;,
,
(4
where ~(1 1s a vertex of Tht,
C; 1s
the cell associated to w;, and IC; 1 1s the length of cell Ci Note that J&T,,AK
could be difficult and expensive to calculate IfTh # Tht
We can avoid this problem if we perform this computation during the mesh adaptation loop, since Cin
Th 1s
easily determined
Using conservative mterpolatlon together with mesh adaptation, the dlscretlsatlon error and CPU time can be reduced substantially for unsteady problems (see Table 1)
5. NUMERICAL
RESULTS
5.1.
Dam Break ProblemThis 1s an mterestmg problem to test the efficiency of conservative mesh adaptation algorithms for nonsteady flows with shocks smce it has an analytical solution
This problem 1s generated by the homogeneous one-dimensional shallow water equations with the mltlal condltlons
i
hL,
lfX<-,L
h(z,O) = 2
L
Q&O) = 0
hR,
lfa:>-,2 In this case,
hL =
2,hR =
1, andL =
60mTable 1 Dam break problem
14
1 35
13
125
12
1 15
11
105
1
36 36 40
h&&
s
-7
15 21
11
05
' happd b(Jti _______ - hexact
10 20 30 40 50 60
Figure 1 Dam break problem with conservative mesh adaptation Comparison with the exact dutlon at time t = 2 5s, h,r_ = 2, hR = 1
If calculatron times used are so as to avord mteraction w&h the edges of the channel, boundary conditions are trrvral
Table 1 summarises the results obtained for the Q-scheme of Poe and the TVD-McCormack scheme (TVD-MC) with a uniform mesh and also for the Q-scheme of Roe with conservative and nonconservative adaptation at time t = 2 5 s As can be observed, the Q-scheme of Roe + conservatrve adaptation only needs 332 nodes to obtain an error of 0 053 units If a uniform mesh is used, the number of nodes must be about 3000 for a simrlar error For a higher-order scheme as the TVD-MC, the number of nodes is about 1000 Note that, if a nonconservative mesh adaptation algorithm 1s used, the approxrmation error increases up to 0 0583 units The reduction of CPU time for a similar tolerance error is significant, if mesh adaptation is used and note that the computational cost for conservative and nonconservative adaptation is practically the same
Figure 1 shows a comparrson between the numerical solution for the dam break problem with conservative mesh adaptation and the exact solution at time t = 2 5 s
5.2. A Steady Flow in a Converging-Diverging Channel
In order to analyse the behaviour of conservatrve mesh adaptatron, a classrcal problem has been selected a transcritical case m a steady flow m a convergmg-diverging channel with flat bed The width variation modrfies the steady-state profiles, and due to the boundary condrtions, a stationary hydrauhc Jump appears to connect subcrrtrcal and supercritrcal flows
More precisely, the geometrrcal domain of the flow is an mterval of L = 500m with flat bed
and a smusoidal width varratron given by
B(x)
=
5-07065(I+cos(,,(~))), If/X-2501<150,18
18
14
12
1
Conservative Grid
' Ada$tedmbsh I
Adaptation Technique 33
2
'TvDk'
1
10-
IB-
Figure 2 Steady flow m a converging-diverging channel Comparison between con- servatlve adaptation and the TVD-MC scheme
Table 2 Steady flow m a converging-dlvergmg channel
Conservative Roe Nonconservative Roe
N Nodes Error CPU Tune 3000 0 328287 8996 s
550 1 0 194526 1 364 s
Subcritrcal mitral condrtrons are stated at a depth h(z, 0) = 2 m As boundary condrtrons, the discharge Q(0, t) = 20 cum/s at the upstream and a 0 1 m high weir condrtion (see [2,3]) at the downstream boundary are imposed As Figure 2 shows, the water accelerates as rt approaches to the pomt of maximal contractron, the flow becomes crrtrcal there and rt changes then to supercrrtrcal flow that gives rise to a statronary hydraulic Jump to connect with the subcritical profile required by the downstream condrtron
Figure 2 shows the numerical solutron obtained with the TVD-MC scheme with a uniform mesh and with the Q-scheme of Poe with conservattve adaptation Table 2 summarises the numerical experiments for the different schemes with and without conservative adaptation Note that, m this case, conservative and nonconservatrve adaptation give srmrlar results and CPU time 1s consrderably reduced when mesh adaptation 1s used
5.3. Surge Propagation Through Converging-Diverging Channel
In this example, the geometrical domain for the flow is an interval of L = 500 m wrth flat bed and a smusordal width varratron given by
B(x)
=
5-07065{l+cos(2a(~))}, lf]X-250]<150,I
5,
otherwiseIn thus case, the exact solutron cannot be obtained, and only comparisons wrth other schemes can be performed
The time evolutron of a surge 1s considered A bore 9 79 m deep of 1000 cum/s propagates downstream over still water 1 m deep A 2 m weir 1s supposed to be placed downstream At time t = 150 s the downstream end 1s reached by a front srmrlar to the mrtial one so that rt 1s partrally reflected and partrally transmitted over the weir (see Figure 3) Only 142 nodes are needed to
t=l50 .g Adapted mest 24 -
22 -
20 -
13 -
16 -
14 -
12 -
0 50 loo 150 200 250 300 350 400 : 450 500
r I I 4 I
t=l!iO s TbD-Mf! (
24 -
22 t 20 -
18 -
16 - 14 - 12 -
0 50 100 150 200 250 300 350 400 450 500
Figure 3 Surge propagation m a convergmg-dlvergmg channel Comparison between conservative adaptation and TVD-MC scheme at time t = 150s
24 =600 8 Adc 22
20
I---
18 t 16 - 14 -
12- A
24 22 20 18 16 14 12
t=6oor VD-!vlC -!--
0 50 100 150 200 250 300 350 400 450 500 0 50 100 150 200 250 300 350 400 450 50 0
Figure 4 Surge propagation m a converging-dlvergmg channel Comparison between conservative adaptation and TVD-MC scheme at time t = 600s
obtain a good approxlmatlon if conservative mesh adaptation 1s used, while a uniform mesh of 600 nodes 1s needed if TVD-McCormack 1s used The reflected surge starts travelhng upstream and It propagates until It becomes a stationary hydraulic Jump m the contracting region This final steady state 1s shown m Figure 4 The total CPU cost when using mesh adaptation 1s 186 seconds while the total CPU time when using TVD-McCormack 1s 360 seconds m a PENTIUM II (333 Mhz )
6. CONCLUSIONS
Conservative mesh adaptation has been applied with success to 1D unsteady problems The idea of the method 1s simple and it can be easily applied to other problems The apphcatlon to 2D and 3D configuration 1s straightforward
Conservative mterpolatlon guarantees the conservation of all the variables durmg mesh adap- tation and, as the results show, the numerical error 1s reduced when It 1s used The global CPU requirement IS slgmficantly reduced compared with a direct computation on a uniform fine mesh
Conservative Grid Adaptation Technique 35
REFERENCES
1 A Bermudez and M E VLquez, Upwmd methods for hyperbohc conservation laws with source terms, Com-
puters and Fluzds 23 (8), 1049-1071, (1994)
2 P Garcia-Navarro and F Alcrudo, Imphclt and explicit TVD methods for chscontmuous open channel flows, In Proc of the 2 nd Znt Conf on Hydraulrc and Envzronmental Modellang of Coastal, Estuanne and Rzver
Waters, Volume 2, (Edlted by Fl A Falconer, K Shlono and R G S Matthew), Ashgate, (1992)
3 P Garcm-Navarro and F Alcrudo, 1D open channel flow simulation usmg TVD McCormack scheme, J of
Hyd Engm ASCE 118, 1359-1373, (1992)
4 P L Roe, Approximate Rlemann solvers, parameter vectors and difference schemes, J of Comput Phys 43, 357-371, (1981)
5 P L Roe, Upwmdrng dlfferenced schemes for hyperbohc conservation laws with source terms, In Proceedzngs of the Conference on Hyperbohc Problems, (E&ted by C Carssso, P-A Ftaviart, and D Serre), pp 41-51, Spnnger, (1986)
6 M J Castro, F Hecht, B Mohammadl and 0 Plronneau, Amsotroplc unstructured mesh adaptation for flow slmulatlons, Znt J Numer Meth 2n Fluzds 25, 475-491, (1997)
7 M Castro-Dlaz, Genera&n y adaptacdn amdtropa de mallados de elementos fmltos para la resolu&n num&ica de E D P aphcaclones, Ph D Umversldad de MBlaga, (1996)