Make pressure clipping in BoundaryModelDummyParticles optional#1143
Make pressure clipping in BoundaryModelDummyParticles optional#1143efaulhaber merged 14 commits intotrixi-framework:devfrom
BoundaryModelDummyParticles optional#1143Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1143 +/- ##
==========================================
- Coverage 89.03% 89.03% -0.01%
==========================================
Files 128 128
Lines 10032 10040 +8
==========================================
+ Hits 8932 8939 +7
- Misses 1100 1101 +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. |
39f91ec to
2d60da5
Compare
2d60da5 to
f96828b
Compare
svchb
left a comment
There was a problem hiding this comment.
- Add a similar note to state equation
- add a test for the mixed stateequation/boundary clipping
|
/run-gpu-tests |
|
/run-gpu-tests |
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.