Skip to content
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

Implement Morris surface tension model #584

Draft
wants to merge 254 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
90897f6
Merge branch 'main' of github.com:svchb/TrixiParticles.jl
svchb Sep 29, 2023
1df6912
Merge branch 'main' of github.com:svchb/TrixiParticles.jl
svchb Oct 5, 2023
6449b5f
Merge branch 'main' of github.com:svchb/TrixiParticles.jl
svchb Oct 10, 2023
439210f
merge by hand
svchb Oct 11, 2023
b31640f
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
675c030
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
2b0b09c
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
b812869
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
c3884d7
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
45938eb
Merge branch 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
3bdfc20
Merge tag 'HEAD' into ipf_surface_tension
svchb Jan 25, 2024
de4f0e8
Merge branch 'conflict1'
svchb Jan 25, 2024
c49dd87
fix merge problems
svchb Jan 25, 2024
780cee3
fix merge
svchb Jan 25, 2024
7550c3d
fix merge
svchb Jan 25, 2024
87c21b9
fix merge
svchb Jan 25, 2024
9cab05f
fix merge
svchb Jan 25, 2024
896faef
fix merge
svchb Jan 25, 2024
b567c55
more merge fixes
svchb Jan 25, 2024
3de9a75
format
svchb Jan 25, 2024
06a1223
fix
svchb Jan 25, 2024
31d4404
fix
svchb Jan 25, 2024
a95a54a
fix
svchb Jan 25, 2024
ce74643
fix
svchb Jan 25, 2024
17da7ef
fix
svchb Jan 25, 2024
f002d2b
more fixes
svchb Jan 25, 2024
120eb80
fix
svchb Jan 25, 2024
31208ad
fix
svchb Jan 25, 2024
81591ad
fix
svchb Jan 25, 2024
066f967
more fixes
svchb Jan 25, 2024
df6e1ac
fix
svchb Jan 25, 2024
b58fbca
Merge branch 'main'
svchb Jan 25, 2024
df44891
fix
svchb Jan 25, 2024
bd8cd98
Merge branch 'main' into ipf_surface_tension
svchb Mar 21, 2024
23d72d8
format
svchb Mar 21, 2024
82d6b71
running
svchb Mar 21, 2024
3338a3f
update
svchb Mar 21, 2024
eae775c
update
svchb Mar 21, 2024
53e6afd
optimization
svchb Mar 22, 2024
75983ac
update
svchb Mar 22, 2024
3aec5c6
update
svchb Mar 22, 2024
651790c
update
svchb Mar 25, 2024
f721ac2
update
svchb Mar 25, 2024
e4b9a75
format
svchb Mar 25, 2024
66f2a03
up
svchb Mar 26, 2024
d4893fb
update
svchb Mar 27, 2024
e95151d
remove unused code
svchb Apr 2, 2024
8c8a3cc
Merge branch 'ipf_surface_tension' of github.com:svchb/TrixiParticles…
svchb Apr 2, 2024
4bd3c22
switch to support radius
svchb Apr 2, 2024
79fac64
update
svchb Apr 2, 2024
af7c748
fix doc
svchb Apr 2, 2024
ccde44a
add adhesion coefficient
svchb Apr 2, 2024
dd53390
update_broken
svchb Apr 3, 2024
7e504a9
update
svchb Apr 3, 2024
2d230bf
format
svchb Apr 4, 2024
d0d6408
add to examples
svchb Apr 4, 2024
6ddd51c
fix tests
svchb Apr 4, 2024
dbfc4db
Merge branch 'main' into ipf_surface_tension
svchb Apr 4, 2024
35a3e3e
fix merge
svchb Apr 4, 2024
43b45f4
fix typos
svchb Apr 4, 2024
a5e3ab1
add basic test
svchb Apr 4, 2024
4e2059d
format
svchb Apr 4, 2024
08c662e
rename
svchb Apr 4, 2024
a9a5b98
format
svchb Apr 4, 2024
6060b04
rename container system
svchb Apr 4, 2024
fb762b9
reduce example run time
svchb Apr 5, 2024
9685cdb
update news and readme
svchb Apr 5, 2024
a6892f4
format
svchb Apr 5, 2024
f598b98
fix test
svchb Apr 5, 2024
d2303ec
reduce run time
svchb Apr 5, 2024
bb68e90
format
svchb Apr 5, 2024
1fbc7cb
Merge branch 'main' into ipf_surface_tension
svchb Apr 19, 2024
5a59211
fix
svchb Apr 19, 2024
451e1e6
correct merge
svchb Apr 19, 2024
755e768
update doc test
svchb Apr 19, 2024
aaf3bd9
revert
svchb Apr 19, 2024
f50d436
Merge branch 'main'
svchb May 3, 2024
493c6ea
Merge branch 'main'
svchb May 3, 2024
c0c1227
fix tests
svchb May 3, 2024
8031c01
fix
svchb May 3, 2024
f9dfe29
Merge branch 'main' into ipf_surface_tension
svchb May 7, 2024
14c7999
fix
svchb May 7, 2024
a00f254
review comments
svchb May 7, 2024
367f2fa
fix
svchb May 7, 2024
e9be23a
fix
svchb May 7, 2024
4626383
correct some stuff
svchb May 7, 2024
03618b9
init with empty initial condition
svchb May 7, 2024
6a5f5ad
Merge branch 'main' into ipf_surface_tension
svchb May 10, 2024
ab72434
review update
svchb May 13, 2024
a4e3d92
rename function
svchb May 13, 2024
fc6432f
Merge branch 'ipf_surface_tension' of https://github.com/svchb/TrixiP…
svchb May 13, 2024
f5c59dd
remove unnecessary if
svchb May 13, 2024
702e833
docs
svchb May 13, 2024
89af7de
fix doc
svchb May 13, 2024
3e0ca33
revert one change
svchb May 13, 2024
050e42d
fix typo
svchb May 13, 2024
67630d6
update
svchb May 13, 2024
2f25b28
try to avoid allocs
svchb May 14, 2024
d0c5d2d
fix mem allocs
svchb May 15, 2024
069be49
review update
svchb May 16, 2024
4ba6e9c
update docs
svchb May 16, 2024
15a3446
update
svchb May 16, 2024
56678f4
Merge branch 'main' into ipf_surface_tension
svchb May 16, 2024
b8c4d89
Merge remote-tracking branch 'upstream/main'
svchb May 16, 2024
0409873
Merge branch 'main' into ipf_surface_tension
svchb May 17, 2024
ed1fca0
review
svchb May 22, 2024
414adcf
Merge branch 'main' into ipf_surface_tension
svchb May 23, 2024
cde0fa5
fix
svchb May 24, 2024
7d778a7
format
svchb May 24, 2024
fd523fc
Merge remote-tracking branch 'upstream/main'
svchb May 27, 2024
cc992b6
Merge branch 'ipf_surface_tension' of https://github.com/svchb/TrixiP…
svchb May 27, 2024
707c4ab
make examples smaller
svchb May 27, 2024
70ff163
reduce resolution
svchb May 27, 2024
4d1062f
review
svchb May 27, 2024
5a26313
rename
svchb May 27, 2024
760eddb
use trixi_include
svchb May 27, 2024
5c40040
format
svchb May 27, 2024
624d66f
use trixi_include
svchb May 27, 2024
1692242
update
svchb May 27, 2024
3c0f684
update
svchb May 27, 2024
c8cd876
review update
svchb May 27, 2024
a197fbe
Merge branch 'main' into ipf_surface_tension
svchb May 27, 2024
78e99e1
format
svchb May 27, 2024
dfbcf2b
Merge branch 'ipf_surface_tension' of https://github.com/svchb/TrixiP…
svchb May 27, 2024
51c2ec0
fix test errors
svchb May 27, 2024
8f78cd4
update
svchb May 27, 2024
a795fbc
fix
svchb May 28, 2024
b6a62d7
remove invalid surface normals
svchb May 28, 2024
63535a6
add
svchb May 28, 2024
7a2d704
Merge branch 'main' of github.com:svchb/TrixiParticles.jlOpen
svchb May 29, 2024
63537a6
Merge branch 'main'
svchb May 29, 2024
7bbb3a5
fix
svchb May 30, 2024
ff84aea
update
svchb May 30, 2024
7aa1e84
update
svchb Jun 18, 2024
06976eb
Merge branch 'main' into generalize_surface_normal_calc
svchb Jul 16, 2024
341886d
update
svchb Jul 16, 2024
61e3325
fix
svchb Jul 16, 2024
c53246d
update
svchb Jul 17, 2024
6bc5567
update
svchb Jul 18, 2024
c017b45
update
svchb Jul 22, 2024
6de5f70
remove unused
svchb Jul 22, 2024
3a083a6
remove unused
svchb Jul 22, 2024
f759fb3
format
svchb Jul 22, 2024
1c5d0aa
Merge branch 'main' into generalize_surface_normal_calc
svchb Jul 22, 2024
54dc3ed
fix tests
svchb Jul 22, 2024
0326b98
fix
svchb Jul 22, 2024
dbb9d75
Merge branch 'main' into generalize_surface_normal_calc
svchb Jul 26, 2024
643dfa8
fix
svchb Jul 26, 2024
50dc742
fix naming
svchb Jul 26, 2024
7a77c11
format
svchb Jul 26, 2024
1969525
fix test
svchb Jul 29, 2024
cf28d2e
inter
svchb Aug 1, 2024
e108d22
update
svchb Aug 1, 2024
613a0d4
fix computation for a single color
svchb Aug 6, 2024
ed83ea1
set test up for 1.11
svchb Aug 8, 2024
5142d13
Merge branch 'main' into generalize_surface_normal_calc
svchb Aug 8, 2024
bf28936
update
svchb Aug 8, 2024
8add6f4
update
svchb Aug 9, 2024
493e26b
Merge branch 'main' into prepare_for_1.11
svchb Aug 12, 2024
3f18112
update
svchb Aug 12, 2024
1c1cd58
Merge branch 'main' into generalize_surface_normal_calc
svchb Aug 12, 2024
612fd43
fix test
svchb Aug 13, 2024
f39f04f
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Aug 13, 2024
35b7c4a
rename to number_density
svchb Aug 14, 2024
3733c21
back merge
svchb Aug 14, 2024
e1fc1bb
fix
svchb Aug 15, 2024
04595af
format
svchb Aug 15, 2024
bf4bea2
fix
LasNikas Aug 15, 2024
f629239
typo
LasNikas Aug 15, 2024
7b91e09
fix
svchb Aug 15, 2024
7d5a5fc
fix again
LasNikas Aug 15, 2024
0acdcc5
fix tests
svchb Aug 15, 2024
e493b7e
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Aug 15, 2024
1cc9c3b
moved from #523
svchb Aug 15, 2024
3c21841
add new example
svchb Aug 20, 2024
9f7d1c1
remove soundspeed from OBS
svchb Aug 20, 2024
5c4734c
Merge branch 'main' into remove_soundspeed
svchb Aug 20, 2024
a01311c
skip empty system
svchb Aug 20, 2024
bad7de8
add basic struct
svchb Aug 20, 2024
aa90aae
add export
svchb Aug 20, 2024
7841461
make equation available
svchb Aug 20, 2024
1e07757
format
svchb Aug 20, 2024
98065e6
typo
svchb Aug 20, 2024
6eb6fec
fix docs
svchb Aug 20, 2024
24a21fc
fix test
svchb Aug 21, 2024
dcecbe0
fix tests
svchb Aug 21, 2024
6151f7f
fix tests
svchb Aug 21, 2024
83ebc5f
add exmaple
svchb Aug 21, 2024
aa9348c
format
svchb Aug 21, 2024
43e89fd
fix bug
svchb Aug 21, 2024
f65eb5a
fix
svchb Aug 22, 2024
da719c8
Merge remote-tracking branch 'origin/apply_samesys_dd' into fix_obs_f…
svchb Aug 22, 2024
1ba97a5
Merge remote-tracking branch 'origin/remove_soundspeed' into fix_obs_…
svchb Aug 22, 2024
3678983
Merge remote-tracking branch 'origin/skip_empty_system_io' into fix_o…
svchb Aug 22, 2024
b164e7a
Merge branch 'fix-moving-boundaries' into fix_obs_for_free_surface
svchb Aug 22, 2024
0091cc3
fix
svchb Aug 22, 2024
fbaf108
check dimensionality of reference functions
svchb Aug 23, 2024
e720529
propagate characteristics
svchb Aug 23, 2024
d14fd19
Merge branch 'main' into generalize_surface_normal_calc
svchb Sep 25, 2024
7400487
update
svchb Sep 27, 2024
c77b1cf
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Sep 27, 2024
bb12fb8
back merge from #584
svchb Sep 27, 2024
f84cafa
move additonal changes from #584
svchb Sep 27, 2024
7cbfd72
add test
svchb Sep 27, 2024
528c2fd
add test
svchb Sep 30, 2024
a4381aa
format
svchb Sep 30, 2024
eab774a
Merge branch 'main' into generalize_surface_normal_calc
svchb Sep 30, 2024
881c503
Merge remote-tracking branch 'origin/generalize_surface_normal_calc' …
svchb Sep 30, 2024
fb9a927
Merge branch 'main' into morris_surface_tension
svchb Oct 7, 2024
a2ca4c1
format
svchb Oct 7, 2024
318720c
fix typo
svchb Oct 7, 2024
5ebc4e7
Merge remote-tracking branch 'upstream/main' into fix_obs_for_free_su…
svchb Oct 7, 2024
7baeec4
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 7, 2024
550146f
cleanup
svchb Oct 8, 2024
90766fe
update
svchb Oct 8, 2024
31b2f75
Merge branch 'main' into prepare_for_1.11
svchb Oct 9, 2024
1d05304
Merge branch 'main' into prepare_for_1.11
svchb Oct 9, 2024
4ed0b91
Increase errors for 1.11
svchb Oct 9, 2024
1ce0460
Fix invalidations
svchb Oct 9, 2024
1774f5a
Fix tests
svchb Oct 9, 2024
4daf984
Update ci.yml
svchb Oct 9, 2024
ac2eb2c
revert
svchb Oct 9, 2024
258f2ba
Update ci.yml
svchb Oct 9, 2024
139e282
Merge remote-tracking branch 'origin/prepare_for_1.11' into fix_obs_f…
svchb Oct 10, 2024
1a9f3f5
Update test/validation/validation.jl
svchb Oct 10, 2024
da9be38
revert changes that had no benefit
svchb Oct 10, 2024
95be0e9
update
svchb Oct 10, 2024
4b87c7c
cleanup
svchb Oct 10, 2024
8c72576
include in test run
svchb Oct 10, 2024
782f9de
remove redundancy
svchb Oct 10, 2024
fa45125
Merge branch 'main' into morris_surface_tension
svchb Oct 10, 2024
8946b45
Merge branch 'main' into generalize_surface_normal_calc
svchb Oct 10, 2024
ddfab3e
Merge remote-tracking branch 'origin/prepare_for_1.11' into generaliz…
svchb Oct 10, 2024
f266682
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Oct 10, 2024
b0d24cc
Merge remote-tracking branch 'origin/prepare_for_1.11' into fix_obs_f…
svchb Oct 10, 2024
ff75223
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 10, 2024
796b1d1
Merge branch 'main' into add_ideal_gas
svchb Oct 10, 2024
c402975
Merge remote-tracking branch 'origin/prepare_for_1.11' into add_ideal…
svchb Oct 10, 2024
83514da
Merge remote-tracking branch 'origin/add_ideal_gas' into add_ideal_gas
svchb Oct 10, 2024
e94218c
Merge branch 'add_ideal_gas'
svchb Oct 10, 2024
6f5ca10
revert
svchb Oct 10, 2024
5e688d2
fix tests
svchb Oct 11, 2024
7557879
fix
svchb Oct 11, 2024
83ba221
Merge remote-tracking branch 'origin/morris_surface_tension' into mor…
svchb Oct 11, 2024
b4f7a2e
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 11, 2024
8294aa9
fix test
svchb Oct 11, 2024
b5663f5
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 11, 2024
bdd6756
fix test
svchb Oct 11, 2024
d8f9b1a
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 11, 2024
6c93850
Merge branch 'main' into morris_surface_tension
svchb Oct 11, 2024
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
248 changes: 248 additions & 0 deletions examples/fluid/calibration_water_drop_shape.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
# In this example we try to approach the static shape of a water droplet on a horizontal plane.
# The shape of a static droplet can be calculated from the Young-Laplace equation.
using TrixiParticles
using OrdinaryDiffEq

