Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

26/09/2013

High order discotinuous Galerkin


methods for fluid dynamics

Esteban Ferrer, PhD


esteban.ferrer@upm.es
http://sites.google.com/site/eferrerdg/

September 2013

Adjoint-based error estimation and adaptive mesh refinement for the


RANS and k–ω turbulence model equations
Ralf Hartmann, , Joachim Held , Tobias Leicht
A high order Discontinuous Galerkin - Fourier incompressible 3D Navier-
Stokes solver with rotating sliding meshes
E Ferrer and RHJ Willden

A high order Discontinuous Galerkin - Fourier


incompressible 3D Navier-Stokes solver with rotating sliding
meshes for simulating cross-flow turbines
E Ferrer

1
26/09/2013

Summary
1) Introduction
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

Summary
1) Introduction
i. What is high order? Why use high order?
ii. Comparison of numerical methods in 1D
iii. General concepts
iv. Books and key references
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

2
26/09/2013

What is high order?

What is high order?

 High order is generally defined for P≥3


 High order allows h/p refinement
 h-refinement offers constant decay of the error
 p-refinement offers exponential decay of the error

3
26/09/2013

What is high order?

Why high order? Poisson equation

h-ref

p-ref

4
26/09/2013

Why high order? Poisson equation

Why high order? Poisson equation

5
26/09/2013

Why high order? NACA0012 - Re=800 - Laminar flow

2nd order Finite Volume Fluent

k=5 high order DG

Why high order? NACA0012 - Re=800 - Laminar flow

2nd order Finite Volume Fluent

k=5 high order DG

6
26/09/2013

Why high order? Square cylinder flow - Re=100

HIGH ORDER METHOD (Nektar, DG):


Very similar accuracy for continuous and dicsontinuous

LOW ORDER METHOD (Fluent):


requires 3x DOF to achieve similar accuracy

Strouhal number: St = ƒ.Lref/U∞


DOF = Degrees Of Freedom

Comparison of numerical methods in 1D

 Finite differences
 Finite Volume
 Finite Elements
 high order h/p Spectral
 high order DG methods

7
26/09/2013

COMMON FEATURES:
 GRID or MESH needed PDE to analytical system of equations.
 Find an approximation of the exact solution u(x,t)  uh(xi,tn)

 Finite Differences
 Differential form of the equations
 Discretisation of derivatives using Taylor series expansion
 High order needs large stencils of cells

 Finite Volume
 Integral form of the equations at a local element level
 Local conservation
 Gauss’s theorem (div theorem) to obtain flux formulation and impose BC
 Piecewise constant functions inside elements (poly. order 0)
 High order requires large stencils of cells

 Finite Element (Weak formulation)


 Integral form of the equations and Weak formulation
 Integration by parts to obtain weak formulation and impose boundary conditions
 C0 continuity required at boundary interfaces
 Typically piecewise linear functions (poly. order 1)

 Spectral methods or C0 continuous h/p high order (Weak formulation)


 Similar to FEM but uses high order basis functions inside an element
 C0 continuity required at element boundary interfaces
 Shows exponential convergence when the poly. order p is increased

 DG methods (Weak formulation)


 High order Finite Volume, with compact stencil
 or h/p spectral but continuity requirement is relaxed
 Local conservation
 Shows exponential convergence when the poly. order p is increased

Finite Differences

0
du xi xi+1

dx ∆x

uh ( xi  x)  uh ( xi )  (x)  (x) 2 xx i  O(x)3


u x ( xi ) u (x )
Taylor:
1! 2!
Upwinding
(flow to the right)

uh ( xi  x)  uh ( xi ) ui 1  ui
u x ( xi )   O(x)  ux   O(x)
x x

ui 1  ui
 0  ui  ui 1
x

8
26/09/2013

Finite Differences

0
du xi xi+1

dx ∆x

uh ( xi  x)  uh ( xi )  (x)  (x) 2 xx i  O(x)3


u x ( xi ) u (x )
Taylor: (1)
1! 2!
uh ( xi  x)  uh ( xi )  (x)  (x)  O(x)3
u x ( xi ) 2 u xx ( xi ) (2)
1! 2!
Central differences (1-2)

uh ( xi  x)  uh ( xi  x) ui 1  ui 1
u x ( xi )   O(x2 )  ux   O(x2 )
2x 2x

ui 1  ui 1
 0  ui  ??  Unstable!
2x
Only odd or even
coupling

Finite Volume
Xp XE

0
du xw xe

dx ∆x ∆x

 d  0   uh .nds  0  uh xew  0 uh x u h ( XE )  u h ( XP )



duh x

uh x
 
u ( X )  uh ( XW )
dx e
2
 h P
Divergence theorem
w
2
Central differences

 uh ( XE )  uh ( XP ) uh ( XP )  uh ( XW ) 
    0
2 2
 u ( X )  uh ( XW ) 
 h E   uh ( XP )  ??  Unstable!
 2

9
26/09/2013

Finite Volume
Xp XE

0
du xw xe

dx ∆x ∆x

 d  0   uh .nds  0  uh xew  0 uh x  u h ( XP )


uh x
duh x

 uh ( XW )
e

 
dx
w

Divergence theorem Upwinding


(flow to the right)

uh ( XP )  uh ( XW )  0
 uh ( XP )  uh ( XW )

Finite Element Method (1/2)


Φ0 Φ1

0
du
dx Xi Xi+1

∆x

 0   h  ( x)d  0
du du ( x) Multiply by test function
dx  dx and integrate

u h ( x) d  u h ( x) ( x)xii1  0 Integration by parts


 d ( x)
 

 
x

dx

 d ( x)
 

u h ( x) d u h ( xi 1 ) ( xi 1 ) u h ( xi ) ( xi )  0
 
dx

10
26/09/2013

Finite Element Method (2/2)


Φ0 Φ1

Xi Xi+1

∆x

Piecewise linear trial or basis functions Galerkin method

u 
order 1
uh ( x)  u00 ( x)  u11 ( x) 
Test functions = basis functions

order 0
i i
 ( x)  ( 0 ( x), 1 ( x))

   0 (u 0  0 u11 ) d u 0  0  0
 d 
 
u k h ( xi 1 )  u k 1 h ( xi )
dx

   1 (u 0  0 u11 ) d u11  0


 d 
  Requires continuity
 Matrix Assembly
dx

Discontinuous Galerkin (high order)


- + - + + - - +

0
du xi xi+1 xi+2
xi+1

dx Δx Δx

 0   h  el1 ( x)d  0
du du ( x) el1=Ω el2


dx dx
 d el1 ( x)
  

u h ( x) d u h ( xi 1 ) el1 ( xi 1 ) u h ( xi ) el1 ( xi )  0
 
dx

u h ( xi 1 )  uˆi 1 (ui 1 , ui 1 )
 

u h ( xi )  uˆi (ui , ui )
 
Numerical fluxes
High order approx.

u 
 d ( x)
  
 order  p
u h ( x) d  uˆi 1 el1 ( xi 1 )  uˆi ( xi ) el1 ( xi )  0 uh ( x) 
el1

  order 0
i i
dx
test functions = basis functions

11
26/09/2013

Advantages of Discontinuous Galerkin methods

 Easy handling complicated geometries and boundary conditions,


allows non-conformal meshes (hanging nodes)
 like FV but we do not loose accuracy if distorted meshes

 Locally conservative  like FV

 Order of convergence of most shemes is hk+1  like Spectral methods

 h- and/or p-adaptivity  like h/p Spectral

 Compact stencil (communication only with close neighbours)

Advantages of Discontinuous Galerkin methods over C0 methods

Biggest problem with Continuous Galerkin (e.g. Finite elements) is


for convection dominated flows since upwinding is not easy  the
solution is continuous so upwinding is not direct (as in FV or DG)

The solution is to use different basis and test functions (e.g. Petrov-
Galerkin or Streamline Upwind Petrov-Galekin (SUPG))

12
26/09/2013

Further general concepts: expansion basis functions

Modal vs Nodal basis

Further general concepts: expansion basis functions in 1D

Nodal basis: Lagrange

13
26/09/2013

Further general concepts: expansion basis functions in 1D

Modal basis (hierarchical): Nodal basis: Lagrange


Legendre

Further general concepts:


Modal and Nodal expansion basis in 2D

14
26/09/2013

Further general concepts: Modal expansion basis in 2D

Further general concepts: mappings


Computational space Physical space

15
26/09/2013

Further general concepts: mappings

Further general concepts: Numerical integration


(quadrature or cubature)

16
26/09/2013

Further general concepts: Numerical integration


(quadrature or cubature)

If f is O(P2) the cost


for integral is O(P4)

the cost for integral


is now O(P2)

Books high order Continuous Galerkin

17
26/09/2013

Books high order Discontinuous Galerkin

Key references Discontinuous Galerkin

B. Cockburn, G. E. Karniadakis and C.-W. Shu (eds.), Discontinuous


Galerkin methods. Theory, computation and applications, Lecture
Notes in Computational Science and Engineering, 11. Springer-Verlag,
Berlin, 2000.

Z.J. Wang et al, High-Order CFD Methods: Current Status and


Perspective. Int. J. Num. Meth. Fluids., Vol. 72 (8), pp. 811-845, July 2013.

18
26/09/2013

