Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/literate/src/tut_rigid_body_fsi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,8 @@ nothing # hide
# See [the docs on dummy particles](@ref boundary_models) for a definition for these terms.

boundary_density_calculator = AdamiPressureExtrapolation()
tank_boundary_model = BoundaryModelDummyParticles(tank.boundary.density,
tank.boundary.mass,
boundary_density_calculator,
fluid_smoothing_kernel,
fluid_smoothing_length;
state_equation)
tank_boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator)

boundary_system = WallBoundarySystem(tank.boundary, tank_boundary_model)
nothing # hide
Expand Down
13 changes: 5 additions & 8 deletions docs/literate/src/tut_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,11 @@ nothing # hide

# To model the boundary, we use particle-based boundary conditions, in which particles
# are sampled in the boundary that interact with the fluid particles to avoid penetration.
# In order to define a boundary system, we first have to choose a boundary model,
# which defines how the fluid interacts with boundary particles.
# We will use the [`BoundaryModelDummyParticles`](@ref) with [`AdamiPressureExtrapolation`](@ref).
# See [here](@ref boundary_models) for a comprehensive overview over boundary models.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
AdamiPressureExtrapolation(),
smoothing_kernel, smoothing_length;
state_equation)
# Here, we explicitly choose the dummy-particle boundary model and use its high-level
# builder to infer kernel and equation-of-state-related settings from the adjacent
# fluid system. See [here](@ref boundary_models) for a comprehensive overview over
# boundary models.
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system)
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
nothing # hide

Expand Down
6 changes: 1 addition & 5 deletions examples/fluid/dam_break_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ viscosity_wall = nothing
# viscosity_wall = viscosity_fluid

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
correction=nothing,
reference_particle_spacing=0,
viscosity=viscosity_wall,
clip_negative_pressure=true)

Expand Down
4 changes: 1 addition & 3 deletions examples/fluid/dam_break_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid; smoothing_kernel, smoothi
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
4 changes: 1 addition & 3 deletions examples/fluid/falling_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid; smoothing_kernel, smoothi
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
5 changes: 2 additions & 3 deletions examples/fluid/falling_water_spheres_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ boundary_density_calculator = AdamiPressureExtrapolation()
wall_viscosity = nu

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary;
fluid_system=sphere_surface_tension,
boundary_density_calculator,
fluid_smoothing_kernel, fluid_smoothing_length;
state_equation,
viscosity=ViscosityAdami(nu=wall_viscosity),
reference_particle_spacing=fluid_particle_spacing,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model;
Expand Down
4 changes: 1 addition & 3 deletions examples/fluid/hydrostatic_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ boundary_density_calculator = AdamiPressureExtrapolation()

# This is to set wall viscosity with `trixi_include`
viscosity_wall = nothing
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
viscosity=viscosity_wall)
boundary_system = WallBoundarySystem(tank.boundary, boundary_model,
prescribed_motion=nothing)
Expand Down
22 changes: 8 additions & 14 deletions examples/fluid/lid_driven_cavity_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,14 @@ is_moving(t) = true

lid_movement = PrescribedMotion(lid_movement_function, is_moving)

boundary_model_cavity = BoundaryModelDummyParticles(cavity.boundary.density,
cavity.boundary.mass,
AdamiPressureExtrapolation(),
smoothing_kernel, smoothing_length;
viscosity, state_equation)

boundary_model_lid = BoundaryModelDummyParticles(lid.density, lid.mass,
AdamiPressureExtrapolation(),
smoothing_kernel, smoothing_length;
viscosity, state_equation)

boundary_system_cavity = WallBoundarySystem(cavity.boundary, boundary_model_cavity)

boundary_system_lid = WallBoundarySystem(lid, boundary_model_lid,
cavity_boundary_model = BoundaryModelDummyParticles(cavity.boundary;
fluid_system=fluid_system,
viscosity=viscosity)
boundary_system_cavity = WallBoundarySystem(cavity.boundary, cavity_boundary_model)

lid_boundary_model = BoundaryModelDummyParticles(lid; fluid_system=fluid_system,
viscosity=viscosity)
boundary_system_lid = WallBoundarySystem(lid, lid_boundary_model,
prescribed_motion=lid_movement)

# ==========================================================================================
Expand Down
6 changes: 2 additions & 4 deletions examples/fluid/moving_wall_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid; smoothing_kernel, smoothi
# ==========================================================================================
# ==== Boundary
boundary_density_calculator = AdamiPressureExtrapolation()
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation)
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model,
prescribed_motion=boundary_movement)
Expand Down
6 changes: 2 additions & 4 deletions examples/fluid/periodic_array_of_cylinders_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ fluid_system = WeaklyCompressibleSPHSystem(fluid; smoothing_kernel, smoothing_le

# ==========================================================================================
# ==== Boundary
boundary_model = BoundaryModelDummyParticles(boundary.density, boundary.mass,
AdamiPressureExtrapolation(), smoothing_kernel,
smoothing_length;
viscosity=ViscosityAdami(; nu), state_equation)
boundary_model = BoundaryModelDummyParticles(boundary; fluid_system=fluid_system,
viscosity=ViscosityAdami(; nu))

boundary_system = WallBoundarySystem(boundary, boundary_model)

Expand Down
4 changes: 1 addition & 3 deletions examples/fluid/periodic_channel_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ viscosity_wall = nothing
# Activate to switch to no-slip walls
#viscosity_wall = ViscosityAdami(nu=0.0025 * smoothing_length * sound_speed / 8)

boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
viscosity=viscosity_wall)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
7 changes: 2 additions & 5 deletions examples/fluid/pipe_flow_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,13 @@ outflow = BoundaryZone(; boundary_face=face_out, face_normal=(-flow_direction),
initial_condition=outlet.fluid, boundary_type=boundary_type_out)

