-
Notifications
You must be signed in to change notification settings - Fork 105
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
Remove normal_direction_ll
for nonconservative terms
#2062
base: main
Are you sure you want to change the base?
Remove normal_direction_ll
for nonconservative terms
#2062
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. |
As expected changing the normal directions caused slightly different results and with that some failing mhd tests. For validation I additionally ran convergence tests using
Looking at these results, I think it would be fine to introduce the averaged normal direction and update the test values. Another open problem is that the test |
Thanks for testing it out in Since the test is failing due to domain error (negative density or pressure) I think it's a real failure. My guess is that it's related to the boundary condition imposition Trixi.jl/src/solvers/dgmulti/dg.jl Lines 555 to 560 in aaf0166
since all the other MHD tests still pass. |
That makes sense. I just looked at the boundary conditions that are used in the elixir and noticed that I will try to replace this with
|
@patrickersing looks like your new |
normal_direction_ll
for nonconservative termsnormal_direction_ll
for nonconservative terms
Once this is ready to go we can schedule the next breaking release 0.9, cf. #1997 |
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.
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.
It looks good. I leave here only a couple of comments.
@@ -71,14 +71,14 @@ struct BoundaryConditionDoNothing end | |||
orientation_or_normal_direction, | |||
direction::Integer, x, t, surface_flux, | |||
equations) | |||
return flux(u_inner, orientation_or_normal_direction, equations) | |||
return surface_flux(u_inner, u_inner, orientation_or_normal_direction, equations) |
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.
Why do we need to use surface_flux
here? isn't that adding computational complexity for the same output?
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.
This became necessary, since we now also apply the boundary condition for nonconservative terms.
When you call BoundaryConditionDoNothing
with nonconservative terms, the old implementation still evaluates the inner flux
instead of the inner nonconservative term. Therefore, we erroneously impose the conservative flux twice.
For conservative fluxes this increases the computational complexity, but the modification is necessary to return a consistent boundary condition for both conservative and nonconservative terms.
end | ||
|
||
# This version can be called by hyperbolic solvers on unstructured, curved meshes | ||
@inline function (::BoundaryConditionDoNothing)(u_inner, | ||
outward_direction::AbstractVector, | ||
x, t, surface_flux, equations) | ||
return flux(u_inner, outward_direction, equations) | ||
return surface_flux(u_inner, u_inner, outward_direction, equations) |
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.
Same as above
contravariant vector (normal direction) at the current node and the averaged | ||
one. This is different from numerical fluxes used to discretize conservative | ||
terms. | ||
## References |
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.
It should be mentioned here that this term is not exactly equivalent to the one proposed by Bohm et al., as the "metrics dealiasing" is done in a different manner.
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 added an additional comment about this to the docstring in 95d846a
contravariant vector (normal direction) at the current node and the averaged | ||
one. This is different from numerical fluxes used to discretize conservative | ||
terms. | ||
## References |
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.
Same as above
A lot of tests fail. Could you please check what's going on? |
Most tests are failing, because we get slightly different results with the averaged normal direction. Since there haven't been any objections, I will proceed and update the reference values to fix the tests. To fix the downstream test for |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2062 +/- ##
==========================================
- Coverage 96.34% 96.34% -0.00%
==========================================
Files 470 470
Lines 37497 37495 -2
==========================================
- Hits 36125 36123 -2
Misses 1372 1372
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@amrueda Could you please review this PR again? |
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.
Could you please add some NEWS.md?
@amrueda There are still some open conversations from your review. Could you please have a look at them? |
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!
This PR simplifies the nonconservative terms to only depend on a single averaged
normal_direction
, instead of bothnormal_direction_average
andnormal_direction_ll
(see #2049).This should also enable setting boundary conditions for nonconservative terms #1445