e4301: numerical methods for pde’smspieg/e4301/lectures/lecture01_2011.pdf · e4301: numerical...

Post on 09-Mar-2018

225 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

E4301: Numerical Methods for PDE’sTu/Thur 11:00-12:15 327 Mudd

www.ldeo.columbia.edu/~mspieg/e4301

Prof. Marc SpiegelmanDept. of Applied Physics and Applied Math

Dept of Earth and Env. Sciences

This Course is Not

• An advanced course in numerical analysis (E6302)

• A programming course. You should have some fluency in a programming language of your choice (for projects) and Matlab for homework assignments.

• Going to be comprehensive: e.g. give you the latest/greatest algorithms for application X (but the project will let you explore any application area of your choice, in the language of your choice).

Course Objectives

• Give both understanding and experience in numerical solution of the most commonly occurring PDEs

• Give you enough analytical tools and examples to understand how it can go badly wrong and why.

• Help you start making intelligent choices of models and methods for solving problems of your choosing

Computational Science Choices

• Choose a Problem

Computational Science Choices

• Choose a Problem• Choose a mathematical Model

Computational Science Choices

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Spatial/Temporal Discretization

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Solver:

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Solver:• Choose Visualization/Analysis Tools:

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Choose a Solver:• Choose Visualization/Analysis Tools:

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

Choose Your Software!

• Choose a Solver:• Choose Visualization/Analysis Tools:

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

Choose Your Software!

• Choose a Solver:• Choose Visualization/Analysis Tools:

• Choose a Spatial/Temporal Discretization• Choose a Functional Discretization Discrete problem

Auh = fh, F(uh) = 0

2

Continuous description Lu = f

• Choose a Problem• Choose a mathematical Model• Choose your PDE’s

Computational Science Choices

• Verification: did you solve the mathematical problem as posed?• Validation: Is your model a good description of reality?

n Dimension

1 Dimension

Choose your Problems/PDE’ssingle physics problems

Basic Problems:

• Di↵usion Problems (Parabolic Equations)

@u

@t

= r· Kru

• Wave Equations (Hyperbolic Equations)

@u

@t

+ c

@u

@x

= 0

@

2u

@t

2+ cr2

u = 0

• Steady State BVPs (Elliptic Equations)

r2u = ⇢

Plus Boundary and initial conditions

3

n Dimension

1 Dimension

Choose your Problems/PDE’ssingle physics problems

Plus Initial and Boundary Conditions!

Basic Problems:

• Di↵usion Problems (Parabolic Equations)

@u

@t

= r· Kru

• Wave Equations (Hyperbolic Equations)

@u

@t

+ c

@u

@x

= 0

@

2u

@t

2+ cr2

u = 0

• Steady State BVPs (Elliptic Equations)

r2u = ⇢

Plus Boundary and initial conditions

3

• Fluid Dynamics (Incompressible Navier Stokes

Equations)

@v

@t

+ v · rv = �rP + ⌫r2v +1

f

r· v = 0

• Elastic Wave propagation

@

2u

@t

2= µr2u + (� + µ)r(r· u)

4

Choose your Problems/PDE’smore complex vector valued problems

Choose your Problems/PDE’s“Multi-Physics Problems”

• Thermal Convection (Advection/Di↵usion

of heat + Equations of motion)

@T

@t

+ v · rT = r2T

@v

@t

+ v · rv = �rP + ⌫r2v + RaT g

r· v = 0

• Magma Dynamics (my personal favorite)

D�

Dt

= (1� �)P⇠

+ �/⇢

s

�r·K

µ

rP+P⇠

= r·K

µ

⇥rP

⇤ + �⇢g⇤+�

�⇢

f

s

r·V =P⇠

rP

⇤ = r· ⌘⇣rV + rVT

⌘� ��⇢g

5

Choose your Problems/PDE’s“Multi-Physics Problems”

• Thermal Convection (Advection/Di↵usion

of heat + Equations of motion)

@T

@t

+ v · rT = r2T

@v

@t

+ v · rv = �rP + ⌫r2v + RaT g

r· v = 0

• Magma Dynamics (my personal favorite)

D�

Dt

= (1� �)P⇠

+ �/⇢

s

�r·K

µ

rP+P⇠

= r·K

µ

⇥rP

⇤ + �⇢g⇤+�

�⇢

f

s

r·V =P⇠

rP

⇤ = r· ⌘⇣rV + rVT

⌘� ��⇢g

5

A hybrid FEniCS/PETSc code forInfinite Prandtl Number Thermal Convection

• Thermal Convection (Advection/Di↵usion

of heat + Equations of motion)

