Skip to content

Averaged inflow velocity #833

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

LasNikas
Copy link
Collaborator

@LasNikas LasNikas commented Jun 15, 2025

The animation below shows a pulse wave propagation scenario (with reference_pressure_in = 5000 and reference_pressure_out = 0). In the upper part, the simulation is performed without averaging the extrapolated inflow velocity. In the lower part, the same simulation is shown, but with the inflow velocity averaged, leading to a more stable simulation.

When no velocity is prescribed at the inflow, the velocity is extrapolated from the fluid domain.
Thus, turbulent flows near the inflow can lead to non-uniform buffer-particles distribution, resulting in a potential numerical instability. Averaging mitigates these effects.

# Without averaged inflow velocity
trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "pipe_flow_2d.jl");
              open_boundary_layers=14, domain_size=(2.0, 0.4), tspan=(0.0, 2.0),
              open_boundary_model=BoundaryModelTafuni(),
              pressure=0.0, wcsph=true, particle_spacing=0.02,
              saving_callback=SolutionSavingCallback(dt=5e-3, prefix=""),
              particle_shifting=ParticleShiftingCallback(),
              average_inflow_velocity=false,
              reference_velocity_in=nothing, reference_density_in=nothing,
              reference_velocity_out=nothing, reference_density_out=nothing,
              reference_pressure_in=5000, reference_pressure_out=0)

# With averaged inflow velocity
trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "pipe_flow_2d.jl");
              open_boundary_layers=14, domain_size=(2.0, 0.4), tspan=(0.0, 2.0),
              open_boundary_model=BoundaryModelTafuni(),
              pressure=0.0, wcsph=true, particle_spacing=0.02,
              saving_callback=SolutionSavingCallback(dt=5e-3, prefix="averaged"),
              particle_shifting=ParticleShiftingCallback(),
              average_inflow_velocity=true,
              reference_velocity_in=nothing, reference_density_in=nothing,
              reference_velocity_out=nothing, reference_density_out=nothing,
              reference_pressure_in=5000, reference_pressure_out=0)
averaged_velocity_.mp4

Snapshot after 1.5 sec: highlighting more stable simulation even with no-slip BC
(the simulation without averaged inflow velocity fails at 0.11 sec).
image

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.49%. Comparing base (785ade6) to head (5eaa528).

Files with missing lines Patch % Lines
src/schemes/boundary/open_boundary/mirroring.jl 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #833      +/-   ##
==========================================
+ Coverage   70.43%   70.49%   +0.05%     
==========================================
  Files         106      106              
  Lines        6867     6884      +17     
==========================================
+ Hits         4837     4853      +16     
- Misses       2030     2031       +1     
Flag Coverage Δ
unit 70.49% <88.88%> (+0.05%) ⬆️

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.

@LasNikas LasNikas marked this pull request as ready for review June 17, 2025 19:24
@LasNikas LasNikas requested review from efaulhaber and svchb June 17, 2025 19:24
@LasNikas LasNikas self-assigned this Jun 18, 2025
@LasNikas
Copy link
Collaborator Author

/run-gpu-tests

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