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

Generalize surface normal calc #539

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

Conversation

svchb
Copy link
Collaborator

@svchb svchb commented May 29, 2024

Depends on #599
extracted from #584

@svchb svchb mentioned this pull request Oct 10, 2024
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
Copy link
Member

@efaulhaber efaulhaber left a comment

Choose a reason for hiding this comment

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

First review iteration, mostly focused on data structures.

NEWS.md Outdated Show resolved Hide resolved
src/general/system.jl Outdated Show resolved Hide resolved
src/general/system.jl Outdated Show resolved Hide resolved
- `correction`: Correction method of the adjacent fluid system (see [Corrections](@ref corrections)).
- `viscosity`: Slip (default) or no-slip condition. See description below for further
information.
- `reference_particle_spacing`: The reference particle spacing used for weighting values at the boundary.
Copy link
Member

Choose a reason for hiding this comment

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

  1. Please add this to the signature above.
  2. This is completely unclear to me. Isn't this only used for surface tension? Then why is the surface tension not mentioned here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its a general value that has nothing todo with surface tension beside being only used there at this time.

src/schemes/boundary/dummy_particles/dummy_particles.jl Outdated Show resolved Hide resolved
src/schemes/fluid/surface_tension.jl Outdated Show resolved Hide resolved
Comment on lines +63 to +64
surface_tension :: SRFT
surface_normal_method :: SRFN
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense to store the normal method inside the surface tension to avoid cluttering the struct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

While the surface normals are only used for surface tension, at this time, they are never actually called from the actual surface tension model. The surface normal calculation steps are always called from the systems.

Copy link
Member

Choose a reason for hiding this comment

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

But it is just a struct defining the method, right? There is no per-particle data stored that depends on the system, right? Then I don't see a reason why we couldn't store the normal method in the surface tension. Seems more intuitive to me:

surface_tension = SurfaceTensionWhatever(surface_normal_method=ColorWhateverNormals())

Copy link
Collaborator Author

@svchb svchb Nov 19, 2024

Choose a reason for hiding this comment

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

The surface normal calculations can be used in other things than the surface tension.

  1. Tracking of the interface
  2. Heatflux between phases
  3. Free surface boundary conditions

Moving it to surface tension just makes it seem like it somehow depends on anything in surface tension but it actually doesn't. Also you need to actually declare surface normal methods for the solids/boundaries as well but they don't have a surface tension. Declaring normal methods for solids/boundaries is part of #666 since they are needed for the wetting model. These are than also different for elastic solids and rigid solids.

Comment on lines 53 to 54
number_density :: Int64
color :: Int64
Copy link
Member

Choose a reason for hiding this comment

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

Why do these need to be here? They are only used when using surface tension, no? Then they would be better off in the cache.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are currently only needed when a surface normal method is used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is though that these values are needed for all systems but not all systems have a surface normal or surface tension model activated.

src/schemes/fluid/surface_normal_sph.jl Outdated Show resolved Hide resolved
src/schemes/fluid/surface_normal_sph.jl Show resolved Hide resolved
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