Software
 At UPM, compressible and incompressible DG solvers
 Nektar++, Imperial College
 Deal II, Texas A&M Univ.
 Sledge++, Rice Univ, Tim Warburton
 hpGEM, Twente Univ.
 FreeFEM++

 PETSc (used as solver by many packages)

Summary
1) Introduction
2) Finite elements and variational formulations
i. Norms
ii. Bilinear and linear forms
iii. Definitions and nomenclature
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

19
26/09/2013

Variatonal formulation and method of weighted


residuals

u is the continuous solution

uh is the discrete solution

- Inner product defines a projection into


the space defined by test functions v
- Residual is weighted and minimised

20
26/09/2013

Spaces and Norms

1) A Hilbert space is an abstract vector space possessing the structure of an


inner product that allows length and angle to be measured.

2) Sobolev spaces, denoted by Wm,p, are Hilbert spaces. These are a special
kind of function space in which differentiation may be performed, and
support the structure of an inner product. Because differentiation is
permitted, Sobolev spaces are a convenient setting for the theory of partial
differential equations.

Spaces and Norms


Inner product and norm definition:

1) Linearity 1

2) Linearity 2

3) Symmetry
4) and equal if and only if Non negativity

p=2

21
26/09/2013

Spaces and Norms


Inner product and norm definition:

Finite elements and variational formulations

22
26/09/2013

Finite elements and variational formulations

Finite elements and variational formulations

Consistency

23
26/09/2013

Finite elements and variational formulations

Coercivity

Continuous

Finite elements and variational formulations

24
26/09/2013

Finite elements and variational formulations

A priori error estimates

Finite elements and variational formulations

25
26/09/2013

Summary
1) Introduction
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

DG for hyperbolic problems

26
26/09/2013

DG for hyperbolic problems

DG for hyperbolic problems

One element K

is a subspace

Replace u by uh  numerical flux n


Sum over all element K in the mesh
Numerical Flux
K

27
26/09/2013

DG for hyperbolic problems


n

Numerical Flux

DG for hyperbolic problems

Numerical Flux

28
26/09/2013

DG for hyperbolic problems

DG for hyperbolic problems

What if we select a polynomial order p=0 (piecewise constant functions)

=0 = cte

DG with p=0 corresponds to a first order finite volume method

Note: integration by parts with a constant function is divergence theorem

29
26/09/2013

DG for hyperbolic problems: Summary and Matrix system

Summary
1) Introduction
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

30
26/09/2013

DG for elliptic and parabolic problems? History

The key references

DG for elliptic and parabolic problems? DG-IP for elliptic equations


- The original approach

E2
nE2 nE1
E1

Jump

31
26/09/2013

DG for elliptic and parabolic problems? DG-IP for elliptic equations


- The original approach E2
nE2 nE1
E1

Consistent
scheme

Jump Average

DG for elliptic and parabolic problems? DG-IP for elliptic equations


- The original approach

Penalty parameterJ0
needed for coercivity

32
26/09/2013

DG for elliptic and parabolic problems? DG-IP for elliptic equations


- The original approach: Boundary conditions for SIPG (ε=-1)

DG for elliptic and parabolic problems? DG-IP for Poisson equation

Effect of penalty parameter on


the numerical solution continuity

Weak imposition of boundary


conditions

33
26/09/2013

DG for elliptic and parabolic problems? DG-IP for elliptic equations


- The original approach

DG for elliptic and parabolic problems? DG for elliptic equations


- The Unified approach (IP, LDG, BR)

Second order to system of first order


Mulitply by test function and integrate by parts

Discretisation

Sum over all elements in the mesh

34
26/09/2013

DG for elliptic and parabolic problems? DG for elliptic equations


- The Unified approach (IP, LDG, BR)

Jump and average definition

Crucial equality (as seen before)

DG for elliptic and parabolic problems? DG for elliptic equations


- The Unified approach (IP, LDG, BR)

(1)

(2)

To obtain the primal formulation: we perform Integration by parts again

Substitute in the above

Substract: (1)-(2)

This is the primal formulation

35
26/09/2013

DG for elliptic and parabolic problems? DG for elliptic equations


- The Unified approach (IP, LDG, BR)

Summary
1) Introduction
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics

36
26/09/2013

Compressible Navier-Stokes

DG for compressible very mature if eq in conservative form

- Explicit or implicit time marching schemes


(explicit or implicit RK are very popular)

- Convective fluxes (plenty of choice from FV)

- Viscous fluxes (e.g. IP, BR2)

- Resulting system solved using GMRES (e.g. petsc)

Compressible Navier-Stokes

37
26/09/2013

Incompressible Navier-Stokes

Stokes system

Not mature enough, No clear method, but variety


