Skip to content

Commit 2d60da5

Browse files
committed
Make free surface examples use boundary pressure clipping
1 parent 5697a0c commit 2d60da5

9 files changed

Lines changed: 46 additions & 14 deletions

examples/fluid/dam_break_2d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,16 @@ boundary_density_calculator = AdamiPressureExtrapolation()
7979
viscosity_wall = nothing
8080
# For a no-slip boundary condition, define a wall viscosity:
8181
# viscosity_wall = viscosity_fluid
82+
83+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
8284
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
8385
state_equation=state_equation,
8486
boundary_density_calculator,
8587
smoothing_kernel, smoothing_length,
8688
correction=nothing,
8789
reference_particle_spacing=0,
88-
viscosity=viscosity_wall)
90+
viscosity=viscosity_wall,
91+
clip_negative_pressure=true)
8992

9093
boundary_system = WallBoundarySystem(tank.boundary, boundary_model,
9194
adhesion_coefficient=0.0)

examples/fluid/dam_break_3d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
5656
# ==========================================================================================
5757
# ==== Boundary
5858
boundary_density_calculator = AdamiPressureExtrapolation()
59+
60+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
5961
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
6062
state_equation=state_equation,
6163
boundary_density_calculator,
62-
smoothing_kernel, smoothing_length)
64+
smoothing_kernel, smoothing_length,
65+
clip_negative_pressure=true)
6366

6467
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
6568

examples/fluid/falling_water_column_2d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
5353
# ==========================================================================================
5454
# ==== Boundary
5555
boundary_density_calculator = AdamiPressureExtrapolation()
56+
57+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
5658
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
5759
state_equation=state_equation,
5860
boundary_density_calculator,
59-
smoothing_kernel, smoothing_length)
61+
smoothing_kernel, smoothing_length,
62+
clip_negative_pressure=true)
6063

6164
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
6265

examples/fluid/falling_water_spheres_2d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,15 @@ sphere = WeaklyCompressibleSPHSystem(sphere2, fluid_density_calculator,
7777
# ==== Boundary
7878
boundary_density_calculator = AdamiPressureExtrapolation()
7979
wall_viscosity = nu
80+
81+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
8082
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
8183
state_equation=state_equation,
8284
boundary_density_calculator,
8385
fluid_smoothing_kernel, fluid_smoothing_length,
8486
viscosity=ViscosityAdami(nu=wall_viscosity),
85-
reference_particle_spacing=fluid_particle_spacing)
87+
reference_particle_spacing=fluid_particle_spacing,
88+
clip_negative_pressure=true)
8689

8790
boundary_system = WallBoundarySystem(tank.boundary, boundary_model,
8891
adhesion_coefficient=1.0)

examples/fsi/dam_break_gate_2d.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,19 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
118118
# ==========================================================================================
119119
# ==== Boundary
120120
boundary_density_calculator = AdamiPressureExtrapolation()
121+
122+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
121123
boundary_model_tank = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
122124
state_equation=state_equation,
123125
boundary_density_calculator,
124-
smoothing_kernel, smoothing_length)
126+
smoothing_kernel, smoothing_length,
127+
clip_negative_pressure=true)
125128

126129
boundary_model_gate = BoundaryModelDummyParticles(gate.density, gate.mass,
127130
state_equation=state_equation,
128131
boundary_density_calculator,
129-
smoothing_kernel, smoothing_length)
132+
smoothing_kernel, smoothing_length,
133+
clip_negative_pressure=true)
130134

131135
boundary_system_tank = WallBoundarySystem(tank.boundary, boundary_model_tank)
132136
boundary_system_gate = WallBoundarySystem(gate, boundary_model_gate,
@@ -145,7 +149,8 @@ boundary_model_structure = BoundaryModelDummyParticles(hydrodynamic_densites,
145149
hydrodynamic_masses,
146150
state_equation=state_equation,
147151
AdamiPressureExtrapolation(),
148-
smoothing_kernel, smoothing_length)
152+
smoothing_kernel, smoothing_length,
153+
clip_negative_pressure=true)
149154

150155
structure_system = TotalLagrangianSPHSystem(structure,
151156
structure_smoothing_kernel,

examples/fsi/dam_break_plate_2d.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
8888
# ==========================================================================================
8989
# ==== Boundary
9090
boundary_density_calculator = AdamiPressureExtrapolation()
91+
92+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
9193
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
9294
state_equation=state_equation,
9395
boundary_density_calculator,
94-
smoothing_kernel, smoothing_length)
96+
smoothing_kernel, smoothing_length,
97+
clip_negative_pressure=true)
9598

9699
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
97100

@@ -121,7 +124,8 @@ boundary_model_structure = BoundaryModelMonaghanKajtar(k_structure, spacing_rati
121124
# hydrodynamic_masses,
122125
# state_equation=state_equation,
123126
# boundary_density_calculator,
124-
# smoothing_kernel, smoothing_length)
127+
# smoothing_kernel, smoothing_length,
128+
# clip_negative_pressure=true)
125129

126130
structure_system = TotalLagrangianSPHSystem(structure,
127131
structure_smoothing_kernel,

examples/fsi/falling_rigid_spheres_2d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
6767
# ==========================================================================================
6868
# ==== Boundary
6969
boundary_density_calculator = AdamiPressureExtrapolation()
70+
71+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
7072
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
7173
state_equation=state_equation,
7274
boundary_density_calculator,
73-
fluid_smoothing_kernel, fluid_smoothing_length)
75+
fluid_smoothing_kernel, fluid_smoothing_length,
76+
clip_negative_pressure=true)
7477

7578
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
7679

examples/fsi/falling_rotating_rigid_squares_2d.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
8383
# ==========================================================================================
8484
# ==== Boundary
8585
boundary_density_calculator = AdamiPressureExtrapolation()
86+
87+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
8688
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
8789
state_equation=state_equation,
8890
boundary_density_calculator,
89-
fluid_smoothing_kernel, fluid_smoothing_length)
91+
fluid_smoothing_kernel, fluid_smoothing_length,
92+
clip_negative_pressure=true)
9093

9194
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
9295

examples/fsi/falling_spheres_2d.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
7171
# ==========================================================================================
7272
# ==== Boundary
7373
boundary_density_calculator = BernoulliPressureExtrapolation()
74+
75+
# Clip negative boundary pressure values to avoid sticking artifacts at the boundary.
7476
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
7577
state_equation=state_equation,
7678
boundary_density_calculator,
77-
fluid_smoothing_kernel, fluid_smoothing_length)
79+
fluid_smoothing_kernel, fluid_smoothing_length,
80+
clip_negative_pressure=true)
7881

7982
boundary_system = WallBoundarySystem(tank.boundary, boundary_model)
8083

@@ -93,7 +96,8 @@ structure_boundary_model_1 = BoundaryModelDummyParticles(hydrodynamic_densites_1
9396
state_equation=state_equation,
9497
boundary_density_calculator,
9598
fluid_smoothing_kernel,
96-
fluid_smoothing_length)
99+
fluid_smoothing_length,
100+
clip_negative_pressure=true)
97101

98102
hydrodynamic_densites_2 = fluid_density * ones(size(sphere2.density))
99103
hydrodynamic_masses_2 = hydrodynamic_densites_2 *
@@ -104,7 +108,8 @@ structure_boundary_model_2 = BoundaryModelDummyParticles(hydrodynamic_densites_2
104108
state_equation=state_equation,
105109
boundary_density_calculator,
106110
fluid_smoothing_kernel,
107-
fluid_smoothing_length)
111+
fluid_smoothing_length,
112+
clip_negative_pressure=true)
108113

109114
structure_system_1 = TotalLagrangianSPHSystem(sphere1,
110115
structure_smoothing_kernel,

0 commit comments

Comments
 (0)