Skip to content

Commit f3172d5

Browse files
committed
Changes from the PR review: system file, example file and test file
1 parent 6246754 commit f3172d5

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

examples/fluid/dam_break_2d_iisph.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# 2D dam break simulation using implicit incompressible SPH (IISPH)
22
using TrixiParticles
33

4+
fluid_particle_spacing = 0.015
5+
46
# Load setup from dam break example
57
trixi_include(@__MODULE__,
68
joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
79
sol=nothing, ode=nothing)
810

9-
# Change smoothing kernel and length to get a stable simulation
1011
# IISPH doesn't require a large compact support like WCSPH and performs worse with a typical
11-
# smoothing length
12-
smoothing_length = 1.2 * fluid_particle_spacing
12+
# smoothing length used for WCSPH.
13+
smoothing_length = 1.0 * fluid_particle_spacing
1314
smoothing_kernel = SchoenbergCubicSplineKernel{2}()
15+
# This kernel slightly overestimates the density, so we reduce the mass slightly
16+
# to obtain a density slightly below the reference density.
17+
# Otherwise, the fluid will jump slightly at the beginning of the simulation.
18+
tank.fluid.mass .*= 0.995
1419

15-
# Calculate kinematic viscosity for the viscosity model
20+
# Calculate kinematic viscosity for the viscosity model.
1621
# Only ViscosityAdami and ViscosityMorris can be used for IISPH simulations since they don't
17-
# need a state equation
22+
# require a speed of sound.
1823
nu = 0.02 * smoothing_length * sound_speed / 8
1924
viscosity = ViscosityAdami(; nu)
2025

src/schemes/fluid/implicit_incompressible_sph/system.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ System for particles of a fluid.
1111
The system employs implicit incompressible SPH (IISPH), iteratively solving a linear system
1212
for the pressure so that density remains within a specified tolerance of the rest value.
1313
See [Implicit Incompressible SPH](@ref iisph) for more details on the method.
14+
!!! note "Time Integration"
15+
This system only supports time integration with `SymplecticEuler()`. No other schemes are currently supported.
1416
1517
# Arguments
1618
- `initial_condition`: [`InitialCondition`](@ref) representing the system's particles.

test/examples/examples_fluid.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,19 @@
216216
@test count_rhs_allocations(sol, semi) == 0
217217
end
218218

219+
@trixi_testset "fluid/dam_break_2d_iisph.jl with PressureMirroring" begin
220+
@trixi_test_nowarn trixi_include(@__MODULE__,
221+
joinpath(examples_dir(), "fluid",
222+
"dam_break_2d_iisph.jl"),
223+
tspan=(0.0, 0.1),
224+
boundary_density_calculator=PressureMirroring()) [
225+
r"┌ Info: The desired tank length in y-direction .*\n",
226+
r"└ New tank length in y-direction.*\n"
227+
]
228+
@test sol.retcode == ReturnCode.Success
229+
@test count_rhs_allocations(sol, semi) == 0
230+
end
231+
219232
@trixi_testset "fluid/dam_break_2d_gpu.jl" begin
220233
@trixi_test_nowarn trixi_include(@__MODULE__,
221234
joinpath(examples_dir(), "fluid",

0 commit comments

Comments
 (0)