Harden boundary_condition_slip_wall for Euler#3137
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3137 +/- ##
=======================================
Coverage 96.84% 96.84%
=======================================
Files 662 662
Lines 51197 51206 +9
=======================================
+ Hits 49579 49588 +9
Misses 1618 1618
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DanielDoehring
left a comment
There was a problem hiding this comment.
Interesting that this did not cause problems before - if this goes below zero, its means that v_normal is quite negative, right? This somewhat smells a bit like that the boundary condition is not imposed "strong enough" (due to a too-coarse mesh)?
| (1 + 0.5f0 * (equations.gamma - 1) * v_normal / sound_speed)^(2 * | ||
| equations.gamma * | ||
| equations.inv_gamma_minus_one) | ||
| base = (1 + 0.5f0 * (equations.gamma - 1) * v_normal / sound_speed) |
There was a problem hiding this comment.
| base = (1 + 0.5f0 * (equations.gamma - 1) * v_normal / sound_speed) | |
| p_scaling_base = (1 + 0.5f0 * (equations.gamma - 1) * v_normal / sound_speed) |
Maybe a bit more verbose? I am thinking mostly about the case that someone searches for "base", expects something mesh related and then ends up here
andrewwinters5000
left a comment
There was a problem hiding this comment.
Thanks for adding this fallback in the limiting vacuum situation.
| if base >= 0 | ||
| p_star = p_local * | ||
| base^(2 * equations.gamma * equations.inv_gamma_minus_one) | ||
| else # avoid taking powers of if base < 0 |
There was a problem hiding this comment.
| else # avoid taking powers of if base < 0 | |
| else # avoid taking powers if base < 0 |
| if base >= 0 | ||
| p_star = p_local * | ||
| base^(2 * equations.gamma * equations.inv_gamma_minus_one) | ||
| else # avoid taking powers of if base < 0 |
There was a problem hiding this comment.
| else # avoid taking powers of if base < 0 | |
| else # avoid taking powers if base < 0 |
| if base >= 0 | ||
| p_star = p_local * | ||
| base^(2 * equations.gamma * equations.inv_gamma_minus_one) | ||
| else # avoid taking powers of if base < 0 |
There was a problem hiding this comment.
| else # avoid taking powers of if base < 0 | |
| else # avoid taking powers if base < 0 |
The implementation of
boundary_condition_slip_wallfor Euler takes the power of an expression when computing the intermediate pressure state.Trixi.jl/src/equations/compressible_euler_1d.jl
Lines 257 to 259 in 12f0483
However, this can be negative, resulting in an error being thrown. This PR hardens this by setting the intermediate pressure state to zero when this happens. This hardening retains entropy stability based on the analysis in https://arxiv.org/abs/1901.04924
This modification was necessary for running the Mach 3 cylinder with no shock capturing and Liu-Zhang positivity limiting.