discontinuous galerkin methods and fenicseoghan/grouppresentations/roisin... · 2017. 10. 27. ·...

20
Discontinuous Galerkin Methods and FEniCS ois´ ın Hill October 27, 2017 Supervisor: Dr Niall Madden R´ois´ ın Hill dG & FEniCS 1/14

Upload: others

Post on 16-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Discontinuous Galerkin Methods and

FEniCS

Roisın Hill

October 27, 2017

Supervisor: Dr Niall Madden

Roisın Hill dG & FEniCS 1/14

Page 2: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

PhD project

Balanced discontinuous Galerkin methods for fluid flowproblems: design, implementation and application.

The project has three distinct phases

Phase 1: Design a new set of FEMs for solvingconvection diffusion problems.

Phase 2: Produce a working implementation of these inFEniCS.

Phase 3: Apply these method to a physical river flowproblem using data assimilation.

Roisın Hill dG & FEniCS 2/14

Page 3: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

PhD project

Balanced discontinuous Galerkin methods for fluid flowproblems: design, implementation and application.

The project has three distinct phases

Phase 1: Design a new set of FEMs for solvingconvection diffusion problems.

Phase 2: Produce a working implementation of these inFEniCS.

Phase 3: Apply these method to a physical river flowproblem using data assimilation.

Roisın Hill dG & FEniCS 2/14

Page 4: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

PhD project

Balanced discontinuous Galerkin methods for fluid flowproblems: design, implementation and application.

The project has three distinct phases

Phase 1: Design a new set of FEMs for solvingconvection diffusion problems.

Phase 2: Produce a working implementation of these inFEniCS.

Phase 3: Apply these method to a physical river flowproblem using data assimilation.

Roisın Hill dG & FEniCS 2/14

Page 5: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

PhD project

Balanced discontinuous Galerkin methods for fluid flowproblems: design, implementation and application.

The project has three distinct phases

Phase 1: Design a new set of FEMs for solvingconvection diffusion problems.

Phase 2: Produce a working implementation of these inFEniCS.

Phase 3: Apply these method to a physical river flowproblem using data assimilation.

Roisın Hill dG & FEniCS 2/14

Page 6: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Starting point - FYP

Become familiar with discontinuous Galerkin methods andtheir implimentation in FEniCS

Read Chapter 1 of Beatrice Riviere’s book ”DiscontinuousGalerkin Methods for Solving Elliptic and ParabolicEquations: Theory and Implementation” [2] in order to:

gain an understanding of discontinuous Galerkin (dG)methodssolve her one-dimensional Poisson’s equation example inFEniCS and reproduce her results

Extend these methods to a selection of ordinary andpartial differential equations, including linear andnon-linear and time-dependent convection-diffusionequations.

Roisın Hill dG & FEniCS 3/14

Page 7: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Starting point - FYP

Become familiar with discontinuous Galerkin methods andtheir implimentation in FEniCS

Read Chapter 1 of Beatrice Riviere’s book ”DiscontinuousGalerkin Methods for Solving Elliptic and ParabolicEquations: Theory and Implementation” [2] in order to:

gain an understanding of discontinuous Galerkin (dG)methodssolve her one-dimensional Poisson’s equation example inFEniCS and reproduce her results

Extend these methods to a selection of ordinary andpartial differential equations, including linear andnon-linear and time-dependent convection-diffusionequations.

Roisın Hill dG & FEniCS 3/14

Page 8: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Finite Element Methods

Finite element methods have been used since the 1950s.

Galerkin methods are the most widely used (continuousGalerkin (cG)).

discontinuous Galerkin (dG) methods are where my focuslies.

Roisın Hill dG & FEniCS 4/14

Page 9: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Comparison of cG and dG methods

cG solution dG solution (before jumps penalised)

One-dimensional jumps and averages in v are respectively

defined as

[v(xn)] = v(x−n )− v(x+n ),

and

{v(xn)} = 12

(v(x−n ) + v(x+

n )

).

Roisın Hill dG & FEniCS 5/14

Page 10: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Brief description of FEniCS

I used FEniCS [1] to implement the methods. FEniCS is aPython based collection of free software for solving partialdifferential equations. It provides access to low-level features,but automates other tasks.

Roisın Hill dG & FEniCS 6/14

Page 11: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Riviere’s Poisson’s example

−u′′(x) = f (x) on (0, 1),

f (x) = exp(−x2)(4x3 − 4x2 − 6x + 2),

u(0) = 1, u(1) = 0,

u(x) = (1− x) exp(−x2).

(1)

The weak form of (1) is:

−N−1∑n=0

∫ xn+1

xn

u′′vdx =

∫ 1

0

fvdx .

and integrating the left hand side by parts we get:

−N−1∑n=0

u′v∣∣∣xn+1

xn+

N−1∑n=0

∫ xn+1

xn

u′v ′dx =

∫ 1

0

fvdx .

Roisın Hill dG & FEniCS 7/14

Page 12: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Poisson’s equation weak formN−1∑n=0

∫xn+1

xnu′v ′dx −

N∑n=0

{u′(xn)}[v(xn)] +γN∑

n=0

{v ′(xn)}[u(xn)]

+N∑

n=0

σ0

h[u(xn)][v(xn)] =

∫1

0fvdx

+γv ′(xN)u(xN)− γv ′(x0)u(x0) − σ0

hN[u(xN)][v(xN)]

+σ0

h0[u(x0)][v(x0)].

