-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The grand reopening Part 3: Add basic DEM (#433)
* implement basic dem * fix * fix bnd * get basic simulation working * fix * format * fix spellcheck * add docs * update readme and news * format * add to examples run list * add basic test * ignore author name * remove * most of the review stuff * format * forgot to remove one thing * one more * rework interaction * format * update * typo * fix doctest * fix test * fix doc * fix tests again * fix doc and test * fix test * fix incorrect test * review * format * typo * review * review * format * realign line * fix test * update
- Loading branch information
Showing
21 changed files
with
482 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
ba = "ba" | ||
Shepard = "Shepard" | ||
shepard = "shepard" | ||
Strack = "Strack" | ||
Lok = "Lok" |
This file contains 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 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 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 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 |
---|---|---|
|
@@ -4,6 +4,10 @@ | |
BoundarySPHSystem | ||
``` | ||
|
||
```@docs | ||
BoundaryDEMSystem | ||
``` | ||
|
||
```@docs | ||
BoundaryMovement | ||
``` | ||
|
This file contains 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,33 @@ | ||
# [Discrete Element Method](@id dem) | ||
The Discrete Element Method (DEM) is a computational technique widely used in physics, engineering, | ||
and applied mathematics for simulating the mechanical behavior of granular materials, such as powders, | ||
sand, soil, or rock, as well as other discontinua. Unlike continuum mechanics that treats materials as | ||
continuous, DEM considers individual particles or elements and their interactions. This approach provides | ||
detailed insights into the micro-mechanical behavior of materials, making it particularly valuable | ||
in fields such as geomechanics, material science, and mechanical engineering. | ||
|
||
## Fundamental Principles | ||
The core idea behind DEM is the discretization of a material system into a finite set of distinct, | ||
interacting mass elements (particles). These elements (particles) can vary in shape, size, and properties, and | ||
they interact with each other and possibly with their boundaries through contact forces and potential fields. | ||
The motion and behavior of each mass element are governed by Newton's laws of motion, accounting for the forces | ||
and moments acting upon them. | ||
|
||
```@autodocs | ||
Modules = [TrixiParticles] | ||
Pages = [joinpath("schemes", "solid", "discrete_element_method", "system.jl")] | ||
``` | ||
|
||
## References | ||
- N. Bićanić. "Discrete element methods". | ||
In: Encyclopedia of Computational Mechanics (2007). | ||
[doi: 10.1002/0470091355.ecm006.pub2](https://doi.org/10.1002/0470091355.ecm006.pub2) | ||
|
||
- P. Cundall and O. Strack. "A discrete numerical model for granular assemblies". | ||
In: Géotechnique 29.1 (1979), pages 47--65. | ||
[doi: 10.1680/geot.1979.29.1.47](https://doi.org/10.1680/geot.1979.29.1.47) | ||
|
||
- A. Renzo and F. Maio. "Comparison of contact-force models for the simulation of collisions in DEM-based granular flow codes" | ||
In: Chemical Engineering Science 59.3 (2004), pages 525--541. | ||
[doi: 10.1016/j.ces.2003.09.037](https://doi.org/10.1016/j.ces.2003.09.037) | ||
|
This file contains 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,50 @@ | ||
using TrixiParticles | ||
using OrdinaryDiffEq | ||
|
||
gravity = -9.81 | ||
|
||
# ========================================================================================== | ||
# ==== Falling rocks | ||
|
||
particle_spacing = 0.1 | ||
|
||
rock_width = 2.0 | ||
rock_height = 2.0 | ||
rock_density = 3000.0 | ||
|
||
tank_width = 2.0 | ||
tank_height = 4.0 | ||
|
||
tank = RectangularTank(particle_spacing, (rock_width, rock_height), | ||
(tank_width, tank_height), rock_density, | ||
n_layers=2) | ||
|
||
# ========================================================================================== | ||
# ==== Systems | ||
|
||
# Move the rocks up to let them fall | ||
tank.fluid.coordinates[2, :] .+= 0.5 | ||
rock_system = DEMSystem(tank.fluid, 2 * 10e5, 10e9, 0.3, acceleration=(0.0, gravity)) | ||
boundary_system = BoundaryDEMSystem(tank.boundary, 10e7) | ||
|
||
# ========================================================================================== | ||
# ==== Simulation | ||
|
||
semi = Semidiscretization(rock_system, boundary_system, | ||
neighborhood_search=GridNeighborhoodSearch) | ||
|
||
tspan = (0.0, 5.0) | ||
ode = semidiscretize(semi, tspan) | ||
|
||
info_callback = InfoCallback(interval=5000) | ||
saving_callback = SolutionSavingCallback(dt=0.02) | ||
|
||
callbacks = CallbackSet(info_callback, saving_callback) | ||
|
||
# Use a Runge-Kutta method with automatic (error based) time step size control | ||
sol = solve(ode, RDPK3SpFSAL49(), | ||
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-3, # Limit stepsize to prevent crashing | ||
dt=1e-7, # Initial step size | ||
save_everystep=false, callback=callbacks); |
This file contains 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 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 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 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 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 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
1 change: 1 addition & 0 deletions
1
src/schemes/solid/discrete_element_method/discrete_element_method.jl
This file contains 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 @@ | ||
include("system.jl") |
Oops, something went wrong.