master in optimization internship’s report · 2018. 9. 26. · master in optimization...

31
Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship has been to propose a new approach for the numerical solution of gradient flows in the Wasserstein space, via Finite Volume space discretization and the linearization of the Wasserstein distance. In this work we checked its feasibility and reliability through several numerical experiments. The topic is vast and demands lot of work and objectives to achieve. This project is only meant to be the starting point of this work that will continue for three years during my PhD in the MOKAPLAN team (INRIA PARIS), under the supervision of Thomas Gallouet and Jean-David Benamou. 1 Introduction We want to propose a new simplified approach to solve numerically Wasserstein gradient flows and provide, in this way, an alternative for the solution of the initial boundary value problems (IBVPs) they represent. Recall that a gradient flow is an evolution stemming from an initial condition and evolving following, in each moment, the steepest decreasing direction of a prescribed functional. In a finite dimensional space, this coincide with a Cauchy problem with vector field given by the opposite of the gradient of the functional. In the Wasserstein space, that is, according to our notation, the space of positive measures defined on the compact domain Ω R d , with prescribed total mass, endowed with the metric given by the quadratic Wasserstein distance W 2 ,(M + (Ω),W 2 ), this evolution should be written as: ∂ρ ∂t = -∇ W 2 E (ρ)”, (1) starting from an initial measure ρ 0 , with respect to the functional E : M + (Ω) R. The Wasserstein distance W 2 between two measures μ, ν ∈M + (Ω) is the cost 1

Upload: others

Post on 05-Nov-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

Master in OptimizationInternship’s report

Todeschi Gabriele

13/09/2018

Abstract

The purpose of this internship has been to propose a new approachfor the numerical solution of gradient flows in the Wasserstein space, viaFinite Volume space discretization and the linearization of the Wassersteindistance. In this work we checked its feasibility and reliability throughseveral numerical experiments. The topic is vast and demands lot of workand objectives to achieve. This project is only meant to be the startingpoint of this work that will continue for three years during my PhD inthe MOKAPLAN team (INRIA PARIS), under the supervision of ThomasGallouet and Jean-David Benamou.

1 Introduction

We want to propose a new simplified approach to solve numerically Wassersteingradient flows and provide, in this way, an alternative for the solution of the initialboundary value problems (IBVPs) they represent. Recall that a gradient flow isan evolution stemming from an initial condition and evolving following, in eachmoment, the steepest decreasing direction of a prescribed functional. In a finitedimensional space, this coincide with a Cauchy problem with vector field given bythe opposite of the gradient of the functional. In the Wasserstein space, that is,according to our notation, the space of positive measures defined on the compactdomain Ω ⊂ Rd, with prescribed total mass, endowed with the metric given bythe quadratic Wasserstein distance W2, (M+(Ω),W2), this evolution should bewritten as:

”∂ρ

∂t= −∇W2 E(ρ)”, (1)

starting from an initial measure ρ0, with respect to the functional E :M+(Ω)→R. The Wasserstein distance W2 between two measures µ, ν ∈M+(Ω) is the cost

1

Page 2: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

to transport one into the other in an optimal way with respect to the cost givenby the squared euclidean distance, namely the optimization problem

W 22 (µ, ν) = min

γ∈Γ(µ,ν)

∫Ω×Ω

||y − x||2dγ(x, y), (2)

with the set Γ(µ, ν) of admissible transport plans given by

Γ(µ, ν) =γ ∈M+(Ω)×M+(Ω) : γ1 = µ, γ2 = ν

,

where γ1, γ2 denote the first and second marginal measure, respectively.The symbol ∇W2 should recover a sort of gradient operator, not to be con-

sidered in the usual sense, in the Wasserstein space. The JKO scheme (Jordan-Kinderlehrer-Otto scheme [13]) can be used to give a meaning to (1), by findingapproximation in time to the solution of the gradient flow, a time dependent mea-sure ρ(t) : [0, T ] →M+(Ω), without the need to consider a differential structurein the space. This scheme, whose general name is Minimizing Movement scheme[12], can be exploited in different types of metric spaces and applied to the caseof Wasserstein gradient flows writes:

(JKO)

ρ0τ = ρ(0)

ρnτ ∈ argmin1

2τW 2

2 (ρ, ρn−1τ ) + E(ρ).

(3)

The parameter τ is the time discretization step. The JKO scheme (3) gener-ates a sequence of measures (ρnτ ). Using this sequence it is possible to constructa time dependent measure by gluing them together in a piecewise constant (intime) fashion: ρτ (t) = ρnτ , for t ∈ ((n − 1)τ, nτ ]. Under suitable assumptionson the functional E , it is possible to prove the uniform convergence in time (andweak convergence in space) of this measure to weak solutions of particular initialboundary value problems.

In the following, to ensure the well-posedness of problems (2) and (3), we willalways deal with absolutely continuous measures with respect to the Lebesguemeasure λ. For this reason, with abuse of notation, we will frequently refer di-rectly to their associated density (in particular ρ will always represent the associ-ated density for us). We will denote by Pa.c.(Ω) the set of absolutely continuousmeasures (w.r.t. the Lebesgue one), positive and with constant total mass, notnecessarily equal to one.

Porous media flows [19, 15], chemotaxis processes in biology [5], superconduc-tivity [1, 2] and semiconductor devices modeling [14, 18] are just few examplesof problems that can be represented as gradient flows in the Wasserstein space.Designing accurate numerical schemes for approximating their solutions is there-fore a major issue and our leading motivation. In this work, we focused on the

2

Page 3: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

relatively simple problem of the linear Fokker-Planck equation:∂tρ = ∆ρ+∇ · (ρ∇V ) in Ω,

(∇ρ+ ρ∇V ) · n = 0 on ∂Ω,

ρ(0, ·) = ρ0 in Ω.

(4)

Simple since it can be written as the gradient flow of the particularly simpleenergy functional E(ρ) =

∫Ωρ log ρ +

∫ΩρV (x), where ρV (x) is any potential

energy with V (x) Lipschitz continuous function. Note that E(ρ) is strictly convexand differentiable in ρ, which eases the treatment from the optimization point ofview. We particularly focused on this problem since, due to its simplicity, allowedus to perform deeper tests and to ease its numerical implementation. However,we considered also more complicated ones. The system (4) can be rewritten in anon-linear form as:

∂tρ− div(ρ∇δE(ρ)

δρ) = 0 in Ω,

ρ∇δE(ρ)

δρ· n = 0 on ∂Ω,

ρ(0, ·) = ρ0 in Ω.

(5)

System (5) expresses the continuity equation for a time evolving density ρ con-

vected by the velocity field −∇ δE(ρ)δρ

. The mixed boundary condition the systemis subjected to represents a no flux condition across the boundary of the domainfor the mass: the total mass is therefore preserved. We used the notation δ(·)

δρto

denote the functional derivative and distinguish it from classical derivatives. Thisform of the problem highlights its gradient flow structure, due to the geomet-rical characterization of the Wasserstein space. Furthermore, other Wassersteingradient flows can be treated in this way, depending on the form of the functional.

We want to propose a new approach to solve these type of problems. A clas-sical numerical scheme, coupled with the implicit Euler discretization of the timederivative, directly applied to the easiest linear version (4) of the Fokker-Planckequation, or any other IBVP representing a gradient flow, would in general dis-regard its variational structure (excepted for very particular choices [4]). Thenumerical solution could not enforce the decay of the energy at each time step.This is instead a fundamental condition to guarantee the stability and the relia-bility of the numerical solution, especially in the long time behavior. In [6], it hasbeen proven that the application of the upwind (upstream) Finite Volume schemetogether with the implicit Euler discretization to the solution of problems of theform (5), gives an energy diminishing scheme that preserves the positivity of thesolution (in this work, we will refer directly to this scheme as Finite Volume (FV),always referring to its application in the form (5)). This second achievement is

3

Page 4: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

another important goal since the solution is interpreted as a positive density anda (possibly local) negative result would be meaningless. However, the drawbackis that the problem becomes more difficult from the computational point of view,since it is now non-linear. Another possibility is to use the JKO scheme (3) tofully exploit the variational structure of the problem and automatically ensure thedecrease of the energy. In [3], an algorithm, hereafter called ALG2-JKO, has beendesigned for the discrete solution of the optimization problem (3). Despite the ad-vantages this approach can give, the computational complexity further increases.In [7], these two approaches have been compared for the solution of multiphaseporous media flows. Indeed, it has been proven in [9] that the flow of two or moreimmiscible fluids in a porous medium can be written as a Wasserstein gradientflow. The FV scheme revealed to be faster but less stable for particularly roughpotential, the Newton scheme requiring smaller and smaller time steps to con-verge to the solution of the non-linear system of equations. On the contrary, theALG2-JKO revealed to be more stable but slower. Our objective is to proposeanother approach that should be placed in between these two. In particular, wewant to propose a PDE based scheme, in order to exploit the easiness and fastnessof the application of numerical schemes to the solution of differential problems.Moreover, this gives the advantage to exploit all the achievements in this field.Finally, we want our scheme to be intimately linked with the variational structureof the problem.

2 Linearized JKO scheme

We want to replace the complex optimization problem involved in the scheme(3) with a simpler one by simplifying the Wasserstein distance via a linearizationprocedure. Consider two probability measures µ, ν ∈ Pa.c.(Ω) with densities ρand σ, respectively. By Brenier’s theorem we know that there exist ϕ convex suchthat ∇ϕ|#µ = ν and the optimal transport plan between µ and ν in (2) is of theform γ = (id,∇ϕ)|#µ. Assume that ρ is strictly positive and ϕ is really close tothe identity. As a consequence, also the two densities are really close. Make theansatz:

ϕ = ϕε =|x|2

2+ εψ +O(ε2), σ = σε = (1 + εh+O(ε2))ρ, (6)

with ε > 0 small. Under this assumption, the W2(µ, ν) distance becomes

W2(µ, ν) = ε

√∫Ω

|∇ψ|2dµ+O(ε2).

The Monge-Ampere equation is a highly non-linear partial differential equationthat, under precise regularity assumptions ([20], chapter 4), relates the initial and

4

Page 5: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

final density and characterizes the optimal transport map:

σ(∇ϕ(x))detD2ϕ(x) = ρ(x). (7)

Under the same assumptions (6), it is possible to show that the linearizationprocedure turns equation (7) into the linear equation

Lψ = h, L = −∆(·) +∇(− log ρ) · ∇(·) = −∇ · (ρ∇(·))/ρ. (8)

From elliptic regularity theory, ψ is smooth whenever h and ρ are smooth, providedthat ρ is strictly positive.

The Laplace-type operator L satisfies the following integration-by-parts for-mula: ∫

Ω

h1(Lh2) dλ =

∫Ω

h2(Lh1) dλ =

∫Ω

∇h1 · ∇h2 dµ,

for h1 and h2 satisfying ∇h1 · n = ∇h2 · n = 0, n being the outer unit normal tothe boundary of the domain Ω. Introduce the notation

||h||2H1µ

=

∫Ω

h(Lh) dλ, H1µ =

h ∈ L2

µ : ||h||2H1µ<∞,∇h · n|∂Ω = 0

,

where the norm || · ||2H1µ

basically corresponds, thanks to the integration by parts

formula, to the weighted L2 norm of the gradient. We use the dot in H1 to pointout the difference of this norm and space with respect to the usual H1 space,according with the notation introduced in [20]. Consider the dual space of H1

µ

and its associated norm, by definition

||h||H−1µ

=

sup

∫Ω

hϕ dµ, ϕ ∈ H1µ, ||ϕ||H1

µ= 1.

Since the operator L admits inverse under suitable hypotheses, we can consider hto have the form h = Lψ for a specific function ψ. Hence, using (8) we can show∣∣∣ ∫

Ω

hϕ dµ∣∣∣ =

∣∣∣ ∫Ω

(Lψ)ϕ dµ∣∣∣ =

∣∣∣− ∫Ω

∇ · (µ∇ψ)ϕ dλ∣∣∣

=∣∣∣ ∫

Ω

∇ψ · ∇ϕ dµ∣∣∣ ≤ ||∇ψ||L2

µ||∇ϕ||H1

= ||ψ||H1µ.

Since for ϕ = ψ/||∇ψ||L2µ

we have the equality, it holds

||h||H−1 = ||ψ||H1µ

=

∫Ω

h(L−1h)dµ,

5

Page 6: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

that is, under the assumption (6), the linearization of the quadratic Wassersteindistance turns out to be a weighted H−1 norm. A rigorous proof for this procedurecan be found for example in [20], where it is shown that

limε→0

W 22 (µ, (1 + εh)µ)

ε= ||h||H−1

µ. (9)

In [20] the result has been proven considering Ω = Rn, without the need to takeinto account the condition ∇h · ~n|∂Ω = 0.

Consider now the n-th step of the JKO scheme, the starting density ρn−1 andthe solution ρ close to it. It is evident that, the smaller the time discretizationparameter, the closer is ρ to ρn−1, since their distance is penalized. The lineariza-tion procedure we showed enables to linearize the Wasserstein distance in theneighborhood of one of the two densities, since it is symmetric. Linearizing in theneighborhood of the starting density ρn−1 we would recover an explicit scheme.However, since we need to design an implicit scheme, as will be clarified later, wewill linearize in the neighborhood of the final point ρ. Hence, we want to see ρn−1

as a small perturbation of ρ, i.e. ρn−1 = (1 + h)ρ and h = ρn−1−ρρ

, in the same

spirit of (6), where we neglect the higher order term and we do not consider theparameter ε since we implicitly assume h to be small. We can then try to replacethe original JKO scheme with a (implicit) linearized one:

(LJKO)

ρ0τ = ρ0

ρnτ ∈ argmin1

τ||h||H−1

ρ (Ω) + E(ρ)(10)

where, again, notice that we have taken the ρ weight in the H−1 norm. To assessthe goodness of this scheme, we should establish the same convergence propertiesthat are valid for the JKO scheme. Unfortunately, this is still an open task.

In this form, at each step, (10) is a constrained optimization problem. Notethat the equation (8) can be seen as the Euler-Lagrange equation of

supψ∈H1

µ(Ω)

∫Ω

hψ dµ− 1

2

∫Ω

|∇ψ|2 dµ, (11)

whose value is exactly 12||h||2

H−1µ

:∫Ω

hψ dµ− 1

2

∫Ω

|∇ψ|2 dµ =

∫Ω

(Lψ)ψ dµ− 1

2

∫Ω

|∇ψ|2 dµ

=

∫Ω

|∇ψ|2 dµ− 1

2

∫Ω

|∇ψ|2 dµ

=1

2

∫Ω

|∇ψ|2 dµ.

.

6

Page 7: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

Replacing (11) in place of 12||h||2

H−1µ

, the LJKO scheme becomes, at each step k:

find the pair (ψ, ρ) satisfying the saddle point problem

infρ

supψ

1

τ

(∫Ω

(ρn−1 − ρ)ψdλ− 1

2

∫Ω

|∇ψ|2ρdλ)

+ E(ρ). (12)

Taking the functional derivative of the argument with respect to ψ gives thealready known stationary condition:

(ρ− ρn−1)−∇ · (ρ∇ψ) = 0.

If we could swap inf and sup without changing the problem, i.e., if ”inf sup”=”supinf”, taking the functional derivative w.r.t. ρ, we would get the second stationarycondition:

ψ +1

2|∇ψ|2 − τ δE(ρ)

δρ= 0.

Basically, to prove this result we need to show that the dual problem of (12) isequal to the primal one.

Lemma 1. Stron duality holds for problem (12).

Proof. We want to exploit the Fenchel-Rockafellar duality theorem in the samefashion as in [10].

Rewrite problem (12) as:

infρ

∫Ω

1

2|∇ψ|2ρdλ+

∫Ω

E(ρ)dλ, such that ρ− ρn−1 −∇ · (ρ∇ψ) = 0

(we can get rid of the multiplicative value 1τ

rescaling by τ the problem andincluding it in the definition of E). The problem is not convex and the costraintis not linear. Perform the change of variable m = ρ∇ψ and denote

L(ρ,m) : (ρ,m) 7→

|m|22ρ

if ρ > 0,

0 if (ρ,m) = 0,

+∞ otherwise.

In this way we reduce the problem to the minimization of a convex functional un-der linear constraints. Let us introduce the spaces E0 ⊂ C1(Ω;R) of C1 functionswith zero normal derivative along the boundary ∂Ω, and E1 ⊂ C0(Ω;R)×C0(Ω;Rd)product space of R valued continuous functions and Rd valued continuous func-tions normal to the boundary. We introduce also the bounded linear operatorΛ(ψ) : E0 → E1, Λ(ψ) = (ψ,∇ψ), whose adjoint is given by Λ∗((ρ,m)) : E∗1 → E∗0 ,Λ∗((ρ,m)) = ρ −∇ · (m). E∗0 and E∗1 are the dual spaces of E0 and E1, i.e. the

7

Page 8: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

spaces of scalar and vector valued measures, respectively. We introduce the func-tionals

Θ(ψ) = −∫

Ω

ρn−1ψdλ,

Ξ(Λ(ψ)) = sup(ρ,m)

∫Ω

(ψρ+∇ψ ·m)dλ− E(ρ) =

∫Ω

E∗(ψ +1

2|∇ψ|2)dλ,

defined respectively on the space E0 and E1, with E∗ denoting the Fenchel trans-form of E. The dual problem of (12), what is actually referred to as primal in theFenchel-Rockafellar duality, can be written

− infψ∈C0

Θ(ψ) + Ξ(Λ(ψ))

.

Since it exists a point ψ0 such that Θ(ψ0) < +∞ and Ξ(Λ(ψ0)) < +∞ (it issufficient to consider ψ0 = 0 since E∗(0) is finite if E is bounded from below, whichis the case for example for the Fokker-Planck energy) and Θ(ψ) is continuous inψ0, the Fenchel-Rockafeller duality theorem implies

− infψ∈E0

Θ(ψ) + Ξ(Λ(ψ))

= − max

(ρ,m)∈E∗1−Θ∗(−Λ∗(ρ,m))− Ξ∗((ρ,m)),

where Θ∗ and Ξ∗ are the Legendre transforms of Θ and Ξ:

Θ∗(−Λ∗((ρ,m))) = supψ∈E0

∫Ω

(−ρ+∇ · (m))ψdλ−Θ(ψ)

= supψ∈E0

∫Ω

(−ρ+∇ · (m))ψdλ+

∫Ω

ρn−1ψdλ

=⇒ Θ∗(−Λ∗((ρ,m))) =

0 if ρ− ρn−1 −∇ · (m) = 0,

+∞ otherwise,

where the equation ρ− ρn−1 −∇ · (m) = 0 holds in the sense of distribution;

Ξ∗((ρ,m)) = sup(ψ,∇ψ)

∫Ω

(ρψ +m · ∇ψ)dλ−∫

Ω

E∗(ψ +1

2|∇ψ|2)dλ

= sup(p,∇ψ)

∫Ω

(ρp− 1

2ρ|∇ψ|2 +m · ∇ψ)dλ−

∫Ω

E∗(p)dλ, p = ψ +1

2|∇ψ|2,

= sup∇ψ

∫Ω

(m · ∇ψ − 1

2ρ|∇ψ|2)dλ+ E(ρ), E convex and continuous,

sup∇ψ

∫Ω

m · ∇ψ − 1

2ρ|∇ψ|2dλ =

Ω|m|22ρ

dλ if ρ > 0

0 if (ρ,m) = 0

+∞ otherwise

=⇒ Ξ∗((ρ,m)) =

∫Ω

L(ρ,m)dλ+ E(ρ).

8

Page 9: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

Finally, the dual problem becomes

min(ρ,m)

∫Ω

L(ρ,m)dλ+ E(ρ), such that ρ− ρn−1 −∇ · (m) = 0,

with∫

Ωρdλ =

∫Ωρn−1dλ, which is exactly problem (12).

Since problem (12) is strictly convex in ρ (provided E(ρ) is so) and strictly con-cave in ψ, its solution is the unique solution of the system of optimality conditionsψ +

1

2|∇ψ|2 − τ δE(ρ)

δρ= 0

(ρ− ρk)−∇ · (ρ∇ψ) = 0

(13a)

(13b)

coupled with the no flux boundary condition ρ∇ψ · n|∂Ω = 0.

3 Finite Volumes discretization

We need now to suggest a space discretization for the problem (10). We want tobase our discretization on the Finite Volume methodology. A possibility could beto directly discretize the optimality conditions (13). However, it is not evidentwhich could be a good strategy to discretize the squared norm of the gradientin the first equation. Moreover, this approach could disregard the variationalstructure of the LJKO. We want to discretize directly the saddle point formulationin order to achieve two important results: the discrete solution would be at eachstep the solution of the discrete variational problem; we want to recover, from theoptimality conditions of the discrete problem, the FV discretization with upstreamtechnique of the continuity equation in (13). The first result will ensure that wecan exploit the mathematical theory of optimization to study and develop ourscheme. In particular, due to the nice features of the energy functional involvedin the problem, that the space discretization must not ruin, this would provideimmediately and trivially the existence and uniqueness of the numerical solution.The second result will instead ensure the positivity of the solution. This is aparticularly important achievement to have a well-posed formulation. Any spacediscretization that does not ensure it would fail in solving the problem.

A Finite Volume scheme relies on a specific space discretization. We willpresent it with reference to the two dimensional case, since the numerical ex-periments have been carried out in dimension two, but the generalization to thethree dimensional case is straightforward. An admissible mesh consists in theset Th, the ensemble of cells the domain is partitioned in, the set Σ, the ensem-ble of edges, and (xK)K∈Th , the ensemble of cell-centers. To avoid discretization

9

Page 10: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

xK

xL

KL

σ

Figure 1: FV notation exemplified with two admissible triangular cells.

problems on the boundary of the domain, assume Ω to be polygonal. The ele-ments K ∈ Th are polygonal convex subsets of Ω called control volumes, whoseboundaries are made of elements σ ∈ Σ, such that Ω = ∪K∈ThK. The mesh-size parameter h denotes the biggest diameter among all the cells K ∈ Th. LetK, L be two distinct elements of Th, then K ∩ L is either empty, or reducedto a point (a vertex), or there exists σ ∈ Σ denoted by σ = K|L such thatK ∩ L = σ. Moreover, two control volumes can share at most one edge. We de-note by ΣK =

σ ∈ Σ : σ ⊂ ∂K

the set of the edges of the element K ∈ Th, and

by NK =L ∈ Th : K ∩ L = σ ∈ ΣK

the set of neighboring control volumes to

