Godunov Interface States

These are working notes for the Godunov step in MAESTROeX and VARDEN.

MAESTROeX Notation

  • For 2D, U=(u,w) and U~=(u~,w~). Note that u=u~. We will use the shorthand i=(x,r).

  • For 3D plane parallel, U=(u,v,w) and U~=(u~,v~,w~). Note that u=u~ and v=v~. We will use the shorthand i=(x,y,r).

  • For 3D spherical, U=(u,v,w) and U~=(u~,v~,w~). We will use the shorthand i=(x,y,z).

Computing U From U~

For plane-parallel problems, in order to compute w from w~, we use simple averaging

(163)win=w~in+w0,r12+w0,r+122.

For spherial problems, in order to compute U from U~, we first map w0 onto w0MAC using put_w0_on_edges, where w0MAC only contains normal velocities at each face. Then we construct U by using

(164)ui=u~i+w0,i+12exMAC+w0,i12exMAC2,
(165)vi=v~i+w0,i+12eyMAC+w0,i12eyMAC2,
(166)wi=w~i+w0,i+12ezMAC+w0,i12ezMAC2.

To compute full edge-state velocities, simply add w0 (for plane-parallel) or w0mac to the perturbational velocity directly since only edge-based quantities are involved.

Computing w0/r

For plane-parallel problems, the spatial derivatives of w0 are given by the two-point centered difference:

(167)(w0r)i=w0,r+12w0,r12h.

For spherical problems, we compute the radial bin centered gradient using

(168)(w0r)r=w0,r+12w0,r12Δr.

Then we put w0/r onto a Cartesian grid using put_1d_array_on_cart_3d_sphr.

Computing U~TRANS in MAESTROeX

In advance_premac, we call mkutrans, to compute U~TRANS. We will only compute the normal component of velocity at each face. These transverse velocities do not contain w0, so immediately following the call to mkutrans, we call addw0 to compute UTRANS from U~TRANS.
The evolution equation for the perturbational velocity is:
(169)U~t=UU~(U~er)w0rer1ρπ+1ρ0π0rer(ρρ0)ρgerforcing terms.

We extrapolate each velocity component to edge-centered, time-centered locations. For example,

(170)u~R,i12ex=u~in+h2u~inx+Δt2u~int=u~in+h2u~inx+Δt2(u~inu~inxw~inu~inr+forcing terms)

We are going to use a 1D Taylor series extrapolation in space and time. By 1D, we mean that we omit any spatial derivatives that are not in the direction of the extrapolation. We also omit the underbraced forcing terms. We also use characteristic tracing.

(171)u~R,i12ex=u~in+[12Δt2hmin(0,u~in)]u~in

2D Cartesian Case

We predict u~ to x-faces using a 1D extrapolation:

(172)u~L,i12ex=u~iexn+[12Δt2hmax(0,uiexn)]Δxu~iexn,u~R,i12ex=u~in[12+Δt2hmin(0,uin)]Δxu~in.

We pick the final trans states using a Riemann solver:

