Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
f1400fd
Update vtk2trixi function to return `NamedTuple` instead of `InitialC…
marcelschurer Oct 17, 2025
217f711
Refactor vtk2trixi function to accept custom fields
marcelschurer Oct 17, 2025
0fa5900
Enhance vtk2trixi function to support scalar and vector custom quanti…
marcelschurer Oct 20, 2025
66f83a3
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Oct 20, 2025
38a9b2a
Fix typo in documentation for vtk2trixi function
marcelschurer Oct 21, 2025
5d1192a
Fix capitalization in comments
marcelschurer Oct 23, 2025
0713bdd
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Oct 23, 2025
2cf2b1c
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Nov 10, 2025
eb98b4f
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Nov 14, 2025
1d33e8b
Merge branch 'main' into vtk2trixi-return-named-tuple
LasNikas Nov 20, 2025
0b22696
Merge branch 'main' into vtk2trixi-return-named-tuple
svchb Nov 21, 2025
7e51a81
add ELTYPE
Nov 22, 2025
cac637d
Merge branch 'main' into read-with-eltype
Nov 22, 2025
ffa4a1c
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Dec 3, 2025
c51f2ac
Merge branch 'vtk2trixi-return-named-tuple' of https://github.com/mar…
marcelschurer Dec 3, 2025
2b2fb72
Fix formatting in documentation
marcelschurer Dec 3, 2025
d460b88
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Dec 3, 2025
a621cca
Merge branch 'main' into read-with-eltype
Dec 8, 2025
1b889b4
Merge branch 'main' into read-with-eltype
Dec 8, 2025
b043bd1
add `coordinates_eltype`
Dec 8, 2025
de55ebd
Merge branch 'main' into read-with-eltype
Dec 9, 2025
9515f84
Merge branch 'main' into vtk2trixi-return-named-tuple
marcelschurer Dec 9, 2025
a9b0f2f
Corrected failing doctest output
marcelschurer Dec 9, 2025
0359425
first prototype
Dec 10, 2025
fd15671
write Q
Dec 10, 2025
364e24e
gpu fix
Dec 10, 2025
c1b0abf
add checks
Dec 10, 2025
eeebcc2
add docs
Dec 10, 2025
d8b5b00
Corrected failing doctest output
marcelschurer Dec 10, 2025
d21a549
adapt pressure model
Dec 10, 2025
b4020c8
use `foreach_no_alloc`
Dec 11, 2025
55be6a6
fix unit tests
Dec 11, 2025
4fe3c7d
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 11, 2025
a431873
fix unit tests
Dec 11, 2025
b27e54d
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 11, 2025
9339bcb
fix unit tests
Dec 11, 2025
5aa8f30
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 11, 2025
d8cda93
fix doc tests
Dec 11, 2025
be8a23e
better docs
Dec 11, 2025
8aff117
use stored type
Dec 12, 2025
868b449
add docs
Dec 12, 2025
6e390c2
add tests
Dec 12, 2025
f3a981b
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 12, 2025
6121e7d
fix formatting
Dec 12, 2025
dc02bd8
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 13, 2025
7369f71
fix eltype
Dec 13, 2025
3682dd8
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Dec 13, 2025
3a97e49
Merge branch 'main' into fix_pressure_model
Dec 15, 2025
4dcece2
Merge branch 'main' into flow-rate-per-boundary-zone
Dec 15, 2025
38e376a
Merge branch 'main' into read-with-eltype
Dec 15, 2025
f347da8
Merge branch 'main' into vtk2trixi-return-named-tuple
LasNikas Dec 16, 2025
b25415f
Merge remote-tracking branch 'marcel/vtk2trixi-return-named-tuple' in…
Dec 16, 2025
a912326
revise #959
Dec 16, 2025
29b5b1a
fix buffer
Jan 6, 2026
daceea2
first poc
Jan 6, 2026
039dd13
Merge branch 'poc-restart' into restart-from-vtu
Jan 6, 2026
e9750b0
add show
Jan 6, 2026
695fe6c
remove mass
Jan 6, 2026
3acfe6c
Merge branch 'poc-restart' into restart-from-vtu
Jan 6, 2026
2d8bce8
add preconditioning
Jan 6, 2026
616a2dc
fix inactive particles
Jan 6, 2026
a80518c
fix zone IDs
Jan 6, 2026
439cb6b
add test
Jan 6, 2026
f3049a4
make it gpu compatible
Jan 6, 2026
1c7cd38
add gpu tests
Jan 6, 2026
c605502
fix tests
Jan 7, 2026
5987957
Merge branch 'poc-restart' into restart-from-vtu
Jan 7, 2026
1cada77
add checks
Jan 7, 2026
100590e
add example
Jan 7, 2026
358848d
add docs
Jan 7, 2026
2b56dc8
fix typo
Jan 7, 2026
63b760a
Merge branch 'main' into flow-rate-per-boundary-zone
Jan 7, 2026
7c08761
implement suggestions
Jan 7, 2026
90402fb
Merge branch 'main' into read-with-eltype
Jan 7, 2026
4a6bca1
implement suggestions
Jan 7, 2026
bbeade4
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Jan 7, 2026
f8f788c
implement suggestions
Jan 7, 2026
ce0febf
Merge branch 'main' into read-with-eltype
Jan 7, 2026
9e4276a
use strings instead of RestartConditin
Jan 7, 2026
7564985
add test mixed types
Jan 7, 2026
2e744db
Merge branch 'main' into flow-rate-per-boundary-zone
Jan 7, 2026
b831fa5
Merge branch 'flow-rate-per-boundary-zone' into fix_pressure_model
Jan 7, 2026
6848fbf
Merge branch 'fix_pressure_model' into restart-from-vtu
Jan 7, 2026
c4ce276
Merge branch 'main' into poc-restart
Jan 7, 2026
5c600c4
Merge branch 'read-with-eltype' into poc-restart
Jan 7, 2026
54190e6
Merge branch 'poc-restart' into restart-from-vtu
Jan 7, 2026
16fcfba
Merge branch 'main' into vtk2trixi-return-named-tuple
Jan 10, 2026
cfba71c
add NEWS entry
Jan 10, 2026
2dcbc76
revise
Jan 10, 2026
0d587cd
fix doc test
Jan 10, 2026
f316d3d
Merge branch 'main' into restart-from-vtu
Jan 10, 2026
bb4e7da
Merge branch 'vtk2trixi-return-named-tuple' into restart-from-vtu
Jan 10, 2026
48a79e1
rm test file
Jan 10, 2026
f264c9a
fix merge bugs
Jan 10, 2026
df63263
fix preconditioning
Jan 10, 2026
e26a569
Merge branch 'main' into restart-from-vtu
Jan 13, 2026
47bc4c2
don't read IC
Jan 13, 2026
2ca0551
Merge branch 'main' into vtk2trixi-return-named-tuple
Jan 13, 2026
5afcc47
Merge branch 'main' into restart-from-vtu
Jan 15, 2026
ae5496a
fix merge bug
Jan 15, 2026
143e9dc
Merge branch 'dev' into vtk2trixi-return-named-tuple
Jan 19, 2026
cf0a4a2
Merge branch 'main' into vtk2trixi-return-named-tuple
Jan 20, 2026
a1fc021
fix NEWS entry
Jan 20, 2026
32872b0
Merge branch 'dev' into vtk2trixi-return-named-tuple
Jan 21, 2026
ab1476b
Merge branch 'vtk2trixi-return-named-tuple' into restart-from-vtu
Jan 21, 2026
8c50353
fix merge bug
Jan 22, 2026
6fa813a
Merge branch 'vtk2trixi-return-named-tuple' into restart-from-vtu
Jan 22, 2026
4b3b911
fix formatting
Jan 22, 2026
55635fc
better name
Jan 22, 2026
f02d724
add more tests
Jan 22, 2026
2542c15
Merge branch 'main' into restart-from-vtu
Apr 17, 2026
21853d3
Merge branch 'dev' into restart-from-vtu
Apr 17, 2026
6221cbc
revise example
Apr 17, 2026
16ee9d1
Merge branch 'dev' into restart-from-vtu
Apr 20, 2026
d69528d
Merge branch 'dev' into restart-from-vtu
Apr 22, 2026
ce37610
Merge branch 'dev' into restart-from-vtu
LasNikas Apr 28, 2026
68a7f28
Merge branch 'main' into restart-from-vtu
LasNikas Apr 29, 2026
1fbb618
Merge branch 'main' into restart-from-vtu
LasNikas May 8, 2026
c96fc3c
Merge branch 'main' into restart-from-vtu
May 9, 2026
ad7c722
Merge branch 'main' into restart-from-vtu
May 13, 2026
8ba5006
implement suggestions
May 13, 2026
393b644
add structure example
May 13, 2026
efeb666
add tests
May 13, 2026
a95dd22
fix description
May 13, 2026
d05f198
fix tests
May 13, 2026
c92869c
avoid outputs
May 13, 2026
64d41c4
add NEWS entry
May 13, 2026
79a5285
Merge branch 'main' into restart-from-vtu
svchb May 19, 2026
34d99e1
Merge branch 'main' into restart-from-vtu
LasNikas Jun 1, 2026
b80727d
implement suggestions
Jun 1, 2026
af8ac67
Merge branch 'main' into restart-from-vtu
LasNikas Jun 2, 2026
1526df9
Merge branch 'main' into restart-from-vtu
LasNikas Jun 16, 2026
ed07cfb
implement suggestions
Jun 16, 2026
adc70a6
fix gpu
Jun 16, 2026
4bcddda
apply formatter
Jun 16, 2026
81d595d
Convert `MechanicalWorkCalculatorCallback` to a custom quantity
efaulhaber Jun 1, 2026
874ee6c
Fix
efaulhaber Jun 1, 2026
c9463a3
Update docstrings
efaulhaber Jun 1, 2026
ae92e89
Extract function
efaulhaber Jun 1, 2026
2606366
Fix docstring
efaulhaber Jun 1, 2026
2ccdb38
Fix return value
efaulhaber Jun 1, 2026
62e5755
Fix return values
efaulhaber Jun 1, 2026
2a0d226
Move timer out of inner function
efaulhaber Jun 1, 2026
057661e
Add `ThrustCalculator`
efaulhaber Jun 1, 2026
ca66122
Fix timer
efaulhaber Jun 1, 2026
5f4bb26
Fix
efaulhaber Jun 1, 2026
5c9942c
Add first fin simulation
efaulhaber Oct 2, 2024
14e3f3d
Fix fin simulation
efaulhaber Nov 6, 2024
cf55757
Use flexural rigidity
efaulhaber May 19, 2025
82ff344
Add rotation angle
efaulhaber May 19, 2025
f7bd53a
Update fin example
efaulhaber May 26, 2025
ae0230d
Move movement code to TrixiParticles module
efaulhaber May 28, 2025
d2e47e9
Fix complex shape offset
efaulhaber Jun 6, 2025
2d10005
Model foot pocket
efaulhaber Jun 6, 2025
a344e57
Fix kernel for FSI
efaulhaber Jun 11, 2025
f66079b
Fix fin example
efaulhaber Jun 16, 2025
271768d
Use Molteni-Colagrossi DD
efaulhaber Jun 16, 2025
4e3abef
Use higher resolution to fix BC
efaulhaber Jun 16, 2025
317a1c6
Reorganize example file
efaulhaber Jun 16, 2025
f433c8f
Add packing
efaulhaber Jun 27, 2025
d818e26
Add fin DXF and packing window
efaulhaber Jul 1, 2025
dda86ff
Use artificial viscosity for TLSPH
efaulhaber Jul 31, 2025
febdbc2
Fix fin example
efaulhaber Sep 3, 2025
2411592
Fix sound speed
efaulhaber Sep 3, 2025
d15c504
Update fin example file
efaulhaber Sep 24, 2025
ac80422
Add open boundaries to fin simulation
efaulhaber Dec 22, 2025
034ddd0
Optimize time integration and add periodic option
efaulhaber Dec 24, 2025
73fdb84
Fix foot rotation
efaulhaber Jan 21, 2026
162bc6f
Implement Kelvin-Vogt damping for TLSPH
efaulhaber Feb 17, 2026
c529b74
Add pvd argument to interpolation
efaulhaber Feb 17, 2026
6aa3184
Update fin with Antuono, velocity averaging, open boundaries and inte…
efaulhaber Feb 17, 2026
3059ae6
Add simplified fin example file
efaulhaber Feb 17, 2026
6dec8da
Add more buffer particles
efaulhaber Feb 20, 2026
b8826cb
Add code for extracting tip velocity
efaulhaber Feb 20, 2026
ac31554
Fix CFL and open boundaries in fin example
efaulhaber Feb 21, 2026
0ba4328
Fix initial condition for inlet/outlet
efaulhaber Feb 25, 2026
1d8eea9
Quick fix for making the `InitialCondition` type safer
efaulhaber Feb 27, 2026
8b465c3
Fix type of prescribed motion
efaulhaber Feb 27, 2026
1d1aa41
Fix simplified fin example
efaulhaber Feb 27, 2026
d0cee87
Make FP64 coordinates work with the fin
efaulhaber Feb 27, 2026
58523d1
Fix fin open boundaries and add velocity averaging
efaulhaber Feb 27, 2026
b3e9bc0
Apply API changes
efaulhaber May 8, 2026
01cfba4
Add PID to InfoCallback
efaulhaber May 13, 2026
e54bac5
Fix Antuono in fin example file
efaulhaber May 15, 2026
ee960bb
Make Antuono work on GPUs
efaulhaber May 15, 2026
4e98d8a
Print number of split integration time steps in summary
efaulhaber May 15, 2026
c9654a5
Sort more frequently
efaulhaber May 18, 2026
9b3b5c5
Fix packing for higher resolution (1mm thick fin)
efaulhaber May 21, 2026
1e05957
Double structure viscosity to make 1mm fin stable
efaulhaber May 21, 2026
85d0535
Update split CFL to make 1mm fin stable
efaulhaber May 21, 2026
af2e718
Use Molteni-Colagrossi density diffusion by default
efaulhaber May 23, 2026
d8dd145
Add work and thrust calculator
efaulhaber Jun 16, 2026
df4b370
Add realistic data for Hyper Bifins X (untested)
efaulhaber Jun 16, 2026
9984c03
Use realistic stiffness and density
efaulhaber Jun 19, 2026
6fbf220
Stabilize new fin model with more viscosity
efaulhaber Jun 20, 2026
9fd00a5
Fix `SerialBackend`
efaulhaber Jun 23, 2026
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
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ 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.5.2

### Features
- Added the ability to restart simulations from VTK solution files generated by `SolutionSavingCallback`.
Users can now pass the `restart_with` keyword argument to `semidiscretize` (#1190).

## Version 0.5.1

### Features

- Implemented stage-level coupling for split integration (#1049).
- Added `MechanicalWorkCalculatorCallback` (#940).

Expand Down
10 changes: 10 additions & 0 deletions docs/src/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ The following pre-defined custom quantities can be used with the
Modules = [TrixiParticles]
Pages = ["general/custom_quantities.jl"]
```

