Skip to content

Commit

Permalink
combine them
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Aug 9, 2024
1 parent c21168f commit d6c316d
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 110 deletions.
2 changes: 1 addition & 1 deletion examples/fluid/accelerated_tank_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ boundary_movement = BoundaryMovement(movement_function, is_moving)
trixi_include(@__MODULE__,
joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"),
fluid_particle_spacing=fluid_particle_spacing, movement=boundary_movement,
tspan=(0.0, 1.0))
tspan=(0.0, 1.0), system_acceleration=(0.0, 0.0))
5 changes: 4 additions & 1 deletion examples/fluid/hydrostatic_water_column_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ alpha = 0.02
viscosity = ArtificialViscosityMonaghan(alpha=alpha, beta=0.0)

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,
acceleration=(0.0, -gravity),
acceleration=system_acceleration,
source_terms=nothing)

# ==========================================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/general/semidiscretization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ function update_nhs!(neighborhood_search,
points_moving=(true, neighbor.ismoving[]))
end

# If declared as a union with the `TotalLagrangianSPHSystem` version will be ambiguous with another dispatch
# This function is the same as the one below to avoid ambiguous dispatch when using `Union`
function update_nhs!(neighborhood_search,
system::BoundarySPHSystem{<:BoundaryModelDummyParticles},
neighbor::FluidSystem, u_system, u_neighbor)
Expand All @@ -732,7 +732,7 @@ function update_nhs!(neighborhood_search,
points_moving=(system.ismoving[], true))
end

# If declared as a union with the `FluidSystem` version will be ambiguous with another dispatch
# This function is the same as the one above to avoid ambiguous dispatch when using `Union`
function update_nhs!(neighborhood_search,
system::BoundarySPHSystem{<:BoundaryModelDummyParticles},
neighbor::TotalLagrangianSPHSystem, u_system, u_neighbor)
Expand Down
Loading

0 comments on commit d6c316d

Please sign in to comment.