Skip to content

Commit

Permalink
Merge branch 'morris_surface_tension' into improved_normal_calc_methods
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Jan 30, 2025
2 parents 7a693ee + 646fbfc commit a01301f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 223 deletions.
213 changes: 0 additions & 213 deletions examples/fluid/periodic_field_2d.jl

This file was deleted.

8 changes: 3 additions & 5 deletions src/schemes/boundary/dummy_particles/dummy_particles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,17 @@ function BoundaryModelDummyParticles(initial_density, hydrodynamic_mass,
create_cache_model(initial_density, density_calculator)...,
create_cache_model(correction, initial_density, NDIMS, n_particles)...)

# If the `reference_density_spacing` is set calculate the `ideal_neighbor_count`
ideal_neighbor_count_ = 0
if reference_particle_spacing > 0.0
# since reference_particle_spacing has to be set for surface normals to be determined we can do this here
cache = (;
cache..., # Existing cache fields
colorfield_bnd=zeros(ELTYPE, n_particles),
colorfield=zeros(ELTYPE, n_particles),
neighbor_count=zeros(ELTYPE, n_particles))
end

# If the `reference_density_spacing` is set calculate the `ideal_neighbor_count`
ideal_neighbor_count_ = 0
if reference_particle_spacing > 0.0
ideal_neighbor_count_ = ideal_neighbor_count(Val(ndims(boundary_model)),
ideal_neighbor_count_ = ideal_neighbor_count(Val(ndims(smoothing_kernel)),
reference_particle_spacing,
compact_support(smoothing_kernel,
smoothing_length))
Expand Down
6 changes: 3 additions & 3 deletions src/schemes/boundary/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ function initialize_colorfield!(system, ::BoundaryModelDummyParticles, neighborh
points=eachparticle(system)) do particle, neighbor, pos_diff,
distance
system.boundary_model.cache.colorfield_bnd[particle] += system.initial_condition.mass[particle] /
system.initial_condition.density[particle] *
system.color *
kernel(smoothing_kernel,
system.initial_condition.density[particle] *
system.color *
kernel(smoothing_kernel,
distance,
smoothing_length)
system.boundary_model.cache.neighbor_count[particle] += 1
Expand Down
2 changes: 1 addition & 1 deletion src/schemes/fluid/entropically_damped_sph/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ See [Entropically Damped Artificial Compressibility for SPH](@ref edac) for more
- `correction`: Correction method used for this system. (default: no correction, see [Corrections](@ref corrections))
- `surface_tension`: Surface tension model used for this SPH system. (default: no surface tension)
- `surface_normal_method`: The surface normal method to be used for this SPH system.
(default: no surface normal method or ColorfieldSurfaceNormal() if a surface_tension model is used)
(default: no surface normal method or `ColorfieldSurfaceNormal()` if a surface_tension model is used)
- `reference_particle_spacing`: The reference particle spacing used for weighting values at the boundary,
which currently is only needed when using surface tension.
Expand Down
2 changes: 1 addition & 1 deletion src/schemes/fluid/weakly_compressible_sph/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ See [Weakly Compressible SPH](@ref wcsph) for more details on the method.
gravity-like source terms.
- `surface_tension`: Surface tension model used for this SPH system. (default: no surface tension)
- `surface_normal_method`: The surface normal method to be used for this SPH system.
(default: no surface normal method or ColorfieldSurfaceNormal() if a surface_tension model is used)
(default: no surface normal method or `ColorfieldSurfaceNormal()` if a surface_tension model is used)
- `reference_particle_spacing`: The reference particle spacing used for weighting values at the boundary,
which currently is only needed when using surface tension.
Expand Down

0 comments on commit a01301f

Please sign in to comment.