Liu-Zhang cell average limiter (part 2, Euler, CNS)#3066
Open
jlchan wants to merge 188 commits into
Open
Conversation
minor export
formatting
… jc/draft_liu_zhang_limiter
TODO: remove later
replaces cell_average_violates_bounds
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.
The Liu-Zhang limiter is activated 10 times, with an iteration history of |
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)The limiter is activated 12 times with iteration counts 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
───────────────────────────────────────────────────────────────────────────────────────────── |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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_setforCompressibleEulerEquations1D/2Ddescribed 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:
P4estMesh, so I think we should defer it for Liu-Zhang part 3 #3100)