Download - Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Transcript
Page 1: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Solving Partial Differential Equations Numerically

Miklós Bergouwith: Gary Miller, David Cardoze, Todd Phillips, Mark Olah

Page 2: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Overview

What are partial differential equations?How do we solve them? (Example)Numerical integrationDoing this quickly

Page 3: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Partial Differential Equations

Equation involving functions and their partial derivativesExample: Wave Equation

We wish to know ψ, which is function of many variablesTypically, no analytical solution possible

2

2

22

2

2

2

2

2 1tvzyx ∂

∂=

∂∂

+∂∂

+∂∂ ψψψψ

Page 4: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Problem Domain

Want to solve problem for specific domainΩ: bounded open domain in space Rn

Γ: boundary of ΩIf domain 2-D, we have following:

Ω

Γ

Page 5: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Navier-Stokes Equation

Model of incompressible fluid flowGoverned by equation:

u: fluid velocityP: pressure

ρ: mass densityν: dynamic viscosity

a: acceleration due to external force

( )

( ) 0at T](0,on 0T](0,in 0

T](0,in

0

2

==

×Γ=×Ω=⋅∇

×Ω+∇

−=∇−∇⋅+∂∂

t

Pt

uxuuu

auuuuρ

ν

Page 6: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Simplifying Navier-Stokes: Just Stokes

Assume steady flow:

Neglect convection:

( )

Γ=Ω=⋅∇

Ω+∇

−=∇−∇⋅

on 0in 0

in 2

uu

auuuρ

ν P

Γ=Ω=⋅∇

Ω+∇

−=∇−

on 0in 0

in 2

uu

auρ

ν P

Page 7: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Solving Stokes Equation

Space of possible functions V that could be solutions to velocity uChoose any , multiply both sides of Stokes Equation and integrate, resulting in:

Γ=Ω=⋅∇Ω=∇−

on 0in 0in 2

uu

fuν

V∈v

xfvxuv ∫∫ΩΩ

⋅=∇⋅− dd2ν

Page 8: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Solving Stokes Equation 2

Apply Green’s Theorem and boundary conditions to obtain:

For notational convenience, this is written as:

xvfxvu ∫∫ΩΩ

⋅=∇⋅∇ ddν

),(, vfvu =

Page 9: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Discretize the domainCreate mesh by partitioning domain into finite elements (curved Bezier triangles)Create subspace Vh of V of piecewise polynomial functions with basis function defined at each node

( ) functions basis ofset =xϕ

( ) ( ) ( )∑=

=⇒∈M

iiihhh V

1

xxvxv ϕη

Page 10: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Linear Equations

Since , so we can say that in order for uh to be a solution to Stokes equation, we need

In particular, must be true for basis functions, so writing uh in terms of basis functions, we have:

VVh ⊂ Vh ∈u

( ) hh V∈∀= vvfvu ,,

( ) Mjjji

M

ii ,...,1 ,,

1==∑

=

ϕϕϕη f

Page 11: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Solution to Problem

Knowing coefficients ηi means we know solution uh

This is a system of M linear equations with M unknowns, can be solved with various numerical methods

[ ]( ) ( )[ ]TM

TM

jiij

ϕϕ

ηη

ϕϕ

,,...,,

,...,

,

1

1

ffb

η

A

bAη

=

=

=

=

Page 12: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Integration

Computing stiffness matrix and load vector requires lots of integrals –

, These are done numerically via quadratures:

Choose Gauss points and weights to give high order accuracy

ji ϕϕ , ( )iϕ,f

( )∑∫ ∫

∑∫

=

=

=

=

n

iiii

y

n

iii

yxfwdxdyyxf

xfwdxxf

1

1

0

1

0

1

1

0

,),(

)()(

Page 13: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Full Navier-Stokes Equation

Requires four types of integrals

f and g are basis functions on curved trianglesMap from K2 simplex to curved triangles:

F : K2 Bezier

∫∫∫∫ΩΩΩΩ ∂

∂⋅

∂∂

∂∂⋅∇⋅∇⋅

βααgfgfgfgf

Page 14: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Mapping K2 to Bezier

Mapping requires 6 control points, defined by

bi’s are Bezier basis function (polynomials)Jacobian is defined in standard way

∑=

=6

1iii bcF

⎥⎥⎥

⎢⎢⎢

∂∂

∂∂

∂∂

∂∂

=

yF

xF

yF

xF

Jyy

xx

Page 15: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Integrals on K2

∫∫∫∫ΩΩΩΩ ∂

∂⋅

∂∂

∂∂⋅∇⋅∇⋅

βααgfgfgfgf

∫∫∫∫ ⋅⎟⎟⎠

⎞⎜⎜⎝

⎛⋅

∂∂

⋅⎟⎠⎞

⎜⎝⎛ ⋅∂∂

⋅⋅∂∂⋅⋅∇⋅∇⋅⋅ −−−−−

2222

det det det det 111

KKK

TT

K

JJJJJJJJJ βαα βψ

αψ

αψφψφψφ

Page 16: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Need for speed

Each type of integral is done on each triangle, for each combination of basis functionsAfter each time step, mesh moves (Lagrangian), so integrals need to be done for each timestepSpeed and accuracy are required

Page 17: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Speedup: Cacheing

Cache K2 basis functions, so only Jacobian needs to be evaluated for each elementBasis functions cached at Gauss points, so functions are essentially just arrays of valuesCache Jacobian for each element as well, since it is reused in every integralLarge speedup versus recomputation each time

Page 18: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Idea: Expand integrals

Jacobian determinant can be written in terms of Bezier basis functions with coefficients given by control points

Integrals in this sum no longer depend on control pointsPrecompute integrals, compute coefficients only

ii K

iK

bnJgf ∑ ∫∫∫=Ω

⋅⋅=⋅=⋅6

122

det ψφψφ

Page 19: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Reusing old values

After each time step, large portions of mesh unchangedIf Jacobian of element is “close enough” to old value, reuse old integralsSpeedup depends on measure of “close enough” and how much mesh changes

Page 20: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Example movie

Page 21: Solving Partial Differential Equations Numerically...Microsoft PowerPoint - Presentation2.ppt Author Miklos Bergou Created Date 7/31/2004 2:23:29 PM ...

Questions?