13.07.2015 Views

A study of the numerical schemes in Zephyr - the Department of ...

A study of the numerical schemes in Zephyr - the Department of ...

A study of the numerical schemes in Zephyr - the Department of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The University <strong>of</strong> Saskatchewan<strong>Department</strong> <strong>of</strong> Computer ScienceTechnical Report #2005-02


A <strong>study</strong> <strong>of</strong> <strong>the</strong> <strong>numerical</strong> <strong>schemes</strong> <strong>in</strong> <strong>Zephyr</strong>Rong Wang ∗ , Raymond J. Spiteri † , and Rosette Tuy ‡June 28, 2005Abstract<strong>Zephyr</strong> is a s<strong>of</strong>tware package designed by Martec, Ltd. that is designedto solve <strong>the</strong> Euler equations for <strong>the</strong> ideal (or perfect) gas. It is a derivative<strong>of</strong> Martec’s proprietary flow solver, Ch<strong>in</strong>ook. <strong>Zephyr</strong> was created asa research tool to exam<strong>in</strong>e <strong>the</strong> key <strong>numerical</strong> features <strong>of</strong> Ch<strong>in</strong>ook. <strong>Zephyr</strong>employs a Godunov-type scheme, where <strong>the</strong> Godunov flux is computedby solv<strong>in</strong>g <strong>the</strong> correspond<strong>in</strong>g Riemann problem with <strong>the</strong> approximate Riemannsolver known as HLLC. Instead <strong>of</strong> apply<strong>in</strong>g <strong>the</strong> traditional Godunovscheme for <strong>the</strong> time <strong>in</strong>tegration, <strong>Zephyr</strong> uses explicit Runge-Kutta (ERK)<strong>schemes</strong>. In this report we describe <strong>the</strong> <strong>schemes</strong> <strong>in</strong> <strong>Zephyr</strong> for <strong>the</strong> spatialand time discretizations. Numerical results are presented for <strong>the</strong> classicalshocktube problem us<strong>in</strong>g <strong>the</strong> ERK methods orig<strong>in</strong>ally <strong>in</strong> <strong>Zephyr</strong> as wellas o<strong>the</strong>r ERK methods that we have added. Computational results showthat <strong>the</strong> stability restriction is <strong>the</strong> major barrier <strong>in</strong> terms <strong>of</strong> <strong>the</strong> allowabletime step. That is, <strong>the</strong> stability requirement forces <strong>the</strong> s<strong>of</strong>tware touse t<strong>in</strong>y time steps, consequently lead<strong>in</strong>g to exceed<strong>in</strong>gly small temporalerrors. Thus, <strong>the</strong>re is no reason to employ anyth<strong>in</strong>g beyond <strong>the</strong> forwardEuler method for <strong>the</strong> time <strong>in</strong>tegration. Indeed we see that it is <strong>the</strong> mostefficient <strong>in</strong> terms <strong>of</strong> both computer time and memory. Better efficiencieswill only be possible us<strong>in</strong>g an implicit time <strong>in</strong>tegrator such as <strong>the</strong> implicitHLLC or a high-order spatial scheme.Keywords: Euler equations, HLLC, explicit Runge–Kutta methods1 Properties <strong>of</strong> <strong>the</strong> 1-D Euler equationsThe one-dimensional Euler equations for an <strong>in</strong>compressible gas take <strong>the</strong> formU t + f x (U) = 0, (1)∗ <strong>Department</strong> <strong>of</strong> Computer Science, University <strong>of</strong> Saskatchewan, Saskatoon, Saskatchewan,S7N 5A9, Canada. The work <strong>of</strong> this author was partially supported by MITACS and Martec,Ltd. rong@cs.usask.ca.† <strong>Department</strong> <strong>of</strong> Computer Science, University <strong>of</strong> Saskatchewan, Saskatoon, Saskatchewan,S7N 5A9, Canada. The work <strong>of</strong> this author was partially supported by MITACS and Martec,Ltd. spiteri@cs.usask.ca.‡ <strong>Department</strong> <strong>of</strong> Computer Science, University <strong>of</strong> Saskatchewan, Saskatoon, Saskatchewan,S7N 5A9, Canada. The work <strong>of</strong> this author was partially supported by MITACS and Martec,Ltd.. tuy@cs.usask.ca.1


An m-stage low-storage ERK method has <strong>the</strong> formY (0) = Y nY (1) = Y n + α 1 ∆tf(t n ,Y (0) )Y (2) = Y n + α 2 ∆tf(t n + α 1 ∆t,Y (1) )..Y (k+1) = Y n + α k+1 ∆tf(t n + α k ∆t,Y (k) ).Y n+1 = Y (m) = Y n + α m ∆tf(t n + α m−1 ∆t,Y (m−1) ).In order to be consistent, it is easy to see that we must have α m = 1. Unlikeusual ERK <strong>schemes</strong>, only <strong>the</strong> approximate solution Y n at t n and <strong>the</strong> currentstage Y (k) are stored <strong>in</strong> order to reduce <strong>the</strong> memory requirement. It is easyto show that <strong>the</strong>se low-storage ERK <strong>schemes</strong> are at most first-order (thougho<strong>the</strong>r low-storage <strong>schemes</strong> <strong>of</strong> higher order are possible; see e.g., [2]). The stagecoefficients can be tuned to <strong>in</strong>crease <strong>the</strong> maximum step size and to improve <strong>the</strong>stability for <strong>the</strong> upw<strong>in</strong>d spatial discretization [8]. In <strong>Zephyr</strong>, <strong>the</strong> coefficientsare chosen from [8] even though <strong>the</strong> spatial discretization scheme is based onHLLC. Table 3 gives <strong>the</strong> CFL number and <strong>the</strong> stage coefficients for <strong>the</strong> firstandsecond-order upw<strong>in</strong>d spatial scheme.first-order HLLC scheme second-order HLLC <strong>schemes</strong>tages 2 4 6 2 4 6σ 1 2 3 0.4693 0.9214 3α 1 0.3333 0.0833 0.0370 0.4242 0.1084 0.0370α 2 1 0.2069 0.0851 1 0.2602 0.0851α 3 0.4265 0.1521 0.5052 0.1521α 4 1 0.2562 1 0.2562α 5 0.4512 0.4512α 6 1 1Table 1: Stage coefficients (α) and CFL number (σ).Besides <strong>the</strong> above ERK methods, <strong>the</strong> forward Euler method is also implemented<strong>in</strong> <strong>Zephyr</strong> with σ = 1.4 Algorithm for <strong>the</strong> time <strong>in</strong>tegrationThe time <strong>in</strong>tegration <strong>in</strong> <strong>Zephyr</strong> is implemented as follows:dt ramp= 10 −12t = t 0while (t < t out )5


{Calculate <strong>the</strong> wave speed <strong>in</strong> <strong>the</strong> i-th cell, (S w ) i , us<strong>in</strong>g (4).Calculate dt global, <strong>the</strong> largest step size based on <strong>the</strong> CFL condition.(See below for details.)Set dt global= m<strong>in</strong>(dt global, dt ramp).Set dt ramp= 2 * dt ramp.Set dt employ= σ * dt global, where σ is <strong>the</strong> CFL number from Table 1.(σ depends on <strong>the</strong> choice <strong>of</strong> spatial and ERK <strong>schemes</strong>.)Take one step us<strong>in</strong>g ERK methods with <strong>the</strong> step size dt employ.Set t = t + dt employ.}We note that <strong>the</strong> <strong>in</strong>itial step size is at most 10 −12 even though <strong>the</strong> largeststep size based on CFL condition may be much larger <strong>in</strong> practice than 10 −12 . Ateach time step, <strong>the</strong> largest time stable step size is calculated us<strong>in</strong>g C ∆x(S w) i, where(S w ) i is <strong>the</strong> wave speed <strong>in</strong> <strong>the</strong> i-th cell, and C is <strong>the</strong> Courant coefficient suppliedby <strong>the</strong> user. The recommended value <strong>of</strong> C is 0.5. The step size dt global is<strong>the</strong>n chosen as <strong>the</strong> m<strong>in</strong>imum value over all <strong>the</strong> cells; i.e.,dt global = m<strong>in</strong> C ∆x . (6)i (S w ) i¿From (6) we note that dt global does not depend on which ERK methodis used. Because dt employ= σ * dt global, we see from Table 3 that if <strong>the</strong>first-order HLLC method is employed for <strong>the</strong> spatial discretization,• dt employ= dt global when <strong>the</strong> forward Euler method is used for <strong>the</strong>time <strong>in</strong>tegration;• dt employ= dt global when <strong>the</strong> 2-stage ERK scheme is used for time<strong>in</strong>tegration;• dt employ= 2 · dt global when <strong>the</strong> 4-stage ERK scheme is used for time<strong>in</strong>tegration;• dt employ= 3 · dt global when <strong>the</strong> 6-stage ERK scheme is used for time<strong>in</strong>tegration.In each time step, <strong>the</strong> m-stage ERK method takes essentially m times as expensiveas <strong>the</strong> forward Euler method. Therefore, we expect that <strong>the</strong> forwardEuler method will be <strong>the</strong> least expensive method <strong>in</strong> terms <strong>of</strong> cost per step. Theo<strong>the</strong>r three methods have similar costs per step. Specifically, <strong>the</strong> forward Eulermethod costs essentially half as much per step as <strong>the</strong> o<strong>the</strong>r methods. This becomesparticularly relevant <strong>in</strong> situations where <strong>the</strong> spatial error is <strong>the</strong> dom<strong>in</strong>antsource <strong>of</strong> error <strong>in</strong> a given problem. In such cases, <strong>the</strong> forward Euler method willbe <strong>the</strong> most computationally efficient.Similarly, if <strong>the</strong> second-order HLLC method is employed for <strong>the</strong> spatial discretization,6


