C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics...

73
Simulation of Nondifferentiable Models for Groundwater Flow and Transport C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics Center for Research in Scientific Computation North Carolina State University Raleigh, North Carolina, USA CMWR04, University of North Carolina Chapel Hill, NC June 14, 2004 C. T. Kelley – p.1

Transcript of C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics...

Page 1: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Simulation of Nondifferentiable Models for Groundwater Flow and Transport

C. T. Kelley, K. R. Fowler, C. E. Kees

Department of Mathematics

Center for Research in Scientific Computation

North Carolina State University

Raleigh, North Carolina, USA

CMWR04, University of North Carolina

Chapel Hill, NC

June 14, 2004

C. T. Kelley – p.1

Page 2: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Outline

• Nonsmooth models• Richards’ equation:

van Genuchten/Mualem formulae• Reactive transport

Freundlich isotherm

• What solvers must do• ODE/DAE formulations• Nonsmooth calculus and ADH• Temporal error estimation and control (time?)

• Conclusions

C. T. Kelley – p.2

Page 3: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Collaborators

• ERDC: Stacy Howington, Charlie Berger,Jackie Hallberg

• NCSU: Jill Reese

• UNC: Casey Miller, Matthew Farthing, Joe Kanney

• Clemson: Lea Jenkins

• Mathworks: Mike Tocci

• Old Dominion: Glenn Williams

C. T. Kelley – p.3

Page 4: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Richards’ Equation: pressure head form

SsSa(ψ)∂ψ∂ t

+η∂Sa(ψ)

∂ t= ∇ · [K(ψ)∇(z+ψ)]

ψ pressure head Ss specific storageSa(ψ) saturation η porosityK(ψ) hydraulic conductivity

C. T. Kelley – p.4

Page 5: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

van Genuchten and Mualem formulae

Sa(ψ) =

{

Sr + (1−Sr)[1+(α |ψ|)n]m , ψ < 0

1, ψ ≥ 0,

K(ψ) =

{

Ks[1−(α |ψ|)n−1[1+(α |ψ|)n]−m]2

[1+(α |ψ|)n]m/2 , ψ < 0

Ks, ψ ≥ 0.

Sr residual saturationα coefficient for mean pore sizeKs saturated hydraulic conductivityn measure of pore size uniformity; m = 1−1/n

C. T. Kelley – p.5

Page 6: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Non-smooth nonlinearities

• K is not Lipschitz continuous if 1 < n < 2

• non-Lipschitz K causes many problems

C. T. Kelley – p.6

Page 7: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Non-smooth nonlinearities

• K is not Lipschitz continuous if 1 < n < 2

• non-Lipschitz K causes many problems• Nonlinear solvers in implicit temporal integration fail• Bizarre nonphysical effects

See Chris Kees’ poster

C. T. Kelley – p.6

Page 8: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Non-smooth nonlinearities

• K is not Lipschitz continuous if 1 < n < 2

• non-Lipschitz K causes many problems• Nonlinear solvers in implicit temporal integration fail• Bizarre nonphysical effects

See Chris Kees’ poster

• Fix: interpolate (or fit data) with a spline• Speeds up the simulation• Makes the nonlinearity smooth

or at least Lipschitz continuous

C. T. Kelley – p.6

Page 9: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Non-smooth nonlinearities

• K is not Lipschitz continuous if 1 < n < 2

• non-Lipschitz K causes many problems• Nonlinear solvers in implicit temporal integration fail• Bizarre nonphysical effects

See Chris Kees’ poster

• Fix: interpolate (or fit data) with a spline• Speeds up the simulation• Makes the nonlinearity smooth

or at least Lipschitz continuous

• ERDC ADH code uses PL splinesLipschitz continuous/not differentiable

C. T. Kelley – p.6

Page 10: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Reactive Transport in Porous Media

Freundlich isotherm:

Csηρb

= Kmax(C,0)r

Transport equation:

(C +ρb

ηKmax(C,0)r)t +∇ · [Cv−D∇C] = 0

Cs equilibrium concentration in the solid phase

r Freundlich exponent

C Freundlich coefficient

ρb bulk density of the solid phase

η porosity

v mean pore velocity

D hydrodynamic dispersion tensorC. T. Kelley – p.7

Page 11: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Nonsmoothness and a Fix

Nonlinearity is not Lipschitz continuous if 0 < r < 1.Fix: Differential Algebraic Equation (DAE) formulationDifferential equation:

mt +∇ · [Cv−D∇C] = 0.

Algebraic constraint:

(

η max(m−C,0)

ρbK

)1/r

−C = 0.

And now everything is differentiable,

C. T. Kelley – p.8

Page 12: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Nonsmoothness and a Fix

Nonlinearity is not Lipschitz continuous if 0 < r < 1.Fix: Differential Algebraic Equation (DAE) formulationDifferential equation:

mt +∇ · [Cv−D∇C] = 0.

Algebraic constraint:

(

η max(m−C,0)

ρbK

)1/r

−C = 0.

And now everything is differentiable,but I’ve added an equation.

C. T. Kelley – p.8

Page 13: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

DAE and ODE Dynamics

ut = f (t,u), u(0) = u0 ODE

f (t,u,ut) = 0, u(0) = u0,u′(0) = u′0 DAE

We have at most Index-one DAEs here.i.e. Implicit Euler works.Initial data for u′(0) is the solver’s job.

C. T. Kelley – p.9

Page 14: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

What DAEs can do for you.

• Make temporal integration work better (Richards)

• Hide nonsmooth physics (Freundlich)

C. T. Kelley – p.10

Page 15: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

What DAEs can do for you.

• Make temporal integration work better (Richards)

• Hide nonsmooth physics (Freundlich)

It’s still your job to design good solvers

• regularity of the solution

• differentiability of the nonlinearity

• discretizations

• linear solvers and preconditioning

C. T. Kelley – p.10

Page 16: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

DAE formulation of Reactive Transport Equation

Two equations for m and C

mt =−∇ · [Cv−D∇C] = f (m,C) Differential Equation

and(

η max(m−C,0)

ρbK

)1/r

−C = g(m,C)= 0 Algebraic Constraint

There’s no Ct anywhere.

C. T. Kelley – p.11

Page 17: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Solving Reactive Transport Equationwith Implicit Euler

Discretize in space, and advance in time by solving

mn+1 = mn +h f (mn+1,Cn+1),

g(mn+1,Cn+1) = 0.

So the equation is for u = (m,C)T .

C. T. Kelley – p.12

Page 18: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Newton’s method

SolveF(u) = 0

byu+ = uc + s, F ′(uc)s =−F(uc)

C. T. Kelley – p.13

Page 19: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Newton’s method

SolveF(u) = 0

byu+ = uc + s, F ′(uc)s =−F(uc)

Solve for F ′(uc)s =−F(uc) for the step by

• Gaussian elimination (compute and factor matrix)

• iterative method with computed(approximate) Jacobian

• Matrix free: iterative method,finite difference Jacobian-vector products

C. T. Kelley – p.13

Page 20: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Newton’s method

SolveF(u) = 0

byu+ = uc + s, F ′(uc)s =−F(uc)

Solve for F ′(uc)s =−F(uc) for the step by

• Gaussian elimination (compute and factor matrix)

• iterative method with computed(approximate) Jacobian

• Matrix free: iterative method,finite difference Jacobian-vector products

Everything works if F ′(u∗) is nonsingular.

C. T. Kelley – p.13

Page 21: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

What do you feed the solver?

F

(

mC

)

=

(

m−mn−h f (m,C)

g(m,C)

)

=

(

00

)

Solve with Newton. Converged result is (mn+1,Cn+1)T .

C. T. Kelley – p.14

Page 22: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

What do you feed the solver?

F

(

mC

)

=

(

m−mn−h f (m,C)

g(m,C)

)

=

(

00

)

Solve with Newton. Converged result is (mn+1,Cn+1)T .For small h,

F ′ =

(

I−h fm −h fCgm gC

)

is nonsingular if gC is nonsingular (aka index one).

C. T. Kelley – p.14

Page 23: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Is RE a DAE?

Discretize in space, and you have

SsSa(ψ)∂ψ∂ t

+η∂Sa(ψ)

∂ t= N(ψ)

ODE solve: Use the chain rule and get

∂ψ∂ t

=N(ψ)

SsSa(ψ)+ηS′a(ψ),

so implicit Euler is . . .

C. T. Kelley – p.15

Page 24: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Implicit Euler for ODE formulation of RE

ψn+1 = ψn +hN(ψn+1)

SsSa(ψn+1)+ηS′a(ψn+1),

performs poorly:

C. T. Kelley – p.16

Page 25: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Implicit Euler for ODE formulation of RE

ψn+1 = ψn +hN(ψn+1)

SsSa(ψn+1)+ηS′a(ψn+1),

performs poorly:

• small denominator,

C. T. Kelley – p.16

Page 26: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Implicit Euler for ODE formulation of RE

ψn+1 = ψn +hN(ψn+1)

SsSa(ψn+1)+ηS′a(ψn+1),

performs poorly:

• small denominator,

• small denominator is squared for the Jacobian,

C. T. Kelley – p.16

Page 27: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Implicit Euler for ODE formulation of RE

ψn+1 = ψn +hN(ψn+1)

SsSa(ψn+1)+ηS′a(ψn+1),

performs poorly:

• small denominator,

• small denominator is squared for the Jacobian,

• leading to many solver failures, which

C. T. Kelley – p.16

Page 28: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Implicit Euler for ODE formulation of RE

ψn+1 = ψn +hN(ψn+1)

SsSa(ψn+1)+ηS′a(ψn+1),

performs poorly:

• small denominator,

• small denominator is squared for the Jacobian,

• leading to many solver failures, which

• result in very small timesteps.

C. T. Kelley – p.16

Page 29: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

DAE formulation

SsSa(ψn+1)(ψn+1−ψn)+η(Sa(ψn+1)−Sa(ψn)) = hN(ψn+1).

This is a lot better,

• larger time steps,

• happier nonlinear solver,

• error control easier to understand, and

• what most folks do.

C. T. Kelley – p.17

Page 30: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

ERDC ADH Code

• approximate VG-Mualem formulae with PL splines

• We explain the success of• finite difference approximation of Jacobians• Newton’s method for implicit time-stepping• first order error estimation and control

C. T. Kelley – p.18

Page 31: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

ADH temporal integration

Solve

F(u) = SsSa(u)(u−ψn)+η(Sa(u)−Sa(ψn))−hN(u) = 0,

with Newton’s method.

C. T. Kelley – p.19

Page 32: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

ADH temporal integration

Solve

F(u) = SsSa(u)(u−ψn)+η(Sa(u)−Sa(ψn))−hN(u) = 0,

with Newton’s method.Approximate F ′(u) by a finite difference Jacobian ∂hF(u)

u+ = uc− (∂hF(uc))−1F(uc),

and you get good results. Why?

C. T. Kelley – p.19

Page 33: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Nonsmooth Calculus

F ∈ LIP implies F differentiable a.e.The generalized Jacobian (Clarke) at u is

∂F(u) = co

{

limu j→u;u j∈DF

F ′(u j)

}

C. T. Kelley – p.20

Page 34: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Nonsmooth Calculus

F ∈ LIP implies F differentiable a.e.The generalized Jacobian (Clarke) at u is

∂F(u) = co

{

limu j→u;u j∈DF

F ′(u j)

}

You’d like to replace Newton’s method with

un+1 = un−V−1n F(un)

where Vn ∈ ∂F(un).

C. T. Kelley – p.20

Page 35: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Nonsmooth Calculus

F ∈ LIP implies F differentiable a.e.The generalized Jacobian (Clarke) at u is

∂F(u) = co

{

limu j→u;u j∈DF

F ′(u j)

}

You’d like to replace Newton’s method with

un+1 = un−V−1n F(un)

where Vn ∈ ∂F(un).How do you compute Vn?Can you use this stuff in the real world?

C. T. Kelley – p.20

Page 36: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Piecewise smooth function: φ = φl +φr∂φ(0) = [φ ′l (0),φ ′r(0)], a SET.

−1 −0.5 0 0.5 10

0.2

0.4

0.6

0.8

1

1.2

1.4

φl

φl’(0) φ

r’(0)

φr

C. T. Kelley – p.21

Page 37: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Difference approximations

Scalar functions

∂hφ(u) =φ(u+h)−φ(u)

h

For Lipschitz functions:

∂hφ(u) ∈ ∂φ(u)+O(h)

where |u− u| ≤ h.Same story for scalar constitutive laws in PDEs.If you differentiate in coordinate directions!

C. T. Kelley – p.22

Page 38: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Difference approximation accuracyφ ′l (0)+O(h)≤ ∂hφ(u)≤ φ ′r(0)+O(h), so ∂hφ(u) ∈ ∂φ(0)+O(h)

−1 −0.5 0 0.5 10

0.2

0.4

0.6

0.8

1

1.2

1.4

φl

φl’(0) φ

r’(0)

φr

u u+h

∂h φ

C. T. Kelley – p.23

Page 39: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Semismoothness

A Lipschitz function F is semismooth (Mifflin, Pang, Qi) if

limw→0,V∈∂ F(u+w)

‖F(u+w)−F(u)−Vw‖‖w‖ = 0.

and semismooth of order 1 at u if

F(u+w)−F(u)−Vw = O(‖w‖2)

for all w ∈ RN and V ∈ ∂F(u+w) as w→ 0.What you need for local convergence of Newton’s method.Piecewise smooth functions are semismooth of order 1.

C. T. Kelley – p.24

Page 40: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Why semismoothness?

If

• F semismooth of order 1,

• F(u∗) = 0, and

• everything in ∂F(u∗) uniformly nonsingular,

• uc near u∗,

then if

u+ = uc−V−1F(uc), where V ∈ ∂F(uc),

C. T. Kelley – p.25

Page 41: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Why semismoothness?

If

• F semismooth of order 1,

• F(u∗) = 0, and

• everything in ∂F(u∗) uniformly nonsingular,

• uc near u∗,

then if

u+ = uc−V−1F(uc), where V ∈ ∂F(uc),

you get fast local convergence

‖u+−u∗‖= O(‖uc−u∗‖2).

C. T. Kelley – p.25

Page 42: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Convergence Proof, e = u−u∗

Semismoothness (u← u∗,w← ec,u+w← uc) implies

F(uc)−Vec = O(‖ec‖2)

C. T. Kelley – p.26

Page 43: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Convergence Proof, e = u−u∗

Semismoothness (u← u∗,w← ec,u+w← uc) implies

F(uc)−Vec = O(‖ec‖2)

Subtract u∗ from both sides of

u+ = uc−V−1F(uc),

C. T. Kelley – p.26

Page 44: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Convergence Proof, e = u−u∗

Semismoothness (u← u∗,w← ec,u+w← uc) implies

F(uc)−Vec = O(‖ec‖2)

Subtract u∗ from both sides of

u+ = uc−V−1F(uc),

to get

e+ = ec−V−1F(uc) = ec− ec +O(‖ec‖2) = O(‖ec‖2).

C. T. Kelley – p.26

Page 45: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

So what’s up with ADH?

u+ = uc− (∂hF(uc))−1F(uc)

and

∂hF(uc) ∈ ∂F(u)+O(h)

C. T. Kelley – p.27

Page 46: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

So what’s up with ADH?

u+ = uc− (∂hF(uc))−1F(uc)

and

∂hF(uc) ∈ ∂F(u)+O(h)

which implies

e+ = O(‖ec‖2 +‖ec‖h+h).

Looks just like Newton if ‖ec‖>>√

h.

C. T. Kelley – p.27

Page 47: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Iterative Linear Solvers

ADH uses preconditioned Krylov linear solvers.Termination on small relative linear residual,

‖F(uc)+∂hF(uc)s‖ ≤ ηc‖F(uc)‖.

Convergence,

e+ = O(‖ec‖2 +‖ec‖(ηc +h)+h).

C. T. Kelley – p.28

Page 48: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Iterative Linear Solvers

ADH uses preconditioned Krylov linear solvers.Termination on small relative linear residual,

‖F(uc)+∂hF(uc)s‖ ≤ ηc‖F(uc)‖.

Convergence,

e+ = O(‖ec‖2 +‖ec‖(ηc +h)+h).

Tradeoffs:

• Keep η small (accurate Newton step), for nonlinearperformance,

• but not too small, to minimize linear solver cost.

C. T. Kelley – p.28

Page 49: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Optimal difference increment

εF : error in evaluation (eg floating point roundoff)Include this in V to get

V (u) ∈ ∂F(u)+O(h+ εF/h)

C. T. Kelley – p.29

Page 50: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Optimal difference increment

εF : error in evaluation (eg floating point roundoff)Include this in V to get

V (u) ∈ ∂F(u)+O(h+ εF/h)

So, if ‖en‖=√

h, then

en+1 = O((h+ εF/h)‖en‖+‖en‖2 +h)

= O(

εFh1/2 +h

)

C. T. Kelley – p.29

Page 51: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Optimal difference increment

εF : error in evaluation (eg floating point roundoff)Include this in V to get

V (u) ∈ ∂F(u)+O(h+ εF/h)

So, if ‖en‖=√

h, then

en+1 = O((h+ εF/h)‖en‖+‖en‖2 +h)

= O(

εFh1/2 +h

)

which is minimized if h = O(ε2/3F )≈ 10−10 in IEEE.

C. T. Kelley – p.29

Page 52: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Temporal Error Estimation and Control

Process: for u′ = F(u), F Lipschitz continuousGoal: local truncation error < τ .

• Begin with un and un−1,

C. T. Kelley – p.30

Page 53: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Temporal Error Estimation and Control

Process: for u′ = F(u), F Lipschitz continuousGoal: local truncation error < τ .

• Begin with un and un−1,

• let up be a linear predictor to un+1,

up = un +hnun−un−1

hn−1

C. T. Kelley – p.30

Page 54: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Temporal Error Estimation and Control

Process: for u′ = F(u), F Lipschitz continuousGoal: local truncation error < τ .

• Begin with un and un−1,

• let up be a linear predictor to un+1,

up = un +hnun−un−1

hn−1

• Compute implicit Euler step, un+1 by solving

un+1 = un +hnF(un+1)

C. T. Kelley – p.30

Page 55: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Temporal Error Estimation and Control

Process: for u′ = F(u), F Lipschitz continuousGoal: local truncation error < τ .

• Begin with un and un−1,

• let up be a linear predictor to un+1,

up = un +hnun−un−1

hn−1

• Compute implicit Euler step, un+1 by solving

un+1 = un +hnF(un+1)

• Compare un+1 and up to estimate error and changestep size.

C. T. Kelley – p.30

Page 56: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

C. T. Kelley – p.31

Page 57: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

• Estimated local truncation error is Lh2n/2.

C. T. Kelley – p.31

Page 58: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

• Estimated local truncation error is Lh2n/2.

• > τ? Enforce Lh2n/2 < .9τ , try again.

C. T. Kelley – p.31

Page 59: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

• Estimated local truncation error is Lh2n/2.

• > τ? Enforce Lh2n/2 < .9τ , try again.

• Too many nonlinear iterations, reduce hn, try again.This was the problem in ODE form of RE!

C. T. Kelley – p.31

Page 60: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

• Estimated local truncation error is Lh2n/2.

• > τ? Enforce Lh2n/2 < .9τ , try again.

• Too many nonlinear iterations, reduce hn, try again.This was the problem in ODE form of RE!

• hn ok? Enforce Lh2n+1/2 < .9τ

C. T. Kelley – p.31

Page 61: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Details, details, details

• Estimate Lipschitz constant of u′ by

L = 2‖un+1−up‖/|2h2n−hnhn−1|

• Estimated local truncation error is Lh2n/2.

• > τ? Enforce Lh2n/2 < .9τ , try again.

• Too many nonlinear iterations, reduce hn, try again.This was the problem in ODE form of RE!

• hn ok? Enforce Lh2n+1/2 < .9τ

• Completely rigorousif we’re getting the Lipschitz constant right.

C. T. Kelley – p.31

Page 62: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Numerical Experiments

Compare

Ln+1 = 2‖un+1−up‖/|2h2n−hnhn−1|

with

L(un+1)‖F(un+1)−F(un)‖

tn+1− tn

You want to see

rn =Ln

L(un)≥ 1.

Study, RE for two media with 1 < n < 2.

C. T. Kelley – p.32

Page 63: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Media Properies

Parameter clay siltn 1.09 1.37α 0.244 0.478Sr 0.179 0.074η 0.33 0.40Ks 1.10808e-5 1.1801e-03Tf inal 600 days 150 daysmaxh 10 days 5 days

τ = 10−2, h0 = 10−9

C. T. Kelley – p.33

Page 64: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Clay

0 100 200 300 400 500 600−10

−5

0

5

10

15

20

25

30

35

40

time

r =

Ln/L

(un)

1/1001/2001/4001/800

r=1

C. T. Kelley – p.34

Page 65: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Silt

0 50 100 150−2

−1

0

1

2

3

4

5

6

time

r =

Ln/L

(un)

1/1001/2001/4001/800

r = 1

C. T. Kelley – p.35

Page 66: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster

C. T. Kelley – p.36

Page 67: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).

C. T. Kelley – p.36

Page 68: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

C. T. Kelley – p.36

Page 69: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

• Semismoothness is all you need for Newton’s method.

C. T. Kelley – p.36

Page 70: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

• Semismoothness is all you need for Newton’s method.• Exotic math; software needn’t know about it.

C. T. Kelley – p.36

Page 71: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

• Semismoothness is all you need for Newton’s method.• Exotic math; software needn’t know about it.• Solvers work, so error control also works.

C. T. Kelley – p.36

Page 72: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

• Semismoothness is all you need for Newton’s method.• Exotic math; software needn’t know about it.• Solvers work, so error control also works.• Implemented and working in ADH.

C. T. Kelley – p.36

Page 73: C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics …ctk.math.ncsu.edu/TALKS/CMWR.pdf · 2018-07-23 · C. T. Kelley, K. R. Fowler, C. E. Kees Department of Mathematics

Conclusions

• Nonsmooth nonlinearities are not a disaster• You can finesse them (Reactive Transport).• You can confront them directly (RE).

• Semismoothness is all you need for Newton’s method.• Exotic math; software needn’t know about it.• Solvers work, so error control also works.• Implemented and working in ADH.

• High-order methods in time seem to work. Why?

C. T. Kelley – p.36