57
Towards Discontinuous Galerkin Solution of the 3D RANS Equations Eric Liu Advisor: Professor David Darmofal Massachusetts Institute of Technology Department of Aeronautics and Astronautics Aerospace Computational Design Laboratory

Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Towards Discontinuous Galerkin Solution ofthe 3D RANS Equations

Eric LiuAdvisor: Professor David Darmofal

Massachusetts Institute of TechnologyDepartment of Aeronautics and AstronauticsAerospace Computational Design Laboratory

Page 2: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Outline

1 IntroductionMotivationApproach

2 The SA model

3 DG Discretization

4 Results

Page 3: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

The Problem

Engineers interested in solving the Navier Stokes equations forcomplex aerodynamic geometriesWell-known that for most problems of interest, turbulence arises

Multiscale problem with lengths ranging from 70m (e.g. 747) to0.1mm (smallest eddies)

Figure:Mach Number

Figure:Eddy Viscosity

Page 4: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Challenges of Turbulence

Kolmogorov Scales ( 1941)Kolmogorov describes the transfer of energy from large to smalleddies (bulk-coherent region of turbulent motion)

At high Re, small scale eddies are statistically isotropicSuch small eddies (sizeη) are similar and governed by the energydissipationǫ = O(1) and the kinematic viscosityν

Eddies have sizel and characteristic velocityul; largest eddieshavel0 = L, the flow length scale

Dimensional analysis:ǫ = O(u3

0l0), η = O((ν3

ǫ)1/4)

length ratio: l0η

= O(Re3/4)

time ratio: l0/u0

τ= O(Re1/2)

Page 5: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Making Turbulence Manageable

A Multiscale ProblemAircraft (typicalRe> 107) in 3D: more than1015 elements tosimulate all turbulent scales!

Worse, more than104 time steps are required.

RANSReformulate the problem by time-averaging and solving for themean flow: Reynolds-Averaged Navier Stokes (RANS) Equations

Make modeling assumptions about the remaining turbulentcomponents to simplify the governing equations

We want to investigate...Whether a higher-order DG implementation of the RANS-SAequations is an efficient and accurate way of obtainingengineering accuracy on aerodynamic problems

Page 6: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Current State of the Art

AIAA Drag Prediction Workshop IIICases designed to exemplify common industry CFD useagepatterns (e.g. turbulent flow:Rearound5× 106)

Wing/Body/Nacelle geometries with as many as 25 million nodes

Goal: Assess the current state-of-the-art CFD capabilities

Sample DPWIII surface mesh Flow solution

Page 7: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

AIAA Drag Prediction Workshop Results

Mavriplis studieddrag convergenceon two differentinitial meshes

1 count(= 0.0001CD) ≈loss of 4-8passengers on a747-800

Meshes highly refined; typical industry meshes ofN = 1 to 4million elements

Observed large differences even after several refinements

Solutions are highly grid dependent; large numbers of refinementsmay not be sufficient for consistent results

Page 8: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Approach

DPW: Same code can give inconsistent results, indicating that currentbest practices are insufficient.

DG for RANSWe aim to provide an automated, accurate, and robustCFD-framework for solving the RANS equations

Higher-order solutions with the DG methodOutput-based mesh adaptation via the adjoint problemDirect interface to CAD models

Believe the above will be effective in approaching the issuesraised by the DPWsSolution of the RANS equations brings up many challenges:

Very stiff source termsNon-canonical source terms not seen in standard problems, e.g.convection-reaction-diffusionLack of solution regularity due to turbulence model

Page 9: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Previous Work

Past Work: DG Discretizations of the RANS EquationsFew publications to date on this subject (even for 2D)

Bassi et al (1997, 2005, 2009):k− ω model, 3D recently

Nguyen et al (2007): SA model, artificial viscosity to regularizeeddy viscosity

Landmann (2007): several models, hard-limiting to improverobustness

Oliver (2008): SA model, unsteady adaptation anddual-consistent source

Oliver (2009): SA model, convergence-rate issues caused bymodel irregularity

