-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assure conservation for SSP scheme #1640
Assure conservation for SSP scheme #1640
Conversation
Review checklistThis 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 ❤️ by the Trixi.jl community. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't believe that it was this, that this was the straw that broke the camel's back 😱 Great catch! Just two suggestions to improve clarity, then it can be merged (or ignore the suggestions and we merge it as it is)
Yes, I felt the same way. Thanks to you for sending me the working code (even I checked it before). It animated me again to just copy their complete code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
One thing I forgot to say: What's missing in the code right now is a comment explaining why you did have to implement it the way you did, with a reference to this PR. You can either do it here (if the PR hasn't automerged by then), or in any of your subsequent PRs. |
This PR corrects the implementation of the SSPRK33 method. It mimics the implementation of OrdinaryDiffEq.jl to guarantee conservation.
Before, the convex combination of the third stage of SSP33 looked like:
@. integrator.u = 1/3 * integrator.r0 + 2/3 * integrator.u
This led to problems with conservation in machine precision. The errors in conservation grow slightly over time:
Now, with using
@. integrator.u = (1 * integrator.r0 + 2 * integrator.u) / 3
the errors level off.These are results of a blast wave simulation with 64x64 elements using positivity subcell limiting for density.