Skip to content

Implement Tensile Instability Control (TIC)#769

Merged
svchb merged 19 commits intotrixi-framework:mainfrom
efaulhaber:tensile-instability-correction
May 18, 2025
Merged

Implement Tensile Instability Control (TIC)#769
svchb merged 19 commits intotrixi-framework:mainfrom
efaulhaber:tensile-instability-correction

Conversation

@efaulhaber
Copy link
Copy Markdown
Member

This is an undocumented feature until we figure out when and if it is useful.
So far, it is not useful alone:
grafik

But it might be useful in addition to PST.

Note that, just like PST, this does not work at free surfaces.

@efaulhaber efaulhaber added the enhancement New feature or request label Apr 14, 2025
@efaulhaber efaulhaber self-assigned this Apr 14, 2025
@efaulhaber efaulhaber requested review from LasNikas and svchb April 14, 2025 12:00
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2025

Codecov Report

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

Project coverage is 70.68%. Comparing base (13694fc) to head (087b500).

Files with missing lines Patch % Lines
src/schemes/fluid/pressure_acceleration.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #769      +/-   ##
==========================================
- Coverage   70.70%   70.68%   -0.03%     
==========================================
  Files         106      106              
  Lines        6701     6703       +2     
==========================================
  Hits         4738     4738              
- Misses       1963     1965       +2     
Flag Coverage Δ
unit 70.68% <33.33%> (-0.03%) ⬇️

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.

@svchb
Copy link
Copy Markdown
Collaborator

svchb commented Apr 15, 2025

@efaulhaber Is there any point in adding that then? The function is not used anywhere.

@efaulhaber
Copy link
Copy Markdown
Member Author

The point is that we can experiment with it. For example, Niklas can try using PST + TIC for the high-res vortex street he's having problems with.

@svchb
Copy link
Copy Markdown
Collaborator

svchb commented Apr 15, 2025

But do we need to merge it than without documentation? He can try this like it is.

@efaulhaber
Copy link
Copy Markdown
Member Author

It's easier to try it if you don't need an extra branch for it. I don't really see a downside of merging this, as it's a very small and non-invasive change.

Comment thread src/schemes/fluid/pressure_acceleration.jl Outdated
Comment thread src/schemes/fluid/pressure_acceleration.jl Outdated
Comment thread src/schemes/fluid/pressure_acceleration.jl Outdated
@efaulhaber
Copy link
Copy Markdown
Member Author

efaulhaber commented May 12, 2025

The point is that we can experiment with it. For example, Niklas can try using PST + TIC for the high-res vortex street he's having problems with.

I experimented with this and it is indeed solving the high resolution issues. Top is PST and bottom PST + TIC, left and right are the same setup, just a different resolution.

out_highres.mp4

I will try @svchb's symmetric version, and then I'll make this public API and add docs and tests.

@efaulhaber
Copy link
Copy Markdown
Member Author

Update: The symmetric version (top panel) is not stable.

grafik

This is shortly before the symmetric version is crashing:
grafik

Here is the code again, so it doesn't get lost in the conversations:

@inline function tensile_instability_correction_sym(m_a, m_b, rho_a, rho_b, p_a, p_b, W_a)
    # Use absolute values of pressure so that negative pressures (tension)
    # also contribute repulsively, preventing unphysical clustering.
    p_abs = abs(p_a) + abs(p_b)
    return -m_b * p_abs / (rho_a * rho_b) * W_a
end

@svchb
Copy link
Copy Markdown
Collaborator

svchb commented May 12, 2025

Yes that was the likely result probably if its conservative its not allowing some loss in energy necessary for it to work.

@efaulhaber
Copy link
Copy Markdown
Member Author

# Note: This should only be applied for the fluid-fluid interaction for non-free surface flows!

@svchb where did you get the information from that this is not supposed to be used for fluid-boundary interaction? I don't find any mention of this in any of the papers.

@efaulhaber
Copy link
Copy Markdown
Member Author

efaulhaber commented May 12, 2025

I just tried TIC only for fluid-fluid interaction and the regular (p_a + p_b) formulation for fluid-boundary interaction, and I got this. Top is no TIC for fluid-boundary, bottom is TIC for everything.
I would say that is clearly showing that we need TIC for both.

out_highres_nobnd.mp4

@svchb
Copy link
Copy Markdown
Collaborator

svchb commented May 12, 2025

So TIC should only be applied for dummy boundaries and MK bnd need to be excluded.

@efaulhaber
Copy link
Copy Markdown
Member Author

MK boundaries use a special "pressure acceleration" anyway, so we don't need to change anything.

@efaulhaber efaulhaber changed the title Implement Tensile Instability Correction (TIC) Implement Tensile Instability Control (TIC) May 15, 2025
@efaulhaber efaulhaber requested a review from svchb May 15, 2025 15:33
@efaulhaber
Copy link
Copy Markdown
Member Author

/run-gpu-tests

Comment thread docs/src/systems/weakly_compressible_sph.md Outdated
Comment thread docs/src/systems/weakly_compressible_sph.md
Comment thread src/schemes/fluid/weakly_compressible_sph/system.jl
@efaulhaber efaulhaber requested a review from LasNikas May 16, 2025 15:08
LasNikas
LasNikas previously approved these changes May 17, 2025
Comment thread docs/src/systems/weakly_compressible_sph.md Outdated
Comment thread docs/src/systems/weakly_compressible_sph.md Outdated
Co-authored-by: Sven Berger <berger.sven@gmail.com>
@efaulhaber efaulhaber requested a review from svchb May 18, 2025 08:48
@svchb
Copy link
Copy Markdown
Collaborator

svchb commented May 18, 2025

/run-gpu-tests

svchb
svchb previously approved these changes May 18, 2025
@efaulhaber efaulhaber requested a review from svchb May 18, 2025 08:58
@LasNikas
Copy link
Copy Markdown
Collaborator

\run-gpu-tests

Copy link
Copy Markdown
Collaborator

@svchb svchb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/run-gpu-tests

@svchb svchb enabled auto-merge (squash) May 18, 2025 13:23
@svchb
Copy link
Copy Markdown
Collaborator

svchb commented May 18, 2025

/run-gpu-tests

@svchb svchb merged commit 952d92a into trixi-framework:main May 18, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants