trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
505 stars 98 forks source link

Mean value in Zhang-Shu limiter on curved meshes #1945

Closed andrewwinters5000 closed 1 month ago

andrewwinters5000 commented 1 month ago

This is a bug fix where all mesh types other than TreeMesh should compute the solution mean value u_mean including the element Jacobians. If this is not done, it is possible to lose conservation. Typically, the values from extra_analysis_errors = (:conservation_error,) in the AnalysisCallback should stay between 1e-13 to 1e-15. However, when one computes the incorrect value for u_mean on a curved mesh these conservation errors might increase to something between 1e-4 to 1e-8 (depending on the setup, how often the limiter is called, and how "warped" the mesh elements are).

github-actions[bot] commented 1 month ago

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

Code quality

Documentation

Testing

Performance

Verification

Created with :heart: by the Trixi.jl community.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 96.15%. Comparing base (6e5ff49) to head (9a1d999).

Files Patch % Lines
src/solvers/dgsem_structured/dg.jl 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1945 +/- ## ========================================== - Coverage 96.15% 96.15% -0.00% ========================================== Files 454 454 Lines 36496 36509 +13 ========================================== + Hits 35092 35103 +11 - Misses 1404 1406 +2 ``` | [Flag](https://app.codecov.io/gh/trixi-framework/Trixi.jl/pull/1945/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/trixi-framework/Trixi.jl/pull/1945/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework) | `96.15% <88.24%> (-<0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.