(173)u~i12exTRANS={0,(u~L,i12ex0  AND  u~R,i12ex0)  OR  |u~L,i12ex+u~R,i12ex|<ϵ,u~L,i12ex,u~L,i12ex+u~R,i12ex>0,u~R,i12ex,u~L,i12ex+u~R,i12ex<0,

We predict w~ to r-faces using a 1D extrapolation:

(174)w~L,i12er=w~iern+[12Δt2hmax(0,wiern)]Δrw~iern,w~R,i12er=w~in[12+Δt2hmin(0,win)]Δrw~in.

We pick the final TRANS states using a Riemann solver, noting that we upwind based on the full velocity.

(175)w~i12erTRANS={0,(wL,i12er0  AND  wR,i12er0)  OR  |wL,i12er+wR,i12er|<ϵ,w~L,i12er,wL,i12er+wR,i12er>0,w~R,i12er,wL,i12er+wR,i12er<0,

3D Cartesian Case

We use the exact same procedure in 2D and 3D to compute u~TRANS and w~TRANS. The procedure for computing v~TRANS is analogous to computing u~TRANS. We predict v~ to y-faces using the 1D extrapolation:

(176)v~L,i12ey=v~ieyn+[12Δt2hmax(0,vieyn)]Δyv~ieyn,v~R,i12ey=v~in[12+Δt2hmin(0,vin)]Δyv~in,
(177)v~i12eyTRANS={0,(vL,i12ey0  AND  vR,i12ey0)  OR  |vL,i12ey+vR,i12ey|<ϵ,v~L,i12ey,vL,i12ey+vR,i12ey>0,v~R,i12ey,vL,i12ey+vR,i12ey<0.

3D Spherical Case

We predict the normal components of velocity to the normal faces using a 1D extrapolation. The equations for all three directions are identical to those given in the 2D and 3D plane-parallel sections. As in the plane-parallel case, make sure that the advection velocities, as well as the upwind velocity, is done with the full velocity, not the perturbational velocity.

Computing U~MAC, in MAESTROeX

In advance_premac, we call velpred to compute U~MAC,. We will only compute the normal component of velocity at each face.
For reference, here is the perturbational velocity equation from before:
(178)U~t=UU~(U~er)w0rer1ρπ+1ρ0π0rer(ρρ0)ρgerterms included in fU~forcing terms.

Note that the w0/r term is treated like a forcing term, but it is not actually part of fU~. We make use of the 1D extrapolations used to compute U~TRANS (u~L/R,i12ex, v~L/R,i12ey, and w~L/R,i12er), as well as the “TRANS” states (u~i12exTRANS, v~i12eyTRANS, and w~i12erTRANS)

2D Cartesian Case

  1. Predict u~ to r-faces using a 1D extrapolation.

  2. Predict u~ to x-faces using a full-dimensional extrapolation.

  3. Predict w~ to x-faces using a 1D extrapolation.

  4. Predict w~ to r-faces using a full-dimensional extrapolation.

Predict u~ to r-faces using a 1D extrapolation:

(179)u~L,i12er=u~iern+[12Δt2hmax(0,wiern)]Δru~iern,u~R,i12er=u~i[12+Δt2hmin(0,win)]Δru~in.

Upwind based on wTRANS:

(180)u~i12er={12(u~L,i12er+u~R,i12er),|wi12erTRANS|<ϵu~L,i12er,wi12erTRANS>0,u~R,i12er,wi12erTRANS<0.

Predict u~ to x-faces using a full-dimensional extrapolation,

(181)u~L,i12exMAC,=u~L,i12exΔt4h(wiex+12erTRANS+wiex12erTRANS)(u~iex+12eru~iex12er)+Δt2fu~,iex,u~R,i12exMAC,=u~R,i12exΔt4h(wi+12erTRANS+wi12erTRANS)(u~i+12eru~i12er)+Δt2fu~,i.

Solve a Riemann problem:

(182)u~i12exMAC,={0,(uL,i12exMAC,0  AND  uR,i12exMAC,0)  OR  |uL,i12exMAC,+uR,i12exMAC,|<ϵ,u~L,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,>0,u~R,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,<0.

Predict w~ to x-faces using a 1D extrapolation:

(183)w~L,i12ex=w~iexn+[12Δt2hmax(0,uiexn)]Δxw~iexn,w~R,i12ex=w~i[12+Δt2hmin(0,uin)]Δxw~in.

Upwind based on uTRANS:

(184)w~i12ex={12(w~L,i12ex+w~R,i12ex),|ui12exTRANS|<ϵw~L,i12ex,ui12exTRANS>0,w~R,i12ex,ui12exTRANS<0.

Predict w~ to r-faces using a full-dimensional extrapolation:

(185)w~L,i12erMAC,=w~L,i12erΔt4h(uier+12exTRANS+uier12exTRANS)(w~ier+12exw~ier12ex)Δt4h(w~i12erTRANS+w~i32erTRANS)(w0,i12erw0,i32er)+Δt2fw~,ier,w~R,i12erMAC,=w~R,i12erΔt4h(ui+12exTRANS+ui12exTRANS)(w~i+12exw~i12ex)Δt4h(w~i+12erTRANS+w~i12erTRANS)(w0,i+12erw0,i12er)+Δt2fw~,i.

Solve a Riemann problem:

(186)w~i12erMAC,={0,(wLMAC,0  AND  wRMAC,0)  OR  |wLMAC,+wRMAC,|<ϵ,w~L,i12erMAC,,wLMAC,+wRMAC,>0,w~R,i12erMAC,,wLMAC,+wRMAC,<0.

3D Cartesian Case

This algorithm is more complicated than the 2D case since we include the effects of corner coupling.

  1. Predict u~ to y-faces using a 1D extrapolation.

  2. Predict u~ to r-faces using a 1D extrapolation.

  3. Predict v~ to x-faces using a 1D extrapolation.

  4. Predict v~ to r-faces using a 1D extrapolation.

  5. Predict w~ to x-faces using a 1D extrapolation.

  6. Predict w~ to y-faces using a 1D extrapolation.

  7. Update prediction of u~ to y-faces by accounting for r-derivatives.

  8. Update prediction of u~ to r-faces by accounting for y-derivatives.

  9. Update prediction of v~ to x-faces by accounting for r-derivatives.

  10. Update prediction of v~ to r-faces by accounting for x-derivatives.

  11. Update prediction of w~ to x-faces by accounting for y-derivatives.

  12. Update prediction of w~ to y-faces by accounting for x-derivatives.

  13. Predict u~ to x-faces using a full-dimensional extrapolation.

  14. Predict v~ to y-faces using a full-dimensional extrapolation.

  15. Predict w~ to r-faces using a full-dimensional extrapolation.

  • Predict u~ to y-faces using a 1D extrapolation.

    (187)u~L,i12ey=u~ieyn+[12Δt2hmax(0,vieyn)]Δyu~ieyn,u~R,i12ey=u~i[12+Δt2hmin(0,vin)]Δyu~in.

    Upwind based on vTRANS:

    (188)u~i12ey={12(u~L,i12ey+u~R,i12ey),|vi12eyTRANS|<ϵu~L,i12ey,vi12eyTRANS>0,u~R,i12ey,vi12eyTRANS<0.
  • Predict u~ to r-faces using a 1D extrapolation.

  • Predict v~ to x-faces using a 1D extrapolation.

  • Predict v~ to r-faces using a 1D extrapolation.

  • Predict w~ to x-faces using a 1D extrapolation.

  • Predict w~ to y-faces using a 1D extrapolation.

  • Update prediction of u~ to y-faces by accounting for r-derivatives. The notation u~i12eyy|r means state u~i12ey that has been updated to account for transverse derives in the r-direction.

    (189)u~L,i12eyy|r=u~L,i12eyΔt6h(wiey+12erTRANS+wiey12erTRANS)(u~iey+12eru~iey12er),u~R,i12eyy|r=u~R,i12eyΔt6h(wi+12erTRANS+wi12erTRANS)(u~i+12eru~i12er).

    Upwind based on vTRANS:

    (190)u~i12eyy|r={12(u~L,i12eyy|r+u~R,i12eyy|r),|vi12eyTRANS|<ϵu~L,i12eyy|r,vi12eyTRANS>0,u~R,i12eyy|r,vi12eyTRANS<0.
  • Update prediction of u~ to r-faces by accounting for y-derivatives.

  • Update prediction of v~ to x-faces by accounting for r-derivatives.

  • Update prediction of v~ to r-faces by accounting for x-derivatives.

  • Update prediction of w~ to x-faces by accounting for y-derivatives.

  • Update prediction of w~ to y-faces by accounting for x-derivatives.

  • Predict u~ to x-faces using a full-dimensional extrapolation.

    (191)u~L,i12exMAC,=u~L,i12exΔt4h(viex+12eyTRANS+viex12eyTRANS)(u~iex+12eyy|ru~iex12eyy|r)Δt4h(wiex+12erTRANS+wiex12erTRANS)(u~iex+12err|yu~iex12err|y)+Δt2fu,iex,u~R,i12exMAC,=u~R,i12exΔt4h(vi+12eyTRANS+vi12eyTRANS)(u~i+12eyy|ru~i12eyy|r)Δt4h(wi+12erTRANS+wi12erTRANS)(u~i+12err|yu~i12err|y)+Δt2fu,i.

    Solve a Riemann problem:

    (192)u~i12exMAC,={0,(uL,i12exMAC,0  AND  uR,i12exMAC,0)  OR  |uL,i12exMAC,+uR,i12exMAC,|<ϵ,u~L,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,>0,u~R,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,<0.
  • Predict v~ to y-faces using a full-dimensional extrapolation.

  • Predict w~ to r-faces using a full-dimensional extrapolation. In this step, make sure you account for the w0/r term before solving the Riemann problem:

    (193)w~L,i12erMAC,=w~L,i12erMAC,Δt4h(w~i+12erTRANS+w~i12erTRANS)(w0,i+12erw0,i12er)w~R,i12erMAC,=w~R,i12erMAC,Δt4h(w~i12erTRANS+w~i32erTRANS)(w0,i12erw0,i32er)

3D Spherical Case

The spherical case is the same as the plane-parallel 3D Cartesian case, except the w0/r term enters in the full dimensional extrapolation for each direction. As in the plane-parallel case, make sure to upwind using the full velocity.

Computing ρEDGE,XkEDGE,(ρh)EDGE, and U~EDGE in MAESTROeX

We call make_edge_scal to compute ρEDGE,XkEDGE,(ρh)EDGE, and U~EDGE at each edge. The procedure is the same for each quantity, so we shall simply denote the scalar as s. We always need to compute ρ and Xk to faces, and the choice of energy prediction is as follows:

  • For enthalpy_pred_type = 1, we predict (ρh) to faces.

  • For enthalpy_pred_type = 2, we predict h to faces.

  • For enthalpy_pred_type = 3 and 4, we predict T to faces.

  • For enthalpy_pred_type = 5, we predict h to faces.

  • For enthalpy_pred_type = 6, we predict T to faces.

We are using enthalpy_pred_type = 1 for now. The equations of motion are:

(194)ρt=UρρU(ρ0U~)fρ,Xkt=UXk   (no forcing),(ρh)t=U(ρh)(ρh)U[(ρh)0U~]+(U~er)p0r+kthTf(ρh),U~t=UU~(U~er)w0rer1ρπ+1ρ0π0rer(ρρ0)ρgerterms included in fU~forcing terms.

2D Cartesian Case

  1. Predict s to r-faces using a 1D extrapolation.

  2. Predict s to x-faces using a full-dimensional extrapolation.

  3. Predict s to x-faces using a 1D extrapolation.

  4. Predict s to r-faces using a full-dimensional extrapolation.

  • Predict s to r-faces using a 1D extrapolation:

    (195)sL,i12er=siern+(12Δt2hwi12erMAC)Δrsiern,sR,i12er=si(12+Δt2hwi12erMAC)Δrsin.

    Upwind based on wMAC:

    (196)si12er={12(sL,i12er+sR,i12er),|wi12erMAC|<ϵsL,i12er,wi12erMAC>0,sR,i12er,wi12erMAC<0.

    Predict s to x-faces using a full-dimensional extrapolation. First, the normal derivative and forcing terms:

    (197)sL,i12exEDGE=siexn+(12Δt2hui12exMAC)Δxsiexn+Δt2fiexnsR,i12exEDGE=sin(12+Δt2hui12exMAC)Δxsin+Δt2fin

    Account for the transverse terms:

    if is_conservative then

    (198)sL,i12exEDGE=sL,i12exEDGEΔt2h[(wMACs)iex+12er(wMACs)iex12er]Δt2hsiexn(ui12exMACui32exMAC)sR,i12exEDGE=sR,i12exEDGEΔt2h[(wMACs)i+12er(wMACs)i12er]Δt2hsin(ui+12exMACui12exMAC)

    else

    (199)sL,i12exEDGE=sL,i12exEDGEΔt4h(wiex+12erMAC+wiex12erMAC)(siex+12ersiex12er)sR,i12exEDGE=sR,i12exEDGEΔt4h(wi+12erMAC+wi12erMAC)(si+12ersi12er)

    end if

  • Account for the w0/r term:

    if is_vel and comp = 2 then

    (200)sL,i12exEDGE=sL,i12exEDGEΔt4h(w~iex+12erMAC+w~iex12erMAC)(w0,i+12erw0,i12er)sR,i12exEDGE=sR,i12exEDGEΔt4h(w~i+12erMAC+w~i12erMAC)(w0,i+12erw0,i12er)

    end if

  • Upwind based on uMAC.

    (201)si12exEDGE={12(sL,i12exEDGE+sR,i12exEDGE),|ui12exMAC|<ϵsL,i12exEDGE,ui12exMAC>0,sR,i12exEDGE,ui12exMAC<0.

    Predict s to x-faces using a 1D extrapolation:

    (202)sL,i12ex=siexn+(12Δt2hui12exMAC)Δxsiexn,sR,i12ex=si(12+Δt2hui12exMAC)Δxsin.

    Upwind based on uMAC:

    (203)si12ex={12(sL,i12ex+sR,i12ex),|ui12exMAC|<ϵsL,i12ex,ui12exMAC>0,sR,i12ex,ui12exMAC<0.

    Predict s to r-faces using a full-dimensional extrapolation. First, the normal derivative and forcing terms:

    (204)sL,i12erEDGE=siern+(12Δt2hwi12erMAC)Δrsiern+Δt2fiernsR,i12erEDGE=sin(12+Δt2hwi12erMAC)Δrsin+Δt2fin

    Account for the transverse terms: if is_conservative then

    (205)sL,i12erEDGE=sL,i12erEDGEΔt2h[(uMACs)ier+12ex(uMACs)ier12ex]Δt2hsiern(wi12erMACwi32erMAC)sR,i12erEDGE=sR,i12erEDGEΔt2h[(uMACs)i+12ex(uMACs)i12ex]Δt2hsin(wi+12erMACwi12erMAC)

    else

    (206)sL,i12erEDGE=sL,i12erEDGEΔt4h(uier+12exMAC+uier12exMAC)(sier+12exsier12ex)sR,i12erEDGE=sR,i12erEDGEΔt4h(ui+12exMAC+ui12exMAC)(si+12exsi12ex)

    end if

  • Account for the w0/r term: if is_vel and comp = 2 then

    (207)sL,i12erEDGE=sL,i12erEDGEΔt4h(w~i12erMAC+w~i32erMAC)(w0,i12erw0,i32er)sR,i12erEDGE=sR,i12erEDGEΔt4h(w~i+12erMAC+w~i12erMAC)(w0,i+12erw0,i12er)

    end if

  • Upwind based on wMAC:

    (208)si12er={12(sL,i12er+sR,i12er),|wi12erMAC|<ϵuL,i12er,wi12erMAC>0,uR,i12er,wi12erMAC<0.

3D Cartesian Case

This algorithm is more complicated than the 2D case since we include the effects of corner coupling.

  1. Predict s to x-faces using a 1D extrapolation.

  2. Predict s to y-faces using a 1D extrapolation.

  3. Predict s to r-faces using a 1D extrapolation.

  4. Update prediction of s to x-faces by accounting for y-derivatives.

  5. Update prediction of s to x-faces by accounting for r-derivatives.

  6. Update prediction of s to y-faces by accounting for x-derivatives.

  7. Update prediction of s to y-faces by accounting for r-derivatives.

  8. Update prediction of s to r-faces by accounting for x-derivatives.

  9. Update prediction of s to r-faces by accounting for y-derivatives.

  10. Predict s to x-faces using a full-dimensional extrapolation.

  11. Predict s to y-faces using a full-dimensional extrapolation.

  12. Predict s to r-faces using a full-dimensional extrapolation.

  • Predict s to x-faces using a 1D extrapolation.

    (209)Misplaced &
    (210)Misplaced &

    Upwind based on uMAC:

    (211)si12ex={12(sL,i12ex+sR,i12ex),|ui12exMAC|<ϵsL,i12ex,ui12exMAC>0,sR,i12ex,ui12exMAC<0.
  • Predict s to y-faces using a 1D extrapolation.

  • Predict s to r-faces using a 1D extrapolation.

  • Update prediction of s to x-faces by accounting for y-derivatives. The notation si12exx|y means “state si12ex that has been updated to account for the transverse derivatives in the y-direction”.

    if is_conservative then

    (212)sL,i12exx|y=sL,i12exΔt3h[(svMAC)iex+12ey(svMAC)iex12ey],sR,i12exx|y=sR,i12exΔt3h[(svMAC)i+12ey(svMAC)i12ey].

    else

    (213)sL,i12exx|y=sL,i12exΔt6h(viex+12eyMAC+viex12eyMAC)(siex+12eysiex12ey),sR,i12exx|y=sR,i12exΔt6h(vi+12eyMAC+vi12eyMAC)(si+12eysi12ey).

    end if

  • Upwind based on uMAC:

    (214)si12exx|y={12(sL,i12exx|y+sR,i12exx|y),|ui12exMAC|<ϵsL,i12exx|y,ui12exMAC>0,sR,i12exx|y,ui12exMAC<0.
  • Update prediction of s to x-faces by accounting for r-derivatives.

  • Update prediction of s to y-faces by accounting for x-derivatives.

  • Update prediction of s to y-faces by accounting for r-derivatives.

  • Update prediction of s to r-faces by accounting for x-derivatives.

  • Update prediction of s to r-faces by accounting for y-derivatives.

  • Predict s to x-faces using a full-dimensional extrapolation.

    if is_conservative then

    (215)sL,i12exEDGE=sL,i12exΔt2h[(sy|rvMAC)iex+12ey(sy|rvMAC)iex12ey]Δt2h[(sr|ywMAC)iex+12er(sr|ywMAC)iex12er]Δt2hsiex(ui12exMACui32exMAC)+Δt2fiex,sR,i12exEDGE=sR,i12exΔt2h[(sy|rvMAC)i+12ey(sy|rvMAC)i12ey]Δt2h[(sr|ywMAC)i+12er(sr|ywMAC)i12er]Δt2hsi(ui+12exMACui12exMAC)+Δt2fi.

    else

    (216)sL,i12exEDGE=sL,i12exΔt4h(viex+12eyMAC+viex12eyMAC)(siex+12eyy|rsiex12eyy|r)Δt4h(wiex+12erMAC+wiex12erMAC)(siex+12err|ysiex12err|y)+Δt2fiex,sR,i12exEDGE=sR,i12exΔt4h(vi+12eyMAC+vi12eyMAC)(si+12eyy|rsi12eyy|r)Δt4h(wi+12erMAC+wi12erMAC)(si+12err|ysi12err|y)+Δt2fi.

    end if

  • Account for the w0/r term:

    if is_vel and comp = 2 then

    (217)sL,i12exEDGE=sL,i12exEDGEΔt4h(w~iex+12erMAC+w~iex12erMAC)(w0,i+12erw0,i12er)sR,i12exEDGE=sR,i12exEDGEΔt4h(w~i+12erMAC+w~i12erMAC)(w0,i+12erw0,i12er)

    end if

  • Upwind based on uMAC:

    (218)si12exEDGE={12(sL,i12exEDGE+sR,i12exEDGE),|ui12exMAC|<ϵsL,i12exEDGE,ui12exMAC>0,sR,i12exEDGE,ui12exMAC<0.
  • Predict s to y-faces using a full-dimensional extrapolation.

  • Predict s to r-faces using a full-dimensional extrapolation.

3D Spherical Case

The spherical case is the same as the plane-parallel 3D Cartesian case, except the w0/r term enters in the full dimensional extrapolation for each direction when predicting velocity to faces. As in the plane-parallel case, make sure upwind based on the full velocity.

Computing UMAC, in VARDEN

2D Cartesian Case

  • We do a 1D Taylor series extrapolation to get both components of velocity at the x-face:

    (219)uL,i12ex1D=uiex+[12Δt2hmax(0,uiex)]Δxuiex,
    (220)uR,i12ex1D=ui+[12Δt2hmin(0,ui)]Δxui.
    (221)vL,i12ex1D=viex+[12Δt2hmax(0,viex)]Δxviex,
    (222)Misplaced &

    We obtain the normal velocity using the Riemann problem:

    (223)ui12ex1D={0,(uL,i12ex1D0  AND  uR,i12ex1D0)  OR  |uL,i12ex1D+uR,i12ex1D|<ϵ,uL,i12ex1D,uL,i12ex1D+uR,i12ex1D>0,uR,i12ex1D,uL,i12ex1D+uR,i12ex1D<0.

    We obtain the transverse velocity by upwinding based on ui12ex1D:

    (224)vi12ex1D={12(vL,i12ex1D+vR,i12ex1D),|ui12ex1D|<ϵvL,i12ex1D,ui12ex1D>0,vR,i12ex1D,ui12ex1D<0.
  • We perform analogous operations to compute both components of velocity at the y-faces, Ui12ey1D.

  • Now we do a full-dimensional extrapolation to get the MAC velocity at the x-faces (note that we only compute the normal components):

    (225)uL,i12exMAC,=uL,i12ex1DΔt4h(viex+12ey1D+viex12ey1D)(uiex+12ey1Duiex12ey1D)+Δt2fu,iex,uR,i12exMAC,=uR,i12ex1DΔt4h(vi+12ey1D+vi12ey1D)(ui+12ey1Dui12ey1D)+Δt2fu,i.

    Then we solve a Riemann problem:

    (226)ui12exMAC,={0,(uL,i12exMAC,0  AND  uR,i12exMAC,0)  OR  |uL,i12exMAC,+uR,i12exMAC,|<ϵ,uL,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,>0,uR,i12exMAC,,uL,i12exMAC,+uR,i12exMAC,<0.
  • We perform analogous operations to compute the normal velocity at the y-faces, vi12eyMAC,.

3D Cartesian Case

This is more complicated than the 2D case because we include corner coupling. We compute Ui12ex1D,Ui12ey1D, and Ui12ez1D in an analogous manner as varden U_L^1D]-Eq.224. Then we compute an intermediate state, ui12eyy|z, which is described as “state ui12ey1D that has been updated to account for the transverse derivatives in the z direction”, using:

(227)uL,i12eyy|z=uL,i12ey1DΔt6h(wiey+12ez1D+wiey12ez1D)(uiey+12ez1Duiey12ez1D),uR,i12eyy|z=uR,i12ey1DΔt6h(wi+12ez1D+wi12ez1D)(ui+12ez1Dui12ez1D).

Then upwind based on vi12ey1D:

(228)ui12eyy|z={12(uL,i12eyy|z+uR,i12eyy|z),|vi12ey1D|<ϵuL,i12eyy|z,vi12ey1D>0,uR,i12eyy|z,vi12ey1D<0.

We use an analogous procedure to compute five more intermediate states, ui12ezz|y,vi12exx|z,vi12ezz|x,wi12exx|y, and wi12eyy|x. Then we do a full-dimensional extrapolation to get the MAC velocities at normal faces:

(229)uL,i12exMAC,=uL,i12ex1DΔt4h(viex+12ey1D+viex12ey1D)(uiex+12eyy|zuiex12eyy|z)Δt4h(wiex+12ez1D+wiex12ez1D)(uiex+12ezz|yuiex12ezz|y)+Δt2fu,iex,uR,i12exMAC,=uR,i12ex1DΔt4h(vi+12ey1D+vi12ey1D)(ui+12eyy|zui12eyy|z)Δt4h(wi+12ez1D+wi12ez1D)(ui+12ezz|yui12ezz|y)+Δt2fu,i.

Then we use the Riemann solver given above for the 2D case (Eq.226) to compute ui12exMAC,. We use an analogous procedure to obtain vi12eyMAC, and wi12ezMAC,.

Computing UEDGE and ρEDGE in VARDEN

To compute UEDGE, VARDEN uses the exact same algorithm as the sEDGE case in MAESTROeX. The algorithm for ρEDGE in VARDEN is slightly different than the sEDGE case in MAESTROeX since it uses a “conservative” formulation. Here, s is used in place of either ρ,u,v, or w (in 3D).

2D Cartesian Case

The 1D extrapolation is:

(230)sL,i12ex1D=siexn+(12Δt2hui12exMAC)Δxsiexn,
(231)sR,i12ex1D=si(12+Δt2hui12exMAC)Δxsin.

Then we upwind based on uMAC:

(232)si12ex1D={12(sL,i12ex1D+sR,i12ex1D),|ui12exMAC|<ϵsL,i12ex1D,ui12exMAC>0,sR,i12ex1D,ui12exMAC<0.

We use an analogous procedure to obtain si12ey1D. Now we do a full-dimensional extrapolation of s to each face. The extrapolation of a “non-conserved” s to x-faces is:

(233)sL,i12exEDGE=sL,i12ex1DΔt4h(viex+12eyMAC+viex12eyMAC)(siex+12ey1Dsiex12ey1D)+Δt2fs,iex,sR,i12exEDGE=sR,i12ex1DΔt4h(vi+12eyMAC+vi12eyMAC)(si+12ey1Dsi12ey1D)+Δt2fs,i.

The extrapolation of a “conserved” s to x-faces is:

(234)sL,i12exEDGE=sL,i12ex1DΔt2h[(s1DvMAC)iex+12ey(s1DvMAC)iex12ey]Δt2siex(UMAC)iex+Δt2hsiex(viex+12eyMACviex12eyMAC)+Δt2fs,iex,sR,i12exEDGE=sR,i12ex1DΔt2h[(s1DvMAC)i+12ey(s1DvMAC)i12ey]Δt2si(UMAC)i+Δt2hsi(vi+12eyMACvi12eyMAC)+Δt2fs,i.

Then we upwind based on uMAC.

(235)si12exEDGE={12(sL,i12exEDGE+sR,i12exEDGE),|ui12exMAC|<ϵsL,i12exEDGE,ui12exMAC>0,sR,i12exEDGE,ui12exMAC<0.

We use an analogous procedure to compute si12eyEDGE.

3D Cartesian Case

This is more complicated than the 2D case because we include corner coupling. We first compute si12ex1D, si12ey1D, and si12ez1D in an analogous manner to Eq.230 and Eq.231. Then we compute six intermediate states, si12exx|y,si12exx|z,si12eyy|x,si12eyy|z,si12ezz|x, and si12ezz|y. For the “non-conservative case”, we use, for example:

(236)sL,i12exx|y=sL,i12ex1DΔt6h(viex+12eyMAC+viex12eyMAC)(siex+12ey1Dsiex12ey1D),sR,i12exx|y=sR,i12ex1DΔt6h(vi+12eyMAC+vi12eyMAC)(si+12ey1Dsi12ey1D).

For the “conservative” case, we use, for example:

(237)sL,i12exx|y=sL,i12ex1DΔt3h[(svMAC)iex+12ey(svMAC)iex12ey],sR,i12exx|y=sR,i12ex1DΔt3h[(svMAC)i+12ey(svMAC)i12ey].

Then we upwind based on uMAC:

(238)si12exx|y={12(sL,i12exx|y+sR,i12exx|y),|ui12exMAC|<ϵsL,i12exx|y,ui12exMAC>0,sR,i12exx|y,ui12exMAC<0.

We use an analogous procedure to compute the other five intermediate states. Now we do a full-dimensional extrapolation of s to each face. The extrapolation of a “non-conserved” s to x-faces is:

(239)sL,i12exEDGE=sL,i12ex1DΔt4h(viex+12eyMAC+viex12eyMAC)(siex+12eyy|zsiex12eyy|z)Δt4h(wiex+12ezMAC+wiex12ezMAC)(siex+12ezz|ysiex12ezz|y)+Δt2fs,iex,sR,i12exEDGE=sR,i12ex1DΔt4h(vi+12eyMAC+vi12eyMAC)(si+12eyy|zsi12eyy|z)Δt4h(wi+12ezMAC+wi12ezMAC)(si+12ezz|ysi12ezz|y)+Δt2fs,i.

The extrapolation of a “conserved” s to x-faces is:

(240)sL,i12exEDGE=sL,i12ex1DΔt2h[(sy|zvMAC)iex+12ey(sy|zvMAC)iex12ey]Δt2h[(sz|ywMAC)iex+12ez(sz|ywMAC)iex12ez]Δt2siex(UMAC)iex+Δt2hsiex(viex+12eyMACviex12eyMAC+wiex+12ezMACwiex12ezMAC)+Δt2fs,iex,sR,i12exEDGE=sR,i12ex1DΔt2h[(sy|zvMAC)i+12ey(sy|zvMAC)i12ey]Δt2h[(sz|ywMAC)i+12ez(sz|ywMAC)i12ez]Δt2si(UMAC)i+Δt2hsi(vi+12eyMACvi12eyMAC+wi+12ezMACwi12ezMAC)+Δt2fs,i.

Then we upwind based on uMAC, as in Eq.235. We use an analogous procedure to compute both si12eyEDGE and si12ez.

ESTATE_FPU in GODUNOV_2D/3D.f

  • First, the normal predictor.

    (241)sLx=siex+(12ΔthxUEDGEi12ex)Δxsiex+Δt2TFORCESiexIF USE\_MINIONsRx=si(12+ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiIF USE\_MINION

    If USE_MINION and ICONSERVE then:

    (242)sLx=sLxΔt2siexDIVUiexsRx=sRxΔt2siDIVUi

    Apply boundary conditions on sLx and sRx. Then,

    (243)si12exx={sLx,UEDGEi12ex>0,sRx,else.
  • Then, if |UEDGEi12ex|ϵ, we set si12exx=(sLx+sRx)/2. The procedure to obtain si12eyy is analogous.

  • Now, the transverse terms.

    If ICONSERVE then:

    (244)sedgeLx=siex+(12ΔthxUEDGEi12ex)Δxsiex+Δt2TFORCESiexΔt2[VEDGEiex+12eysiex+12eyyVEDGEiex12eysiex12eyyhy          siex(VEDGEiex+12eyVEDGEiex12ey)hy+siexDIVUiex]sedgeRx=si(12+ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiΔt2[VEDGEi+12eysi+12eyyVEDGEi12eysi12eyyhy          si(VEDGEi+12eyVEDGEi12ey)hy+siDIVUi]
  • Now, define VBARi=(VEDGEi+12ey+VEDGEi12ey)/2.

    If NOT ICONSERVE and VEDGEi+12eyVEDGEi12ey<0 and VBARi<0 then:

    (245)sedgeLx=siex+(12ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiexΔt2[VBARiex(siex+eysiex)hy]
    (246)sedgeRx=si(12+ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiΔt2[VBARi(si+eysi)hy]

    Else If NOT ICONSERVE and VEDGEi+12eyVEDGEi12ey<0 and VBARi0 then:

    (247)sedgeLx=siex+(12ΔthxUEDGEi12ex)Δxsiex+Δt2TFORCESiexΔt2[VBARiex(siexsiexey)hy]sedgeRx=si(12+ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiΔt2[VBARi(sisiey)hy]

    Else If NOT ICONSERVE and VEDGEi+12eyVEDGEi12ey0 then:

    (248)sedgeLx=siex+(12ΔthxUEDGEi12ex)Δxsiex+Δt2TFORCESiexΔt2[(VEDGEiex+12ey+VEDGEiex12ey)(siex+12eysiex12ey)2hy]sedgeRx=si(12+ΔthxUEDGEi12ex)Δxsi+Δt2TFORCESiΔt2[(VEDGEi+12ey+VEDGEi12ey)(si+12eysi12ey)2hy]
  • Finally, upwind analogous to Eq.243 to get sedgei12ex.

ESTATE in GODUNOV_2D/3D.f

First, the normal predictor.

(249)sLx=siex+(12Δthxuiex)ΔxsiexsRx=si(12+Δthxui)Δxsi

If USE_MINION then:

(250)sLx=sLx+Δt2TFORCESiexsRx=sRx+Δt2TFORCESi

Apply boundary conditions on sLx and sRx. Then,

(251)si12exx={sLx,UADi12ex>0,sRx,else.

Then, if |UADi12ex|ϵ, we set si12exx=(sLx+sRx)/2.

(252)sedgeLx=siex+(12Δthxuiex)Δxsiex+Δt2TFORCESiexΔt2[(VADiex+12ey+VADiex12ey)(siex+12eysiex12ey)2hy]sedgeRx=si(12+Δthxui)Δxsi+Δt2TFORCESiΔt2[(VADi+12ey+VADi12ey)(si+12eysi12ey)2hy]

Note that the 2D and 3D algorithms are different - in 3D the transverse terms use upwinding analogous to Eq.245-Eq.248, using UAD instead of UEDGE. Finally, upwind analogous to Eq.251 to get sedgei12ex, but use UEDGE instead of UAD.

Piecewise Parabolic Method (PPM)

Consider a scalar, s, which we wish to predict to time-centered edges. The PPM method is an improvement over the piecewise-linear method. Using our notation, we modify equations (Eq.209 and Eq.210) in Section 4 to obtain better estimates for the time-centered 1D edge states, sL/R,i12ex, etc.. Once these states are obtained, we continue with the full-dimensional extrapolations as described before.

The PPM method is described in a series of papers:

  • Colella and Woodward 1984 - describes the basic method.

  • Miller and Colella 2002 - describes how to apply PPM to a multidimensional unsplit Godunov method and generalizes the characteristic tracing for more complicated systems. Note that we only need to upwind based on the fluid velocity, so we don’t need to use fancy characteristic tracing.

  • Colella and Sekora 2008 - describes new fancy quadratic limiters. There are several errors in the printed text, so we have implemented a corrected version from Phil Colella.

Here are the steps for the x-direction. For simplicity, we replace the vector index notation with a simple scalar notation (i+exi+1, etc.).

  • Step 1: Compute si,+ and si,, which are spatial interpolations of s to the hi and lo faces of cell i, respectively. See Sections 9.1 and 9.2 for the two options.

  • Step 2: Construct a quadratic profile within each cell.

    (253)siI(x)=si,+ξ[si,+si,+s6,i(1ξ)],
    (254)s6,i=6si3(si,+si,+),
    (255)ξ=x(i12)hh, 0ξ1.
  • Step 3: Integrate quadratic profiles to get the average value swept over the face over time. Define the following integrals, where σ=|u|Δt/h:

    (256)Ii,+(σ)=1σh(i+12)hσh(i+12)hsiI(x)dxIi,(σ)=1σh(i12)h(i12)h+σhsiI(x)dx

    Plugging in ([Quadratic Interp]) gives:

    (257)Ii,+(σ)=sj,+σ2[sj,+sj,(123σ)s6,i],Ii,(σ)=sj,+σ2[sj,+sj,+(123σ)s6,i].
  • Step 4: Obtain 1D edge states. Perform a 1D extrapolation, without source terms, to get left and right edge states. Add the source terms later if desired/necessary.

    (258)sL,i12={Ii1,+(σ),ui1 or ui12MAC>0si1,else.sR,i12={Ii,(σ),ui or ui12MAC<0si,else.

Colella and Woodward Based Approach

Spatially interpolate s to edges. Use a 4th-order interpolation in space with van Leer limiting to obtain edge values:

(259)si+12=12(si+si+1)16(δsi+1vLδsivL),
(260)δsi=12(si+1si1),
(261)δsivL={sign(δsi)min(|δsi|, 2|si+1si|, 2|sisi1|),if (si+1si)(sisi1)>0,0,otherwise.

A more compact way of writing this is

(262)s=sign(δsi),
(263)δsivL=smax{min[sδsi,2s(si+1si),2s(sisi1)],0}

Without the limiters, Eq.259 is the familiar 4th-order spatial interpolation formula:

(264)si+12=712(si+1+si)112(si+2+si1).

Next, we must ensure that si+12 lies between the adjacent cell-centered values:

(265)min(si,si+1)si+12max(si,si+1).

In anticipation of further limiting, we set double-valued face-centered values:

(266)si,+=si+1,=si+12.

Modify si,± using a quadratic limiter. First, we test whether si is a local extreumum with the condition:

(267)(si,+si)(sisi,)0,

If this condition is true, we constrain si,± by setting si,+=si,=si. If not, we then apply a second test to determine whether si is sufficiently close to si,± so that a quadratic interpolate would contain a local extremum. We define αi,±=si,±si. If one of |αi,±|2|αi,| holds, then for that choice of ±=+, we set:

(268)si,±=3si2si,.

Colella and Sekora Based Approach

  • Spatially interpolate s to edges.

    Use a 4th-order interpolation in space to obtain edge values:

    (269)si+12=712(si+1+si)112(si+2+si1).

    Then, if (si+12si)(si+1si+12)<0, we limit si+12 using a nonlinear combination of approximations to the second derivative. First, define:

    (270)(D2s)i+12=3(si2si+12+si+1)(D2s)i+12,L=si12si+si+1(D2s)i+12,R=si2si+1+si+2

    Then, define

    (271)s=sign[(D2s)i+12],
    (272)(D2s)i+12,lim=smax{min[Cs(D2s)i+12,L,Cs(D2s)i+12,R,s(D2s)i+12],0},

    where C=1.25 was used in Colella and Sekora. Then,

    (273)si+12=12(si+si+1)16(D2s)i+12,lim.

    Now we implement Phil’s new version of the algorithm to eliminate sensitivity to roundoff. First we need to detect whether a particular cell corresponds to an “extremum”. There are two tests. For the first test, define

    (274)αi,±=si±12si.

    If αi,+αi,0, then we are at an extremum. We apply the second test if either |αi,±|>2|αi,|. Then, we define:

    (275)(Ds)i,face,=si12si\sfrac32(Ds)i,face,+=si+\sfrac32si+12
    (276)(Ds)i,face,min=min[|(Ds)i,face,|,|(Ds)i,face,+|].
    (277)(Ds)i,cc,=sisi1(Ds)i,cc,+=si+1si
    (278)(Ds)i,cc,min=min[|(Ds)i,cc,|,|(Ds)i,cc,+|].

    If (Ds)i,face,min(Ds)i,cc,min, set (Ds)i,±=(Ds)i,face,±. Otherwise, set (Ds)i,±=(Ds)i,cc,±. Finally, we are at an extreumum if (Ds)i,+(Ds)i,0.

  • Now that we have finished the extremum tests, if we are at an extremum, we scale αi,±. First, we define

    (279)(D2s)i=6(αi,++αi,)(D2s)i,L=si22si1+si(D2s)i,R=si2si+1+si+2(D2s)i,C=si12si+si+1

    Then, define

    (280)s=sign[(D2s)i],
    (281)(D2s)i,lim=max{min[s(D2s)i,Cs(D2s)i,L,Cs(D2s)i,R,Cs(D2s)i,C],0}.

    Then,

    (282)αi,±=αi,±(D2s)i,limmax[|(D2s)i|,1×1010]

    Otherwise, if we are not at an extremum and |αi,±|>2|αi,|, then define

    (283)s=sign(αi,)
    (284)δIext=αi,±24(αj,++αj,),
    (285)δs=si1si,

    If sδIextsδs, then we perform the following test. If sδsαi,1×1010, then

    (286)αi,±=2δs2s[(δs)2δsαi,]12

    otherwise,

    (287)αi,±=2αi,

    Finally, si,±=si+αi,±.