Skip to content

Commit cecb8c0

Browse files
authored
Merge dev into main for major release 0.4 (#832)
2 parents 63c4382 + e970b59 commit cecb8c0

146 files changed

Lines changed: 4180 additions & 2981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NEWS.md

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ TrixiParticles.jl follows the interpretation of
44
[semantic versioning (semver)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
55
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.
66

7+
## Version 0.4
8+
9+
### API Changes
10+
11+
- Renamed `BoundarySPHSystem` to `WallBoundarySystem` and the keyword argument
12+
`movement` to `prescribed_motion`.
13+
14+
- Renamed `OpenBoundarySPHSystem` to `OpenBoundarySystem`.
15+
16+
- Renamed `BoundaryMovement` to `PrescribedMotion`. The `movement_function` must now be
17+
a function of `(x, t)` returning the *new position* instead of an offset.
18+
For example, `movement_function(t) = SVector(t, 0.0)` now needs to be
19+
`movement_function(x, t) = x + SVector(t, 0.0)`.
20+
21+
- Renamed directory `solid` to `structure` in the examples file tree.
22+
VTK files for the `TotalLagrangianSPHSystem` are now also called `structure_*`.
23+
24+
- Renamed keyword argument `n_fixed_particles` of the `TotalLagrangianSPHSystem`
25+
to `n_clamped_particles`.
26+
27+
- API for `OpenBoundarySystem` and `BoundaryZone` changed.
28+
It is now possible to pass multiple `BoundaryZone`s to a single `OpenBoundarySystem`.
29+
Reference values are now assigned individually to each `BoundaryZone`. (#866)
30+
31+
- Rename keyword arguments `plane` and `plane_normal` for `BoundaryZone` to `boundary_face` and `face_normal` (#597).
32+
33+
- The argument of `TransportVelocityAdami` is now a keyword argument.
34+
`TransportVelocityAdami(1000.0)` now becomes
35+
`TransportVelocityAdami(background_pressure=1000.0)` (#884).
36+
37+
- Combined transport velocity formulation (TVF) and particle shifting technique (PST) into
38+
one unified framework.
39+
The keyword argument `transport_velocity` now changed to `shifting_technique`.
40+
The `ParticleShiftingCallback` has been removed. To use PST, use the `UpdateCallback`
41+
instead, and pass `shifting_technique=ParticleShiftingTechniqueSun2017()` to the system (#884).
42+
43+
- Renamed the keyword argument `tlsph` to `place_on_shell` for `ParticlePackingSystem`,
44+
`sample_boundary`, `extrude_geometry`, `RectangularShape`, and `SphereShape` (#814).
45+
46+
- Custom quantity functions passed to `SolutionSavingCallback` or `PostprocessCallback`
47+
that were not using the documented API but were functions of
48+
`(system, v_ode, u_ode, semi, t)` now need to be functions
49+
of `(system, dv_ode, du_ode, v_ode, u_ode, semi, t)` (#879).
50+
51+
- Renamed `each_moving_particle` to `each_integrated_particle`,
52+
`n_moving_particles` to `n_integrated_particles`
53+
and `active_particles` to `each_active_particle`.
54+
55+
### Features
56+
57+
- Added consistent particle shifting by Sun et al. (2019) as `ConsistentShiftingSun2019` (#888).
58+
59+
760
## Version 0.3.2
861
### Features
962

@@ -19,18 +72,17 @@ used in the Julia ecosystem. Notable changes will be documented in this file for
1972

2073
- Fix the coordinates used for TLSPH in Adami extrapolation (#853)
2174
- Fix PST for small smoothing length factors (#834)
22-
- The TVF model has been improved to integrate correctly with time stepping (#864)
23-
75+
- The TVF model has been improved to integrate correctly with time stepping (#864)
2476

2577

2678
## Version 0.3.1
2779

2880
### Features
2981

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

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

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

4294
- **Improved Plane interpolation**: Massively improved interpolation performance for planes (#763).
43-
95+
4496
### GPU
4597

4698
- Make PST GPU-compatible (#813).
47-
99+
48100
- Make open boundaries GPU-compatible (#773).
49-
101+
50102
- Make interpolation GPU-compatible (#812).
51103

52104
### Important Bugfixes
53-
105+
54106
- Fix validation setups (#801).
55107

56108
- Calculate interpolated density instead of computed density when using interpolation (#808).
@@ -230,4 +282,3 @@ Features:
230282
#### TLSPH
231283

232284
An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions).
233-

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TrixiParticles"
22
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a"
33
authors = ["erik.faulhaber <44124897+efaulhaber@users.noreply.github.com>"]
4-
version = "0.3.2"
4+
version = "0.4"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -27,6 +27,7 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
2727
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2828
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2929
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
30+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3031
StrideArraysCore = "7792a7ef-975c-4747-a70f-980b88e8d1da"
3132
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
3233
TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284"

docs/src/gpu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
GPU support is still an experimental feature that is actively being worked on.
44
Currently, the [`WeaklyCompressibleSPHSystem`](@ref), [`TotalLagrangianSPHSystem`](@ref)
5-
and [`BoundarySPHSystem`](@ref) support GPU execution.
5+
and [`WallBoundarySystem`](@ref) support GPU execution.
66
We have tested GPU support on Nvidia, AMD and Apple GPUs.
77
Note that most Apple GPUs do not support `Float64`.
88
See [below on how to run single precision simulations](@ref single_precision).

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},

docs/src/systems/boundary.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Boundary System
22

33
```@docs
4-
BoundarySPHSystem
4+
WallBoundarySystem
55
```
66

77
```@docs
88
BoundaryDEMSystem
99
```
1010

1111
```@docs
12-
BoundaryMovement
12+
PrescribedMotion
1313
```
1414

1515

@@ -61,7 +61,7 @@ We provide six options to compute the boundary density and pressure, determined
6161
This option usually yields the best results of the options listed here.
6262
2. (Only relevant for FSI) With [`BernoulliPressureExtrapolation`](@ref), the pressure is extrapolated from the
6363
pressure similar to the [`AdamiPressureExtrapolation`](@ref), but a relative velocity-dependent pressure part
64-
is calculated between moving solids and fluids, which increases the boundary pressure in areas prone to
64+
is calculated between moving bodies and fluids, which increases the boundary pressure in areas prone to
6565
penetrations.
6666
3. With [`SummationDensity`](@ref), the density is calculated by summation over the neighboring particles,
6767
and the pressure is computed from the density with the state equation.
@@ -103,7 +103,7 @@ Identical to the pressure ``p_b `` calculated via [`AdamiPressureExtrapolation`]
103103
p_b = \frac{\sum_f (p_f + \frac{1}{2} \, \rho_{\text{neighbor}} \left( \frac{ (\mathbf{v}_f - \mathbf{v}_{\text{body}}) \cdot (\mathbf{x}_f - \mathbf{x}_{\text{neighbor}}) }{ \left\| \mathbf{x}_f - \mathbf{x}_{\text{neighbor}} \right\| } \right)^2 \times \text{factor} +\rho_f (\bm{g} - \bm{a}_b) \cdot \bm{r}_{bf}) W(\Vert r_{bf} \Vert, h)}{\sum_f W(\Vert r_{bf} \Vert, h)}
104104
```
105105
where ``\mathbf{v}_f`` is the velocity of the fluid and ``\mathbf{v}_{\text{body}}`` is the velocity of the body.
106-
This adjustment provides a higher boundary pressure for solid bodies moving with a relative velocity to the fluid to prevent penetration.
106+
This adjustment provides a higher boundary pressure for bodies moving with a relative velocity to the fluid to prevent penetration.
107107
This modification is original and not derived from any literature source.
108108

109109
```@docs
@@ -217,9 +217,8 @@ a no-slip condition is imposed. When omitting the viscous interaction
217217
!!! warning
218218
The no-slip conditions for `BoundaryModelMonaghanKajtar` have not been verified yet.
219219

220-
```@autodocs
221-
Modules = [TrixiParticles]
222-
Pages = [joinpath("schemes", "boundary", "monaghan_kajtar", "monaghan_kajtar.jl")]
220+
```@docs
221+
BoundaryModelMonaghanKajtar
223222
```
224223

225224
# [Open Boundaries](@id open_boundary)
@@ -234,6 +233,11 @@ Modules = [TrixiParticles]
234233
Pages = [joinpath("schemes", "boundary", "open_boundary", "boundary_zones.jl")]
235234
```
236235

236+
```@autodocs
237+
Modules = [TrixiParticles]
238+
Filter = t -> typeof(t) === typeof(TrixiParticles.planar_geometry_to_face)
239+
```
240+
237241
# [Open Boundary Models](@id open_boundary_models)
238242
We offer two models for open boundaries, with the choice depending on the specific problem and flow characteristics near the boundary:
239243
1. [**Method of characteristics**](@ref method_of_characteristics): The method of characteristics is typically used in problems where tracking of wave propagation

docs/src/systems/dem.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ and moments acting upon them.
1919

2020
```@autodocs
2121
Modules = [TrixiParticles]
22-
Pages = [joinpath("schemes", "solid", "discrete_element_method", "system.jl")]
22+
Pages = [joinpath("schemes", "structure", "discrete_element_method", "system.jl")]
2323
```
2424

2525
### Contact Models
2626

2727
```@autodocs
2828
Modules = [TrixiParticles]
29-
Pages = [joinpath("schemes", "solid", "discrete_element_method", "contact_models.jl")]
29+
Pages = [joinpath("schemes", "structure", "discrete_element_method", "contact_models.jl")]
3030
```

docs/src/systems/entropically_damped_sph.md

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ this scheme uses a pressure evolution equation to calculate the pressure
77
```
88
which is derived by [Clausen (2013)](@cite Clausen2013). This equation is similar to the continuity equation (first term, see
99
[`ContinuityDensity`](@ref)), but also contains a pressure damping term (second term, similar to density diffusion
10-
see [`DensityDiffusion`](@ref)), which reduces acoustic pressure waves through an entropy-generation mechanism.
10+
see [`AbstractDensityDiffusion`](@ref TrixiParticles.AbstractDensityDiffusion)),
11+
which reduces acoustic pressure waves through an entropy-generation mechanism.
1112

1213
The pressure evolution is discretized with the SPH method by [Ramachandran (2019)](@cite Ramachandran2019) as following:
1314

@@ -45,64 +46,3 @@ is a good choice for a wide range of Reynolds numbers (0.0125 to 10000).
4546
Modules = [TrixiParticles]
4647
Pages = [joinpath("schemes", "fluid", "entropically_damped_sph", "system.jl")]
4748
```
48-
49-
## [Transport Velocity Formulation (TVF)](@id transport_velocity_formulation)
50-
Standard SPH suffers from problems like tensile instability or the creation of void regions in the flow.
51-
To address these problems, [Adami (2013)](@cite Adami2013) modified the advection velocity and added an extra term to the momentum equation.
52-
The authors introduced the so-called Transport Velocity Formulation (TVF) for WCSPH. [Ramachandran (2019)](@cite Ramachandran2019) applied the TVF
53-
also for the [EDAC](@ref edac) scheme.
54-
55-
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
56-
57-
```math
58-
\frac{\mathrm{d} r_a}{\mathrm{d}t} = \tilde{v}_a
59-
```
60-
61-
and is obtained at every time-step ``\Delta t`` from
62-
63-
```math
64-
\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),
65-
```
66-
67-
where ``\rho_a`` is the density of particle ``a`` and ``p_{\text{background}}`` is a constant background pressure field.
68-
The tilde in the second term of the right hand side indicates that the material derivative has an advection part.
69-
70-
The discretized form of the last term is
71-
72-
```math
73-
-\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},
74-
```
75-
76-
where ``V_a``, ``V_b`` denote the volume of particles ``a`` and ``b`` respectively.
77-
Note that although in the continuous case ``\nabla p_{\text{background}} = 0``, the discretization is not 0th-order consistent for **non**-uniform particle distribution,
78-
which means that there is a non-vanishing contribution only when particles are disordered.
79-
That also means that ``p_{\text{background}}`` occurs as prefactor to correct the trajectory of a particle resulting in uniform pressure distributions.
80-
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.
81-
82-
The inviscid momentum equation with an additional convection term for a particle moving with ``\tilde{v}`` is
83-
84-
```math
85-
\frac{\tilde{\mathrm{d}} \left( \rho v \right)}{\mathrm{d}t} = -\nabla p + \nabla \cdot \bm{A},
86-
```
87-
88-
where the tensor ``\bm{A} = \rho v\left(\tilde{v}-v\right)^T`` is a consequence of the modified
89-
advection velocity and can be interpreted as the convection of momentum with the relative velocity ``\tilde{v}-v``.
90-
91-
The discretized form of the momentum equation for a particle ``a`` reads as
92-
93-
```math
94-
\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].
95-
```
96-
97-
Here, ``\tilde{p}_{ab}`` is the density-weighted pressure
98-
99-
```math
100-
\tilde{p}_{ab} = \frac{\rho_b p_a + \rho_a p_b}{\rho_a + \rho_b},
101-
```
102-
103-
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``.
104-
105-
```@autodocs
106-
Modules = [TrixiParticles]
107-
Pages = [joinpath("schemes", "fluid", "transport_velocity.jl")]
108-
```

docs/src/systems/total_lagrangian_sph.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The term $\bm{f}_a^{PF}$ is an optional penalty force. See e.g. [`PenaltyForceGa
5959

6060
```@autodocs
6161
Modules = [TrixiParticles]
62-
Pages = [joinpath("schemes", "solid", "total_lagrangian_sph", "system.jl")]
62+
Pages = [joinpath("schemes", "structure", "total_lagrangian_sph", "system.jl")]
6363
```
6464

6565
## Penalty Force
@@ -100,7 +100,7 @@ where the error vector is defined as
100100

101101
```@autodocs
102102
Modules = [TrixiParticles]
103-
Pages = [joinpath("schemes", "solid", "total_lagrangian_sph", "penalty_force.jl")]
103+
Pages = [joinpath("schemes", "structure", "total_lagrangian_sph", "penalty_force.jl")]
104104
```
105105

106106
## Viscosity

0 commit comments

Comments
 (0)