# ==========================================================================================
# ==== Resolution
fluid_particle_spacing = 0.0001

boundary_layers = 4
spacing_ratio = 1

# ==========================================================================================
# ==== Experiment Setup
gravity = 9.81
tspan = (0.0, 5.0)

# Boundary geometry and initial fluid particle positions
initial_fluid_size = (0.0, 0.0)
tank_size = (0.05, 0.01)

fluid_density = 1000.0
sound_speed = 50

state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density,
exponent=1)

tank = RectangularTank(fluid_particle_spacing, initial_fluid_size, tank_size, fluid_density,
n_layers=boundary_layers, spacing_ratio=spacing_ratio,
faces=(true, true, true, false),
acceleration=(0.0, -gravity), state_equation=state_equation)

sphere_radius = 0.0015

sphere1_center = (0.5, sphere_radius)
sphere1 = SphereShape(fluid_particle_spacing, sphere_radius, sphere1_center,
fluid_density, sphere_type=VoxelSphere())

# ==========================================================================================
# ==== Fluid
# fluid_smoothing_length = 1.2 * fluid_particle_spacing
# fluid_smoothing_kernel = SchoenbergCubicSplineKernel{2}()

fluid_smoothing_length = 2.5 * fluid_particle_spacing
fluid_smoothing_kernel = WendlandC2Kernel{2}()

