diff --git a/test/schemes/fluid/surface_tension.jl b/test/schemes/fluid/surface_tension.jl index ff2f1ddd0..95cd4c8d6 100644 --- a/test/schemes/fluid/surface_tension.jl +++ b/test/schemes/fluid/surface_tension.jl @@ -1,79 +1,88 @@ @testset verbose=true "surface tension" begin @testset verbose=true "cohesion_force_akinci" begin - surface_tension = TrixiParticles.SurfaceTensionAkinci(surface_tension_coefficient=1.0) support_radius = 1.0 m_b = 1.0 pos_diff = [1.0, 1.0] test_distance = 0.1 - zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance) * test_distance + zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance) * test_distance @test isapprox(zero[1], 0.1443038770421044, atol=6e-15) @test isapprox(zero[2], 0.1443038770421044, atol=6e-15) # maximum repulsion force test_distance = 0.01 - zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance) * test_distance + zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance) * test_distance @test isapprox(zero[1], 0.15913517632298307, atol=6e-15) @test isapprox(zero[2], 0.15913517632298307, atol=6e-15) # near 0 test_distance = 0.2725 - zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance) * test_distance + zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance) * test_distance @test isapprox(zero[1], 0.0004360543645195717, atol=6e-15) @test isapprox(zero[2], 0.0004360543645195717, atol=6e-15) # maximum attraction force test_distance = 0.5 - zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance) * test_distance + zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance) * test_distance @test isapprox(zero[1], -0.15915494309189535, atol=6e-15) @test isapprox(zero[2], -0.15915494309189535, atol=6e-15) - # should be 0 test_distance = 1.0 - zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance) * test_distance + zero = TrixiParticles.cohesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance) * test_distance @test isapprox(zero[1], 0.0, atol=6e-15) @test isapprox(zero[2], 0.0, atol=6e-15) - end @testset verbose=true "adhesion_force_akinci" begin - surface_tension = TrixiParticles.SurfaceTensionAkinci(surface_tension_coefficient=1.0) support_radius = 1.0 m_b = 1.0 pos_diff = [1.0, 1.0] test_distance = 0.1 - zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance, 1.0) * test_distance + zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance, 1.0) * + test_distance @test isapprox(zero[1], 0.0, atol=6e-15) @test isapprox(zero[2], 0.0, atol=6e-15) test_distance = 0.5 - zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance, 1.0) * test_distance + zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance, 1.0) * + test_distance @test isapprox(zero[1], 0.0, atol=6e-15) @test isapprox(zero[2], 0.0, atol=6e-15) # near 0 test_distance = 0.51 - zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance, 1.0) * test_distance + zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance, 1.0) * + test_distance @test isapprox(zero[1], -0.002619160170741761, atol=6e-15) @test isapprox(zero[2], -0.002619160170741761, atol=6e-15) # maximum adhesion force test_distance = 0.75 - zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance, 1.0) * test_distance + zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance, 1.0) * + test_distance @test isapprox(zero[1], -0.004949747468305833, atol=6e-15) @test isapprox(zero[2], -0.004949747468305833, atol=6e-15) - # should be 0 test_distance = 1.0 - zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, pos_diff, test_distance, 1.0) * test_distance + zero = TrixiParticles.adhesion_force_akinci(surface_tension, support_radius, m_b, + pos_diff, test_distance, 1.0) * + test_distance @test isapprox(zero[1], 0.0, atol=6e-15) @test isapprox(zero[2], 0.0, atol=6e-15) - end end