The MOOD method for steady-state Euler equations G.J. Machado1 , S. Clain1,2 , R. Loubère2 1 Universidade do Minho, Centre of Mathematics, Guimarães, Portugal 2 Université Paul Sabatier, Institut de Mathématique de Toulouse, Toulouse, France
SHARK-FV 2015 Ofir, 18 – 22 May, 2015, Portugal
This research was financed by FEDER Funds through Programa Operacional Fatores de Competitividade — COMPETE and by Portuguese Funds through FCT — Fundação para a Ciência e a Tecnologia, within the Projects PEst-C/MAT/UI0013/2011 and PTDC/MAT/121185/2010
motivation
to solve steady-state hyperbolic equations using finite volume schemes prototypes: Burgers’ equation (scalar case) and Euler’s equation (vectorial case) regular solutions: high accuracy solutions with a shock: stability (no oscillations) approach: MOOD (Multidimensional Optimal Order Detection)
inviscid Burgers’ equation we seek the velocity function φ “ φpxq, solution of the 1D steady-state inviscid Burgers’ equation dF pφq “ f, in Ω “ p0, 1q dx with Dirichlet boundary conditions φ “ φlf , on x “ 0 φ “ φrg , on x “ 1 with φ2 2 f “ f pxq
F pφq “
notation
K1
Ki
KI
x1
xi
xI
b
b
x 12 ≡ 0
x 32
xi− 21
xi+ 21 hi
Ki — cell i I — number of cells xi´ 1 , xi` 1 — boundary points of cell i 2
2
hi — length of cell i xi — centroid of cell i
b
xI− 12
xI+ 12 ≡ 1
FV scheme (i) integrating equation dFdxpφq “ f over cell Ki results in ¯ 1 ´ Fi` 1 ´ Fi´ 1 ´ f¯i “ 0 2 2 hi with Fi` 1 “ F pφpxi` 1 qq 2 2 ż 1 f¯i “ f pξq dξ hi Ki let Fi` 1 « Fi` 1 2
2
fi « f¯i
the residual at cell Ki ¯ 1 ´ Gi “ Fi` 1 ´ Fi´ 1 ´ fi 2 2 hi
FV scheme (ii)
goal — to compute an approximation of the mean value of φ in each cell of the mesh represented by φi the approximation to the mean value of f over cell Ki , fi , will be computed by gaussian quadrature the way that the numerical fluxes Fi` 1 are computed 2
characterize the FV scheme
first-order finite volume scheme ˆ ˙ φ2i`1 1 φ2i maxp|φi`1 |, |φi |q Fi` 12 “ ` ´ pφi`1 ´ φi q 2 2 2 2 high-order finite volume scheme
high-order FV scheme (i)
to achieve high-order numerical approximations, we introduce local polynomial reconstructions of the underlying solutions stencil: the stencil Si of cell Ki is composed of the di ` 1 closest neighbour cells excluding cell Ki p px; di q is based on the data reconstruction: the polynomial φ i associated to the stencil under a least-square technique consistency: if the underlying solution is a polynomial of degree d, the reconstruction of degree d is exact
high-order FV scheme (ii) define the polynomial reconstructions based on the data of the associated stencil φ i px; di q “ φi `
di ÿ
Ri,α rpx ´ xi qα ´ Mi,α s
α“1
with Mi,α
1 “ hi
ż
1 px ´ xi q dx ñ hi Ki
ż
α
φ i pxq dx “ φi Ki
for a given stencil Si , we consider the quadratic functional ¨ « ff2 ˛ ÿ 1 ż pi “ arg min ˝E pi pRi q “ R φ px; di q dx ´ φj ‚ hj Kj i jPS i
p the associated polynomial that corresponds to the we set φ i best approximation in the least squares sense of the data of the stencil
high-order FV scheme (iii) to construct a generic high-order scheme one has to substitute the left and right states in by states evaluated through high-order polynomial reconstructions let us assume that a cell polynomial degree map is given M “ pd1 , . . . , dI qT with its associated stencil map S “ pS1 , . . . , SI qT p φp´ i “ φ i pxi´ 1 ; minpdi´1 , di qq 2
and
p φp` i “ φ i pxi` 1 ; minpdi , di`1 qq 2
¨ ´ ¯2 ´ ˇ¯ ¯2 ˛ ´ˇ ˇ ˇ ˇ p` ˇ ˇ p´ ˇ ´ ´ ` p p ¯ φi`1 ‹ max ˇφi ˇ , ˇφi`1 ˇ 1 ˚ φi ´ ` p p Fi` 1 pΦq “ ˝ ` ´ φ ´ φ ‚ i`1 i 2 2 2 2 2 note that the minimal polynomial degree minpdi , di`1 q at interface xi` 1 is mandatory to ensure that the cell is updated 2 with the first-rder scheme when di “ 0 or di`1 “ 0
residual form algorithm f
Ñ
fi
Φ “ pφq1“1,...,I
Ñ
fi ` Fi` 1
Ñ
p px; di q Ñ F 1 φ i i` 2 ¯ 1 ´ Fi` 1 ´ Fi´ 1 ´ fi Gi “ 2 2 hi
2
the very-high order scheme explicitly depends on the map M and the stencil S G ” GpΦ; M, Sq the numerical solution is given by vector Φ: “ pφ:i qi“1,...,I which is the solution of the nonlinear problem
the MOOD loop (i) p px; 0q: stable/low accuracy φ i p φ i px; 6q: oscillations if there is a discontinuity/high accuracy compromise: to locally reduce the polynomial degree in domains where the solution is discontinuous while preserving the optimal order in the smooth function domain MOOD: a posterior limiting procedure — the limitation is applied after the computation of the fluxes MOOD idea: to consider the maximum polynomial degree for the reconstruction, to evaluate the flux, to compute the candidate solution and then make some corrections only if it is really necessary the detection criteria: a first filter detects all extrema (called ED) and a second filter (called u2) applied on detected extrema splits them into regular or non-regular ones for non-regular extrema, one decrements the cell polynomial degree
the MOOD loop (ii) k=0 0
Φ M0 Φk M k
k = k+1
IN
NL SOLVER
OUT
Φ
POLYNOMIAL RECONSTRUCTION
k+1
DETECTION
ELSE
M
k+1
DECREMENTING
Problematic cells
CellPD map
if
M
k+1
=M
k
or
Φ
k+1
=Φ
k
THEN CONVERGENCE, EXIT
Φ*
Burgers: manufactured regular solution (i) manufactured regular solution upxq “ sinp3πxq exppxq ` 2 then f pxq “ pexppxq sinp3πxq ` 2qpexppxq sinp3πxq ` 3π exppxq cosp3πxqq ulf “ 2 urg “ 2 errors evaluation I
E8 pIq “ max |ui ´ u ¯i | i“1
| logpE8 pI1 q{E8 pI2 qq| | logpI1 {I2 q| u ¯i : the exact mean value of u over cell Ki O8 pI1 , I2 q “
initial approximation: Φ0 “ p2, . . . , 2qT
Burgers: manufactured regular solution (ii) I
E8
O8 # bad cells
40 80 P0 160 320
3.2E´01 1.6E´01 8.2E´02 4.1E´02
— 1.0 1.0 1.0
0 0 0 0
40 80 P1 160 320
2.9E´02 5.4E´03 1.1E´03 2.5E´04
— 2.4 2.3 2.2
0 0 0 0
40 80 P5 160 320
2.9E´05 3.8E´07 8.5E´09 1.6E´10
— 6.2 5.5 5.7
0 0 0 0
Burgers: solution with a shock data f pxq “ ´π cospπxqupxq ulf “ 1 urg “ ´0.1 analytical solution # 1 ´ sinpπxq if 0 ď x ď xs upxq “ ´0.1 ´ sinpπxq if xs ď x ď 1 where xs is the location of the shock (xs “ 0.1486) initial approximation: : U 0 “ pu0i qi“1,...,I # 1 if 0 ď xi ď 41 0 ui “ ´0.1 if 14 ď xi ď 1
Burgers: solution with a shock/unlimited (i)
the P0 scheme solution is rather diffused the P1 and P5 scheme solutions seem sharper and more accurate but with numerical oscillations as expected
Burgers: solution with a shock/unlimited (ii)
Burgers: solution with a shock/unlimited (iii)
Burgers: solution with a shock/unlimited (iv)
Burgers: solution with a shock/MOOD
we now trigger the MOOD loop to eliminate the non-physical oscillations with dmax “ 5 the MOOD method provides a stable and sharp solution without oscillations when the mesh is refined, the solution gets better without any oscillations (I “ 80 and I “ 140) only cells around the shock were decremented
Burgers: solution with a shock/MOOD (I “ 80)
Burgers: solution with a shock/MOOD (I “ 140)
Burgers — solution with a shock/MOOD
I E1 P0 P1 P5
r0; 0.1s O1 E8
O8
E1
r0.3; 1s O1 E8
O8 # bad cells
80 1.7E´03 — 1.9E´02 — 3.1E´02 — 5.3E´02 — 80 3.0E´05 — 1.8E´03 — 4.9E´05 — 1.0E´04 — 80 1.1E´04 — 4.6E´03 — 4.8E´05 — 9.8E´05 —
80 1.7E´04 MOOD 100 4.2E´05 dmax “ 5 120 2.4E´05 140 3.0E´06
— 6.3 3.1 13.5
6.8E´03 2.4E´03 1.7E´03 2.4E´04
— 4.7 2.0 12.5
4.8E´05 3.1E´05 2.1E´05 1.5E´05
— 2.0 2.0 2.1
9.8E´05 6.3E´05 4.3E´05 3.2E´05
— 2.0 2.0 2.0
0 2 2 0 0 0 0
Euler’s equations
dFpU q dS “ , in Ω “ p0, 1q dx dx where the conservative variable U is given by U “ pρ, ρu, EqT the flux is given by FpU q “ pρu, ρu2 ` p, upE ` pqqT , and the source term
dS dx ,
S “ pD, F, HqT “ pDpxq, F pxq, HpxqqT
Euler: manufactured regular solution (i) manufactured regular solution ρpxq “ exppxq ` exppxq sinp3πxq ` 2 upxq “ sinpαπxq ` exppxq ppxq “ exppxq then dS “ p. . . , . . . , . . .qT dx Ulf “ p. . . , . . . , . . .qT Urg “ p. . . , . . . , . . .qT initial approximation: analytical soluton/linear combination of the boundary conditions
ex3, ss, x0: exact, Rusanov, unlimited, α “1
E1 pρq
O1 pρq
E1 pρuq
O1 pρuq
E1 pEq
O1 pEq
}G}1
}Gpxp0q q}1
O
P0
40 80 160 320
6 8 8 8
847 1689 3369 6729
1.9E´01 1.0E´01 5.2E´02 2.6E´02
— 0.9 1.0 1.0
4.7E´01 2.4E´01 1.2E´01 6.1E´02
— 1.0 1.0 1.0
5.9E´01 3.0E´01 1.5E´01 7.5E´02
— 1.0 1.0 1.0
4.32e-13 8.82e-13 1.81e-12 3.32e-12
4.9E`00 2.6E`00 1.3E`00 6.5E´01
— 1.0 1.0 1.0
P1 p2q
40 80 160 320
4 4 3 3
605 1205 1924 3844
1.5E´02 2.7E´03 5.7E´04 1.3E´04
— 2.5 2.2 2.1
1.7E´02 3.5E´03 8.9E´04 2.3E´04
— 2.2 2.0 1.9
2.1E´02 4.9E´03 1.3E´03 3.4E´04
— 2.1 1.9 1.9
6.44e-13 1.23e-12 2.60e-12 5.03e-12
2.3E´01 5.6E´02 1.4E´02 3.5E´03
— 2.0 2.0 2.0
P3 p4q
40 80 160 320
3 3 3 2
484 964 1924 2883
7.9E´04 3.6E´05 3.2E´06 2.3E´07
— 4.4 3.5 3.8
8.4E´04 1.3E´04 10.0E´06 6.8E´07
— 2.7 3.7 3.9
1.6E´03 1.5E´04 1.0E´05 6.7E´07
— 3.4 3.9 4.0
7.90e-13 1.59e-12 2.73e-12 6.39e-12
1.6E´02 8.9E´04 5.2E´05 3.1E´06
— 4.1 4.1 4.1
P5 p6q
40 80 160 320
3 2 2 2
484 723 1443 2883
7.1E´05 9.7E´07 2.3E´08 4.2E´10
— 6.2 5.4 5.8
6.5E´05 3.3E´06 6.6E´08 1.1E´09
— 4.3 5.7 5.9
2.0E´04 4.2E´06 6.4E´08 9.8E´10
— 5.6 6.0 6.0
7.51e-13 1.76e-12 2.86e-12 5.88e-12
7.9E´04 1.1E´05 1.5E´07 2.1E´09
— 6.2 6.2 6.1
I
nIter nGs
x0: exact, unlimited, α “1, P 0
x0: exact, unlimited, α “1, P 1
x0: exact, unlimited, α “1, P 3
x0: exact, unlimited, α “1, P 5
ex3, ss, x0: bcs, Rusanov, unlimited, α “1
I
nIter
nGs
E1 pρq
O1 pρq
E1 pρuq
O1 pρuq
E1 pEq
O1 pEq
}G}1
}Gpxp0q q}1
O
P0
40 80 160 320
9 9 9 10
1210 2410 4810 10571
1.9E´01 1.0E´01 5.2E´02 2.6E´02
— 0.9 1.0 1.0
4.7E´01 2.4E´01 1.2E´01 6.1E´02
— 1.0 1.0 1.0
5.9E´01 3.0E´01 1.5E´01 7.5E´02
— 1.0 1.0 1.0
5.38e-13 1.02e-12 2.08e-12 3.55e-12
2.6E`01 2.6E`01 2.6E`01 2.6E`01
— Ò 0.0 0.0
P1 p2q
40 80 160 320
9 9 9 10
1210 2410 4810 10571
1.5E´02 2.7E´03 5.7E´04 1.3E´04
— 2.5 2.2 2.1
1.7E´02 3.5E´03 8.9E´04 2.3E´04
— 2.2 2.0 1.9
2.1E´02 4.9E´03 1.3E´03 3.4E´04
— 2.1 1.9 1.9
6.41e-13 1.27e-12 2.67e-12 4.92e-12
2.6E`01 2.6E`01 2.6E`01 2.6E`01
— Ò Ò Ò
P3 p4q
40 80 160 320
9 9 9 10
1210 2410 4810 10571
7.9E´04 3.6E´05 3.2E´06 2.3E´07
— 4.4 3.5 3.8
8.4E´04 1.3E´04 10.0E´06 6.8E´07
— 2.7 3.7 3.9
1.6E´03 1.5E´04 1.0E´05 6.7E´07
— 3.4 3.9 4.0
6.77e-13 1.60e-12 3.12e-12 5.82e-12
2.6E`01 2.6E`01 2.6E`01 2.6E`01
— Ò Ò Ò
P5 p6q
40 80 160 320
15 9 9 10
1576 2410 4810 10571
7.1E´05 9.7E´07 2.3E´08 4.2E´10
— 6.2 5.4 5.8
6.5E´05 3.3E´06 6.6E´08 1.1E´09
— 4.3 5.7 5.9
2.0E´04 4.2E´06 6.4E´08 9.8E´10
— 5.6 6.0 6.0
6.05e-13 1.69e-12 3.57e-12 6.40e-12
2.6E`01 2.6E`01 2.6E`01 2.6E`01
— Ò Ò Ò
x0: linear bc’s, unlimited, α “1, P 0
x0: linear bc’s, unlimited, α “1, P 1
x0: linear bc’s, unlimited, α “1, P 3
x0: linear bc’s, unlimited, α “1, P 5
ex3, ss, x0: exact, Rusanov, unlimited, α “3
I
nIter
nGs
E1 pρq
E1 pEq
O1 pEq
}G}1
}Gpxp0q q}1
O
P0
40 80 160 320
16 24 58 30
1697 5545 25019 25951
1.6E`00 2.6E`00 3.2E`00 5.1E´01
— Ò Ò 2.7
1.2E`00 8.9E´01 4.2E´01 7.9E´02
— 0.5 1.1 2.4
3.4E`00 5.4E`00 6.4E`00 8.4E´01
— Ò Ò 2.9
3.45e-13 1.12e-12 1.64e+01 9.41e+00
5.5E`00 2.8E`00 1.4E`00 6.9E´01
— 1.0 1.0 1.0
P1 p2q
40 80 160 320
13 110 55 32
1454 25071 25016 25953
3.5E´01 5.1E´02 2.2E´02 9.0E´03
— 2.8 1.2 1.3
9.3E´02 1.1E´02 2.3E´03 5.1E´04
— 3.0 2.3 2.2
6.4E´01 8.4E´02 3.6E´02 1.5E´02
— 2.9 1.2 1.3
7.16e-13 9.93e-01 4.44e-01 1.42e-01
3.3E´01 9.8E´02 2.8E´02 7.3E´03
— 1.7 1.8 1.9
P3 p4q
40 80 160 320
6 110 59 35
847 25071 25020 25956
2.3E´02 1.9E´02 6.4E´03 6.6E´04
— 0.3 1.6 3.3
6.0E´03 2.3E´03 4.9E´04 3.1E´05
— 1.4 2.2 4.0
4.5E´02 3.1E´02 1.0E´02 1.1E´03
— 0.5 1.6 3.3
8.13e-13 3.02e-02 3.18e-03 2.49e-04
2.8E´02 2.4E´03 1.9E´04 1.3E´05
— 3.5 3.7 3.9
P5 p6q
40 80 160 320
5 4 59 35
726 1205 25020 25956
10.0E´03 4.8E´04 4.9E´04 2.7E´05
— 4.4 Ò 4.2
2.4E´03 7.1E´05 3.5E´05 1.1E´06
— 5.1 1.0 4.9
1.6E´02 8.0E´04 7.9E´04 4.3E´05
— 4.3 0.0 4.2
8.32e-13 1.68e-12 4.55e-05 5.02e-07
3.2E´03 6.8E´05 1.5E´06 2.6E´08
— 5.6 5.5 5.9
O1 pρq E1 pρuq O1 pρuq
x0: exact, unlimited, α “3, P 0
x0: exact, unlimited, α “3, P 1
x0: exact, unlimited, α “3, P 3
x0: exact, unlimited, α “3, P 5
ex3, ss, x0: bcs, Rusanov, unlimited, α “3
I
nIter
nGs
E1 pρq
E1 pEq
O1 pEq
}G}1
}Gpxp0q q}1
O
P0
40 80 160 320
26 97 60 31
2907 20498 25021 25952
1.6E`00 2.6E`00 6.5E´01 1.1E´01
— Ò 2.0 2.5
1.2E`00 8.9E´01 2.6E´01 7.1E´02
— 0.5 1.7 1.9
3.4E`00 5.4E`00 1.2E`00 2.4E´01
— Ò 2.2 2.3
6.01e-12 2.30e-12 5.94e-01 2.65e-01
4.5E`01 4.5E`01 4.5E`01 4.5E`01
— 0.0 0.0 0.0
P1 p2q
40 80 160 320
15 17 13 14
1696 3858 6734 14415
1.9E´01 1.7E´01 1.6E´01 1.5E´01
— 0.1 0.1 0.0
3.5E´02 8.1E´03 2.0E´03 4.9E´04
— 2.1 2.0 2.0
3.4E´01 3.2E´01 3.1E´01 3.0E´01
— 0.1 0.1 0.0
6.56e-13 9.68e-13 2.52e-12 5.07e-12
4.5E`01 4.5E`01 4.5E`01 4.5E`01
— Ò Ò Ò
P3 p4q
40 80 160 320
14 13 14 22
1575 3374 7215 17303
1.7E´01 1.6E´01 1.5E´01 1.5E´01
— 0.1 0.0 0.0
6.8E´03 1.3E´03 2.5E´04 4.5E´05
— 2.4 2.4 2.5
3.3E´01 3.1E´01 3.0E´01 3.0E´01
— 0.1 0.0 0.0
7.34e-13 1.33e-12 2.47e-12 4.03e-12
4.5E`01 4.5E`01 4.5E`01 4.5E`01
— Ò Ò Ò
P5 p6q
40 80 160 320
12 13 23 15
1573 3374 8664 15376
1.6E´01 1.6E´01 1.5E´01 1.5E´01
— 0.1 0.0 0.0
4.7E´03 7.8E´04 1.4E´04 2.4E´05
— 2.6 2.4 2.6
3.2E´01 3.0E´01 3.0E´01 3.0E´01
— 0.1 0.0 0.0
8.11e-13 1.64e-12 2.43e-12 6.58e-12
4.5E`01 4.5E`01 4.5E`01 4.5E`01
— Ò Ò Ò
O1 pρq E1 pρuq O1 pρuq
x0: linear bc’s, unlimited, α “3, P 0
x0: linear bc’s, unlimited, α “3, P 1
x0: linear bc’s, unlimited, α “3, P 3
x0: linear bc’s, unlimited, α “3, P 5
Euler’s equations From ρu “ D and ρu2 ` p “ F , we deduce that p“F ´
D2 , ρ
(1)
and the pressure non negativity yields that F ě 0 and ρě
D2 . F
(2)
For F ą 0, we define the reference density ρˆ0 pD, F q “
D2 , F
ρ0 pxq “ ρˆ0 pDpxq, F pxqq
then we have by construction ρpxq ě ρ0 pxq, x P Ω
(3)
Euler’s equations On the other side, from ρu2 ` p “ F , upE ` pq “ H, and p e “ ρpγ´1q , we deduce that γ´1 p“ γ
ˆ
H 1 ´ ρu2 u 2
˙ (4)
Assuming that D ě 0 and arguing one more time that the pressure is non-negative, we get DH ě
D4 2ρ2
thus HD ě 0. From (4), we deduce that there exists a function Fˆ with respect to ρ given by γ ` 1 D2 γ ´ 1 H Fˆ pρq “ ` ρ 2γ ρ γ D such that F pxq “ Fˆ pρpxqq if ρ is solution of Euler’s equations
(5)
Euler’s equations Moreover, the sonic point is given by d γ ` 1 D3 ρˆson pD, Hq “ , ρson pxq “ ρˆson pDpxq, Hpxqq. 2pγ ´ 1q H 2
γ´1 H D Equation Fˆ pρq “ γ`1 2γ ρ ` γ D ρ is rewritten as a quadratic polynomial in ρ of the form
2pγ ´ 1qHρ2 ´ 2γDF ρ ` pγ ` 1qD3 “ 0. Existence of solution requires that the following compatibility condition are satisfied: F ą 0, HD ě 0,
γ2 DH ě2 2 2 γ ´1 F
Euler’s equations The supersonic solution ρˆsup pD, F, Hq writes a 2γF ´ 4γ 2 F 2 ´ 4pγ ` 1qpγ ` 1qDH 2 ρˆsup pD, F, Hq “ . 4pγ ´ 1q H D After algebraic manipulations, we also have the expression ¯ a ρ0 ´ 2 ρrsup pρ0 , ρson q “ 1´ 1´α α γ ` 1 ρ0 . In the same way, the subsonic solution is γ ρson given by ¯ a ρ0 ´ ρrsub pρ0 , ρson q “ 1 ` 1 ´ α2 α
with α “
ex3, ss, x0: bcs, unlimited, α “1, I “ 320
ex3, ss, x0: bcs, unlimited, α “3, I “ 320
Euler: solution with a shock data f1 pxq “ 0 f2 pxq “ 1 f3 pxq “ 0 Ulf “ p2.4142, 1.0000, 0.7058qT : supersonic Urg “ p3.9598, 1.0000, 1.0967qT : subsonic unlimited with P0 , P1 , and P5 and I “ 200 MOOD with Mp0q “ p5, . . . , 5qT
Euler: solution with a shock/unlimited
oscillations are clearly observed and localized around the discontinuity with MOOD: the oscillations vanish and the cell polynomial degree map is essentially equal to 5 except in the vicinity of the shock the MOOD strategy succeeds in eliminating the oscillations while preserving the high degree of reconstruction in the smooth part of the
Euler: solution with a shock/unlimited P0
Euler: solution with a shock/unlimited P1
Euler: solution with a shock/unlimited P5
Euler: solution with a shock/MOOD