fluid_smoothing_length_2 = 2.5 * fluid_particle_spacing
fluid_smoothing_kernel_2 = WendlandC2Kernel{2}()

fluid_density_calculator = ContinuityDensity()

# water at 20C
#nu=0.00089
nu = 0.00089
# too much 0.00089 -> 0.00045 -> 0.0002 -> 0.0001
# no impact 0.00005

# the following term only holds for 2d sims
# alpha = 8 * nu / (fluid_smoothing_length * sound_speed)
viscosity = ViscosityAdami(nu=nu)
# density_diffusion = DensityDiffusionAntuono(sphere2, delta=0.1)

# with increased smoothing length surface_tension is too small
sphere_surface_tension = WeaklyCompressibleSPHSystem(sphere1, fluid_density_calculator,
state_equation, fluid_smoothing_kernel,
fluid_smoothing_length,
viscosity=viscosity,
acceleration=(0.0, -gravity),
surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.008),
correction=AkinciFreeSurfaceCorrection(fluid_density))

# 0.001
# 0.2 > 90
# 0.15 > 90
# 0.125 > 90
# 0.11 60-90
# 0.1 ~ 45

# 0.0008
# 0.11 ~45-50
# 0.1125 ~90
# 0.115 ~90
# 0.12 > 90

# 0.0005
#0.11 ~100

