27
Block-Structured Adaptive Mesh Refinement Lecture 2 Incompressible Navier-Stokes Equations – Fractional Step Scheme 1-D AMR for “classical” PDE’s – hyperbolic – elliptic – parabolic Accuracy considerations Bell Lecture 2 – p. 1/27

Block structured mesh refinement

Embed Size (px)

DESCRIPTION

PPT from ccse Berkeley lab

Citation preview

  • Block-Structured Adaptive MeshRenement

    Lecture 2Incompressible Navier-Stokes Equations

    Fractional Step Scheme

    1-D AMR for classical PDEs hyperbolic elliptic parabolic

    Accuracy considerations

    Bell Lecture 2 p. 1/27

  • Extension to More General SystemsHow do we generalize the basic AMR ideas to more general systems?

    Incompressible Navier-Stokes equations as a prototype

    Ut + U U +p = U

    U = 0

    Advective transport

    Diffusive transport

    Evolution subject to a constraint

    Bell Lecture 2 p. 2/27

  • Vector eld decompositionHodge decomposition: Any vector field V can be written as

    V = Ud +

    where Ud = 0 and U n = 0 on the boundary

    The two components, Ud and are orthogonal

    U dx = 0

    With these properties we can define a projection P

    P = I (1)

    such thatUd = PV

    with P2 = P and ||P|| = 1

    Bell Lecture 2 p. 3/27

  • Projection form of Navier-StokesIncompressible Navier-Stokes equations

    Ut + U U +p = U

    U = 0

    Applying the projection to the momentum equation recasts the system asan initial value problem

    Ut + P(U U U) = 0

    Develop a fractional step scheme based on the projection form ofequations

    Design of the fractional step scheme takes into account issues that willarise in generalizing the methodology to

    More general Low Mach number models

    AMR

    Bell Lecture 2 p. 4/27

  • Discrete projectionProjection separates vector fields into orthogonal components

    V = Ud +

    Orthogonality from integration by parts (with U n = 0 at boundaries)

    U p dx =

    U p dx = 0

    Discretely mimic the summation by parts:

    U GP =

    (DU) p

    In matrix form D = GT

    Discrete projectionV = Ud +Gp

    DV = DGp Ud = V Gp

    P = I G(DG)1DBell Lecture 2 p. 5/27

  • Spatial discretizationDefine discrete variables so that U , Gp defined at the same locations andDU , p defined at the same locations.

    D : Vspace pspace G : pspace Vspace

    Candidate variable definitions:

    u,v

    p

    u

    v

    p u,v,p

    Bell Lecture 2 p. 6/27

  • Projection discretizationsWhat is the DG stencil corresponding to the different discretization choices

    Non-compact stencils decoupling in matrix

    Decoupling is not a problem for incompressible Navier-Stokes withhomogeneous boundary conditions but it causes difficulties for

    Nontrivial boundary conditions

    Low Mach number generalizations

    AMRFully staggered MAC discretization is problematic for AMR

    Proliferation of solversAlgorithm and discretization design issues

    Bell Lecture 2 p. 7/27

  • Approximate projection methodsBased on AMR considerations, we will define velocities at cell-centers

    Discrete projectionV = Ud +Gp

    DV = DGp Ud = V Gp

    P = I G(DG)1D

    Avoid decoupling by replacing inversion of DG in definition of P by astandard elliptic discretization.

    Bell Lecture 2 p. 8/27

  • Approximate projection methodsAnalysis of projection options indicates staggered pressure has "best"approximate projection properties in terms of stability and accuracy.

    DUi+1/2,j+1/2 =ui+1,j+1 + ui+1,j ui,j+1 ui,j

    2x

    +vi+1,j+1 + vi,j+1 ui+1,j ui,j

    2y

    Gpij =

    pi+1/2,j+1/2+pi+1/2,j1/2pi1/2,j+1/2pi1/2,j1/2

    2x

    pi+1/2,j+1/2+pi1/2,j+1/2pi+1/2,j1/2pi1/2,j1/2

    2y

    Projection is given by P = I G(L)1D

    where L is given by bilinear finite element basis

    (p,) = (V,)

    Nine point discretizationBell Lecture 2 p. 9/27

  • 2nd Order Fractional Step SchemeFirst Step:

    Construct an intermediate velocity field U:

    U Un

    t= [UADV U ]n+

    1

    2 pn1

    2 + Un + U

    2

    Second Step:

    Project U onto constraint and update p. Form

    V =U

    t+Gpn

    1

    2

    SolveLp

    n+ 12 = DV

    SetU

    n+1 = t(V Gpn+1

    2 )

    Bell Lecture 2 p. 10/27

  • Computation of Advective DerivativesStart with Un at cell centersPredict normal velocities at cell edges using variation of second-orderGodunov methodology un+1/2

    i+1/2,j, v

    n+1/2i,j+1/2

    MAC-project the edge-based normal velocities, i.e. solve

    DMAC(GMAC) = DMACUn+1/2

    and define normal advection velocities

    uADVi+1/2,j = u

    n+1/2i+1/2,j

    Gx, vADVi,j+1/2 = vn+1/2i,j+1/2

    Gy

    Use these advection velocities to define [UADV U ]n+1/2.

    : u : v :

    Bell Lecture 2 p. 11/27

  • Second-order projection algorithmProperties

    Second-order in space and time

    Robust discretization ofadvection terms using modernupwind methodology

    Approximate projection formula-tion

    Algorithm components

    Explicit advection

    Semi-implicit diffusion

    Elliptic projections5-point cell-centered9-point node-centered

    How do we generalize AMR to work for projection algorithm?

    Look at discretization details in one dimensionRevisit hyperbolic

    Elliptic

    Parabolic

    Spatial discretizations

    Bell Lecture 2 p. 12/27

  • Hyperbolic1dConsider Ut + Fx = 0 discretized with an explicit finite differencescheme:

    Un+1i Uni

    t=F

    n+ 12

    i1/2 F

    n+ 12

    i+1/2

    x

    In order to advance the composite solution we must specify how tocompute the fluxes:

    tf

    xf xc

    j1 j J J+1

    Away from coarse/fine interface the coarse grid sees the average offine grid values onto the coarse grid

    Fine grid uses interpolated coarse grid data

    The fine flux is used at the coarse/fine interface

    Bell Lecture 2 p. 13/27

  • HyperboliccompositeOne can advance the coarse grid

    tf

    (J1) J J+1

    then advance the fine grid

    tf

    j1 j (j+1)

    using ghost cell data at the fine level interpolated from the coarse griddata.

    This results in a flux mismatch at the coarse/fine interface, which createsan error in Un+1J . The error can be corrected by refluxing, i.e. setting

    xcUn+1J := xcU

    n+1J t

    fF

    cJ1/2 + t

    fF

    fj+1/2

    Before the next step one must average the fine grid solution onto thecoarse grid. Bell Lecture 2 p. 14/27

  • HyperbolicsubcyclingTo subcycle in time we advance the coarse grid with tc

    tc

    (J1) J J+1

    and advance the fine grid multiple times with tf .

    tf

    tf

    tf

    tf

    j1 j (j+1)

    The refluxing correction now mustbe summed over the fine grid timesteps:

    xcUn+1J := xcU

    n+1J

    tcF cJ1/2 +

    tfF fj+1/2

    Bell Lecture 2 p. 15/27

  • AMR Discretization algorithmsDesign Principles:

    Define what is meant by the solution on the grid hierarchy.

    Identify the errors that result from solving the equations on each levelof the hierarchy independently (motivated by subcycling in time).

    Solve correction equation(s) to fix the solution.

    For subcycling, average the correction in time.

    Coarse grid supplies Dirichlet data as boundary conditions for the finegrids.

    Errors take the form of flux mismatches at the coarse/fine interface.

    Bell Lecture 2 p. 16/27

  • EllipticConsider xx = on a locally refined grid:

    xf xc

    j 1 j J J + 1

    We discretize with standard centered differences except at j and J . Wethen define a flux, cfx , at the coarse / fine boundary in terms of f and c

    and discretize in flux form with

    1

    xf

    (

    cfx

    (j j1)

    xf

    )= j

    at i = j and

    1

    xc

    ((J+1 J )

    xc cfx

    )= J

    at I = J .

    This defines a perfectly reasonable linear system but ...

    Bell Lecture 2 p. 17/27

  • Elliptic compositeSuppose we solve

    1

    xc

    ((I+1 I)

    xc

    (I I1)

    xc

    )= I

    at all coarse grid points I and then solve

    1

    xf

    ((i+1 i)

    xf

    (i i1)

    xf

    )= i

    at all fine grid points i 6= j and use the correct stencil at i = j, holding thecoarse grid values fixed.

    j 1 j J J + 1

    Bell Lecture 2 p. 18/27

  • Elliptic synchronization

    The composite solution defined by c and f satisfies the compositeequations everywhere except at J.

    The error is manifest in the difference between cfx and(JJ1)

    xc.

    Let e = . Then he = 0 except at I = J where

    he =1

    xc

    ((J J1)

    xc cfx

    )

    Solve the composite for e and correct

    c = c+ ec

    f = f

    + ef

    The resulting solution is the same as solving the composite operator

    Bell Lecture 2 p. 19/27

  • Parabolic compositeConsider ut + fx = uxx and the semi-implicit time-advance algorithm:

    un+1i uni

    t+f

    n+ 12

    i+1/2 f

    n+ 12

    i1/2

    x=

    2

    ((hun+1)i + (

    hu

    n)i

    )

    t

    xf xc

    j1 j J J+1

    Again if one advances the coarse and fine levels separately, a mismatch inthe flux at the coarse-fine interface results.

    Let ucf be the initial solution from separate evolution

    Bell Lecture 2 p. 20/27

  • Parabolic synchronizationThe difference en+1 between the exact composite solution un+1 and thesolution un+1 found by advancing each level separately satisfies

    (I t

    2h) en+1 =

    t

    xc(f + D)

    t f = t (fJ1/2 + fj+1/2)

    t D =t

    2

    ((uc,n

    x,J1/2+ uc,n+1

    x,J1/2) (ucf,nx + u

    cf,n+1x )

    )

    Source term is localized to to coarse cell at coarse / fine boundary

    Updating un+1 = un+1 + e again recovers the exact composite solution

    Bell Lecture 2 p. 21/27

  • Parabolic subcycling

    Advance coarse grid

    tc

    (J1) J J+1

    Advance fine grid r times

    tf

    tf

    tf

    tf

    j1 j (j+1)

    The refluxing correction now must be summed over the fine grid timesteps:

    (I tc

    2h) en+1 =

    tc

    xc(f + D)

    tc f = tc fJ1/2 +

    tffj+1/2

    tc D =tc

    2(uc,n

    x,J1/2+ uc,n+1

    x,J1/2)

    tf

    2(ucf,nx + u

    cf,n+1x )

    Bell Lecture 2 p. 22/27

  • Spatial accuracy cell-centeredModified equation gives

    comp = exact + 1comp

    where is a local function of the solution derivatives.

    Simple interpolation formulae are not sufficiently accurate for second-orderoperators

    yc

    yc

    xc-f

    xc-fxc

    Bell Lecture 2 p. 23/27

  • Convergence resultsLocal Truncation Error

    D Norm x ||L(Ue) ||h ||L(Ue) ||2h R P

    2 L 1/32 1.57048e-02 2.80285e-02 1.78 0.842 L 1/64 8.08953e-03 1.57048e-02 1.94 0.963 L 1/16 2.72830e-02 5.60392e-02 2.05 1.043 L 1/32 1.35965e-02 2.72830e-02 2.00 1.003 L1 1/32 8.35122e-05 3.93200e-04 4.70 2.23

    Solution Error

    D Norm x ||Uh Ue|| ||U2h Ue|| R P

    2 L 1/32 5.13610e-06 1.94903e-05 3.79 1.922 L 1/64 1.28449e-06 5.13610e-06 3.99 2.003 L 1/16 3.53146e-05 1.37142e-04 3.88 1.963 L 1/32 8.88339e-06 3.53146e-05 3.97 1.99

    computed = exact + L1

    Solution operator smooths the errorBell Lecture 2 p. 24/27

  • Spatial accuracy nodalNode-based solvers:

    Symmetric self-adjoint matrix

    Accuracy properties given by approximation theory

    Bell Lecture 2 p. 25/27

  • RecapSolving coarse grid then solving fine grid with interpolated Dirichletboundary conditions leads to a flux mismatch at boundary

    Synchronization corrects mismatch in fluxes at coarse / fine boundaries.

    Correction equations match the structure of the process they arecorrecting.

    For explicit discretizations of hyperbolic PDEs the correction is anexplicit flux correction localized at the coarse/fine interface.

    For an elliptic equation (e.g., the projection) the source is localized onthe coarse/fine interface but an elliptic equation is solved to distributethe correction through the domain. Discrete analog of a layerpotential problem.

    For Crank-Nicolson discretization of parabolic PDEs, the correctionsource is localized on the coarse/fine interface but the correctionequation diffuses the correction throughout the domain.

    Bell Lecture 2 p. 26/27

  • Efciency considerationsFor the elliptic solves, we can substitute the following for a full compositesolve with no loss of accuracy

    Solve c = gc on coarse grid

    Solve f = gf on fine grid using interpolated Dirichlet boundaryconditionsEvaluate composite residual on the coarse cells adjacent to the finegrids

    Solve for correction to coarse and fine solutions on the compositehierarchy

    Because of the smoothing properties of the elliptic operator, we can, insome cases, substitute either a two-level solve or a coarse level solve forthe full composite operator to compute the correction to the solution.

    Source is localized at coarse cells at coares / fine boundary

    Solution is a discrete harmonic function in interior of fine grid

    This correction is exact in 1-D

    Bell Lecture 2 p. 27/27

    Extension to More General SystemsVector field decomposition Projection form of Navier-StokesDiscrete projectionSpatial discretizationProjection discretizationsApproximate projection methodsApproximate projection methods2nd Order Fractional Step SchemeComputation of Advective DerivativesSecond-order projection algorithmHyperbolic--1dHyperbolic--compositeHyperbolic--subcyclingAMR Discretization algorithmsEllipticElliptic -- compositeElliptic -- synchronizationParabolic -- compositeParabolic -- synchronizationParabolic -- subcyclingSpatial accuracy -- cell-centeredConvergence resultsSpatial accuracy -- nodalRecapEfficiency considerations