K. Furthermore, we denote Σext =σ ∈ Σ : σ ⊂ ∂Ω

, the set of boundary edges,

Σint = Σ \ Σext the set of internal edges and Σint,K = Σint ∩ ΣK , ∀K. To eachcontrol volume K ∈ Th we associate an element xK ∈ Ω such that for all L ∈ NK ,the segment [xK ,xL] is orthogonal to the edge K|L, denoting by dσ = |xK − xL|the euclidean distance between the two cell centers. Finally, for each element Kand each σ ∈ ΣK , we denote by nK,σ its unitary outward normal. In figure 1this notation is exemplified for two neighbouring triangular cells. We will denoteby mK and mσ the Lebesgue measure of the control volume K ∈ Th and theedge σ ∈ Σ, respectively. Finally, for each edge σ, we will call transmissivity thequantity mσ

dσand denote it aσ.

The hypothesis on the reciprocal position of the cell centers of each elementrequires some regularity on the partitioning. To get this regularity, beyond theeasiest case of cartesian grids, it is possible to use Delaunay triangulation, whereeach cell center xK is the circumcenter of the triangular element K, i.e., thecenter of its circumscribed circle; an example of such mesh can be found in figure4. In alternative, it is possible to construct the partitioning first choosing the

10

Page 11: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

cell-centers (xK) and then constructing Th as the associated Voronoı diagram.We used the former strategy.

Denote by Nh the number of elements K of the partitioning Th. The finitevolume discretization substitutes a function defined on Ω with a vector belongingto RNh : in each cell K, the restriction of the function is approximated with a realnumber; this number can be thought as located in the cell center xK of K and seenas its mean over the cell. Denote by ρn−1

K and ρnK the discrete density at step n−1and n, respectively, and by ψK the discrete potential, for each element K. Thediscretization of the first and last contribution of (13) is quite natural and showndirectly in (14). More delicate is instead the discretization of the remaining part,and actually fundamental to achieve the goal of our formulation. For each edgeσ = K|L ∈ Σint, we refer to the diamond sub-cell as the convex envelop of thetwo vertexes of the edge σ and the two cell-centers xK and xL (the green-shadedzone in figure 2). In each diamond sub-cell we approximate ∇ψ taking as discretegradient

(ψL−ψKdσ

)nK,σ. We approximate the weighted L2

ρ norm of ∇ψ as

∫Ω

|∇ψ|2ρdλ ≈∑σ∈Σint

(ψL − ψKdσ

)2ρσ(dσmσ) =

∑σ∈Σint

(ψL − ψK)

)2ρσaσ.

For the measure of the sub-cell we use the quantity (dσmσ), that is actually thedouble of its area. The density ρσ is approximated with the classical upwindtechnique:

ρσ =

ρL if ψL > ψK ,

ρK otherwise,∀σ = K|L ∈ Σint

The upwind technique reflects the fact that, considering the discretization of theflux −ρ∇ψ, ρ is discretized approximating it with ρK if the mass is moving fromelement K to L, using ρL if the opposite holds. The mass moves only in thedirection of the velocity field. Taking the sum over the set of internal edgesΣint, we automatically take into account the zero flux condition on the boundary,∇ψ · n|∂Ω = 0. This choice for the discretization of ρσ enables us to rewrite theapproximation as∫

Ω

|∇ψ|2ρdλ ≈∑K∈Th

∑σ∈Σint,K

((ψL − ψK)−

)2ρKaσ,

where (x)− = min(x, 0). In each cell K, the contribution of the discrete gradienton each edge, weighted with the transmissivity, is taken only if the flux is outwardand disregarded if not.

Using the space discretization introduced, we can approximate problem (12)

11

Page 12: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

xK

xL

KL

Figure 2: Diamond sub-cell.

with the discrete problem LJKOh:

infρn∈RNh+

supψ∈RNh

1

τ

( ∑K∈Th

(ρn−1K − ρnK)ψKmK−

1

2

∑K∈Th

∑σ∈Σint,K

((ψL − ψK)−

)2ρnKaσ

)+∑K∈Th

E(ρnK)mK , (14)

with the energy functional of the form E(ρ) =∫

ΩE(ρ,x). Note that (14) is still

strictly convex in the discrete variables (ρK)K∈Th and strictly concave in (ψK)K∈Th .

Lemma 2. The solution of problem (14) exists and is unique.

Therefore, the unique solution of this problem must satisfy the following dis-crete optimality conditions:

ψKmK +1

2

∑σ∈Σint,K

((ψL − ψK)−

)2aσ − τ

∂E(ρnK)

∂ρKmK = 0

(ρnK − ρn−1K )mK −

∑σ∈Σint,K

(ψL − ψK)ρnσaσ = 0∀K ∈ Th,

(15a)

(15b)

with the same upwind definition of ρnσ. While equation (15a) represents a par-ticular discretization of the potential equation, equation (15b) is precisely theFinite Volume discretization of equation (13b) with upstream technique. Hence,the LJKOh scheme consists, at each step, in finding the solution of the non-linearsystem of equations (15). If we neglect the term corresponding to the discretiza-tion of the gradient squared in the first equation and rescale the potential by τ ,ψ = ψ

τ, we obtain exactly the FV scheme for problem (5):

ψK =∂E(ρnK)

∂ρK1

τ(ρnK − ρn−1

K )mK −∑

σ∈Σint,K

(ψL − ψK)ρnσaσ = 0∀K ∈ Th, (16)

12

Page 13: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

It is now clear what we meant saying that our objective was to find an alterna-tive approach between FV and the ALG2-JKO schemes. Our scheme is based onthe Finite Volume approach for the discretization of partial differential equations.It is still strictly linked with the variational structure of the problem. However, asfor the FV scheme, the problem is non-linear and presents moreover a particularcoupling between the two equations of the system. Even worse, the number ofvariables has been doubled, since now we need to consider also the auxiliary vari-able ψ. What we expect in an increased stability due to the variational structure:the presence of the gradient term in (15) should add a bit of diffusion with respectto (16). Due to the linearization procedure we adopted, it is clear that the schemeis accurate only for relatively small time steps, with respect to the dynamics.

The LJKOh guarantees the conservation of the discrete total mass,∑

K ρ0KmK ,

with ρ0K initial discrete density.

Lemma 3. At each step n, the solution (ρnK)K∈Th of problem (14) satisfies∑K ρ

nKmK =

∑K ρ

n−1K mK.

Proof. It is sufficient to sum over all the cells K ∈ Th the equation (15b), sinceall the internal fluxes cancel out and no boundary fluxes are considered.

The LJKOh is trivially energy diminishing, as it is a direct discretization ofproblem (10). Denote by Enh =

∑K∈Th E(ρnK)mK the total discrete energy at step

n.

Lemma 4. At each step n, the solution (ρnK)K∈Th of problem (14) satisfiesEnh ≤ En−1

h .

Proof. Consider the discrete density (ρnK)K∈Th and the discrete potential (ψK)K∈Th ,generated by (15) at step n, and the discrete density (ρn−1

K )K∈Th . Problem (14)can be rewritten as

infρn∈RNh+

1

τ

∑σ∈Σint

(ψL − ψK)

)2ρnσaσ +

∑K∈Th

E(ρnK)mK , (17)

subjected to the constraint: (ρnK−ρn−1K )mK−

∑σ∈Σint,K

(ψL−ψK)ρnσaσ = 0, ∀K ∈Th (namely equation (15b)). It holds

1

τ

∑σ∈Σint

(ψL − ψK)

)2ρnσaσ +

∑K∈Th

E(ρnK)mK <∑K∈Th

E(ρn−1K )mK , (18)

just using the density (ρn−1K )K∈Th in (17). Indeed, from equation (15b), replacing

(ρnK)K∈Th with (ρn−1K )K∈Th , one gets

−∑

σ∈Σint,K

(ψL − ψK)ρn−1σ aσ = −

∑σ∈Σint,K

(ψL − ψK)−ρn−1K aσ = 0

=⇒∑

σ∈Σint,K

−(ψL − ψK)−aσ = 0,

13

Page 14: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

and therefore, since −(ψL − ψK)− are non-negative quantities, (ψK)K∈Th is con-stant.

Moreover, the scheme preserves the positivity of the discrete measure.

Lemma 5. Given the non-negative discrete measure at the step n−1, (ρn−1K )K∈Th,

the solution (ρnK)K∈Th of the system of equations (15) remains non-negative.

Proof. Consider the cell K and denote by

FK,ψ(ρnK , ρ

n−1K , (ρnL)L∈NK

)= (ρnK − ρn−1

K )mK −∑

σ∈Σint,K

(ψL − ψK)ρnσaσ,

for a fixed discrete potential field (ψK)K∈Th . FK,ψ(ρnK , ρ

n−1K , (ρnL)L∈NK

)is an in-

creasing function of ρnK , while it is decreasing for ρn−1K and (ρnL)L∈NK . Moreover,

FK,ψ(0, 0, 0

)= 0. Hence, exploiting again the notation (x)− = min(x, 0), we can

write

FK,ψ((ρnK)−, (ρn−1

K )−, ((ρnL)L∈NK )−)− FK,ψ(ρnK , ρ

n−1K , (ρnL)L∈NK ) ≤ 0,∑

K∈Th

(FK,ψ

((ρnK)−, (ρn−1

K )−, ((ρnL)L∈NK )−)− FK,ψ(ρnK , ρ

n−1K , (ρnL)L∈NK )

)≤ 0,

and, since the fluxes cancel out by summing over all the cells,∑K∈Th

((ρnK)− − ρnK

)≤∑K∈Th

((ρn−1K )− − ρn−1

K

)→∑K∈Th

(ρn−1K )−︸ ︷︷ ︸

=0

≤∑K∈Th

(ρnK)−,

i.e. ρnK ≥ 0,∀K ∈ Th. This holds true whatever discrete potential (ψK)K∈Th ,therefore is true for scheme (15).

To solve the non-linearity we chose to use a Newton scheme. Rewrite theproblem of finding, at each step n, the new density (ρnK)K∈Th as: find (ψ,ρn) ∈RNh×RNh such that F (ψ,ρn) = (F 1(ψ,ρn), F 2(ψ,ρn)) = 0, F 1 and F 2 denotingequations (15a) and (15b), respectively. The Newton method finds a sequence ofapproximated solutions (ψ`,ρ

n` ) by computing at each step `:

d` = −JF (ψ`−1,ρn`−1)−1F (ψ`−1,ρ

n`−1),

(ψ`, ρn` ) = (ψ`−1,ρ

n`−1) + d`,

(19)

where we indicated with JF the jacobian of the vector field F , with the con-vention (ψ0,ρ

n0 ) = (ψn−1,ρn−1). The algorithm stops when F` is close enough

14

Page 15: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

to zero, up to a specified tolerance. The Jacobian can be easily computed from(15). Since the vector field F is actually non-smooth, it should be more correctto speak about a semi-smooth Newton method. The values of ρn−1 need to beslightly modifies in those part of the domain where they vanish in case the energyfunctional is singular, as for the energy of the Fokker-Planck equation. To improvethe performance of the scheme (19), we admit variable time step τ in its imple-mentation. Whenever the number of iterations ` needed to reach convergence isless than a specific lower bound, we increase the time step τ by a factor 1.2. If,on the contrary, the number of Newton steps exceeds a specific upper bound, wehalve the time step τ and repeat the iteration n.

Remark. Since system of equations (15) is solved up to a specified tolerance, ateach step the solution (ρnK)K∈Th is non-negative up to a specified tolerance. Thisshould be taken into account to avoid problem in the convergence of the scheme.

4 Numerical results

The algorithm introduced in section 3 has been implemented in Matlab. To verifythe efficiency of our approach we performed several numerical experiments. Inparticular, to check the convergence of the LJKOh and to compare it with theclassical FV scheme (16), we solve the Fokker-Planck equation (4). To performthis comparison, we implemented also the latter scheme. Morever, to test thereliability and the performance of the LJKOh, we solve the more complicated caseof multiphase flows in porous media. We finally show that the scheme can beeasily extended to the computation of gradient flows on manifolds.

4.1 Fokker-Planck

The first problem we tackle is the gradient flow of the energy E(ρ) =∫

Ωρ log ρ−∫

ΩρV (x) [13]. As already mentioned, for this energy the problem coincides with

the linear Fokker-Planck equation (4). Moreover, if we set V (x) to zero, we recoverthe heat equation. In figure 3 a qualitative test can be found of this latter case:starting from an initial gaussian condition, since no flux is allowed across theboundary, the density diffuses in the whole domain, until it reaches a constantdistribution equal to the total mass divided by the area.

The LJKOh performs very well, for different type of potential V (x), the con-vergence of the Newton scheme is fast and the time step τ rapidly increases. Itis however sensitive to the initial condition: very sharp initial densities requiresmall time step to make the Newton scheme converge and start the integration.An intriguing question is the initial condition on the potential, which is not givenand has no meaning from the optimal transport point of view, but has great in-

15

Page 16: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

Figure 3: Gaussian initial density that flattens. Example of heat equation’s solution.

Figure 4: Sequence of regular triangular meshes.

fluence on the behavior of the Newton scheme. We did not deepen this issue andwe simply used null values.

To check numerically the correctness of our formulation we performed alsoquantitative tests. Consider the potential ρV (x) = −ρgx: for this case it ispossible to design an analytical solution and test the convergence of the scheme.Consider the domain Ω = [0, 1]2, the time interval [0, 0.25] and the followinganalytical solution of the Fokker-Planck equation (built from a one-dimensionalone):

ρ(x, y, t) = exp(−αt+g

2x)(π cos(πx) +

g

2sin(πx)) + π exp(g(x− 1

2)),

where α = π2 + g2

4. On the domain Ω = [0, 1]2, the function ρ is positive and satis-

fies the mixed boundary conditions (∇ρ+ρ∇V )·n|∂Ω = 0. We want to exploit theknowledge of this exact solution to compute the error we commit in the temporaland time integration. Consider a sequence of meshes (Thk ,Σ, (xK)K∈Thk )k withdeacreasing meshsize hk and a sequence of deacreasing time steps (∆t)k such thathk+1

hk= ∆tk+1

∆tk. In particular, we used a sequence of Delaunay triangular meshes

such that the meshsize halves at each step, obtained subdividing at each stepeach triangle into four using the edges midpoints. Three subsequent partitioningof the domain are shown in figure 4. In section 3 we said that we implementedthe Newton scheme with variable time step. Nonetheless, for this test we need to

16

Page 17: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

Table 1: Time-space convergence for the two schemes.

FV LJKO

h dt εL∞

r εL2

r εL∞

r εL2

r

0.2986 0.0500 0.1840 / 0.0799 / 0.1756 / 0.0790 /0.1493 0.0250 0.0965 0.931 0.0404 0.983 0.0889 0.983 0.0352 1.1660.0747 0.0125 0.0488 0.983 0.0202 1.004 0.0659 0.431 0.0172 1.0380.0373 0.0063 0.0245 0.996 0.0100 1.005 0.0455 0.535 0.0093 0.8850.0187 0.0031 0.0123 0.999 0.0050 1.003 0.0280 0.701 0.0051 0.8660.0093 0.0016 0.0061 1.000 0.0025 1.001 0.0158 0.829 0.0027 0.901

consider the time step fixed during the integration. Let us introduce the followingmesh-dependent errors:

ε2n =

∑K∈Th

(ρnK − ρ(xK , n∆t))2mK , → discrete L2 error

εL∞

= maxn

(εn), → discrete L∞((0, T );L2(Ω)) error,

εL2

=(∑

n

∆t ε2n

) 12 , → discrete L2((0, T );L2(Ω)) error,

where ρ(xK , n∆t) is the value in the cell center of the triangle K of the analyticalsolution at time n∆t, n running from 0 to the total number of time steps N∆t =d T

∆te. The upstream Finite Volume scheme with implicit Euler discretization of

the temporal derivative is known to exhibit order one of convergence applied tothis problem, both in time and space. This means that the L∞((0, T );L2(Ω))and L2((0, T );L2(Ω)) errors halve whenever h and ∆t halve. We want to inspectwhether the LJKOh recovers the same behavior. We can estimate the order ofconvergence computing the numerical rate

rk =εk−1

εk· hkhk−1

=εk−1

εk· ∆tk

∆tk−1

, (20)

for both the L2 and L∞ discrete errors. For the sequence of meshes and time steps,for k going from one to the total number of meshes, we computed the solution tothe linear Fokker-Planck equations and the errors, using both the Finite Volumescheme and the LJKOh. The results are shown in table (1): for each meshsize andtime step k, it is represented the error together with the rate (20). The LJKOh

exhibits the same order of convergence of the FV scheme.To further investigate and compare the behavior of the LJKOh scheme with the

FV, we computed also the energy decay along the trajectory. We call dissipationthe difference E(ρ)−E(ρ∞), where ρ∞ is the final equilibrium condition, the long

17

Page 18: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

time behavior. Since the Fokker-Planck equation can be seen as the gradient flowof its related energy, its dissipation is a useful criteria to assess the goodness ofthe scheme. The long time value of the energy is equal to:

E( limt→∞

ρ) =

∫Ω

limt→∞

(ρ log ρ− ρgx)dx

= exp(g

2)(π log(π)

g+π

2− π

g) + exp(−g

2)(−π log(π)

g− π

2+π

g).

It is possible to define the equilibrium solution also on the discrete dynamics onthe grid. Namely, the equilibrium solution for the dynamic defined on the grid is

ρ∞K = M exp(−VK), VK = V (xK),

as it can be easily checked to be the unique minimizer of the discrete energyEh =

∑K∈Th E(ρK)mK subject to the constraint of the conservation of the mass:

∂ρK

(Eh + λ

∑(ρK − ρ0

K)mK

)|ρ∞K =

(log ρ∞K + 1 + VK + λ

)mK = 0, ∀K ∈ Th

=⇒ ρ∞K = exp(−(1 + λ)− VK) = M exp(−VK), ∀K ∈ Th,

with λ lagrange multiplier associated with the constraint. M is the constant thatmakes (ρ∞K )K∈Th have the same total mass,

M =

∑K∈Th ρ

0KmK∑

K∈Th exp−VK mK

.

It is immediate to observe that this is indeed the equilibrium solution in the FVscheme, since with such density the potential in (16) is constant:

ψK =δEh(ρ)

δρK|ρ∞K = log ρ∞K +1+VK = logM−VK+1+VK = logM+1, ∀K ∈ Th.

For the LJKOh scheme instead, as already explained in lemma 4, whenever ρnK =ρn−1K ,∀K ∈ Th, as it is the case for an equilibrium solution, the potential is

constant. From the potential equation one gets again

ψK = τδE(ρ)

δρK|ρ∞K = τ(logM + 1),∀K ∈ Th.

In figure 5 it is represented the semilog plot of the dissipation of the system,computed for the LJKOh and the FV, Eh(ρK) − Eh(ρ∞K ), and the real solution,E(ρ)− E(ρ∞). In figure 5a it is noticeable that the LJKOh scheme dissipates theenergy faster than the FV scheme: the LJKOh is a bit more diffusive. This isan expected behavior since the scheme is built to maximize the decrease of the

18

Page 19: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

energy and this is actually one of the main strength of the approach. In figure 5b,one can see that the two dissipation tends to the real one when finer mesh andsmaller time step are used, for both schemes, despite the fact that the LJKOh stilldissipates faster. In the end, in figure 5c it is remarkable that for a very smalltime step the dissipation of the two schemes tends to coincide, as it is expected:for the time parameter going to zero the two schemes coincide. Indeed, this isanother numerical evidence of the convergence of the LJKO scheme to the samesolutions of the original JKO.

4.2 Incompressible immiscible multiphase flows in porousmedia

Incompressible immiscible multiphase flows in porous media have been provenin [9] to be Wasserstein gradient flows. We recall quickly the modeling of thisproblem. Consider a subset Ω of R2 to represent the porous medium. Within themedium, N + 1 phases are flowing. Denote by s = (s0, ..., sN) the saturations ofeach phase, i.e.,

si =Viω|Ω|

, i ∈ 0, ..., N

where ω represents the porosity of the medium, considered constant for simplicity,|Ω| is the total volume of the domain and Vi the volume occupied by the i-th phase.As evident, the following total saturation relation

N∑i=0

si = 1 (21)

needs to be satisfied. We denote by

∆ =

s ∈ RN+1+ :

N∑i=0

si = 1,

χ =

s : Ω→ RN+1 : s(x) ∈ ∆ for a.e. x ∈ Ω.

As a consequence of (21), the composition of the fluid is fully characterized bythe knowledge of the saturations si, i ∈ 1, ..., N. The first governing law of thesystem is the Darcy’s law that quantifies the convection speed that moves eachphase:

vi = − κµi

(∇pi − ρig), i ∈ 0, ..., N,

where the parameter κ, the permeability, is characteristic of the porous mediumwhereas the densities ρi and the viscosities µi, both constant in the whole domain,are characteristic of each phase. The term ρig reflects the influence of the potential

19

Page 20: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

(a) T = 0.25,∆t = 0.01, h = 0.1493. Dissipation over the time interval [0, T ] and detail.

(b) T = 0.25,∆t = 0.0063, h = 0.0373. Dissipation over the time interval [0, T ] and detail.

(c) T = 0.25,∆t = 0.0001, h = 0.1493. Dissipation over the time interval [0, T ] and detail.

Figure 5: Comparison of the dissipation of the system computed with the two numer-ical schemes and in the real case. Semi-logarithmic plot.

20

Page 21: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

energy on the motion (g is the gravity acceleration), but other type of potentialsenergy could be considered in the model. The unknown phase pressures (pi),i ∈ 0, ..., N, are related to the saturations by N capillary pressure relations:

pi − p0 = πi(s∗,x), a.e. in Ω, i ∈ 0, ..., N,

where s∗ = (s1, ...sN). The second governing law is the mass balance. Each phaseevolves convected by its own speed vi satisfying the continuity equation that canbe written directly in terms of the saturations:

ω∂si∂t

+∇ · (sivi) = 0, i ∈ 0, ..., N.

The physical system is completed by a no flux boundary condition across theboundary ∂Ω of the domain, that translates in the condition vi · n|∂Ω = 0 for eachphase: the total mass is conserved along time. A rescaling of the time allows toconsider the porosity equal to one and we will therefore disregard it.

This physical system can be interpreted as a gradient flow as clarified in [8],[9]. Consider the spaces:

Ai =si ∈ L1(Ω;R+) :

∫Ω

sidλ = ci

, i ∈ 0, ..., N,

with the constant ci depending on the density of the i-th phase. Given s1i and s2

i

belonging to Ai, the set of admissible transport plans between s1i and s2

i is definedby

Γi(s1i , s

2i ) =

γi ∈M+(Ω× Ω) : γi(Ω× Ω) = ci, γ

1i = s1

i , γ2i = s2

i

,

where M+(Ω × Ω) stand for the set of Borel measures on Ω × Ω and γ1i , γ

2i are

the first and second marginal of the measure γi. We can endowed the space Aiwith the following quadratic Wasserstein distance:

W 2i (s1

i , s2i ) = min

γi∈Γi(s1i ,s2i )

∫Ω×Ω

µiκ|x− y|2dγi.

We can define the global quadratic Wasserstein distance W on A := A0× ...×ANby setting

W 2(s1, s2) =N∑i=0

W 2i (s1

i , s2i ), ∀s1, s2 ∈ A.

The incompressible immiscible multiphase flows in the porous medium can thenbe represented as the gradient flow in the space A with respect to the energyfunctional

E(s) =

∫Ω

Ψ · s dλ+

∫Ω

Π(s∗) dλ+

∫Ω

χ∆(s) dλ, (22)

21

Page 22: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

where Ψ is the exterior gravitational potential given by

Ψi(x) = −ρig · x, ∀x ∈ Ω

(but one can consider a large class of arbitrary potentials), Π(s∗) is a strictlyconvex potential from which the capillary pressure relations are assumed to derive

πi(s∗,x) =

∂Π(s∗,x)

∂si, i ∈ 1, ..., N,

χ∆ is the indicator function of the set ∆, i.e.,

χ∆(s) =

0 if s(x) ∈ ∆,

+∞ otherwise.

The functional (22) is strictly convex, for all s ∈ ∆, therefore we can applydirectly the LJKOh scheme for the approximate resolution of the gradient flow.Nonetheless, it is not differentiable. As a consequence, we need to consider itssub-differential, given by:

∂sE(s) =ϕ : Ω→ RN+1, s.t. ϕi − ϕ0 − (ρi − ρ0)gz ∈ π(si,x), a.e. x ∈ Ω

for all s ∈ χ.

This construction has been detailed and proven in [9]. In [7], this model hasbeen solved numerically, for two- and three-phase problems, using two approaches:the direct application of the FV scheme with upstream mobility and the ALG2-JKO scheme. In these papers, further assumptions has been considered in orderto prove the convergence of the two schemes. We avoid them since we do notwant here to prove the convergence of the LJKOh in this context. Our purposeis to apply the LJKOh scheme to assess numerically its feasibility, and comparequalitatively its behavior with the other two.

4.2.1 Two-phase flow

We consider a two-phase flow, where water (s0) and oil (s1) are competing in theporous medium. We choose the classical Brooks-Corey capillary pressure model:

p1 − p0 = π1(s1) = α(1− s1)−12 .

Therefore, the energy functional is:

E(s0, s1) :=

∫Ω

(s0ρ0gz + s1ρ1gz

)dλ− 2α

∫Ω

(1− s1)12 dλ+

∫Ω

χ∆(s1, s0)dλ, (23)

with ρ0g = 9.81 and ρ1g = 0.87 · 9.81, g acting along the negative direction of thez axis. We set the model parameter α = 1. For the viscosity of the two fluids we

22

Page 23: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

take the simplistic values µ0 = 1 and µ1 = 100, whereas the permeability of themedium is κ = 1.

After the linearization of the Wasserstein distance (of both the two contribu-tions)

W22 ((sn−1

0 , sn−11 ), (s0, s1)) =W2

2 (sn−10 , s0) +W2

2 (sn−11 , s1) ≈

≈ sup(ψ0,ψ1)

1

τ

(µ0

κ

∫Ω

((sn−1

0 − s0)ψ0 −1

2|∇ψ0|2s0

)dλ+

µ1

κ

∫Ω

((sn−1

1 − s1)ψ1 −1

2|∇ψ1|2s1

)dλ),

the problem becomes:

inf(s0,s1)

sup(ψ0,ψ1)

1

τ

(µ0

κ

∫Ω

((sn−1

0 − s0)ψ0 −1

2|∇ψ0|2s0

)dλ+

+µ1

κ

∫Ω

((sn−1

1 − s1)ψ1 −1

2|∇ψ1|2s1

)dλ)

+ E(s0, s1), (24)

whose optimality conditions are:

ψ0 +1

2|∇ψ0|2 − τ

κ

µ0

ϕ0 = 0

ψ1 +1

2|∇ψ1|2 − τ

κ

µ1

ϕ1 = 0

(s0 − sn−10 )−∇ · (s0∇ψ0) = 0

(s1 − sn−11 )−∇ · (s1∇ψ1) = 0

s0 + s1 − 1 = 0

ϕ1 − ϕ0 + (ρ1 − ρ0)gz − α(1− s1)−12 = 0

(25)

The first four equations are discretized as previously explained, the only differencebeing the presence of the auxiliary variables ϕ0 and ϕ1 in place of the derivativeof the energy functional. The last two are discretized as:

s0,K + s1,K − 1 = 0, ∀K ∈ Th,ϕ1,K − ϕ0,K + (ρ1 − ρ0) g zK − α(1− s1,K)−

12 = 0, ∀K ∈ Th.

(26)

We perform the same simulation contained in [7]. We use a grid of regular(Delaunay) triangles, as the one in figure 4, with 2560 triangles. In order tohave a meaningful comparison of the behavior of the temporal integration (ofthe Newton scheme in particular), we used a grid with a number of cells of thesame order of the one used in [7]. The evolution of the two phases, horizontallyseparated at the beginning, is shown in figure 6. The water, the denser phase, isinstantaneously diffused in the whole domain because of the singularity of π1 near1. The oil, less dense than the water, due to the effect of the gravity, moves to thetop and the two phases tend to separate vertically. The results, from a qualitative

23

Page 24: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

inspection, match with the ones contained in [7]. The Newton scheme, despite theinitial difficulty, works well and the time step tends to increase as the simulationgoes on, reaching values of the order of 0.1 s (and even more if the simulationcontinues). It is clear that the difficulties are at the beginnning, due to the sharpinitial condition on the saturations and again to the lack of a complete initialcondition. Our approach involves an increased number of variables, but only theinitial condition on the saturations is known. In particular, the Newton schemesenses the lack of an initial value for the potential. For these reasons, the schemeneeds at the beginning a really small time step, that increases immediately rightafter.

4.2.2 Three-phase flow

We consider now a three-phase flow where, in addition to water (s0) and oil (s1),also gas (s2) is in competition within the porous medium. As physical parameters,we consider now the values µ0 = 1, µ1 = 50 and µ2 = 0.1 for the viscosities,whereas ρ0 = 1, ρ1 = 0.87 and ρ2 = 0.1 for the densities. We assume the capillaryfunctions of the form:

p1 − p0 = π1(s1) = α1s1 and p2 − p0 = π2(s2) = α2s2.

Therefore, the energy functional writes:

E(s0, s1, s2) :=

∫Ω

( 2∑i=0

siρigz)dλ+

α1

2

∫Ω

s21dλ+

α2

2

∫Ω

s22dλ+

∫Ω

χ∆(s0, s1, s2)dλ

(27)

(g acts along the negative direction of the z axis). We consider the two modelparameters α1 and α2 equal to one. Applying the LJKOh, each phase’s evolutionis described by its continuity and potential equations, as in (25), and we need toadd the other three optimality conditions,

s0 + s1 + s2 − 1 = 0,

ϕ1 − ϕ0 − (ρ1 − ρ0)gz − α1s1 = 0,

ϕ2 − ϕ0 − (ρ2 − ρ0)gz − α2s2 = 0,

that can be again directly discretized as in (26).To test the reliability of our approach, we performed the same simulation

contained in [7] and we used again a grid with 2560 (Delaunay) triangles. Theevolution of the three phases is shown in figure 7 and 8: the results match with theones obtained with the FV and ALG2-JKO schemes. The saturations, startingfrom the initial conditions, tend to stratify in three layers of decreasing density.

24

Page 25: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

t=0 s

t=2.5 s

t=5 s

t=7.5 s

t=10 s

Figure 6: Water (right) and oil (left) saturations evolution in the time interval [0, 10].

25

Page 26: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

The diagnostic of the functioning of the Newton scheme does not change withrespect to the two-phase case, this being the main difference with the other twoapproaches. Indeed, the FV and ALG2-JKO schemes sense a huge difference inthe solution of the three-phase problem with respect to the two-phase one. In [7],the computational time needed to solve the former problem deeply increased withrespect to the latter, requiring hours (and even days) to solve it. The LJKOh

scheme instead solves this harder problem without sensing particular differences.The time step, starting from a small initial value, increases until values of theorder of 0.1 s.

5 Manifold

We want here to show that the LJKOh scheme can be directly exploited for thecomputation of Wasserstein gradient flows on manifolds, without any particu-lar change. We just show a simple example. Let M be a connected, completesmooth Riemannian manifold, equipped with its standard volume measure dS.We consider the gradient flow related to the energy

E(ρ) =1

m− 1

∫M

ρmdS, m > 1, (28)

which corresponds to the porous media equation

∂tρ = ∆ρm inM,

completed with the no flux boundary condition: ∇ρm−1·n = 0 on ∂Ω. We consideragain a discretization in Delaunay triangles of the manifold. The scheme (15) canbe directly applied, the energy functional (28) is convex and differentiable. Theonly difference with respect to (15) is that the euclidean distance between two cell-centers of two neighboring cells dσ is replaced by their geodesic distance, that is,due to the regularity of the triangulation, the sum of the euclidean distance of thetwo cell-centers from the edge midpoint. In figure 9 the evolution of the densityon a manifold is shown. We considered as initial condition a delta distribution(different scales have been used in the various plot for this reason). For this testwe considered the value m = 2. Notice the finite speed of propagation of thesolution.

6 Conclusions

We presented an alternative approach for the numerical solutions of gradient flowproblems, via a linearization of the quadratic Wasserstein distance, with respectto classical optimization methods. This approach is also alternative to the direct

26

Page 27: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

t=0 s

t=0.1 s

t=1.25 s

t=3.75 s

Figure 7: Water (center), oil (left) and gas (right) saturations evolution in the timeinterval [0, 10].

27

Page 28: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

t=5 s

t=6.25 s

t=8.75 s

t=10 s

Figure 8: Water (center), oil (left) and gas (right) saturations evolution in the timeinterval [0, 10].

28

Page 29: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

t=0 s t=0.01 s

t=0.1 s t=0.5 s

t=1.5 s t=3 s

Figure 9: Porous media equation with m = 2 on a manifold. The mesh has been takenfrom [11].

29

Page 30: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

discretization of the partial differential equations describing the problems andenables to preserve the variational structure. In particular, the approach can beseen as an alternative to standard implicit Euler discretization for the temporalderivative. Via numerical experiments we checked its validity and its features.The scheme seems to preserve the order one of convergence in time and space.We checked its reliability by comparing its outcomes with the FV and ALG2-JKOschemes on the solution of multiphase flows in porous media. The LJKOh revealsto be more robust than the FV scheme and at the same time faster than theALG2-JKO. This is the goal we wanted to achieve. Further, the approach can bedirectly applied to the solution of gradient flows defined on manifolds.

However, we did not manage to prove the convergence of the scheme theoret-ically. This will be the first problem to tackle during the PhD. Several otherachievements will be considered: extend the method to non-preserving massproblems; generalization to other boundary conditions (non trivial due to theoptimal transport formulation of the method); efficient implementation of the(semi-smooth) Newton method for the numerical resolution of the system of lin-ear equations; increase the order of the in time approximation via a generalizationof our approach to higher order JKO schemes ([17],[16]); extension of the approachto other optimal transport related problems.

References

[1] L. Ambrosio, E. Mainini, and S. Serfaty, Gradient flow of thechapman-rubinstein-schatzman model for signed vortices, 28 (2011).

[2] L. Ambrosio and S. Serfaty, A gradient flow approach to an evolutionproblem arising in superconductivity, 61 (2008), pp. 1495 – 1539.

[3] J.-D. Benamou, G. Carlier, and M. Laborde, An augmented la-grangian approach to wasserstein gradient flows and applications, 54 (2016),pp. 1–17.

[4] M. Bessemoulin, A finite volume scheme for convection-diffusion equationswith nonlinear diffusion derived from the scharfetter-gummel scheme, 121(2012), pp. 637–670.

[5] A. BLANCHET, A gradient flow approach to the keller-segel systems(progress in variational problems: Variational problems interacting with prob-ability theories), (2013).

[6] C. Cances and C. Guichard, Numerical analysis of a robust free en-ergy diminishing finite volume scheme for parabolic equations with gradientstructure, (2016).

30

Page 31: Master in Optimization Internship’s report · 2018. 9. 26. · Master in Optimization Internship’s report Todeschi Gabriele 13/09/2018 Abstract The purpose of this internship

[7] C. Cances, T. O. Gallouet, M. Laborde, and L. Monsaingeon,Simulation of multiphase porous media flows with minimizing movement andfinite volume schemes, (2018).

[8] C. Cances, T. O. Gallouet, and L. Monsaingeon, The gradient flowstructure of immiscible incompressible two-phase flows in porous media, C.R. Acad. Sci. Paris Ser. I Math., (2015), pp. 353:985–989.

[9] C. Cances, T. O. Gallouet, and L. Monsaingeon, Incompressibleimmiscible multiphase flows in porous media: a variational approach, Anal.PDE, (2017), pp. 10(8):1845–1876.

[10] P. Cardaliaguet, Weak solutions for first order mean field games withlocal coupling, 11 (2013).

[11] X. Chen, A. Golovinskiy, and T. Funkhouser, A benchmark for 3Dmesh segmentation, ACM Transactions on Graphics (Proc. SIGGRAPH), 28(2009).

[12] E. De Giorgi, New problems on minimizing movements, RMA Res. NotesAppl. Math., 29 (1993), pp. 81–98.

[13] R. Jordan, D. Kinderlehrer, and F. Otto, The variational formula-tion of the fokker-planck equation, 29 (2000).

[14] D. Kinderlehrer, L. Monsaingeon, and X. Xu, A wasserstein gradientflow approach to poisson-nernst-planck equations, 2015 (2015).

[15] P. Laurencot and B.-V. Matioc, A gradient flow approach to a thinfilm approximation of the muskat problem, 47 (2011).

[16] G. Legendre and G. Turinici, Second-order in time schemes for gradientflows in wasserstein and geodesic metric spaces, 355 (2017), pp. 345–353.

[17] D. Matthes and S. Plazotta, A variational formulation of the bdf2method for metric gradient flows, (2017).

[18] A. Mielke, A gradient structure for reaction-diffusion systems and forenergy-drift-diffusion systems, Nonlinearity, 24 (2011), pp. 1329–1346.

[19] F. Otto, The geometry of dissipative evolution equations: The porousmedium equation, 26 (2000).

[20] C. Villani, Topics in Optimal Transportation, Graduate studies in mathe-matics, American Mathematical Society, 2003.

31