Page 10: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Advantages of Higher-Order

1 2 410

−8

10−7

10−6

10−5

10−4

log2(h/h

0)

Err

or in

cd

−1.03

−2.06

−3.31

−4.54

p1

p2

p3

p4

Figure:Grid convergencestudy on a flat platein 2D

ObservedO(hp)drag convergencerate

Nguyen et al (2007)Experimentally observed that increasingp results in less errorthan decreasingh, maintaining equal numbers of unknowns

The higherp case also required significantly less CPU time

Page 11: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Convergence Rate Issues Caused by Irregularity

NACA 0012 at:M∞ = 0.25,Rec = 1× 107, α = 0.

Figure: Drag error vsh for p = 1

(), p = 2 (), p = 3 (∗), p = 4 (⊳),

andp = 5 (×). Error measured

againstp = 5 solution on the finest

mesh.

Oliver (2009)Superconvergence achieved forp = 1 andp = 2 but not forhigherp.

Suboptimal rates due to a non-smooth solution and insufficientmesh resolution at the BL edge.

Page 12: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Convergence Rate Issues Caused by Irregularity

NACA 0012 at:M∞ = 0.25,Rec = 1× 107, α = 0.

Figure: Drag error vsNDOF;

shows severalp-orders for different

meshes. Error measured against

p = 5 solution on the finest mesh.

Oliver (2009)p-refinement shows that exponential converengence: the ratestagnates

Despite stagnation, higherp solutions sometimes reach lowererror with fewer DOFs. (NDOF = O(1/h2))

Page 13: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Spalart Allmaras One-Variable Turbulence Model

SA OverviewOne-equation model forν, providing closure for eddy viscosity

Popular in the aerospace community, especially for external flows

IssuesRequires distance to the nearest solid wall.

Potentially unstable whenν < 0.

Numerical difficulties from very stiff, nonlinear source termsν varies rapidly near the BL edge (discontinuous first derivative inthe 0 viscosity limit).

Needs additional mesh resolution at the BL edge as a result.

Using a modified SA model to mitigate issues whenν < 0

Page 14: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Wall-Distance Calculation

Popular ChoicesSolve for distance exactly using a modified level-set equationover the entire flow-field.

Intelligent-search for the distance at points of interest.

ApproachUse kd-tree filled with surface quadrature points to performanearest-neighbor search from quadrature points in the flow field.

Assumes wall-curvature is small relative to quad-point spacing.

Result initializes a Newton search to minimize wall-distancebased on a polynomial representation of the geometry.

Page 15: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

kd-Trees

kd-treeskd-trees are essentiallyk-dimensional binary trees.

Each node represents a k-dimensional point in spaceNon-leaves also host splitting hyperplanes; points on the left/rightbecome left/right children

Expected asymptotic performance:O(log(N)) to find a nearest-neighbor in a tree ofN points.O(N) storage andO(N log(N)) construction time

Page 16: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

DG Discretization

DiscretizationFor some triangulation (Th) of the domain (Ω), apply a polynomialbasis (Vp) locally over each element to the governing equations inweak form.

κ∈Th

κ

vTh

∂uh

∂t+ Rh,Inv(uh, vh) + Rh,Vis(uh, vh) + Rh,Src(uh, vh) = 0

where test functionsvh and solutionuh are represented in the discretebasisVp

h andRh,· are the discrete residuals.

Rh,Inv: evaluated using Roe’s method

Rh,Vis: evaluated using the 2nd method of Bassi and Rebay (BR2)

Rh,Src: optionally handled in a dual consistent manner (i.e. NOT assimple as

κvT

hS(u,∇u))

Page 17: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Time Discretization

Steady problem:R(U) = 0, whereR is the discrete residualvectorBut R is nonlinear, so we solve a pseudo-time-dependent problemto slowly march to the steady-state solution:

M dUdt + R(U) = 0 whereM is the mass matrix

Use Backward-Euler:1∆tM

(

Um+1 − Um)

+ R(Um+1) = 0