• dt employ= dt global when <strong>the</strong> forward Euler method is used for <strong>the</strong>time <strong>in</strong>tegration;• dt employ= 0.4693 · dt global when <strong>the</strong> 2-stage ERK scheme is used fortime <strong>in</strong>tegration;• dt employ= 0.9214 · dt global when <strong>the</strong> 4-stage ERK scheme is used fortime <strong>in</strong>tegration;• dt employ= 3 · dt global when <strong>the</strong> 6-stage ERK scheme is used for time<strong>in</strong>tegration.As before, <strong>the</strong> forward Euler method is <strong>the</strong> most computationally efficient. However,now <strong>the</strong> 6-stage ERK method is <strong>the</strong> second most efficient. The performance<strong>of</strong> 2-stage and 4-stage are still similar; <strong>the</strong>y are <strong>the</strong> least efficient <strong>in</strong> this case.5 Numerical experimentsThe notation used and <strong>the</strong> statistics collected <strong>in</strong> this section <strong>in</strong>clude:p: <strong>the</strong> pressure;ρ: <strong>the</strong> density;u: <strong>the</strong> velocity;CPU: <strong>the</strong> CPU time <strong>in</strong> seconds;r: <strong>the</strong> order <strong>of</strong> <strong>the</strong> spatial <strong>schemes</strong>;m: <strong>the</strong> number <strong>of</strong> stages for <strong>the</strong> ERK methods.Here m = 1 is <strong>the</strong> forward Euler method, m = 2, 4, 6, are <strong>the</strong> ERK methods<strong>in</strong> Table 3.5.1 Problem 1The first problem is <strong>the</strong> 1-D Euler equations with <strong>the</strong> follow<strong>in</strong>g <strong>in</strong>itial conditions.{ 10p =5 , if 0 ≤ x ≤ 0.5;10 3 , if 0.5 ≤ x ≤ 1;ρ ={ 1, if 0 ≤ x ≤ 0.5;0.01, if 0.5 ≤ x ≤ 1;u = 0, 0 ≤ x ≤ 1.γ is chosen to be 1.4.A reference solution, U ref is obta<strong>in</strong>ed by apply<strong>in</strong>g <strong>Zephyr</strong> with J = 50000,r = 1 and m = 1. We compute <strong>the</strong> solution at <strong>the</strong> output time t = 4 × 10 −4and plot p, ρ, and u.7


10000090000800007000060000500004000030000200001000000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Figure 1: p for Problem 1.10.90.80.70.60.50.40.30.20.100 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Figure 2: ρ for Problem 1.70060050040030020010000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Figure 3: u for Problem 1.8


The error <strong>of</strong> a given <strong>numerical</strong> solution is computed from√ ∫ 10 (U − U ref) 2 dx√ ∫ 10 U2 ref dxWe applied <strong>Zephyr</strong> with different time step sizes for test<strong>in</strong>g. The default stepsize is given by dt employ= σ * dt global. We fur<strong>the</strong>r modified <strong>the</strong> formulato dt employ= θ * σ * dt global<strong>in</strong> order to exam<strong>in</strong>e <strong>the</strong> effect <strong>of</strong> <strong>the</strong> Courantcoefficient. Therefore, θ = 1 means <strong>the</strong> default step size is used, while θ = 2means twice <strong>the</strong> default step size is used. Similarly, θ = 0.5 means that onlyhalf <strong>the</strong> default step size is used. The follow<strong>in</strong>g tables report <strong>the</strong> errors and <strong>the</strong>CPU time when we apply <strong>Zephyr</strong> with J = 400 and r = 1.θ p ρ u CPU0.5 1.88 · 10 −2 1.82 · 10 −2 1.16 · 10 −1 10.671 1.81 · 10 −2 1.76 · 10 −2 1.14 · 10 −1 5.352 1.65 · 10 −2 1.58 · 10 −2 1.01 · 10 −1 2.914 or 8 unstableTable 2: The error with J = 400, r = 1, and m = 1 for Problem 1.θ p ρ u CPU0.5 1.90 · 10 −2 1.85 · 10 −2 1.16 · 10 −1 20.411 1.84 · 10 −2 1.82 · 10 −2 1.13 · 10 −1 10.682 1.76 · 10 −2 1.75 · 10 −2 1.17 · 10 −1 5.594 1.56 · 10 −2 1.60 · 10 −2 1.02 · 10 −1 3.118 unstableTable 3: The error with J = 400, r = 1, and m = 2 for Problem 1.θ p ρ u CPU0.5 1.86 · 10 −2 1.84 · 10 −2 1.15 · 10 −1 19.611 1.78 · 10 −2 1.78 · 10 −2 1.19 · 10 −1 10.502 1.67 · 10 −2 1.69 · 10 −2 1.28 · 10 −1 5.544 1.59 · 10 −2 1.60 · 10 −2 1.42 · 10 −1 3.738 unstableTable 4: The error with J = 400, r = 1, and m = 4 for Problem 1.9


θ p ρ u CPU0.5 1.83 · 10 −2 1.82 · 10 −2 1.16 · 10 −1 19.511 1.68 · 10 −2 1.73 · 10 −2 1.10 · 10 −1 10.462 1.46 · 10 −2 1.61 · 10 −2 8.57 · 10 −2 6.274 1.98 · 10 −2 1.66 · 10 −2 2.16 · 10 −1 4.248 unstableTable 5: The error with J = 400, r = 1, and m = 6 for Problem 1.We make <strong>the</strong> follow<strong>in</strong>g observations.• As discussed <strong>in</strong> Section 4, <strong>the</strong> forward Euler method is <strong>the</strong> most efficientamong all <strong>the</strong> methods when <strong>the</strong> default sett<strong>in</strong>g is used <strong>in</strong> <strong>Zephyr</strong>; i.e.,when θ = 1. The o<strong>the</strong>r <strong>schemes</strong> have similar performance, as expected.• The forward Euler method is unstable when θ = 4 or 8, whereas <strong>the</strong> o<strong>the</strong>rERK methods are unstable only when θ = 8. It seems that <strong>the</strong> Courantcoefficient, C, can be set to 1.• It is possible to improve efficiency without loss <strong>of</strong> accuracy by us<strong>in</strong>g values<strong>of</strong> θ that are greater than 1.• The error does not <strong>in</strong>crease when <strong>the</strong> time step size is <strong>in</strong>creased providedthat a stable solution is obta<strong>in</strong>ed. This means that <strong>the</strong> spatial error dom<strong>in</strong>ates<strong>the</strong> temporal error no matter which ERK scheme is used. In o<strong>the</strong>rwords, <strong>the</strong> CFL restriction forces <strong>Zephyr</strong> to use t<strong>in</strong>y time steps that leadto unnecessarily small temporal errors. Because <strong>the</strong> CFL condition forcesall <strong>the</strong> methods to take small time steps, <strong>the</strong>y produce solutions withsmall temporal errors. Thus <strong>the</strong> total errors are dom<strong>in</strong>ated by <strong>the</strong> spatialcomponent, and hence <strong>the</strong>re is no advantage to us<strong>in</strong>g higher-order ERK<strong>schemes</strong>.We now present <strong>the</strong> results for J = 400 and r = 2. As shown <strong>in</strong> <strong>the</strong> follow<strong>in</strong>gtables, better errors are obta<strong>in</strong>ed because <strong>the</strong> second-order spatial scheme isemployed.θ p ρ u CPU0.5 6.08 · 10 −3 6.63 · 10 −3 9.40 · 10 −2 19.541 5.16 · 10 −3 5.08 · 10 −3 9.25 · 10 −2 9.962 6.33 · 10 −3 4.82 · 10 −3 1.13 · 10 −1 5.324 or 8 unstableTable 6: The error with J = 400, r = 2, and m = 1 for Problem 1.10


θ p ρ u CPU0.5 6.74 · 10 −3 8.01 · 10 −3 9.25 · 10 −2 71.811 6.46 · 10 −3 7.78 · 10 −3 9.28 · 10 −2 36.672 5.93 · 10 −3 7.37 · 10 −3 9.28 · 10 −2 18.664 4.95 · 10 −3 6.66 · 10 −3 8.95 · 10 −2 9.808 unstableTable 7: The error with J = 400, r = 2, and m = 2 for Problem 1.θ p ρ u CPU0.5 6.62 · 10 −3 7.99 · 10 −3 9.45 · 10 −2 64.811 6.30 · 10 −3 7.81 · 10 −3 9.78 · 10 −2 33.052 6.37 · 10 −3 7.64 · 10 −3 1.11 · 10 −1 17.284 6.37 · 10 −3 7.78 · 10 −3 1.04 · 10 −1 10.048 1.08 · 10 −2 1.18 · 10 −2 1.35 · 10 −1 5.80Table 8: The error with J = 400, r = 2, and m = 4 for Problem 1.θ p ρ u CPU0.5 6.22 · 10 −3 7.26 · 10 −3 1.07 · 10 −1 29.571 4.95 · 10 −3 6.76 · 10 −3 8.33 · 10 −2 16.882 9.31 · 10 −3 9.26 · 10 −3 1.13 · 10 −1 9.714 2.85 · 10 −2 1.95 · 10 −2 2.24 · 10 −1 6.448 unstableTable 9: The error with J = 400, r = 2, and m = 6 for Problem 1.We have <strong>the</strong> same results as before regard<strong>in</strong>g performance. There are, however,two notable differences.• We are able to obta<strong>in</strong> a solution with m = 4 and θ = 8 even though <strong>the</strong>error is larger than o<strong>the</strong>rs. As we know, at each time step dt employ=0.9214 · dt global for <strong>the</strong> 4-stage ERK scheme. In o<strong>the</strong>r words, it takes asmaller step than even <strong>the</strong> forward Euler method. Recall that <strong>the</strong> value <strong>of</strong>σ and <strong>the</strong> coefficients <strong>of</strong> <strong>the</strong> ERK <strong>schemes</strong> employed <strong>in</strong> <strong>Zephyr</strong> are chosenfrom [8], where a different spatial discretization is employed. As for <strong>the</strong>HLLC scheme, a larger step size could be allowed, especially when <strong>the</strong>spatial scheme is second order.• For <strong>the</strong> 6-stage ERK scheme, when we choose θ = 2 and θ = 4, <strong>the</strong> erroris doubled; i.e., <strong>the</strong> temporal error now dom<strong>in</strong>ates <strong>the</strong> spatial error. Thisimplies that it is not as accurate as <strong>the</strong> o<strong>the</strong>r methods with <strong>the</strong> same θ;i.e., it has a larger error constant for this problem.11


¿From <strong>the</strong> above experiments, we conclude that when <strong>the</strong> same mesh andorder <strong>of</strong> spatial discretization r are used, <strong>the</strong> forward Euler method is <strong>the</strong> mostefficient choice <strong>in</strong> default mode (θ = 1). We now present results us<strong>in</strong>g J = 2000.θ p ρ u CPU0.5 6.97 · 10 −3 8.27 · 10 −3 6.47 · 10 −2 274.511 6.65 · 10 −3 7.81 · 10 −3 6.56 · 10 −2 157.552 6.04 · 10 −3 6.72 · 10 −3 5.94 · 10 −2 73.384 or 8 unstableTable 10: The error with J = 2000, r = 1, and m = 1 for Problem 1.θ p ρ u CPU0.5 7.05 · 10 −3 8.51 · 10 −3 6.44 · 10 −2 539.121 6.90 · 10 −3 8.33 · 10 −3 6.62 · 10 −2 306.952 6.51 · 10 −3 7.93 · 10 −3 6.53 · 10 −2 140.474 5.54 · 10 −3 7.14 · 10 −3 5.41 · 10 −2 74.058 unstableTable 11: The error with J = 2000, r = 1, and m = 2 for Problem 1.θ p ρ u CPU0.5 6.96 · 10 −3 8.45 · 10 −3 6.65 · 10 −2 492.791 6.60 · 10 −3 8.21 · 10 −3 6.59 · 10 −2 282.552 5.98 · 10 −3 7.72 · 10 −3 6.50 · 10 −2 130.884 5.98 · 10 −3 7.20 · 10 −3 7.21 · 10 −2 80.188 unstableTable 12: The error with J = 2000, r = 1, and m = 4 for Problem 1.θ p ρ u CPU0.5 6.66 · 10 −3 8.37 · 10 −3 6.15 · 10 −2 480.561 6.40 · 10 −3 8.09 · 10 −3 6.85 · 10 −2 276.662 5.57 · 10 −3 7.55 · 10 −3 6.32 · 10 −2 140.174 4.51 · 10 −2 3.25 · 10 −2 2.17 · 10 −1 88.638 unstableTable 13: The error with J = 2000, r = 1, and m = 6 for Problem 1.12


θ p ρ u CPU0.5 1.53 · 10 −3 9.07 · 10 −4 3.81 · 10 −2 466.701 1.67 · 10 −3 1.66 · 10 −3 3.63 · 10 −2 234.762 3.18 · 10 −3 2.78 · 10 −3 4.14 · 10 −2 121.854 or 8 unstableTable 14: The error with J = 2000, r = 2, and m = 1 for Problem 1.θ p ρ u CPU0.5 1.78 · 10 −3 1.99 · 10 −3 4.11 · 10 −2 1795.011 1.65 · 10 −3 1.85 · 10 −3 3.96 · 10 −2 868.922 1.62 · 10 −3 1.61 · 10 −3 3.96 · 10 −2 433.244 1.90 · 10 −3 1.40 · 10 −3 3.93 · 10 −2 220.168 unstableTable 15: The error with J = 2000, r = 2, and m = 2 for Problem 1.θ p ρ u CPU0.5 1.75 · 10 −3 2.08 · 10 −3 4.08 · 10 −2 1775.021 1.81 · 10 −3 2.07 · 10 −3 4.31 · 10 −2 861.992 2.09 · 10 −3 2.16 · 10 −3 4.52 · 10 −2 397.834 3.06 · 10 −3 2.86 · 10 −3 3.60 · 10 −2 209.328 9.95 · 10 −3 7.84 · 10 −3 5.94 · 10 −2 112.69Table 16: The error with J = 2000, r = 2, and m = 4 for Problem 1.θ p ρ u CPU0.5 1.95 · 10 −3 1.67 · 10 −3 4.40 · 10 −2 685.981 2.23 · 10 −3 1.99 · 10 −3 2.58 · 10 −2 410.002 2.06 · 10 −2 8.88 · 10 −3 3.34 · 10 −1 249.684 or 8 unstableTable 17: The error with J = 2000, r = 2, and m = 6 for Problem 1.Compar<strong>in</strong>g <strong>the</strong> tests between J = 400 and 2000, we see that <strong>in</strong> order toobta<strong>in</strong> <strong>the</strong> same accuracy with m = 1, us<strong>in</strong>g r = 2 is more efficient. Forexample, if we set θ = 1, similar errors are obta<strong>in</strong>ed by us<strong>in</strong>g ei<strong>the</strong>r J = 400,r = 2, and m = 1, or J = 2000, r = 1, and m = 1. However, <strong>the</strong> formercomb<strong>in</strong>ation <strong>of</strong> sett<strong>in</strong>gs leads to much more efficient program than <strong>the</strong> latter.In addition to <strong>the</strong> ERK <strong>schemes</strong> orig<strong>in</strong>ally coded <strong>in</strong> <strong>Zephyr</strong>, we tested twoclassical second-order ERK methods. We refer to <strong>the</strong> first one as m = 2M. It13


is based on <strong>the</strong> well known mid-po<strong>in</strong>t rule and has <strong>the</strong> formY (1) = Y n + 0.5 ∆tf(t n ,Y n ),Y n+1 = Y n + ∆tf(t n + 0.5 ∆t,Y (1) ).We refer <strong>the</strong> second one as m = 2T. It is based on <strong>the</strong> well known trapezoidalrule and has <strong>the</strong> formY (1) = Y n + ∆tf(t n ,Y n ),Y n+1 = Y n + 0.5 ∆tf(t n ,Y n ) + 0.5 ∆tf(t n + ∆t,Y (1) ).We now present <strong>the</strong> results by us<strong>in</strong>g <strong>the</strong> two ERK <strong>schemes</strong> with σ = 1.θ p ρ u CPU0.5 7.08 · 10 −3 8.62 · 10 −3 6.44 · 10 −2 537.621 6.97 · 10 −3 8.56 · 10 −3 6.59 · 10 −2 270.582 6.65 · 10 −3 8.40 · 10 −3 6.50 · 10 −2 135.684 or 8 unstableTable 18: The error with J = 2000, r = 1, and m = 2M for Problem 1.θ p ρ u CPU0.5 6.97 · 10 −3 8.27 · 10 −3 6.47 · 10 −2 489.131 6.65 · 10 −3 7.81 · 10 −3 6.56 · 10 −2 246.312 6.04 · 10 −3 6.72 · 10 −3 5.94 · 10 −2 124.774 or 8 unstableTable 19: The error with J = 2000, r = 1, and m = 2T for Problem 1.θ p ρ u CPU0.5 1.79 · 10 −3 2.07 · 10 −3 4.20 · 10 −2 819.131 1.54 · 10 −3 2.07 · 10 −3 3.78 · 10 −2 408.772 2.07 · 10 −3 2.11 · 10 −3 4.37 · 10 −2 209.064 or 8 unstableTable 20: The error with J = 2000, r = 2, and m = 2M for Problem 1.14


θ p ρ u CPU0.5 1.53 · 10 −3 9.07 · 10 −4 3.81 · 10 −2 737.961 1.67 · 10 −3 1.66 · 10 −3 3.63 · 10 −2 371.492 3.14 · 10 −3 2.75 · 10 −3 4.17 · 10 −2 191.534 unstableTable 21: The error with J = 2000, r = 2, and m = 2T for Problem 1.As expected, <strong>the</strong>se added methods <strong>of</strong>fer no computational advantage comparedto <strong>the</strong> forward Euler method.5.2 Problem 2The second problem we consider is <strong>the</strong> 1-D Euler equations with <strong>the</strong> follow<strong>in</strong>g<strong>in</strong>itial conditions:{10p =4 , if 0 ≤ x ≤ 0.5;10 5 , if 0.5 ≤ x ≤ 1;{ 0.125, if 0 ≤ x ≤ 0.5;ρ =1, if 0.5 ≤ x ≤ 1;u = 0, 0 ≤ x ≤ 1.γ is chosen to be 1.4.The reference solution U ref is obta<strong>in</strong>ed by apply<strong>in</strong>g <strong>Zephyr</strong> with J = 50000,r = 2, and m = 1. We compute <strong>the</strong> solution at <strong>the</strong> output time t = 6 × 10 −4 .θ p ρ u CPU0.5 2.25 · 10 −2 2.37 · 10 −2 7.23 · 10 −2 8.261 2.08 · 10 −2 2.25 · 10 −2 6.62 · 10 −2 4.242 1.58 · 10 −2 1.94 · 10 −2 3.88 · 10 −2 2.284 or 8 unstableTable 22: The error with J = 400, r = 1, and m = 1 for Problem 2.θ p ρ u CPU0.5 2.30 · 10 −2 2.41 · 10 −2 7.46 · 10 −2 16.091 2.19 · 10 −2 2.35 · 10 −2 7.07 · 10 −2 8.322 2.11 · 10 −2 2.27 · 10 −2 7.30 · 10 −2 4.484 2.48 · 10 −2 2.36 · 10 −2 8.65 · 10 −2 2.568 unstableTable 23: The error with J = 400, r = 1, and m = 2 for Problem 2.15


θ p ρ u CPU0.5 2.24 · 10 −2 2.38 · 10 −2 7.39 · 10 −2 15.461 2.23 · 10 −2 2.35 · 10 −2 7.96 · 10 −2 8.092 1.67 · 10 −2 2.08 · 10 −2 4.65 · 10 −2 4.564 2.41 · 10 −2 2.30 · 10 −2 7.76 · 10 −2 3.198 unstableTable 24: The error with J = 400, r = 1, and m = 4 for Problem 2.θ p ρ u CPU0.5 2.14 · 10 −2 2.33 · 10 −2 6.95 · 10 −2 15.361 2.21 · 10 −2 2.33 · 10 −2 8.05 · 10 −2 8.432 1.58 · 10 −2 2.04 · 10 −2 4.09 · 10 −2 5.234 or 8 unstableTable 25: The error with J = 400, r = 1, and m = 6 for Problem 2.θ p ρ u CPU0.5 8.29 · 10 −3 1.15 · 10 −2 4.19 · 10 −2 14.861 7.49 · 10 −3 1.01 · 10 −2 4.20 · 10 −2 7.612 1.56 · 10 −2 1.28 · 10 −2 5.77 · 10 −2 4.254 or 8 unstableTable 26: The error with J = 400, r = 2, and m = 1 for Problem 2.θ p ρ u CPU0.5 1.01 · 10 −2 1.31 · 10 −2 4.74 · 10 −2 54.631 9.59 · 10 −3 1.28 · 10 −2 4.63 · 10 −2 27.672 8.78 · 10 −3 1.24 · 10 −2 4.47 · 10 −2 14.384 1.14 · 10 −2 1.31 · 10 −2 5.66 · 10 −2 7.658 7.41 · 10 −2 5.85 · 10 −2 1.66 · 10 −1 4.45Table 27: The error with J = 400, r = 2, and m = 2 for Problem 2.16


θ p ρ u CPU0.5 9.75 · 10 −3 1.30 · 10 −2 4.65 · 10 −2 49.491 1.02 · 10 −2 1.32 · 10 −2 5.17 · 10 −2 25.542 1.00 · 10 −2 1.31 · 10 −2 4.99 · 10 −2 13.324 1.38 · 10 −2 1.50 · 10 −3 5.11 · 10 −2 7.728 3.16 · 10 −2 2.65 · 10 −2 6.36 · 10 −2 4.79Table 28: The error with J = 400, r = 2, and m = 4 for Problem 2.θ p ρ u CPU0.5 8.74 · 10 −3 1.23 · 10 −2 4.52 · 10 −2 22.821 9.58 · 10 −3 1.25 · 10 −2 3.72 · 10 −2 13.22 7.14 · 10 −2 4.67 · 10 −2 2.76 · 10 −1 8.324 1.22 · 10 −1 8.38 · 10 −2 3.28 · 10 −1 6.418 unstableTable 29: The error with J = 400, r = 2, and m = 6 for Problem 2.Once aga<strong>in</strong> we see that <strong>in</strong> <strong>the</strong> default mode (θ = 1) and for a given level<strong>of</strong> accuracy, <strong>the</strong> most efficient comb<strong>in</strong>ation <strong>of</strong> sett<strong>in</strong>gs for <strong>Zephyr</strong> is <strong>the</strong> secondorderspatial discretization comb<strong>in</strong>ed with <strong>the</strong> forward Euler method <strong>in</strong> time.6 Conclusions and future directionsWe have performed several experiments us<strong>in</strong>g <strong>Zephyr</strong> for <strong>the</strong> 1-D Euler equations.The ma<strong>in</strong> conclusion is that, based on <strong>the</strong> current spatial discretization<strong>schemes</strong>, <strong>the</strong> stability requirement forces <strong>the</strong> s<strong>of</strong>tware to use extremely smalltime steps, and hence <strong>the</strong> temporal errors are exceed<strong>in</strong>gly small. High-orderERK methods are not able to take large enough step sizes to overcome <strong>the</strong> <strong>in</strong>creasedcost per step. The most efficient comb<strong>in</strong>ation <strong>of</strong> sett<strong>in</strong>gs is to use <strong>the</strong>second-order scheme <strong>in</strong> space and <strong>the</strong> forward Euler method <strong>in</strong> time. In orderto improve <strong>the</strong> efficiency for 1-D problems, we could use high-order spatial discretization<strong>schemes</strong>, such as ENO [3, 4] or WENO [5] <strong>schemes</strong>. This can <strong>in</strong>crease<strong>the</strong> <strong>numerical</strong> doma<strong>in</strong> <strong>of</strong> <strong>in</strong>tegration and hence ameliorate <strong>the</strong> CFL restriction.At <strong>the</strong> same time, a given accuracy can be achieved by smaller number <strong>of</strong> meshpo<strong>in</strong>ts <strong>in</strong> space, also lead<strong>in</strong>g to <strong>the</strong> possibility <strong>of</strong> employ<strong>in</strong>g larger time steps.Ano<strong>the</strong>r approach to improve <strong>the</strong> efficiency <strong>of</strong> <strong>Zephyr</strong> is to switch to <strong>the</strong> use <strong>of</strong>an implicit solver.References[1] P. Batten, N. Clarke, C. Lambert, and D.M. Causon, On <strong>the</strong> choice <strong>of</strong>wavespeeds for <strong>the</strong> HLLC Riemann solver, SIAM J. Sci. Comput., 1817


(1997), 1553–1570.[2] S. Gottlieb, C.-W. Shu, and E. Tadmor, Strong stability-preserv<strong>in</strong>g highordertime discretization methods, SIAM Review, 43 (2001), 89–112.[3] A. Harten, B. Engquist, S. Osher, and S. Chakravarthy, Uniformly highorder Essentially Non-Oscillatory <strong>schemes</strong> I, SIAM J. Numer. Anal., 24(1987), 270–309.[4] A. Harten, B. Engquist, S. Osher, and S. Chakravarthy, Uniformly highorder Essentially Non-Oscillatory <strong>schemes</strong> III, J. Comput. Phys., 71(1987), 231–303.[5] G.-S. Jiang and C.-W. Shu, Efficient implementation <strong>of</strong> Weighted ENO<strong>schemes</strong>, J. Comput. Phys., 126 (1996), 202–228.[6] B. Van Leer, C.H. Tai, and K.G. Powell, Design <strong>of</strong> optimally smooth<strong>in</strong>gmulti-stage <strong>schemes</strong> for <strong>the</strong> Euler equations, AIAA Paper 89–1933, 1989.[7] E.F. Toro, Riemann solvers and <strong>numerical</strong> methods for fluid dynamics, apractical <strong>in</strong>troduction, Spr<strong>in</strong>ger-Verlag, New York, second edition, 1999.[8] C.H. Tai, J.H. Sheu, and B. Van Leer, Optimal multistage <strong>schemes</strong>for Euler equations with residual smooth<strong>in</strong>g, AIAA Journal, 33 (1995),1008–1016.18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!