Skip to content

Add interface-aware surface pressure - #1283

Draft
svchb wants to merge 48 commits into
trixi-framework:mainfrom
svchb:integration/corrections-surface-method
Draft

svchb wants to merge 48 commits into
trixi-framework:mainfrom
svchb:integration/corrections-surface-method

Conversation

@svchb

@svchb svchb commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Stack status

This draft joins two prerequisite lines:

Merge commit a94de3ca4a joins #1282 onto the correction stack. The review delta after that join is 9da1756512 plus the integration-only test fix 2f001f3e76: 15 files, 469 insertions, and 21 deletions. The validation-only #1286 remains related but does not block this PR.

Summary

  • Add opt-in SurfacePressureDifference() support to WCSPH and EDAC through the surface_pressure keyword.
  • Blend the configured conservative pressure acceleration with a first-order consistent pressure-difference operator according to the target particle's surface_activity.
  • Restrict blending to interactions within the same fluid system; boundary and cross-fluid interactions remain conservative.
  • Support GradientCorrection and MixedKernelGradientCorrection, including the asymmetric corrected-pressure paths from the correction stack, and reject unsupported configurations.
  • Require a configured surface method so pressure blending uses the shared global surface-quantity lifecycle from Generalize free-surface detection #1282.
  • Keep transport-velocity pseudo-pressure shifting on its conservative path with use_surface_pressure=false.
  • Add metadata, documentation, examples, focused dynamic tests, and manufactured-solution validation.

Numerical behavior

The pressure-difference operator removes the constant-pressure free-surface defect. Where surface activity is nonzero, the blended operator is intentionally not pairwise momentum-conservative; boundary and cross-fluid interactions are not blended. The manufactured solution records this residual and confirms that it decreases under refinement.

Validation

  • Complete unit suite: 23,729 tests pass.
  • Pressure acceleration: 45/45.
  • Colorfield surface detection: 39/39.
  • Manufactured solution: approximately first-order boundary and second-order interior convergence; constant-pressure boundary error is zero and the momentum residual decreases under refinement.
  • JuliaFormatter 2.1.1 is idempotent.
  • git diff --check passes.

@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.93069% with 198 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.12%. Comparing base (6a56a72) to head (2f001f3).

Files with missing lines Patch % Lines
test/examples/gpu.jl 0.00% 154 Missing ⚠️
src/schemes/fluid/surface_normal_sph.jl 93.78% 12 Missing ⚠️
...rc/schemes/fluid/weakly_compressible_sph/system.jl 91.66% 6 Missing ⚠️
src/general/corrections.jl 95.06% 4 Missing ⚠️
src/schemes/fluid/pressure_acceleration.jl 93.33% 4 Missing ⚠️
src/general/custom_quantities.jl 62.50% 3 Missing ⚠️
src/preprocessing/particle_packing/system.jl 50.00% 3 Missing ⚠️
src/schemes/fluid/surface_tension.jl 89.65% 3 Missing ⚠️
src/schemes/structure/structure.jl 81.25% 3 Missing ⚠️
...chemes/fluid/implicit_incompressible_sph/system.jl 89.47% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1283      +/-   ##
==========================================
- Coverage   90.49%   90.12%   -0.38%     
==========================================
  Files         141      150       +9     
  Lines       11419    12714    +1295     
==========================================
+ Hits        10334    11458    +1124     
- Misses       1085     1256     +171     
Flag Coverage Δ
total 90.12% <86.93%> (-0.38%) ⬇️
unit 81.53% <86.07%> (+3.70%) ⬆️

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.

svchb added 22 commits August 16, 2026 13:48
Fix conflicts in EDAC and WCSPH RHS:
- adopt mapreduce_neighbor / add_dv_* functional API from origin/main
- preserve gradient/force correction splitting from stack (gradient_correction for pressure/shifting, force_correction for free-surface)
…tion-pressure-conservation

# Conflicts:
#	src/schemes/fluid/entropically_damped_sph/rhs.jl
#	src/schemes/fluid/weakly_compressible_sph/rhs.jl
#	src/schemes/structure/structure.jl
…ion' into fix/asymmetric-correction-pressure-conservation

# Conflicts:
#	src/general/corrections.jl
#	src/schemes/fluid/entropically_damped_sph/rhs.jl
#	src/schemes/fluid/weakly_compressible_sph/rhs.jl
#	test/general/corrections.jl
#	test/general/corrections/gradient.jl
#	test/general/corrections/kernel.jl
svchb added 16 commits August 31, 2026 16:12
…orrection-configuration

# Conflicts:
#	src/schemes/fluid/entropically_damped_sph/rhs.jl
#	src/schemes/fluid/weakly_compressible_sph/rhs.jl
#	src/schemes/structure/structure.jl
…t-correction-configuration

# Conflicts:
#	src/schemes/structure/structure.jl
#	test/general/corrections/common.jl
# Conflicts:
#	NEWS.md
#	docs/src/systems/fluid.md
#	src/general/custom_quantities.jl
#	src/schemes/fluid/surface_tension.jl
#	test/systems/edac_system.jl
# Conflicts:
#	examples/fluid/dam_break_2d.jl
#	examples/fluid/dam_break_oil_film_2d.jl
#	src/general/semidiscretization.jl
#	src/schemes/fluid/entropically_damped_sph/system.jl
#	src/schemes/fluid/implicit_incompressible_sph/system.jl
#	src/schemes/fluid/weakly_compressible_sph/system.jl
#	test/examples/gpu.jl
@svchb
svchb force-pushed the integration/corrections-surface-method branch from f160706 to 2f001f3 Compare September 2, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant