Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
87da03c
swap extrapolation
Jul 2, 2025
ea700a9
Merge branch 'main' into fix-obc-extrapolation
Jul 2, 2025
f30f019
swap density pressure
Jul 3, 2025
61ea456
adapt docs
Jul 3, 2025
350c791
rm example
Jul 3, 2025
a8b6555
fix missing nhs update
Jul 9, 2025
ac9108c
implement different mirror methods
Jul 9, 2025
d69f03d
add docs
Jul 10, 2025
8863884
fix tests
Jul 10, 2025
8beb4d9
fix typos
Jul 10, 2025
f060318
add docs
Jul 10, 2025
bf610b8
add tests
Jul 10, 2025
8ca3825
apply formatter
Jul 10, 2025
6481f3e
Merge branch 'main' into fix-obc-extrapolation
Jul 15, 2025
15c737c
add `average_velocity!` for `BoundaryModelLastiwka`
Jul 15, 2025
f285ccd
fix
Jul 15, 2025
91b0aab
Merge branch 'main' into fix-obc-extrapolation
Jul 23, 2025
5eb6442
add interpolation functions
Jul 23, 2025
81989b5
Merge branch 'main' into fix-obc-extrapolation
Jul 23, 2025
888ef53
restructure again
Jul 23, 2025
2cdd9e9
Merge branch 'main' into fix-obc-extrapolation
Jul 23, 2025
4fd1b32
fix gpu bugs
Jul 23, 2025
fb9f333
remove unnecessary argument
Jul 23, 2025
c5fa956
fix gpu again
Jul 23, 2025
0925255
fix gpu
Jul 24, 2025
3a001f3
implement suggestions
Jul 24, 2025
d611748
fix
Jul 24, 2025
70105bb
add comments
Jul 24, 2025
1425637
implement suggestions
Jul 24, 2025
956ad94
first prototype: NOT VALIDATED YET
Jul 24, 2025
b888b3f
fix avg vel in LastiwkaModel
Jul 25, 2025
df291e7
fix avg in mirroring
Jul 25, 2025
91b308f
fix tests
Jul 25, 2025
28061d2
adapt example file
Jul 25, 2025
99f5eaf
fix allocations
Jul 25, 2025
8136ba1
fix gpu
Jul 25, 2025
452b5c5
first GPU working prototype
Jul 26, 2025
df39f14
improve API
Jul 26, 2025
5f99a18
fix tests
Jul 26, 2025
ecabe1e
rm export
Jul 26, 2025
ced1f86
fix
Jul 26, 2025
42c7b3e
fix type stability
Jul 26, 2025
70422b9
implement suggestions
Jul 28, 2025
7e0d618
rm ref
Jul 28, 2025
fcfd477
format
Jul 28, 2025
440cb71
Merge branch 'fix-obc-extrapolation' into revise-open-boundaries
Jul 28, 2025
08de264
Rename 'tlsph' to 'place_on_shell' (#814)
svchb Jun 13, 2025
3e0b8d8
Merge branch 'dev' into revise-open-boundaries
Jul 29, 2025
0ed7dd5
fix merge bugs
Jul 29, 2025
0150a1f
supersede #852
Jul 29, 2025
95ee811
supersede #850
Jul 29, 2025
76411ff
fix
Jul 29, 2025
8ac88be
rename boundary models
Jul 29, 2025
2b94538
fix?
Jul 30, 2025
d45fbdd
fix tests
Jul 31, 2025
ce0ed1d
Rename 'tlsph' to 'place_on_shell' (#814)
svchb Jun 13, 2025
c77b0f6
Merge branch 'dev' into revise-open-boundaries
Jul 31, 2025
3367db3
fix characteristics
Aug 1, 2025
fcb7675
revise pipe flow example
Aug 1, 2025
49b10b3
fix include bug
Aug 1, 2025
c1e8589
Rename 'tlsph' to 'place_on_shell' (#814)
svchb Jun 13, 2025
b8309d3
Merge branch 'dev' into revise-open-boundaries
Aug 25, 2025
38f5f07
Merge branch 'main' into dev
efaulhaber Aug 26, 2025
b9d091c
Combine PST and TVF into a unified framework (#884)
efaulhaber Aug 26, 2025
1e4c4e3
Merge branch 'dev' into revise-open-boundaries
Aug 26, 2025
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
25 changes: 19 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@ TrixiParticles.jl follows the interpretation of
[semantic versioning (semver)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

## Version 0.4

### API Changes

- Combined transport velocity formulation (TVF) and particle shifting technique (PST) into
one unified framework.
The keyword argument `transport_velocity` now changed to `shifting_technique`.
The `ParticleShiftingCallback` has been removed. To use PST, use the `UpdateCallback`
instead, and pass `shifting_technique=ParticleShiftingTechnique()` to the system.

- Renamed the keyword argument `tlsph` to `place_on_shell` for `ParticlePackingSystem`,
`sample_boundary`, `extrude_geometry`, `RectangularShape`, and `SphereShape`.

## Version 0.3.1

### Features

- **Simplified SGS Viscosity Models**: Added ViscosityMorrisSGS and ViscosityAdamiSGS,
- **Simplified SGS Viscosity Models**: Added ViscosityMorrisSGS and ViscosityAdamiSGS,
which implement a simplified Smagorinsky-type sub-grid-scale viscosity. (#753)

- **Multithreaded Integration Array**: Introduced a new array type for CPU backends
- **Multithreaded Integration Array**: Introduced a new array type for CPU backends
that enables multithreaded broadcasting, delivering speed-ups of up to 5× on systems
with many threads when combined with thread pinning. (#722)

Expand All @@ -21,17 +34,17 @@ used in the Julia ecosystem. Notable changes will be documented in this file for
- **DXF file format support**: Import complex geometries using the DXF file format. (#821)

- **Improved Plane interpolation**: Massively improved interpolation performance for planes (#763).

### GPU

- Make PST GPU-compatible (#813).

- Make open boundaries GPU-compatible (#773).

- Make interpolation GPU-compatible (#812).

### Important Bugfixes

- Fix validation setups (#801).

- Calculate interpolated density instead of computed density when using interpolation (#808).
Expand Down
61 changes: 0 additions & 61 deletions docs/src/systems/entropically_damped_sph.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,64 +45,3 @@ is a good choice for a wide range of Reynolds numbers (0.0125 to 10000).
Modules = [TrixiParticles]
Pages = [joinpath("schemes", "fluid", "entropically_damped_sph", "system.jl")]
```

## [Transport Velocity Formulation (TVF)](@id transport_velocity_formulation)
Standard SPH suffers from problems like tensile instability or the creation of void regions in the flow.
To address these problems, [Adami (2013)](@cite Adami2013) modified the advection velocity and added an extra term to the momentum equation.
The authors introduced the so-called Transport Velocity Formulation (TVF) for WCSPH. [Ramachandran (2019)](@cite Ramachandran2019) applied the TVF
also for the [EDAC](@ref edac) scheme.

The transport velocity ``\tilde{v}_a`` of particle ``a`` is used to evolve the position of the particle ``r_a`` from one time step to the next by

```math
\frac{\mathrm{d} r_a}{\mathrm{d}t} = \tilde{v}_a
```

and is obtained at every time-step ``\Delta t`` from

```math
\tilde{v}_a (t + \Delta t) = v_a (t) + \Delta t \left(\frac{\tilde{\mathrm{d}} v_a}{\mathrm{d}t} - \frac{1}{\rho_a} \nabla p_{\text{background}} \right),
```

where ``\rho_a`` is the density of particle ``a`` and ``p_{\text{background}}`` is a constant background pressure field.
The tilde in the second term of the right hand side indicates that the material derivative has an advection part.

The discretized form of the last term is

```math
-\frac{1}{\rho_a} \nabla p_{\text{background}} \approx -\frac{p_{\text{background}}}{m_a} \sum_b \left(V_a^2 + V_b^2 \right) \nabla_a W_{ab},
```

where ``V_a``, ``V_b`` denote the volume of particles ``a`` and ``b`` respectively.
Note that although in the continuous case ``\nabla p_{\text{background}} = 0``, the discretization is not 0th-order consistent for **non**-uniform particle distribution,
which means that there is a non-vanishing contribution only when particles are disordered.
That also means that ``p_{\text{background}}`` occurs as prefactor to correct the trajectory of a particle resulting in uniform pressure distributions.
Suggested is a background pressure which is in the order of the reference pressure but can be chosen arbitrarily large when the time-step criterion is adjusted.

The inviscid momentum equation with an additional convection term for a particle moving with ``\tilde{v}`` is

```math
\frac{\tilde{\mathrm{d}} \left( \rho v \right)}{\mathrm{d}t} = -\nabla p + \nabla \cdot \bm{A},
```

where the tensor ``\bm{A} = \rho v\left(\tilde{v}-v\right)^T`` is a consequence of the modified
advection velocity and can be interpreted as the convection of momentum with the relative velocity ``\tilde{v}-v``.

The discretized form of the momentum equation for a particle ``a`` reads as

```math
\frac{\tilde{\mathrm{d}} v_a}{\mathrm{d}t} = \frac{1}{m_a} \sum_b \left(V_a^2 + V_b^2 \right) \left[ -\tilde{p}_{ab} \nabla_a W_{ab} + \frac{1}{2} \left(\bm{A}_a + \bm{A}_b \right) \cdot \nabla_a W_{ab} \right].
```

Here, ``\tilde{p}_{ab}`` is the density-weighted pressure

```math
\tilde{p}_{ab} = \frac{\rho_b p_a + \rho_a p_b}{\rho_a + \rho_b},
```

with the density ``\rho_a``, ``\rho_b`` and the pressure ``p_a``, ``p_b`` of particles ``a`` and ``b`` respectively. ``\bm{A}_a`` and ``\bm{A}_b`` are the convection tensors for particle ``a`` and ``b`` respectively and are given, e.g. for particle ``a``, as ``\bm{A}_a = \rho v_a\left(\tilde{v}_a-v_a\right)^T``.

```@autodocs
Modules = [TrixiParticles]
Pages = [joinpath("schemes", "fluid", "transport_velocity.jl")]
```
70 changes: 68 additions & 2 deletions docs/src/systems/weakly_compressible_sph.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,74 @@ as explained in [Sun2018](@cite Sun2018) on page 29, right above Equation 9.
The ``\delta``-SPH method (WCSPH with density diffusion) together with this formulation
of PST is commonly referred to as ``\delta^+``-SPH.

The Particle Shifting Technique can be applied in form
of the [`ParticleShiftingCallback`](@ref).
To apply particle shifting, use the keyword argument `shifting_technique` in the constructor
of a system that supports it.


## [Transport Velocity Formulation (TVF)](@id transport_velocity_formulation)

An alternative formulation is the so-called Transport Velocity Formulation (TVF)
by [Adami (2013)](@cite Adami2013).
[Ramachandran (2019)](@cite Ramachandran2019) applied the TVF also for the [EDAC](@ref edac)
scheme.

The transport velocity ``\tilde{v}_a`` of particle ``a`` is used to evolve the position
of the particle ``r_a`` from one time step to the next by
```math
\frac{\mathrm{d} r_a}{\mathrm{d}t} = \tilde{v}_a
```
and is obtained at every time step ``\Delta t`` from
```math
\tilde{v}_a (t + \Delta t) = v_a (t) + \Delta t \left(\frac{\tilde{\mathrm{d}} v_a}{\mathrm{d}t} - \frac{1}{\rho_a} \nabla p_{\text{background}} \right),
```
where ``\rho_a`` is the density of particle ``a`` and ``p_{\text{background}}``
is a constant background pressure field.
The tilde in the second term of the right-hand side indicates that the material derivative
has an advection part.

The discretized form of the last term is
```math
-\frac{1}{\rho_a} \nabla p_{\text{background}} \approx -\frac{p_{\text{background}}}{m_a} \sum_b \left(V_a^2 + V_b^2 \right) \nabla_a W_{ab},
```
where ``V_a``, ``V_b`` denote the volume of particles ``a`` and ``b`` respectively.
Note that although in the continuous case ``\nabla p_{\text{background}} = 0``,
the discretization is not 0th-order consistent for **non**-uniform particle distribution,
which means that there is a non-vanishing contribution only when particles are disordered.
That also means that ``p_{\text{background}}`` occurs as pre-factor to correct
the trajectory of a particle resulting in uniform pressure distributions.
Suggested is a background pressure which is in the order of the reference pressure,
but it can be chosen arbitrarily large when the time-step criterion is adjusted.

The inviscid momentum equation with an additional convection term for a particle
moving with ``\tilde{v}`` is
```math
\frac{\tilde{\mathrm{d}} \left( \rho v \right)}{\mathrm{d}t} = -\nabla p + \nabla \cdot \bm{A},
```
where the tensor ``\bm{A} = \rho v\left(\tilde{v}-v\right)^T`` is a consequence
of the modified advection velocity and can be interpreted as the convection of momentum
with the relative velocity ``\tilde{v}-v``.

The discretized form of the momentum equation for a particle ``a`` reads as
```math
\frac{\tilde{\mathrm{d}} v_a}{\mathrm{d}t} = \frac{1}{m_a} \sum_b \left(V_a^2 + V_b^2 \right) \left[ -\tilde{p}_{ab} \nabla_a W_{ab} + \frac{1}{2} \left(\bm{A}_a + \bm{A}_b \right) \cdot \nabla_a W_{ab} \right].
```
Here, ``\tilde{p}_{ab}`` is the density-weighted pressure
```math
\tilde{p}_{ab} = \frac{\rho_b p_a + \rho_a p_b}{\rho_a + \rho_b},
```
with the density ``\rho_a``, ``\rho_b`` and the pressure ``p_a``, ``p_b`` of particles ``a``
and ``b``, respectively. ``\bm{A}_a`` and ``\bm{A}_b`` are the convection tensors
for particle ``a`` and ``b``, respectively, and are given, e.g., for particle ``a``,
as ``\bm{A}_a = \rho v_a\left(\tilde{v}_a-v_a\right)^T``.

To apply the TVF, use the keyword argument `shifting_technique` in the constructor
of a system that supports it.

```@autodocs
Modules = [TrixiParticles]
Pages = [joinpath("schemes", "fluid", "shifting_techniques.jl")]
```


## [Tensile Instability Control](@id tic)

Expand Down
3 changes: 2 additions & 1 deletion examples/dem/collapsing_sand_pile_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ min_coords_floor = (min_boundary[1] - boundary_thickness,
floor_particles = RectangularShape(particle_spacing,
(n_particles_floor_x, n_particles_floor_y,
n_particles_floor_z),
min_coords_floor; density=boundary_density, tlsph=true)
min_coords_floor; density=boundary_density,
place_on_shell=true)
boundary_particles = floor_particles

# ==========================================================================================
Expand Down
4 changes: 2 additions & 2 deletions examples/fluid/lid_driven_cavity_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ if wcsph
state_equation, smoothing_kernel,
pressure_acceleration=TrixiParticles.inter_particle_averaged_pressure,
smoothing_length, viscosity=viscosity,
transport_velocity=TransportVelocityAdami(pressure))
shifting_technique=TransportVelocityAdami(pressure))
else
state_equation = nothing
density_calculator = ContinuityDensity()
fluid_system = EntropicallyDampedSPHSystem(cavity.fluid, smoothing_kernel,
smoothing_length,
density_calculator=density_calculator,
sound_speed, viscosity=viscosity,
transport_velocity=TransportVelocityAdami(pressure))
shifting_technique=TransportVelocityAdami(pressure))
end

# ==========================================================================================
Expand Down
2 changes: 1 addition & 1 deletion examples/fluid/periodic_array_of_cylinders_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ smoothing_length = 1.2 * particle_spacing
smoothing_kernel = SchoenbergQuarticSplineKernel{2}()
fluid_system = EntropicallyDampedSPHSystem(fluid, smoothing_kernel, smoothing_length,
sound_speed, viscosity=ViscosityAdami(; nu),
transport_velocity=TransportVelocityAdami(pressure),
shifting_technique=TransportVelocityAdami(pressure),
acceleration=(acceleration_x, 0.0))

# ==========================================================================================
Expand Down
3 changes: 2 additions & 1 deletion examples/fluid/periodic_channel_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ initial_fluid_size = tank_size
initial_velocity = (1.0, 0.0)

fluid_density = 1000.0
sound_speed = initial_velocity[1]
sound_speed = 10 * initial_velocity[1]
state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density,
exponent=7)

Expand All @@ -48,6 +48,7 @@ viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
shifting_technique=nothing,
pressure_acceleration=nothing)

# ==========================================================================================
Expand Down
Loading
Loading