43 a = dot ( grad ( u ) , grad ( v ) ) ∗dx \44 − dot ( avg ( grad ( u ) ) , jump ( v , n ) ) ∗dS \45 + gamma∗ dot ( jump ( u , n ) , avg ( grad ( v ) ) ) ∗dS \46 + sigma / h avg ∗ dot ( jump ( u , n ) , jump ( v , n ) ) ∗dS \47 − dot ( grad ( u ) , v∗n ) ∗ds \48 + gamma∗ dot ( u∗n , grad ( v ) ) ∗ds \49 + ( sigma /h ) ∗u∗v∗ds

50 L = f ∗v∗dx \51 + gamma∗g∗ dot ( grad ( v ) , n ) ∗ds \52 + ( sigma /h ) ∗v∗g∗ds

Roisın Hill dG & FEniCS 8/14

Page 13: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Poisson’s equation weak formN−1∑n=0

∫xn+1

xnu′v ′dx −

N∑n=0

{u′(xn)}[v(xn)] +γN∑

n=0

{v ′(xn)}[u(xn)]

+N∑

n=0

σ0

h[u(xn)][v(xn)] =

∫1

0fvdx

+γv ′(xN)u(xN)− γv ′(x0)u(x0) − σ0

hN[u(xN)][v(xN)]

+σ0

h0[u(x0)][v(x0)].

43 a = dot ( grad ( u ) , grad ( v ) ) ∗dx \44 − dot ( avg ( grad ( u ) ) , jump ( v , n ) ) ∗dS \45 + gamma∗ dot ( jump ( u , n ) , avg ( grad ( v ) ) ) ∗dS \46 + sigma / h avg ∗ dot ( jump ( u , n ) , jump ( v , n ) ) ∗dS \47 − dot ( grad ( u ) , v∗n ) ∗ds \48 + gamma∗ dot ( u∗n , grad ( v ) ) ∗ds \49 + ( sigma /h ) ∗u∗v∗ds

50 L = f ∗v∗dx \51 + gamma∗g∗ dot ( grad ( v ) , n ) ∗ds \52 + ( sigma /h ) ∗v∗g∗ds

Roisın Hill dG & FEniCS 8/14

Page 14: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Poisson’s equation weak formN−1∑n=0

∫xn+1

xnu′v ′dx −

N∑n=0

{u′(xn)}[v(xn)] +γN∑

n=0

{v ′(xn)}[u(xn)]

+N∑

n=0

σ0

h[u(xn)][v(xn)] =

∫1

0fvdx

+γv ′(xN)u(xN)− γv ′(x0)u(x0) − σ0

hN[u(xN)][v(xN)]

+σ0

h0[u(x0)][v(x0)].

43 a = dot ( grad ( u ) , grad ( v ) ) ∗dx \44 − dot ( avg ( grad ( u ) ) , jump ( v , n ) ) ∗dS \45 + gamma∗ dot ( jump ( u , n ) , avg ( grad ( v ) ) ) ∗dS \46 + sigma / h avg ∗ dot ( jump ( u , n ) , jump ( v , n ) ) ∗dS \47 − dot ( grad ( u ) , v∗n ) ∗ds \48 + gamma∗ dot ( u∗n , grad ( v ) ) ∗ds \49 + ( sigma /h ) ∗u∗v∗ds

50 L = f ∗v∗dx \51 + gamma∗g∗ dot ( grad ( v ) , n ) ∗ds \52 + ( sigma /h ) ∗v∗g∗ds

Roisın Hill dG & FEniCS 8/14

Page 15: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Other equations solved

I extended the methods to one-dimensional andtwo-dimensional convection-diffusion equations includingthe following components:

linear,time-dependent andnon-linear.

and then to a range of two-dimensional vector basedconvection-diffusion equations.

All problems were solved using a uniform mesh.

Roisın Hill dG & FEniCS 9/14

Page 16: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Solution to a convection-diffusion equation showing oscillations

Solution to δuδt − 0.01∆u + (1 + x , 1 + y)u = exp(−x2), on

(0, 0)(1, 1), u = u(x , y , t), x(0) = x(1) = y(0) = y(1) = 0, and N=32

Roisın Hill dG & FEniCS 10/14

Page 17: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Solution to a convection-diffusion equation with a finer mesh

Solution to δuδt − 0.01∆u + (1 + x , 1 + y)u = exp(−x2), on

(0, 0)(1, 1), u = u(x , y , t), x(0) = x(1) = y(0) = y(1) = 0 with N=128

Roisın Hill dG & FEniCS 11/14

Page 18: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Solution to a vector based non-linear convection diffusion equation

Solution to δ~uδt − 0.01∆~u + (~u · ∇)~u = (exp(−x), exp(−y)), on

(0, 0)(1, 1), ~u = ~u(x , y , t), x(0) = x(1) = y(0) = y(1) = 0 with N=16

Roisın Hill dG & FEniCS 12/14

Page 19: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Outcomes and Current work

Outcomes

I now have an excellent understanding of thefundamentals of discontinuous Galerkin methods.

I am competent in using the FEniCS software system tosolve partial differential equations.

Current work

Reviewing existing literature in the area.

Investigating different methods of measuring errors.

Roisın Hill dG & FEniCS 13/14

Page 20: Discontinuous Galerkin Methods and FEniCSeoghan/GroupPresentations/Roisin... · 2017. 10. 27. · their implimentation in FEniCS Read Chapter 1 of B eatrice Rivi ere’s book "Discontinuous

Bibliography

Anders Logg, Kent-Andre Mardal, Garth N. Wells, et al.Automated solution of differential equations by the finiteelement method.Springer, 2012.

Beatrice Riviere.Discontinuous Galerkin methods for solving elliptic andparabolic equations, volume 35 of Frontiers in AppliedMathematics.Society for Industrial and Applied Mathematics (SIAM),Philadelphia, PA, 2008.Theory and implementation.

Roisın Hill dG & FEniCS 14/14