forked from trixi-framework/TrixiParticles.jl
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdam_break_2d_PressureBoundaries.jl
More file actions
39 lines (33 loc) · 1.72 KB
/
dam_break_2d_PressureBoundaries.jl
File metadata and controls
39 lines (33 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 2D dam break simulation using implicit incompressible SPH (IISPH)
using TrixiParticles
# Load setup from dam break example
trixi_include(@__MODULE__,
joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
sol=nothing, ode=nothing)
# Change smoothing kernel and length
smoothing_length = 1.2 * fluid_particle_spacing
smoothing_kernel = SchoenbergCubicSplineKernel{2}()
# Calculate kinematic viscosity for the viscosity model
nu = 0.02 * smoothing_length * sound_speed / 8
viscosity = ViscosityAdami(; nu)
# Use IISPH as fluid system
time_step = 1e-3
omega = 0.4
IISPH_system = ImplicitIncompressibleSPHSystem(tank.fluid, smoothing_kernel,
smoothing_length, fluid_density,
viscosity=ViscosityAdami(nu=nu),
acceleration=(0.0, -gravity),
min_iterations=10,
max_iterations=30,
omega=omega,
time_step=time_step)
# Run the dam break simulation with these changes
trixi_include(@__MODULE__,
joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
viscosity=ViscosityAdami(nu=nu),
smoothing_kernel=smoothing_kernel, smoothing_length=smoothing_length,
fluid_system=IISPH_system,
boundary_density_calculator=PressureBoundaries(time_step, omega=omega),
state_equation=nothing,
callbacks=CallbackSet(info_callback, saving_callback),
time_integration_algorithm=SymplecticEuler(), time_step=time_step, )