Skip to content

Fix open boundaries with periodic boundary zone#1237

Open
efaulhaber wants to merge 7 commits into
trixi-framework:mainfrom
efaulhaber:fix-periodic-inoutflow
Open

Fix open boundaries with periodic boundary zone#1237
efaulhaber wants to merge 7 commits into
trixi-framework:mainfrom
efaulhaber:fix-periodic-inoutflow

Conversation

@efaulhaber

Copy link
Copy Markdown
Member

When simulating periodic boundaries top/bottom and open boundaries left/right, the boundary zones are periodic in tangential direction. This doesn't work on main, as fluid particles that passed through the periodic boundary (in the screenshot below particles from the bottom that appear at the top) don't get converted when entering the boundary zone.

Note the orphaned fluid particles at the top in this screenshot.
grafik

@efaulhaber efaulhaber self-assigned this Jun 23, 2026
@efaulhaber efaulhaber added the bug Something isn't working label Jun 23, 2026

@efaulhaber efaulhaber left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Codex Review

The PR updates open-boundary particle classification and transfer to use periodic coordinates, with a regression test covering conversion near a periodic boundary. I did not identify correctness or regression issues in the changed production behavior.

This is an AI-generated code review. Please verify the findings and summary before acting on them.
Review generated by codex-pr-review

Comment thread test/systems/open_boundary_system.jl
@efaulhaber efaulhaber marked this pull request as ready for review July 3, 2026 13:35
@efaulhaber efaulhaber requested review from LasNikas and svchb July 3, 2026 13:35
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (64fd356) to head (622caa6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1237   +/-   ##
=======================================
  Coverage   90.13%   90.13%           
=======================================
  Files         138      138           
  Lines       10797    10801    +4     
=======================================
+ Hits         9732     9736    +4     
  Misses       1065     1065           
Flag Coverage Δ
total 90.14% <100.00%> (+<0.01%) ⬆️
unit 76.10% <100.00%> (+0.06%) ⬆️

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.

Comment on lines +553 to +554
particle_coords = current_coords(u_old, system_old, particle_old)
particle_coords = PointNeighbors.periodic_coords(particle_coords, periodic_box)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these coords should have different names

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

or just move the first line inside like in the other places

Comment on lines +197 to +199
@test TrixiParticles.is_in_boundary_zone(outflow,
SVector(Tuple(u_open_boundary[:,
particle_new])))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@test TrixiParticles.is_in_boundary_zone(outflow,
SVector(Tuple(u_open_boundary[:,
particle_new])))
@test TrixiParticles.is_in_boundary_zone(
outflow,
PointNeighbors.periodic_coords(SVector(Tuple(u_open_boundary[:, particle_new])),
periodic_box)
)

Comment on lines +511 to +512
particle_coords = PointNeighbors.periodic_coords(current_coords(u, system, particle),
periodic_box)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
particle_coords = PointNeighbors.periodic_coords(current_coords(u, system, particle),
periodic_box)

v, u, v_fluid, u_fluid)
v, u, v_fluid, u_fluid, periodic_box)
# Position relative to the origin of the transition face
relative_position = current_coords(u, system, particle) - boundary_zone.zone_origin

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
relative_position = current_coords(u, system, particle) - boundary_zone.zone_origin
particle_coords = PointNeighbors.periodic_coords(current_coords(u, system, particle),
periodic_box)
relative_position = current_coords(u, system, particle) - boundary_zone.zone_origin

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants