TrixiParticles.jl icon indicating copy to clipboard operation
TrixiParticles.jl copied to clipboard

More robust open boundaries I

Open LasNikas opened this issue 1 month ago • 1 comments

For geometries that expand downstream of the inflow, particle conversion may occasionally fail. This PR provides a fix for this issue.

In rare cases (likely when using relatively large timesteps), an inflow particle may lie outside the outer edge of the boundary zone at the moment of conversion. This can happen when the fluid domain widens rapidly. If such a particle is reset upstream during convert_particle!, it may be shifted outside the boundary zone. Because of this, it cannot be assigned to any boundary zone, yet it remains active—leading to an assertion failure.

The screenshots below show one of these cases. Left: The red region is the fluid domain after the transition face (blue). The yellow particle is the inflow particle that will be incorrectly reset in the next timestep.

Right: The fluid domain (red) and the inflow zone (blue) are shown again. The geometry expands significantly.

A schematic illustration of this situation is shown underneath.

Last frame before error inflow expansion
image image
image

LasNikas avatar Nov 26 '25 20:11 LasNikas

Codecov Report

:x: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 89.57%. Comparing base (d2cbee5) to head (a51c03e).

Files with missing lines Patch % Lines
src/schemes/boundary/open_boundary/system.jl 75.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #997      +/-   ##
==========================================
- Coverage   89.59%   89.57%   -0.02%     
==========================================
  Files         120      120              
  Lines        8579     8585       +6     
==========================================
+ Hits         7686     7690       +4     
- Misses        893      895       +2     
Flag Coverage Δ
total 89.57% <75.00%> (-0.02%) :arrow_down:
unit 64.77% <0.00%> (-0.05%) :arrow_down:

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

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

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

codecov[bot] avatar Nov 26 '25 21:11 codecov[bot]