Skip to content

Fix structure-fluid interaction force - #1348

Merged
svchb merged 9 commits into
trixi-framework:mainfrom
efaulhaber:fix-fsi
Oct 5, 2026
Merged

svchb merged 9 commits into
trixi-framework:mainfrom
efaulhaber:fix-fsi

Conversation

@efaulhaber

Copy link
Copy Markdown
Member

No description provided.

@efaulhaber efaulhaber self-assigned this Oct 5, 2026
@efaulhaber efaulhaber added the bug Something isn't working label Oct 5, 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

Centralize fluid momentum-force calculations so structure-fluid interactions reuse the same pressure, viscosity, and adhesion logic; exclude shifting terms from forces applied to structures; and add force-conservation coverage for fluid-structure pairs.

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/schemes/fluid/rhs.jl Resolved
Comment thread test/schemes/fluid/rhs.jl Resolved
Comment thread src/schemes/structure/structure.jl Resolved
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.61%. Comparing base (8b63e1a) to head (1948598).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/schemes/structure/structure.jl 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1348      +/-   ##
==========================================
+ Coverage   90.51%   90.61%   +0.10%     
==========================================
  Files         143      143              
  Lines       11439    11492      +53     
==========================================
+ Hits        10354    10414      +60     
+ Misses       1085     1078       -7     
Flag Coverage Δ
total 90.61% <98.66%> (+0.10%) ⬆️
unit 78.14% <98.66%> (+0.34%) ⬆️

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.

@efaulhaber
efaulhaber marked this pull request as ready for review October 5, 2026 09:57
@efaulhaber
efaulhaber requested a review from svchb October 5, 2026 09:57
Comment thread src/schemes/structure/structure.jl Resolved
Comment thread test/schemes/fluid/rhs.jl Resolved
Comment thread src/schemes/structure/structure.jl Resolved
Comment thread src/schemes/structure/structure.jl Resolved
@svchb
svchb self-requested a review October 5, 2026 16:36
@svchb

svchb commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

/run-gpu-tests

@svchb
svchb enabled auto-merge (squash) October 5, 2026 17:38
@svchb
svchb merged commit cc7a205 into trixi-framework:main Oct 5, 2026
17 checks passed
@efaulhaber
efaulhaber deleted the fix-fsi branch October 6, 2026 05:31
RubberLanding pushed a commit to RubberLanding/TrixiParticles.jl that referenced this pull request Nov 12, 2026
Bring in the remaining 30 upstream commits up to 3c5005e on top of the
40 commits on this branch. This completes the follow-up to d1448a5,
which stopped at 6a56a72.

Upstream changes that affected refinement:
- `drift!`, `kick!` and related code moved from semidiscretization.jl
  to general/ode_rhs.jl and general/time_integration.jl (trixi-framework#1060)
- `add_momentum_equation` is shared by the fluid and structure
  interactions (trixi-framework#1348, trixi-framework#1338)
- `almostzero` is now a function of the smoothing length (trixi-framework#1349)
- The quadratic term in `ArtificialViscosityMonaghan` changed sign
  (trixi-framework#1295). The refinement viscosity methods wrap `add_dv_viscosity`, so
  they pick up the fix without changes.
- Custom quantity code moved to src/custom_quantities
- TimerOutputs 1.2 and TrixiBase 0.2 are now required. Existing
  environments need `Pkg.update`, because `Pkg.resolve` keeps the old
  pinned versions and fails.

Conflicts resolved:
- src/TrixiParticles.jl
- src/general/semidiscretization.jl
- src/schemes/boundary/open_boundary/rhs.jl
- src/schemes/fluid/entropically_damped_sph/rhs.jl
- src/schemes/fluid/weakly_compressible_sph/rhs.jl
- src/util.jl

Adaptations beyond the conflict markers:
- Keep upstream's EDAC `add_momentum_equation` and `pressure_evolution!`
  unchanged, and add methods that also take both kernel gradients and
  the refinement. Without refinement, they forward to the upstream
  methods. With refinement, they apply the scaled pressures and `beta`.
- Replace `evaluate_pressure_terms` with `scaled_pressures`. Compute
  `beta` and the shifting velocity in the refinement methods, so that
  the EDAC loop no longer passes them around.
- Move `set_zero!(du_ode)` into `drift!` in general/ode_rhs.jl.
- Remove the `::AbstractSystem` restriction from
  `initial_smoothing_length`. Upstream's `check_smoothing_kernel_fsi`
  also calls it with boundary models.
- Replace the local `sqrt(eps(h_w^2))` threshold in the refinement wall
  boundary code with `almostzero(h_w)`. The threshold is now
  `sqrt(eps(typeof(h_w))) * h_w`. This is the same order of magnitude
  but not identical, and it only matters for particles almost exactly
  on top of each other.
- Use upstream's "Skip neighbors" comment in the open boundary and WCSPH
  rhs.
- Double `particle_spacing` in taylor_green_vortex_2d_refinement.jl
  from 0.025 to 0.05.
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