Each step requires the solution of a nonlinear problem; instead,only take 1 newton-step (i.e. linearize):

Um+1 = Um −(

1∆t

M +∂R∂U

)−1

R(Um)

Use ILU-preconditioned GMRES to solve the linear system

Page 18: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Preliminary Results

Extruded Flat Plate Test CaseM∞ = 0.25, Rec = 1× 106, α = 0

2D, 234 element triangular mesh extruded to 3DCreated 3 layers of tetrahedrons with total depth 1

Table:Drag on a flat plate in 2D and 3D

2D 3Dp0 2.31445785633959E-031.95276171254365E-03p1 1.99582001498445E-032.01820769879093E-03p2 2.01753364756800E-032.02608940463984E-03p5 2.03642280345054E-03 N/A

Page 19: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Flat Plate SA Profile

0 0.005 0.01 0.015 0.02 0.025 0.03 0.0350

5

10

15

20

25

30

y distance

SA

wor

king

var

iabl

e, ρ

ν

2d3d

Figure:Output taken atx = 0.45 (2D, 3D) andz = 0.5 (3D).

Page 20: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Flat Plate Skin Friction

10−5

10−4

10−3

10−2

10−1

100

10−3

10−2

10−1

x distance

skin

fric

tion

coef

ficie

nt, c

f

2d3d

Figure:Output taken atz = 0.5 in 3D.

Page 21: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Remaining Challenges

Strong/Stiff source termsMay be wiping out the matrix diagonal of the linear system

Non-physical updates and overshoots in timePseudo-time stepping often leads to non-physical intermediatestates before reaching a steady solutionOvershoots can be large enough to trigger unwanted modes,leading to non-convergenceArtificial solution oscillation in time can also result

Lack of regularity at the edge of the BLCould lead to non-convergence on coarse meshes by causingsolution oscillationReduces optimal solution/output convergence rate

Page 22: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Future Work

Overall GoalsImprove robustness of current implementation

Solve problems on DPW grids

Immediate Tasks at HandProjectX 3D capability remains largely untested

Create and run a battery of test cases to study the performance androbustness of the 3D laminar codeProblems to range from extruded 2D to wing-body configurations

Solver is currently problematically slowLarge problems may not be feasible from a time perspectiveCode profiling to attempt to improve performance (e.g. bettercache/memory efficiency)

Page 23: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Questions

Questions?

Page 24: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

AIAA Drag Prediction Workshop Results

0 2 4 6 8 10 12 14 16 18 20 220.024

0.026

0.028

0.03

0.032

0.034

Solution Index

CD

, TO

T

MultiblockOversetUnstructuredMedian1 Std Dev

In the core region, spread is about 10 drag counts (1 count≈.0001CD): seems good?

By the Breguet Range Equation, raising the drag of a 747-400 by1 count≈ loss of 4-8 passngers

Uncertainty of 10 counts is actually huge!

Page 25: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Advantages of Higher-Order

Back of the Envelope ArgumentIf the error converges atO(hp+1), the computation time is

estimated:logT ≈ d(

− 1p+1 logE)

)

− logF + const

d is the dimension,F is the computational rate

For smallE, the time depends exponentially ondp+1

Increasingp can significantly lowerT

Venkatakrishnan et al (2003)Experimentally compared FV, SUPG, and DG schemes of variousorders on the Euler and Navier-Stokes EquationsConcluded that higher-order schemes are exceptionally efficientin smooth flows

But solution discontinuities “cap” convergence rates

Higher-order schemes generally require update-limiting due tostronger, non-physical overshoots in pseudo-time stepping

Page 26: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Hartmann DLR

Lift and Drag3D RANS usingk− ω model

DG method (higher order)

Body of revolution based on NACA 0012

Page 27: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Why DG?

Discontinuous Galerkin Finite Elements: AdvantagesEasier development of higher order schemes for convectiondominated flows using upwinding ideas from FD and FV

Compact stencils at anyp: block-structured Jacobian with only1st-neighbor connectivity

well-suited to unstructured meshes, mesh adaptation (h andp),and parallelization

Natural, weak enforcement of boundary conditions

No global continuity constraint means maximal flexibility

Optimally O(hp+1) solution error andO(h2p) output error

Page 28: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Compressible Reynolds-Averaged Navier Stokes Equations

Time-average the NS Equations, solving for the mean-state:

∂ρ

∂t+

∂xi(ρui) = 0

∂t(ρui) +

∂xj(ρujui + pδij ) =

∂xj

[

2(µ+ µt)

(

sji −13∂uk

∂xkδij

)]

∂t

[

ρ

(

e+12

uiui

)]

+∂

∂xj

[

ρuj

(

h +12

uiui

)]

=

∂xj

[

cp

(

µ

Pr+

µt

Prt

)

∂T∂xj

]

+∂

∂xj

[

2ui (µ+ µt)

(

sij −13∂uk

∂xkδij

)]

where(·) and(·) denote the Reynolds and Favre averages

Neglect: turbulent kinetic energy, molecular diffusion, turbulenttransportRequire closure models for the Reynolds stress (BoussinesqApproximation) and eddy viscosity (µt). . .

Page 29: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations I

The (compressible) Navier Stokes (NS) equations are:

∂ρ

∂t+

∂xi(ρui) = 0

∂t(ρui) +

∂xj(ρujui + pδij ) =

∂τij

∂xj

∂t

(

ρ(e+12

uiui)

)

+∂

∂xj

(

ρuj(h +12

uiui)

)

=∂

∂xj(uiτij ) −

∂qj

∂xj

wheree is the specific internal energy,h is the specific enthalpy,τij isthe (deviatoric) viscous stress tensor, andqi is the heat flux vector.

Recall thatτij = 2µ(

sij − 13

∂uk∂xkδij

)

wheresij = 12

(

∂ui∂xj

+∂uj

∂xi

)

is the

strain rate tensor using Stokes’ Hypothesis. We also assumeFourier’sLaw, qi = −κ ∂T

∂xi. Finally, we assume the working fluid is a perfect gas.

Page 30: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations II

The NS equations apply to laminar and turbulent flows. As we haveseen, turbulent flow is too complex to solve fully. Instead, we willderive the Reynolds Averaged Navier Stokes (RANS) equations whichgovern themean flowby averaging out or modeling turbulentfluctuations.Toward this end, we need two notions of “average”. First, thetimeaverage of a quantityv is,

v(x) = limT→∞

∫ t0+T

t0

v(x, t)dt

Now we can decomposev into mean and fluctuating parts,v = v + v′.v is constant andv′ has mean 0. The averaging process is also a linearoperation. Observe thatv′ need not be small.

Page 31: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations III

For compressible flow, a density weighted average (Favre average) isalso useful:

u(x) =1ρ

limT→∞

∫ t0+T

t0

ρ(x, t)u(x, t)dt

We breaku asu = u + u′′. The Favre average has the same propertiesas the time average; after all they are quite similar.As an example, consider computingu∂u

∂x = limT→∞1T

∫ t0+Tt0

(u + u′)(∂u∂x + ∂u′

∂x )dt for an incompressible flow.

Usingf ′g = 0, this reduces tou∂u∂x + u′ ∂u′

∂x .

Soui∂u∂xi

= ui∂u∂xi

+ u′i∂u′

∂xi. The nonlinear terms are evaluated as

limT→∞1T

∫ t0+Tt0

∂u′i u′

∂xi+ u′ ∂u′i

∂xidt. Using continuity, the second term

drops out, sou′i∂u′

∂xi=

∂u′i u′

∂xi.

Page 32: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations IV

∂ρ

∂t+

∂xj(ρui) = 0

∂t(ρui) +

∂xj(ρujui + pδij ) =

∂xj(τij − ρu′′

j u′′i )

∂t

(

ρ(e+12

uiui) +12ρu′′′

i u′′i

)

+∂

∂xj

(

ρuj(h +12

uiui) + uj12ρu′′

i u′′i

)

=∂

∂xj

(

−qj − ρu′′j h′′ + τji u′′

i − ρu′′j

12

u′′i u′′

i

)

+∂

∂xj

(

ui(τij − ρu′′i u′′

j ))

Notice that the terms with large overlines (e.g.ρu′′j u′′

i ) do not haveequivalents in the NS equations. In particular, these termsarose whenwe attempted to average nonlinear terms of the NS equations.

Page 33: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations V

Additionally, these quantities are not in terms of the mean flowvariables, implying that while the number of equations stayed thesame, we have added “five” new unknowns. (Really there are manymore than 5, since some of the new unknowns are tensors.)Until now we have made no approximations or assumptions. But inorder to make the RANS equations solvable, we need closure relationsfor our five new terms: the Reynolds stress tensor,ρu′′

j u′′i ; the turbulent

heat flux,ρu′′j h′′; the turbulent specific kinetic energy,ρk = 1

2ρu′′i u′′

i ;

the molecular diffusion,τjiu′′i ; and the turbulent transport,ρu′′

j12u′′

i u′′j .

Assumingk ≪ h (reasonable for most aerodynamic problems), we canneglect the latter three terms.Boussinesq Approximation:

−ρu′′j u′′

i = 2µt

(

sij −13∂uk

∂xkδij

)

− 23ρkδij

Page 34: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Derivation of the RANS Equations VI

whereµt is an artificial quantity called the eddy viscosity; it is anadditional, apparent addition to viscosity arising from the action ofturbulent eddies. Keeping withk ≪ h, the second term is neglected.Note that we still need a closure relation forµt; this will be providedby the Spalart-Allmaras turbulence model.Using the Reynolds Analogy, we find that the turbulent heat fluxis,

ρu′′j h′′ = −µtCp

Prt

∂T∂xj

wherePrt = 0.9 is the turbulent Prandtl number.

Page 35: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Strong and Weak Forms

The RANS equations have the strong form:

∂u∂t

+ ∇ · Finv(u) −∇ · Fvis(u,∇u) = S(u,∇u)

Finv andFvis are the inviscid and viscous fluxes, respectivelyThe corresponding weak form is obtained through multiplicationby test functionsv and integration by parts:

Ω

v∂u∂t

+

Ω

∇v · F(u,∇u) +

∂Ω

vF(u,∇u) · n =

Ω

vS(u,∇u)

Need a triangulationTh of a domainΩ; both may be curvedp-th order polynomial basis in the reference space:Vp ≡ v ∈ L2(Ω) | v fk ∈ Pp(κref),∀κ ∈ Th ⊂ L2(Ω)

Page 36: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Nearest-Neighbor with kd-Trees

AlgorithmGiven a treeT and a query-pointQ...Idea: Use binary structure to quickly find a good candidate and thendouble-check the result

Start at the root ofT, traverse to find whereQ would be inserted

The leaf-region whereQ “fits” is the current best-estimate,d

Unwind the recursion of the search until the root is reachedAt each nodeS, check if the kd-regioncouldcontain a bettercandidate than the current besti.e. if a hypersphere of radiusd atQ intersects the splittinghyperplane ofSIf so, start another recursive search down the other branch ofS

Page 37: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Complexity and Improvements

Time ComplexityAssuming balance andN >> 2k, nearest-neighbor queries takeO(log(N)) time

This is optimal

Worst-case occurs when theN points are arranged roughly in acircle, for searches near the center of that circle

HeuristicsSearch a sequence of pointsA,B,C, ... such that A is near B, Bis near C, etc

Manual stack-mangement to avoid recursion

Pre-sort inputs to obtain a balanced kd-tree

Use squared-distances to avoid computation of square roots

Page 38: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Baseline SA Model

µt = ρνfv1, fv1 =χ3

χ3 + c3v1

, χ =ν

ν

∂t(ρν) +

∂xj(ρuj ν) = cb1Sρν

+1σ

[

∂xj

(

(µ+ ρν)∂ν

∂xj

)

+ cb2ρ∂ν

∂xj

∂ν

∂xj

]