open_boundary = OpenBoundarySystem(inflow, outflow; fluid_system,
boundary_model=open_boundary_model,
buffer_size=n_buffer_particles)
boundary_model=open_boundary_model)

# ==========================================================================================
# ==== Boundary
wall = union(pipe.boundary, inlet.boundary, outlet.boundary)
viscosity_boundary = viscosity
boundary_model = BoundaryModelDummyParticles(wall.density, wall.mass,
AdamiPressureExtrapolation(), smoothing_kernel,
smoothing_length; state_equation,
boundary_model = BoundaryModelDummyParticles(wall; fluid_system=fluid_system,
viscosity=viscosity_boundary)

boundary_system = WallBoundarySystem(wall, boundary_model)
Expand Down
8 changes: 3 additions & 5 deletions examples/fluid/poiseuille_flow_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,14 @@ outlet_boundary_zone = BoundaryZone(; boundary_face=outlet_face,

open_boundary = OpenBoundarySystem(inlet_boundary_zone, outlet_boundary_zone; fluid_system,
boundary_model=open_boundary_model,
calculate_flow_rate=true,
buffer_size=n_buffer_particles)
calculate_flow_rate=true)

# ==========================================================================================
# ==== Boundary
wall_boundary = union(channel.boundary)

boundary_model = BoundaryModelDummyParticles(wall_boundary.density, wall_boundary.mass,
AdamiPressureExtrapolation(), smoothing_kernel,
smoothing_length; state_equation, viscosity)
boundary_model = BoundaryModelDummyParticles(wall_boundary; fluid_system=fluid_system,
viscosity)

boundary_system = WallBoundarySystem(wall_boundary, boundary_model)

Expand Down
8 changes: 3 additions & 5 deletions examples/fluid/poiseuille_flow_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,12 @@ outlet_zone = BoundaryZone(; boundary_face=outlet_face,
boundary_type=outlet_boundary_type)

open_boundary = OpenBoundarySystem(inlet_zone, outlet_zone; fluid_system,
boundary_model=open_boundary_model,
buffer_size=n_buffer_particles)
boundary_model=open_boundary_model)

# ==========================================================================================
# ==== Boundary
boundary_model = BoundaryModelDummyParticles(wall_boundary.density, wall_boundary.mass,
AdamiPressureExtrapolation(), smoothing_kernel,
smoothing_length; state_equation, viscosity)
boundary_model = BoundaryModelDummyParticles(wall_boundary; fluid_system=fluid_system,
viscosity)

boundary_system = WallBoundarySystem(wall_boundary, boundary_model)

Expand Down
13 changes: 4 additions & 9 deletions examples/fsi/dam_break_gate_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,15 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid; smoothing_kernel, smoothi
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model_tank = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
tank_boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_model_gate = BoundaryModelDummyParticles(gate.density, gate.mass,
gate_boundary_model = BoundaryModelDummyParticles(gate; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system_tank = WallBoundarySystem(tank.boundary, boundary_model_tank)
boundary_system_gate = WallBoundarySystem(gate, boundary_model_gate,
boundary_system_tank = WallBoundarySystem(tank.boundary, tank_boundary_model)
boundary_system_gate = WallBoundarySystem(gate, gate_boundary_model,
prescribed_motion=gate_movement)

# ==========================================================================================
Expand Down
4 changes: 1 addition & 3 deletions examples/fsi/dam_break_plate_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid; smoothing_kernel, smoothi
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
4 changes: 1 addition & 3 deletions examples/fsi/falling_rigid_spheres_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
fluid_smoothing_kernel, fluid_smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
4 changes: 1 addition & 3 deletions examples/fsi/falling_rotating_rigid_squares_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
boundary_density_calculator = AdamiPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
fluid_smoothing_kernel, fluid_smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
4 changes: 1 addition & 3 deletions examples/fsi/falling_spheres_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
boundary_density_calculator = BernoulliPressureExtrapolation()

# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
fluid_smoothing_kernel, fluid_smoothing_length;
state_equation,
clip_negative_pressure=true)

boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
Expand Down
3 changes: 1 addition & 2 deletions examples/fsi/hydrostatic_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ else
damping_coefficient=0.05))
end

boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
boundary_model = BoundaryModelDummyParticles(tank.boundary; fluid_system=fluid_system,
boundary_density_calculator,
smoothing_kernel, smoothing_length_fluid;
state_equation)
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
boundary_model_structure = BoundaryModelDummyParticles(hydrodynamic_densities,
Expand Down
Loading
Loading