Skip to content

Commit

Permalink
Merge branch 'main' into particle-refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
LasNikas committed Mar 26, 2024
2 parents fb9f0ea + 1ca7fff commit a997464
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions docs/src/systems/boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ viscosity parameter of the adjacent fluid or the equivalent from the artificial
viscous interaction (default `viscosity=nothing`), a free-slip wall boundary
condition is applied.

!!! warning
The viscosity model [`ArtificialViscosityMonaghan`](@ref) for [`BoundaryModelDummyParticles`](@ref)
has not been verified yet.

### References
- S. Adami, X. Y. Hu, N. A. Adams.
"A generalized wall boundary condition for smoothed particle hydrodynamics".
Expand Down
9 changes: 4 additions & 5 deletions src/schemes/boundary/dummy_particles/dummy_particles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function create_cache_model(viscosity::Nothing, n_particles, n_dims)
return (;)
end

function create_cache_model(viscosity::ViscosityAdami, n_particles, n_dims)
ELTYPE = eltype(viscosity.nu)
function create_cache_model(viscosity, n_particles, n_dims)
ELTYPE = eltype(viscosity.epsilon)

wall_velocity = zeros(ELTYPE, n_dims, n_particles)

Expand Down Expand Up @@ -425,12 +425,11 @@ function compute_smoothed_velocity!(cache, viscosity::ViscosityAdami,
return cache
end

@inline function compute_wall_velocity!(viscosity, system, system_coords, particle)
@inline function compute_wall_velocity!(viscosity::Nothing, system, system_coords, particle)
return viscosity
end

@inline function compute_wall_velocity!(viscosity::ViscosityAdami, system,
system_coords, particle)
@inline function compute_wall_velocity!(viscosity, system, system_coords, particle)
(; boundary_model) = system
(; cache) = boundary_model
(; volume, wall_velocity) = cache
Expand Down
4 changes: 2 additions & 2 deletions src/schemes/boundary/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ end
return viscous_velocity(v, system.boundary_model.viscosity, system, particle)
end

@inline function viscous_velocity(v, ::ViscosityAdami, system, particle)
@inline function viscous_velocity(v, viscosity, system, particle)
return extract_svector(system.boundary_model.cache.wall_velocity, system, particle)
end

@inline function viscous_velocity(v, viscosity, system, particle)
@inline function viscous_velocity(v, viscosity::Nothing, system, particle)
return current_velocity(v, system, particle)
end

Expand Down
4 changes: 2 additions & 2 deletions src/schemes/fluid/viscosity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ end
rho_mean)
(; smoothing_length) = particle_system

v_a = current_velocity(v_particle_system, particle_system, particle)
v_b = current_velocity(v_neighbor_system, neighbor_system, neighbor)
v_a = viscous_velocity(v_particle_system, particle_system, particle)
v_b = viscous_velocity(v_neighbor_system, neighbor_system, neighbor)
v_diff = v_a - v_b

pi_ab = viscosity(sound_speed, v_diff, pos_diff, distance, rho_mean, smoothing_length)
Expand Down

0 comments on commit a997464

Please sign in to comment.