Skip to content

Commit

Permalink
Inline viscosity (#578)
Browse files Browse the repository at this point in the history
Co-authored-by: Sven Berger <[email protected]>
  • Loading branch information
efaulhaber and svchb authored Jul 19, 2024
1 parent a676f52 commit c2670cc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/schemes/fluid/viscosity.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Unpack the neighboring systems viscosity to dispatch on the viscosity type
function dv_viscosity(particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
@inline function dv_viscosity(particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
viscosity = viscosity_model(particle_system, neighbor_system)

return dv_viscosity(viscosity, particle_system, neighbor_system,
Expand All @@ -12,20 +12,20 @@ function dv_viscosity(particle_system, neighbor_system,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
end

function dv_viscosity(viscosity, particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
@inline function dv_viscosity(viscosity, particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
return viscosity(particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
end

function dv_viscosity(viscosity::Nothing, particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
@inline function dv_viscosity(viscosity::Nothing, particle_system, neighbor_system,
v_particle_system, v_neighbor_system,
particle, neighbor, pos_diff, distance,
sound_speed, m_a, m_b, rho_a, rho_b, grad_kernel)
return zero(pos_diff)
end

Expand Down

0 comments on commit c2670cc

Please sign in to comment.