Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
03807a2
Refactor SPH system initialization to use keyword arguments
svchb Apr 16, 2026
0707dc4
Merge branch 'dev' into api/unify-fluid-constructors
svchb Apr 17, 2026
be971d9
fix test
svchb Apr 17, 2026
e63edb9
Update docs/literate/src/tut_setup.jl
svchb Apr 21, 2026
ac5bdfd
Merge branch 'dev' into api/unify-fluid-constructors
svchb Apr 21, 2026
b88cae3
remove unneeded named arguments
svchb Apr 21, 2026
664e602
more fixes
svchb Apr 21, 2026
927fcdd
Refactor constructors to use keyword arguments for DEM and SPH systems
svchb Apr 22, 2026
d30cb69
Refactor constructors in DEM, SPH, and TotalLagrangian systems to use…
svchb Apr 22, 2026
7526800
fix tests
svchb Apr 22, 2026
5148a1d
Merge branch 'dev' into api/unify-fluid-constructors
svchb Apr 22, 2026
da12eb9
better fix for included parameters
svchb Apr 23, 2026
0cf74ae
another pass to reduce unreqed named args
svchb Apr 23, 2026
c8ddbf0
even more unreq named keyword use
svchb Apr 23, 2026
e0c6124
format
svchb Apr 23, 2026
d7eafc2
typo
svchb Apr 23, 2026
c979bce
fix tests
svchb Apr 23, 2026
c8ead74
fix tests
svchb Apr 23, 2026
6968828
fix tests
svchb Apr 23, 2026
c699853
fix tests
svchb Apr 23, 2026
ae2c7b0
format
svchb Apr 27, 2026
2170226
Merge branch 'api/unify-fluid-constructors' of https://github.com/svc…
svchb Apr 27, 2026
b6b01fe
format
svchb Apr 27, 2026
1ddba07
fix
svchb Apr 28, 2026
9ff9e82
format
svchb Apr 28, 2026
08e2a86
Apply suggestion from @efaulhaber
svchb Apr 28, 2026
d03a88c
Update examples/fluid/dam_break_oil_film_2d.jl
svchb Apr 28, 2026
b14fe41
Update examples/fluid/falling_water_spheres_2d.jl
svchb Apr 28, 2026
d941a56
Update examples/fluid/falling_water_spheres_2d.jl
svchb Apr 28, 2026
bfd5087
Update test/systems/tlsph_system.jl
svchb Apr 28, 2026
7851285
Update test/systems/tlsph_system.jl
svchb Apr 28, 2026
6c31252
Update test/systems/edac_system.jl
svchb Apr 28, 2026
104980b
Update test/schemes/structure/total_lagrangian_sph/rhs.jl
svchb Apr 28, 2026
ce4d33c
Update examples/fluid/poiseuille_flow_3d.jl
svchb Apr 28, 2026
de04134
Update examples/fsi/dam_break_gate_2d.jl
svchb Apr 28, 2026
c6455de
Update examples/fsi/dam_break_plate_2d.jl
svchb Apr 28, 2026
75b4076
Update examples/fsi/hydrostatic_water_column_2d.jl
svchb Apr 28, 2026
ab8d1bc
Update examples/structure/oscillating_beam_2d.jl
svchb Apr 28, 2026
556bd94
Update src/schemes/boundary/dem_boundary/system.jl
svchb Apr 28, 2026
ec946f8
Update src/schemes/fluid/entropically_damped_sph/system.jl
svchb Apr 28, 2026
efe949b
Update src/schemes/fluid/implicit_incompressible_sph/system.jl
svchb Apr 28, 2026
00b2f1f
Update src/schemes/fluid/weakly_compressible_sph/system.jl
svchb Apr 28, 2026
3d0e81b
Update src/schemes/structure/discrete_element_method/system.jl
svchb Apr 28, 2026
265b562
Update test/general/custom_quantities.jl
svchb Apr 28, 2026
7aa8654
Update test/general/interpolation.jl
svchb Apr 28, 2026
9832bee
Update test/general/interpolation.jl
svchb Apr 28, 2026
1ae0b3f
Update test/schemes/boundary/dummy_particles/rhs.jl
svchb Apr 28, 2026
4c5ad19
Update test/schemes/fluid/rhs.jl
svchb Apr 28, 2026
687698c
Update test/schemes/boundary/dummy_particles/dummy_particles.jl
svchb Apr 28, 2026
2144c9b
Update test/schemes/boundary/dummy_particles/dummy_particles.jl
svchb Apr 28, 2026
46ece3a
fix doc strings
svchb Apr 28, 2026
2196584
Merge branch 'api/unify-fluid-constructors' of github.com:svchb/Trixi…
svchb Apr 28, 2026
ea41299
review
svchb Apr 28, 2026
27278c0
format
svchb Apr 28, 2026
cf51f6a
Merge remote-tracking branch 'upstream/dev' into api/unify-fluid-cons…
svchb Apr 28, 2026
cb2a640
fix test
svchb Apr 28, 2026
df825a0
fix NEWS.md
svchb Apr 28, 2026
297e6e6
add news section
svchb Apr 28, 2026
79f701f
Update src/schemes/fluid/implicit_incompressible_sph/system.jl
svchb Apr 28, 2026
188f4fa
review comments
svchb Apr 28, 2026
74f02b6
Merge branch 'api/unify-fluid-constructors' of github.com:svchb/Trixi…
svchb Apr 28, 2026
3ca4955
Update NEWS.md
svchb Apr 28, 2026
9277de1
Update NEWS.md
svchb Apr 28, 2026
91e054c
Merge branch 'dev' into api/unify-fluid-constructors
efaulhaber Apr 28, 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
9 changes: 6 additions & 3 deletions docs/literate/src/tut_rigid_body_fsi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)

fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, fluid_smoothing_kernel,
fluid_smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=fluid_smoothing_kernel,
smoothing_length=fluid_smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
Comment thread
svchb marked this conversation as resolved.
Outdated
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity))
nothing # hide
Expand Down
8 changes: 5 additions & 3 deletions docs/literate/src/tut_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ nothing # hide
# The simulation quality greatly benefits from using [density diffusion](@ref density_diffusion).
fluid_density_calculator = ContinuityDensity()
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel, smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity))
nothing # hide
Expand Down
12 changes: 8 additions & 4 deletions examples/fluid/dam_break_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ viscosity_fluid = ArtificialViscosityMonaghan(alpha=alpha, beta=0.0)
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)
# density_diffusion = DensityDiffusionAntuono(delta=0.1)

fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity_fluid,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
Comment thread
svchb marked this conversation as resolved.
Outdated
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity_fluid,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity), correction=nothing,
acceleration=(0.0, -gravity),
correction=nothing,
surface_tension=nothing,
reference_particle_spacing=0)

Expand Down
7 changes: 5 additions & 2 deletions examples/fluid/dam_break_2phase_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ air_eos = StateEquationCole(; sound_speed, reference_density=air_density, expone
clip_negative_pressure=false)
#air_eos = StateEquationIdealGas(; sound_speed, reference_density=air_density, gamma=1.4)

air_system_system = WeaklyCompressibleSPHSystem(air_system, fluid_density_calculator,
air_eos, smoothing_kernel, smoothing_length,
air_system_system = WeaklyCompressibleSPHSystem(air_system;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=air_eos,
viscosity=air_viscosity,
acceleration=(0.0, -gravity))

Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/dam_break_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)

fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity, 0.0))

Expand Down
18 changes: 12 additions & 6 deletions examples/fluid/dam_break_oil_film_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,23 @@ end

oil_state_equation = StateEquationCole(; sound_speed, reference_density=oil_density,
exponent=1, clip_negative_pressure=false)
oil_system = WeaklyCompressibleSPHSystem(oil, fluid_density_calculator,
oil_eos, smoothing_kernel,
smoothing_length, viscosity=oil_viscosity,
oil_system = WeaklyCompressibleSPHSystem(oil;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=oil_eos,
viscosity=oil_viscosity,
acceleration=(0.0, -gravity),
surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.01),
correction=AkinciFreeSurfaceCorrection(oil_density),
reference_particle_spacing=fluid_particle_spacing)

# oil_system = WeaklyCompressibleSPHSystem(oil, fluid_density_calculator,
# oil_eos, smoothing_kernel,
# smoothing_length, viscosity=oil_viscosity,
# oil_system = WeaklyCompressibleSPHSystem(oil;
# smoothing_kernel=smoothing_kernel,
# smoothing_length=smoothing_length,
# density_calculator=fluid_density_calculator,
# state_equation=oil_eos,
# viscosity=oil_viscosity,
# acceleration=(0.0, -gravity),
# surface_tension=SurfaceTensionMorris(surface_tension_coefficient=0.03),
# reference_particle_spacing=fluid_particle_spacing)
Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/falling_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ smoothing_kernel = SchoenbergCubicSplineKernel{2}()
fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)

fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
acceleration=(0.0, -gravity))

# ==========================================================================================
Expand Down
17 changes: 11 additions & 6 deletions examples/fluid/falling_water_spheres_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,22 @@ alpha = 8 * nu / (fluid_smoothing_length * sound_speed)
viscosity = ArtificialViscosityMonaghan(alpha=alpha, beta=0.0)
density_diffusion = DensityDiffusionAntuono(delta=0.1)