# 0.00025
# 0.115 ~60 grad aber zu tief in der mitte 0.006
# 0.115 and increase nu to 0.0002

# 0.0001 deg 90 (x-axis: 2mm, y-axis: 1.8mm)
# start x-axis ~1.7mm y-axis: 2.2mm ~110deg distance to boundary to large at adhesion coefficient 1.0
# increase adhesion coefficient to 1.1 x-axis ~1.8mm y-axis: 2mm ~100deg distance still to high
# increase adhesion coefficient to 1.2 x-axis ~2.8 y-axis: 1.7 distance still to high
# decrease adhesion coefficient to 1.15 x-axis 2.4mm y-axis: 1.9 distance high
# decrease adhesion coefficient to 1.125 x-axis 2-2.2mm y-axis: 1.9 distance high ~90+
# decrease surface tension coefficient from 0.115 to 0.11 x-axis: 2.6mm y-axis: 1.7 -> invalid too much adhesion
# increase surface tension coefficient from 0.11 to 0.1125 x-axis: 2-2.2mm y-axis: 1.9
# increase surface tension coefficient from 0.1125 to 0.12 x-axis: 1.9-2mm y-axis: 2.0
# increase viscosity from 0.0001 to 0.0002 x-axis: 1.8mm y-axis:2.2
# increase adhesion coefficient from 1.125 to 1.15 x-axis: 1.8mm y-axis:2.1
# increase adhesion coefficient from 1.15 to 1.2 x-axis: 1.8mm y-axis:2.1
# increase adhesion coefficient from 1.2 to 1.25 x-axis: 2.6mm y-axis:1.7
# increase viscosity from 0.0002 to 0.0003 x-axis: 2.1mm y-axis:1.9 <=== (adh=1.25, surft=0.12, nu=0.0003)
# increase adhesion coefficient from 1.25 to 1.275 x-axis: 2.6mm y-axis:1.7
# decrease adhesion coefficient from 1.275 to 1.26 x-axis: 2.2mm y-axis:1.8
# decrease adhesion coefficient from 1.26 to 1.255 x-axis: 1.8-2.6mm y-axis:1.8
# increase viscosity from 0.0003 to 0.00031 x-axis: 2.2-2.8mm y-axis:1.7
# increase viscosity from 0.00031 to 0.00032 x-axis: 2.2-2.8mm y-axis:1.7

# 0.0001 deg 75 (x-axis: 2.2mm, y-axis: 1.6mm)
#(adh=1.25, surft=0.12, nu=0.0003)
# decrease surft=0.11 x-axis: 2.4-2.6mm y-axis:1.6
# decrease adh=1.2 x-axis: 2.2-2.4mm y-axis:1.8
# increase viscosity = 0.00035 x-axis: 2.4-3.2mm y-axis:1.6
# increase viscosity = 0.0004 x-axis: 2.6-2.8mm y-axis:1.4
# increase viscosity = 0.00045 x-axis: 2.4-3.2mm y-axis:1.4
# decrease adh=1.15 x-axis: 1.8mm y-axis:2.1
# increase adh=1.175 x-axis: 1.8mm y-axis:2.2
# increase adh=1.19 x-axis: 1.8mm y-axis:2.1
#(adh=1.25, surft=0.12, nu=0.0003)
# increase adh=1.3 and x-axis: 2.4mm y-axis:1.8
# decrease adh=1.275 and x-axis: 2.4mm y-axis:1.8
# decrease adh=1.26 and x-axis: 2.4mm y-axis:1.8
# decrease adh=1.255 and x-axis: 2.4mm y-axis:1.8
# decrease smoothing length from 4 -> 3.75 x-axis: 2mm y-axis:1.9