− cw1fwρν2

d2

whered is the wall-distance.

S= |∇ × u| + νfv2

k2d2, fv2 = 1− χ

1 + χfv1

fw = g

(

1 + c6w3

g6 + c6w3

)

, g = r + cw2

(

r6 − r)

, r =ν

Sk2d2

Boundary Conditions:νinflow/ν = 5.0 (Allmaras);νwall = 0; convectiveoutflow

Page 39: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

SA Model: Term Descriptions I

Transport term:ρDνDt = ∂

∂t (ρν) + ∂∂xj

(ρuj ν). Naturally chosen asthe substantial derivative, this will be balanced by production,destruction, and diffusion terms.

Production:cb1Sρν. Models the notion that turbulence isprimarily found in regions of vorticity (which in turn arises nearsolid walls). Primarily this term should be proportional tothedeformation tensor∂Ui

∂xj. ν can only be created by the presence of

vorticity.

Destruction:−cw1fwρν2

d2 . Viscous effects are strongest near solidwalls. The destruction of Reynolds shear stress is mainly felt at adistance through the pressure term. The form of destructioncomes through dimensional analysis.fw is a correction functionwhich is calibrated to improve behavior in the log layer and overflat plates.

Page 40: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

SA Model: Term Descriptions II

Diffusion: 1σ

[∇ · ((µ+ ρν)∇ν)] + cb2ρ(∇ν)2]. Contains a“classical” diffusive term along with a non-standard one.ν1+cb2 isconserved, notν. cb2 is chosen so the conservation holds and sothat a turbulent front propogates into a non-turbulent region.

All terms were chosen by analyzing previous turbulence models and/orthrough an educated guess. The constants were then tuned to matchexperimental data over some representative cases.

Page 41: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

SA Model Modifications

Lack of RobustnessIssues whenν < 0; difficult to force this condition.

Limiting of ν is hard because one must respect conservation andall the higher order DOFs.

Our modifications to the SA model do not prevent this; in fact it isstill very likely on under-resolved meshes.

Modifications to mitigateν < 0 issuesSoft-limitedµt ≥ 0.

Modified source so turbulent energy decreases ifν < 0.

Source production term is non-negative.

Page 42: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Modifications to the SA Model I

The exact solution to the SA equation is non-negative, whichfollowsthe intution thatµt ≥ 0. Unfortunately the discretized equation is notguaranteed to preserve this property. In factν is likely to be negativenear the BL edge where mesh resolution is typically lacking.The SA model may react unstably toν < 0; it can cause convergenceissues. Allmaras has since suggested modifications to improve thisproblem. Note that the following changes at least preserve firstderivative continuity, which is necessary to use Newton’s method forthe nonlinear problem.First, we can easily preventmut < 0 even if ν < 0:

µt =

ρνfv1 ν > 00 ν ≤ 0

Page 43: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Modifications to the SA Model II

To motivate further changes, we will examine the energy of the SAworking variable:eν = 1

2ν2. Multiplying the SA equation byν:

∂t(ρeν)+

∂xj(ρujeν) =

[

∂xj(η∂eν

∂xj) + (cb2ρν − η)

∂ν

∂xj

∂ν

∂xj

]

+ν(P−D)

whereη = µ+ ρν, P = cb1Sρν andD = cw1fwρ ν2

d2 . Whenν < 0 theRHS of the energy equation should be dissipative, causingeν todecrease in time. LetΩ−

t denote the region whereν < 0 andE−

ν (t) =∫

Ω−

tρeν(x, t)dx be the total energy in that region. Using

Reynolds Transport,

dE−ν

dt=

Ω−

t

∂t(ρeν)dx +

∂Ω−

t

ρeν~v · nds

Page 44: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Modifications to the SA Model III

If ∂Ω−t is strictly in the interior andν is continous, thenν|∂Ω

t= 0.

Substituing the energy equation intodE−

ν

dt and applying the divergencetheorem,

dE−ν

dt=

