     • date post

17-Jul-2020
• Category

## Documents

• view

5

1

Embed Size (px)

### Transcript of Solving Partial Differential Equations ... Microsoft PowerPoint - Author Miklos Bergou

• Solving Partial Differential Equations Numerically

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

• Overview

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

• Partial Differential Equations

Equation involving functions and their partial derivatives Example: Wave Equation

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

2

2

22

2

2

2

2

2 1 tvzyx ∂

∂ =

∂ ∂

+ ∂ ∂

+ ∂ ∂ ψψψψ

• Problem Domain

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

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

Γ

• Navier-Stokes Equation

Model of incompressible fluid flow Governed by equation:

u: fluid velocity P: pressure

ρ: mass density ν: dynamic viscosity

a: acceleration due to external force

( )

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

T](0,in

0

2

==

×Γ= ×Ω=⋅∇

×Ω+ ∇

−=∇−∇⋅+ ∂ ∂

t

P t

uxu u u

auuuu ρ

ν

• Simplifying Navier-Stokes: Just Stokes

Neglect convection:

( )

Γ= Ω=⋅∇

Ω+ ∇

−=∇−∇⋅

on 0 in 0

in 2

u u

auuu ρ

ν P

Γ= Ω=⋅∇

Ω+ ∇

−=∇−

on 0 in 0

in 2

u u

au ρ

ν P

• Solving Stokes Equation

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

Γ= Ω=⋅∇ Ω=∇−

on 0 in 0 in 2

u u

fuν

V∈v

xfvxuv ∫∫ ΩΩ

⋅=∇⋅− dd2ν

• Solving Stokes Equation 2

Apply Green’s Theorem and boundary conditions to obtain:

For notational convenience, this is written as:

xvfxvu ∫∫ ΩΩ

⋅=∇⋅∇ ddν

),(, vfvu =

• Discretize the domain Create 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

i iihhh V

1

xxvxv ϕη

• 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

i i ,...,1 ,,

1 ==∑

=

ϕϕϕη f

• 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

T M

jiij

ϕϕ

ηη

ϕϕ

,,...,,

,...,

,

1

1

ffb

η

A

bAη

=

=

=

=

• 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

i iii

y

n

i ii

yxfwdxdyyxf

xfwdxxf

1

1

0

1

0

1

1

0

,),(

)()(

• Full Navier-Stokes Equation

Requires four types of integrals

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

F : K2 Bezier

∫∫∫∫ ΩΩΩΩ ∂

∂ ⋅

∂ ∂

∂ ∂ ⋅∇⋅∇⋅

βαα gfgfgfgf

• 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

1i ii bcF

⎥ ⎥ ⎥

⎢ ⎢ ⎢

∂ ∂

∂ ∂

∂ ∂

∂ ∂

=

y F

x F

y F

x F

J yy

xx

• Integrals on K2

∫∫∫∫ ΩΩΩΩ ∂

∂ ⋅

∂ ∂

∂ ∂ ⋅∇⋅∇⋅

βαα gfgfgfgf

∫∫∫∫ ⋅⎟⎟ ⎠

⎞ ⎜⎜ ⎝

⎛ ⋅

∂ ∂

⋅⎟ ⎠ ⎞

⎜ ⎝ ⎛ ⋅ ∂ ∂

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

2222

det det det det 111 KKK

TT

K

JJJJJJJJJ βαα β ψ

α ψ

α ψφψφψφ

• Need for speed

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

• Speedup: Cacheing

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

• 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 points Precompute integrals, compute coefficients only

i i K

i K

bnJgf ∑ ∫∫∫ =Ω

⋅⋅=⋅=⋅ 6

1 22

det ψφψφ

• Reusing old values

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

• Example movie

• Questions?