# 60deg x=2.4, y=1.3
# adh = 1.15, surft=0.115, nu=0.0003, h=3.75, x=1.7-1.8, y=2.2
# adh = 1.2, surft=0.115, nu=0.0003, h=3.75, x=2-2.2, y=1.8
# adh = 1.25, surft=0.115, nu=0.0003, h=3.75, x=2.2, y=1.8
# adh = 1.3, surft=0.115, nu=0.0003, h=3.75, x=2.6, y=1.6
# adh = 1.3, surft=0.12, nu=0.0003, h=3.75, x=2.2-2.6, y=1.6
# adh = 1.3, surft=0.125, nu=0.0003, h=3.75, x=2, y=1.8
# adh = 1.35, surft=0.125, nu=0.0003, h=3.75, x=2.5, y=1.6
# adh = 1.35, surft=0.13, nu=0.0003, h=3.75, x=2-2.2, y=1.8
# adh = 1.4, surft=0.13, nu=0.0003, h=3.75, x=2-2.2, y=1.8
# adh = 1.45, surft=0.13, nu=0.0003, h=3.75, x=2.6, y=1.6
# not possible with smoothing_length -> lower to 3 and switch from C4 to C2
# adh = 1.45, surft=0.13, nu=0.0003, h=3.0, x=1.4, y=2.6
# adh = 1.45, surft=0.12, nu=0.0003, h=3.0, x=1.4, y=2.4
# adh = 1.5, surft=0.12, nu=0.0003, h=3.0, x=1.6, y=2.6
# adh = 1.5, surft=0.11, nu=0.0003, h=3.0, x=1.4, y=2.4
# adh = 1.5, surft=0.10, nu=0.0003, h=3.0, x=1.4, y=2.4
# adh = 1.5, surft=0.05, nu=0.0003, h=3.0, x=3.5, y=2.0
# adh = 1.4, surft=0.075, nu=0.0003, h=3.0, x=3, y=2.0
# adh = 1.4, surft=0.075, nu=0.0003, h=2.0, x=3, y=2.0 crap
# adh = 1.4, surft=0.05, nu=0.0003, h=2.0, x=3, y=2.0 crap
# adh = 1.4, surft=0.01, nu=0.0003, h=2.0, x=3, y=2.0 crap
# adh = 1.4, surft=0.01, nu=0.0001, h=2.0, x=3, y=2.0 crap
# adh = 1.4, surft=0.001, nu=0.00089, h=2.0, x=3, y=2.0 crap
# adh = 1.2, surft=0.002, nu=0.00089, h=2.0, x=3, y=2.0 crap
# adh = 1.2, surft=0.002, nu=0.00089, h=2.5, x=2.5, y=1.4 close but too much adh
# adh = 0.6, surft=0.002, nu=0.00089, h=2.5, x=2.7, y=1.3 close but too much adh
# adh = 0.3, surft=0.002, nu=0.00089, h=2.5, x=2.8, y=1.2
# adh = 0.15, surft=0.002, nu=0.00089, h=2.5, x=2.8, y=1.2
# adh = 0.075, surft=0.002, nu=0.00089, h=2.5, x=3.4, y=1.2
# adh = 0.075, surft=0.004, nu=0.00089, h=2.5, x=2.8, y=1.4
# adh = 0.075, surft=0.01, nu=0.00089, h=2.5, x=2.2, y=1.7
# adh = 0.075, surft=0.007, nu=0.00089, h=2.5, x=2.6, y=1.4 <- okish but form needs more adh
# adh = 0.075, surft=0.008, nu=0.00089, h=2.5, x=2.6, y=1.4
# adh = 0.1, surft=0.01, nu=0.00089, h=2.5, x=2.4, y=1.6 <- okish but form needs more adh
# adh = 0.15, surft=0.01, nu=0.00089, wall_nu=0.00089, h=2.5, x=2.4, y=1.8
# adh = 0.15, surft=0.01, nu=0.00089, h=2.5, wall_nu=0.5*0.00089, x=2.2, y=1.7 <-lower wall viscosity
# adh = 0.15, surft=0.01, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.6, y=1.6 <-lower wall viscosity
# adh = 0.15, surft=0.015, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.2, y=1.8
# adh = 0.2, surft=0.015, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.2, y=1.8
# adh = 0.2, surft=0.0125, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.6, y=1.7
# adh = 0.25, surft=0.014, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.4, y=1.6
# adh = 0.25, surft=0.014, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.8, y=1.5 diverged for up to 3s
# adh = 0.25, surft=0.015, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.5, y=1.6 diverged at 2.722 <----
# adh = 0.25, surft=0.016, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.5, y=1.6
# adh = 0.1, surft=0.0125, nu=0.00089, h=2.5, wall_nu=20*0.00089, x=2.2, y=1.7 <- 75d
# adh = 0.15, surft=0.0125, nu=0.00089, h=2.5, wall_nu=20*0.00089, x=2.2, y=1.7
# adh = 0.15, surft=0.0125, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.3, y=1.7
# adh = 0.2, surft=0.0125, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.6, y=1.6
# adh = 0.15, surft=0.0125, nu=0.00089, h=2.5, wall_nu=0.00089, x=2.6, y=1.5
# adh = 0.15, surft=0.0125, nu=0.00089, h=2.5, wall_nu=5 * 0.00089, x=2.4, y=1.6
# adh = 0.13, surft=0.011, nu=0.00089, h=2.5, wall_nu=5*0.00089, x=2.6, y=1.5
# adh = 0.11, surft=0.011, nu=0.00089, h=2.5, wall_nu=5*0.00089, x=2.4, y=1.6

