From b9a945082e28b38a10ee0acdabcadb2018298f90 Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:41:30 +0100 Subject: [PATCH] Make simulations run with `Float32` (#662) * Replace hardcoded Float64 values * Avoid Float64 `eps()` * Remove the last Float64 occurrence in fluid-fluid kernel * Fix tests * Make all smoothing kernels preserve types and add test for this * Make eps(typeof(h)) consistent * Reformat code * Fix tests --- src/schemes/fluid/viscosity.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/schemes/fluid/viscosity.jl b/src/schemes/fluid/viscosity.jl index 222fa6fd8..a86719e55 100644 --- a/src/schemes/fluid/viscosity.jl +++ b/src/schemes/fluid/viscosity.jl @@ -112,9 +112,12 @@ end v_neighbor_system, particle, neighbor, pos_diff, distance, - sound_speed, m_a, m_b, - rho_a, rho_b, grad_kernel) - rho_mean = 0.5 * (rho_a + rho_b) + sound_speed, + m_a, m_b, rho_a, rho_b, + grad_kernel) + (; smoothing_length) = particle_system + + rho_mean = (rho_a + rho_b) / 2 v_a = viscous_velocity(v_particle_system, particle_system, particle) v_b = viscous_velocity(v_neighbor_system, neighbor_system, neighbor)