# Mechanical Work Calculator

The `MechanicalWorkCalculator` is a special custom quantity to be used with the
[`PostprocessCallback`](@ref).

```@autodocs
Modules = [TrixiParticles]
Pages = ["general/mechanical_work_calculator.jl"]
```
193 changes: 193 additions & 0 deletions examples/fluid/vortex_street.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
using TrixiParticles
using OrdinaryDiffEqLowStorageRK

# ==========================================================================================
# ==== Resolution
fluid_particle_spacing = 0.005

# Change spacing ratio to 3 and boundary layers to 1 when using Monaghan-Kajtar boundary model
boundary_layers = 4
spacing_ratio = 1

# ==========================================================================================
# ==== Experiment Setup
# Boundary geometry and initial fluid particle positions
tank_size = (1.0, 0.5)
# tank_size = (0.6, 0.6)
initial_fluid_size = tank_size

Re = 10000
initial_velocity = (0.0, 0.0)
nu = 1 * 1 / Re

tspan = (0.0, 2.0)

fluid_density = 1000.0
sound_speed = 50.0
state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density,
exponent=1, background_pressure=0.0)

tank = RectangularTank(fluid_particle_spacing, initial_fluid_size, tank_size, fluid_density,
n_layers=boundary_layers, spacing_ratio=spacing_ratio,
faces=(false, false, true, true), velocity=initial_velocity)

center = tank_size ./ 2
hollow_sphere = SphereShape(fluid_particle_spacing, 0.1, center, fluid_density,
n_layers=4, sphere_type=RoundSphere())

filled_sphere = SphereShape(fluid_particle_spacing, 0.1, center, fluid_density,
sphere_type=RoundSphere())

# hollow_sphere = RectangularShape(fluid_particle_spacing, round.(Int, (0.1, 0.3) ./ fluid_particle_spacing), center .- 0.15,
# density=fluid_density)
# filled_sphere = hollow_sphere

# using PythonCall
# using CondaPkg

# CondaPkg.add("svgpathtools")
# CondaPkg.add("ezdxf")
# svgpath = pyimport("svgpathtools")

# svg_path = "M509.299 100.016C507.966 91.5871 505.915 85.7111 503.145 82.3879C498.991 77.4031 479.883 60.7871 475.521 58.2947C471.16 55.8023 455.167 49.1559 448.936 47.702C442.705 46.2481 355.471 30.463 339.893 28.8014C329.508 27.6937 287.761 23.5397 214.651 16.3394C199.727 15.7768 185.488 15.1656 171.934 14.5056C151.602 13.5157 106.318 5.19544 82.4982 0.830064C58.6781 -3.53532 3.26262 9.37214 0.279574 38.2664C-2.54326 65.6089 16.5085 89.4186 34.9345 99.2843C49.9801 107.34 58.7166 107.403 71.5338 114.275C101.912 130.564 100.849 169.8 123.353 175.939C145.856 182.078 146.637 180.9 155.986 179.279C162.22 178.199 199.267 168.32 267.129 149.644L359.355 117.398L405.801 102.863C446.849 101.008 472.412 100.061 482.489 100.022C497.605 99.9635 507.524 100.062 509.299 100.016Z"

