Skip to content

Commit d69f03d

Browse files
author
LasNikas
committed
add docs
1 parent ac9108c commit d69f03d

3 files changed

Lines changed: 67 additions & 10 deletions

File tree

docs/src/refs.bib

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,19 @@ @Article{Li1996
406406
publisher = {Elsevier BV},
407407
}
408408

409+
@Article{Liu2006,
410+
author = {Liu, M.B. and Liu, G.R.},
411+
journal = {Applied Numerical Mathematics},
412+
title = {Restoring particle consistency in smoothed particle hydrodynamics},
413+
year = {2006},
414+
issn = {0168-9274},
415+
month = jan,
416+
number = {1},
417+
pages = {19--36},
418+
volume = {56},
419+
doi = {10.1016/j.apnum.2005.02.012},
420+
publisher = {Elsevier BV},
421+
}
409422

410423
@Article{Molteni2009,
411424
author = {Molteni, Diego and Colagrossi, Andrea},
@@ -561,6 +574,19 @@ @Article{Negi2020
561574
publisher = {Elsevier BV},
562575
}
563576

577+
@Article{Negi2022,
578+
author = {Negi, Pawan and Ramachandran, Prabhu},
579+
journal = {Physics of Fluids},
580+
title = {How to train your solver: Verification of boundary conditions for smoothed particle hydrodynamics},
581+
year = {2022},
582+
issn = {1089-7666},
583+
month = nov,
584+
number = {11},
585+
volume = {34},
586+
doi = {10.1063/5.0126234},
587+
publisher = {AIP Publishing},
588+
}
589+
564590
@Article{O’Connor2021,
565591
author = {O’Connor, Joseph and Rogers, Benedict D.},
566592
journal = {Journal of Fluids and Structures},

src/schemes/boundary/open_boundary/method_of_characteristics.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@doc raw"""
2-
BoundaryModelLastiwka(; extrapolate_reference_values::Bool=false)
2+
BoundaryModelLastiwka(; extrapolate_reference_values=nothing)
33
44
Boundary model for [`OpenBoundarySPHSystem`](@ref).
55
This model uses the characteristic variables to propagate the appropriate values
@@ -8,15 +8,19 @@ It requires a specific flow direction to be passed to the [`BoundaryZone`](@ref)
88
For more information about the method see [description below](@ref method_of_characteristics).
99
1010
# Keywords
11-
- `extrapolate_reference_values=false`: If `true`, the reference values are extrapolated
12-
from the fluid domain to the boundary particles.
11+
- `extrapolate_reference_values=nothing`: If one of the follwoing mirror methods is choosen,
12+
the reference values are extrapolated from the fluid domain to the boundary particles.
13+
- [`ZerothOrderMirroring`](@ref)
14+
- [`FirstOrderMirroring`](@ref)
15+
- [`SimpleMirroring`](@ref)
16+
1317
**Note:** This feature is experimental and has not been fully validated yet.
1418
As of now, we are not aware of any published literature supporting its use.
1519
"""
16-
struct BoundaryModelLastiwka
17-
extrapolate_reference_values::Bool
18-
function BoundaryModelLastiwka(; extrapolate_reference_values::Bool=false)
19-
return new{}(extrapolate_reference_values)
20+
struct BoundaryModelLastiwka{T}
21+
extrapolate_reference_values::T
22+
function BoundaryModelLastiwka(; extrapolate_reference_values=nothing)
23+
return new{typeof(extrapolate_reference_values)}(extrapolate_reference_values)
2024
end
2125
end
2226

@@ -31,13 +35,14 @@ end
3135

3236
sound_speed = system_sound_speed(fluid_system)
3337

34-
if boundary_model.extrapolate_reference_values
38+
if !isnothing(boundary_model.extrapolate_reference_values)
3539
(; prescribed_pressure, prescribed_velocity, prescribed_density) = cache
3640
v_fluid = wrap_v(v_ode, fluid_system, semi)
3741
u_fluid = wrap_u(u_ode, fluid_system, semi)
3842

3943
@trixi_timeit timer() "extrapolate and correct values" begin
40-
extrapolate_values!(system, v, v_fluid, u, u_fluid, semi, t;
44+
extrapolate_values!(system, boundary_model.extrapolate_reference_values,
45+
v, v_fluid, u, u_fluid, semi, t;
4146
prescribed_pressure, prescribed_velocity,
4247
prescribed_density)
4348
end

src/schemes/boundary/open_boundary/mirroring.jl

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,56 @@
11
@doc raw"""
2-
BoundaryModelTafuni()
2+
BoundaryModelTafuni(; mirror_method=FirstOrderMirroring(; firstorder_tolerance=1e-3))
33
44
Boundary model for the `OpenBoundarySPHSystem`.
55
This model implements the method of [Tafuni et al. (2018)](@cite Tafuni2018) to extrapolate the properties from the fluid domain
66
to the buffer zones (inflow and outflow) using ghost nodes.
77
The position of the ghost nodes is obtained by mirroring the boundary particles
88
into the fluid along a direction that is normal to the open boundary.
9+
Fluid properties are then interpolated at these ghost node positions using surrounding fluid particles.
10+
The values are then mirrored back to the boundary particles.
11+
We provide three different mirroring methods:
12+
- [`ZerothOrderMirroring`](@ref): Uses a Shepard interpolation to interpolate the values.
13+
- [`FirstOrderMirroring`](@ref): Uses a first order correction based on the gradient of the interpolated values .
14+
- [`SimpleMirroring`](@ref): Similar to the first order mirroring, but does not use the gradient of the interpolated values.
915
"""
1016
struct BoundaryModelTafuni{MM}
1117
mirror_method::MM
1218
end
1319

20+
"""
21+
FirstOrderMirroring
22+
23+
Fluid properties are interpolated onto ghost nodes using the method propsed by [Liu and Liu (2006)](@cite Liu2006),
24+
to retrieve first oder kernel and particle consistency.
25+
"""
1426
struct FirstOrderMirroring{ELTYPE}
1527
firstorder_tolerance::ELTYPE
1628
function FirstOrderMirroring(; firstorder_tolerance::ELTYPE=1e-3) where {ELTYPE}
1729
return new{typeof(firstorder_tolerance)}(firstorder_tolerance)
1830
end
1931
end
2032

33+
"""
34+
SimpleMirroring
35+
36+
This method is similar to [`FirstOrderMirroring`](@ref), but does not use
37+
the corrected gradient as proposed by [Negi et al. (2022)](@cite Negi2022).
38+
"""
2139
struct SimpleMirroring{ELTYPE}
2240
firstorder_tolerance::ELTYPE
2341
function SimpleMirroring(; firstorder_tolerance::Real=1e-3)
2442
return new{typeof(firstorder_tolerance)}(firstorder_tolerance)
2543
end
2644
end
2745

46+
"""
47+
ZerothOrderMirroring
48+
49+
Fluid properties are interpolated onto ghost nodes using Shepard interpolation.
50+
The position of the ghost nodes is obtained by mirroring the boundary particles
51+
into the fluid along a direction that is normal to the open boundary.
52+
The interpolated values at the ghost nodes are then assigned to the corresponding boundary particles.
53+
"""
2854
struct ZerothOrderMirroring end
2955

3056
function BoundaryModelTafuni(;

0 commit comments

Comments
 (0)