# 75deg (x-axis: 2.2mm, y-axis: 1.6mm)
# adh = 0.20, surft=0.015, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.5, y=1.6
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=20*0.00089, x=2, y=1.7 <- 90d
# adh = 0.1, surft=0.0125, nu=0.00089, h=2.5, wall_nu=20*0.00089, x=2.2, y=1.7
# adh = 0.1, surft=0.0125, nu=0.00089, h=2.5, wall_nu=7*0.00089, x=2.2, y=1.6
# adh = 0.08, surft=0.011, nu=0.00089, h=2.5, wall_nu=7*0.00089, x=2.3, y=1.6
# adh = 0.07, surft=0.011, nu=0.00089, h=2.5, wall_nu=7*0.00089, x=2.2, y=1.6
# adh = 0.07, surft=0.011, nu=0.00089, h=2.5, wall_nu=5*0.00089, x=2.3, y=1.6
# adh = 0.05, surft=0.008, nu=0.00089, h=2.5, wall_nu=2*0.00089, x=2.2, y=1.6

# 90deg (x-axis: 2mm, y-axis: 1.8mm)
# adh = 0.15, surft=0.015, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.5, y=1.6
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=0.25*0.00089, x=2.2, y=1.7 after capallariy test
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=0.4*0.00089, x=2.2, y=1.6
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=0.00089, x=2.2, y=1.6
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=2*0.00089, x=2.2, y=1.7
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=4*0.00089, x=2.2, y=1.7
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.7
# adh = 0.05, surft=0.0125, nu=0.00089, h=2.5, wall_nu=20*0.00089, x=2, y=1.7 <- does not work in capallariy test
# adh = 0.04, surft=0.0125, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.1, y=1.7 <- further testing showed surface tension is about 10-20% too high
# adh = 0.04, surft=0.011, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.7
# adh = 0.03, surft=0.011, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.7 **** <- seems to be still too high
# adh = 0.02, surft=0.011, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.8
# adh = 0.02, surft=0.011, nu=0.00089, h=2.5, wall_nu=15*0.00089, x=2.2, y=1.7
# adh = 0.01, surft=0.011, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.7
# adh = 0.01, surft=0.008, nu=0.00089, h=2.5, wall_nu=5*0.00089, x=2.2, y=1.6
# adh = 0.01, surft=0.008, nu=0.00089, h=2.5, wall_nu=10*0.00089, x=2.2, y=1.6

# sphere = WeaklyCompressibleSPHSystem(sphere2, fluid_density_calculator,
# state_equation, fluid_smoothing_kernel_2,
# fluid_smoothing_length_2, viscosity=viscosity,
# density_diffusion=density_diffusion,
# acceleration=(0.0, -gravity))

# ==========================================================================================
# ==== Boundary
boundary_density_calculator = AdamiPressureExtrapolation()
boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundary.mass,
state_equation=state_equation,
boundary_density_calculator,
fluid_smoothing_kernel_2,
fluid_smoothing_length_2,
viscosity=ViscosityAdami(nu=10 * nu))

# adhesion_coefficient = 1.0 and surface_tension_coefficient=0.01 for perfect wetting
# adhesion_coefficient = 0.001 and surface_tension_coefficient=2.0 for no wetting
boundary_system = BoundarySPHSystem(tank.boundary, boundary_model,
adhesion_coefficient=0.01)

# ==========================================================================================
# ==== Simulation
semi = Semidiscretization(boundary_system, sphere_surface_tension)
ode = semidiscretize(semi, tspan)

info_callback = InfoCallback(interval=50)
saving_callback = SolutionSavingCallback(dt=0.01, output_directory="out", prefix="",
write_meta_data=true)

callbacks = CallbackSet(info_callback, saving_callback)

# Use a Runge-Kutta method with automatic (error based) time step size control.
sol = solve(ode, RDPK3SpFSAL35(),
abstol=1e-5, # Default abstol is 1e-6
reltol=1e-4, # Default reltol is 1e-3
dt=1e-4, maxiters=1E12,
save_everystep=false, callback=callbacks);
104 changes: 104 additions & 0 deletions examples/fluid/dam_break_2_phase_2d.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 2D dam break simulation with an oil film on top

using TrixiParticles
using OrdinaryDiffEq

# Size parameters
H = 0.6
W = 2 * H

gravity = 9.81
tspan = (0.0, 2.0)

# Resolution
fluid_particle_spacing = H / 60

# Numerical settings
smoothing_length = 3.5 * fluid_particle_spacing
sound_speed = 100

# physical values
nu_water = 8.9E-7
nu_air = 1.544E-5
nu_ratio = nu_water / nu_air

nu_sim_air = 0.02 * smoothing_length * sound_speed
nu_sim_water = nu_ratio * nu_sim_air

air_viscosity = ViscosityMorris(nu=nu_sim_air)
water_viscosity = ViscosityMorris(nu=nu_sim_water)

trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
sol=nothing, fluid_particle_spacing=fluid_particle_spacing,
viscosity=water_viscosity, smoothing_length=smoothing_length,
gravity=gravity, tspan=tspan,
density_diffusion=nothing,
sound_speed=sound_speed,
surface_tension=SurfaceTensionMorris(surface_tension_coefficient=0.08),
cfl=0.8,
tank_size=(floor(5.366 * H / fluid_particle_spacing) * fluid_particle_spacing,
2.6 * H))

# TODO: broken (fixed?)
# trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
# sol=nothing, fluid_particle_spacing=fluid_particle_spacing,
# viscosity=ViscosityMorris(nu=nu), smoothing_length=smoothing_length,
# gravity=gravity, tspan=tspan,
# density_diffusion=DensityDiffusionMolteniColagrossi(delta=0.1),
# sound_speed=sound_speed,
# surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.02),
# correction=AkinciFreeSurfaceCorrection(1000.0))

# ==========================================================================================
# ==== Setup oil layer

oil_size = (tank_size[1], 1.5 * H)
oil_size2 = (tank_size[1] - W, H)
oil_density = 1.0

oil = RectangularShape(fluid_particle_spacing,
round.(Int, oil_size ./ fluid_particle_spacing),
zeros(length(oil_size)), density=oil_density)

oil2 = RectangularShape(fluid_particle_spacing,
round.(Int, oil_size2 ./ fluid_particle_spacing),
(W, 0.0), density=oil_density)

# move on top of the water
for i in axes(oil.coordinates, 2)
oil.coordinates[:, i] .+= [0.0, H]
end

oil = union(oil, oil2)

oil_system = WeaklyCompressibleSPHSystem(oil, fluid_density_calculator,
StateEquationCole(; sound_speed,
reference_density=oil_density,
exponent=1,
clip_negative_pressure=false),
smoothing_kernel,
smoothing_length, viscosity=air_viscosity,
#density_diffusion=density_diffusion,
acceleration=(0.0, -gravity))

# oil_system = WeaklyCompressibleSPHSystem(oil, fluid_density_calculator,
# StateEquationIdealGas(; gas_constant=287.0, temperature=293.0, gamma=1.4),
# smoothing_kernel,
# smoothing_length, viscosity=air_viscosity,
# density_diffusion=density_diffusion,
# acceleration=(0.0, -gravity))

# ==========================================================================================
# ==== Simulation
semi = Semidiscretization(fluid_system, oil_system, boundary_system,
neighborhood_search=GridNeighborhoodSearch{2}(update_strategy=nothing))
ode = semidiscretize(semi, tspan, data_type=nothing)

# sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false),
# dt=1.0, # This is overwritten by the stepsize callback
# save_everystep=false, callback=callbacks);
sol = solve(ode, RDPK3SpFSAL35(),
abstol=1e-5, # Default abstol is 1e-6 (may need to be tuned to prevent boundary penetration)
reltol=1e-4, # Default reltol is 1e-3 (may need to be tuned to prevent boundary penetration)
dtmax=1e-2, # Limit stepsize to prevent crashing
save_everystep=false, callback=callbacks);
7 changes: 5 additions & 2 deletions examples/fluid/dam_break_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ tank_size = (floor(5.366 * H / boundary_particle_spacing) * boundary_particle_sp
fluid_density = 1000.0
sound_speed = 20 * sqrt(gravity * H)
state_equation = StateEquationCole(; sound_speed, reference_density=fluid_density,
exponent=1, clip_negative_pressure=false)
exponent=1, clip_negative_pressure=false,
background_pressure=0.0)

tank = RectangularTank(fluid_particle_spacing, initial_fluid_size, tank_size, fluid_density,
n_layers=boundary_layers, spacing_ratio=spacing_ratio,
Expand All @@ -59,9 +60,11 @@ density_diffusion = DensityDiffusionAntuono(tank.fluid, delta=0.1)
fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
state_equation, smoothing_kernel,
smoothing_length, viscosity=viscosity,
reference_particle_spacing=fluid_particle_spacing,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity), correction=nothing,
surface_tension=nothing)
surface_tension=nothing,
reference_particle_spacing=fluid_particle_spacing)

# ==========================================================================================
# ==== Boundary
Expand Down
Loading
Loading