Mar 30, 1999 - This paper describes UTPROJ, the University of Texas PROJection .... this system using diagonally preconditioned conjugate gradient iteration.
CEWES MSRC/PET TR/99-04
UTPROJ: The University of Texas Projection Code for Computing Locally Conservative Velocity Fields by Mary F. Wheeler Clint Dawson Jichun Li Victor Parr
04h00299
UTPROJ: The University of Texas Projection Code for Computing Locally Conservative Velocity Fields
Mary F. Wheeler, Clint Dawson, Jichun Li and Victor Parr March 30, 1999
1 Introduction In the numerical modeling of uid ow and transport problems, the computed velocity eld frequently needs to be projected from one grid to another between dierent models. Usually the ow and multi-species transport are solved separately using completely dierent numerical methods and grids due to dierences in length and time scales of the phenomena involved. For accurate transport, it is often desirable for the velocities to be locally conservative on the transport grid. If we do not have local mass conservation it amounts to adding spurious sources and sinks to the transport equation [4]. Local mass conservation can be accomplished through a projection algorithm. One particular example where projection is needed is in the modeling of surface ow. The velocities computed from a ow model, e.g., ADCIRC [8] (an advanced circulation model for shelves, coasts and estuaries based on unstructured triangular grids) or RMA [7] (also uses unstructured triangular grids), are used as input to a transport model, such as CE-QUAL-ICM [3] (a water quality model using unstructured quadrilateral grids). These codes are widely used by U.S. Army Corps of Engineers at the Waterways Experiment Station in Vicksburg, Mississippi, and other state and federal agencies in environmental quality modeling. Therefore, there is a need to couple these
ow and water quality models and perform a projection to produce a locally conservative velocity eld on the transport grid. This paper describes UTPROJ, the University of Texas PROJection code, which constructs locally mass conservative velocity elds by solving scalar linear second order elliptic equations. The code is built on TUF (the Texas Unstructured Flow program in C++) [5] and an algorithm described in [4]. TUF was developed to solve elliptic equations on general unstructured meshes in two and three space dimensions using mixed nite element methods [2]. The user interface to UTPROJ is based on Keenan's Kscript package [6], a powerful and plain English like script laguage. The input to UTPROJ3D-2D is easily obtained through a preprocessing of the output from the
ow model in Tecplot (a widely used graphics package) format. In the next sections, we describe the numerical formulation used in UTPROJ and give some numerical examples. Texas Institute for Computational and Applied Mathematics, The University of Texas at Austin, 105 Dean Keaton Street; C0200, Austin, Texas 78712.
1
ξ
hb
Bottom sea bed
Figure 1: De nitions of ; hb and h
2 Details of the Numerical Algorithm To be consistent, we use the same notations as in [4]. Let 2 Rn , n = 2 or 3, be the physical domain which is being modeled and @ the external boundary of this domain. The general form of the conservation of mass in modeling surface water ow is given by[10]: or
@h + r (hU) = q; for 2D; xy @t
(1)
U = q; for 3D: (2) In the above equation, h = + hb is the surface elevation (see Figure 1), U is the velocity vector eld in 3D (or the depth averaged velocity eld in 2D), r (or rxy ) is the spatial gradient operator in 3D (or 2D) and q represents the sources and sinks that may be present in the ow domain. Let ho be the mesh parameter of the old grid and hn be the mesh parameter of the new grid, where the projected velocities are desired. Further, let Vho and Vhn be the nite dimensional subspaces corresponding to the old and new meshes. The main idea of our projection algorithm is to nd a locally mass conservative velocity Uhn 2 Vhn from Uho 2 Vho : For this purpose, the new velocity Uhn is expressed in terms of the old velocity Uho in the following manner: r
Uhn = Phn Uho + ,hn 2 Vhn ;
(3)
where Phn Uho is the L2 (or other equivalent) projection into Vhn of the old velocity Uho and ,hn 2 Vhn is the velocity correction which we need to compute. Generally speaking, we want Uhn to satisfy the mass conservation law given by: U hn = f Uhn = g r
in ; on @ :
Substituting (3) into (4), we obtain the following boundary value problem: r,hn = f , rPhn Uho = ~ f in ; ,hn = 0 on @ : 2
(4)
(5)
To solve the problem, we denote ,hn = ,rhn ; where the scalar variable hn is a pseudo-pressure. Hence we obtain the following elliptic problem: ,4hn = ~f on ; (6) ,rh = 0 on @ : The elliptic problem given by (6) is solved by using the mixed/hybrid nite element method which approximates both uxes , and pressures . In addition, the uxes , = ,r are continuous across the edges and the resulting numerical solution satis es mass conservation cell-by-cell. The mixed/hybrid nite element approximation of the elliptic problem (6) along with velocity relations (3) represent the conservative velocity projection formulation. On the new grid, the elliptic problem is solved using the lowest order Raviart-Thomas spaces:
and
Whn (E ) = fa 2 R on E g ;
(7)
Vhn (E ) = f( + x; + y; C1 + C2 z )T ; ; ; ; C1 ; C2 2 R; (x; y; z ) 2 E;
(8)
hn (@E ) = fa 2 R on @E g ; (9) where E is any given (triangular, rectangular, tetrahedral, hexahedral or prismatic) element. Here C1 = C2 = 0 in 2D. The nite dimensional scalar and vector spaces on the new grid are de ned as: n
o
Whn = w 2 L2 ( ) : wjE 2 Whn (E ); 8E ; n
Vhn = v 2 (L2 ( ))d : vjE 2 Vhn (E ); 8E
and
o
hn = f : j@ E 2 hn (@ E); 8Eg : Here d is the spatial dimension. The mixed/hybrid nite element method for the second-order elliptic problem is: Find (,hn ; hn ; hn ) 2 (Vhn ; Whn ; hn ) such that
(,hn ; vhn )E , (hn; rvhn )E + hhn ; vhn E i@E = 0 (r,hn ; whn )E = ~f; whn E P @E h,hn E ; hn i@E = 0 ,hn = 0 on @ ;
(10) (11) (12)
8 vhn 2 Vhn ; vhn = 0 on @ ; 8 whn 2 Whn ; (13) 8 hn 2 hn ;
where (; )E and h; i@E are the usual inner product on E and @E , and E is the unit outward normal to @E . In the third equation the sum is over all element boundaries. Note that this equation enforces the continuity of the normal ux across element edges in the interior of . Equations (13) gives rise to a linear algebraic system of the form 2 6 4
A ,B C BT 0 0 CT 0 0
32 76 54
3
3
2
3
0 , 75 = 64 F 75 ; 0
(14)
where A is symmetric and positive de nite, and B and C are rectangular. Eliminating , and in terms of , we obtain a symmetric positive de nite system in variables only. UTPROJ solves this system using diagonally preconditioned conjugate gradient iteration. Once is known, then and can be determined. More information on the mixed/hybrid nite element method and implementation details can be found in [2].
3 Numerical examples In this section, we give three numerical examples, two two-dimensional examples and one threedimensional example. The rst problem is a standard test problem in hydrodynamics, the quarter annular harbor problem. The domain and nite element mesh for this example are given in Figure 2. On the inner circle of the annulus, a land boundary is prescribed and on the outer circle elevation is speci ed. The lateral boundaries were modeled as a solid wall. Velocities were generated using the ADCIRC hydrodynamics code. In this code, velocities and elevation are computed at the nodes of the nite element mesh. The velocities at a speci ed time are plotted at the nodes in Figure 2. For this velocity eld, the local mass error was computed and plotted in Figure 3. As shown in this gure, the mass error is on the order of 103 to 104 for most of the elements. The local mass error after postprocessing is given in Figure 4, indicating that UTPROJ has reduced the error to about 10,5 over the entire domain. For this example, the code took 103 conjugate gradient iterations and 260 milliseconds to compute the solution. The second problem is representative of coupling between a ow and transport algorithm. Here we model a scenario of a contaminant (e.g. oil) spill in the Houston Ship Channel. The physical domain and nite element mesh are given in Figure 5. A constant source of contaminant is released near the entrance to the ship channel. The contaminant concentration c, is assumed to satisfy the transport equation @ (hc) + r (hUc) = 0: (15) xy @t Velocities were computed using the ADCIRC code simulating a period of two days using thirty second time steps. The transport solution was computed on the same grid, using 7.5 minute time steps. The velocities are time averaged before being projected. Transport is approximated using a one point upwinding scheme on each triangular element. This approach is similar to the nite volume method used in CE-QUAL-ICM, restricted to two space dimensions. A plot of the tracer solution after several hours of ow, is given in Figure 6, indicating the spread of contaminant through the coastal environment. The nal example is a three-dimensional example, with mesh given in Figure 7. In this problem we have three layers of prismatic elements. A non-conservative velocity eld is de ned at the nodes of the mesh, then projected conservatively onto the prisms. Local mass errors before and after postprocessing for each of the three layers are given in Figures 8, 9 and 10.
4 Conclusions and future work There are several avenues for improvement of the present code. First, the code is still too slow for production work. A better linear solver needs to be developed, and the code needs to be ported 4
to parallel platforms. Moreover, more complete testing on three-dimensional cases needs to be performed.
5 Acknowledgment This work was supported in part by a grant of HPC time from the DoD HPC Modernization Program.
References [1] T. Arbogast, C.N. Dawson and P.T. Keenan, Ecient Mixed Methods for Groundwater Flow on Triangular or Tetrahedral Meshes, Computational Methods in Water Resources X, (Peters et. al., editors), Kluwer (1994), pp. 3{10. [2] F. Brezzi and M. Fortin, Mixed and hybrid nite element methods, Springer-Verlag, New York, 1991. [3] C.F. Cerco and T. Cole, \User's Guide to the CE-QUAL-ICM Three-Dimensional Eutrophication Model, Release Version 1.0," Technical Report EL-95-15, U.S. Army Engineer Waterways Experiment Station, Vicksburg, MS, 1995. [4] S. Chippada, C.N. Dawson, M.L. Martinez and M.F. Wheeler, Projection Method for Constructing a Mass Conservative Velocity Field, Comp. Meth. Appl. Mech. Eng. 157, pp. 1-10, 1998. [5] P.T. Keenan, TUF 2.5 User Manual, TICAM Report 96-10, University of Texas at Austin, 1996. [6] P.T. Keenan, kScript User Manual, Dept. of Computational and Applied Mathematics Tech. Report #95{02, Rice University, 1995. [7] I.P. King and W.R. Norton, \Recent application of RMA's nite element models for twodimensional hydrodynamics and water quality." in Finite Elements in Water Resources II, C. A. Brebbia, W. G. Gray, and G. F. Pinder, eds., Pentech Press, London, 1978. [8] R.A. Luettich, Jr., J.J. Westerink and N.W. Schener, \ADCIRC: An Advanced ThreeDimensional Circulation Model for Shelves, Coasts and Estuaries," Report 1, U.S. Army Corps of Engineers, Washington, D.C. 20314-1000, December 1991. [9] R.A. Raviart and J.M. Thomas, \A mixed nite element method for 2nd order elliptic problems," Mathematical Aspects of the Finite Element Method, Lecture Notes in Mathematics, Springer-Verlag, New York, vol.606 (1977), pp.292-315. [10] W. Tan, Shallow Water Hydrodynamics, Elsevier Oceanography Series, 55, Elsevier, Amsterdam, 1992.
5
50000
63
56
95 96 62
55 94
61
54
92 91
60
53 90
49
84
72 82
93
40000
83
79 78
48
42 71
81 80
47 69 68
46
70 40
41
59
60
58
35
34
48 57 77 66 39 55 56 33 47 28 45 65 45 46 87 75 76 54 64 44 58 27 38 32 51 53 35 86 44 63 74 26 43 34 85 36 51 52 31 41 73 42 62 37 57 50 25 61 21 43 50 30 40 31 33 20 32 24 36 49 30 39 24 19 29 37 38 23 29 21 18 27 28 20 17 22 23 22 26 17 14 16 25 16 13 18 19 12 15 13 11 12 14 15 10 10 9 7 6 8 3 2 11 8 9 4 5 1 1 2 3 4 5 6 7 89
30000
59
Y
88
20000
10000
0
0
67
52
10000
20000
30000
40000
50000
X
Figure 2: 2D test problem: the mesh and velocity eld
massOld -2.9302E+03 -4.3583E+03 -5.7863E+03 -7.2144E+03 -8.6424E+03 -1.0070E+04 -1.1499E+04 -1.2927E+04 -1.4355E+04 -1.5783E+04 -1.7211E+04 -1.8639E+04 -2.0067E+04 -2.1495E+04 -2.2923E+04
50000
40000
40000
Y
30000
Y
30000
20000
20000
10000
10000
0
0
10000
20000
30000
40000
0
50000
X
Figure 3: 2D test problem: local mass error.
massNew 6.1141E-05 5.4519E-05 4.7898E-05 4.1276E-05 3.4654E-05 2.8033E-05 2.1411E-05 1.4789E-05 8.1674E-06 1.5457E-06 -5.0760E-06 -1.1698E-05 -1.8319E-05 -2.4941E-05 -3.1563E-05
50000
0
10000
20000
30000
40000
50000
X
(Left) before postprocessing (Right) after postprocessing
6
San Jacinto River
Trinity River
Buffalo Bayou Morgans Point
Trinity Bay
int Galveston h Po Smit Bay East Bay la su nin Eagle Point en rP a v i l Bo
Clear Lake
Houston Ship Channel Entrance Chocolate Bayou
S an
d West slan Bay on I st Gulf of Mexico e lv Ga
Galveston Bay 2113 Nodes, 3397 Elements Luis Pa
ss
Figure 4: Galveston Bay and nite element mesh
Figure 5: Contaminant concentration in area near spill
7
Z
X
Y
Figure 6: 3D test problem: the mesh and velocity eld
massOld 7.0075E+03 6.2621E+03 5.5167E+03 4.7713E+03 4.0259E+03 3.2805E+03 2.5351E+03 1.7897E+03 1.0443E+03 2.9886E+02 -4.4654E+02 -1.1919E+03 -1.9374E+03 -2.6828E+03 -3.4282E+03
3.156E+06
3.155E+06
3.154E+06
3.156E+06
3.155E+06
3.154E+06
Y
3.153E+06
Y
3.153E+06
massNew 5.5498E-02 5.0617E-02 4.5737E-02 4.0856E-02 3.5975E-02 3.1095E-02 2.6214E-02 2.1334E-02 1.6453E-02 1.1572E-02 6.6917E-03 1.8111E-03 -3.0695E-03 -7.9501E-03 -1.2831E-02
3.152E+06
3.152E+06
3.151E+06
3.151E+06
3.15E+06
3.15E+06
3.149E+06
3.149E+06
3.148E+06
3.148E+06
755000
760000
755000
X
760000
X
Figure 7: 3D test problem: local mass error on the bottom layer: after postprocessing
8
(Left) before postprocessing (Right)
massOld 1.0084E+04 8.9409E+03 7.7978E+03 6.6546E+03 5.5115E+03 4.3684E+03 3.2253E+03 2.0822E+03 9.3906E+02 -2.0405E+02 -1.3472E+03 -2.4903E+03 -3.6334E+03 -4.7765E+03 -5.9196E+03
3.156E+06
3.155E+06
3.154E+06
3.156E+06
3.155E+06
3.154E+06
Y
3.153E+06
Y
3.153E+06
massNew 4.0803E-02 3.7300E-02 3.3796E-02 3.0293E-02 2.6789E-02 2.3285E-02 1.9782E-02 1.6278E-02 1.2774E-02 9.2708E-03 5.7672E-03 2.2635E-03 -1.2401E-03 -4.7437E-03 -8.2473E-03
3.152E+06
3.152E+06
3.151E+06
3.151E+06
3.15E+06
3.15E+06
3.149E+06
3.149E+06
3.148E+06
3.148E+06
755000
760000
755000
X
760000
X
Figure 8: 3D test problem: local mass error on the 1st layer above the bottom: (Right) after postprocessing
massOld 1.9290E+03 1.6050E+03 1.2811E+03 9.5709E+02 6.3311E+02 3.0914E+02 -1.4836E+01 -3.3881E+02 -6.6279E+02 -9.8676E+02 -1.3107E+03 -1.6347E+03 -1.9587E+03 -2.2827E+03 -2.6066E+03
3.156E+06
3.155E+06
3.154E+06
massNew 2.1462E-02 1.8385E-02 1.5309E-02 1.2232E-02 9.1558E-03 6.0793E-03 3.0028E-03 -7.3763E-05 -3.1503E-03 -6.2268E-03 -9.3034E-03 -1.2380E-02 -1.5456E-02 -1.8533E-02 -2.1610E-02
3.156E+06
3.155E+06
3.154E+06
Y
3.153E+06
Y
3.153E+06
(Left) before postprocessing
3.152E+06
3.152E+06
3.151E+06
3.151E+06
3.15E+06
3.15E+06
3.149E+06
3.149E+06
3.148E+06
3.148E+06
755000
760000
755000
X
760000
X
Figure 9: 3D test problem: local mass error on the surface layer: after postprocessing
9
(Left) before postprocessing (Right)