Ω−

t

[

(cb2ρν − η)

σ

∂ν

∂xj

∂ν

∂xj+ ν(P− D)

]

dx

We need the RHS of the above to be always negative, whichcorresponds to requiring:

(cb2ρν − η) < 0

ν(P− D) < 0

Page 45: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Modifications to the SA Model IV

To accomplish this, it is necessary to modify the defintions of thediffusion coefficientη, the productionP, and the destructionD fromthe original SA paper. Summarizing,

η =

µ(1 + χ) χ ≥ 0µ(1 + χ+ χ2) χ < 0

P =

cb1Sρν χ ≥ 0cb1Sρνgn χ < 0

wheregn = 1− 1000χ2

1+χ2 .

D =

cw1fwρν2

d2 χ ≥ 0−cw1

ρν2

d2 χ < 0

Page 46: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Modifications to the SA Model V

Tests indicate that the modifications makeν less negative but do notguaranteeν > 0. Additionally the changes do not significantly affectthe final answer from a RANS-SA simulation.

Page 47: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

SA Source Discretization

Standard WeightingThe direct approach: multiply by the test function and integrate.

Rh,S,DinC (wh, vh) = −∑

κ∈Th

κ

vThS(wh,∇wh)

Unfortunately, this results in adual inconsistentdiscretization.

Modified Standard Weighting

Rh,S,DC (wh, vh) = −∑

κ∈Th

κ

vThS(wh,∇wh) +

Γi

[[wh]]T · ~β (wh,∇wh, vh) +

∂Ω

(

ub − w+

h

)

~βb (wh,∇wh, vh) · ~n

This isdual consistentfor the right choice of “dual” fluxes,~β.

Page 48: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

The Adjoint Problem

The adjoint (dual) solution is analogous to a Green’s Function relatingthe source of a PDE (e.g. truncation error) to an output,J , computedfrom the solution of the PDE.

Primal and Dual ProblemsDiscrete Primal: find uh ∈ Vp

h satisfyingRh(uh, vh) = 0,∀vh ∈ Vp

h whereRh is the discrete primal residual.Based on discretizing the continuous PDER(u, v) = 0

Discrete Dual: find ψh ∈ Vph satisfyingR′

h(vh, ψh) = J ′h(vh),

∀vh ∈ Vph whereR′

h andJ ′h denote derivatives taken wrt

components ofuh, evaluated atuh

Notice that the arguments toRh are transposed.The discrete dual can also be reached by discretizing thecontinuous dual problem: findψ ∈ V such thatR′(v, ψ) = J′(v),∀v ∈ V.

When areR′h and the discretization ofR′ the same?

Page 49: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Dual Consistency: Why do we care?

Dual ConsistencyLoosely, a discretization (Rh,Jh) is dual consistentif the exactprimal and dual solutions (u, ψ ∈ V) satisfy the discrete dualproblem:

R′h(v, ψ) = J ′

h(v),∀v ∈ V + Vph

Not all primal discretizations lead to dual consistent adjointdiscretizations!

Advantages of Dual Consistent (DC) DiscretizationsDual inconsistency leads to suboptimal primal convergence,(O(hp) instead ofO(hp+1)) and output error (O(hp) < O(h2p))

Adjoint problems important in optimal control, designoptimisation, etc.

Many adjoint-based adaptation techniques will fail if the primaldiscretization is dual inconsistent.

Page 50: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Dual Consistency: Scalar Model Problem

− ((1 + u) ux)x −12

uxux = g for x ∈ (0,1)

u(0) = u(1) = 0

Optimal output error convergence rates fordual consistent (left)anddualinconsistent (right) discretizations forJ (u) = 1

2

∫ 10 (2 sin(πx) − u)2.

Notice the difference between the convergence rates with a DCdiscretization and the standard weighting.

Page 51: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Dual Consistent RANS Results: RAE 2822 airfoil

RAE 2822 at:M∞ = 0.6,Rec = 6.3× 106, α = 2.57,using the dual consistentdiscretization.

Figure: Drag error vsh for p = 1

(), p = 2 (), p = 3 (∗), p = 4 (⊳),

andp = 5 (×).

CommentsError measured againstp = 5 solution on the finest mesh.Optimal rate achieved forp = 1 andp = 2 but not for higherp.

p = 5 obtains betweenO(h3) andO(h4) due to a non-smoothsolution and suboptimal mesh resolution at the BL edge.

Page 52: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Development Process I

Started With...2D RANS-SA capability with dual consistent source terms

In the last year...KD-Tree based distance function for 2D

Cut-cell mesh capability for 2D problems

Analysis indicating that non-physical solution overshoots cancause non-convergence

Artificial viscosity to improve BL-edge resolution

Extension of RANS-SA code for 3D problems withaccompanying unit tests

Assorted robustness improvements and bug fixes

Page 53: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Development Process II

Green = me; Blue = group; Black = others.

Current and Ongoing WorkImprovements to the nonlinear solver (e.g. linesearch, limiting)

DGLS stabilization for the SA model equation

Source operator splitting to prevent ill-conditioning (which causelarge updates)

Improving the robustness of the 3D RANS capability

Page 54: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Dual Consistency: Linear Case I

Primal Problem: computeJ (u) for u ∈ V s.t. a(u, v) = ℓ(v),∀v ∈ VDual Problem: findψ ∈ V s.t. a(v, ψ) = J (v),∀v ∈ V

The discrete primal is obtained by findinguh ∈ Vh s.t.a(uh, vh) = ℓ(vh),∀v ∈ V whereVh ⊂ V is finite dimensional.

Similarly the discrete dual: findψh ∈ Vh s.t.a(vh, ψh) = J (vh),∀v ∈ Vh. This can be obtained 2 ways: 1) discretizethe (continuous) dual problem; 2) transpose the discrete primal; if theyare the same thena(u, v) is said to be dual consistent.

|J (u) − J (uh)| = |J (u− uh)| (by linearity)= |a(u− uh, ψ)|(defintion of dual)= |a(u− uh, ψ − ψh)| (Galerkin Orthogonality onthe primal)≤ β‖u− uh‖V‖ψ − ψh‖V .

Page 55: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Dual Consistency: Linear Case II

If the discretization obtains‖u− uh‖V ≤ O(hs) and‖ψ − ψh‖V ≤ O(ht), then the output error|J (u) − J (uh)| ≤ O(hs+t).For many common problems,h = s = p, wherep is the order of thepolynomial basis.

Page 56: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Roe’s Flux I

For a problemut + F(u)x = 0, Roe’s approximate numerical flux is:

Fni+1/2 =

12

(

F(uni ) + F(un

i+1))

− 12

∂F∂u

i′(un

i+1 − uni )

The evaluation at statei′ involves Roe-averaging. This takes the form:ρi′ =

√ρiρi+1 andui′ =

√ρiui+

√ρi+1ui+1√

ρi+√

ρi+1.

Roe’s method solves a certain linear Riemann Problem exactly at cellinterfaces. This problem has the formut + Aux = 0, whereA is only afunction ofuL anduR. It satisfies the conditions: 1)F(uR) − F(uL) = A(uR − uL); 2) A has real eigenvalues and acomplete set of eigenvectors; and 3)A → ∂F

∂u |u asuL,ur → u.These conditions ensure exactness for a single shock or expansionwave, consistency with the original equations, and solvability of the

Page 57: Towards Discontinuous Galerkin Solution of the 3D RANS Equationsweb.mit.edu/ehliu/Public/Quals/qualsRE.pdf · 2010-01-25 · Towards Discontinuous Galerkin Solution of the 3D RANS

Roe’s Flux II

linear Riemann problem.

We are also using Harten’s entropy correction, which fixes the RoeFlux near points where the velocity is near sonic. Here, expansions cango sonic, which is nonphysical. In fact Roe reduces to a centraldiscretization and entropy-violation solutions may arise. Harten’s fixinvolves replacing near-0 eigenvalues.