24
1st Reading June 16, 2005 18:35 WSPC/103-M3AS 00079 Mathematical Models and Methods in Applied Sciences 1 Vol. 15, No. 9 (2005) 1–24 c World Scientific Publishing Company 3 THE WATER CONVEYANCE PROBLEM: OPTIMAL PURIFICATION OF POLLUTED WATERS 5 L. J. ALVAREZ-V ´ AZQUEZ* and A. MART ´ INEZ Departamento de Matem´ atica Aplicada II, 7 ETSI Telecomunicaci´ on, Universidad de Vigo, 36200 Vigo, Spain 9 [email protected] [email protected] 11 R. MU ˜ NOZ-SOLA and C. RODR ´ IGUEZ § Departamento de Matem´ atica Aplicada, 13 Facultad de Matem´ aticas, Universidad de Santiago de Compostela, 15782 Santiago, Spain 15 [email protected] § [email protected] 17 M. E. V ´ AZQUEZ-M ´ ENDEZ Departamento de Matem´ atica Aplicada, 19 Escola Polit´ ecnica Superior, Universidad de Santiago de Compostela, 21 27002 Lugo, Spain [email protected] 23 Received 22 November 2004 Revised 17 February 2005 25 Communicated by T. Teaduyar In this work we deal with the optimal purification of polluted areas of shallow waters 27 by means of the injection of clear water in order to promote seawater exchange. This problem can be formulated as a control constrained optimal control problem where the 29 control is the velocity of the injected water, the state equations are the shallow water equations together with that modelling the contaminant concentration, and the cost 31 function measures the total amount of injected water and the fulfilment of the water quality standards. We analyze the solutions of the optimal control problem and give 33 an optimality condition in order to characterize them. We also discretize the problem by means of a characteristics-mixed finite element method, focusing our attention on 35 both the discrete and the discretized adjoint systems, and propose an algorithm for the numerical resolution of the discrete optimization problem. Finally, we present numerical 37 results for some computational experiments. Keywords : Optimal control; numerical optimization; shallow water; pollution. 39 AMS Subject Classification: 49K20, 76D55, 93C20 1