# path = svgpath.parse_path(svg_path)
# t_range = range(0, 1, length=50 * length(path))
# points = [(pyconvert(Float64, p.real), -pyconvert(Float64, p.imag))
# for p in (path.point(t) for t in t_range)]

# # ezdxf = pyimport("ezdxf")
# # doc = ezdxf.new(dxfversion="R2010")
# # msp = doc.modelspace()
# # msp.add_polyline2d(points)
# # doc.saveas("output.dxf")

# center = tank_size ./ 2
# points_matrix = reinterpret(reshape, Float64, points)
# scaling = 0.3 / maximum(points_matrix, dims=2)[1]
# points_matrix .*= scaling
# points_matrix .+= (-0.15, -points_matrix[2, 1])

# geometry = TrixiParticles.Polygon(points_matrix)

# # trixi2vtk(geometry)

# point_in_geometry_algorithm = WindingNumberJacobson(; geometry,
# winding_number_factor=0.4,
# hierarchical_winding=true)

# # Returns `InitialCondition`
# shape_sampled = ComplexShape(geometry; particle_spacing=fluid_particle_spacing, density=fluid_density,
# store_winding_number=true,
# point_in_geometry_algorithm)

# # angle = pi / 4
# # using StaticArrays
# # rotation_matrix = @SMatrix [cos(angle) -sin(angle)
# # sin(angle) cos(angle)]
# # shape_sampled.initial_condition.coordinates .= rotation_matrix * shape_sampled.initial_condition.coordinates
# shape_sampled.initial_condition.coordinates .+= center

