Skip to content

Add shifting for InFlow-buffer particles #768

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LasNikas
Copy link
Collaborator

I ran a simulation with a step in the transition zone (see image below). This step induced periodic gaps in the buffer zone which didn't decay. Indeed, the opposite is the case. The simulation is becoming unstable.

image

So the workaround is to shift not only the fluid particles but also the buffer particles.
I only shift particles that are in the vicinity of the transition plane.

Left: No shifting of buffer particle. Right: Shifted buffer particles
image

@LasNikas LasNikas added the enhancement New feature or request label Apr 11, 2025
@LasNikas LasNikas requested review from svchb and efaulhaber April 11, 2025 15:32
@LasNikas LasNikas self-assigned this Apr 11, 2025
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 2.12766% with 46 lines in your changes missing coverage. Please review.

Project coverage is 70.22%. Comparing base (114a57b) to head (683b09c).

Files with missing lines Patch % Lines
src/callbacks/particle_shifting.jl 0.00% 44 Missing ⚠️
src/schemes/boundary/open_boundary/system.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #768      +/-   ##
==========================================
- Coverage   70.60%   70.22%   -0.38%     
==========================================
  Files         106      106              
  Lines        6769     6804      +35     
==========================================
- Hits         4779     4778       -1     
- Misses       1990     2026      +36     
Flag Coverage Δ
unit 70.22% <2.12%> (-0.38%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@efaulhaber efaulhaber left a comment

Choose a reason for hiding this comment

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

Can you just cut off the shifting at a point? Is this stable? Or should this be a smooth transition from shifting to no shifting?

Comment on lines 168 to 169
for neighbor in PointNeighbors.eachneighbor(particle_coords,
neighborhood_search)
Copy link
Member

Choose a reason for hiding this comment

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

  1. This is not public API.
  2. This is not available for every NHS implementation.

I see two options:

  1. Use foreach_point_neighbor and skip all particle-neighbor pairs with particle outside the max distance (benchmark performance and compare with this function here).
  2. If this is not fast enough, we can make foreach_neighbor public API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The first option is not an option, because their exists no NHS for OpenBoundarySPHSystems.
Buffer particles don't need to interact with other particles or with itself.
I like the second option

Copy link
Member

@efaulhaber efaulhaber Apr 14, 2025

Choose a reason for hiding this comment

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

Buffer particles don't need to interact with other particles or with itself.

You are just implementing an interaction between buffer particles and other particles.

You can't just use another NHS and assume it works for a different set of particles. This is what PointNeighbors.requires_update is for.

@LasNikas
Copy link
Collaborator Author

Can you just cut off the shifting at a point? Is this stable? Or should this be a smooth transition from shifting to no shifting?

Yes, because these buffer particles don't calculate their physical properties physically but extrapolate (Tafuni) them or determine them with a model (Lastiwka). Here, the shifting acts basically as a rearrangement of the position of the particles.

@LasNikas LasNikas marked this pull request as draft June 8, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants