-
Notifications
You must be signed in to change notification settings - Fork 19
Validation hydrostatic water column #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LasNikas
merged 121 commits into
trixi-framework:main
from
svchb:validation_hydrostatic_water_column
Mar 9, 2026
Merged
Changes from 114 commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
0f75713
working
svchb 79ade1a
update
svchb 54bee9b
add more reference files
svchb 82e6fdd
change style
svchb 5defb55
update
svchb 0459622
update
svchb c10e468
with error plots
svchb 5fb5b4e
working
svchb b5a4b22
update
svchb 12d8054
update
svchb 2ea2a33
update
svchb ef60adf
cleanup
svchb 151ef4b
format
svchb e192cc0
Merge branch 'main' into validation_hydrostatic_water_column
svchb ddac0e9
format
svchb 5be95b7
Merge branch 'validation_hydrostatic_water_column' of github.com:svch…
svchb 37dffdf
remove statistics package dependency
svchb bd575b8
increase error
svchb ad2cddc
update files
svchb e513dc0
format
svchb 35b3e00
fix file path
svchb 0e38347
increase errors
svchb 06a217c
larger error
svchb 662723a
increase error
svchb 821f763
another try
svchb 2972b07
Merge branch 'main' into validation_hydrostatic_water_column
svchb a87b3d2
Merge branch 'main' into validation_hydrostatic_water_column
svchb 83e5598
Merge branch 'main' into validation_hydrostatic_water_column
svchb 3ae5db6
Merge branch 'main' into validation_hydrostatic_water_column
svchb 244a94f
Merge branch 'main' into validation_hydrostatic_water_column
svchb 2452933
Merge branch 'main' into validation_hydrostatic_water_column
svchb 45b607f
replace trixi_test_nowarn
svchb 24b1924
Merge branch 'main' into validation_hydrostatic_water_column
svchb 6f69766
update
svchb 265ce07
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb 7fda2f1
fix
svchb b3920de
update
svchb 8e6e621
add convenience scripts
svchb 5ad9325
update
svchb ca683b5
add test mode
svchb 4ebd3a3
update
svchb fe71153
escape command
svchb 66fdad6
update
svchb 9df122c
adjust naming
svchb ab93cb3
update
svchb 6bf3969
update
svchb bb6674a
format
svchb 81b8e93
update
svchb 9b6707e
remove srun
svchb 348f42a
update
svchb 3296349
update
svchb 84c5428
add new validation reference files
svchb 7ddc0f1
update time estimate
svchb 42f8cb0
Merge branch 'main' into validation_hydrostatic_water_column
svchb da29a88
review comments
svchb 537f525
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb e490f41
format
svchb 06aeb6c
update
svchb 2480dca
update
svchb c776947
split into example
svchb 4ca11be
update
svchb 606d854
remove 2nd tspan
svchb d7920e0
format
svchb 8564459
Merge branch 'main' into validation_hydrostatic_water_column
svchb 9bf15a5
Merge branch 'main' into validation_hydrostatic_water_column
svchb 222e8b1
Remove left over files from merge
svchb a8bcde1
revert changes
svchb 442e63a
fix problems with new version
svchb ddfbf78
Merge branch 'main' into validation_hydrostatic_water_column
svchb 067aa87
update style
svchb b5778e7
refactor: rename solid_density and solid_particle_spacing to structur…
svchb 52be78f
refactor: rename local_state_equation to state_equation for consistency
svchb 502e325
Update examples/fsi/hydrostatic_water_column_2d.jl
svchb 1184eb2
Update examples/fsi/hydrostatic_water_column_2d.jl
svchb 758c578
Update test/validation/validation.jl
svchb c0b492e
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb acaab98
adjust comment style
svchb 79941d3
remove semicolons
svchb 1a887bc
remove for now
svchb 4d223f0
cleanup
svchb 92c9577
format
svchb 6952b4a
Merge branch 'main' into validation_hydrostatic_water_column
svchb e181304
renaming
svchb 290ead4
update
svchb 2e78106
fix
svchb afae8e8
remove comment
svchb 63347b4
Merge branch 'main' into validation_hydrostatic_water_column
svchb 8036cb3
update
svchb 3102254
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb 3803c9a
switch to split integration
svchb d5a28fa
format
svchb 4a060ab
suppress warning
svchb 9750794
update
svchb d8d87f3
Merge branch 'main' into validation_hydrostatic_water_column
svchb ba8b642
fix grammar
svchb 2f8db52
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb 7c397e0
update
svchb e8e4edf
more suppression
svchb 1c22253
format
svchb a27211e
run the example as well
svchb 6a57999
Remove obsolete validation reference files for hydrostatic water colu…
svchb d12c336
Merge branch 'main' into validation_hydrostatic_water_column
svchb c922d73
Reformat
svchb 127b267
Merge branch 'validation_hydrostatic_water_column' of https://github.…
svchb 9a535f9
fix tests
svchb 29cb130
remove dt
svchb 145576f
update tolerance for wcsph error in hydrostatic_water_column test
svchb 7fbdc95
remove txt
svchb a673aba
remove error functions
svchb 02b3f1d
update split integration callback to use Carpenter-Kennedy2N54 and ad…
svchb d5ea990
refactor kinetic_energy function
svchb 0813410
update tolerance for edac error in hydrostatic_water_column test
svchb 246fa29
Merge branch 'main' into validation_hydrostatic_water_column
svchb fd03767
Merge branch 'main' into validation_hydrostatic_water_column
svchb 21fdff0
Merge branch 'main' into validation_hydrostatic_water_column
svchb 85c4c98
Merge branch 'main' into validation_hydrostatic_water_column
svchb 013fa96
fix solid to structure
svchb 4557df9
hotfix
svchb 74df4ea
fix the test
svchb fbd012b
format
svchb 2966228
Merge branch 'main' into validation_hydrostatic_water_column
svchb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| # ========================================================================================== | ||
| # 2D Hydrostatic Water Column on an Elastic Plate (FSI) | ||
| # | ||
| # Case "Elastic plate under a hydrostatic water column" as described in | ||
| # "A fluid–structure interaction model for free-surface flows and flexible structures | ||
| # using smoothed particle hydrodynamics on a GPU" by J. O'Connor and B.D. Rogers | ||
| # published in Journal of Fluids and Structures | ||
| # https://doi.org/10.1016/j.jfluidstructs.2021.103312 | ||
| # ========================================================================================== | ||
|
|
||
| using TrixiParticles | ||
| using OrdinaryDiffEq | ||
| using JSON | ||
|
|
||
| # ========================================================================================== | ||
| # ==== Options | ||
| use_edac = true # Use EDAC or WCSPH | ||
|
|
||
| # ========================================================================================== | ||
| # ==== Experiment Parameters | ||
| # The paper uses 5 to 40 (3 for short runtime in CI) | ||
| n_particles_plate_y = 5 | ||
| boundary_layers = 3 | ||
| spacing_ratio = 1 | ||
| gravity = 9.81 | ||
| # Recommended: run at least to 0.5 (paper runs to 1.0); using 0.3 for speed in CI | ||
| tspan = (0.0, 0.5) | ||
|
|
||
| initial_fluid_size = (1.0, 2.0) | ||
| plate_size = (1.0, 0.05) | ||
|
|
||
| fluid_density = 1000.0 | ||
| structure_density = 2700.0 | ||
|
|
||
| E = 67.5e9 | ||
| nu = 0.3 | ||
| sound_speed = 50.0 | ||
|
|
||
| # Particle spacings (structure and fluid share same spacing) | ||
| structure_particle_spacing = plate_size[2] / (n_particles_plate_y - 1) | ||
| fluid_particle_spacing = structure_particle_spacing | ||
| boundary_particle_spacing = fluid_particle_spacing / spacing_ratio | ||
|
|
||
| # Analytical solution (constant) | ||
| D = E * plate_size[2]^3 / (12 * (1 - nu^2)) | ||
| analytical_value = -0.0026 * gravity * | ||
| (fluid_density * initial_fluid_size[2] + | ||
| structure_density * plate_size[2]) / D | ||
|
|
||
| # ========================================================================================== | ||
| # ==== Geometry Definitions: Tank, Beam, and Fixed Particles | ||
| n_particles_plate_x = round(Int, plate_size[1] / structure_particle_spacing + 1) | ||
| n_particles_per_dimension = (n_particles_plate_x, n_particles_plate_y) | ||
|
|
||
| plate = RectangularShape(structure_particle_spacing, n_particles_per_dimension, | ||
| (0.0, -plate_size[2]), density=structure_density, | ||
| place_on_shell=true) | ||
|
|
||
| left_wall = RectangularShape(structure_particle_spacing, (3, n_particles_plate_y), | ||
| (-3 * structure_particle_spacing, -plate_size[2]), | ||
| density=structure_density, place_on_shell=true) | ||
| right_wall = RectangularShape(structure_particle_spacing, (3, n_particles_plate_y), | ||
| (plate_size[1] + structure_particle_spacing, | ||
| -plate_size[2]), density=structure_density, | ||
| place_on_shell=true) | ||
| fixed_particles = union(left_wall, right_wall) | ||
|
|
||
| structure_geometry = union(plate, fixed_particles) | ||
|
|
||
| # ========================================================================================== | ||
| # ==== Smoothing Kernel, Boundary, and Related Quantities | ||
| smoothing_kernel = WendlandC2Kernel{2}() | ||
| smoothing_length_structure = sqrt(2) * structure_particle_spacing | ||
|
|
||
| smoothing_length_fluid = sqrt(2) * fluid_particle_spacing | ||
|
|
||
| hydrodynamic_densities = fluid_density * ones(size(structure_geometry.density)) | ||
| hydrodynamic_masses = hydrodynamic_densities * | ||
| structure_particle_spacing^ndims(structure_geometry) | ||
| boundary_density_calculator = AdamiPressureExtrapolation() | ||
|
|
||
| # ========================================================================================== | ||
| # ==== Run Simulations | ||
| state_equation = use_edac ? nothing : | ||
| StateEquationCole(; sound_speed, reference_density=fluid_density, | ||
| exponent=7, clip_negative_pressure=false) | ||
|
|
||
| tank = RectangularTank(fluid_particle_spacing, initial_fluid_size, (plate_size[1], 3.0), | ||
| min_coordinates=(0.0, fluid_particle_spacing / 2), | ||
| fluid_density, n_layers=boundary_layers, | ||
| spacing_ratio=spacing_ratio, | ||
| faces=(true, true, false, false), | ||
| acceleration=(0.0, -gravity), | ||
| state_equation=state_equation) | ||
|
|
||
| if use_edac | ||
| fluid_system = EntropicallyDampedSPHSystem(tank.fluid, smoothing_kernel, | ||
| smoothing_length_fluid, sound_speed, | ||
| acceleration=(0.0, -gravity), | ||
| correction=ShepardKernelCorrection(), | ||
| source_terms=SourceTermDamping(; | ||
| damping_coefficient=0.05)) | ||
| else | ||
| fluid_density_calculator = ContinuityDensity() | ||
| density_diffusion = DensityDiffusionMolteniColagrossi(delta=0.1) | ||
|
efaulhaber marked this conversation as resolved.
|
||
| # density_diffusion = DensityDiffusionAntuono(tank.fluid, delta=0.1) | ||
| fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator, | ||
| state_equation, smoothing_kernel, | ||
| smoothing_length_fluid, | ||
| density_diffusion=density_diffusion, | ||
| acceleration=(0.0, -gravity), | ||
| source_terms=SourceTermDamping(; | ||
| damping_coefficient=0.05)) | ||
| end | ||
|
|
||
| boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass, | ||
| state_equation=state_equation, | ||
| boundary_density_calculator, | ||
| smoothing_kernel, smoothing_length_fluid) | ||
| boundary_system = WallBoundarySystem(tank.boundary, boundary_model) | ||
| boundary_model_structure = BoundaryModelDummyParticles(hydrodynamic_densities, | ||
| hydrodynamic_masses, | ||
| state_equation=state_equation, | ||
| boundary_density_calculator, | ||
| smoothing_kernel, | ||
| smoothing_length_structure) | ||
| structure_system = TotalLagrangianSPHSystem(structure_geometry, smoothing_kernel, | ||
| smoothing_length_structure, | ||
| E, nu, boundary_model=boundary_model_structure, | ||
| n_clamped_particles=nparticles(fixed_particles), | ||
| acceleration=(0.0, -gravity)) | ||
|
|
||
| min_corner = min.(minimum(structure_geometry.coordinates, dims=2), | ||
| minimum(tank.boundary.coordinates, dims=2), | ||
| minimum(tank.fluid.coordinates, dims=2)) .- smoothing_length_fluid | ||
| max_corner = max.(maximum(structure_geometry.coordinates, dims=2), | ||
| maximum(tank.boundary.coordinates, dims=2), | ||
| maximum(tank.fluid.coordinates, dims=2)) .+ smoothing_length_fluid | ||
|
|
||
| cell_list = FullGridCellList(; min_corner, max_corner) | ||
| neighborhood_search = GridNeighborhoodSearch{2}(; update_strategy=ParallelUpdate(), | ||
| cell_list) | ||
| semi = Semidiscretization(structure_system, fluid_system, boundary_system, | ||
| neighborhood_search=neighborhood_search, | ||
| parallelization_backend=PolyesterBackend()) | ||
| ode = semidiscretize(semi, tspan) | ||
|
|
||
| split_integration = SplitIntegrationCallback(CarpenterKennedy2N54(williamson_condition=false), | ||
| callback=StepsizeCallback(cfl=1.6), | ||
| dt=1.0) # dt will be overwritten by the stepsize cb | ||
|
|
||
|
svchb marked this conversation as resolved.
|
||
| # This can be overwritten with `trixi_include` | ||
| extra_callback = nothing | ||
|
|
||
| info_callback = InfoCallback(interval=100) | ||
| saving_callback = SolutionSavingCallback(dt=0.1, prefix="") | ||
| callbacks = CallbackSet(info_callback, saving_callback, split_integration, extra_callback) | ||
|
|
||
| sol = solve(ode, RDPK3SpFSAL49(), dt=1e-8, reltol=1e-6, save_everystep=false, | ||
| callback=callbacks) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.