Skip to content
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

Implement Morris surface tension model #584

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

Conversation

svchb
Copy link
Collaborator

@svchb svchb commented Jul 29, 2024

Depends on #539
Depends on #604
Depends on #605
Depends on #606
Depends on #607
Depends on #608
Depends on #609
Depends on #599
super seeds #523

@svchb svchb marked this pull request as draft July 29, 2024 12:54
@svchb svchb added the enhancement New feature or request label Jul 29, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 70.48611% with 85 lines in your changes missing coverage. Please review.

Project coverage is 70.22%. Comparing base (1c537fd) to head (cc14ce5).

Files with missing lines Patch % Lines
src/schemes/fluid/surface_tension.jl 58.62% 24 Missing ⚠️
src/visualization/write2vtk.jl 0.00% 18 Missing ⚠️
src/schemes/fluid/fluid.jl 28.57% 10 Missing ⚠️
...rc/schemes/fluid/entropically_damped_sph/system.jl 20.00% 8 Missing ⚠️
src/general/semidiscretization.jl 72.72% 6 Missing ⚠️
src/preprocessing/particle_packing/system.jl 0.00% 6 Missing ⚠️
...rc/schemes/fluid/weakly_compressible_sph/system.jl 70.58% 5 Missing ⚠️
src/schemes/fluid/surface_normal_sph.jl 94.36% 4 Missing ⚠️
src/general/system.jl 66.66% 2 Missing ⚠️
src/schemes/boundary/system.jl 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #584      +/-   ##
==========================================
- Coverage   70.53%   70.22%   -0.31%     
==========================================
  Files          96       96              
  Lines        5976     6143     +167     
==========================================
+ Hits         4215     4314      +99     
- Misses       1761     1829      +68     
Flag Coverage Δ
unit 70.22% <70.48%> (-0.31%) ⬇️

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.

svchb added a commit to svchb/TrixiParticles.jlOpen that referenced this pull request Sep 27, 2024
svchb added a commit to svchb/TrixiParticles.jlOpen that referenced this pull request Sep 27, 2024
This was referenced Oct 7, 2024
svchb added 20 commits October 22, 2024 19:08
Conflicts:
	src/schemes/fluid/entropically_damped_sph/rhs.jl
	src/schemes/fluid/entropically_damped_sph/system.jl
	src/schemes/fluid/weakly_compressible_sph/system.jl
	test/schemes/fluid/fluid.jl
Conflicts:
	src/schemes/fluid/entropically_damped_sph/system.jl
	test/examples/examples.jl
Conflicts:
	src/schemes/fluid/entropically_damped_sph/system.jl
Conflicts:
	test/examples/examples.jl
Conflicts:
	test/examples/examples.jl
@svchb svchb requested a review from efaulhaber February 12, 2025 23:10

### Features

- Adds the classic **Continuum Surface Force (CSF)** model based on Morris 2000 (#584), which computes
Copy link
Member

Choose a reason for hiding this comment

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

Why bold? Nothing else is bold in this file.


### Artificial (numerical) viscosity

- Goal: Stabilize the simulation, capture shocks, and prevent unphysical particle interpenetration.
Copy link
Member

Choose a reason for hiding this comment

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

  1. What do you mean by unphysical particle interpenetration?
  2. It should be mentioned that this is mostly used when modeling inviscid flow to stabilize the simulation and not to add physical viscosity. Also that we usually want to add as little artificial viscosity as possible to stabilize the simulation but not to change the physical behavior.


- Goal: Stabilize the simulation, capture shocks, and prevent unphysical particle interpenetration.
- Method: Adds a dissipative (artificial) term to the momentum equations.
- Typical Use: High-speed flows with strong shocks, astrophysical simulations, or situations where numerical damping is needed for stability.
Copy link
Member

Choose a reason for hiding this comment

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

Is there any situation where we would use a fluid without any kind of viscosity? If not, the typical use is all simulations where we want to model inviscid flow.


- Goal: Model the actual viscous stresses of a fluid, aligned with a target Reynolds number or experimentally measured fluid properties.
- Method: Introduces a force consistent with the Navier–Stokes viscous stress term.
- Typical Use: Low-speed, incompressible or weakly compressible flows where matching real fluid behavior is important.
Copy link
Member

Choose a reason for hiding this comment

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

Artificial viscosity is often used for low-speed weakly compressible flows as well. This is a bit confusing IMO. @LasNikas ?

Comment on lines +32 to +45
#### ArtificialViscosityMonaghan

- Best For: Compressible/high-speed flows, shock capturing, general purpose damping.
- If you need: Stability in challenging flow regimes with potentially large density/pressure variations.

#### ViscosityMorris

- Best For: Moderate to low Mach number flows where realistic viscous behavior is desired.
- If you need: Straightforward approach to physical viscosity that still works well in weakly compressible scenarios.

#### ViscosityAdami

- Best For: Incompressible or weakly compressible flows requiring accurate shear stress treatment.
- If you need: Good boundary layer representation and accurate laminar flow with minimal compressibility effects.
Copy link
Member

Choose a reason for hiding this comment

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

Source?

The computed curvature is then used to determine forces acting perpendicular to the interface.
While this method provides accurate surface tension forces, it does not explicitly conserve momentum.

In the Morris model, surface tension is computed based on local interface curvature ``\kappa`` and the unit surface normal ``\hat{n}``.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why the period is put in the next line. Can you maybe slightly reformulate this sentence?

```
This formulation focuses directly on geometric properties of the interface, making it relatively straightforward to implement when a reliable interface detection
(e.g., a color function) is available. However, accurately estimating ``\kappa`` and ``n`` may require fine resolutions.
---
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't render correctly.

@@ -120,32 +187,57 @@ A(r) = \frac{0.007}{h_c^{3.25}}

---

### Morris Surface Tension Model

The method estimates curvature by combining particle color gradients and smoothing functions to derive surface normals.
Copy link
Member

Choose a reason for hiding this comment

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

Are color gradients explained somewhere? If so, could you please add a link here?

- ``\hat{n}``: Unit normal vector,
- ``I``: Identity matrix.

That can be calculated as
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
That can be calculated as
This divergence can be computed numerically in the SPH framework as

This model implements the momentum-conserving surface tension approach outlined by
[Morris2000](@cite). It calculates surface tension forces using the gradient of a stress
This model implements the momentum-conserving surface tension approach outlined by Morris
[Morris2000](@cite). It calculates surface tension forces using the divergence of a stress
tensor, ensuring exact conservation of linear momentum. This method is particularly
useful for simulations where momentum conservation is critical, though it may require
numerical adjustments at higher resolutions.
Copy link
Member

Choose a reason for hiding this comment

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

Please add a link to the surface tension docs section. Also for the other models, which are explained in more details in the docs. This is useful when someone is only looking at the docs within the Julia help.

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.

2 participants