Skip to content

Commit 6010689

Browse files
authored
Implement consistent shifting by Sun et al. 2019 (#888)
* Implement consistent shifting by Sun et al. 2019 * Fix tests * Add option to switch between dynamic and static v_max * Fix docs * Add more constructor tests * Fix `dv_shifting` * Add reference * Remove doctest output * Fix ugly spaces * Fix tests * Fix tests * Update NEWS.md * Reformat * Add #879 to NEWS.md * Fix tests * Revise docstring * Make API more flexible * Fix tests
1 parent ceee740 commit 6010689

15 files changed

Lines changed: 531 additions & 64 deletions

File tree

NEWS.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,28 @@ used in the Julia ecosystem. Notable changes will be documented in this file for
1111
- API for `OpenBoundarySPHSystem` and `BoundaryZone` changed.
1212
It is now possible to pass multiple `BoundaryZone`s to a single `OpenBoundarySPHSystem`.
1313
Reference values are now assigned individually to each `BoundaryZone`. (#866)
14+
15+
- The argument of `TransportVelocityAdami` is now a keyword argument.
16+
`TransportVelocityAdami(1000.0)` now becomes
17+
`TransportVelocityAdami(background_pressure=1000.0)` (#884).
18+
1419
- Combined transport velocity formulation (TVF) and particle shifting technique (PST) into
1520
one unified framework.
1621
The keyword argument `transport_velocity` now changed to `shifting_technique`.
1722
The `ParticleShiftingCallback` has been removed. To use PST, use the `UpdateCallback`
18-
instead, and pass `shifting_technique=ParticleShiftingTechnique()` to the system.
23+
instead, and pass `shifting_technique=ParticleShiftingTechniqueSun2017()` to the system (#884).
1924

2025
- Renamed the keyword argument `tlsph` to `place_on_shell` for `ParticlePackingSystem`,
21-
`sample_boundary`, `extrude_geometry`, `RectangularShape`, and `SphereShape`.
26+
`sample_boundary`, `extrude_geometry`, `RectangularShape`, and `SphereShape` (#814).
27+
28+
- Custom quantity functions passed to `SolutionSavingCallback` or `PostprocessCallback`
29+
that were not using the documented API but were functions of
30+
`(system, v_ode, u_ode, semi, t)` now need to be functions
31+
of `(system, dv_ode, du_ode, v_ode, u_ode, semi, t)` (#879).
32+
33+
### Features
34+
35+
- Added consistent particle shifting by Sun et al. (2019) as `ConsistentShiftingSun2019` (#888).
2236

2337
## Version 0.3.1
2438

docs/src/refs.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,17 @@ @article{Sun2018
707707
doi = {10.1016/j.cpc.2017.11.016},
708708
}
709709

710+
@article{Sun2019,
711+
author = {Sun, P. N. and Colagrossi, A. and Marrone, S. and Antuono, M. and Zhang, A. -M.},
712+
title = {A consistent approach to particle shifting in the δPlus-{SPH} model},
713+
journal = {Computer Methods in Applied Mechanics and Engineering},
714+
volume = {348},
715+
year = {2019},
716+
issn = {0045-7825},
717+
pages = {912--934},
718+
doi = {10.1016/j.cma.2019.01.045},
719+
}
720+
710721
@Article{Tafuni2018,
711722
author = {A. Tafuni and J.M. Dom{\'{\i}}nguez and R. Vacondio and A.J.C. Crespo},
712723
journal = {Computer Methods in Applied Mechanics and Engineering},

examples/fluid/lid_driven_cavity_2d.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ if wcsph
6565
state_equation, smoothing_kernel,
6666
pressure_acceleration=TrixiParticles.inter_particle_averaged_pressure,
6767
smoothing_length, viscosity=viscosity,
68-
shifting_technique=TransportVelocityAdami(pressure))
68+
shifting_technique=TransportVelocityAdami(background_pressure=pressure))
6969
else
7070
state_equation = nothing
7171
density_calculator = ContinuityDensity()
7272
fluid_system = EntropicallyDampedSPHSystem(cavity.fluid, smoothing_kernel,
7373
smoothing_length,
7474
density_calculator=density_calculator,
7575
sound_speed, viscosity=viscosity,
76-
shifting_technique=TransportVelocityAdami(pressure))
76+
shifting_technique=TransportVelocityAdami(background_pressure=pressure))
7777
end
7878

7979
# ==========================================================================================

examples/fluid/periodic_array_of_cylinders_2d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ smoothing_length = 1.2 * particle_spacing
6060
smoothing_kernel = SchoenbergQuarticSplineKernel{2}()
6161
fluid_system = EntropicallyDampedSPHSystem(fluid, smoothing_kernel, smoothing_length,
6262
sound_speed, viscosity=ViscosityAdami(; nu),
63-
shifting_technique=TransportVelocityAdami(pressure),
63+
shifting_technique=TransportVelocityAdami(background_pressure=pressure),
6464
acceleration=(acceleration_x, 0.0))
6565

6666
# ==========================================================================================

examples/fluid/pipe_flow_2d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if wcsph
8383
state_equation, smoothing_kernel,
8484
density_diffusion=density_diffusion,
8585
smoothing_length, viscosity=viscosity,
86-
shifting_technique=ParticleShiftingTechnique(),
86+
shifting_technique=ParticleShiftingTechnique(v_max_factor=1.5),
8787
buffer_size=n_buffer_particles)
8888
else
8989
# Alternatively the EDAC scheme can be used

examples/fluid/taylor_green_vortex_2d.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ if wcsph
8686
pressure_acceleration=TrixiParticles.inter_particle_averaged_pressure,
8787
smoothing_length,
8888
viscosity=ViscosityAdami(; nu),
89-
shifting_technique=TransportVelocityAdami(background_pressure))
89+
shifting_technique=TransportVelocityAdami(;
90+
background_pressure))
9091
else
9192
density_calculator = SummationDensity()
9293
fluid_system = EntropicallyDampedSPHSystem(fluid, smoothing_kernel, smoothing_length,
9394
sound_speed,
9495
density_calculator=density_calculator,
95-
shifting_technique=TransportVelocityAdami(background_pressure),
96+
shifting_technique=TransportVelocityAdami(;
97+
background_pressure),
9698
viscosity=ViscosityAdami(; nu))
9799
end
98100

src/TrixiParticles.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export BoundaryZone, InFlow, OutFlow, BidirectionalFlow
6868
export InfoCallback, SolutionSavingCallback, DensityReinitializationCallback,
6969
PostprocessCallback, StepsizeCallback, UpdateCallback, SteadyStateReachedCallback
7070
export ContinuityDensity, SummationDensity
71-
export PenaltyForceGanzenmueller, TransportVelocityAdami, ParticleShiftingTechnique
71+
export PenaltyForceGanzenmueller, TransportVelocityAdami, ParticleShiftingTechnique,
72+
ParticleShiftingTechniqueSun2017, ConsistentShiftingSun2019,
73+
ContinuityEquationTermSun2019, MomentumEquationTermSun2019
7274
export SchoenbergCubicSplineKernel, SchoenbergQuarticSplineKernel,
7375
SchoenbergQuinticSplineKernel, GaussianKernel, WendlandC2Kernel, WendlandC4Kernel,
7476
WendlandC6Kernel, SpikyKernel, Poly6Kernel

src/schemes/boundary/open_boundary/boundary_zones.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ There are three ways to specify the actual shape of the boundary zone:
8080
or evolved using the characteristic flow variables ([BoundaryModelCharacteristicsLastiwka](@ref BoundaryModelCharacteristicsLastiwka)).
8181
8282
# Examples
83-
```jldoctest; output = false
83+
```jldoctest; output=false
8484
# 2D
8585
plane_points = ([0.0, 0.0], [0.0, 1.0])
8686
plane_normal = [1.0, 0.0]

src/schemes/fluid/entropically_damped_sph/rhs.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ function interact!(dv, v_particle_system, u_particle_system,
5353

5454
# Extra terms in the momentum equation when using a shifting technique
5555
dv_tvf = dv_shifting(shifting_technique(particle_system),
56-
particle_system, neighbor_system, particle, neighbor,
56+
particle_system, neighbor_system,
5757
v_particle_system, v_neighbor_system,
58-
m_a, m_b, rho_a, rho_b, pos_diff, distance,
59-
grad_kernel, correction)
58+
particle, neighbor, m_a, m_b, rho_a, rho_b,
59+
pos_diff, distance, grad_kernel, correction)
6060

6161
dv_surface_tension = surface_tension_force(surface_tension_a, surface_tension_b,
6262
particle_system, neighbor_system,

0 commit comments

Comments
 (0)