Skip to content

Harden boundary_condition_slip_wall for Euler#3137

Open
jlchan wants to merge 7 commits into
trixi-framework:mainfrom
jlchan:jc/harden_euler_slip_wall
Open

Harden boundary_condition_slip_wall for Euler#3137
jlchan wants to merge 7 commits into
trixi-framework:mainfrom
jlchan:jc/harden_euler_slip_wall

Conversation

@jlchan

@jlchan jlchan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The implementation of boundary_condition_slip_wall for Euler takes the power of an expression when computing the intermediate pressure state.

p_star = p_local *
(1 + 0.5f0 * (equations.gamma - 1) * v_normal / sound_speed)^(2 *
equations.gamma *

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.

@github-actions

Copy link
Copy Markdown
Contributor

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

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@jlchan jlchan marked this pull request as ready for review July 10, 2026 03:45
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.84%. Comparing base (12f0483) to head (0c4d6e3).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
unittests 96.84% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanielDoehring DanielDoehring left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Comment thread src/equations/compressible_euler_1d.jl Outdated

@andrewwinters5000 andrewwinters5000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this fallback in the limiting vacuum situation.

Comment thread src/equations/compressible_euler_1d.jl Outdated
Comment thread src/equations/compressible_euler_2d.jl Outdated
Comment thread src/equations/compressible_euler_3d.jl Outdated
jlchan and others added 3 commits July 10, 2026 08:52
Co-authored-by: Andrew Winters <andrew.ross.winters@liu.se>
Co-authored-by: Daniel Doehring <doehringd2@gmail.com>
@jlchan

jlchan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

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)?

Yeah, v_normal would have to be larger relative to local Mach number. I think shock capturing tended to control things in previous cases. It is a bit odd to me that the naive mirror state imposition would just return (0, p * nx, p * ny, 0) independently of v_normal though.

@DanielDoehring

Copy link
Copy Markdown
Member

It is a bit odd to me that the naive mirror state imposition would just return (0, p * nx, p * ny, 0) independently of v_normal though.

Yeah that is also what I thought - maybe somewhere in the textbook some assumptions on v_normal are made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants