Make pressure clipping in BoundaryModelDummyParticles optional#1143
Make pressure clipping in BoundaryModelDummyParticles optional#1143efaulhaber wants to merge 3 commits intotrixi-framework:mainfrom
BoundaryModelDummyParticles optional#1143Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1143 +/- ##
==========================================
- Coverage 89.19% 89.19% -0.01%
==========================================
Files 128 128
Lines 9919 9927 +8
==========================================
+ Hits 8847 8854 +7
- Misses 1072 1073 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR makes negative pressure clipping in BoundaryModelDummyParticles configurable so it can be disabled for closed-system simulations where clipping would be physically incorrect and can introduce artifacts.
Changes:
- Added a
clip_negative_pressurekeyword (defaulttrue) toBoundaryModelDummyParticlesand threaded it through the model type for compile-time branching. - Updated boundary pressure computation to conditionally clip negative pressures (both for state-equation-based pressure and Adami extrapolation).
- Added tests covering clipping on/off behavior and ensuring the setting survives
Adapt.adapt.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/schemes/boundary/wall_boundary/dummy_particles.jl |
Adds optional negative-pressure clipping to BoundaryModelDummyParticles with a static (type-parameter) flag used in pressure update paths. |
test/schemes/boundary/dummy_particles/dummy_particles.jl |
Adds unit tests validating clipping behavior for multiple density calculators and through Adapt.adapt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
What is supposed to happen when clipping in the state equation is activated and deactivated here? |
|
When clipping in the state equation is activated, then pressure is clipped everywhere and it cannot become negative anyway, except perhaps with Adami when the boundary is accelerated away from the fluid. |
|
But shouldn't this be an error than or warning? |
Why? Everything is working as expected. |
|
Because the inconsistency might be confusing. |
|
I don't see an inconsistency. Enable pressure clipping for the boundary model to clip boundary pressure. Enable pressure clipping of the state equation to enable global pressure clipping. |
|
Ok than just adjust the docstring also for state equation pressure clipping. |
Pressure clipping is not a correct formulation, it is just a workaround to avoid sticking artifacts.
Away from free surfaces it leads to artificially increased boundary pressures that cause larger gaps between fluid and boundary in areas of low pressure, against which the particle shifting technique is fighting.
This PR adds an option to disable clipping, which should be enabled for closed systems.