@T

@t

+ v · rT = r2T

@v

@t

+ v · rv = �rP + ⌫r2v + RaT g

r· v = 0

• Magma Dynamics (my personal favorite)

D�

Dt

= (1� �)P⇠

+ �/⇢

s

�r·K

µ

rP+P⇠

= r·K

µ

⇥rP

⇤ + �⇢g⇤+�

�⇢

f

s

r·V =P⇠

rP

⇤ = r· ⌘⇣rV + rVT

⌘� ��⇢g

5

Choose your Problems/PDE’s“Multi-Physics Problems”

• Thermal Convection (Advection/Di↵usion

of heat + Equations of motion)

@T

@t

+ v · rT = r2T

@v

@t

+ v · rv = �rP + ⌫r2v + RaT g

r· v = 0

• Magma Dynamics (my personal favorite)

D�

Dt

= (1� �)P⇠

+ �/⇢

s

�r·K

µ

rP+P⇠

= r·K

µ

⇥rP

⇤ + �⇢g⇤+�

�⇢

f

s

r·V =P⇠

rP

⇤ = r· ⌘⇣rV + rVT

⌘� ��⇢g

5

Choose your Problems/PDE’s“Multi-Physics Problems”

Plus IC’s, BC’s and constitutive relationships

Non-linear porosity waves(Scott & Stevenson, 1984 Nature, Spiegelman, JFM, 1993, Simpson et al 2009,2010)

Collision of 2, 2D-porosity waves. Instability of 1D waves to 3D waves

Non-linear porosity waves(Scott & Stevenson, 1984 Nature, Spiegelman, JFM, 1993, Simpson et al 2009,2010)

Computational Seismology

Weak Form

Choose w,u � V s.t.�

��w · uttdV =

��w : ⇥ + M : �w(xs)S(t)

s = 0, st = 0 at t = 0

Note: Free stress Boundary conditions ·n = 0 areautomatically included as natural boundary conditions.

Issue is simply choice of Discrete function space V for testfunctions w and u.

Benchmarked Hybrid FEniCS/PETSc codes (Simpson & Spiegelman, 2010 J. Sci. Comp) using P2-P2 mixed elements with Semi-Lagrangian 2nd-order time stepping.

Collision of 2, 2D-porosity waves. Instability of 1D waves to 3D waves

Choose your Mesh(Spatial/Temporal Discretization)

Uniform cartesian mesh

Staggered mesh(finite Volume methods)

Choose your Mesh(Spatial/Temporal Discretization)

Unstructured Meshes (from FEniCS/Dolfin)

2-D Triangular3-D Tetrahedral

Choose your Mesh(Spatial/Temporal Discretization)

Unstructured Hexahedral Meshes (from Cubit (Sandia)FEniCS/Dolfin)

Choose your Mesh(Spatial/Temporal Discretization)

Semi-Structured

Forest of Oct-tree Mesh (K Burstedde, ICES, UT Austin)

Choose your Mesh(Spatial/Temporal Discretization)

Unstructured Meshes (a toilet)

Choose a functional discretization

• Truncated Taylor series (Finite Difference)

• Linear combination of N basis functions

• local compact basis (FEM, FVEM methods)

• Global basis functions (Spectral methods)

• High order local bases (Spectral Elements)

u

h(x) =NX

i=1

w

i

�i

(x)

6

Transformation from Continuous to Discrete problem

• Introduces Truncation Error!

• Need to analyze both stability and convergence.

• Transforms problem to discrete problems

• Requires efficient solvers for algebraic systems of linear and non-linear equations

Auh = fh, F(uh) = 0

2

Choose your solvers• Whole families of methods for large sparse

systems

• Sparse direct (x=A\b)

• Simple iterative (Jacobi, SOR)

• Advanced Iterative methods:

• Krylov methods (CG, GMRES)

• Multi-grid methods

• Combined Preconditioned methods

• Newton-Krylov for nonlinear problems

• Physics based block-preconditioners (all of the above)

Good software helps making choices (and changing your mind) easier

Choose your Software!

Good software helps making choices (and changing your mind) easier

Choose your Software!

• Basic Programming Languages and tools

• C,C++,Python,Fortran

• Editors, Debuggers, Version Control (hg,svn etc)

Good software helps making choices (and changing your mind) easier

Choose your Software!

• Basic Programming Languages and tools

• C,C++,Python,Fortran

• Editors, Debuggers, Version Control (hg,svn etc)

• Higher level programming languages and computational environments

• Matlab, Mathematica, SciPy,Octave,Sage,R

Good software helps making choices (and changing your mind) easier

Choose your Software!

• Basic Programming Languages and tools

• C,C++,Python,Fortran

• Editors, Debuggers, Version Control (hg,svn etc)

• Higher level programming languages and computational environments

• Matlab, Mathematica, SciPy,Octave,Sage,R

• Advanced computational Libraries!

• Parallel Linear Algebra: PETSc, Trilinos

• Finite Elements: FEniCS, deal.ii, etc

Good software helps making choices (and changing your mind) easier

Choose your Software!

• Basic Programming Languages and tools

• C,C++,Python,Fortran

• Editors, Debuggers, Version Control (hg,svn etc)

• Higher level programming languages and computational environments

• Matlab, Mathematica, SciPy,Octave,Sage,R

• Advanced computational Libraries!

• Parallel Linear Algebra: PETSc, Trilinos

• Finite Elements: FEniCS, deal.ii, etc

• Visualization/Analysis software

• Matlab, SciPy, Paraview, Sage...

Course Objective

• Give Guidance and experience to start making intelligent choices (and enough tools and breadth to change your mind)

Course Logistics• All information on web-site, http://

www.ldeo.columbia.edu/~mspieg/e4301

• Link also in Courseworks

• Principal approach is lectures, problem sets (~6) and projects.

• Projects can be collaborative up to 3/group

• Fill out the User Survey so I can gauge background and interests

VolcanosEarthquakes

A (complicated) exampleUnderstanding the dynamics of Subduction Zones

VolcanosEarthquakes

A (complicated) exampleUnderstanding the dynamics of Subduction Zones

Choices• Problem: Subduction Zones

• why? Earthquakes, Volcanos (cool!)

• PDEs: Magma Dynamics (McKenzie 84, Spiegelman 93, Katz 2007, Simpson 2010)

• Discretization:

• mesh: Unstructured Triangles

• elements: P1-P1 (velocity, Temperature), P2-P2 Porosity Pressure

• Time stepping: Semi-Lagrangian Crank Nicolson

• Solvers: Newton-Krylov with Physics-based block-preconditioned GMRES

• Software: SEPRAN, hybrid FEniCS/PETSc w/ Paraview

An Example Solution

Non-linear porosity waves(Scott & Stevenson, 1984 Nature, Spiegelman, JFM, 1993, Simpson et al 2009,2010)

Collision of 2, 2D-porosity waves. Instability of 1D waves to 3D waves

Non-linear porosity waves(Scott & Stevenson, 1984 Nature, Spiegelman, JFM, 1993, Simpson et al 2009,2010)

Computational Seismology

Weak Form

Choose w,u � V s.t.�

��w · uttdV =

��w : ⇥ + M : �w(xs)S(t)

s = 0, st = 0 at t = 0

Note: Free stress Boundary conditions ·n = 0 areautomatically included as natural boundary conditions.

Issue is simply choice of Discrete function space V for testfunctions w and u.

Benchmarked Hybrid FEniCS/PETSc codes (Simpson & Spiegelman, 2010 J. Sci. Comp) using P2-P2 mixed elements with Semi-Lagrangian 2nd-order time stepping.

Collision of 2, 2D-porosity waves. Instability of 1D waves to 3D waves

Comparison to Data0

200

Depth

, km

5

5

5

10

15

0 1 2 3 4 5 6 7 8 9 10 11 12 130.00 0.04 0.08

0 100 200 300 400

Distance, kmSW NE

0

200

100 100

0 100 200 300 400

Distance, kmSW NE

Vp/Vs1000/Qs

low permeability high permeability

.

Comparison to Data0

200

Depth

, km

5

5

5

10

15

0 1 2 3 4 5 6 7 8 9 10 11 12 130.00 0.04 0.08

0 100 200 300 400

Distance, kmSW NE

0

200

100 100

0 100 200 300 400

Distance, kmSW NE

Vp/Vs1000/Qs

low permeability high permeability

.

132.9 ± 4.1 km(Syracuse & Abers)

The Future? GuMBi

• A prototype Model Building interface

• encapsulates the full set of choices in a single options file

• Built on existing Libraries: FEniCS, PETSc, spud

• Allows complete model building for custom compiled applications through code generation.

• FEM for General, coupled PDE’s on unstructured meshes (from FEniCS)

• Physics based, flexible block-preconditioners ( for non-linear multi-physics problems (built on PETSc SNES)

• Self documenting schema for options files (from spud)

The Future? GuMBi

Course Objectives

• Basic tools and insights to understand and use these and other computational tools

• Some real practical experience in solving a problem of your own.

By the end of this course, you should have:

top related