# hollow_sphere = shape_sampled.initial_condition
# filled_sphere = hollow_sphere

# n_particles = round(Int, 0.12 / fluid_particle_spacing)
# cylinder = RectangularShape(fluid_particle_spacing, (n_particles, n_particles), (0.2 - 1.0, 0.24 - 1.0), density=fluid_density)

fluid = setdiff(tank.fluid, filled_sphere)

# ==========================================================================================
# ==== Fluid
smoothing_length = 2 * fluid_particle_spacing
smoothing_kernel = WendlandC2Kernel{2}()

viscosity_fluid = ViscosityAdami(; nu)
# viscosity_fluid = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)
viscosity_wall = ViscosityAdami(; nu)
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)
fluid_density_calculator = ContinuityDensity()
fluid_system = WeaklyCompressibleSPHSystem(fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
density_diffusion=density_diffusion,
pressure_acceleration=TrixiParticles.tensile_instability_control,
particle_shifting=TrixiParticles.ParticleShiftingSun2019(5.0),
smoothing_length, viscosity=viscosity_fluid)

# ==========================================================================================
# ==== Boundary
boundary_density_calculator = AdamiPressureExtrapolation(pressure_offset=10000.0)
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
state_equation=state_equation,
boundary_density_calculator,
smoothing_kernel, smoothing_length)

# Movement function
# https://en.wikipedia.org/wiki/Triangle_wave#Harmonics
# triangle_series(t, N) = 8 / pi^2 * sum(i -> (-1)^i / (2i + 1)^2 * sin(2pi * (2i + 1) * t), 0:(N-1))
# movement_function(x, t) = x + SVector(0.4 * triangle_series(2 * t, 5), 0.0)
# is_moving(t) = true
# boundary_movement = BoundaryMovement(movement_function, is_moving)

boundary_movement = TrixiParticles.oscillating_movement(1.0,
SVector(0.4, 0.0),
0.0, center;
ramp_up=0.5)

boundary_system = BoundarySPHSystem(tank.boundary, boundary_model)

boundary_model_cylinder = BoundaryModelDummyParticles(hollow_sphere.density,
hollow_sphere.mass,
state_equation=state_equation,
boundary_density_calculator,
smoothing_kernel, smoothing_length,
viscosity=viscosity_wall)

boundary_system_cylinder = BoundarySPHSystem(hollow_sphere, boundary_model_cylinder,
movement=boundary_movement)

# boundary_system_cylinder = TotalLagrangianSPHSystem(hollow_sphere, smoothing_kernel, smoothing_length,
# 1e5, 0.0;
# n_fixed_particles=nparticles(hollow_sphere), movement=boundary_movement,
# boundary_model=boundary_model)

# ==========================================================================================
# ==== Simulation
min_corner = minimum(fluid.coordinates, dims=2) .- fluid_particle_spacing / 2
max_corner = maximum(fluid.coordinates, dims=2) .+ fluid_particle_spacing / 2
periodic_box = PeriodicBox(; min_corner, max_corner)
cell_list = FullGridCellList(; min_corner, max_corner)
neighborhood_search = GridNeighborhoodSearch{2}(; periodic_box, cell_list)

semi = Semidiscretization(fluid_system, boundary_system_cylinder;
neighborhood_search)
ode = semidiscretize(semi, tspan)

info_callback = InfoCallback(interval=10)
saving_callback = SolutionSavingCallback(dt=0.01, prefix="")
shifting_callback = ParticleShiftingCallback()

stepsize_callback = StepsizeCallback(cfl=1.5)

callbacks = CallbackSet(info_callback, saving_callback, shifting_callback,
stepsize_callback)

# Use a Runge-Kutta method with automatic (error based) time step size control.
# Limiting of the maximum stepsize is necessary to prevent crashing.
# When particles are approaching a wall in a uniform way, they can be advanced
# with large time steps. Close to the wall, the stepsize has to be reduced drastically.
# Sometimes, the method fails to do so because forces become extremely large when
# fluid particles are very close to boundary particles, and the time integration method
# interprets this as an instability.
# fluid_dt = 1e-3
# sol = solve(ode, RDPK3SpFSAL49(),
# # abstol=1.0e-6, # Default abstol is 1e-6 (may need to be tuned to prevent boundary penetration)
# # reltol=1.0e-4, # Default reltol is 1e-3 (may need to be tuned to prevent boundary penetration)
# adaptive=false, dt=fluid_dt,
# save_everystep=false, callback=callbacks);

time_step = 1.0
sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false),
dt=time_step, # This is overwritten by the stepsize callback
save_everystep=false, callback=callbacks);

# plane = interpolate_plane([0.0, -0.25], [1.0, 0.75], 0.0025, semi, fluid_system, sol)
Loading
Loading