Skip to content

Liu-Zhang cell average limiter (part 2, Euler, CNS)#3066

Open
jlchan wants to merge 188 commits into
trixi-framework:mainfrom
jlchan:jc/liu_zhang_euler
Open

Liu-Zhang cell average limiter (part 2, Euler, CNS)#3066
jlchan wants to merge 188 commits into
trixi-framework:mainfrom
jlchan:jc/liu_zhang_euler

Conversation

@jlchan

@jlchan jlchan commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Part 2 of #3063. This extends the Liu-Zhang limiter to Euler (and compressible Navier-Stokes, though I have not added any CNS examples since this is already a longer PR).

The main ingredient is project_to_admissible_set for CompressibleEulerEquations1D/2D described in Appendix B and C of https://arxiv.org/pdf/2510.21080. Unfortunately, it is a rather mathematically dense algorithm, and was at least partially translated using AI tools from a reference Fortran implementation. I tried to make it more readable, but the logic is not the easiest to follow.

Additional TODOs:

@jlchan

jlchan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Example of the astro jet with Liu-Zhang: https://gist.github.com/jlchan/37e4b1d5877f3625f63cd55c0968b39d. Without shock capturing, more time-steps are required, but the solution is also less dissipated.

Screenshot 2026-06-23 at 8 16 15 PM

The Liu-Zhang limiter is activated 10 times, with an iteration history of [4, 4, 6, 4, 4, 6, 4, 5, 4, 4]

@jlchan jlchan changed the title Liu-Zhang cell average limiter (part 2, Euler) Liu-Zhang cell average limiter (part 2, Euler, CNS) Jun 24, 2026
@jlchan

jlchan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Running

include(joinpath(examples_dir(), "tree_1d_dgsem/elixir_euler_leblanc_limiter_liu_zhang.jl"))
using Plots; plot(PlotData1D(sol)["rho"], yaxis=:log)

yields the following:
Screenshot 2026-06-23 at 9 43 34 PM

The limiter is activated 12 times with iteration counts [23, 17, 17, 16, 12, 13, 12, 9, 9, 8, 8, 5]. With only the Zhang-Shu limiter, the elixir crashes about 26% of the way through.

On one thread, this yields the following summary.

─────────────────────────────────────────────────────────────────────────────────────────────
                 Trixi.jl                           Time                    Allocations      
                                           ───────────────────────   ────────────────────────
             Tot / % measured:                  2.34s /  92.6%            204KiB /  49.4%    

Section                            ncalls     time    %tot     avg     alloc    %tot      avg
─────────────────────────────────────────────────────────────────────────────────────────────
rhs!                                23.6k    2.04s   94.4%  86.6μs   3.03KiB    3.0%    0.13B
  volume integral                   23.6k    1.83s   84.6%  77.6μs     0.00B    0.0%    0.00B
  interface flux                    23.6k   69.9ms    3.2%  2.96μs     0.00B    0.0%    0.00B
  Jacobian                          23.6k   37.8ms    1.7%  1.60μs     0.00B    0.0%    0.00B
  surface integral                  23.6k   30.4ms    1.4%  1.29μs     0.00B    0.0%    0.00B
  prolong2interfaces                23.6k   30.0ms    1.4%  1.27μs     0.00B    0.0%    0.00B
  reset ∂u/∂t                       23.6k   28.4ms    1.3%  1.20μs     0.00B    0.0%    0.00B
  ~rhs!~                            23.6k   13.0ms    0.6%   550ns   3.03KiB    3.0%    0.13B
  prolong2boundaries                23.6k    619μs    0.0%  26.3ns     0.00B    0.0%    0.00B
  boundary flux                     23.6k    579μs    0.0%  24.6ns     0.00B    0.0%    0.00B
  source terms                      23.6k    236μs    0.0%  10.0ns     0.00B    0.0%    0.00B
Liu-Zhang positivity limiter        28.3k    100ms    4.6%  3.53μs   1.69KiB    1.7%    0.06B
  Zhang-Shu positivity limiter      28.3k   49.6ms    2.3%  1.75μs     0.00B    0.0%    0.00B
  calc cell averages                28.3k   35.9ms    1.7%  1.27μs     0.00B    0.0%    0.00B
  ~Liu-Zhang positivity limiter~    28.3k   13.0ms    0.6%   460ns   1.25KiB    1.2%    0.05B
  global cell-average limiter          12   1.48ms    0.1%   123μs      448B    0.4%    37.3B
calculate dt                        4.72k   17.7ms    0.8%  3.75μs     0.00B    0.0%    0.00B
analyze solution                        2   3.80ms    0.2%  1.90ms   96.2KiB   95.3%  48.1KiB
─────────────────────────────────────────────────────────────────────────────────────────────

@jlchan jlchan marked this pull request as ready for review June 24, 2026 02:40
@jlchan jlchan requested review from DanielDoehring and ranocha and removed request for ranocha June 24, 2026 02:47
@jlchan jlchan mentioned this pull request Jun 24, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant