Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Jan 21, 2025
1 parent 8a413d6 commit c737197
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/schemes/fluid/entropically_damped_sph/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct EntropicallyDampedSPHSystem{NDIMS, ELTYPE <: Real, IC, M, DC, K, V, TV,
ndims(smoothing_kernel)),
source_terms=nothing, surface_tension=nothing,
surface_normal_method=nothing, buffer_size=nothing,
reference_particle_spacing=0.0, color_value=0)
reference_particle_spacing=0.0)
buffer = isnothing(buffer_size) ? nothing :
SystemBuffer(nparticles(initial_condition), buffer_size)

Expand Down Expand Up @@ -134,7 +134,7 @@ struct EntropicallyDampedSPHSystem{NDIMS, ELTYPE <: Real, IC, M, DC, K, V, TV,
typeof(buffer), typeof(cache)}(initial_condition, mass, density_calculator,
smoothing_kernel, smoothing_length,
ideal_neighbor_count_,
color_value, sound_speed, viscosity, nu_edac,
sound_speed, viscosity, nu_edac,
acceleration_, nothing, pressure_acceleration,
transport_velocity, source_terms,
surface_tension, surface_normal_method, buffer,
Expand Down
4 changes: 2 additions & 2 deletions src/schemes/fluid/weakly_compressible_sph/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function WeaklyCompressibleSPHSystem(initial_condition,
ndims(smoothing_kernel)),
correction=nothing, source_terms=nothing,
surface_tension=nothing, surface_normal_method=nothing,
reference_particle_spacing=0.0, color_value=0)
reference_particle_spacing=0.0)
buffer = isnothing(buffer_size) ? nothing :
SystemBuffer(nparticles(initial_condition), buffer_size)

Expand Down Expand Up @@ -143,7 +143,7 @@ function WeaklyCompressibleSPHSystem(initial_condition,
return WeaklyCompressibleSPHSystem(initial_condition, mass, pressure,
density_calculator, state_equation,
smoothing_kernel, smoothing_length,
ideal_neighbor_count_, color_value,
ideal_neighbor_count_,
acceleration_, viscosity,
density_diffusion, correction,
pressure_acceleration, nothing,
Expand Down
14 changes: 6 additions & 8 deletions test/schemes/fluid/surface_normal_sph.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include("../../test_util.jl")
function create_boundary_system(coordinates, particle_spacing, state_equation, kernel,
smoothing_length, NDIMS, walldistance)
# Compute bounding box of fluid particles
Expand Down Expand Up @@ -98,15 +99,12 @@ function compute_and_test_surface_normals(system, semi, ode; NDIMS=2)
# Check that the threshold has been applied correctly
threshold = 2^ndims(system) + 1

# Test the surface normals based on neighbor counts
# # Test the surface normals based on neighbor counts
# Test that surface normals are zero when there are not enough neighbors.
# For the linear arrangement, surface normals may still be zero
# when we have more neighbors than the threshold.
for i in 1:nparticles
if system.cache.neighbor_count[i] < threshold
@test all(system.cache.surface_normal[:, i] .== 0.0)
else
# For the linear arrangement, surface normals may still be zero
# Adjust the test to account for this possibility
@test true
end
@test system.cache.neighbor_count[i] >= threshold || all(system.cache.surface_normal[:, i] .== 0.0)
end
end

Expand Down

0 comments on commit c737197

Please sign in to comment.