diff --git a/examples/fluid/refinement_2d.jl b/examples/fluid/refinement_2d.jl deleted file mode 100644 index 9dc77f906..000000000 --- a/examples/fluid/refinement_2d.jl +++ /dev/null @@ -1,72 +0,0 @@ -using TrixiParticles -using OrdinaryDiffEq - -# ========================================================================================== -# ==== Resolution -fluid_particle_spacing = 0.05 - -# Make sure that the kernel support of fluid particles at a boundary is always fully sampled -boundary_layers = 3 - -# ========================================================================================== -# ==== Experiment Setup -gravity = 9.81 -tspan = (0.0, 1.0) - -# Boundary geometry and initial fluid particle positions -initial_fluid_size = (1.0, 1.0) -tank_size = (1.0, 1.0) - -fluid_density = 1000.0 -sound_speed = 10.0 -state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density, - exponent=7, clip_negative_pressure=false) - -tank = RectangularTank(fluid_particle_spacing, initial_fluid_size, tank_size, fluid_density, - n_layers=boundary_layers, acceleration=(0.0, -gravity), - state_equation=state_equation) - -# ========================================================================================== -# ==== Fluid - -smoothing_length = 1.2 * fluid_particle_spacing -smoothing_kernel = SchoenbergQuarticSplineKernel{2}() - -fluid_density_calculator = ContinuityDensity() -pressure = 1000.0 -particle_refinement = ParticleRefinement(; splitting_pattern=TrixiParticles.HexagonalSplitting(), max_spacing_ratio=1.2) -fluid_system = EntropicallyDampedSPHSystem(tank.fluid, smoothing_kernel, smoothing_length, - sound_speed; viscosity=ViscosityAdami(; nu=1e-4), - particle_refinement=particle_refinement, - transport_velocity=TransportVelocityAdami(pressure), - acceleration=(0.0, -gravity)) - -# ========================================================================================== -# ==== Boundary - -# This is to set another boundary density calculation with `trixi_include` -boundary_density_calculator = AdamiPressureExtrapolation() - -# This is to set wall viscosity with `trixi_include` -viscosity_wall = nothing -boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass, - boundary_density_calculator, - smoothing_kernel, smoothing_length, - viscosity=viscosity_wall) -boundary_system = BoundarySPHSystem(tank.boundary, boundary_model, movement=nothing) - -# ========================================================================================== -# ==== Simulation -semi = Semidiscretization(fluid_system, boundary_system) -ode = semidiscretize(semi, tspan) - -info_callback = InfoCallback(interval=50) -saving_callback = SolutionSavingCallback(dt=0.02, prefix="") - -# This is to easily add a new callback with `trixi_include` -extra_callback = nothing - -callbacks = CallbackSet(info_callback, saving_callback, extra_callback, UpdateCallback()) - -# Use a Runge-Kutta method with automatic (error based) time step size control -sol = solve(ode, RDPK3SpFSAL35(), save_everystep=false, callback=callbacks); diff --git a/src/schemes/fluid/entropically_damped_sph/system.jl b/src/schemes/fluid/entropically_damped_sph/system.jl index 3e9715485..485078c9e 100644 --- a/src/schemes/fluid/entropically_damped_sph/system.jl +++ b/src/schemes/fluid/entropically_damped_sph/system.jl @@ -101,12 +101,15 @@ function EntropicallyDampedSPHSystem(initial_condition, smoothing_kernel, cache = create_cache_density(initial_condition, density_calculator) cache = (; create_cache_edac(initial_condition, transport_velocity)..., cache...) + cache = (; + create_cache_refinement(initial_condition, particle_refinement, + smoothing_length)..., cache...) return EntropicallyDampedSPHSystem(initial_condition, mass, density_calculator, - smoothing_kernel, smoothing_length, sound_speed, - viscosity, nu_edac, acceleration_, nothing, - pressure_acceleration, transport_velocity, - source_terms, buffer, particle_refinement, cache) + smoothing_kernel, sound_speed, viscosity, nu_edac, + acceleration_, nothing, pressure_acceleration, + transport_velocity, source_terms, buffer, + particle_refinement, cache) end function Base.show(io::IO, system::EntropicallyDampedSPHSystem)