benasque.orgbenasque.org/2005pde/contributions/2_AlvarezVazquez.pdf · 1 st Reading June 16, 2005 18:35 WSPC/103-M3AS 00079 1 Mathematical Models and Methods in Applied Sciences Vol

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    Mathematical Models and Methods in Applied Sciences1Vol. 15, No. 9 (2005) 1–24c© World Scientific Publishing Company3

    THE WATER CONVEYANCE PROBLEM:OPTIMAL PURIFICATION OF POLLUTED WATERS5

    L. J. ALVAREZ-VÁZQUEZ* and A. MARTÍNEZ†

    Departamento de Matemática Aplicada II,7ETSI Telecomunicación, Universidad de Vigo,

    36200 Vigo, Spain9∗[email protected][email protected]

    R. MUÑOZ-SOLA‡ and C. RODRÍGUEZ§

    Departamento de Matemática Aplicada,13Facultad de Matemáticas, Universidad de Santiago de Compostela,

    15782 Santiago, Spain15‡[email protected]

    §[email protected]

    M. E. VÁZQUEZ-MÉNDEZ

    Departamento de Matemática Aplicada,19Escola Politécnica Superior,

    Universidad de Santiago de Compostela,2127002 Lugo, [email protected]

    Received 22 November 2004Revised 17 February 200525

    Communicated by T. Teaduyar

    In this work we deal with the optimal purification of polluted areas of shallow waters27by means of the injection of clear water in order to promote seawater exchange. Thisproblem can be formulated as a control constrained optimal control problem where the29control is the velocity of the injected water, the state equations are the shallow waterequations together with that modelling the contaminant concentration, and the cost31function measures the total amount of injected water and the fulfilment of the waterquality standards. We analyze the solutions of the optimal control problem and give33an optimality condition in order to characterize them. We also discretize the problemby means of a characteristics-mixed finite element method, focusing our attention on35both the discrete and the discretized adjoint systems, and propose an algorithm for thenumerical resolution of the discrete optimization problem. Finally, we present numerical37results for some computational experiments.

    Keywords: Optimal control; numerical optimization; shallow water; pollution.39

    AMS Subject Classification: 49K20, 76D55, 93C20

    1

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    2 L. J. Alvarez-Vázquez et al.

    1. Introduction1

    Protection of the marine environment in Europe is generally carried out by means ofwater quality and emission standards. These limit the maximum concentration and3the quantity of contaminants which may be discharged into the sea, as can be seenfrom the environmental legislation instigated by the European Commission (see,5for instance, the directives of the Council of European Communities concerning thedischarge of dangerous substances, the quality of bathing water or the quality of7shellfish waters).

    Contaminants can be divided into a number of main types based on their ori-9gin: natural contaminants (those produced by nature: sediments, dissolved salts andorganic material), domestic contaminants (those produced in homes: mainly, sewage11and detergents), industrial contaminants (which cover the whole spectrum of pos-sible discharges) and agricultural contaminants (mainly, fertilizers, pesticides and13chemicals). All of these contaminants end up in the sea by river discharges, atmo-spheric transport, wastewater discharges or industrial waste disposal, and result in15the pollution of the marine environment. The impact of contaminants varies anddepends on both their quantity/concentration and the morphology of water region17into which they are discharged.

    Coastal pollution is generally controlled by treating contaminants at source or19at sewage farms by wastewater treatment methods in order to reduce their con-centration. In practice, several control parameters can be used (dissolved oxygen,21temperature, pH, heavy metals concentration, radioactivity, . . .), all of them givingindication of the water quality. To avoid sanitary problems, it is necessary to main-23tain a minimum or a maximum level of the parameter in each of the areas to beprotected: fisheries, bathing zones, marine recreation areas and so on.25

    We have recently studied, from both the theoretical and the numerical pointsof view, two related optimal control problem where the aim is to determine the27optimal level of the discharges and the optimal location of wastewater outfalls inorder to minimize the global purification cost and to maintain the water quality29standards (see Mart́ınez et al.15,16 and Alvarez-Vázquez et al.4,5). The optimalcontrol theory allows us to design a wastewater treatment system in order to control31marine pollution in any open area of shallow waters.

    However, there exist many closed areas (for instance, enclosed bays) which33present a serious quality problem caused by domestic and/or industrial contam-inants, due to the insufficient seawater exchange. In these areas where the ability35of natural purification is very weak, it is necessary to consider a new technique inorder to purify polluted waters: the most common strategy consists of promoting37seawater exchange by the injection of clear water from the outer sea. This strategypresents a high efficiency to purify polluted closed areas in a short period of time.39In this process of water conveyance the main problem consists, once the injectionpoint is selected by geophysical reasons, of finding the minimum quantity of water41which is needed to be injected into the closed area in order to purify it up to a fixedthreshold. The aim of this paper is to determine this minimal quantity of injected43

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 3

    water in order to ensure that the contaminant concentration in the protected areas1is lower than fixed thresholds. Mathematically, this is a parabolic optimal controlproblem with control constraints.3

    In Sec. 2 we present the mathematical formulation of the continuous controlproblem, giving a detailed description and justification of the state system, the cost5function and the set of admissible controls. The next section is devoted to the studyof the state system, specially to the weak formulation of the problem which will be7basic in further theoretical and numerical developments. Section 4 is devoted to theexistence of optimal solutions for the control problem, and the derivation of formal9optimality conditions in order to characterize them. In Sec. 5 we deal with thediscretization of the optimal control problem by means of a characteristics-mixed11finite elements method, obtaining the discrete adjoint system and the gradientof the approximated cost function. In Sec. 6 we present an alternative approach:13the use of the discretized adjoint system for obtaining another approximation ofthe cost gradient. Section 7 is devoted to the numerical resolution of a realistic15problem, where the optimization method (a limited-memory BFGS algorithm forbound constrained problems) is introduced and computational results are provided.17Final conclusions are presented in last section.

    2. The Mathematical Model19

    We consider a domain Ω ⊂ R2 occupied by shallow waters, for instance a ŕıa(estuary), a bay or a lake, and we assume that the contaminants are dumped into21the domain Ω through L submarine outfalls, each of them located at a point bj in Ωand connected to a sewage farm which discharges an amount mj(t), j = 1, . . . , L.23Moreover, we assume the existence of a highly polluted area A ⊂ Ω (for example,an enclosed bay) where the seawater exchange is poor, and we need to maintain the25water quality in that area with levels of pollution lower than the previously fixedvalue c.27

    In order to purify the region A we inject clear water through a portion Γ− ofthe boundary of Ω. We divide the remainder of the boundary of Ω into two parts:29Γ0 (corresponding to the coast) and Γ+ (corresponding to open sea) in such a waythat ∂Ω = Γ−∪Γ0∪Γ+. We denote by H(x, t), u(x, t) and ρ(x, t), respectively, the31height of water, the depth-averaged horizontal velocity of water and the depth-averaged contaminant concentration at any point x ∈ Ω and any time t ∈33(0, T ). The evolution of H,u and ρ along Ω × (0, T ) is obtained as the solutionof the boundary value problem coupling the shallow water equations with the35convection-diffusion-reaction equation for the contaminant concentration:

    ∂H

    ∂t+ ∇ · (Hu) = 0, in Ω × (0, T ),

    ∂u∂t

    + (u · ∇)u − ν∇(∇ · u) + g∇H = F in Ω × (0, T ),∂ρ

    ∂t+ u · ∇ρ + kρ − β∆ρ = 1

    H

    L∑j=1

    mjδ(x − bj) in Ω × (0, T ),37

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    4 L. J. Alvarez-Vázquez et al.

    H = η on Γ− × (0, T ),H = φ on Γ+ × (0, T ),H(0) = H0 in Ω,

    u · n = q on Γ− × (0, T ),u · n = 0 on Γ0 × (0, T ),∇ · u = 0 on Γ+ × (0, T ),u(0) = u0 in Ω,

    ρ = 0 on Γ− × (0, T ),∂ρ

    ∂n= 0 on (Γ+ ∪ Γ0) × (0, T ),

    ρ(0) = ρ0 in Ω,

    (2.1)

    where δ(x − bj), j = 1, . . . , L, denotes the Dirac measure at point bj, mj(t) is the1mass flow rate of BOD to be discharged in bj , n denotes the unit outer normalvector to boundary ∂Ω, and the second member F = g∇H0 − ∇Pa + τw − τb + C3collects all the effects due to bottom slope H0, atmospheric pressure Pa, windstress τw depending on wind velocity, bottom friction τb depending on the Chezy5coefficient, and Coriolis effect. We also assume that all the physical parametersare experimentally known: ν the coefficient of kinetic eddy viscosity, g the grav-7ity acceleration, β the horizontal viscosity coefficient and k a kinetic parameterrelated to temperature. The main point in this system corresponds to the diffusion9term in the shallow water equations: momentum diffusion is usually modelled (atfirst step, at least) by the Laplace operator ν∆u. The effect of this term on the11structure of the solution is usually small. The reason for including it is sometimesnon-physical,17 and it is related to the stability of the computational methods. In13our case, taking into account the equality ∆u = ∇(∇ · u) + rot(rotu), and thefact that we are dealing with shallow water, we propose to neglect the vorticity15term and model the diffusion under the form ν∇(∇ · u). The form of this term isimportant for the numerical discretization of the shallow water equations, because17it allows the use of the mixed finite element method to determine the velocity. Theuse of mixed elements in the discretization of the shallow water equations was first19introduced in the mathematical literature by Bermúdez et al.,7 more than a decadeago, with very accurate results. The boundary conditions on the injection boundary21Γ− correspond to the height of injected water η (assumed to be fixed), the velocityof clear water q (which will be the control of our problem) and the contaminant23concentration (assumed to be zero, since we are injecting clear water). The otherboundary conditions on the coast Γ0 and the open sea Γ+, as much as the initial25conditions, are classical (cf., for instance, Ref. 17 or 2).

    Since we need to inject water through Γ− we are led to consider only the admis-sible velocities in the set:

    Uad = {l ∈ L2(0, T ; L2(Γ−)) : 0 ≥ l}. (2.2)

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 5

    We formulate the control problem considering as the cost functional the totalamount of clear water injected through Γ− together with a measure in the region Aof the contaminant concentration which remains higher than the fixed threshold c.Thus, we define the cost function:

    J(q) =γ

    2

    ∫ T0

    ∫Γ−

    η2q2 +ε

    2

    ∫ T0

    ∫A

    (ρ − c)2+, (2.3)

    where γ and ε are two weight parameters, and (ρ − c)+ denotes the positive part1of ρ − c, i.e. (ρ − c)+ = max{ρ − c, 0}.

    Then the problem, denoted by (P), of the optimal water conveyance for thepurification of polluted areas consists of finding the control velocity q ∈ Uad ofinjected clear water in such a way that, verifying the state system (2.1), minimizesthe cost function J given by (2.3). Thus, the problem can be written as:

    (P) minq∈Uad

    J(q).

    3. The State System3

    The theory regarding existence, uniqueness and regularity for solutions to shal-low water equations is still incomplete and will not be discussed here: there exist5several works related to the study of solution of shallow water equations in par-ticular cases (in a first attempt to deal with the well-posedness of the shallow7water equations, Ton21 proved local, in time, existence and uniqueness of strongsolution to the Dirichlet problem using Hölder estimates and smooth initial data.9Later, Kloeden13 proved global existence and uniqueness of strong solution to thehomogeneous Dirichlet problem using Sobolev estimates. Subsequently, Sundbye2011proved global existence and uniqueness of strong solution to the Dirichlet prob-lem for small initial data and small forcing. From another point of view, Orenga1813obtained an existence result for the weak solution to the Dirichlet problem withnon-smooth data. In the same spirit, Chatelon and Orenga10 obtained smooth-15ness and uniqueness results for the weak solution to the problem in the case thatrotu = 0 and u · n is prescribed on the whole boundary). However, the analysis17of the general case is still an open problem. From a computational point of viewthe contributions have been more frequent: several numerical approximations of H19and u in Ω × (0, T ) can be obtained by finite difference, finite element or finitevolume methods (see, for instance, Refs. 7, 6, 1 and 11). For the solution of the21contaminant concentration equation starting from an achieved solution of the shal-low water equations several results can be seen, for instance, in Mart́ınez et al.15 A23very interesting related work is that of Kashiyama et al.12 where massively parallelfinite element strategies for large-scale computations of shallow water flows and con-25taminant transport are presented, although no optimization issues are addressed.The stabilized finite element discretizations, carried out on unstructured grids, are27based on a three-step explicit formulation both for the shallow water equations

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    6 L. J. Alvarez-Vázquez et al.

    and for the advection-diffusion equation governing the contaminant transport. The1method seems to be very efficient in the computation of tidal flows and contaminantconcentrations.3

    For our study we will need a suitable weak formulation of the state system (2.1).So, we consider the functional spaces

    U = W = {r ∈ H1(Ω): r|Γ− = 0},V = {z ∈ H1(Ω)2 : z · n|Γ−∪Γ0 = 0}.

    All along this work we will use extensively the method of characteristics, whichstems from considering the following equality:5

    Dy

    Dt(x, t) =

    ∂y

    ∂t(x, t) + u · ∇y, (3.1)

    where DyDt denotes the total derivative of function y with respect to t and u, i.e.7

    Dy

    Dt(x, t) =

    ∂τ[y(X(x, t; τ), τ)]

    ∣∣∣∣τ=t

    , (3.2)

    with τ → X(x, t; τ) the characteristic line, providing the position at time τ of the9particle that occupied the position x at time t. So, the characteristic line is theunique solution of the following ordinary differential equation:11

    dX

    dτ(x, t; τ) = u(X(x, t; τ), τ),

    X(x, t; t) = x.(3.3)

    Thus, the state system (2.1) can be written is the equivalent form13

    DH

    Dt+ H∇ · u = 0 in Ω × (0, T ),

    DuDt

    − ν∇(∇ · u) + g∇H = F in Ω × (0, T ),Dρ

    Dt+ kρ − β∆ρ = G

    Hin Ω × (0, T ),

    (3.4)

    with the same set of boundary and initial conditions as in Eq. (2.1), and where, forthe sake of simplicity, we note the measure

    G(x, t) =L∑

    j=1

    mj(t)δ(x − bj).

    We say that (H,u, ρ) is a weak solution of (3.4) if it satisfies

    H ∈ L2(0, T ; H1(Ω)), H|Γ− = η,u ∈ L2(0, T ; H1(Ω))2, u · n|Γ− = q, u · n|Γ0 = 0,ρ ∈ L2(0, T ; W ),

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 7

    and, in the sense of distributions on (0, T ),∫Ω

    DH

    Dtr +

    ∫Ω

    H∇ · u r = 0, ∀ r ∈ U,∫Ω

    DuDt

    · z + ν∫

    ∇ · u∇ · z− g∫

    H∇ · z =∫

    F · z − g∫

    Γ+φz · n, ∀ z ∈ V,∫

    Dty + k

    ∫Ω

    ρy + β∫

    ∇ρ · ∇y =〈

    G,y

    H

    〉, ∀ y ∈ W, (3.5)

    H(0) = H0 in Ω,

    u(0) = u0 in Ω,

    ρ(0) = ρ0 in Ω.

    This weak formulation will be the basis for the numerical approximations developed1in the following sections.

    4. The Optimal Control Problem3

    The question regarding the existence of solution for problem (P) is still an openproblem and will not be discussed here. The problem is non-convex because of the5nonlinearity of the state system, so uniqueness of solution is not expected.

    We will focus our attention on obtaining a formal first-order optimality condi-7tion satisfied by the solutions of problem (P). In order to express this necessaryoptimality condition in a simpler way we introduce, using the classical techniques,149the functions (p,w, s) solutions of the adjoint system:

    −∂p∂t

    − u · ∇p − g∇ · w + sH2

    G = 0 in Ω × (0, T ),

    −∂w∂t

    − ∇ · (u ⊗ w) + (∇u)Tw − ν∇(∇ · w)−H∇p + s∇ρ = 0 in Ω × (0, T ),

    −∂s∂t

    − ∇ · (su) + ks − β∆s + εχA(ρ − c)+ = 0 in Ω × (0, T ),w · n = 0 on (Γ− ∪ Γ0) × (0, T ),qw · τ = 0 on Γ− × (0, T ),φpn + (u · n)w + ν(∇ ·w)n = 0 on Γ+ × (0, T ),p(T ) = 0 in Ω,

    w(T ) = 0 in Ω,

    s = 0 on Γ− × (0, T ),∂s

    ∂n= 0 on Γ0 × (0, T ),

    (u · n)s + β ∂s∂n

    = 0 on Γ+ × (0, T ),s(T ) = 0 in Ω,

    (4.1)

    11

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    8 L. J. Alvarez-Vázquez et al.

    where τ denotes the unit tangent vector to boundary ∂Ω, and χA is the indicator1function of the set A, that is,

    χA(x) =

    {1, if x ∈ A,0, otherwise.3

    Remark 4.1. We must note that the first two boundary conditions for w onΓ− × (0, T ), i.e. w · n = 0 and qw · τ = 0, involve the condition qw = 0, and are5equivalent, whenever q �= 0, to the homogeneous Dirichlet condition:

    w = 0 on Γ− × (0, T ).7Now, assuming the solvability of the state system (2.1) and the adjoint system

    (4.1), we have the following result whose detailed proof can be seen in Appendix A:9

    Theorem 4.1. Let q ∈ Uad be a solution of the control problem (P). Then, thereexist (H,u, ρ) solutions of the state system (2.1) and (p,w, s) solutions of theadjoint system (4.1), such that it verify the relation:∫ T

    0

    ∫Γ−

    {γη2q + ηp + ν(∇ ·w)}(l − q) ≥ 0, ∀ l ∈ Uad. (4.2)

    5. The Discretized Problem

    Now we introduce discretizations of the state system and the cost function: a char-11acteristic scheme for time discretization and a mixed finite element method forspatial approximation. We must remark that no discretization is introduced for the13adjoint system and the cost gradient. In fact, once the discretizations for state andcost are chosen, this yields a unique discrete adjoint equation which gives us an15expression for the exact gradient of the discretized cost function.

    In order to discretize the state system (3.4) in time we use a first-order scheme.For the time interval [0, T ] we choose N ∈ N, we consider the time step ∆t = TNand define tn = n∆t, n = 0, 1, . . . , N. If we denote

    Xn(x) = X(x, tn+1; tn),

    then the total derivative of any function y(x, t) at instant tn+1 can be approxi-17mated by:

    Dy

    Dt(x, tn+1) y

    n+1(x) − yn(Xn(x))∆t

    , (5.1)19

    where yn stands for the approximation given by yn(x) = y(x, tn). We will denoteby y∆t = (y1, . . . , yN ). Then, the state system can be approximated by

    H0 = H0,

    u0 = u0,

    ρ0 = ρ0,

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 9

    for n = 0, . . . , N − 1:(Hn+1,un+1, ρn+1) ∈ H1(Ω) × H1(Ω)2 × W such thatHn+1|Γ− = ηn+1, un+1 · n|Γ− = qn+1,un+1 · n|Γ0 = 0, and∫

    Hn+1 − Hn ◦ Xn∆t

    r +∫

    Hn+1∇ · un+1 r = 0, ∀ r ∈ U,∫Ω

    un+1 − un ◦ Xn∆t

    · z + ν∫

    ∇ · un+1 ∇ · z − g∫

    Hn+1∇ · z

    =∫

    Fn+1 · z − g∫

    Γ+φn+1z · n, ∀ z ∈ V,∫

    ρn+1 − ρn ◦ Xn∆t

    y + k∫

    ρn+1y + β∫

    ∇ρn+1 · ∇y

    =〈

    Gn+1, yHn+1

    〉, ∀ y ∈ W.

    (5.2)

    Remark 5.1. This approximation (and the following ones) would be much simpler1from a computational point of view if the nonlinear and coupling terms would betreated complete explicitly.3

    For spatial approximation of this semi-discretized problem we will use a mixedfinite element method. As usual, we consider τh a regular finite element triangula-5tion of Ω (which will be assumed to be a polygonal domain of R2 from now on),where h is the discretization parameter corresponding to the maximal length of the7triangle edges in τh.

    Actually, we will use Raviart–Thomas19 mixed finite elements for approximatingthe pair (Hn+1,un+1) (that is, discontinuous piecewise constant (P0) functions forthe height Hn+1 and special discontinuous vector-valued functions for the velocityun+1), and continuous piecewise linear (P1) polynomials for approximating theconcentration ρn+1. That is, we approximate the functional spaces by the non-conforming finite element spaces:

    Uh = {rh ∈ L2(Ω): rh|K ∈ P0, ∀ K ∈ τh; rh|Γ− = 0},Vh = {zh ∈ L2(Ω)2 : ∇ · zh ∈ L2(Ω); zh|K ∈ (P1)2,

    zh · nK|∂K ∈ P0, ∀ K ∈ τh; zh · nK|Γ−∪Γ0 = 0},Wh = {yh ∈ C0(Ω̄) : yh|K ∈ P1, ∀ K ∈ τh; yh|Γ− = 0}.

    Remark 5.2. For instance, if we restrict to the reference triangle with vertices9(0, 0), (1, 0) and (0, 1), the functions of Vh will be in the three-dimensional vec-tor space spanned by the functions v1(x1, x2) = (x1,−1 + x2), v2(x1, x2) =11(√

    2x1,√

    2x2) and v3(x1, x2) = (−1 + x1, x2). For any other triangle K in τh, theusual affine transformation is necessary.13

    We must recall that functions in Vh are discontinuous, but their normal com-ponents are continuous and constant on the edges of the triangles. In fact, they are15taken as degrees of freedom.

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    10 L. J. Alvarez-Vázquez et al.

    Then, we choose the following fully discrete approximation of the state system:1

    H0h is the L2-projection of H0 onto Ũh,

    u0h is the L2-projection of u0 onto Ṽh,3

    ρ0h is the L2-projection of ρ0 onto Wh,

    for n = 0, . . . , N − 1:5(Hn+1h ,u

    n+1h , ρ

    n+1h ) ∈ Ũh × Ṽh × Wh such that

    Hn+1h |Γ− = ηn+1h , u

    n+1h · n|Γ− = qn+1h , un+1h · n|Γ0 = 0, and∫

    Hn+1h − Hnh ◦ Xnh∆t

    rh +∫

    Hn+1h ∇ · un+1h rh = 0, ∀ rh ∈ Uh,∫

    un+1h − unh ◦ Xnh∆t

    · zh + ν∫

    ∇ · un+1h ∇ · zh − g∫

    Hn+1h ∇ · zh

    =∫

    Fn+1 · zh − g∫

    Γ+φn+1zh · n, ∀ zh ∈ Vh,

    ∫Ω

    ρn+1h − ρnh ◦ Xnh∆t

    yh + k∫

    ρn+1h yh + β∫

    ∇ρn+1h · ∇yh

    =〈

    Gn+1,yh

    Hn+1h

    〉, ∀ yh ∈ Wh.

    (5.3)

    where Ũh = {rh ∈ L2(Ω) : rh|K ∈ P0, ∀ K ∈ τh}, Ṽh = {zh ∈ L2(Ω)2 : ∇ ·7zh ∈ L2(Ω); zh|K ∈ (P1)2, zh · nK|∂K ∈ P0, ∀K ∈ τh}, ηn+1h and qn+1h aresuitable approximations of the boundary conditions ηn+1 and qn+1 (obtained, for9instance, by interpolation at the boundary nodes of the triangulation), and Xnh isan approximation of Xn computed by using the backward Euler scheme, i.e.11

    Xnh (x) = x − ∆t unh(x).We also choose the following approximation of the cost function:

    J∆th (q∆th ) =

    γ

    2∆t

    N−1∑n=0

    ∫Γ−

    (ηn+1h )2(qn+1h )

    2 +ε

    2∆t

    N−1∑n=0

    ∫A

    (ρn+1h − c)2+. (5.4)

    Thus, the fully discrete control problem corresponding to (P) will be13(P∆th ) min

    q∆th ∈U∆tad,hJ∆th (q

    ∆th )

    where

    U∆tad,h = {lh ∈ L2(Γ−) : lh|∂K∩Γ− ∈ P0, ∀ K ∈ τh; 0 ≥ lh}N .In order to derive the discrete adjoint system and the gradient of the discrete cost15

    function we proceed by perturbation analysis. Although integration by parts wasused for obtaining the adjoint system (4.1), in the discrete case, partial summation17will replace integration in time, and no integration by parts will be used in spacesince the functions involved do not possess enough regularity.19

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 11

    After a tedious chain of computations, which can be seen in Appendix B, wecan obtain the discrete adjoint system:

    pNh = 0,

    wNh = 0,

    sNh = 0,

    for n = N − 1, . . . , 0:(pnh,w

    nh , s

    nh) ∈ Uh × Vh × Wh such that

    1∆t

    {∫Ω

    pnh rh −∫

    pn+1h (rh ◦ Xn+1h )}

    +∫

    pnh∇ · un+1h rh − g∫

    ∇ ·wnh rh

    +〈

    Gn+1,snh

    (Hn+1h )2rh

    〉= 0, ∀rh ∈ Uh,

    1∆t

    {∫Ω

    wnh · zh −∫

    wn+1h · (zh ◦ Xn+1h )}

    +∫

    wn+1h · (∇un+1h ◦ Xn+1h ) zh

    + ν∫

    ∇ ·wnh ∇ · zh +∫

    pn+1h (∇Hn+1h ◦ Xn+1h ) · zh

    +∫

    pnh Hn+1h ∇ · zh +

    ∫Ω

    sn+1h (∇ρn+1h ◦ Xn+1h ) zh = 0, ∀ zh ∈ Vh,1

    ∆t

    {∫Ω

    snh yh −∫

    sn+1h (yh ◦ Xn+1h )}

    + k∫

    snh yh + β∫

    ∇snh · ∇yh

    + ε∫

    χA(ρn+1h − c)+ yh = 0, ∀ yh ∈ Wh. (5.5)

    and derive an expression for the exact gradient of the discrete cost function, whichstrongly depends on our choices in the discretization processes:

    DJ∆th (q∆th )(δ

    ∆th )

    = γ∆tN−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δ

    n+1h

    +N−1∑n=0

    ∫Ω

    wnh · ψ(δn+1h ) −N−2∑n=0

    ∫Ω

    wn+1h · (ψ(δn+1h ) ◦ Xn+1h )

    + ∆t

    [N−2∑n=0

    ∫Ω

    wn+1h · (∇un+1h ◦ Xn+1h )ψ(δn+1h ) + νN−1∑n=0

    ∫Ω

    ∇ · wnh∇ · ψ(δn+1h )

    +N−2∑n=0

    ∫Ω

    pn+1h (∇Hn+1h ◦ Xn+1h ) · ψ(δn+1h ) +N−1∑n=0

    ∫Ω

    Hn+1h pnh∇ · ψ(δn+1h )

    +N−2∑n=0

    ∫Ω

    sn+1h (∇ρn+1h ◦ Xn+1h ) · ψ(δn+1h )]

    , ∀ q∆th ∈ U∆tad,h, ∀ δ∆th ∈ Cq∆th ,

    (5.6)

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    12 L. J. Alvarez-Vázquez et al.

    where Cq∆th is the cone of admissible directions based on q∆th , i.e.1Cq∆th = {δ

    ∆th : ∃ t > 0 such that q∆th + tδ∆th ∈ U∆tad,h}.

    6. An Alternative Approach3

    We will present now an alternative scheme consisting of the discretized (not thediscrete) adjoint system. The adjoint system (4.1) was previously obtained in Sec. 45by means of integration by parts techniques. This adjoint system can be written,by using the total derivative, in the following equivalent way:7

    −DpDt

    − g∇ · w + GH2

    s = 0 in Ω × (0, T ),

    −DwDt

    − (∇ · u)w + (∇u)Tw − ν∇(∇ · w)−H∇p + s∇ρ = 0 in Ω × (0, T ),

    −DsDt

    − s(∇ · u) + ks − β∆s + εχA(ρ − c)+ = 0 in Ω × (0, T ),

    (6.1)

    with the same set of boundary and initial conditions as in Eq. (4.1).9We say that (p,w, s) is a weak solution to (6.1) if it satisfies

    p ∈ L2(0, T ; H1(Ω)),w ∈ L2(0, T ; V ),s ∈ L2(0, T ; W ),

    and, in the sense of distributions on (0, T ),

    −∫

    Dp

    Dtr − g

    ∫Ω

    ∇ · w r +〈

    G,s

    H2r

    〉= 0, ∀ r ∈ H1(Ω),

    −∫

    DwDt

    · z +∫

    (u · ∇)w · z +∫

    w · (u · ∇)z +∫

    w · (∇u)z + ν∫

    ∇ · w ∇ · z

    +∫

    p∇H · z +∫

    pH∇ · z +∫

    s∇ρ · z = 0, ∀ z ∈ V,

    −∫

    Ds

    Dty +

    ∫Ω

    u · ∇s y +∫

    s u · ∇y + k∫

    s y+β∫

    ∇s · ∇y

    +ε∫

    χA(ρ − c)+ y = 0, ∀ y ∈ W,p(T ) = 0 in Ω,w(T ) = 0 in Ω,s(T ) = 0 in Ω.

    (6.2)

    For the time discretization we recall the definition of the time step ∆t = TN andthe discrete instants tn = n∆t, n = 0, 1, . . . , N. If we denote11

    Y n+1(x) = X(x, tn; tn+1),

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 13

    i.e. the position, at time tn+1, of the particle that was in x at the instant tn, then1the total derivative of any function y at instant tn can be approximated by:

    Dy

    Dt(x, tn) y

    n+1(Y n+1(x)) − yn(x)∆t

    . (6.3)3

    In this way, the adjoint system can be approximated by

    pN = 0,

    wN = 0,

    sN = 0,

    for n = N − 1, . . . , 0:

    (pn,wn, sn) ∈ H1(Ω) × V × W such that∫Ω

    pn − pn+1 ◦ Y n+1∆t

    r − g∫

    ∇ ·wn r +〈

    Gn,sn

    (Hn)2r

    〉= 0, ∀ r ∈ H1(Ω),∫

    wn − wn+1 ◦ Y n+1∆t

    · z +∫

    (un · ∇)wn · z +∫

    wn · (un · ∇)z

    +∫

    wn · (∇un)z + ν∫

    ∇ · wn ∇ · z

    +∫

    pn∇Hn · z +∫

    pnHn∇ · z +∫

    sn∇ρn · z = 0, ∀ z ∈ V,∫Ω

    sn − sn+1 ◦ Y n+1∆t

    y +∫

    un · ∇sn y +∫

    sn un · ∇y + k∫

    sn y

    + β∫

    ∇sn · ∇y + ε∫

    χA(ρn − c)+ y = 0, ∀ y ∈ W.

    For spatial approximation of this semi-discretized problem we will use a mixedfinite element method similar to previous section: we will use discontinuous piece-5wise constant functions for approximating pn, and discontinuous piecewise linearpolynomials for approximating wn and sn, the nodes being the midpoints of edges.7

    Thus, we choose the fully discretized approximation of the adjoint system:

    pNh = 0,

    wNh = 0,

    sNh = 0,

    for n = N − 1, . . . , 0:9(pnh,w

    nh , s

    nh) ∈ Ũh × Vh × Wh such that∫

    pnh − pn+1h ◦ Y n+1h∆t

    rh − g∫

    ∇ ·wnh rh +〈

    Gn,snh

    (Hnh )2rh

    〉= 0, ∀ rh ∈ Ũh,

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    14 L. J. Alvarez-Vázquez et al.

    ∫Ω

    wnh − wn+1h ◦ Y n+1h∆t

    · zh +∫

    (unh · ∇)wnh · zh +∫

    wnh · (unh · ∇)zh

    +∫

    wnh · (∇unh)zh + ν∫

    ∇ ·wnh ∇ · zh +∫

    pnh∇Hnh · zh

    +∫

    pnhHnh ∇ · zh +

    ∫Ω

    snh∇ρnh · zh = 0, ∀ zh ∈ Vh,∫Ω

    snh − sn+1h ◦ Y n+1h∆t

    yh +∫

    unh · ∇snh yh +∫

    snh unh · ∇yh + k

    ∫Ω

    snh yh

    + β∫

    ∇snh · ∇yh + ε∫

    χA(ρnh − c)+ yh = 0, ∀ yh ∈ Wh,

    (6.4)

    1

    where Y n+1h is an approximation of Yn+1 computed by using the forward Euler

    scheme, i.e.3

    Y n+1h (x) = x + ∆t unh(x).

    Finally, taking into account the expression obtained in Theorem 4.1 for the5derivative

    DJ(q)(δ) =∫ T

    0

    ∫Γ−

    [γη2q + ηp + ν(∇ · w)]δ,7

    we can obtain this alternative approximation of the gradient of the exact costfunction:

    DJ∆th (q∆th )(δ

    ∆th ) = γ∆t

    N−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δ

    n+1h

    + ∆t

    [N−1∑n=0

    ∫Γ−

    ηn+1h pn+1h δ

    n+1h + ν

    N−1∑n=0

    ∫Γ−

    (∇ · wn+1h )δn+1h]

    ,

    ∀ q∆th ∈ U∆tad,h, ∀ δ∆th ∈ Cq∆th . (6.5)

    Remark 6.1. At first glance, it might not be obvious that the expressions (5.6) and(6.5) are approximations of the same gradient. In order to show that this is indeed9the case we must note that the discretized gradient (6.5) only involves integralsover the boundary Γ− of functions corresponding to normal components, while the11discrete gradient (5.6) involves integrals over the whole domain Ω of functions thatare null except in a small neighborhood of that boundary and whose normal com-13ponents on Γ− are exactly the ones considered in the alternative expression (6.5).

    7. Numerical Results15

    In order to solve the discrete control problem (P∆th ) we will use a limited-memoryBFGS algorithm for bound constrained optimization problems. By numerical rea-sons, we will solve the following equivalent problem, where we have included an

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 15

    additional lower bound (actually related to technological constraints on the veloc-ity of injected clear water, which may not surpass a critical threshold):

    (P̃∆th ) minq∆th ∈Ũ∆tad,h

    J∆th (q∆th )

    where

    Ũ∆tad,h = {lh ∈ L2(Γ−) : lh|∂K∩Γ− ∈ P0, ∀K ∈ τh; 0 ≥ lh ≥ −Q}N

    for Q large enough.1If we consider am, m = 1, . . . , M, the nodes of the triangulation τh lying on the

    boundary Γ−, and we denote by3

    Q∆th ={{Qnm}Mm=1}Nn=1 ∈ RM×N ,

    where Qnm = qnh(am), the discrete control problem can be written in the form:

    (P̂∆th ) minQ∆th ∈[−Q,0]M×N

    Ĵ∆th (Q∆th )

    for the new cost function Ĵ∆th defined by Ĵ∆th (Q

    ∆th ) = J

    ∆th (q

    ∆th ).5

    The algorithm can be easily summarized in the following way: starting from aninitial admissible vector Q∆th (0), we construct a sequence of iterates Q

    ∆th (k+1), k =

    0, 1, 2, . . . , by the recursive formula:

    Q∆th (k + 1) = Π(Q∆th (k) − αk Dk ∇Ĵ∆th (Q∆th (k))

    ), (7.6)

    where for all vector Z∆th = {Znm} ∈ RM×N we denote by Π(Z∆th ) = {Πnm} ∈[−Q, 0]M×N the projected vector with coordinates

    Πnm =

    0 if Znm ≥ 0,Znm if −Q < Znm < 0,−Q if −Q ≥ Znm;

    αk is chosen by an Armijo-like stepsize rule and Dk is an adequately chosen positivedefinite matrix (see, for instance, Ref. 9 and the references therein). The discrete7gradient ∇Ĵ∆th (Q∆th (k)) can be obtained both from expression (5.6) or from alter-native expression (6.5). The convergence test is based on the norm of the cost9gradient with respect to the non-active variables and on the difference between twoconsecutive iterates. In case of stopping, the algorithm converges to a solution of11the discrete control problem (P̂∆th ).

    For the numerical experiments we have considered the following situation,13depicted in Fig. 1: the bay Ω, whose dimensions are about 10.5×4.9km, is occupiedby shallow water and the contaminants are dumped into the sea, through L = 115submarine outfall located at point b1, with constant rate m1 = 108. In order topurify the protected area A1 (in white in the picture) we inject clear water through17the boundary Γ−. We assume that the time interval [0, 3600] is divided into N = 20equal intervals (∆t = 180 seconds). For the discretization of Ω we use a mesh of19860 elements, where only M = 1 node lies over the boundary Γ−. In this node, the

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    16 L. J. Alvarez-Vázquez et al.

    Fig. 1. Domain Ω for numerical test.

    height of water is assumed to be η = 1m, in the open sea the boundary condition1over the height of water is a wave-like function.

    For solving the state system we have used the physical parameters ν = 5, β =310 and k = log(10)/7200. For the cost function we have considered the weightparameters γ = ε = 10−5, and a fixed threshold c = 7000 for the contaminant5concentration.

    The algorithm has been developed for a lower bound given by Q = 104. Starting7from an initial normal velocity with constant value Q∆th (0) = 1, we obtain conver-gence in 8 iterations. The gradients have been computed, in the case presented9here, by the alternative expression (6.5) introduced in previous section. Figure 2

    0 2 4 6 8 10 12 14 16 18 200

    5

    10

    20

    15

    25

    30Initial

    Optimal

    Fig. 2. Initial and optimal normal velocities on Γ−.

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 17

    Fig. 3. Initial and optimal contaminant concentrations.

    shows the optimal normal velocity achieved by the algorithm. Figure 3 shows a1detail, near the protected area A, of the contaminant concentration at final timeT = 3600 corresponding to the initial (left) and the optimal (right) normal veloc-3ities. In the picture one can see, for instance, how the contaminant concentration,which surpassed the threshold c in a part of the protected area A for the initial5(no control) situation, remains lower than that value in the whole region A for theoptimal (controlled) case.7

    8. Conclusions

    In this work the authors have formulated, analyzed and solved an optimal control9problem related to water conveyance, mainly, the purification of polluted areas ofshallow water by the injection of clear water through a small portion of the bound-11ary. Once the physical problem is mathematically well-posed, a formal optimalitycondition is obtained for the characterization of its solutions. A limited-memory13BFGS algorithm for bound constrained optimization problems is proposed for thenumerical resolution, where the gradient of the cost function can be computed by15two alternative methods: the discrete adjoint system (Sec. 5) or the the discretizedadjoint system (Sec. 6). Finally, the good performance of the algorithm is confirmed17by the numerical experiments developed by us.

    Appendix A. Proof of Theorem 4.119

    Since q is solution of the minimization problem (P), the following inequality holds:

    DJ(q) · (l − q) ≥ 0, ∀ l ∈ Uad. (A.1)

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    18 L. J. Alvarez-Vázquez et al.

    Let (H,u, ρ) be the state corresponding to the optimal control, then we have:

    DJ(q) · (l − q) = γ∫ T

    0

    ∫Γ−

    η2q(l − q) + ε∫ T

    0

    ∫A

    (ρ − c)+ ρ̄,

    where (H̄, ū, ρ̄) = DDq (H,u, ρ)(q) · (l − q) is given by the linearized system:1

    ∂H̄

    ∂t+ ∇ · (H̄u) + ∇ · (Hū) = 0 in Ω × (0, T ),

    ∂ū∂t

    + (ū · ∇)u + (u · ∇)ū − ν∇(∇ · ū) + g∇H̄ = 0 in Ω × (0, T ),∂ρ̄

    ∂t+ ū · ∇ρ + u · ∇ρ̄ + kρ̄ − β∆ρ̄ + H̄

    H2G = 0 in Ω × (0, T ),

    H̄ = 0 on (Γ− ∪ Γ+) × (0, T ),H̄(0) = 0 in Ω,

    ū · n = l − q on Γ− × (0, T ),ū · n = 0 on Γ0 × (0, T ),∇ · ū = 0 on Γ+ × (0, T ),ū(0) = 0 in Ω,

    ρ̄ = 0 on Γ− × (0, T ),∂ρ̄

    ∂n= 0 on (Γ+ ∪ Γ0) × (0, T ),

    ρ̄(0) = 0 in Ω.

    (A.2)

    Thus, we have:

    DJ(q) · (l − q) =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    ∫Ω

    εχA(ρ − c)+ ρ̄

    =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    ∫Ω

    {∂s

    ∂t+ ∇ · (su) − ks + β∆s

    }ρ̄

    =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    ∫Ω

    {− ∂ρ̄

    ∂t− u · ∇ρ̄ − kρ̄ + β∆ρ̄

    }s

    + s(T )ρ̄(T ) − s(0)ρ̄(0) +∫ T

    0

    ∫Γ

    {sρ̄u · n + β ∂s

    ∂nρ̄ − β ∂ρ̄

    ∂ns

    }

    =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    ∫Ω

    ū · ∇ρ s +∫ T

    0

    〈G,

    H2s

    =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    〈G,

    H2s

    +∫ T

    0

    ∫Ω

    {∂w∂t

    + ∇ · (u ⊗ w) − (∇u)Tw

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 19

    + H∇p + ν∇(∇ ·w)}

    · ū

    =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    〈G,

    H2s

    +∫ T

    0

    ∫Ω

    {−∂ū

    ∂t− (u · ∇)ū − (ū · ∇)u + ν∇(∇ · ū)

    }·w

    −∫ T

    0

    ∫Ω

    p∇ · (Hū) + w(T ) · ū(T ) − w(0) · ū(0)

    +∫ T

    0

    ∫Γ

    {(w · ū)(u · n) + ν(∇ ·w)(ū · n) − ν(∇ · ū)(w · n)}

    +∫ T

    0

    ∫Γ

    Hpū · n. (A.3)

    Taking into account that {n, τ} is an orthonormal basis of R2, and that, conse-quently, each vector v ∈ R2 can be written as:

    v = (v · n)n + (v · τ )τwe have that∫ T

    0

    ∫Γ

    (w · ū)(u · n) =∫ T

    0

    ∫Γ−∪Γ0∪Γ+

    {(w · n)(ū · n) + (w · τ )(ū · τ )}(u · n)

    and the other terms in a similar way. So,

    DJ(q) · (l − q) =∫ T

    0

    ∫Γ−

    γη2q(l − q) +∫ T

    0

    〈G,

    H2s

    +∫ T

    0

    ∫Ω

    {g∇H̄ · w − p∇ · (Hū)} +∫ T

    0

    ∫Γ−

    ν(∇ ·w)(l − q)

    +∫ T

    0

    ∫Γ−

    ηp(l − q)

    =∫ T

    0

    ∫Γ−

    {γη2q + ηp + ν (∇ ·w)} (l − q) + ∫ T

    0

    〈G,

    H2s

    +∫ T

    0

    ∫Ω

    {g∇H̄ · w + p

    [∂H̄

    ∂t+ ∇ · (H̄u)

    ]}(A.4)

    =∫ T

    0

    ∫Γ−

    {γη2q + ηp + ν(∇ · w)}(l − q)

    +∫ T

    0

    ∫Ω

    {−g∇ · w − ∂p∂t

    − u · ∇p}H̄ +∫ T

    0

    〈G,

    s

    H2H̄

    + p(T )H̄(T ) − p(0)H̄(0) +∫ T

    0

    ∫Γ

    {gH̄w · n + H̄pu · n}

    =∫ T

    0

    ∫Γ−

    {γη2q + ηp + ν(∇ · w)}(l − q).

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    20 L. J. Alvarez-Vázquez et al.

    Taking this expression to (A.1) we obtain the optimality condition (4.2).1

    Appendix B. Derivation of the Gradient DJ∆thIf we differentiate the discrete cost function J∆th , given by (5.4), with respect to the3variation δq∆th of the control, we obtain

    δJ∆th = γ∆tN−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δq

    n+1h + ε∆t

    N−1∑n=0

    ∫Ω

    χA(ρn+1h − c)+δρn+1h , (B.1)5

    where, by differentiating the discrete state system (5.3), using the chain rule andtaking into account that δXnh = −∆t δunh,δH0h = 0,

    δu0h = 0,

    δρ0h = 0,

    for n = 0, . . . , N − 1:(δHn+1h , δu

    n+1h , δρ

    n+1h ) are such that

    δHn+1h |Γ− = 0, δun+1h · n|Γ− = δqn+1h , δun+1h · n|Γ0 = 0, δρn+1h |Γ− = 0, and

    1∆t

    ∫Ω

    [δHn+1h − (δHnh ◦ Xnh ) + ∆t(∇Hnh ◦ Xnh ) · δunh]rh +∫

    δHn+1h ∇ · un+1h rh

    +∫

    Hn+1h ∇ · δun+1h rh = 0, ∀ rh ∈ Uh,1

    ∆t

    ∫Ω

    [δun+1h − (δunh ◦ Xnh ) + ∆t(∇unh ◦ Xnh )δunh ] · zh + ν∫

    ∇ · δun+1h ∇ · zh

    − g∫

    δHn+1h ∇ · zh = 0, ∀ zh ∈ Vh, (B.2)1

    ∆t

    ∫Ω

    [δρn+1h − (δρnh ◦ Xnh ) + ∆t(∇ρnh ◦ Xnh ) · δunh ]yh + k∫

    δρn+1h yh

    + β∫

    ∇δρn+1h · ∇yh +〈

    Gn+1, δHn+1hyh

    (Hn+1h )2

    〉= 0, ∀ yh ∈ Wh.

    Due to previous boundary conditions, it is clear that δHn+1h ∈ Uh andδρn+1h ∈ Wh, but δun+1h �∈ Vh. For later computations, we will need to decompose7δun+1h as the sum of an element δũ

    n+1h ∈ Vh and a remainder δûn+1h = ψ(δqn+1h ).

    This element δûn+1h can be uniquely constructed from δqn+1h in the following way:9

    δûn+1h will be the only vector-valued function in Ṽh so that δûn+1h · n = 0 at

    all the nodes of the triangulation except the ones on the boundary Γ− where11δûn+1h ·n = δqn+1h . In this way, the unique element δũn+1h = δun+1h − δûn+1h triviallyverifies that δũn+1h · n|Γ−∪Γ0 = 0 and, consequently, δũn+1h ∈ Vh.13

    We introduce a sequence (pnh ,wnh , s

    nh), n = 0, . . . , N − 1, of elements in Uh ×

    Vh × Wh. Taking these elements as test functions in (B.2), summing all the N

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 21

    equations, and bearing in mind that δH0h, δu0h and δρ

    0h are null, we obtain:

    1∆t

    N−1∑n=0

    ∫Ω

    δHn+1h pnh −

    1∆t

    N−1∑n=1

    ∫Ω

    (δHnh ◦ Xnh )pnh +N−1∑n=1

    ∫Ω

    (∇Hnh ◦ Xnh ) · δunhpnh

    +N−1∑n=0

    ∫Ω

    δHn+1h ∇ · un+1h pnh +N−1∑n=0

    ∫Ω

    Hn+1h ∇ · δun+1h pnh

    +1

    ∆t

    N−1∑n=0

    ∫Ω

    δun+1h · wnh−1

    ∆t

    N−1∑n=1

    ∫Ω

    (δunh ◦ Xnh ) · wnh

    +N−1∑n=1

    ∫Ω

    (∇unh ◦ Xnh )δunh · wnh + νN−1∑n=0

    ∫Ω

    ∇ · δun+1h ∇ ·wnh

    − gN−1∑n=0

    ∫Ω

    δHn+1h ∇ ·wnh +1

    ∆t

    N−1∑n=0

    ∫Ω

    δρn+1h snh −

    1∆t

    N−1∑n=1

    ∫Ω

    (δρnh ◦ Xnh )snh

    +N−1∑n=1

    ∫Ω

    (∇ρnh ◦ Xnh ) · δunhsnh + kN−1∑n=0

    ∫Ω

    δρn+1h snh + β

    N−1∑n=0

    ∫Ω

    ∇δρn+1h · ∇snh

    +N−1∑n=0

    〈Gn+1, δHn+1h

    snh(Hn+1h )2

    〉= 0.

    Then, reordering the terms in previous equality, and taking into account thedecomposition of δun+1h = δũ

    n+1h + δû

    n+1h we obtain

    1∆t

    N−1∑n=0

    ∫Ω

    pnh δHn+1h −

    1∆t

    N−2∑n=0

    ∫Ω

    pn+1h (δHn+1h ◦ Xn+1h )

    +N−1∑n=0

    ∫Ω

    pnh∇ · un+1h δHn+1h −gN−1∑n=0

    ∫Ω

    ∇ ·wnh δHn+1h

    +N−1∑n=0

    〈Gn+1,

    snh(Hn+1h )2

    δHn+1h

    〉+

    1∆t

    N−1∑n=0

    ∫Ω

    wnh · δũn+1h

    − 1∆t

    N−2∑n=0

    ∫Ω

    wn+1h · (δũn+1h ◦ Xn+1h ) +N−2∑n=0

    ∫Ω

    (∇un+1h ◦ Xn+1h )Twn+1h · δũn+1h

    + νN−1∑n=0

    ∫Ω

    ∇ · wnh ∇ · δũn+1h +N−2∑n=0

    ∫Ω

    pn+1h (∇Hn+1h ◦ Xn+1h ) · δũn+1h

    +N−1∑n=0

    ∫Ω

    Hn+1h pnh∇ · δũn+1h +

    N−2∑n=0

    ∫Ω

    sn+1h (∇ρn+1h ◦ Xn+1h ) · δũn+1h

    +1

    ∆t

    N−1∑n=0

    ∫Ω

    snhδρn+1h −

    1∆t

    N−2∑n=0

    ∫Ω

    sn+1h (δρn+1h ◦ Xn+1h )

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    22 L. J. Alvarez-Vázquez et al.

    + kN−1∑n=0

    ∫Ω

    snhδρn+1h + β

    N−1∑n=0

    ∫Ω

    ∇snh · ∇δρn+1h

    = − 1∆t

    N−1∑n=0

    ∫Ω

    wnh · δûn+1h +1

    ∆t

    N−2∑n=0

    ∫Ω

    wn+1h · (δûn+1h ◦ Xn+1h )

    −N−2∑n=0

    ∫Ω

    (∇un+1h ◦ Xn+1h )Twn+1h · δûn+1h − νN−1∑n=0

    ∫Ω

    ∇ · wnh ∇ · δûn+1h

    −N−2∑n=0

    ∫Ω

    pn+1h (∇Hn+1h ◦ Xn+1h ) · δûn+1h −N−1∑n=0

    ∫Ω

    Hn+1h pnh∇ · δûn+1h

    −N−2∑n=0

    ∫Ω

    sn+1h (∇ρn+1h ◦ Xn+1h ) · δûn+1h

    Thus, we are led to consider the discrete adjoint system as given in (5.5). Finally,taking all those equalities to (B.1) we obtain the following expression for the dif-ferential of the discrete cost function J∆th with respect to the variation δq

    ∆th of the

    control:

    δJ∆th = γ∆tN−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δq

    n+1h + ε∆t

    N−1∑n=0

    ∫Ω

    χA(ρn+1h − c)+δρn+1h

    = γ∆tN−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δq

    n+1h

    −N−1∑n=0

    ∫Ω

    snh δρn+1h +

    N−2∑n=0

    ∫Ω

    sn+1h (δρn+1h ◦ Xn+1h )

    −∆t[k

    N−1∑n=0

    ∫Ω

    snh δρn+1h + β

    N−1∑n=0

    ∫Ω

    ∇snh · ∇δρn+1h]

    = γ∆tN−1∑n=0

    ∫Γ−

    (ηn+1h )2qn+1h δq

    n+1h +

    N−1∑n=0

    ∫Ω

    wnh · δûn+1h (B.3)

    −N−2∑n=0

    ∫Ω

    wn+1h · (δûn+1h ◦ Xn+1h )

    + ∆t

    [N−2∑n=0

    ∫Ω

    wn+1h · (∇un+1h ◦ Xn+1h )δûn+1h

    + νN−1∑n=0

    ∫Ω

    ∇ ·wnh ∇ · δûn+1h +N−2∑n=0

    ∫Ω

    pn+1h (∇Hn+1h ◦ Xn+1h ) · δûn+1h

    +N−1∑n=0

    ∫Ω

    Hn+1h pnh∇ · δûn+1h +

    N−2∑n=0

    ∫Ω

    sn+1h (∇ρn+1h ◦ Xn+1h ) · δûn+1h]

    .

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    The Water Conveyance Problem 23

    This expression gives us, in a direct way, the exact gradient of the discrete cost1function (5.6).

    Acknowledgments3

    This work was supported by Project BFM2003-00373 of Ministerio de Ciencia yTecnoloǵıa (Spain).5

    References

    1. V. I. Agoshkov, D. Ambrosi, V. Pennati, A. Quarteroni and F. Saleri, Mathematical7and numerical modelling of shallow water flow, Comput. Mech. 11 (1993) 280–299.

    2. V. I. Agoshkov, A. Quarteroni and F. Saleri, Recent developments in the numerical9simulation of shallow water equations I: Boundary conditions, Appl. Numer. Math.15 (1994) 175–200.11

    3. L. J. Alvarez-Vázquez, A. Mart́ınez, C. Rodŕıguez and M. E. Vázquez-Méndez,Numerical convergence for a sewage disposal problem, Appl. Math. Model. 25 (2001)131015–1024.

    4. L. J. Alvarez-Vázquez, A. Mart́ınez, C. Rodŕıguez and M. E. Vázquez-Méndez, Math-15ematical analysis of the optimal location of wastewater outfalls, IMA J. Appl. Math.67 (2002) 23–39.17

    5. L. J. Alvarez-Vázquez, A. Mart́ınez, C. Rodŕıguez and M. E. Vázquez-Méndez,Numerical optimization for the location of wastewater outfalls, Comput. Optim. Appl.1922 (2002) 399–417.

    6. C. Bernardi and O. Pironneau, On the shallow water equations at low Reynolds21number, Comm. Partial Differential Eqns. 16 (1991) 59–104.

    7. A. Bermúdez, C. Rodŕıguez and M. A. Vilar, Solving shallow water equations by a23mixed implicit finite element method, IMA J. Numer. Anal. 11 (1991) 79–97.

    8. A. Bermúdez, Mathematical techniques for some environmental problems related to25water, in Mathematics, Climate and Environment, eds. J. I. Dı́az and J. L. Lions(Masson, 1993).27

    9. D. P. Bertsekas, Constrained Optimization and Lagrange Multiplier Methods (Aca-demic Press, 1982).29

    10. F. J. Chatelon and P. Orenga, Some smoothness and uniqueness results for a shallow-water problem, Adv. Differential Eqns. 3 (1998) 155–176.31

    11. S. Chippada, C. N. Dawson, M. L. Martinez and M. F. Wheeler, Finite elementapproximations to the system of shallow water equations I. Continuous-time a priori33error estimates, SIAM J. Numer. Anal. 35 (1998) 692–711.

    12. K. Kashiyama, H. Ito, M. Behr and T. Tezduyar, Three-step explicit finite element35computation of shallow water flows on a massively parallel computer, Int. J. Numer.Meth. Fluids 21 (1995) 885–900 .37

    13. P. E. Kloeden, Global existence of classical solutions in the dissipative shallow waterequations, SIAM J. Math. Anal. 16 (1985) 301–315.39

    14. J.-L. Lions, Optimal Control of Systems Governed by Partial Differential Equations(Springer-Verlag, 1971).41

    15. A. Mart́ınez, C. Rodŕıguez and M. E. Vázquez-Méndez, Theoretical and numericalanalysis of an optimal control problem related to wastewater treatment, SIAM J.43Control Optim. 38 (2000) 1534–1553.

    16. A. Mart́ınez, C. Rodŕıguez and M. E. Vázquez-Méndez, A control problem arising in45the process of water purification, J. Comput. Appl. Math. 114 (2000) 67–79.

  • 1st ReadingJune 16, 2005 18:35 WSPC/103-M3AS 00079

    24 L. J. Alvarez-Vázquez et al.

    17. J. Oliger and A. Sundström, Theoretical and practical aspects of some initial boundary1value problems in fluid dynamics, SIAM J. Appl. Math. 35 (1978) 419–446.

    18. P. Orenga, A theorem on the existence of solutions of a shallow-water problem, Arch.3Rat. Mech. Anal. 130 (1995) 183–204.

    19. P. A. Raviart and J. M. Thomas, A mixed finite element method for 2nd order ellip-5tic problems, in Mathematical Aspects of Finite Element Methods, Lecture Notes inMath., Vol. 606, eds. I. Galligani and E. Magenes (Springer, 1977).7

    20. L. Sundbye, Global existence for the Cauchy problem for the viscous shallow waterequations, Rocky Mountain J. Math. 28 (1998) 1135–1152.9

    21. B. A. Ton, Existence and uniqueness of a classical solution of an initial-boundary valueproblem of the theory of shallow waters, SIAM J. Math. Anal. 12 (1981) 229–241.11