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

Open
wants to merge 409 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
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
76e5354
Merge branch 'main' into generalize_surface_normal_calc
svchb Oct 11, 2024
f267d43
Merge branch 'main' into add_ideal_gas
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
cde7990
Merge branch 'main' into fix_obs_for_free_surface
svchb Oct 11, 2024
6c93850
Merge branch 'main' into morris_surface_tension
svchb Oct 11, 2024
1191c3a
update
svchb Oct 11, 2024
c3683e9
fix division by zero
svchb Oct 11, 2024
1ec7eac
fix the test
svchb Oct 16, 2024
d0f475e
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Oct 16, 2024
8d58435
implement CFL condition
svchb Oct 16, 2024
e1ee75c
Merge branch 'morris_surface_tension' of https://github.com/svchb/Tri…
svchb Oct 16, 2024
77eafc0
fixes
svchb Oct 16, 2024
4ace40d
fix
svchb Oct 17, 2024
e031507
implement momentum conserving morris surface tension form
svchb Oct 22, 2024
d88dd72
update
svchb Oct 23, 2024
7d4ee69
update
svchb Oct 24, 2024
b3a88a0
make properties settable
svchb Oct 24, 2024
e079dc0
Merge remote-tracking branch 'refs/remotes/origin/main'
svchb Nov 13, 2024
7f85a3f
Merge branch 'generalize_surface_normal_calc'
svchb Nov 13, 2024
b4c5ace
format
svchb Nov 13, 2024
e555f03
Merge branch 'generalize_surface_normal_calc'
svchb Nov 13, 2024
6222872
format
svchb Nov 13, 2024
dcc7001
Merge branch 'main'
svchb Nov 13, 2024
0b3043c
Update news and set to 0.2.4
svchb Nov 13, 2024
3335386
update
svchb Nov 13, 2024
7d4016c
fix MD format
svchb Nov 13, 2024
28e9c2f
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 13, 2024
8837a5a
Merge branch 'fix_obs_for_free_surface'
svchb Nov 13, 2024
d8d6d4b
fix error
svchb Nov 13, 2024
f9e2202
Merge branch 'main' into add_ideal_gas
svchb Nov 13, 2024
c6b0c72
fix tests
svchb Nov 13, 2024
77493f5
format
svchb Nov 13, 2024
4192cf7
format
svchb Nov 13, 2024
b15fe3e
fix tests
svchb Nov 13, 2024
1db1507
fix test
svchb Nov 14, 2024
3065a5d
cleanup
svchb Nov 14, 2024
c47850b
Update NEWS.md
svchb Nov 14, 2024
aa53a4d
Update src/schemes/boundary/open_boundary/method_of_characteristics.jl
svchb Nov 15, 2024
eefcd6c
Update test/schemes/boundary/open_boundary/boundary_zone.jl
svchb Nov 15, 2024
9402b4a
Update src/setups/extrude_geometry.jl
svchb Nov 15, 2024
f1de160
Update src/schemes/boundary/open_boundary/method_of_characteristics.jl
svchb Nov 15, 2024
ba98d18
Update src/schemes/boundary/open_boundary/boundary_zones.jl
svchb Nov 15, 2024
e0ede3e
Update examples/fluid/pipe_flow_3d.jl
svchb Nov 15, 2024
d4016a6
review fixes
svchb Nov 16, 2024
7afffb4
Merge branch 'add_ideal_gas' of https://github.com/svchb/TrixiParticl…
svchb Nov 16, 2024
3dfa4e4
Merge branch 'main' into add_ideal_gas
svchb Nov 16, 2024
1467107
add test
svchb Nov 16, 2024
fc4f61b
fix example
svchb Nov 16, 2024
c4fcc16
Merge branch 'main' into fix_obs_for_free_surface
svchb Nov 16, 2024
e0eb153
fix test
svchb Nov 16, 2024
33a704a
fix test
svchb Nov 16, 2024
2533ed0
fix test
svchb Nov 16, 2024
4899d08
format
svchb Nov 16, 2024
d5e7c63
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 17, 2024
276436d
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 17, 2024
1781da0
Merge branch 'fix_obs_for_free_surface' into morris_surface_tension
svchb Nov 17, 2024
2fb587d
Merge branch 'add_ideal_gas' into morris_surface_tension
svchb Nov 17, 2024
eeca819
review comments
svchb Nov 18, 2024
c18b774
Merge branch 'main' into add_ideal_gas
svchb Nov 18, 2024
514ffcf
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 18, 2024
223bcd0
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 18, 2024
f5dac70
Merge branch 'main' into add_ideal_gas
svchb Nov 18, 2024
cc50150
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 18, 2024
38ba683
format
svchb Nov 18, 2024
5f96dab
fix test
svchb Nov 18, 2024
9286097
fix test
svchb Nov 18, 2024
b330a07
fix test
svchb Nov 19, 2024
ca3a3c0
fix
svchb Nov 19, 2024
f73614e
remove some allocations
svchb Nov 19, 2024
14ec982
format
svchb Nov 19, 2024
96e1cf6
fix docs
svchb Nov 19, 2024
bcfa0d8
Merge branch 'add_ideal_gas' into morris_surface_tension
svchb Nov 19, 2024
d9227bb
some fixes
svchb Nov 19, 2024
747bf1c
Update src/schemes/fluid/weakly_compressible_sph/state_equations.jl
svchb Nov 19, 2024
3c5fd08
add docs
svchb Nov 19, 2024
969dedd
review fixes
svchb Nov 19, 2024
c6371eb
remove independent setting of smoothing_kernel and smoothing_length
svchb Nov 19, 2024
4bf25e6
remove calls to surface_normal method smoothing kernel
svchb Nov 19, 2024
ebf6602
format
svchb Nov 19, 2024
8659850
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 19, 2024
5b0ed25
Merge branch 'generalize_surface_normal_calc' of https://github.com/s…
svchb Nov 19, 2024
7a6331e
update news
svchb Nov 19, 2024
3c80adf
typo
svchb Nov 19, 2024
4f66fa7
forgot to edit the other doc
svchb Nov 19, 2024
8faa548
Merge branch 'main' into add_ideal_gas
svchb Nov 19, 2024
2ba1902
Merge branch 'add_ideal_gas' into morris_surface_tension
svchb Nov 19, 2024
503bc8b
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 19, 2024
801b274
format
svchb Nov 19, 2024
d09b163
Update NEWS.md
svchb Nov 19, 2024
593c746
forgot some renames
svchb Nov 19, 2024
3180897
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 19, 2024
ba69a80
fix doc tests
svchb Nov 19, 2024
73b5749
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 19, 2024
67d5b87
fix docs
svchb Nov 19, 2024
f276a7b
fix tests
svchb Nov 19, 2024
b17a629
format
svchb Nov 19, 2024
ad7a11f
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 19, 2024
7b076e6
cleanup
svchb Nov 20, 2024
23cbd38
format
svchb Nov 20, 2024
537df19
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 20, 2024
cb227d5
Merge branch 'main' into morris_surface_tension
svchb Nov 20, 2024
20b77d7
Update NEWS.md
svchb Nov 20, 2024
d7b6af1
fix tests
svchb Nov 20, 2024
01bddb0
Merge branch 'generalize_surface_normal_calc' of https://github.com/s…
svchb Nov 20, 2024
dc6fa70
Update NEWS.md
svchb Nov 20, 2024
28b28b8
Merge branch 'generalize_surface_normal_calc'
svchb Nov 20, 2024
ffc83d3
Merge branch 'main'
svchb Nov 20, 2024
96d1a17
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 20, 2024
e424cfa
Merge branch 'main' into generalize_surface_normal_calc
svchb Nov 20, 2024
ec407ad
fixers
svchb Nov 20, 2024
041861e
fix
svchb Nov 20, 2024
21f08b2
fix
svchb Nov 21, 2024
93067f3
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 21, 2024
0b63bca
fix
svchb Nov 21, 2024
4501847
Merge branch 'generalize_surface_normal_calc'
svchb Nov 21, 2024
b7f448c
fix
svchb Nov 21, 2024
a2cda84
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Nov 21, 2024
ccf94c6
improve documentation
svchb Nov 21, 2024
8851385
fixes
svchb Nov 21, 2024
57ab0a6
format
svchb Nov 21, 2024
a690b52
adding this again
svchb Nov 21, 2024
f4fbbb3
Merge branch 'main' into generalize_surface_normal_calc
svchb Dec 2, 2024
589d416
review fixes
svchb Dec 2, 2024
1263e1a
Merge branch 'generalize_surface_normal_calc' of https://github.com/s…
svchb Dec 2, 2024
39a8f79
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 2, 2024
dd56f47
review comments
svchb Dec 4, 2024
306f96d
Merge branch 'generalize_surface_normal_calc' of https://github.com/s…
svchb Dec 4, 2024
eab49a1
Merge remote-tracking branch 'refs/remotes/origin/generalize_surface_…
svchb Dec 4, 2024
7c7a1f0
fix test
svchb Dec 4, 2024
2223ee8
update
svchb Dec 4, 2024
9ad0526
format
svchb Dec 4, 2024
93630aa
fix test
svchb Dec 4, 2024
64396ef
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 4, 2024
2cc151c
merge
svchb Dec 4, 2024
9f758be
typo
svchb Dec 4, 2024
f74ac4e
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 4, 2024
170e314
merge error
svchb Dec 4, 2024
3618010
typo
svchb Dec 4, 2024
ec75fab
update
svchb Dec 5, 2024
d9325ad
update
svchb Dec 12, 2024
1dfd1fe
Merge branch 'main' into morris_surface_tension
svchb Dec 12, 2024
cd26885
Merge branch 'main' into generalize_surface_normal_calc
svchb Dec 12, 2024
80e51ba
review updates
svchb Dec 12, 2024
1141a12
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 12, 2024
4721aec
review update
svchb Dec 12, 2024
3a0413e
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 12, 2024
98a5f6c
add boundary system
svchb Dec 13, 2024
e05edea
update
svchb Dec 13, 2024
36741d7
update
svchb Dec 13, 2024
ba8765f
format
svchb Dec 13, 2024
c83c95e
Merge branch 'generalize_surface_normal_calc' into morris_surface_ten…
svchb Dec 13, 2024
9936e5d
format
svchb Dec 13, 2024
4dc0cf8
fix merge
svchb Dec 13, 2024
5e83f0c
format
svchb Dec 13, 2024
55e6557
another merge error
svchb Dec 13, 2024
ee5c2da
format
svchb Dec 13, 2024
cfe7626
reset to original version
svchb Dec 13, 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
33 changes: 33 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,83 @@
TrixiParticles.jl follows the interpretation of [semantic versioning (semver)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

## Version 0.2.4

### Features

- Support for surface tension was added to EDAC (#539)
- A method to prevent penetration of fast moving particles with solids was added (#498)

### Documentation

- GPU Support Documentation was added (#660)

### Fixes

- JuliaFormatter was updated from 1.0.42 to 1.0.62 (#661)
- Diverse Doc fixes (#663, #659, #637, #658, #664)
- Simulations can be run with `Float32` (#662)

### Refactored

- Surface normal calculation was moved from surface_tension.jl to surface_normal_sph.jl (#539)

## Version 0.2.3

### Highlights

Transport Velocity Formulation (TVF) based on the work of Ramachandran et al. "Entropically damped artificial compressibility for SPH" (2019) was added.

## Version 0.2.2

### Highlights

Hotfix for threaded sampling of complex geometries.

## Version 0.2.1

### Highlights

Particle sampling of complex geometries from `.stl` and `.asc` files.

## Version 0.2.0

### Removed

Use of the internal neighborhood search has been removed and replaced with PointNeighbors.jl.

## Development Cycle 0.1

### Highlights

#### Discrete Element Method

A basic implementation of the discrete element method was added.

#### Surface Tension and Adhesion Model

A surface tension and adhesion model based on the work by Akinci et al., "Versatile Surface Tension and Adhesion for SPH Fluids" (2013) was added to WCSPH.

#### Support for Open Boundaries

Open boundaries using the method of characteristics based on the work of Lastiwka et al., "Permeable and non-reflecting boundary conditions in SPH" (2009) were added for WCSPH and EDAC.

## Pre Initial Release (v0.1.0)

This section summarizes the initial features that TrixiParticles.jl was released with.

### Highlights
#### EDAC

An implementation of EDAC (Entropically Damped Artificial Compressibility) was added,
which allows for more stable simulations compared to basic WCSPH and reduces spurious pressure oscillations.

#### WCSPH

An implementation of WCSPH (Weakly Compressible Smoothed Particle Hydrodynamics), which is the classical SPH approach.

Features:

- Correction schemes (Shepard (0. Order) ... MixedKernelGradient (1. Order))
- Density reinitialization
- Kernel summation and Continuity equation density formulations
Expand All @@ -57,4 +89,5 @@ Features:


#### TLSPH

An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions).
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TrixiParticles"
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a"
authors = ["erik.faulhaber <[email protected]>"]
version = "0.2.4-dev"
version = "0.2.4"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
3 changes: 2 additions & 1 deletion examples/fluid/dam_break_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ fluid_system = WeaklyCompressibleSPHSystem(tank.fluid, fluid_density_calculator,
smoothing_length, viscosity=viscosity,
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
96 changes: 96 additions & 0 deletions examples/fluid/dam_break_2phase_2d.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 2D dam break simulation with an air layer on top

using TrixiParticles
using OrdinaryDiffEq

# Size parameters
H = 0.6
W = 2 * H

# ==========================================================================================
# ==== Resolution

# Note: The resolution is very coarse. A better result is obtained with H/60 or higher (which takes over 1 hour+)
fluid_particle_spacing = H / 20

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

# Numerical settings
smoothing_length = 3.5 * fluid_particle_spacing
sound_speed = 100.0
# when using the Ideal gas equation
# sound_speed = 343.0

# 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, exponent=7,
tank_size=(floor(5.366 * H / fluid_particle_spacing) * fluid_particle_spacing,
2.6 * H))

# ==========================================================================================
# ==== Setup air_system layer

air_size = (tank_size[1], 1.5 * H)
air_size2 = (tank_size[1] - W, H)
air_density = 1.0

# Air above the initial water
air_system = RectangularShape(fluid_particle_spacing,
round.(Int, air_size ./ fluid_particle_spacing),
zeros(length(air_size)), density=air_density)

# Air for the rest of the empty volume
air_system2 = RectangularShape(fluid_particle_spacing,
round.(Int, air_size2 ./ fluid_particle_spacing),
(W, 0.0), density=air_density)

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

air_system = union(air_system, air_system2)

air_system_system = WeaklyCompressibleSPHSystem(air_system, fluid_density_calculator,
StateEquationCole(; sound_speed,
reference_density=air_density,
exponent=1,
clip_negative_pressure=false,
background_pressure=0),
smoothing_kernel, smoothing_length,
viscosity=air_viscosity,
acceleration=(0.0, -gravity))

# air_system_system = WeaklyCompressibleSPHSystem(air_system, fluid_density_calculator,
# StateEquationIdealGas(; sound_speed, reference_density=air_density, gamma=1.4, background_pressure=0),
# smoothing_kernel, smoothing_length,
# viscosity=air_viscosity,
# acceleration=(0.0, -gravity))

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

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);
45 changes: 35 additions & 10 deletions examples/fluid/dam_break_oil_film_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,39 @@ fluid_particle_spacing = H / 60
smoothing_length = 3.5 * fluid_particle_spacing
sound_speed = 20 * sqrt(gravity * H)

nu = 0.02 * smoothing_length * sound_speed / 8
oil_viscosity = ViscosityMorris(nu=10 * nu)
# Physical values
nu_water = 8.9E-7
nu_oil = 6E-5
nu_ratio = nu_water / nu_oil

nu_sim_oil = max(0.01 * smoothing_length * sound_speed, nu_oil)
nu_sim_water = nu_ratio * nu_sim_oil

oil_viscosity = ViscosityMorris(nu=nu_sim_oil)
# Physical values
nu_water = 8.9E-7
nu_oil = 6E-5
nu_ratio = nu_water / nu_oil

nu_sim_oil = max(0.01 * smoothing_length * sound_speed, nu_oil)
nu_sim_water = nu_ratio * nu_sim_oil

oil_viscosity = ViscosityMorris(nu=nu_sim_oil)

# TODO: broken if both are set to surface tension
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,
density_diffusion=DensityDiffusionMolteniColagrossi(delta=0.1),
sound_speed=sound_speed)
viscosity=ViscosityMorris(nu=nu_sim_water), smoothing_length=smoothing_length,
gravity=gravity, tspan=tspan, density_diffusion=nothing,
sound_speed=sound_speed, prefix="")

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

oil_size = (W, 0.1 * H)
oil_density = 700.0
oil_eos = StateEquationCole(; sound_speed, reference_density=oil_density, exponent=1,
clip_negative_pressure=false)

oil = RectangularShape(fluid_particle_spacing,
round.(Int, oil_size ./ fluid_particle_spacing),
Expand All @@ -43,12 +61,19 @@ for i in axes(oil.coordinates, 2)
end

oil_system = WeaklyCompressibleSPHSystem(oil, fluid_density_calculator,
state_equation, smoothing_kernel,
oil_eos, smoothing_kernel,
smoothing_length, viscosity=oil_viscosity,
density_diffusion=density_diffusion,
acceleration=(0.0, -gravity),
surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.02),
correction=AkinciFreeSurfaceCorrection(oil_density))
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,
# acceleration=(0.0, -gravity),
# surface_tension=SurfaceTensionMorris(surface_tension_coefficient=0.03),
# reference_particle_spacing=fluid_particle_spacing)

# ==========================================================================================
# ==== Simulation
Expand Down
18 changes: 9 additions & 9 deletions examples/fluid/falling_water_spheres_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sphere2 = SphereShape(fluid_particle_spacing, sphere_radius, sphere2_center,

# ==========================================================================================
# ==== Fluid
fluid_smoothing_length = 1.0 * fluid_particle_spacing
fluid_smoothing_length = 1.0 * fluid_particle_spacing - eps()
fluid_smoothing_kernel = SchoenbergCubicSplineKernel{2}()

fluid_density_calculator = ContinuityDensity()
Expand All @@ -50,13 +50,13 @@ alpha = 8 * nu / (fluid_smoothing_length * sound_speed)
viscosity = ArtificialViscosityMonaghan(alpha=alpha, beta=0.0)
density_diffusion = DensityDiffusionAntuono(sphere2, delta=0.1)

sphere_surface_tension = WeaklyCompressibleSPHSystem(sphere1, fluid_density_calculator,
state_equation, fluid_smoothing_kernel,
sphere_surface_tension = EntropicallyDampedSPHSystem(sphere1, fluid_smoothing_kernel,
fluid_smoothing_length,
viscosity=viscosity,
sound_speed, viscosity=viscosity,
density_calculator=ContinuityDensity(),
acceleration=(0.0, -gravity),
surface_tension=SurfaceTensionAkinci(surface_tension_coefficient=0.05),
correction=AkinciFreeSurfaceCorrection(fluid_density))
reference_particle_spacing=fluid_particle_spacing)

sphere = WeaklyCompressibleSPHSystem(sphere2, fluid_density_calculator,
state_equation, fluid_smoothing_kernel,
Expand All @@ -75,16 +75,16 @@ boundary_model = BoundaryModelDummyParticles(tank.boundary.density, tank.boundar
viscosity=ViscosityAdami(nu=wall_viscosity))

boundary_system = BoundarySPHSystem(tank.boundary, boundary_model,
adhesion_coefficient=0.001)
adhesion_coefficient=1.0)

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

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

callbacks = CallbackSet(info_callback, saving_callback)

Expand Down
16 changes: 8 additions & 8 deletions examples/fluid/falling_water_spheres_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ using OrdinaryDiffEq

# ==========================================================================================
# ==== Resolution
fluid_particle_spacing = 0.008
fluid_particle_spacing = 0.005

# ==========================================================================================
# ==== Experiment Setup
gravity = 9.81
nu = 0.01
nu = 0.001
fluid_density = 1000.0
sound_speed = 50

sphere1_radius = 0.05

sphere1_center = (0.5, 0.5, 0.2)
sphere2_center = (1.5, 0.5, 0.2)
sphere1_center = (0.5, 0.5, 0.075)
sphere2_center = (1.5, 0.5, 0.075)
sphere1 = SphereShape(fluid_particle_spacing, sphere1_radius, sphere1_center,
fluid_density, sphere_type=VoxelSphere(), velocity=(0.0, 0.0, -2.0))
fluid_density, sphere_type=VoxelSphere(), velocity=(0.0, 0.0, -1.0))
sphere2 = SphereShape(fluid_particle_spacing, sphere1_radius, sphere2_center,
fluid_density, sphere_type=VoxelSphere(), velocity=(0.0, 0.0, -2.0))
fluid_density, sphere_type=VoxelSphere(), velocity=(0.0, 0.0, -1.0))

# `compact_support` needs to be `2.0 * particle_spacing` to be correct
fluid_smoothing_length = 1.0 * fluid_particle_spacing

trixi_include(@__MODULE__,
joinpath(examples_dir(), "fluid", "falling_water_spheres_2d.jl"),
fluid_particle_spacing=fluid_particle_spacing, tspan=(0.0, 0.2),
fluid_particle_spacing=fluid_particle_spacing, tspan=(0.0, 0.1),
initial_fluid_size=(0.0, 0.0, 0.0),
tank_size=(2.0, 1.0, 0.1), sound_speed=sound_speed,
faces=(true, true, true, true, true, false),
acceleration=(0.0, 0.0, -gravity), sphere1=sphere1, sphere2=sphere2,
fluid_smoothing_length=fluid_smoothing_length,
fluid_smoothing_kernel=SchoenbergCubicSplineKernel{3}(),
nu=nu, alpha=10 * nu / (fluid_smoothing_length * sound_speed),
surface_tension_coefficient=1.5, adhesion_coefficient=0.5)
surface_tension_coefficient=10, adhesion_coefficient=0.1)
Loading
Loading