- Inf-sup condition: saddle point system
- Projection type methods, stabilised or Pk-Pk-1 spaces

Incompressible Navier-Stokes

Steady Stokes system

System solvability depends on the


inversion of the Schur complement of Sh

38
26/09/2013

Incompressible Navier-Stokes: variety of methods

Summary
1) Introduction
2) Finite elements and variational formulations
3) DG for hyperbolic equations
4) DG for elliptic equations
5) Compressible and Incompressible flows
6) Advanced topics
i. Curved boundaries
ii. h/p Adaption
iii. Multigrid and Preconditioning
iv. Moving meshes

39
26/09/2013

Curved boundaries

Curved boundaries
- Isoparametric, the classic approach
 curved boundary is approximated with polynomial of
same degree as solution in the interior of the element
- Analytical (e.g. Ferrer and Willden 2012)
 use analytical expression to approximate polynomial
- NURBS or splines based approach
 Isogeometric analysis by Hughes et al. 2005
 NEFEM Sevilla et al. 2008)

Dr Rubén Sevilla

40
26/09/2013

Curved boundaries
Main problem is producing high order meshes,
few meshers allow high order:
- mainly academics:
* Octree mesher at UPM (now 2D)
* J. Peiro, (Imperial College), P. Olof-Persson (MIT and
Berckley), T. Warburton (Rice Univ.)
- Commercial codes:
* Gmsh (?), IcemCFD (?)

h/p adaption
- h and p refinement available in DG methods
- hanging nodes are not a problem
- p-refinement for smooth solution (smooth zones)
- h-refinement near discontinuities
- refinement zones located using a-posteriori error estimates,
adjoints, etc.
- solution smoothness can be “guessed”: e.g. decay of
modal coefficients for modal hierarchical basis

- Refs on h/p refinement


• R. Hartmann et al. Adjoint-based error estimation and adaptive mesh refinement for the RANS and
k-ω turbulence model equations, J. Comput. Phys., 230(11): 4268-4284, 2011
• T. A. Oliver, A High-Order, Adaptive, Discontinuous Galerkin Finite Element Method for the
Reynolds-Averaged Navier-Stokes, PhD Thesis, 2008
• N. Kroll, ADIGMA: A European Project on the Development of Adaptive Higher Order Variational
Methods for Aerospace Applications, AIAA, 2009
• IDIHOM project, N. Kroll from DLR

41
26/09/2013

Multigrid
- can be geometric (FAS) or algebraic (AMG)
- In addition to h-multigird, p-multigrid is available in DG methods
- p-multigrid is well suited to modal hierarchical basis functions
- Find right smoothers?

- Refs on multigird:
* Hong Luo, Joseph D. Baum, Rainald Löhner, A p-multigrid discontinuous Galerkin method for
the Euler equations on unstructured grids, JCP Volume 211, Issue 2, 2006
* F. Bassi, A. Ghidoni, S Rebay, High-order accurate p-multigrid discontinuous Galerkin
solution of the Euler equations, International Journal for Numerical Methods in Fluids
Volume 60, Issue 8, pages 847–865, 20 July 2009

Preconditioning
- DG matrices are block diagonal dominant
- Communication is limited to neighbours
(block bandwidth is not large)

Left preconditioning

where P is easily invertible and P-1A has good condition number so it is


suitable for iterative methods
Examples are block Jacobi, ILU

- Refs on preconditioning:
* Compressible PO Persson - 2008, R Hartmann - 2009
* Incompressible G Kanschat - 2002, PF Antonietti 2013

42
26/09/2013

High order moving meshes

SUMMARY
- High order DG is very popular these days:
combines advantages of high order methods (i.e. exponential convergence)
with flexibility of Finite Volume (e.g. hanging nodes)
- Mature, particularly for 3D viscous compressible NS:
* turbulence RANS, ILES
* h/p adaption
- Bottlenecks:
* Requires more efficient solvers (e.g. preconditioners,
multigrid) to become competitive
* High order mesh generators
- Various projects focussing on high order and DG:
e.g. Adigma, Idihom, Anade
- Industry is getting interested, e.g. Numeca, Dassault
Z.J. Wang et al, High-Order CFD Methods: Current Status and Perspective, Int. J. Num.
Meth. Fluids., Vol. 72 (8), pp. 811-845, July 2013. Summary of Workshop on high order

43
26/09/2013

Acknowledgments

Upcoming Events

iw.anade-itn.eu
 20-25 July 2014, ECCOMAS 2014: CFD for wind and tidal offshore turbines
 20-25 July 2014, ECCOMAS 2014: Numerical predictions of detached flows

Thank you very much


Any questions?

esteban.ferrer@upm.es

44

You might also like