sphere_surface_tension = EntropicallyDampedSPHSystem(sphere1, fluid_smoothing_kernel,
fluid_smoothing_length,
sound_speed, viscosity=viscosity,
sphere_surface_tension = EntropicallyDampedSPHSystem(sphere1;
smoothing_kernel=fluid_smoothing_kernel,
smoothing_length=fluid_smoothing_length,
sound_speed=sound_speed,
viscosity=viscosity,
density_calculator=ContinuityDensity(),
acceleration=(0.0, -gravity),
surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.05),
reference_particle_spacing=fluid_particle_spacing)

sphere = WeaklyCompressibleSPHSystem(sphere2, fluid_density_calculator,
state_equation, fluid_smoothing_kernel,
fluid_smoothing_length, viscosity=viscosity,
sphere = WeaklyCompressibleSPHSystem(sphere2;
smoothing_kernel=fluid_smoothing_kernel,
smoothing_length=fluid_smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity))

Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/hydrostatic_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ fluid_density_calculator = ContinuityDensity()

# This is to set acceleration with `trixi_include`
system_acceleration = (0.0, -gravity)
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity_fluid,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity_fluid,
acceleration=system_acceleration,
source_terms=nothing)

Expand Down
17 changes: 11 additions & 6 deletions examples/fluid/lid_driven_cavity_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,23 @@ if wcsph
density_calculator = ContinuityDensity()
state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density,
exponent=1)
fluid_system = WeaklyCompressibleSPHSystem(cavity.fluid, density_calculator,
state_equation, smoothing_kernel,
fluid_system = WeaklyCompressibleSPHSystem(cavity.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=density_calculator,
state_equation=state_equation,
pressure_acceleration=TrixiParticles.inter_particle_averaged_pressure,
smoothing_length, viscosity=viscosity,
viscosity=viscosity,
shifting_technique=TransportVelocityAdami(background_pressure=pressure))
else
state_equation = nothing
density_calculator = ContinuityDensity()
fluid_system = EntropicallyDampedSPHSystem(cavity.fluid, smoothing_kernel,
smoothing_length,
fluid_system = EntropicallyDampedSPHSystem(cavity.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=density_calculator,
sound_speed, viscosity=viscosity,
sound_speed=sound_speed,
viscosity=viscosity,
shifting_technique=TransportVelocityAdami(background_pressure=pressure))
end

Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/moving_wall_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ smoothing_kernel = SchoenbergCubicSplineKernel{2}()
fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.1, beta=0.0)

fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
acceleration=(0.0, -gravity))

# ==========================================================================================
Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/oscillating_drop_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)

density_diffusion = DensityDiffusionAntuono(delta=0.1)
fluid_system = WeaklyCompressibleSPHSystem(fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
density_diffusion=density_diffusion,
source_terms=source_terms)

Expand Down
7 changes: 5 additions & 2 deletions examples/fluid/periodic_array_of_cylinders_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ state_equation = StateEquationCole(; sound_speed, reference_density=fluid_densit
exponent=1, clip_negative_pressure=false)

density_diffusion = DensityDiffusionAntuono(delta=0.1)
fluid_system = WeaklyCompressibleSPHSystem(fluid, ContinuityDensity(), state_equation,
smoothing_kernel, smoothing_length,
fluid_system = WeaklyCompressibleSPHSystem(fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=ContinuityDensity(),
state_equation=state_equation,
density_diffusion=density_diffusion,
viscosity=ViscosityAdami(; nu),
shifting_technique=ParticleShiftingTechnique(),
Expand Down
9 changes: 6 additions & 3 deletions examples/fluid/periodic_channel_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ fluid_density_calculator = ContinuityDensity()
viscosity = ArtificialViscosityMonaghan(alpha=0.02, beta=0.0)

# `pressure_acceleration=nothing` is the default and can be overwritten with `trixi_include`
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
viscosity=viscosity,
shifting_technique=nothing,
pressure_acceleration=nothing)

Expand Down
15 changes: 10 additions & 5 deletions examples/fluid/pipe_flow_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,23 @@ if wcsph
exponent=1)
density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1)

fluid_system = WeaklyCompressibleSPHSystem(pipe.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
fluid_system = WeaklyCompressibleSPHSystem(pipe.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
density_calculator=fluid_density_calculator,
state_equation=state_equation,
density_diffusion=density_diffusion,
smoothing_length, viscosity=viscosity,
viscosity=viscosity,
shifting_technique=ParticleShiftingTechnique(v_max_factor=1.5),
buffer_size=n_buffer_particles)
else
# Alternatively the EDAC scheme can be used
state_equation = nothing

fluid_system = EntropicallyDampedSPHSystem(pipe.fluid, smoothing_kernel,
smoothing_length, sound_speed,
fluid_system = EntropicallyDampedSPHSystem(pipe.fluid;
smoothing_kernel=smoothing_kernel,
smoothing_length=smoothing_length,
sound_speed=sound_speed,
viscosity=viscosity,
density_calculator=fluid_density_calculator,
shifting_technique=ParticleShiftingTechnique(),
Expand Down
Loading
Loading