From c66114577f45b451759f72b2b05ccbf92d11f90a Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 6 Aug 2024 11:04:38 +0000 Subject: [PATCH] build based on 0afec5c --- dev/.documenter-siteinfo.json | 2 +- dev/authors/index.html | 2 +- dev/callbacks/index.html | 8 ++++---- dev/code_of_conduct/index.html | 2 +- dev/contributing/index.html | 2 +- dev/development/index.html | 2 +- dev/examples/index.html | 2 +- dev/general/density_calculators/index.html | 2 +- dev/general/initial_condition/index.html | 12 ++++++------ dev/general/interpolation/index.html | 10 +++++----- dev/general/neighborhood_search/index.html | 2 +- dev/general/semidiscretization/index.html | 4 ++-- dev/general/smoothing_kernels/index.html | 18 +++++++++--------- dev/general/util/index.html | 4 ++-- dev/getting_started/index.html | 2 +- dev/index.html | 2 +- dev/install/index.html | 2 +- dev/license/index.html | 2 +- dev/news/index.html | 2 +- dev/objects.inv | Bin 4335 -> 4331 bytes dev/overview/index.html | 2 +- dev/preprocessing/preprocessing/index.html | 4 ++-- dev/reference-pointneighbors/index.html | 2 +- dev/reference-trixibase/index.html | 2 +- dev/systems/boundary/index.html | 16 ++++++++-------- dev/systems/dem/index.html | 2 +- .../entropically_damped_sph/index.html | 2 +- dev/systems/total_lagrangian_sph/index.html | 4 ++-- .../weakly_compressible_sph/index.html | 14 +++++++------- dev/time_integration/index.html | 2 +- dev/tutorial/index.html | 2 +- dev/tutorials/tut_beam/index.html | 2 +- dev/tutorials/tut_beam_replaced/index.html | 2 +- dev/tutorials/tut_dam_break/index.html | 2 +- .../tut_dam_break_replaced/index.html | 2 +- dev/tutorials/tut_falling/index.html | 2 +- dev/tutorials/tut_falling_replaced/index.html | 2 +- dev/tutorials/tut_setup/index.html | 2 +- dev/tutorials/tut_setup_replaced/index.html | 2 +- dev/visualization/index.html | 6 +++--- 40 files changed, 78 insertions(+), 78 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 30ced44c7..7772915e9 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-06T10:07:47","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-06T11:04:34","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/authors/index.html b/dev/authors/index.html index 19e687a32..dd0cab1b2 100644 --- a/dev/authors/index.html +++ b/dev/authors/index.html @@ -1,2 +1,2 @@ -Authors · TrixiParticles.jl

Authors

TrixiParticles.jl's development is coordinated by a group of principal developers, who are also its main contributors and who can be contacted in case of questions about TrixiParticles.jl. In addition, there are contributors who have provided substantial additions or modifications. Together, these two groups form "The TrixiParticles.jl Authors" as mentioned under License.

Principal Developers

Contributors

The following people contributed major additions or modifications to TrixiParticles.jl and are listed in alphabetical order:

  • Sven Berger
  • Erik Faulhaber
  • Gregor Gassner
  • Niklas Neher
  • Hendrik Ranocha
  • Michael Schlottke-Lakemper
+Authors · TrixiParticles.jl

Authors

TrixiParticles.jl's development is coordinated by a group of principal developers, who are also its main contributors and who can be contacted in case of questions about TrixiParticles.jl. In addition, there are contributors who have provided substantial additions or modifications. Together, these two groups form "The TrixiParticles.jl Authors" as mentioned under License.

Principal Developers

Contributors

The following people contributed major additions or modifications to TrixiParticles.jl and are listed in alphabetical order:

  • Sven Berger
  • Erik Faulhaber
  • Gregor Gassner
  • Niklas Neher
  • Hendrik Ranocha
  • Michael Schlottke-Lakemper
diff --git a/dev/callbacks/index.html b/dev/callbacks/index.html index 0124e45e1..6c6677a93 100644 --- a/dev/callbacks/index.html +++ b/dev/callbacks/index.html @@ -1,11 +1,11 @@ -Callbacks · TrixiParticles.jl

Callbacks

TrixiParticles.DensityReinitializationCallbackType
DensityReinitializationCallback(; interval::Integer=0, dt=0.0)

Callback to reinitialize the density field when using ContinuityDensity.

Keywords

  • interval=0: Reinitialize the density every interval time steps.
  • dt: Reinitialize the density in regular intervals of dt in terms of integration time.
  • reinit_initial_solution: Reinitialize the initial solution (default=false)

References

  • Panizzo, Andrea, Giovanni Cuomo, and Robert A. Dalrymple. "3D-SPH simulation of landslide generated waves." In: Coastal Engineering 2006 (2007), pages 1503-1515. doi: 10.1142/9789812709554_0128
source
TrixiParticles.InfoCallbackMethod
InfoCallback()

Create and return a callback that prints a human-readable summary of the simulation setup at the beginning of a simulation and then resets the timer. When the returned callback is executed directly, the current timer values are shown.

source
TrixiParticles.PostprocessCallbackType
PostprocessCallback(; interval::Integer=0, dt=0.0, exclude_boundary=true, filename="values",
+Callbacks · TrixiParticles.jl

Callbacks

TrixiParticles.DensityReinitializationCallbackType
DensityReinitializationCallback(; interval::Integer=0, dt=0.0)

Callback to reinitialize the density field when using ContinuityDensity.

Keywords

  • interval=0: Reinitialize the density every interval time steps.
  • dt: Reinitialize the density in regular intervals of dt in terms of integration time.
  • reinit_initial_solution: Reinitialize the initial solution (default=false)

References

  • Panizzo, Andrea, Giovanni Cuomo, and Robert A. Dalrymple. "3D-SPH simulation of landslide generated waves." In: Coastal Engineering 2006 (2007), pages 1503-1515. doi: 10.1142/9789812709554_0128
source
TrixiParticles.InfoCallbackMethod
InfoCallback()

Create and return a callback that prints a human-readable summary of the simulation setup at the beginning of a simulation and then resets the timer. When the returned callback is executed directly, the current timer values are shown.

source
TrixiParticles.PostprocessCallbackType
PostprocessCallback(; interval::Integer=0, dt=0.0, exclude_boundary=true, filename="values",
                     output_directory="out", append_timestamp=false, write_csv=true,
                     write_json=true, write_file_interval=1, funcs...)

Create a callback to post-process simulation data at regular intervals. This callback allows for the execution of a user-defined function func at specified intervals during the simulation. The function is applied to the current state of the simulation, and its results can be saved or used for further analysis. The provided function cannot be anonymous as the function name will be used as part of the name of the value.

The callback can be triggered either by a fixed number of time steps (interval) or by a fixed interval of simulation time (dt).

Keywords

  • funcs...: Functions to be executed at specified intervals during the simulation. Each function must have the arguments (v, u, t, system), and will be called for every system, where v and u are the wrapped solution arrays for the corresponding system and t is the current simulation time. Note that working with these v and u arrays requires undocumented internal functions of TrixiParticles. See Custom Quantities for a list of pre-defined functions that can be used here.
  • interval=0: Specifies the number of time steps between each invocation of the callback. If set to 0, the callback will not be triggered based on time steps. Either interval or dt must be set to something larger than 0.
  • dt=0.0: Specifies the simulation time interval between each invocation of the callback. If set to 0.0, the callback will not be triggered based on simulation time. Either interval or dt must be set to something larger than 0.
  • exclude_boundary=true: If set to true, boundary particles will be excluded from the post-processing.
  • filename="values": The filename of the postprocessing files to be saved.
  • output_directory="out": The path where the results of the post-processing will be saved.
  • write_csv=true: If set to true, write a csv file.
  • write_json=true: If set to true, write a json file.
  • append_timestep=false: If set to true, the current timestamp will be added to the filename.
  • write_file_interval=1: Files will be written after every write_file_interval number of postprocessing execution steps. A value of 0 indicates that files are only written at the end of the simulation, eliminating I/O overhead.

Examples

# Create a callback that is triggered every 100 time steps
 postprocess_callback = PostprocessCallback(interval=100, example_quantity=kinetic_energy)
 
 # Create a callback that is triggered every 0.1 simulation time units
-postprocess_callback = PostprocessCallback(dt=0.1, example_quantity=kinetic_energy)
source
TrixiParticles.SolutionSavingCallbackType
SolutionSavingCallback(; interval::Integer=0, dt=0.0, save_times=Array{Float64, 1}([]),
+postprocess_callback = PostprocessCallback(dt=0.1, example_quantity=kinetic_energy)
source
TrixiParticles.SolutionSavingCallbackType
SolutionSavingCallback(; interval::Integer=0, dt=0.0, save_times=Array{Float64, 1}([]),
                        save_initial_solution=true, save_final_solution=true,
                        output_directory="out", append_timestamp=false, prefix="",
                        verbose=false, write_meta_data=true, max_coordinates=2^15,
@@ -16,5 +16,5 @@
 saving_callback = SolutionSavingCallback(dt=0.1)
 
 # Additionally store the kinetic energy of each system as "my_custom_quantity"
-saving_callback = SolutionSavingCallback(dt=0.1, my_custom_quantity=kinetic_energy)
source
TrixiParticles.StepsizeCallbackMethod
StepsizeCallback(; cfl::Real)

Set the time step size according to a CFL condition if the time integration method isn't adaptive itself.

The current implementation is using the simplest form of CFL condition, which chooses a time step size that is constant during the simulation. The step size is therefore only applied once at the beginning of the simulation.

The step size $\Delta t$ is chosen as the minimum

\[ \Delta t = \min(\Delta t_\eta, \Delta t_a, \Delta t_c),\]

where

\[ \Delta t_\eta = 0.125 \, h^2 / \eta, \quad \Delta t_a = 0.25 \sqrt{h / \lVert g \rVert}, - \quad \Delta t_c = \text{CFL} \, h / c,\]

with $\nu = \alpha h c / (2n + 4)$, where $\alpha$ is the parameter of the viscosity and $n$ is the number of dimensions.

Experimental implementation

This is an experimental feature and may change in future releases.

References

  • M. Antuono, A. Colagrossi, S. Marrone. "Numerical Diffusive Terms in Weakly-Compressible SPH Schemes." In: Computer Physics Communications 183, no. 12 (2012), pages 2570–80. doi: 10.1016/j.cpc.2012.07.006
  • S. Adami, X. Y. Hu, N. A. Adams. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231, 21 (2012), pages 7057–7075. doi: 10.1016/J.JCP.2012.05.005
  • P. N. Sun, A. Colagrossi, S. Marrone, A. M. Zhang. "The δplus-SPH Model: Simple Procedures for a Further Improvement of the SPH Scheme." In: Computer Methods in Applied Mechanics and Engineering 315 (2017), pages 25–49. doi: 10.1016/j.cma.2016.10.028
  • M. Antuono, S. Marrone, A. Colagrossi, B. Bouscasse. "Energy Balance in the δ-SPH Scheme." In: Computer Methods in Applied Mechanics and Engineering 289 (2015), pages 209–26. doi: 10.1016/j.cma.2015.02.004
source
TrixiParticles.UpdateCallbackMethod
UpdateCallback(; interval::Integer, dt=0.0)

Callback to update quantities either at the end of every interval time steps or in intervals of dt in terms of integration time by adding additional tstops (note that this may change the solution).

Keywords

  • interval=1: Update quantities at the end of every interval time steps.
  • dt: Update quantities in regular intervals of dt in terms of integration time by adding additional tstops (note that this may change the solution).
source

Custom Quantities

The following pre-defined custom quantities can be used with the SolutionSavingCallback and PostprocessCallback.

+saving_callback = SolutionSavingCallback(dt=0.1, my_custom_quantity=kinetic_energy)
source
TrixiParticles.StepsizeCallbackMethod
StepsizeCallback(; cfl::Real)

Set the time step size according to a CFL condition if the time integration method isn't adaptive itself.

The current implementation is using the simplest form of CFL condition, which chooses a time step size that is constant during the simulation. The step size is therefore only applied once at the beginning of the simulation.

The step size $\Delta t$ is chosen as the minimum

\[ \Delta t = \min(\Delta t_\eta, \Delta t_a, \Delta t_c),\]

where

\[ \Delta t_\eta = 0.125 \, h^2 / \eta, \quad \Delta t_a = 0.25 \sqrt{h / \lVert g \rVert}, + \quad \Delta t_c = \text{CFL} \, h / c,\]

with $\nu = \alpha h c / (2n + 4)$, where $\alpha$ is the parameter of the viscosity and $n$ is the number of dimensions.

Experimental implementation

This is an experimental feature and may change in future releases.

References

  • M. Antuono, A. Colagrossi, S. Marrone. "Numerical Diffusive Terms in Weakly-Compressible SPH Schemes." In: Computer Physics Communications 183, no. 12 (2012), pages 2570–80. doi: 10.1016/j.cpc.2012.07.006
  • S. Adami, X. Y. Hu, N. A. Adams. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231, 21 (2012), pages 7057–7075. doi: 10.1016/J.JCP.2012.05.005
  • P. N. Sun, A. Colagrossi, S. Marrone, A. M. Zhang. "The δplus-SPH Model: Simple Procedures for a Further Improvement of the SPH Scheme." In: Computer Methods in Applied Mechanics and Engineering 315 (2017), pages 25–49. doi: 10.1016/j.cma.2016.10.028
  • M. Antuono, S. Marrone, A. Colagrossi, B. Bouscasse. "Energy Balance in the δ-SPH Scheme." In: Computer Methods in Applied Mechanics and Engineering 289 (2015), pages 209–26. doi: 10.1016/j.cma.2015.02.004
source
TrixiParticles.UpdateCallbackMethod
UpdateCallback(; interval::Integer, dt=0.0)

Callback to update quantities either at the end of every interval time steps or in intervals of dt in terms of integration time by adding additional tstops (note that this may change the solution).

Keywords

  • interval=1: Update quantities at the end of every interval time steps.
  • dt: Update quantities in regular intervals of dt in terms of integration time by adding additional tstops (note that this may change the solution).
source

Custom Quantities

The following pre-defined custom quantities can be used with the SolutionSavingCallback and PostprocessCallback.

diff --git a/dev/code_of_conduct/index.html b/dev/code_of_conduct/index.html index 5af59acae..37ab4c426 100644 --- a/dev/code_of_conduct/index.html +++ b/dev/code_of_conduct/index.html @@ -1,2 +1,2 @@ -Code of Conduct · TrixiParticles.jl

Code of Conduct

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to Michael Schlottke-Lakemper, Sven Berger, or any other of the principal developers responsible for enforcement listed in Authors. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/codeofconduct.html.

Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

+Code of Conduct · TrixiParticles.jl

Code of Conduct

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to Michael Schlottke-Lakemper, Sven Berger, or any other of the principal developers responsible for enforcement listed in Authors. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/codeofconduct.html.

Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

diff --git a/dev/contributing/index.html b/dev/contributing/index.html index 9d1d8a16a..fd15178bd 100644 --- a/dev/contributing/index.html +++ b/dev/contributing/index.html @@ -35,4 +35,4 @@ are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. + this project or the open source license(s) involved. diff --git a/dev/development/index.html b/dev/development/index.html index c6772dffb..75cf8c65b 100644 --- a/dev/development/index.html +++ b/dev/development/index.html @@ -1,2 +1,2 @@ -Development · TrixiParticles.jl

Development

Preview of the documentation

To generate the Documentation, first instantiate the docs environment by executing the following command from the TrixiParticles.jl root directory:

julia --project=docs -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"

This command only has to be run once. After that, maintain the docs environment as described under Installation.

With an instantiated docs environment, generate the docs with the following command (again from the TrixiParticles.jl root directory):

julia --project=docs --color=yes docs/make.jl

You can then open the generated files in docs/build with your webbrowser. Alternatively, run

python3 -m http.server -d docs/build

and open localhost:8000 in your webbrowser.

Release management

To create a new release for TrixiParticles.jl, perform the following steps:

  1. Make sure that all PRs and changes that you want to go into the release are merged to main and that the latest commit on main has passed all CI tests.
  2. Determine the currently released version of TrixiParticles.jl, e.g., on the release page. For this manual, we will assume that the latest release was v0.2.3.
  3. Decide on the next version number. We follow semantic versioning, thus each version is of the form vX.Y.Z where X is the major version, Y the minor version, and Z the patch version. In this manual, we assume that the major version is always 0, thus the decision process on the new version is as follows:
    • If the new release contains breaking changes (i.e., user code might not work as before without modifications), increase the minor version by one and set the patch version to zero. In our example, the new version should thus be v0.3.0.
    • If the new release only contains minor modifications and/or bug fixes, the minor version is kept as-is and the patch version is increased by one. In our example, the new version should thus be v0.2.4.
  4. Edit the version string in the Project.toml and set it to the new version. Push/merge this change to main.
  5. Go to GitHub and add a comment to the commit that you would like to become the new release (typically this will be the commit where you just updated the version). You can comment on a commit by going to the commit overview and clicking on the title of the commit. The comment should contain the following text:
    @JuliaRegistrator register
  6. Wait for the magic to happen! Specifically, JuliaRegistrator will create a new PR to the Julia registry with the new release information. After a grace period of ~15 minutes, this PR will be merged automatically. A short while after, TagBot will create a new release of TrixiParticles.jl in our GitHub repository.
  7. Once the new release has been created, the new version can be obtained through the Julia package manager as usual.
  8. To make sure people do not mistake the latest state of main as the latest release, we set the version in the Project.toml to a development version. The development version should be the latest released version, with the patch version incremented by one, and the -dev suffix added. For example, if you just released v0.3.0, the new development version should be v0.3.1-dev. If you just released v0.2.4, the new development version should be v0.2.5-dev.
+Development · TrixiParticles.jl

Development

Preview of the documentation

To generate the Documentation, first instantiate the docs environment by executing the following command from the TrixiParticles.jl root directory:

julia --project=docs -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"

This command only has to be run once. After that, maintain the docs environment as described under Installation.

With an instantiated docs environment, generate the docs with the following command (again from the TrixiParticles.jl root directory):

julia --project=docs --color=yes docs/make.jl

You can then open the generated files in docs/build with your webbrowser. Alternatively, run

python3 -m http.server -d docs/build

and open localhost:8000 in your webbrowser.

Release management

To create a new release for TrixiParticles.jl, perform the following steps:

  1. Make sure that all PRs and changes that you want to go into the release are merged to main and that the latest commit on main has passed all CI tests.
  2. Determine the currently released version of TrixiParticles.jl, e.g., on the release page. For this manual, we will assume that the latest release was v0.2.3.
  3. Decide on the next version number. We follow semantic versioning, thus each version is of the form vX.Y.Z where X is the major version, Y the minor version, and Z the patch version. In this manual, we assume that the major version is always 0, thus the decision process on the new version is as follows:
    • If the new release contains breaking changes (i.e., user code might not work as before without modifications), increase the minor version by one and set the patch version to zero. In our example, the new version should thus be v0.3.0.
    • If the new release only contains minor modifications and/or bug fixes, the minor version is kept as-is and the patch version is increased by one. In our example, the new version should thus be v0.2.4.
  4. Edit the version string in the Project.toml and set it to the new version. Push/merge this change to main.
  5. Go to GitHub and add a comment to the commit that you would like to become the new release (typically this will be the commit where you just updated the version). You can comment on a commit by going to the commit overview and clicking on the title of the commit. The comment should contain the following text:
    @JuliaRegistrator register
  6. Wait for the magic to happen! Specifically, JuliaRegistrator will create a new PR to the Julia registry with the new release information. After a grace period of ~15 minutes, this PR will be merged automatically. A short while after, TagBot will create a new release of TrixiParticles.jl in our GitHub repository.
  7. Once the new release has been created, the new version can be obtained through the Julia package manager as usual.
  8. To make sure people do not mistake the latest state of main as the latest release, we set the version in the Project.toml to a development version. The development version should be the latest released version, with the patch version incremented by one, and the -dev suffix added. For example, if you just released v0.3.0, the new development version should be v0.3.1-dev. If you just released v0.2.4, the new development version should be v0.2.5-dev.
diff --git a/dev/examples/index.html b/dev/examples/index.html index 0a1d435b7..50375c70d 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -1,2 +1,2 @@ -Examples · TrixiParticles.jl
+Examples · TrixiParticles.jl
diff --git a/dev/general/density_calculators/index.html b/dev/general/density_calculators/index.html index 3f859d44f..43f82784c 100644 --- a/dev/general/density_calculators/index.html +++ b/dev/general/density_calculators/index.html @@ -1,2 +1,2 @@ -Density Calculators · TrixiParticles.jl

Density Calculators

TrixiParticles.ContinuityDensityType
ContinuityDensity()

Density calculator to integrate the density from the continuity equation

\[\frac{\mathrm{d}\rho_a}{\mathrm{d}t} = \sum_{b} m_b v_{ab} \cdot \nabla_{r_a} W(\Vert r_a - r_b \Vert, h),\]

where $\rho_a$ denotes the density of particle $a$ and $r_{ab} = r_a - r_b$ is the difference of the coordinates, $v_{ab} = v_a - v_b$ of the velocities of particles $a$ and $b$.

source
TrixiParticles.SummationDensityType
SummationDensity()

Density calculator to use the summation formula

\[\rho(r) = \sum_{b} m_b W(\Vert r - r_b \Vert, h),\]

for the density estimation, where $r_b$ denotes the coordinates and $m_b$ the mass of particle $b$.

source
+Density Calculators · TrixiParticles.jl

Density Calculators

TrixiParticles.ContinuityDensityType
ContinuityDensity()

Density calculator to integrate the density from the continuity equation

\[\frac{\mathrm{d}\rho_a}{\mathrm{d}t} = \sum_{b} m_b v_{ab} \cdot \nabla_{r_a} W(\Vert r_a - r_b \Vert, h),\]

where $\rho_a$ denotes the density of particle $a$ and $r_{ab} = r_a - r_b$ is the difference of the coordinates, $v_{ab} = v_a - v_b$ of the velocities of particles $a$ and $b$.

source
TrixiParticles.SummationDensityType
SummationDensity()

Density calculator to use the summation formula

\[\rho(r) = \sum_{b} m_b W(\Vert r - r_b \Vert, h),\]

for the density estimation, where $r_b$ denotes the coordinates and $m_b$ the mass of particle $b$.

source
diff --git a/dev/general/initial_condition/index.html b/dev/general/initial_condition/index.html index 762155dcf..8650c661d 100644 --- a/dev/general/initial_condition/index.html +++ b/dev/general/initial_condition/index.html @@ -28,13 +28,13 @@ initial_condition = InitialCondition(; coordinates, velocity, mass, density) # With functions -initial_condition = InitialCondition(; coordinates, velocity=x -> 2x, mass=1.0, density=1000.0)source

Setups

TrixiParticles.ComplexShapeMethod
ComplexShape(geometry::Union{TriangleMesh, Polygon}; particle_spacing, density,
+initial_condition = InitialCondition(; coordinates, velocity=x -> 2x, mass=1.0, density=1000.0)
source

Setups

TrixiParticles.ComplexShapeMethod
ComplexShape(geometry::Union{TriangleMesh, Polygon}; particle_spacing, density,
              pressure=0.0, mass=nothing, velocity=zeros(ndims(geometry)),
              point_in_geometry_algorithm=WindingNumberJacobson(; geometry,
                                                                hierarchical_winding=false,
                                                                winding_number_factor=sqrt(eps())),
              grid_offset::Real=0.0, max_nparticles=10^7,
-             pad_initial_particle_grid=2particle_spacing)

Sample a complex geometry with particles. Returns an InitialCondition. Note that an initial particle grid is generated inside the bounding box of the geometry. A point_in_geometry_algorithm checks if particles are inside the geometry or not. For more information about the method see WindingNumberJacobson or WindingNumberHorman.

Arguments

Keywords

  • particle_spacing: Spacing between the particles.
  • density: Either a function mapping each particle's coordinates to its density, or a scalar for a constant density over all particles.
  • velocity: Either a function mapping each particle's coordinates to its velocity, or, for a constant fluid velocity, a vector holding this velocity. Velocity is constant zero by default.
  • mass: Either nothing (default) to automatically compute particle mass from particle density and spacing, or a function mapping each particle's coordinates to its mass, or a scalar for a constant mass over all particles.
  • pressure: Scalar to set the pressure of all particles to this value. This is only used by the EntropicallyDampedSPHSystem and will be overwritten when using an initial pressure function in the system.
  • point_in_geometry_algorithm: Algorithm for sampling the complex geometry with particles. It basically checks whether a particle is inside an object or not. For more information see WindingNumberJacobson or WindingNumberHorman
  • grid_offset: Offset of the initial particle grid of the bounding box of the geometry.
  • max_nparticles: Maximum number of particles in the initial particle grid. This is only used to avoid accidentally choosing a particle_spacing that is too small for the scale of the geometry.
  • pad_initial_particle_grid: Padding of the initial particle grid.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.extrude_geometryMethod
extrude_geometry(geometry; particle_spacing, direction, n_extrude::Integer,
+             pad_initial_particle_grid=2particle_spacing)

Sample a complex geometry with particles. Returns an InitialCondition. Note that an initial particle grid is generated inside the bounding box of the geometry. A point_in_geometry_algorithm checks if particles are inside the geometry or not. For more information about the method see WindingNumberJacobson or WindingNumberHorman.

Arguments

Keywords

  • particle_spacing: Spacing between the particles.
  • density: Either a function mapping each particle's coordinates to its density, or a scalar for a constant density over all particles.
  • velocity: Either a function mapping each particle's coordinates to its velocity, or, for a constant fluid velocity, a vector holding this velocity. Velocity is constant zero by default.
  • mass: Either nothing (default) to automatically compute particle mass from particle density and spacing, or a function mapping each particle's coordinates to its mass, or a scalar for a constant mass over all particles.
  • pressure: Scalar to set the pressure of all particles to this value. This is only used by the EntropicallyDampedSPHSystem and will be overwritten when using an initial pressure function in the system.
  • point_in_geometry_algorithm: Algorithm for sampling the complex geometry with particles. It basically checks whether a particle is inside an object or not. For more information see WindingNumberJacobson or WindingNumberHorman
  • grid_offset: Offset of the initial particle grid of the bounding box of the geometry.
  • max_nparticles: Maximum number of particles in the initial particle grid. This is only used to avoid accidentally choosing a particle_spacing that is too small for the scale of the geometry.
  • pad_initial_particle_grid: Padding of the initial particle grid.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.extrude_geometryMethod
extrude_geometry(geometry; particle_spacing, direction, n_extrude::Integer,
                  velocity=zeros(length(direction)),
                  mass=nothing, density=nothing, pressure=0.0)

Extrude either a line, a plane or a shape along a specific direction. Returns an InitialCondition.

Arguments

  • geometry: Either particle coordinates or an InitialCondition defining a 2D shape to extrude to a 3D volume, or two 2D points $(A, B)$ defining the interval $[A, B]$ to extrude to a plane in 2D, or three 3D points $(A, B, C)$ defining the parallelogram spanned by the vectors $\widehat{AB}$ and $\widehat {AC}$ to extrude to a parallelepiped.

Keywords

  • particle_spacing: Spacing between the particles. Can be omitted when geometry is an InitialCondition (unless geometry.particle_spacing == -1).
  • direction: A vector that specifies the direction in which to extrude.
  • n_extrude: Number of layers of particles created in the direction of extrusion.
  • velocity: Either a function mapping each particle's coordinates to its velocity, or, for a constant fluid velocity, a vector holding this velocity. Velocity is constant zero by default.
  • mass: Either nothing (default) to automatically compute particle mass from particle density and spacing, or a function mapping each particle's coordinates to its mass, or a scalar for a constant mass over all particles.
  • density: Either a function mapping each particle's coordinates to its density, or a scalar for a constant density over all particles.
  • pressure: Scalar to set the pressure of all particles to this value. This is only used by the EntropicallyDampedSPHSystem and will be overwritten when using an initial pressure function in the system.
  • tlsph: With the TotalLagrangianSPHSystem, particles need to be placed on the boundary of the shape and not one particle radius away, as for fluids. When tlsph=true, particles will be placed on the boundary of the shape.

Examples

# Extrude a line in 2D to a plane in 2D
 p1 = [0.0, 0.0]
@@ -59,7 +59,7 @@
 
 direction = [0.0, 0.0, 1.0]
 
-shape = extrude_geometry(shape; direction, particle_spacing=0.1, n_extrude=4, density=1000.0)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.RectangularShapeMethod
RectangularShape(particle_spacing, n_particles_per_dimension, min_coordinates;
+shape = extrude_geometry(shape; direction, particle_spacing=0.1, n_extrude=4, density=1000.0)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.RectangularShapeMethod
RectangularShape(particle_spacing, n_particles_per_dimension, min_coordinates;
                  velocity=zeros(length(n_particles_per_dimension)),
                  mass=nothing, density=nothing, pressure=0.0,
                  acceleration=nothing, state_equation=nothing,
@@ -73,7 +73,7 @@
                                acceleration=(0.0, -9.81), state_equation=state_equation)
 
 # 3D
-rectangular = RectangularShape(particle_spacing, (5, 4, 7), (1.0, 2.0, 3.0), density=1000.0)
source
TrixiParticles.RectangularTankType
RectangularTank(particle_spacing, fluid_size, tank_size, fluid_density;
+rectangular = RectangularShape(particle_spacing, (5, 4, 7), (1.0, 2.0, 3.0), density=1000.0)
source
TrixiParticles.RectangularTankType
RectangularTank(particle_spacing, fluid_size, tank_size, fluid_density;
                 velocity=zeros(length(fluid_size)), fluid_mass=nothing,
                 pressure=0.0,
                 acceleration=nothing, state_equation=nothing,
@@ -95,7 +95,7 @@
 # 3D
 setup = RectangularTank(particle_spacing, (water_width, water_height, water_depth),
                         (container_width, container_height, container_depth), fluid_density,
-                        n_layers=2)

See also: reset_wall!.

source
TrixiParticles.reset_wall!Method
reset_wall!(rectangular_tank::RectangularTank, reset_faces, positions)

The selected walls of the tank will be placed at the new positions.

Arguments

  • reset_faces: Boolean tuple of 4 (in 2D) or 6 (in 3D) dimensions, similar to faces in RectangularTank.
  • positions: Tuple of new positions
Warning

There are overlapping particles when adjacent walls are moved inwards simultaneously.

source
TrixiParticles.RoundSphereType
RoundSphere(; start_angle=0.0, end_angle=2π)

Construct a sphere (or sphere segment) by nesting perfectly round concentric spheres. The resulting ball will be perfectly round, but will not have a regular inner structure.

Keywords

  • start_angle: The starting angle of the sphere segment in radians. It determines the beginning point of the segment. The default is set to 0.0 representing the positive x-axis.
  • end_angle: The ending angle of the sphere segment in radians. It defines the termination point of the segment. The default is set to 2pi, completing a full sphere.
Usage

See SphereShape on how to use this.

Warning

The sphere segment is intended for 2D geometries and hollow spheres. If used for filled spheres or in a 3D context, results may not be accurate.

source
TrixiParticles.VoxelSphereType
VoxelSphere()

Construct a sphere of voxels (where particles are placed in the voxel center) with a regular inner structure but corners on the surface. Essentially, a grid of particles is generated and all particles outside the sphere are removed. The resulting sphere will have a perfect inner structure, but is not perfectly round, as it will have corners (like a sphere in Minecraft).

Usage

See SphereShape on how to use this.

source
TrixiParticles.SphereShapeMethod
SphereShape(particle_spacing, radius, center_position, density;
+                        n_layers=2)

See also: reset_wall!.

source
TrixiParticles.reset_wall!Method
reset_wall!(rectangular_tank::RectangularTank, reset_faces, positions)

The selected walls of the tank will be placed at the new positions.

Arguments

  • reset_faces: Boolean tuple of 4 (in 2D) or 6 (in 3D) dimensions, similar to faces in RectangularTank.
  • positions: Tuple of new positions
Warning

There are overlapping particles when adjacent walls are moved inwards simultaneously.

source
TrixiParticles.RoundSphereType
RoundSphere(; start_angle=0.0, end_angle=2π)

Construct a sphere (or sphere segment) by nesting perfectly round concentric spheres. The resulting ball will be perfectly round, but will not have a regular inner structure.

Keywords

  • start_angle: The starting angle of the sphere segment in radians. It determines the beginning point of the segment. The default is set to 0.0 representing the positive x-axis.
  • end_angle: The ending angle of the sphere segment in radians. It defines the termination point of the segment. The default is set to 2pi, completing a full sphere.
Usage

See SphereShape on how to use this.

Warning

The sphere segment is intended for 2D geometries and hollow spheres. If used for filled spheres or in a 3D context, results may not be accurate.

source
TrixiParticles.VoxelSphereType
VoxelSphere()

Construct a sphere of voxels (where particles are placed in the voxel center) with a regular inner structure but corners on the surface. Essentially, a grid of particles is generated and all particles outside the sphere are removed. The resulting sphere will have a perfect inner structure, but is not perfectly round, as it will have corners (like a sphere in Minecraft).

Usage

See SphereShape on how to use this.

source
TrixiParticles.SphereShapeMethod
SphereShape(particle_spacing, radius, center_position, density;
             sphere_type=VoxelSphere(), n_layers=-1, layer_outwards=false,
             cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), tlsph=false,
             velocity=zeros(length(center_position)), mass=nothing, pressure=0.0)

Generate a sphere that is either completely filled (by default) or hollow (by passing n_layers).

With the sphere type VoxelSphere, a sphere of voxels (where particles are placed in the voxel center) with a regular inner structure but corners on the surface is created. Essentially, a grid of particles is generated and all particles outside the sphere are removed. With the sphere type RoundSphere, a perfectly round sphere with an imperfect inner structure is created.

A cuboid can be cut out of the sphere by specifying the two corners in negative and positive coordinate directions as cutout_min and cutout_max.

Arguments

  • particle_spacing: Spacing between the particles.
  • radius: Radius of the sphere.
  • center_position: The coordinates of the center of the sphere.
  • density: Either a function mapping each particle's coordinates to its density, or a scalar for a constant density over all particles.

Keywords

  • sphere_type: Either VoxelSphere or RoundSphere (see explanation above).
  • n_layers: Set to an integer greater than zero to generate a hollow sphere, where the shell consists of n_layers layers.
  • layer_outwards: When set to false (by default), radius is the outer radius of the sphere. When set to true, radius is the inner radius of the sphere. This is only used when n_layers > 0.
  • cutout_min: Corner in negative coordinate directions of a cuboid that is to be cut out of the sphere.
  • cutout_max: Corner in positive coordinate directions of a cuboid that is to be cut out of the sphere.
  • tlsph: With the TotalLagrangianSPHSystem, particles need to be placed on the boundary of the shape and not one particle radius away, as for fluids. When tlsph=true, particles will be placed on the boundary of the shape.
  • velocity: Either a function mapping each particle's coordinates to its velocity, or, for a constant fluid velocity, a vector holding this velocity. Velocity is constant zero by default.
  • mass: Either nothing (default) to automatically compute particle mass from particle density and spacing, or a function mapping each particle's coordinates to its mass, or a scalar for a constant mass over all particles.
  • pressure: Either a function mapping each particle's coordinates to its pressure, or a scalar for a constant pressure over all particles. This is optional and only needed when using the EntropicallyDampedSPHSystem.

Examples

# Filled circle with radius 0.5, center in (0.2, 0.4) and a particle spacing of 0.1
@@ -123,4 +123,4 @@
 SphereShape(0.1, 0.5, (0.2, 0.4, 0.3), 1000.0)
 
 # Same as before, but perfectly round
-SphereShape(0.1, 0.5, (0.2, 0.4, 0.3), 1000.0, sphere_type=RoundSphere())
source
+SphereShape(0.1, 0.5, (0.2, 0.4, 0.3), 1000.0, sphere_type=RoundSphere())source diff --git a/dev/general/interpolation/index.html b/dev/general/interpolation/index.html index 89a1d03d2..c846f70c8 100644 --- a/dev/general/interpolation/index.html +++ b/dev/general/interpolation/index.html @@ -2,17 +2,17 @@ Interpolation · TrixiParticles.jl

Interpolation

TrixiParticles.interpolate_lineMethod
interpolate_line(start, end_, n_points, semi, ref_system, sol; endpoint=true,
                  smoothing_length=ref_system.smoothing_length, cut_off_bnd=true,
                  clip_negative_pressure=false)

Interpolates properties along a line in a TrixiParticles simulation. The line interpolation is accomplished by generating a series of evenly spaced points between start and end_. If endpoint is false, the line is interpolated between the start and end points, but does not include these points.

See also: interpolate_point, interpolate_plane_2d, interpolate_plane_2d_vtk, interpolate_plane_3d.

Arguments

  • start: The starting point of the line.
  • end_: The ending point of the line.
  • n_points: The number of points to interpolate along the line.
  • semi: The semidiscretization used for the simulation.
  • ref_system: The reference system for the interpolation.
  • sol: The solution state from which the properties are interpolated.

Keywords

  • endpoint=true: A boolean to include (true) or exclude (false) the end point in the interpolation.
  • smoothing_length=ref_system.smoothing_length: The smoothing length used in the interpolation.
  • cut_off_bnd=true: Boolean to indicate if quantities should be set to NaN when the point is "closer" to the boundary than to the fluid in a kernel-weighted sense. Or, in more detail, when the boundary has more influence than the fluid on the density summation in this point, i.e., when the boundary particles add more kernel-weighted mass than the fluid particles.
  • clip_negative_pressure=false: One common approach in SPH models is to clip negative pressure values, but this is unphysical. Instead we clip here during interpolation thus only impacting the local interpolated value.

Returns

  • A NamedTuple of arrays containing interpolated properties at each point along the line.
Note
  • This function is particularly useful for analyzing gradients or creating visualizations along a specified line in the SPH simulation domain.
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used which is not as accurate as a real surface reconstruction.

Examples

# Interpolating along a line from [1.0, 0.0] to [1.0, 1.0] with 5 points
-results = interpolate_line([1.0, 0.0], [1.0, 1.0], 5, semi, ref_system, sol)
source
TrixiParticles.interpolate_plane_2dMethod
interpolate_plane_2d(min_corner, max_corner, resolution, semi, ref_system, sol;
+results = interpolate_line([1.0, 0.0], [1.0, 1.0], 5, semi, ref_system, sol)
source
TrixiParticles.interpolate_plane_2dMethod
interpolate_plane_2d(min_corner, max_corner, resolution, semi, ref_system, sol;
                      smoothing_length=ref_system.smoothing_length, cut_off_bnd=true,
                      clip_negative_pressure=false)

Interpolates properties along a plane in a TrixiParticles simulation. The region for interpolation is defined by its lower left and top right corners, with a specified resolution determining the density of the interpolation points.

The function generates a grid of points within the defined region, spaced uniformly according to the given resolution.

See also: interpolate_plane_2d_vtk, interpolate_plane_3d, interpolate_line, interpolate_point.

Arguments

  • min_corner: The lower left corner of the interpolation region.
  • max_corner: The top right corner of the interpolation region.
  • resolution: The distance between adjacent interpolation points in the grid.
  • semi: The semidiscretization used for the simulation.
  • ref_system: The reference system for the interpolation.
  • sol: The solution state from which the properties are interpolated.

Keywords

  • smoothing_length=ref_system.smoothing_length: The smoothing length used in the interpolation.
  • cut_off_bnd=true: Boolean to indicate if quantities should be set to NaN when the point is "closer" to the boundary than to the fluid in a kernel-weighted sense. Or, in more detail, when the boundary has more influence than the fluid on the density summation in this point, i.e., when the boundary particles add more kernel-weighted mass than the fluid particles.
  • clip_negative_pressure=false: One common approach in SPH models is to clip negative pressure values, but this is unphysical. Instead we clip here during interpolation thus only impacting the local interpolated value.

Returns

  • A NamedTuple of arrays containing interpolated properties at each point within the plane.
Note
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used, which is not as accurate as a real surface reconstruction.

Examples

# Interpolating across a plane from [0.0, 0.0] to [1.0, 1.0] with a resolution of 0.2
-results = interpolate_plane_2d([0.0, 0.0], [1.0, 1.0], 0.2, semi, ref_system, sol)
source
TrixiParticles.interpolate_plane_2d_vtkMethod
interpolate_plane_2d_vtk(min_corner, max_corner, resolution, semi, ref_system, sol;
                          smoothing_length=ref_system.smoothing_length, cut_off_bnd=true,
                          clip_negative_pressure=false, output_directory="out", filename="plane")

Interpolates properties along a plane in a TrixiParticles simulation and exports the result as a VTI file. The region for interpolation is defined by its lower left and top right corners, with a specified resolution determining the density of the interpolation points.

The function generates a grid of points within the defined region, spaced uniformly according to the given resolution.

See also: interpolate_plane_2d, interpolate_plane_3d, interpolate_line, interpolate_point.

Arguments

  • min_corner: The lower left corner of the interpolation region.
  • max_corner: The top right corner of the interpolation region.
  • resolution: The distance between adjacent interpolation points in the grid.
  • semi: The semidiscretization used for the simulation.
  • ref_system: The reference system for the interpolation.
  • sol: The solution state from which the properties are interpolated.

Keywords

  • smoothing_length=ref_system.smoothing_length: The smoothing length used in the interpolation.
  • output_directory="out": Directory to save the VTI file.
  • filename="plane": Name of the VTI file.
  • cut_off_bnd=true: Boolean to indicate if quantities should be set to NaN when the point is "closer" to the boundary than to the fluid in a kernel-weighted sense. Or, in more detail, when the boundary has more influence than the fluid on the density summation in this point, i.e., when the boundary particles add more kernel-weighted mass than the fluid particles.
  • clip_negative_pressure=false: One common approach in SPH models is to clip negative pressure values, but this is unphysical. Instead we clip here during interpolation thus only impacting the local interpolated value.
Note
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used, which is not as accurate as a real surface reconstruction.

Examples

# Interpolating across a plane from [0.0, 0.0] to [1.0, 1.0] with a resolution of 0.2
-results = interpolate_plane_2d([0.0, 0.0], [1.0, 1.0], 0.2, semi, ref_system, sol)
source
TrixiParticles.interpolate_plane_3dMethod
interpolate_plane_3d(point1, point2, point3, resolution, semi, ref_system, sol;
+results = interpolate_plane_2d([0.0, 0.0], [1.0, 1.0], 0.2, semi, ref_system, sol)
source
TrixiParticles.interpolate_plane_3dMethod
interpolate_plane_3d(point1, point2, point3, resolution, semi, ref_system, sol;
                      smoothing_length=ref_system.smoothing_length, cut_off_bnd=true,
                      clip_negative_pressure=false)

Interpolates properties along a plane in a 3D space in a TrixiParticles simulation. The plane for interpolation is defined by three points in 3D space, with a specified resolution determining the density of the interpolation points.

The function generates a grid of points on a parallelogram within the plane defined by the three points, spaced uniformly according to the given resolution.

See also: interpolate_plane_2d, interpolate_plane_2d_vtk, interpolate_line, interpolate_point.

Arguments

  • point1: The first point defining the plane.
  • point2: The second point defining the plane.
  • point3: The third point defining the plane. The points must not be collinear.
  • resolution: The distance between adjacent interpolation points in the grid.
  • semi: The semidiscretization used for the simulation.
  • ref_system: The reference system for the interpolation.
  • sol: The solution state from which the properties are interpolated.

Keywords

  • smoothing_length=ref_system.smoothing_length: The smoothing length used in the interpolation.
  • cut_off_bnd=true: Boolean to indicate if quantities should be set to NaN when the point is "closer" to the boundary than to the fluid in a kernel-weighted sense. Or, in more detail, when the boundary has more influence than the fluid on the density summation in this point, i.e., when the boundary particles add more kernel-weighted mass than the fluid particles.
  • clip_negative_pressure=false: One common approach in SPH models is to clip negative pressure values, but this is unphysical. Instead we clip here during interpolation thus only impacting the local interpolated value.

Returns

  • A NamedTuple of arrays containing interpolated properties at each point within the plane.
Note
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used which is not as accurate as a real surface reconstruction.

Examples

# Interpolating across a plane defined by points [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], and [0.0, 1.0, 0.0]
 # with a resolution of 0.1
-results = interpolate_plane_3d([0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 0.1, semi, ref_system, sol)
source
TrixiParticles.interpolate_pointMethod
interpolate_point(points_coords::Array{Array{Float64,1},1}, semi, ref_system, sol;
+results = interpolate_plane_3d([0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 0.1, semi, ref_system, sol)
source
TrixiParticles.interpolate_pointMethod
interpolate_point(points_coords::Array{Array{Float64,1},1}, semi, ref_system, sol;
                   smoothing_length=ref_system.smoothing_length, cut_off_bnd=true,
                   clip_negative_pressure=false)
 
@@ -23,4 +23,4 @@
 
 # For multiple points
 points = [[1.0, 0.5], [1.0, 0.6], [1.0, 0.7]]
-results = interpolate_point(points, semi, ref_system, sol)
Note
  • This function is particularly useful for analyzing gradients or creating visualizations along a specified line in the SPH simulation domain.
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used which is not as

accurate as a real surface reconstruction.

source
+results = interpolate_point(points, semi, ref_system, sol)
Note
  • This function is particularly useful for analyzing gradients or creating visualizations along a specified line in the SPH simulation domain.
  • The interpolation accuracy is subject to the density of particles and the chosen smoothing length.
  • With cut_off_bnd, a density-based estimation of the surface is used which is not as

accurate as a real surface reconstruction.

source diff --git a/dev/general/neighborhood_search/index.html b/dev/general/neighborhood_search/index.html index 5ff746791..e9942c919 100644 --- a/dev/general/neighborhood_search/index.html +++ b/dev/general/neighborhood_search/index.html @@ -2,4 +2,4 @@ Neighborhood Search · TrixiParticles.jl

Neighborhood Search

The neighborhood search is the most essential component for performance. We provide several implementations in the package PointNeighbors.jl. See the docs of this package for an overview and a comparison of different implementations.

Usage

To run a simulation with a neighborhood search implementation, pass a template of the neighborhood search to the constructor of the Semidiscretization. A template is just an empty neighborhood search with search radius 0.0. See copy_neighborhood_search and the examples below for more details.

semi = Semidiscretization(system1, system2,
                           neighborhood_search=PrecomputedNeighborhoodSearch{2}())

The keyword argument periodic_box in the neighborhood search constructors can be used to define a periodic domain. See the PointNeighbors.jl docs for more details.

periodic_box = PeriodicBox(min_corner=[0.0, -0.25], max_corner=[1.0, 0.75])
 semi = Semidiscretization(system1, system2,
-                          neighborhood_search=GridNeighborhoodSearch{2}(; periodic_box))
+ neighborhood_search=GridNeighborhoodSearch{2}(; periodic_box)) diff --git a/dev/general/semidiscretization/index.html b/dev/general/semidiscretization/index.html index 08a53f6cd..1f84790cd 100644 --- a/dev/general/semidiscretization/index.html +++ b/dev/general/semidiscretization/index.html @@ -12,6 +12,6 @@ neighborhood_search=PrecomputedNeighborhoodSearch{2}()) semi = Semidiscretization(fluid_system, boundary_system, - neighborhood_search=nothing)source
TrixiParticles.SourceTermDampingType
SourceTermDamping(; damping_coefficient)

A source term to be used when a damping step is required before running a full simulation. The term $-c \cdot v_a$ is added to the acceleration $\frac{\mathrm{d}v_a}{\mathrm{d}t}$ of particle $a$, where $c$ is the damping coefficient and $v_a$ is the velocity of particle $a$.

Keywords

  • damping_coefficient: The coefficient $d$ above. A higher coefficient means more damping. A coefficient of 1e-4 is a good starting point for damping a fluid at rest.

Examples

source_terms = SourceTermDamping(; damping_coefficient=1e-4)
source
TrixiParticles.restart_with!Method
restart_with!(semi, sol)

Set the initial coordinates and velocities of all systems in semi to the final values in the solution sol. semidiscretize has to be called again afterwards, or another Semidiscretization can be created with the updated systems.

Arguments

  • semi: The semidiscretization
  • sol: The ODESolution returned by solve of OrdinaryDiffEq
source
TrixiParticles.semidiscretizeMethod
semidiscretize(semi, tspan; reset_threads=true)

Create an ODEProblem from the semidiscretization with the specified tspan.

Arguments

  • semi: A Semidiscretization holding the systems involved in the simulation.
  • tspan: The time span over which the simulation will be run.

Keywords

  • reset_threads: A boolean flag to reset Polyester.jl threads before the simulation (default: true). After an error within a threaded loop, threading might be disabled. Resetting the threads before the simulation ensures that threading is enabled again for the simulation. See also trixi-framework/Trixi.jl#1583.

Returns

A DynamicalODEProblem (see the OrdinaryDiffEq.jl docs) to be integrated with OrdinaryDiffEq.jl. Note that this is not a true DynamicalODEProblem where the acceleration does not depend on the velocity. Therefore, not all integrators designed for DynamicalODEProblems will work properly. However, all integrators designed for ODEProblems can be used.

Examples

semi = Semidiscretization(fluid_system, boundary_system)
+                          neighborhood_search=nothing)
source
TrixiParticles.SourceTermDampingType
SourceTermDamping(; damping_coefficient)

A source term to be used when a damping step is required before running a full simulation. The term $-c \cdot v_a$ is added to the acceleration $\frac{\mathrm{d}v_a}{\mathrm{d}t}$ of particle $a$, where $c$ is the damping coefficient and $v_a$ is the velocity of particle $a$.

Keywords

  • damping_coefficient: The coefficient $d$ above. A higher coefficient means more damping. A coefficient of 1e-4 is a good starting point for damping a fluid at rest.

Examples

source_terms = SourceTermDamping(; damping_coefficient=1e-4)
source
TrixiParticles.restart_with!Method
restart_with!(semi, sol)

Set the initial coordinates and velocities of all systems in semi to the final values in the solution sol. semidiscretize has to be called again afterwards, or another Semidiscretization can be created with the updated systems.

Arguments

  • semi: The semidiscretization
  • sol: The ODESolution returned by solve of OrdinaryDiffEq
source
TrixiParticles.semidiscretizeMethod
semidiscretize(semi, tspan; reset_threads=true)

Create an ODEProblem from the semidiscretization with the specified tspan.

Arguments

  • semi: A Semidiscretization holding the systems involved in the simulation.
  • tspan: The time span over which the simulation will be run.

Keywords

  • reset_threads: A boolean flag to reset Polyester.jl threads before the simulation (default: true). After an error within a threaded loop, threading might be disabled. Resetting the threads before the simulation ensures that threading is enabled again for the simulation. See also trixi-framework/Trixi.jl#1583.

Returns

A DynamicalODEProblem (see the OrdinaryDiffEq.jl docs) to be integrated with OrdinaryDiffEq.jl. Note that this is not a true DynamicalODEProblem where the acceleration does not depend on the velocity. Therefore, not all integrators designed for DynamicalODEProblems will work properly. However, all integrators designed for ODEProblems can be used.

Examples

semi = Semidiscretization(fluid_system, boundary_system)
 tspan = (0.0, 1.0)
-ode_problem = semidiscretize(semi, tspan)
source
+ode_problem = semidiscretize(semi, tspan)source diff --git a/dev/general/smoothing_kernels/index.html b/dev/general/smoothing_kernels/index.html index 81564181e..ad51ef871 100644 --- a/dev/general/smoothing_kernels/index.html +++ b/dev/general/smoothing_kernels/index.html @@ -1,33 +1,33 @@ -Smoothing Kernels · TrixiParticles.jl

Smoothing Kernels

The following smoothing kernels are currently available:

Smoothing KernelCompact SupportTyp. Smoothing LengthRecommended ApplicationStability
SchoenbergCubicSplineKernel$[0, 2h]$$1.1$ to $1.3$General + sharp waves++
SchoenbergQuarticSplineKernel$[0, 2.5h]$$1.1$ to $1.5$General+++
SchoenbergQuinticSplineKernel$[0, 3h]$$1.1$ to $1.5$General++++
GaussianKernel$[0, 3h]$$1.0$ to $1.5$Literature+++++
WendlandC2Kernel$[0, 1h]$$2.5$ to $4.0$General (recommended)++++
WendlandC4Kernel$[0, 1h]$$3.0$ to $4.5$General+++++
WendlandC6Kernel$[0, 1h]$$3.5$ to $5.0$General+++++
Poly6Kernel$[0, 1h]$$1.5$ to $2.5$Literature+
SpikyKernel$[0, 1h]$$1.5$ to $3.0$Sharp corners + waves+

We recommend to use the WendlandC2Kernel for most applications. If less smoothing is needed, try SchoenbergCubicSplineKernel, for more smoothing try WendlandC6Kernel.

Usage

The kernel can be called as

TrixiParticles.kernel(smoothing_kernel, r, h)

The length of the compact support can be obtained as

TrixiParticles.compact_support(smoothing_kernel, h)

Note that $r$ has to be a scalar, so in the context of SPH, the kernel should be used as

\[W(\Vert r_a - r_b \Vert, h).\]

The gradient required in SPH,

\[ \nabla_{r_a} W(\Vert r_a - r_b \Vert, h)\]

can be called as

TrixiParticles.kernel_grad(smoothing_kernel, pos_diff, distance, h)

where pos_diff is $r_a - r_b$ and distance is $\Vert r_a - r_b \Vert$.

TrixiParticles.GaussianKernelType
GaussianKernel{NDIMS}()

Gaussian kernel given by

\[W(r, h) = \frac{\sigma_d}{h^d} e^{-r^2/h^2}\]

where $d$ is the number of dimensions and

  • $\sigma_2 = \frac{1}{\pi}$ for 2D,
  • $\sigma_3 = \frac{1}{\pi^{3/2}}$ for 3D.

This kernel function has an infinite support, but in practice, it's often truncated at a certain multiple of $h$, such as $3h$.

In this implementation, the kernel is truncated at $3h$, so this kernel function has a compact support of $[0, 3h]$.

The smoothing length is typically in the range $[1.0\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

Note: This truncation makes this Kernel not conservative, which is beneficial in regards to stability but makes it less accurate.

source
TrixiParticles.Poly6KernelType
Poly6Kernel{NDIMS}()

Poly6 kernel, a commonly used kernel in SPH literature, especially in computer graphics contexts. It is defined as

\[W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +Smoothing Kernels · TrixiParticles.jl

Smoothing Kernels

The following smoothing kernels are currently available:

Smoothing KernelCompact SupportTyp. Smoothing LengthRecommended ApplicationStability
SchoenbergCubicSplineKernel$[0, 2h]$$1.1$ to $1.3$General + sharp waves++
SchoenbergQuarticSplineKernel$[0, 2.5h]$$1.1$ to $1.5$General+++
SchoenbergQuinticSplineKernel$[0, 3h]$$1.1$ to $1.5$General++++
GaussianKernel$[0, 3h]$$1.0$ to $1.5$Literature+++++
WendlandC2Kernel$[0, 1h]$$2.5$ to $4.0$General (recommended)++++
WendlandC4Kernel$[0, 1h]$$3.0$ to $4.5$General+++++
WendlandC6Kernel$[0, 1h]$$3.5$ to $5.0$General+++++
Poly6Kernel$[0, 1h]$$1.5$ to $2.5$Literature+
SpikyKernel$[0, 1h]$$1.5$ to $3.0$Sharp corners + waves+

We recommend to use the WendlandC2Kernel for most applications. If less smoothing is needed, try SchoenbergCubicSplineKernel, for more smoothing try WendlandC6Kernel.

Usage

The kernel can be called as

TrixiParticles.kernel(smoothing_kernel, r, h)

The length of the compact support can be obtained as

TrixiParticles.compact_support(smoothing_kernel, h)

Note that $r$ has to be a scalar, so in the context of SPH, the kernel should be used as

\[W(\Vert r_a - r_b \Vert, h).\]

The gradient required in SPH,

\[ \nabla_{r_a} W(\Vert r_a - r_b \Vert, h)\]

can be called as

TrixiParticles.kernel_grad(smoothing_kernel, pos_diff, distance, h)

where pos_diff is $r_a - r_b$ and distance is $\Vert r_a - r_b \Vert$.

TrixiParticles.GaussianKernelType
GaussianKernel{NDIMS}()

Gaussian kernel given by

\[W(r, h) = \frac{\sigma_d}{h^d} e^{-r^2/h^2}\]

where $d$ is the number of dimensions and

  • $\sigma_2 = \frac{1}{\pi}$ for 2D,
  • $\sigma_3 = \frac{1}{\pi^{3/2}}$ for 3D.

This kernel function has an infinite support, but in practice, it's often truncated at a certain multiple of $h$, such as $3h$.

In this implementation, the kernel is truncated at $3h$, so this kernel function has a compact support of $[0, 3h]$.

The smoothing length is typically in the range $[1.0\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

Note: This truncation makes this Kernel not conservative, which is beneficial in regards to stability but makes it less accurate.

source
TrixiParticles.Poly6KernelType
Poly6Kernel{NDIMS}()

Poly6 kernel, a commonly used kernel in SPH literature, especially in computer graphics contexts. It is defined as

\[W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} (1 - q^2)^3 & \text{if } 0 \leq q < 1, \\ 0 & \text{if } q \geq 1, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor that depends on the dimension. The normalization factor $\sigma$ is $4 / \pi$ in two dimensions or $315 / 64\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

Poly6 is well-known for its computational simplicity, though it's worth noting that there are other kernels that might offer better accuracy for hydrodynamic simulations. Furthermore, its derivatives are not that smooth, which can lead to stability problems. It is also susceptible to clumping.

The smoothing length is typically in the range $[1.5\delta, 2.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Matthias Müller, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications". In: Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association. 2003, pages 154-159. doi: 10.5555/846276.846298
source
TrixiParticles.SchoenbergCubicSplineKernelType
SchoenbergCubicSplineKernel{NDIMS}()

Cubic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor that depends on the dimension. The normalization factor $\sigma$ is $4 / \pi$ in two dimensions or $315 / 64\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

Poly6 is well-known for its computational simplicity, though it's worth noting that there are other kernels that might offer better accuracy for hydrodynamic simulations. Furthermore, its derivatives are not that smooth, which can lead to stability problems. It is also susceptible to clumping.

The smoothing length is typically in the range $[1.5\delta, 2.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Matthias Müller, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications". In: Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association. 2003, pages 154-159. doi: 10.5555/846276.846298
source
TrixiParticles.SchoenbergCubicSplineKernelType
SchoenbergCubicSplineKernel{NDIMS}()

Cubic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} \frac{1}{4} (2 - q)^3 - (1 - q)^3 & \text{if } 0 \leq q < 1, \\ \frac{1}{4} (2 - q)^3 & \text{if } 1 \leq q < 2, \\ 0 & \text{if } q \geq 2, \\ -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{2}{3}, \frac{10}{7 \pi}, \frac{1}{\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 2h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985). The largest disadvantage of Schoenberg Spline Kernel is the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.3\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SchoenbergQuarticSplineKernelType
SchoenbergQuarticSplineKernel{NDIMS}()

Quartic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{2}{3}, \frac{10}{7 \pi}, \frac{1}{\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 2h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985). The largest disadvantage of Schoenberg Spline Kernel is the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.3\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SchoenbergQuarticSplineKernelType
SchoenbergQuarticSplineKernel{NDIMS}()

Quartic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} \left(5/2 - q \right)^4 - 5\left(3/2 - q \right)^4 + 10\left(1/2 - q \right)^4 & \text{if } 0 \leq q < \frac{1}{2}, \\ \left(5/2 - q \right)^4 - 5\left(3/2 - q \right)^4 & \text{if } \frac{1}{2} \leq q < \frac{3}{2}, \\ \left(5/2 - q \right)^4 & \text{if } \frac{3}{2} \leq q < \frac{5}{2}, \\ 0 & \text{if } q \geq \frac{5}{2}, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{1}{24}, \frac{96}{1199 \pi}, \frac{1}{20\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 2.5h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985).

The largest disadvantage of Schoenberg Spline Kernel are the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SchoenbergQuinticSplineKernelType
SchoenbergQuinticSplineKernel{NDIMS}()

Quintic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{1}{24}, \frac{96}{1199 \pi}, \frac{1}{20\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 2.5h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985).

The largest disadvantage of Schoenberg Spline Kernel are the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SchoenbergQuinticSplineKernelType
SchoenbergQuinticSplineKernel{NDIMS}()

Quintic spline kernel by Schoenberg (Schoenberg, 1946), given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} (3 - q)^5 - 6(2 - q)^5 + 15(1 - q)^5 & \text{if } 0 \leq q < 1, \\ (3 - q)^5 - 6(2 - q)^5 & \text{if } 1 \leq q < 2, \\ (3 - q)^5 & \text{if } 2 \leq q < 3, \\ 0 & \text{if } q \geq 3, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{1}{120}, \frac{7}{478 \pi}, \frac{1}{120\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 3h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985).

The largest disadvantage of Schoenberg Spline Kernel are the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SpikyKernelType
SpikyKernel{NDIMS}()

The Spiky kernel is another frequently used kernel in SPH, especially due to its desirable properties in preserving features near boundaries in fluid simulations. It is defined as:

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with:

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization constant given by $\sigma =[\frac{1}{120}, \frac{7}{478 \pi}, \frac{1}{120\pi}]$ in $[1, 2, 3]$ dimensions.

This kernel function has a compact support of $[0, 3h]$.

For an overview of Schoenberg cubic, quartic and quintic spline kernels including normalization factors, see (Price, 2012). For an analytic formula for higher order Schoenberg kernels, see (Monaghan, 1985).

The largest disadvantage of Schoenberg Spline Kernel are the rather non-smooth first derivative, which can lead to increased noise compared to other kernel variants.

The smoothing length is typically in the range $[1.1\delta, 1.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Daniel J. Price. "Smoothed particle hydrodynamics and magnetohydrodynamics". In: Journal of Computational Physics 231.3 (2012), pages 759-794. doi: 10.1016/j.jcp.2010.12.011
  • Joseph J. Monaghan. "Particle methods for hydrodynamics". In: Computer Physics Reports 3.2 (1985), pages 71–124. doi: 10.1016/0167-7977(85)90010-3
  • Isaac J. Schoenberg. "Contributions to the problem of approximation of equidistant data by analytic functions. Part B. On the problem of osculatory interpolation. A second class of analytic approximation formulae." In: Quarterly of Applied Mathematics 4.2 (1946), pages 112–141. doi: 10.1090/QAM/16705
source
TrixiParticles.SpikyKernelType
SpikyKernel{NDIMS}()

The Spiky kernel is another frequently used kernel in SPH, especially due to its desirable properties in preserving features near boundaries in fluid simulations. It is defined as:

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with:

\[w(q) = \sigma \begin{cases} (1 - q)^3 & \text{if } 0 \leq q < 1, \\ 0 & \text{if } q \geq 1, -\end{cases}\]

where $d$ is the number of dimensions and the normalization factor $\sigma$ is $10 / \pi$ in two dimensions or $15 / \pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

The Spiky kernel is particularly known for its sharp gradients, which can help to preserve sharp features in fluid simulations, especially near solid boundaries. These sharp gradients at the boundary are also the largest disadvantage as they can lead to instability.

The smoothing length is typically in the range $[1.5\delta, 3.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Matthias Müller, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications". In: Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association. 2003, pages 154-159. doi: 10.5555/846276.846298
source
TrixiParticles.WendlandC2KernelType
WendlandC2Kernel{NDIMS}()

Wendland C2 kernel (Wendland, 1995), a piecewise polynomial function designed to have compact support and to be twice continuously differentiable everywhere. Given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and the normalization factor $\sigma$ is $10 / \pi$ in two dimensions or $15 / \pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

The Spiky kernel is particularly known for its sharp gradients, which can help to preserve sharp features in fluid simulations, especially near solid boundaries. These sharp gradients at the boundary are also the largest disadvantage as they can lead to instability.

The smoothing length is typically in the range $[1.5\delta, 3.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Matthias Müller, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications". In: Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association. 2003, pages 154-159. doi: 10.5555/846276.846298
source
TrixiParticles.WendlandC2KernelType
WendlandC2Kernel{NDIMS}()

Wendland C2 kernel (Wendland, 1995), a piecewise polynomial function designed to have compact support and to be twice continuously differentiable everywhere. Given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} (1 - q)^4 (4q + 1) & \text{if } 0 \leq q < 1, \\ 0 & \text{if } q \geq 1, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $40/7\pi$ in two dimensions or $21/2\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they lose details at sharp corners.

The smoothing length is typically in the range $[2.5\delta, 4.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995), pages 389-396. doi: 10.1007/BF02123482

source
TrixiParticles.WendlandC4KernelType
WendlandC4Kernel{NDIMS}()

Wendland C4 kernel, a piecewise polynomial function designed to have compact support and to be four times continuously differentiable everywhere. Given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $40/7\pi$ in two dimensions or $21/2\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they lose details at sharp corners.

The smoothing length is typically in the range $[2.5\delta, 4.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995), pages 389-396. doi: 10.1007/BF02123482

source
TrixiParticles.WendlandC4KernelType
WendlandC4Kernel{NDIMS}()

Wendland C4 kernel, a piecewise polynomial function designed to have compact support and to be four times continuously differentiable everywhere. Given by

\[ W(r, h) = \frac{1}{h^d} w(r/h)\]

with

\[w(q) = \sigma \begin{cases} (1 - q)^6 (35q^2 / 3 + 6q + 1) & \text{if } 0 \leq q < 1, \\ 0 & \text{if } q \geq 1, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $9 / \pi$ in two dimensions or $495 / 32\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they loose details at sharp corners.

The smoothing length is typically in the range $[3.0\delta, 4.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995): 389-396. doi: 10.1007/BF02123482

source
TrixiParticles.WendlandC6KernelType
WendlandC6Kernel{NDIMS}()

Wendland C6 kernel, a piecewise polynomial function designed to have compact support and to be six times continuously differentiable everywhere. Given by:

\[W(r, h) = \frac{1}{h^d} w(r/h)\]

with:

\[w(q) = \sigma \begin{cases} +\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $9 / \pi$ in two dimensions or $495 / 32\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they loose details at sharp corners.

The smoothing length is typically in the range $[3.0\delta, 4.5\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995): 389-396. doi: 10.1007/BF02123482

source
TrixiParticles.WendlandC6KernelType
WendlandC6Kernel{NDIMS}()

Wendland C6 kernel, a piecewise polynomial function designed to have compact support and to be six times continuously differentiable everywhere. Given by:

\[W(r, h) = \frac{1}{h^d} w(r/h)\]

with:

\[w(q) = \sigma \begin{cases} (1 - q)^8 (32q^3 + 25q^2 + 8q + 1) & \text{if } 0 \leq q < 1, \\ 0 & \text{if } q \geq 1, -\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $78 / 7 \pi$ in two dimensions or $1365 / 64\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they loose details at sharp corners.

The smoothing length is typically in the range $[3.5\delta, 5.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995): 389-396. doi: 10.1007/BF02123482

source
+\end{cases}\]

where $d$ is the number of dimensions and $\sigma$ is a normalization factor dependent on the dimension. The normalization factor $\sigma$ is $78 / 7 \pi$ in two dimensions or $1365 / 64\pi$ in three dimensions.

This kernel function has a compact support of $[0, h]$.

For a detailed discussion on Wendland functions and their applications in SPH, see (Dehnen & Aly, 2012). The smoothness of these functions is also the largest disadvantage as they loose details at sharp corners.

The smoothing length is typically in the range $[3.5\delta, 5.0\delta]$, where $\delta$ is the typical particle spacing.

For general information and usage see Smoothing Kernels.

References

  • Walter Dehnen & Hassan Aly. "Improving convergence in smoothed particle hydrodynamics simulations without pairing instability". In: Monthly Notices of the Royal Astronomical Society 425.2 (2012), pages 1068-1082. doi: 10.1111/j.1365-2966.2012.21439.x

  • Holger Wendland. "Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree." In: Advances in computational Mathematics 4 (1995): 389-396. doi: 10.1007/BF02123482

source
diff --git a/dev/general/util/index.html b/dev/general/util/index.html index 220569fb5..f08a84b25 100644 --- a/dev/general/util/index.html +++ b/dev/general/util/index.html @@ -1,3 +1,3 @@ -Util · TrixiParticles.jl

Util

TrixiParticles.examples_dirMethod
examples_dir()

Return the directory where the example files provided with TrixiParticles.jl are located. If TrixiParticles is installed as a regular package (with ]add TrixiParticles), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
TrixiParticles.validation_dirMethod
validation_dir()

Return the directory where the validation files provided with TrixiParticles.jl are located. If TrixiParticles is installed as a regular package (with ]add TrixiParticles), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(validation_dir())
source
TrixiParticles.@autoinfiltrateMacro
@autoinfiltrate
-@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to TrixiParticles.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of TrixiParticles.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source
+Util · TrixiParticles.jl

Util

TrixiParticles.examples_dirMethod
examples_dir()

Return the directory where the example files provided with TrixiParticles.jl are located. If TrixiParticles is installed as a regular package (with ]add TrixiParticles), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
TrixiParticles.validation_dirMethod
validation_dir()

Return the directory where the validation files provided with TrixiParticles.jl are located. If TrixiParticles is installed as a regular package (with ]add TrixiParticles), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(validation_dir())
source
TrixiParticles.@autoinfiltrateMacro
@autoinfiltrate
+@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to TrixiParticles.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of TrixiParticles.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source
diff --git a/dev/getting_started/index.html b/dev/getting_started/index.html index d86a7551d..cc7e9560e 100644 --- a/dev/getting_started/index.html +++ b/dev/getting_started/index.html @@ -1,2 +1,2 @@ -Getting started · TrixiParticles.jl

Getting started

If you have not installed TrixiParticles.jl, please follow the instructions given here.

In the following sections, we will give a short introduction. For a more thorough discussion, take a look at our Tutorials.

Running an Example

The easiest way to run a simulation is to run one of our predefined example files. We will run the file examples/fluid/hydrostatic_water_column_2d.jl, which simulates a fluid resting in a rectangular tank. Since TrixiParticles.jl uses multithreading, you should start Julia with the flag --threads auto (or, e.g. --threads 4 for 4 threads).

In the Julia REPL, first load the package TrixiParticles.jl.

julia> using TrixiParticles

Then start the simulation by executing

julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"))

This will open a new window with a 2D visualization of the final solution: plot_hydrostatic_water_column

For more information about visualization, see Visualization.

Running other Examples

You can find a list of our other predefined examples under Examples. Execute them as follows from the Julia REPL by replacing subfolder and example_name

julia> trixi_include(joinpath(examples_dir(), "subfolder", "example_name.jl"))

Modifying an example

You can pass keyword arguments to the function trixi_include to overwrite assignments in the file.

With trixi_include, we can overwrite variables defined in the example file to run a different simulation without modifying the example file.

julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"), initial_fluid_size=(1.0, 0.5))

This for example, will change the fluid size from $(0.9, 1.0)$ to $(1.0, 0.5)$.

To understand why, take a look into the file hydrostatic_water_column_2d.jl in the subfolder fluid inside the examples directory, which is the file that we executed earlier. You can see that the initial size of the fluid is defined in the variable initial_fluid_size, which we could overwrite with the trixi_include call above. Another variable that is worth experimenting with is fluid_particle_spacing, which controls the resolution of the simulation in this case. A lower value will increase the resolution and the runtime.

Set up you first simulation from scratch

See Set up your first simulation.

Find an overview over the available tutorials under Tutorials.

+Getting started · TrixiParticles.jl

Getting started

If you have not installed TrixiParticles.jl, please follow the instructions given here.

In the following sections, we will give a short introduction. For a more thorough discussion, take a look at our Tutorials.

Running an Example

The easiest way to run a simulation is to run one of our predefined example files. We will run the file examples/fluid/hydrostatic_water_column_2d.jl, which simulates a fluid resting in a rectangular tank. Since TrixiParticles.jl uses multithreading, you should start Julia with the flag --threads auto (or, e.g. --threads 4 for 4 threads).

In the Julia REPL, first load the package TrixiParticles.jl.

julia> using TrixiParticles

Then start the simulation by executing

julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"))

This will open a new window with a 2D visualization of the final solution: plot_hydrostatic_water_column

For more information about visualization, see Visualization.

Running other Examples

You can find a list of our other predefined examples under Examples. Execute them as follows from the Julia REPL by replacing subfolder and example_name

julia> trixi_include(joinpath(examples_dir(), "subfolder", "example_name.jl"))

Modifying an example

You can pass keyword arguments to the function trixi_include to overwrite assignments in the file.

With trixi_include, we can overwrite variables defined in the example file to run a different simulation without modifying the example file.

julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"), initial_fluid_size=(1.0, 0.5))

This for example, will change the fluid size from $(0.9, 1.0)$ to $(1.0, 0.5)$.

To understand why, take a look into the file hydrostatic_water_column_2d.jl in the subfolder fluid inside the examples directory, which is the file that we executed earlier. You can see that the initial size of the fluid is defined in the variable initial_fluid_size, which we could overwrite with the trixi_include call above. Another variable that is worth experimenting with is fluid_particle_spacing, which controls the resolution of the simulation in this case. A lower value will increase the resolution and the runtime.

Set up you first simulation from scratch

See Set up your first simulation.

Find an overview over the available tutorials under Tutorials.

diff --git a/dev/index.html b/dev/index.html index d74065717..54f5235a5 100644 --- a/dev/index.html +++ b/dev/index.html @@ -16,4 +16,4 @@
Dam Break with Elastic Plate
-

Quickstart

  1. Installation
  2. Getting started

If you have any questions concerning TrixiParticles.jl you can join our community on Slack or open an issue with your question.

Start with development

To get started with development have a look at these pages:

  1. Installation
  2. Development
  3. Contributing
+

Quickstart

  1. Installation
  2. Getting started

If you have any questions concerning TrixiParticles.jl you can join our community on Slack or open an issue with your question.

Start with development

To get started with development have a look at these pages:

  1. Installation
  2. Development
  3. Contributing
diff --git a/dev/install/index.html b/dev/install/index.html index df9d9de5b..0449b8ae0 100644 --- a/dev/install/index.html +++ b/dev/install/index.html @@ -11,4 +11,4 @@ julia> Pkg.resolve() -julia> Pkg.instantiate() +julia> Pkg.instantiate() diff --git a/dev/license/index.html b/dev/license/index.html index da3dd0f94..4c4254bb3 100644 --- a/dev/license/index.html +++ b/dev/license/index.html @@ -1,2 +1,2 @@ -License · TrixiParticles.jl

License

MIT License

Copyright (c) 2023-present The TrixiParticles.jl Authors (see Authors)
Copyright (c) 2023-present Helmholtz-Zentrum hereon GmbH, Institute of Surface Science

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+License · TrixiParticles.jl

License

MIT License

Copyright (c) 2023-present The TrixiParticles.jl Authors (see Authors)
Copyright (c) 2023-present Helmholtz-Zentrum hereon GmbH, Institute of Surface Science

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/dev/news/index.html b/dev/news/index.html index c0a344adf..1e87af2fe 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -1,2 +1,2 @@ -News · TrixiParticles.jl

Changelog

TrixiParticles.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability. We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions.

Version 0.3.x

Highlights

Added

Removed

Deprecated

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
  • Flexible boundary conditions e.g. dummy particles with Adami pressure extrapolation, pressure zeroing, pressure mirroring...
  • Moving boundaries
  • Density diffusion based on the models by Molteni & Colagrossi (2009), Ferrari et al. (2009) and Antuono et al. (2010).

TLSPH

An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions).

+News · TrixiParticles.jl

Changelog

TrixiParticles.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability. We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions.

Version 0.3.x

Highlights

Added

Removed

Deprecated

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
  • Flexible boundary conditions e.g. dummy particles with Adami pressure extrapolation, pressure zeroing, pressure mirroring...
  • Moving boundaries
  • Density diffusion based on the models by Molteni & Colagrossi (2009), Ferrari et al. (2009) and Antuono et al. (2010).

TLSPH

An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions).

diff --git a/dev/objects.inv b/dev/objects.inv index dfa75e95de1da026bf03d3984945865c97e3058d..435e14fc2b36d7562e227a832508538a7645e790 100644 GIT binary patch delta 10 RcmaE__*!v-*G9jE0stJE1g8K1 delta 15 WcmaE@_+D{>7mIF6YS~7wg#rLHO$HMH diff --git a/dev/overview/index.html b/dev/overview/index.html index 12b09bc30..28567dc73 100644 --- a/dev/overview/index.html +++ b/dev/overview/index.html @@ -1,2 +1,2 @@ -Overview · TrixiParticles.jl

Overview

The following page gives a rough overview of important parts of the code.

Program flow

To initiate a simulation, the goal is to solve an ordinary differential equation, for example, by employing the time integration schemes provided by OrdinaryDiffEq.jl. These schemes are then utilized to integrate $\mathrm{d}u/\mathrm{d}t$ and $\mathrm{d}v/\mathrm{d}t$, where $u$ represents the particles' positions and $v$ their properties such as velocity and density. During a single time step or an intermediate step of the time integration scheme, the functions drift! and kick! are invoked, followed by the functions depicted in this diagram (with key parts highlighted in orange/yellow).

Main Program Flow

Structure

What we refer to as schemes are various models such as Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH) or Total Lagrangian Smoothed Particle Hydrodynamics (TLSPH). These schemes are categorized based on the applicable physical regimes, namely fluid, solid, gas, and others. Each scheme comprises at least two files: a system.jl file and an rhs.jl file. The system.jl file provides the data structure holding the particles of this scheme and some routines, particularly those for allocation and the main update routines, excluding system interactions. The interactions between particles of this scheme (and with particles of other schemes) are handled in the rhs.jl file.

+Overview · TrixiParticles.jl

Overview

The following page gives a rough overview of important parts of the code.

Program flow

To initiate a simulation, the goal is to solve an ordinary differential equation, for example, by employing the time integration schemes provided by OrdinaryDiffEq.jl. These schemes are then utilized to integrate $\mathrm{d}u/\mathrm{d}t$ and $\mathrm{d}v/\mathrm{d}t$, where $u$ represents the particles' positions and $v$ their properties such as velocity and density. During a single time step or an intermediate step of the time integration scheme, the functions drift! and kick! are invoked, followed by the functions depicted in this diagram (with key parts highlighted in orange/yellow).

Main Program Flow

Structure

What we refer to as schemes are various models such as Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH) or Total Lagrangian Smoothed Particle Hydrodynamics (TLSPH). These schemes are categorized based on the applicable physical regimes, namely fluid, solid, gas, and others. Each scheme comprises at least two files: a system.jl file and an rhs.jl file. The system.jl file provides the data structure holding the particles of this scheme and some routines, particularly those for allocation and the main update routines, excluding system interactions. The interactions between particles of this scheme (and with particles of other schemes) are handled in the rhs.jl file.

diff --git a/dev/preprocessing/preprocessing/index.html b/dev/preprocessing/preprocessing/index.html index a52d5092a..c9836789b 100644 --- a/dev/preprocessing/preprocessing/index.html +++ b/dev/preprocessing/preprocessing/index.html @@ -1,3 +1,3 @@ -Sample Geometries · TrixiParticles.jl

TODO

TrixiParticles.WindingNumberHormanType
WindingNumberHorman()

Algorithm for inside-outside segmentation of a complex geometry proposed by Horman et al. (2001). It is only supported for 2D geometries. WindingNumberHorman might handle edge cases a bit better, since the winding number is an integer value. Also, it is faster than WindingNumberJacobson for 2D geometries with more than about 100 edges.

Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.WindingNumberJacobsonType
WindingNumberJacobson(; geometry=nothing, winding_number_factor=sqrt(eps()),
-                      hierarchical_winding=false)

Algorithm for inside-outside segmentation of a complex geometry proposed by Jacobson et al. (2013).

Keywords

  • geometry: Complex geometry returned by load_geometry and is only required when using hierarchical_winding=true.
  • hierarchical_winding: If set to true, an optimized hierarchical approach will be used, which gives a significant speedup.
  • winding_number_factor: For leaky geometries, a factor of 0.4 will give a better inside-outside segmentation.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.load_geometryMethod
load_geometry(filename; element_type=Float64)

Load file and return corresponding type for ComplexShape. Supported file formats are .stl and .asc.

Arguments

  • filename: Name of the file to be loaded.

Keywords

  • element_type: Element type (default is Float64)
source

References

  • Alec Jacobson, Ladislav Kavan, and Olga Sorkine-Hornung "Robust inside-outside segmentation using generalized winding numbers". In: ACM Transactions on Graphics, 32.4 (2013), pages 1–12. doi: 10.1145/2461912.2461916
  • Kai Horman, Alexander Agathos "The point in polygon problem for arbitrary polygons". In: Computational Geometry, 20.3 (2001), pages 131–144. doi: 10.1016/s0925-7721(01)00012-8
+Sample Geometries · TrixiParticles.jl

TODO

TrixiParticles.WindingNumberHormanType
WindingNumberHorman()

Algorithm for inside-outside segmentation of a complex geometry proposed by Horman et al. (2001). It is only supported for 2D geometries. WindingNumberHorman might handle edge cases a bit better, since the winding number is an integer value. Also, it is faster than WindingNumberJacobson for 2D geometries with more than about 100 edges.

Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.WindingNumberJacobsonType
WindingNumberJacobson(; geometry=nothing, winding_number_factor=sqrt(eps()),
+                      hierarchical_winding=false)

Algorithm for inside-outside segmentation of a complex geometry proposed by Jacobson et al. (2013).

Keywords

  • geometry: Complex geometry returned by load_geometry and is only required when using hierarchical_winding=true.
  • hierarchical_winding: If set to true, an optimized hierarchical approach will be used, which gives a significant speedup.
  • winding_number_factor: For leaky geometries, a factor of 0.4 will give a better inside-outside segmentation.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.load_geometryMethod
load_geometry(filename; element_type=Float64)

Load file and return corresponding type for ComplexShape. Supported file formats are .stl and .asc.

Arguments

  • filename: Name of the file to be loaded.

Keywords

  • element_type: Element type (default is Float64)
source

References

  • Alec Jacobson, Ladislav Kavan, and Olga Sorkine-Hornung "Robust inside-outside segmentation using generalized winding numbers". In: ACM Transactions on Graphics, 32.4 (2013), pages 1–12. doi: 10.1145/2461912.2461916
  • Kai Horman, Alexander Agathos "The point in polygon problem for arbitrary polygons". In: Computational Geometry, 20.3 (2001), pages 131–144. doi: 10.1016/s0925-7721(01)00012-8
diff --git a/dev/reference-pointneighbors/index.html b/dev/reference-pointneighbors/index.html index f80bf95a7..431ee8fd3 100644 --- a/dev/reference-pointneighbors/index.html +++ b/dev/reference-pointneighbors/index.html @@ -16,4 +16,4 @@ # output GridNeighborhoodSearch{2, Float64, ...}(...)source
PointNeighbors.foreach_point_neighborMethod
foreach_point_neighbor(f, system_coords, neighbor_coords, neighborhood_search;
-                       points = axes(system_coords, 2), parallel = true)

Loop for each point in system_coords over all points in neighbor_coords whose distances to that point are smaller than the search radius and execute the function f(i, j, x, y, d), where

  • i is the column index of the point in system_coords,
  • j the column index of the neighbor in neighbor_coords,
  • x an SVector of the coordinates of the point (system_coords[:, i]),
  • y an SVector of the coordinates of the neighbor (neighbor_coords[:, j]),
  • d the distance between x and y.

The neighborhood_search must have been initialized or updated with system_coords as first coordinate array and neighbor_coords as second coordinate array.

Note that system_coords and neighbor_coords can be identical.

Arguments

  • f: The function explained above.
  • system_coords: A matrix where the i-th column contains the coordinates of point i.
  • neighbor_coords: A matrix where the j-th column contains the coordinates of point j.
  • neighborhood_search: A neighborhood search initialized or updated with system_coords as first coordinate array and neighbor_coords as second coordinate array.

Keywords

  • points: Loop over these point indices. By default all columns of system_coords.
  • parallel=true: Run the outer loop over points thread-parallel.

See also initialize!, update!.

source
PointNeighbors.initialize!Method
initialize!(search::AbstractNeighborhoodSearch, x, y)

Initialize a neighborhood search with the two coordinate arrays x and y.

In general, the purpose of a neighborhood search is to find for one point in x all points in y whose distances to that point are smaller than the search radius. x and y are expected to be matrices, where the i-th column contains the coordinates of point i. Note that x and y can be identical.

See also update!.

source
PointNeighbors.update!Method
update!(search::AbstractNeighborhoodSearch, x, y; points_moving = (true, true))

Update an already initialized neighborhood search with the two coordinate arrays x and y.

Like initialize!, but reusing the existing data structures of the already initialized neighborhood search. When the points only moved a small distance since the last update! or initialize!, this is significantly faster than initialize!.

Not all implementations support incremental updates. If incremental updates are not possible for an implementation, update! will fall back to a regular initialize!.

Some neighborhood searches might not need to update when only x changed since the last update! or initialize! and y did not change. Pass points_moving = (true, false) in this case to avoid unnecessary updates. The first flag in points_moving indicates if points in x are moving. The second flag indicates if points in y are moving.

Experimental Feature: Backend Specification

The keyword argument parallelization_backend allows users to specify the multithreading backend. This feature is currently considered experimental!

Possible parallelization backends are:

See also initialize!.

source
PointNeighbors.@threadedMacro
@threaded x for ... end

Run either a threaded CPU loop or launch a kernel on the GPU, depending on the type of x. Semantically the same as Threads.@threads when iterating over a AbstractUnitRange but without guarantee that the underlying implementation uses Threads.@threads or works for more general for loops.

The first argument must either be a parallelization backend (see below) or an array from which the backend can be derived to determine if the loop must be run threaded on the CPU or launched as a kernel on the GPU. Passing KernelAbstractions.CPU() will run the GPU kernel on the CPU.

Possible parallelization backends are:

In particular, the underlying threading capabilities might be provided by other packages such as Polyester.jl.

Warning

This macro does not necessarily work for general for loops. For example, it does not necessarily support general iterables such as eachline(filename).

source
+ points = axes(system_coords, 2), parallel = true)

Loop for each point in system_coords over all points in neighbor_coords whose distances to that point are smaller than the search radius and execute the function f(i, j, x, y, d), where

The neighborhood_search must have been initialized or updated with system_coords as first coordinate array and neighbor_coords as second coordinate array.

Note that system_coords and neighbor_coords can be identical.

Arguments

Keywords

See also initialize!, update!.

source
PointNeighbors.initialize!Method
initialize!(search::AbstractNeighborhoodSearch, x, y)

Initialize a neighborhood search with the two coordinate arrays x and y.

In general, the purpose of a neighborhood search is to find for one point in x all points in y whose distances to that point are smaller than the search radius. x and y are expected to be matrices, where the i-th column contains the coordinates of point i. Note that x and y can be identical.

See also update!.

source
PointNeighbors.update!Method
update!(search::AbstractNeighborhoodSearch, x, y; points_moving = (true, true))

Update an already initialized neighborhood search with the two coordinate arrays x and y.

Like initialize!, but reusing the existing data structures of the already initialized neighborhood search. When the points only moved a small distance since the last update! or initialize!, this is significantly faster than initialize!.

Not all implementations support incremental updates. If incremental updates are not possible for an implementation, update! will fall back to a regular initialize!.

Some neighborhood searches might not need to update when only x changed since the last update! or initialize! and y did not change. Pass points_moving = (true, false) in this case to avoid unnecessary updates. The first flag in points_moving indicates if points in x are moving. The second flag indicates if points in y are moving.

Experimental Feature: Backend Specification

The keyword argument parallelization_backend allows users to specify the multithreading backend. This feature is currently considered experimental!

Possible parallelization backends are:

See also initialize!.

source
PointNeighbors.@threadedMacro
@threaded x for ... end

Run either a threaded CPU loop or launch a kernel on the GPU, depending on the type of x. Semantically the same as Threads.@threads when iterating over a AbstractUnitRange but without guarantee that the underlying implementation uses Threads.@threads or works for more general for loops.

The first argument must either be a parallelization backend (see below) or an array from which the backend can be derived to determine if the loop must be run threaded on the CPU or launched as a kernel on the GPU. Passing KernelAbstractions.CPU() will run the GPU kernel on the CPU.

Possible parallelization backends are:

In particular, the underlying threading capabilities might be provided by other packages such as Polyester.jl.

Warning

This macro does not necessarily work for general for loops. For example, it does not necessarily support general iterables such as eachline(filename).

source
diff --git a/dev/reference-trixibase/index.html b/dev/reference-trixibase/index.html index c3b1e8149..7d057c722 100644 --- a/dev/reference-trixibase/index.html +++ b/dev/reference-trixibase/index.html @@ -7,4 +7,4 @@ sol.t[end] end [ Info: You just called `trixi_include`. Julia may now compile the code, please be patient. -0.1source
TrixiBase.@trixi_timeitMacro
@trixi_timeit timer() "some label" expression

Basically the same as a special case of @timeit_debug from TimerOutputs.jl, but without try ... finally ... end block. Thus, it's not exception-safe, but it also avoids some related performance problems. Since we do not use exception handling in Trixi.jl, that's not really an issue.

All @trixi_timeit timings can be disabled with disable_debug_timings. The timings should then be optimized away, allowing for truly zero-overhead.

See also disable_debug_timings, enable_debug_timings.

source
+0.1source
TrixiBase.@trixi_timeitMacro
@trixi_timeit timer() "some label" expression

Basically the same as a special case of @timeit_debug from TimerOutputs.jl, but without try ... finally ... end block. Thus, it's not exception-safe, but it also avoids some related performance problems. Since we do not use exception handling in Trixi.jl, that's not really an issue.

All @trixi_timeit timings can be disabled with disable_debug_timings. The timings should then be optimized away, allowing for truly zero-overhead.

See also disable_debug_timings, enable_debug_timings.

source
diff --git a/dev/systems/boundary/index.html b/dev/systems/boundary/index.html index 04e45ec1f..4565345e0 100644 --- a/dev/systems/boundary/index.html +++ b/dev/systems/boundary/index.html @@ -1,8 +1,8 @@ -Boundary · TrixiParticles.jl

Boundary System

TrixiParticles.BoundarySPHSystemType
BoundarySPHSystem(initial_condition, boundary_model; movement=nothing, adhesion_coefficient=0.0)

System for boundaries modeled by boundary particles. The interaction between fluid and boundary particles is specified by the boundary model.

Arguments

Keyword Arguments

  • movement: For moving boundaries, a BoundaryMovement can be passed.
  • adhesion_coefficient: Coefficient specifying the adhesion of a fluid to the surface. Note: currently it is assumed that all fluids have the same adhesion coefficient.
source
TrixiParticles.BoundaryDEMSystemType
BoundaryDEMSystem(initial_condition, normal_stiffness)

System for boundaries modeled by boundary particles. The interaction between fluid and boundary particles is specified by the boundary model.

Experimental Implementation

This is an experimental feature and may change in a future releases.

source
TrixiParticles.BoundaryMovementType
BoundaryMovement(movement_function, is_moving; moving_particles=nothing)

Arguments

  • movement_function: Time-dependent function returning an SVector of $d$ dimensions for a $d$-dimensional problem.
  • is_moving: Function to determine in each timestep if the particles are moving or not. Its boolean return value is mandatory to determine if the neighborhood search will be updated.

Keyword Arguments

  • moving_particles: Indices of moving particles. Default is each particle in BoundarySPHSystem.

In the example below, movement describes particles moving in a circle as long as the time is lower than 1.5.

Examples

movement_function(t) = SVector(cos(2pi*t), sin(2pi*t))
+Boundary · TrixiParticles.jl

Boundary System

TrixiParticles.BoundarySPHSystemType
BoundarySPHSystem(initial_condition, boundary_model; movement=nothing, adhesion_coefficient=0.0)

System for boundaries modeled by boundary particles. The interaction between fluid and boundary particles is specified by the boundary model.

Arguments

Keyword Arguments

  • movement: For moving boundaries, a BoundaryMovement can be passed.
  • adhesion_coefficient: Coefficient specifying the adhesion of a fluid to the surface. Note: currently it is assumed that all fluids have the same adhesion coefficient.
source
TrixiParticles.BoundaryDEMSystemType
BoundaryDEMSystem(initial_condition, normal_stiffness)

System for boundaries modeled by boundary particles. The interaction between fluid and boundary particles is specified by the boundary model.

Experimental Implementation

This is an experimental feature and may change in a future releases.

source
TrixiParticles.BoundaryMovementType
BoundaryMovement(movement_function, is_moving; moving_particles=nothing)

Arguments

  • movement_function: Time-dependent function returning an SVector of $d$ dimensions for a $d$-dimensional problem.
  • is_moving: Function to determine in each timestep if the particles are moving or not. Its boolean return value is mandatory to determine if the neighborhood search will be updated.

Keyword Arguments

  • moving_particles: Indices of moving particles. Default is each particle in BoundarySPHSystem.

In the example below, movement describes particles moving in a circle as long as the time is lower than 1.5.

Examples

movement_function(t) = SVector(cos(2pi*t), sin(2pi*t))
 is_moving(t) = t < 1.5
 
-movement = BoundaryMovement(movement_function, is_moving)
source

Boundary Models

Dummy Particles

Boundaries modeled as dummy particles, which are treated like fluid particles, but their positions and velocities are not evolved in time. Since the force towards the fluid should not change with the material density when used with a TotalLagrangianSPHSystem, the dummy particles need to have a mass corresponding to the fluid's rest density, which we call "hydrodynamic mass", as opposed to mass corresponding to the material density of a TotalLagrangianSPHSystem.

Here, initial_density and hydrodynamic_mass are vectors that contains the initial density and the hydrodynamic mass respectively for each boundary particle. Note that when used with SummationDensity (see below), this is only used to determine the element type and the number of boundary particles.

To establish a relationship between density and pressure, a state_equation has to be passed, which should be the same as for the adjacent fluid systems. To sum over neighboring particles, a smoothing_kernel and smoothing_length needs to be passed. This should be the same as for the adjacent fluid system with the largest smoothing length.

In the literature, this kind of boundary particles is referred to as "dummy particles" (Adami et al., 2012 and Valizadeh & Monaghan, 2015), "frozen fluid particles" (Akinci et al., 2012) or "dynamic boundaries (Crespo et al., 2007). The key detail of this boundary condition and the only difference between the boundary models in these references is the way the density and pressure of boundary particles is computed.

Since boundary particles are treated like fluid particles, the force on fluid particle $a$ due to boundary particle $b$ is given by

\[f_{ab} = m_a m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_b}{\rho_b^2} \right) \nabla_{r_a} W(\Vert r_a - r_b \Vert, h).\]

The quantities to be defined here are the density $\rho_b$ and pressure $p_b$ of the boundary particle $b$.

Boundary Models

Dummy Particles

Boundaries modeled as dummy particles, which are treated like fluid particles, but their positions and velocities are not evolved in time. Since the force towards the fluid should not change with the material density when used with a TotalLagrangianSPHSystem, the dummy particles need to have a mass corresponding to the fluid's rest density, which we call "hydrodynamic mass", as opposed to mass corresponding to the material density of a TotalLagrangianSPHSystem.

Here, initial_density and hydrodynamic_mass are vectors that contains the initial density and the hydrodynamic mass respectively for each boundary particle. Note that when used with SummationDensity (see below), this is only used to determine the element type and the number of boundary particles.

To establish a relationship between density and pressure, a state_equation has to be passed, which should be the same as for the adjacent fluid systems. To sum over neighboring particles, a smoothing_kernel and smoothing_length needs to be passed. This should be the same as for the adjacent fluid system with the largest smoothing length.

In the literature, this kind of boundary particles is referred to as "dummy particles" (Adami et al., 2012 and Valizadeh & Monaghan, 2015), "frozen fluid particles" (Akinci et al., 2012) or "dynamic boundaries (Crespo et al., 2007). The key detail of this boundary condition and the only difference between the boundary models in these references is the way the density and pressure of boundary particles is computed.

Since boundary particles are treated like fluid particles, the force on fluid particle $a$ due to boundary particle $b$ is given by

\[f_{ab} = m_a m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_b}{\rho_b^2} \right) \nabla_{r_a} W(\Vert r_a - r_b \Vert, h).\]

The quantities to be defined here are the density $\rho_b$ and pressure $p_b$ of the boundary particle $b$.

TrixiParticles.BoundaryModelDummyParticlesType
BoundaryModelDummyParticles(initial_density, hydrodynamic_mass,
                             density_calculator, smoothing_kernel,
                             smoothing_length; viscosity=nothing,
                             state_equation=nothing, correction=nothing)

Boundary model for BoundarySPHSystem.

Arguments

  • initial_density: Vector holding the initial density of each boundary particle.
  • hydrodynamic_mass: Vector holding the "hydrodynamic mass" of each boundary particle. See description above for more information.
  • density_calculator: Strategy to compute the hydrodynamic density of the boundary particles. See description below for more information.
  • smoothing_kernel: Smoothing kernel should be the same as for the adjacent fluid system.
  • smoothing_length: Smoothing length should be the same as for the adjacent fluid system.

Keywords

  • state_equation: This should be the same as for the adjacent fluid system (see e.g. StateEquationCole).
  • correction: Correction method of the adjacent fluid system (see Corrections).
  • viscosity: Slip (default) or no-slip condition. See description below for further information.

Examples

# Free-slip condition
@@ -12,19 +12,19 @@
 # No-slip condition
 boundary_model = BoundaryModelDummyParticles(densities, masses, AdamiPressureExtrapolation(),
                                              smoothing_kernel, smoothing_length,
-                                             viscosity=ViscosityAdami(nu=1e-6))
source

Hydrodynamic density of dummy particles

We provide five options to compute the boundary density and pressure, determined by the density_calculator:

  1. (Recommended) With AdamiPressureExtrapolation, the pressure is extrapolated from the pressure of the fluid according to (Adami et al., 2012), and the density is obtained by applying the inverse of the state equation. This option usually yields the best results of the options listed here.
  2. With SummationDensity, the density is calculated by summation over the neighboring particles, and the pressure is computed from the density with the state equation.
  3. With ContinuityDensity, the density is integrated from the continuity equation, and the pressure is computed from the density with the state equation. Note that this causes a gap between fluid and boundary where the boundary is initialized without any contact to the fluid. This is due to overestimation of the boundary density as soon as the fluid comes in contact with boundary particles that initially did not have contact to the fluid. Therefore, in dam break simulations, there is a visible "step", even though the boundary is supposed to be flat. See also dual.sphysics.org/faq/#Q_13.
  4. With PressureZeroing, the density is set to the reference density and the pressure is computed from the density with the state equation. This option is not recommended. The other options yield significantly better results.
  5. With PressureMirroring, the density is set to the reference density. The pressure is not used. Instead, the fluid pressure is mirrored as boundary pressure in the momentum equation. This option is not recommended due to stability issues. See PressureMirroring for more details.

1. AdamiPressureExtrapolation

The pressure of the boundary particles is obtained by extrapolating the pressure of the fluid according to (Adami et al., 2012). The pressure of a boundary particle $b$ is given by

\[p_b = \frac{\sum_f (p_f + \rho_f (\bm{g} - \bm{a}_b) \cdot \bm{r}_{bf}) W(\Vert r_{bf} \Vert, h)}{\sum_f W(\Vert r_{bf} \Vert, h)},\]

where the sum is over all fluid particles, $\rho_f$ and $p_f$ denote the density and pressure of fluid particle $f$, respectively, $r_{bf} = r_b - r_f$ denotes the difference of the coordinates of particles $b$ and $f$, $\bm{g}$ denotes the gravitational acceleration acting on the fluid, and $\bm{a}_b$ denotes the acceleration of the boundary particle $b$.

4. PressureZeroing

This is the simplest way to implement dummy boundary particles. The density of each particle is set to the reference density and the pressure to the reference pressure (the corresponding pressure to the reference density by the state equation).

TrixiParticles.PressureZeroingType
PressureZeroing()

density_calculator for BoundaryModelDummyParticles.

Note

This boundary model produces significantly worse results than all other models and is only included for research purposes.

source

5. PressureMirroring

Instead of calculating density and pressure for each boundary particle, we modify the momentum equation,

\[\frac{\mathrm{d}v_a}{\mathrm{d}t} = -\sum_b m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_b}{\rho_b^2} \right) \nabla_a W_{ab}\]

to replace the unknown density $\rho_b$ if $b$ is a boundary particle by the reference density and the unknown pressure $p_b$ if $b$ is a boundary particle by the pressure $p_a$ of the interacting fluid particle. The momentum equation therefore becomes

\[\frac{\mathrm{d}v_a}{\mathrm{d}t} = -\sum_f m_f \left( \frac{p_a}{\rho_a^2} + \frac{p_f}{\rho_f^2} \right) \nabla_a W_{af} --\sum_b m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_a}{\rho_0^2} \right) \nabla_a W_{ab},\]

where the first sum is over all fluid particles and the second over all boundary particles.

This approach was first mentioned by Akinci et al. (2012) and written down in this form by Band et al. (2018).

TrixiParticles.PressureMirroringType
PressureMirroring()

density_calculator for BoundaryModelDummyParticles.

Note

This boundary model requires high viscosity for stability with WCSPH. It also produces significantly worse results than AdamiPressureExtrapolation and is not more efficient because smaller time steps are required due to more noise in the pressure. We added this model only for research purposes and for comparison with SPlisHSPlasH.

source

No-slip conditions

For the interaction of dummy particles and fluid particles, Adami et al. (2012) impose a no-slip boundary condition by assigning a wall velocity $v_w$ to the dummy particle.

The wall velocity of particle $a$ is calculated from the prescribed boundary particle velocity $v_a$ and the smoothed velocity field

\[v_w = 2 v_a - \frac{\sum_b v_b W_{ab}}{\sum_b W_{ab}},\]

where the sum is over all fluid particles.

By choosing the viscosity model ViscosityAdami for viscosity, a no-slip condition is imposed. It is recommended to choose nu in the order of either the kinematic viscosity parameter of the adjacent fluid or the equivalent from the artificial parameter alpha of the adjacent fluid ($\nu = \frac{\alpha h c }{2d + 4}$). When omitting the viscous interaction (default viscosity=nothing), a free-slip wall boundary condition is applied.

Warning

The viscosity model ArtificialViscosityMonaghan for BoundaryModelDummyParticles has not been verified yet.

References

  • S. Adami, X. Y. Hu, N. A. Adams. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231, 21 (2012), pages 7057–7075. doi: 10.1016/J.JCP.2012.05.005
  • Alireza Valizadeh, Joseph J. Monaghan. "A study of solid wall models for weakly compressible SPH". In: Journal of Computational Physics 300 (2015), pages 5–19. doi: 10.1016/J.JCP.2015.07.033
  • Nadir Akinci, Markus Ihmsen, Gizem Akinci, Barbara Solenthaler, Matthias Teschner. "Versatile rigid-fluid coupling for incompressible SPH". ACM Transactions on Graphics 31, 4 (2012), pages 1–8. doi: 10.1145/2185520.2185558
  • A. J. C. Crespo, M. Gómez-Gesteira, R. A. Dalrymple. "Boundary conditions generated by dynamic particles in SPH methods" In: Computers, Materials and Continua 5 (2007), pages 173-184. doi: 10.3970/cmc.2007.005.173
  • Stefan Band, Christoph Gissler, Andreas Peer, and Matthias Teschner. "MLS Pressure Boundaries for Divergence-Free and Viscous SPH Fluids." In: Computers & Graphics 76 (2018), pages 37–46. doi: 10.1016/j.cag.2018.08.001

Repulsive Particles

Boundaries modeled as boundary particles which exert forces on the fluid particles (Monaghan, Kajtar, 2009). The force on fluid particle $a$ due to boundary particle $b$ is given by

\[f_{ab} = m_a \left(\tilde{f}_{ab} - m_b \Pi_{ab} \nabla_{r_a} W(\Vert r_a - r_b \Vert, h)\right)\]

with

\[\tilde{f}_{ab} = \frac{K}{\beta^{n-1}} \frac{r_{ab}}{\Vert r_{ab} \Vert (\Vert r_{ab} \Vert - d)} \Phi(\Vert r_{ab} \Vert, h) + viscosity=ViscosityAdami(nu=1e-6))

source

Hydrodynamic density of dummy particles

We provide five options to compute the boundary density and pressure, determined by the density_calculator:

  1. (Recommended) With AdamiPressureExtrapolation, the pressure is extrapolated from the pressure of the fluid according to (Adami et al., 2012), and the density is obtained by applying the inverse of the state equation. This option usually yields the best results of the options listed here.
  2. With SummationDensity, the density is calculated by summation over the neighboring particles, and the pressure is computed from the density with the state equation.
  3. With ContinuityDensity, the density is integrated from the continuity equation, and the pressure is computed from the density with the state equation. Note that this causes a gap between fluid and boundary where the boundary is initialized without any contact to the fluid. This is due to overestimation of the boundary density as soon as the fluid comes in contact with boundary particles that initially did not have contact to the fluid. Therefore, in dam break simulations, there is a visible "step", even though the boundary is supposed to be flat. See also dual.sphysics.org/faq/#Q_13.
  4. With PressureZeroing, the density is set to the reference density and the pressure is computed from the density with the state equation. This option is not recommended. The other options yield significantly better results.
  5. With PressureMirroring, the density is set to the reference density. The pressure is not used. Instead, the fluid pressure is mirrored as boundary pressure in the momentum equation. This option is not recommended due to stability issues. See PressureMirroring for more details.

1. AdamiPressureExtrapolation

The pressure of the boundary particles is obtained by extrapolating the pressure of the fluid according to (Adami et al., 2012). The pressure of a boundary particle $b$ is given by

\[p_b = \frac{\sum_f (p_f + \rho_f (\bm{g} - \bm{a}_b) \cdot \bm{r}_{bf}) W(\Vert r_{bf} \Vert, h)}{\sum_f W(\Vert r_{bf} \Vert, h)},\]

where the sum is over all fluid particles, $\rho_f$ and $p_f$ denote the density and pressure of fluid particle $f$, respectively, $r_{bf} = r_b - r_f$ denotes the difference of the coordinates of particles $b$ and $f$, $\bm{g}$ denotes the gravitational acceleration acting on the fluid, and $\bm{a}_b$ denotes the acceleration of the boundary particle $b$.

4. PressureZeroing

This is the simplest way to implement dummy boundary particles. The density of each particle is set to the reference density and the pressure to the reference pressure (the corresponding pressure to the reference density by the state equation).

TrixiParticles.PressureZeroingType
PressureZeroing()

density_calculator for BoundaryModelDummyParticles.

Note

This boundary model produces significantly worse results than all other models and is only included for research purposes.

source

5. PressureMirroring

Instead of calculating density and pressure for each boundary particle, we modify the momentum equation,

\[\frac{\mathrm{d}v_a}{\mathrm{d}t} = -\sum_b m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_b}{\rho_b^2} \right) \nabla_a W_{ab}\]

to replace the unknown density $\rho_b$ if $b$ is a boundary particle by the reference density and the unknown pressure $p_b$ if $b$ is a boundary particle by the pressure $p_a$ of the interacting fluid particle. The momentum equation therefore becomes

\[\frac{\mathrm{d}v_a}{\mathrm{d}t} = -\sum_f m_f \left( \frac{p_a}{\rho_a^2} + \frac{p_f}{\rho_f^2} \right) \nabla_a W_{af} +-\sum_b m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_a}{\rho_0^2} \right) \nabla_a W_{ab},\]

where the first sum is over all fluid particles and the second over all boundary particles.

This approach was first mentioned by Akinci et al. (2012) and written down in this form by Band et al. (2018).

TrixiParticles.PressureMirroringType
PressureMirroring()

density_calculator for BoundaryModelDummyParticles.

Note

This boundary model requires high viscosity for stability with WCSPH. It also produces significantly worse results than AdamiPressureExtrapolation and is not more efficient because smaller time steps are required due to more noise in the pressure. We added this model only for research purposes and for comparison with SPlisHSPlasH.

source

No-slip conditions

For the interaction of dummy particles and fluid particles, Adami et al. (2012) impose a no-slip boundary condition by assigning a wall velocity $v_w$ to the dummy particle.

The wall velocity of particle $a$ is calculated from the prescribed boundary particle velocity $v_a$ and the smoothed velocity field

\[v_w = 2 v_a - \frac{\sum_b v_b W_{ab}}{\sum_b W_{ab}},\]

where the sum is over all fluid particles.

By choosing the viscosity model ViscosityAdami for viscosity, a no-slip condition is imposed. It is recommended to choose nu in the order of either the kinematic viscosity parameter of the adjacent fluid or the equivalent from the artificial parameter alpha of the adjacent fluid ($\nu = \frac{\alpha h c }{2d + 4}$). When omitting the viscous interaction (default viscosity=nothing), a free-slip wall boundary condition is applied.

Warning

The viscosity model ArtificialViscosityMonaghan for BoundaryModelDummyParticles has not been verified yet.

References

  • S. Adami, X. Y. Hu, N. A. Adams. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231, 21 (2012), pages 7057–7075. doi: 10.1016/J.JCP.2012.05.005
  • Alireza Valizadeh, Joseph J. Monaghan. "A study of solid wall models for weakly compressible SPH". In: Journal of Computational Physics 300 (2015), pages 5–19. doi: 10.1016/J.JCP.2015.07.033
  • Nadir Akinci, Markus Ihmsen, Gizem Akinci, Barbara Solenthaler, Matthias Teschner. "Versatile rigid-fluid coupling for incompressible SPH". ACM Transactions on Graphics 31, 4 (2012), pages 1–8. doi: 10.1145/2185520.2185558
  • A. J. C. Crespo, M. Gómez-Gesteira, R. A. Dalrymple. "Boundary conditions generated by dynamic particles in SPH methods" In: Computers, Materials and Continua 5 (2007), pages 173-184. doi: 10.3970/cmc.2007.005.173
  • Stefan Band, Christoph Gissler, Andreas Peer, and Matthias Teschner. "MLS Pressure Boundaries for Divergence-Free and Viscous SPH Fluids." In: Computers & Graphics 76 (2018), pages 37–46. doi: 10.1016/j.cag.2018.08.001

Repulsive Particles

Boundaries modeled as boundary particles which exert forces on the fluid particles (Monaghan, Kajtar, 2009). The force on fluid particle $a$ due to boundary particle $b$ is given by

\[f_{ab} = m_a \left(\tilde{f}_{ab} - m_b \Pi_{ab} \nabla_{r_a} W(\Vert r_a - r_b \Vert, h)\right)\]

with

\[\tilde{f}_{ab} = \frac{K}{\beta^{n-1}} \frac{r_{ab}}{\Vert r_{ab} \Vert (\Vert r_{ab} \Vert - d)} \Phi(\Vert r_{ab} \Vert, h) \frac{2 m_b}{m_a + m_b},\]

where $m_a$ and $m_b$ are the masses of fluid particle $a$ and boundary particle $b$ respectively, $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$, $d$ denotes the boundary particle spacing and $n$ denotes the number of dimensions (see (Monaghan, Kajtar, 2009, Equation (3.1)) and (Valizadeh, Monaghan, 2015)). Note that the repulsive acceleration $\tilde{f}_{ab}$ does not depend on the masses of the boundary particles. Here, $\Phi$ denotes the 1D Wendland C4 kernel, normalized to $1.77$ for $q=0$ (Monaghan, Kajtar, 2009, Section 4), with $\Phi(r, h) = w(r/h)$ and

\[w(q) = \begin{cases} (1.77/32) (1 + (5/2)q + 2q^2)(2 - q)^5 & \text{if } 0 \leq q < 2 \\ 0 & \text{if } q \geq 2. \end{cases}\]

The boundary particles are assumed to have uniform spacing by the factor $\beta$ smaller than the expected fluid particle spacing. For example, if the fluid particles have an expected spacing of $0.3$ and the boundary particles have a uniform spacing of $0.1$, then this parameter should be set to $\beta = 3$. According to (Monaghan, Kajtar, 2009), a value of $\beta = 3$ for the Wendland C4 that we use here is reasonable for most computing purposes.

The parameter $K$ is used to scale the force exerted by the boundary particles. In (Monaghan, Kajtar, 2009), a value of $gD$ is used for static tank simulations, where $g$ is the gravitational acceleration and $D$ is the depth of the fluid.

The viscosity $\Pi_{ab}$ is calculated according to the viscosity used in the simulation, where the density of the boundary particle if needed is assumed to be identical to the density of the fluid particle.

No-slip condition

By choosing the viscosity model ArtificialViscosityMonaghan for viscosity, a no-slip condition is imposed. When omitting the viscous interaction (default viscosity=nothing), a free-slip wall boundary condition is applied.

Warning

The no-slip conditions for BoundaryModelMonaghanKajtar have not been verified yet.

TrixiParticles.BoundaryModelMonaghanKajtarType
BoundaryModelMonaghanKajtar(K, beta, boundary_particle_spacing, mass;
-                            viscosity=nothing)

Boundary model for BoundarySPHSystem.

Arguments

  • K: Scaling factor for repulsive force.
  • beta: Ratio of fluid particle spacing to boundary particle spacing.
  • boundary_particle_spacing: Boundary particle spacing.
  • mass: Vector holding the mass of each boundary particle.

Keywords

  • viscosity: Free-slip (default) or no-slip condition. See description above for further information.
source

References

  • Joseph J. Monaghan, Jules B. Kajtar. "SPH particle boundary forces for arbitrary boundaries". In: Computer Physics Communications 180.10 (2009), pages 1811–1820. doi: 10.1016/j.cpc.2009.05.008
  • Alireza Valizadeh, Joseph J. Monaghan. "A study of solid wall models for weakly compressible SPH." In: Journal of Computational Physics 300 (2015), pages 5–19. doi: 10.1016/J.JCP.2015.07.033

Open Boundaries

TrixiParticles.OpenBoundarySPHSystemType
OpenBoundarySPHSystem(boundary_zone::Union{InFlow, OutFlow}; sound_speed,
+                            viscosity=nothing)

Boundary model for BoundarySPHSystem.

Arguments

  • K: Scaling factor for repulsive force.
  • beta: Ratio of fluid particle spacing to boundary particle spacing.
  • boundary_particle_spacing: Boundary particle spacing.
  • mass: Vector holding the mass of each boundary particle.

Keywords

  • viscosity: Free-slip (default) or no-slip condition. See description above for further information.
source

References

  • Joseph J. Monaghan, Jules B. Kajtar. "SPH particle boundary forces for arbitrary boundaries". In: Computer Physics Communications 180.10 (2009), pages 1811–1820. doi: 10.1016/j.cpc.2009.05.008
  • Alireza Valizadeh, Joseph J. Monaghan. "A study of solid wall models for weakly compressible SPH." In: Journal of Computational Physics 300 (2015), pages 5–19. doi: 10.1016/J.JCP.2015.07.033

Open Boundaries

TrixiParticles.OpenBoundarySPHSystemType
OpenBoundarySPHSystem(boundary_zone::Union{InFlow, OutFlow}; sound_speed,
                       fluid_system::FluidSystem, buffer_size::Integer,
                       boundary_model,
                       reference_velocity=nothing,
                       reference_pressure=nothing,
-                      reference_density=nothing)

Open boundary system for in- and outflow particles.

Arguments

  • boundary_zone: Use InFlow for an inflow and OutFlow for an outflow boundary.

Keywords

  • sound_speed: Speed of sound.
  • fluid_system: The corresponding fluid system
  • boundary_model: Boundary model (see Open Boundary Models)
  • buffer_size: Number of buffer particles.
  • reference_velocity: Reference velocity is either a function mapping each particle's coordinates and time to its velocity, an array where the $i$-th column holds the velocity of particle $i$ or, for a constant fluid velocity, a vector holding this velocity.
  • reference_pressure: Reference pressure is either a function mapping each particle's coordinates and time to its pressure, a vector holding the pressure of each particle, or a scalar for a constant pressure over all particles.
  • reference_density: Reference density is either a function mapping each particle's coordinates and time to its density, a vector holding the density of each particle, or a scalar for a constant density over all particles.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.InFlowType
InFlow(; plane, flow_direction, density, particle_spacing,
+                      reference_density=nothing)

Open boundary system for in- and outflow particles.

Arguments

  • boundary_zone: Use InFlow for an inflow and OutFlow for an outflow boundary.

Keywords

  • sound_speed: Speed of sound.
  • fluid_system: The corresponding fluid system
  • boundary_model: Boundary model (see Open Boundary Models)
  • buffer_size: Number of buffer particles.
  • reference_velocity: Reference velocity is either a function mapping each particle's coordinates and time to its velocity, an array where the $i$-th column holds the velocity of particle $i$ or, for a constant fluid velocity, a vector holding this velocity.
  • reference_pressure: Reference pressure is either a function mapping each particle's coordinates and time to its pressure, a vector holding the pressure of each particle, or a scalar for a constant pressure over all particles.
  • reference_density: Reference density is either a function mapping each particle's coordinates and time to its density, a vector holding the density of each particle, or a scalar for a constant density over all particles.
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.InFlowType
InFlow(; plane, flow_direction, density, particle_spacing,
        initial_condition=nothing, extrude_geometry=nothing,
        open_boundary_layers::Integer)

Inflow boundary zone for OpenBoundarySPHSystem.

The specified plane (line in 2D or rectangle in 3D) will be extruded in upstream direction (the direction opposite to flow_direction) to create a box for the boundary zone. There are three ways to specify the actual shape of the inflow:

  1. Don't pass initial_condition or extrude_geometry. The boundary zone box will then be filled with inflow particles (default).
  2. Specify extrude_geometry by passing a 1D shape in 2D or a 2D shape in 3D, which is then extruded in upstream direction to create the inflow particles.
    • In 2D, the shape must be either an initial condition with 2D coordinates, which lies on the line specified by plane, or an initial condition with 1D coordinates, which lies on the line specified by plane when a y-coordinate of 0 is added.
    • In 3D, the shape must be either an initial condition with 3D coordinates, which lies in the rectangle specified by plane, or an initial condition with 2D coordinates, which lies in the rectangle specified by plane when a z-coordinate of 0 is added.
  3. Specify initial_condition by passing a 2D initial condition in 2D or a 3D initial condition in 3D, which will be used for the inflow particles.
Note

Particles outside the boundary zone box will be removed.

Keywords

  • plane: Tuple of points defining a part of the surface of the domain. The points must either span a line in 2D or a rectangle in 3D. This line or rectangle is then extruded in upstream direction to obtain the boundary zone. In 2D, pass two points $(A, B)$, so that the interval $[A, B]$ is the inflow surface. In 3D, pass three points $(A, B, C)$, so that the rectangular inflow surface is spanned by the vectors $\widehat{AB}$ and $\widehat{AC}$. These two vectors must be orthogonal.
  • flow_direction: Vector defining the flow direction.
  • open_boundary_layers: Number of particle layers in upstream direction.
  • particle_spacing: The spacing between the particles (see InitialCondition).
  • density: Particle density (see InitialCondition).
  • initial_condition=nothing: InitialCondition for the inflow particles. Particles outside the boundary zone will be removed. Do not use together with extrude_geometry.
  • extrude_geometry=nothing: 1D shape in 2D or 2D shape in 3D, which lies on the plane and is extruded upstream to obtain the inflow particles. See point 2 above for more details.

Examples

# 2D
 plane_points = ([0.0, 0.0], [0.0, 1.0])
@@ -44,7 +44,7 @@
 circle = SphereShape(0.1, 0.5, (0.5, 0.5), 1.0, sphere_type=RoundSphere())
 
 inflow = InFlow(; plane=plane_points, particle_spacing=0.1, flow_direction, density=1.0,
-                extrude_geometry=circle, open_boundary_layers=4)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.OutFlowType
OutFlow(; plane, flow_direction, density, particle_spacing,
+                extrude_geometry=circle, open_boundary_layers=4)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source
TrixiParticles.OutFlowType
OutFlow(; plane, flow_direction, density, particle_spacing,
         initial_condition=nothing, extrude_geometry=nothing,
         open_boundary_layers::Integer)

Outflow boundary zone for OpenBoundarySPHSystem.

The specified plane (line in 2D or rectangle in 3D) will be extruded in downstream direction (the direction in flow_direction) to create a box for the boundary zone. There are three ways to specify the actual shape of the outflow:

  1. Don't pass initial_condition or extrude_geometry. The boundary zone box will then be filled with outflow particles (default).
  2. Specify extrude_geometry by passing a 1D shape in 2D or a 2D shape in 3D, which is then extruded in downstream direction to create the outflow particles.
    • In 2D, the shape must be either an initial condition with 2D coordinates, which lies on the line specified by plane, or an initial condition with 1D coordinates, which lies on the line specified by plane when a y-coordinate of 0 is added.
    • In 3D, the shape must be either an initial condition with 3D coordinates, which lies in the rectangle specified by plane, or an initial condition with 2D coordinates, which lies in the rectangle specified by plane when a z-coordinate of 0 is added.
  3. Specify initial_condition by passing a 2D initial condition in 2D or a 3D initial condition in 3D, which will be used for the outflow particles.
Note

Particles outside the boundary zone box will be removed.

Keywords

  • plane: Tuple of points defining a part of the surface of the domain. The points must either span a line in 2D or a rectangle in 3D. This line or rectangle is then extruded in downstream direction to obtain the boundary zone. In 2D, pass two points $(A, B)$, so that the interval $[A, B]$ is the outflow surface. In 3D, pass three points $(A, B, C)$, so that the rectangular outflow surface is spanned by the vectors $\widehat{AB}$ and $\widehat{AC}$. These two vectors must be orthogonal.
  • flow_direction: Vector defining the flow direction.
  • open_boundary_layers: Number of particle layers in downstream direction.
  • particle_spacing: The spacing between the particles (see InitialCondition).
  • density: Particle density (see InitialCondition).
  • initial_condition=nothing: InitialCondition for the outflow particles. Particles outside the boundary zone will be removed. Do not use together with extrude_geometry.
  • extrude_geometry=nothing: 1D shape in 2D or 2D shape in 3D, which lies on the plane and is extruded downstream to obtain the outflow particles. See point 2 above for more details.

Examples

# 2D
 plane_points = ([0.0, 0.0], [0.0, 1.0])
@@ -64,4 +64,4 @@
 circle = SphereShape(0.1, 0.5, (0.5, 0.5), 1.0, sphere_type=RoundSphere())
 
 outflow = OutFlow(; plane=plane_points, particle_spacing=0.1, flow_direction, density=1.0,
-                  extrude_geometry=circle, open_boundary_layers=4)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source

Open Boundary Models

Method of characteristics

TrixiParticles.BoundaryModelLastiwkaType
BoundaryModelLastiwka()

Boundary model for OpenBoundarySPHSystem. This model uses the characteristic variables to propagate the appropriate values to the outlet or inlet and have been proposed by Lastiwka et al. (2009). For more information about the method see description below.

source

The difficulty in non-reflecting boundary conditions, also called open boundaries, is to determine the appropriate boundary values of the exact characteristics of the Euler equations. Assuming the flow near the boundaries is normal to the boundary and free of shock waves and significant viscous effects, it can be shown that three characteristic variables exist:

  • $J_1$, associated with convection of entropy and propagates at flow velocity,
  • $J_2$, downstream-running characteristics,
  • $J_3$, upstream-running characteristics.

Giles (1990) derived those variables based on a linearized set of governing equations:

\[J_1 = -c_s^2 (\rho - \rho_{\text{ref}}) + (p - p_{\text{ref}})\]

\[J_2 = \rho c_s (v - v_{\text{ref}}) + (p - p_{\text{ref}})\]

\[J_3 = - \rho c_s (v - v_{\text{ref}}) + (p - p_{\text{ref}})\]

where the subscript "ref" denotes the reference flow near the boundaries, which can be prescribed.

Specifying the reference variables is not equivalent to prescription of $\rho$, $v$ and $p$ directly, since the perturbation from the reference flow is allowed.

Lastiwka et al. (2009) applied the method of characteristic to SPH and determined the number of variables that should be prescribed at the boundary and the number which should be propagated from the fluid domain to the boundary:

  • For an inflow boundary:

    • Prescribe downstream-running characteristics $J_1$ and $J_2$
    • Transmit $J_3$ from the fluid domain (allow $J_3$ to propagate upstream to the boundary).
  • For an outflow boundary:

    • Prescribe upstream-running characteristic $J_3$
    • Transmit $J_1$ and $J_2$ from the fluid domain.

Prescribing is done by simply setting the characteristics to zero. To transmit the characteristics from the fluid domain, or in other words, to carry the information of the fluid to the boundaries, Negi et al. (2020) use a Shepard Interpolation

\[f_i = \frac{\sum_j^N f_j W_{ij}}{\sum_j^N W_{ij}},\]

where the $i$-th particle is a boundary particle, $f$ is either $J_1$, $J_2$ or $J_3$ and $N$ is the set of neighboring fluid particles.

To express pressure $p$, density $\rho$ and velocity $v$ as functions of the characteristic variables, the system of equations from the characteristic variables is inverted and gives

\[ \rho - \rho_{\text{ref}} = \frac{1}{c_s^2} \left( -J_1 + \frac{1}{2} J_2 + \frac{1}{2} J_3 \right),\]

\[u - u_{\text{ref}}= \frac{1}{2\rho c_s} \left( J_2 - J_3 \right),\]

\[p - p_{\text{ref}} = \frac{1}{2} \left( J_2 + J_3 \right).\]

With $J_1$, $J_2$ and $J_3$ determined, we can easily solve for the actual variables for each particle.

References

  • M. B. Giles. "Nonreflecting boundary conditions for Euler equation calculations". In: AIAA Journal, 28.12 pages 2050–2058. doi: 10.2514/3.10521
  • M. Lastiwka, M. Basa, N. J. Quinlan. "Permeable and non-reflecting boundary conditions in SPH". In: International Journal for Numerical Methods in Fluids 61, (2009), pages 709–724. doi: 10.1002/fld.1971
  • P. Negi, P. Ramachandran, A. Haftu. "An improved non-reflecting outlet boundary condition for weakly-compressible SPH". In: Computer Methods in Applied Mechanics and Engineering 367, (2020), pages 113–119. doi: 10.1016/j.cma.2020.113119
+ extrude_geometry=circle, open_boundary_layers=4)
Experimental Implementation

This is an experimental feature and may change in any future releases.

source

Open Boundary Models

Method of characteristics

TrixiParticles.BoundaryModelLastiwkaType
BoundaryModelLastiwka()

Boundary model for OpenBoundarySPHSystem. This model uses the characteristic variables to propagate the appropriate values to the outlet or inlet and have been proposed by Lastiwka et al. (2009). For more information about the method see description below.

source

The difficulty in non-reflecting boundary conditions, also called open boundaries, is to determine the appropriate boundary values of the exact characteristics of the Euler equations. Assuming the flow near the boundaries is normal to the boundary and free of shock waves and significant viscous effects, it can be shown that three characteristic variables exist:

Giles (1990) derived those variables based on a linearized set of governing equations:

\[J_1 = -c_s^2 (\rho - \rho_{\text{ref}}) + (p - p_{\text{ref}})\]

\[J_2 = \rho c_s (v - v_{\text{ref}}) + (p - p_{\text{ref}})\]

\[J_3 = - \rho c_s (v - v_{\text{ref}}) + (p - p_{\text{ref}})\]

where the subscript "ref" denotes the reference flow near the boundaries, which can be prescribed.

Specifying the reference variables is not equivalent to prescription of $\rho$, $v$ and $p$ directly, since the perturbation from the reference flow is allowed.

Lastiwka et al. (2009) applied the method of characteristic to SPH and determined the number of variables that should be prescribed at the boundary and the number which should be propagated from the fluid domain to the boundary:

Prescribing is done by simply setting the characteristics to zero. To transmit the characteristics from the fluid domain, or in other words, to carry the information of the fluid to the boundaries, Negi et al. (2020) use a Shepard Interpolation

\[f_i = \frac{\sum_j^N f_j W_{ij}}{\sum_j^N W_{ij}},\]

where the $i$-th particle is a boundary particle, $f$ is either $J_1$, $J_2$ or $J_3$ and $N$ is the set of neighboring fluid particles.

To express pressure $p$, density $\rho$ and velocity $v$ as functions of the characteristic variables, the system of equations from the characteristic variables is inverted and gives

\[ \rho - \rho_{\text{ref}} = \frac{1}{c_s^2} \left( -J_1 + \frac{1}{2} J_2 + \frac{1}{2} J_3 \right),\]

\[u - u_{\text{ref}}= \frac{1}{2\rho c_s} \left( J_2 - J_3 \right),\]

\[p - p_{\text{ref}} = \frac{1}{2} \left( J_2 + J_3 \right).\]

With $J_1$, $J_2$ and $J_3$ determined, we can easily solve for the actual variables for each particle.

References

diff --git a/dev/systems/dem/index.html b/dev/systems/dem/index.html index dd4951b94..881be574e 100644 --- a/dev/systems/dem/index.html +++ b/dev/systems/dem/index.html @@ -1,3 +1,3 @@ Discrete Element Method (Solid) · TrixiParticles.jl

Discrete Element Method

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.

TrixiParticles.DEMSystemType
DEMSystem(initial_condition, normal_stiffness, elastic_modulus, poissons_ratio;
- damping_coefficient=0.0001, acceleration=ntuple(_ -> 0.0, NDIMS), source_terms=nothing)

Constructs a Discrete Element Method (DEM) system for numerically simulating the dynamics of granular and particulate matter. DEM is employed to simulate and analyze the motion, interactions, and collective behavior of assemblies of discrete, solid particles, typically under mechanical loading. The model accounts for individual particle characteristics and implements interaction laws that govern contact forces (normal and tangential), based on specified material properties and contact mechanics.

Arguments

  • initial_condition: Initial condition of the system, encapsulating the initial positions, velocities, masses, and radii of particles.
  • normal_stiffness: Normal stiffness coefficient for particle-particle and particle-wall contacts.
  • elastic_modulus: Elastic modulus for this particle system.
  • poissons_ratio: Poisson ratio for this particle system.

Keywords

  • acceleration: Global acceleration vector applied to the system, such as gravity. Specified as an SVector of length NDIMS, with a default of zero in each dimension.
  • source_terms: Optional; additional forces or modifications to particle dynamics not captured by standard DEM interactions, such as electromagnetic forces or user-defined perturbations.
  • damping_coefficient=0.0001: Set a damping coefficient for the collision interactions.

!!! warning "Experimental Implementation" This is an experimental feature and may change in a future releases.

source

References

  • N. Bićanić. "Discrete element methods". In: Encyclopedia of Computational Mechanics (2007). doi: 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

  • 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

+ damping_coefficient=0.0001, acceleration=ntuple(_ -> 0.0, NDIMS), source_terms=nothing)

Constructs a Discrete Element Method (DEM) system for numerically simulating the dynamics of granular and particulate matter. DEM is employed to simulate and analyze the motion, interactions, and collective behavior of assemblies of discrete, solid particles, typically under mechanical loading. The model accounts for individual particle characteristics and implements interaction laws that govern contact forces (normal and tangential), based on specified material properties and contact mechanics.

Arguments

Keywords

!!! warning "Experimental Implementation" This is an experimental feature and may change in a future releases.

source

References

diff --git a/dev/systems/entropically_damped_sph/index.html b/dev/systems/entropically_damped_sph/index.html index ea78eb442..4689975f7 100644 --- a/dev/systems/entropically_damped_sph/index.html +++ b/dev/systems/entropically_damped_sph/index.html @@ -6,4 +6,4 @@ density_calculator=SummationDensity(), alpha=0.5, viscosity=nothing, acceleration=ntuple(_ -> 0.0, NDIMS), buffer_size=nothing, - source_terms=nothing)

System for particles of a fluid. As opposed to the weakly compressible SPH scheme, which uses an equation of state, this scheme uses a pressure evolution equation to calculate the pressure. See Entropically Damped Artificial Compressibility for SPH for more details on the method.

Arguments

Keyword Arguments

source

References

+ source_terms=nothing)

System for particles of a fluid. As opposed to the weakly compressible SPH scheme, which uses an equation of state, this scheme uses a pressure evolution equation to calculate the pressure. See Entropically Damped Artificial Compressibility for SPH for more details on the method.

Arguments

Keyword Arguments

source

References

diff --git a/dev/systems/total_lagrangian_sph/index.html b/dev/systems/total_lagrangian_sph/index.html index 67715e2b7..e2efe7783 100644 --- a/dev/systems/total_lagrangian_sph/index.html +++ b/dev/systems/total_lagrangian_sph/index.html @@ -7,5 +7,5 @@ young_modulus, poisson_ratio; n_fixed_particles=0, boundary_model=nothing, acceleration=ntuple(_ -> 0.0, NDIMS), - penalty_force=nothing, source_terms=nothing)

System for particles of an elastic structure.

A Total Lagrangian framework is used wherein the governing equations are formulated such that all relevant quantities and operators are measured with respect to the initial configuration (O’Connor & Rogers 2021, Belytschko et al. 2000). See Total Lagrangian SPH for more details on the method.

Arguments

Keyword Arguments

Note

The fixed particles must be the last particles in the InitialCondition. To do so, e.g. use the union function:

solid = union(beam, fixed_particles)

where beam and fixed_particles are of type InitialCondition.

source

References

Penalty Force

In FEM, underintegrated elements can deform without an associated increase of energy. This is caused by the stiffness matrix having zero eigenvalues (so-called hourglass modes). The name "hourglass modes" comes from the fact that elements can deform into an hourglass shape.

Similar effects can occur in SPH as well. Particles can change positions without changing the SPH approximation of the deformation gradient $\bm{F}$, thus, without causing an increase of energy. To ensure regular particle positions, we can apply similar correction forces as are used in FEM.

Ganzenmüller (2015) introduced a so-called hourglass correction force or penalty force $f^{PF}$, which is given by

\[\bm{f}_a^{PF} = \frac{1}{2} \alpha \sum_b \frac{m_{0a} m_{0b} W_{0ab}}{\rho_{0a}\rho_{0b} |\bm{X}_{ab}|^2} - \left( E \delta_{ab}^a + E \delta_{ba}^b \right) \frac{\bm{x}_{ab}}{|\bm{x}_{ab}|}\]

The subscripts $a$ and $b$ denote quantities of particle $a$ and $b$, respectively. The zero subscript on quantities denotes that the quantity is to be measured in the initial configuration. The difference in the initial coordinates is denoted by $\bm{X}_{ab} = \bm{X}_a - \bm{X}_b$, the difference in the current coordinates is denoted by $\bm{x}_{ab} = \bm{x}_a - \bm{x}_b$. Note that Ganzenmüller (2015) has a flipped sign here because they define $\bm{x}_{ab}$ the other way around.

This correction force is based on the potential energy density of a Hookean material. Thus, $E$ is the Young's modulus and $\alpha$ is a dimensionless coefficient that controls the amplitude of hourglass correction. The separation vector $\delta_{ab}^a$ indicates the change of distance which the particle separation should attain in order to minimize the error and is given by

\[ \delta_{ab}^a = \frac{\bm{\epsilon}_{ab}^a \cdot \bm{x_{ab}}}{|\bm{x}_{ab}|},\]

where the error vector is defined as

\[ \bm{\epsilon}_{ab}^a = \bm{F}_a \bm{X}_{ab} - \bm{x}_{ab}.\]

TrixiParticles.PenaltyForceGanzenmuellerType
PenaltyForceGanzenmueller(; alpha=0.1)

Penalty force to ensure regular particle positions under large deformations.

Keywords

  • alpha: Coefficient to control the amplitude of hourglass correction.
source

References

+ penalty_force=nothing, source_terms=nothing)

System for particles of an elastic structure.

A Total Lagrangian framework is used wherein the governing equations are formulated such that all relevant quantities and operators are measured with respect to the initial configuration (O’Connor & Rogers 2021, Belytschko et al. 2000). See Total Lagrangian SPH for more details on the method.

Arguments

Keyword Arguments

Note

The fixed particles must be the last particles in the InitialCondition. To do so, e.g. use the union function:

solid = union(beam, fixed_particles)

where beam and fixed_particles are of type InitialCondition.

source

References

Penalty Force

In FEM, underintegrated elements can deform without an associated increase of energy. This is caused by the stiffness matrix having zero eigenvalues (so-called hourglass modes). The name "hourglass modes" comes from the fact that elements can deform into an hourglass shape.

Similar effects can occur in SPH as well. Particles can change positions without changing the SPH approximation of the deformation gradient $\bm{F}$, thus, without causing an increase of energy. To ensure regular particle positions, we can apply similar correction forces as are used in FEM.

Ganzenmüller (2015) introduced a so-called hourglass correction force or penalty force $f^{PF}$, which is given by

\[\bm{f}_a^{PF} = \frac{1}{2} \alpha \sum_b \frac{m_{0a} m_{0b} W_{0ab}}{\rho_{0a}\rho_{0b} |\bm{X}_{ab}|^2} + \left( E \delta_{ab}^a + E \delta_{ba}^b \right) \frac{\bm{x}_{ab}}{|\bm{x}_{ab}|}\]

The subscripts $a$ and $b$ denote quantities of particle $a$ and $b$, respectively. The zero subscript on quantities denotes that the quantity is to be measured in the initial configuration. The difference in the initial coordinates is denoted by $\bm{X}_{ab} = \bm{X}_a - \bm{X}_b$, the difference in the current coordinates is denoted by $\bm{x}_{ab} = \bm{x}_a - \bm{x}_b$. Note that Ganzenmüller (2015) has a flipped sign here because they define $\bm{x}_{ab}$ the other way around.

This correction force is based on the potential energy density of a Hookean material. Thus, $E$ is the Young's modulus and $\alpha$ is a dimensionless coefficient that controls the amplitude of hourglass correction. The separation vector $\delta_{ab}^a$ indicates the change of distance which the particle separation should attain in order to minimize the error and is given by

\[ \delta_{ab}^a = \frac{\bm{\epsilon}_{ab}^a \cdot \bm{x_{ab}}}{|\bm{x}_{ab}|},\]

where the error vector is defined as

\[ \bm{\epsilon}_{ab}^a = \bm{F}_a \bm{X}_{ab} - \bm{x}_{ab}.\]

TrixiParticles.PenaltyForceGanzenmuellerType
PenaltyForceGanzenmueller(; alpha=0.1)

Penalty force to ensure regular particle positions under large deformations.

Keywords

  • alpha: Coefficient to control the amplitude of hourglass correction.
source

References

diff --git a/dev/systems/weakly_compressible_sph/index.html b/dev/systems/weakly_compressible_sph/index.html index 9198a12a5..9e01bb6fc 100644 --- a/dev/systems/weakly_compressible_sph/index.html +++ b/dev/systems/weakly_compressible_sph/index.html @@ -5,12 +5,12 @@ viscosity=nothing, density_diffusion=nothing, acceleration=ntuple(_ -> 0.0, NDIMS), buffer_size=nothing, - correction=nothing, source_terms=nothing)

System for particles of a fluid. The weakly compressible SPH (WCSPH) scheme is used, wherein a stiff equation of state generates large pressure changes for small density variations. See Weakly Compressible SPH for more details on the method.

Arguments

Keyword Arguments

source

References

Equation of State

The equation of state is used to relate fluid density to pressure and thus allow an explicit simulation of the WCSPH system. The equation in the following formulation was introduced by Cole (Cole 1948, pp. 39 and 43). The pressure $p$ is calculated as

\[ p = B \left(\left(\frac{\rho}{\rho_0}\right)^\gamma - 1\right) + p_{\text{background}},\]

where $\rho$ denotes the density, $\rho_0$ the reference density, and $p_{\text{background}}$ the background pressure, which is set to zero when applied to free-surface flows (Adami et al., 2012).

The bulk modulus, $B = \frac{\rho_0 c^2}{\gamma}$, is calculated from the artificial speed of sound $c$ and the isentropic exponent $\gamma$.

An ideal gas equation of state with a linear relationship between pressure and density can be obtained by choosing exponent=1, i.e.

\[ p = B \left( \frac{\rho}{\rho_0} -1 \right) = c^2(\rho - \rho_0).\]

For higher Reynolds numbers, exponent=7 is recommended, whereas at lower Reynolds numbers exponent=1 yields more accurate pressure estimates since pressure and density are proportional.

When using SummationDensity (or DensityReinitializationCallback) and free surfaces, initializing particles with equal spacing will cause underestimated density and therefore strong attractive forces between particles at the free surface. Setting clip_negative_pressure=true can avoid this.

TrixiParticles.StateEquationColeType
StateEquationCole(; sound_speed, reference_density, exponent,
-                  background_pressure=0.0, clip_negative_pressure=false)

Equation of state to describe the relationship between pressure and density of water up to high pressures.

Keywords

  • sound_speed: Artificial speed of sound.
  • reference_density: Reference density of the fluid.
  • exponent: A value of 7 is usually used for most simulations.
  • background_pressure=0.0: Background pressure.
source

References

Viscosity

TODO: Explain viscosity.

TrixiParticles.ArtificialViscosityMonaghanType
ArtificialViscosityMonaghan(; alpha, beta=0.0, epsilon=0.01)

Artificial viscosity by Monaghan (Monaghan 1992, Monaghan 1989), given by

\[\Pi_{ab} = + correction=nothing, source_terms=nothing)

System for particles of a fluid. The weakly compressible SPH (WCSPH) scheme is used, wherein a stiff equation of state generates large pressure changes for small density variations. See Weakly Compressible SPH for more details on the method.

Arguments

Keyword Arguments

  • viscosity: Viscosity model for this system (default: no viscosity). See ArtificialViscosityMonaghan or ViscosityAdami.
  • density_diffusion: Density diffusion terms for this system. See DensityDiffusion.
  • acceleration: Acceleration vector for the system. (default: zero vector)
  • buffer_size: Number of buffer particles. This is needed when simulating with OpenBoundarySPHSystem.
  • correction: Correction method used for this system. (default: no correction, see Corrections)
  • source_terms: Additional source terms for this system. Has to be either nothing (by default), or a function of (coords, velocity, density, pressure, t) (which are the quantities of a single particle), returning a Tuple or SVector that is to be added to the acceleration of that particle. See, for example, SourceTermDamping. Note that these source terms will not be used in the calculation of the boundary pressure when using a boundary with BoundaryModelDummyParticles and AdamiPressureExtrapolation. The keyword argument acceleration should be used instead for gravity-like source terms.
  • surface_tension: Surface tension model used for this SPH system. (default: no surface tension)
source

References

Equation of State

The equation of state is used to relate fluid density to pressure and thus allow an explicit simulation of the WCSPH system. The equation in the following formulation was introduced by Cole (Cole 1948, pp. 39 and 43). The pressure $p$ is calculated as

\[ p = B \left(\left(\frac{\rho}{\rho_0}\right)^\gamma - 1\right) + p_{\text{background}},\]

where $\rho$ denotes the density, $\rho_0$ the reference density, and $p_{\text{background}}$ the background pressure, which is set to zero when applied to free-surface flows (Adami et al., 2012).

The bulk modulus, $B = \frac{\rho_0 c^2}{\gamma}$, is calculated from the artificial speed of sound $c$ and the isentropic exponent $\gamma$.

An ideal gas equation of state with a linear relationship between pressure and density can be obtained by choosing exponent=1, i.e.

\[ p = B \left( \frac{\rho}{\rho_0} -1 \right) = c^2(\rho - \rho_0).\]

For higher Reynolds numbers, exponent=7 is recommended, whereas at lower Reynolds numbers exponent=1 yields more accurate pressure estimates since pressure and density are proportional.

When using SummationDensity (or DensityReinitializationCallback) and free surfaces, initializing particles with equal spacing will cause underestimated density and therefore strong attractive forces between particles at the free surface. Setting clip_negative_pressure=true can avoid this.

TrixiParticles.StateEquationColeType
StateEquationCole(; sound_speed, reference_density, exponent,
+                  background_pressure=0.0, clip_negative_pressure=false)

Equation of state to describe the relationship between pressure and density of water up to high pressures.

Keywords

  • sound_speed: Artificial speed of sound.
  • reference_density: Reference density of the fluid.
  • exponent: A value of 7 is usually used for most simulations.
  • background_pressure=0.0: Background pressure.
source

References

Viscosity

TODO: Explain viscosity.

TrixiParticles.ArtificialViscosityMonaghanType
ArtificialViscosityMonaghan(; alpha, beta=0.0, epsilon=0.01)

Artificial viscosity by Monaghan (Monaghan 1992, Monaghan 1989), given by

\[\Pi_{ab} = \begin{cases} -(\alpha c \mu_{ab} + \beta \mu_{ab}^2) / \bar{\rho}_{ab} & \text{if } v_{ab} \cdot r_{ab} < 0, \\ 0 & \text{otherwise} -\end{cases}\]

with

\[\mu_{ab} = \frac{h v_{ab} \cdot r_{ab}}{\Vert r_{ab} \Vert^2 + \epsilon h^2},\]

where $\alpha, \beta, \epsilon$ are parameters, $c$ is the speed of sound, $h$ is the smoothing length, $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$, $v_{ab} = v_a - v_b$ is the difference of their velocities, and $\bar{\rho}_{ab}$ is the arithmetic mean of their densities.

Note that $\alpha$ needs to adjusted for different resolutions to maintain a specific Reynolds Number. To do so, Monaghan (Monaghan 2005) defined an equivalent effective physical kinematic viscosity $\nu$ by

\[ \nu = \frac{\alpha h c }{2d + 4},\]

where $d$ is the dimension.

Keywords

  • alpha: A value of 0.02 is usually used for most simulations. For a relation with the kinematic viscosity, see description above.
  • beta=0.0: A value of 0.0 works well for most fluid simulations and simulations with shocks of moderate strength. In simulations where the Mach number can be very high, eg. astrophysical calculation, good results can be obtained by choosing a value of beta=2.0 and alpha=1.0.
  • epsilon=0.01: Parameter to prevent singularities.

References

source
TrixiParticles.ViscosityAdamiType
ViscosityAdami(; nu, epsilon=0.01)

Viscosity by Adami (Adami et al. 2012). The viscous interaction is calculated with the shear force for incompressible flows given by

\[f_{ab} = \sum_w \bar{\eta}_{ab} \left( V_a^2 + V_b^2 \right) \frac{v_{ab}}{||r_{ab}||^2+\epsilon h_{ab}^2} \nabla W_{ab} \cdot r_{ab},\]

where $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$, $v_{ab} = v_a - v_b$ is the difference of their velocities, $h$ is the smoothing length and $V$ is the particle volume. The parameter $\epsilon$ prevents singularities (see Ramachandran et al. 2019). The inter-particle-averaged shear stress is

\[ \bar{\eta}_{ab} =\frac{2 \eta_a \eta_b}{\eta_a + \eta_b},\]

where $\eta_a = \rho_a \nu_a$ with $\nu$ as the kinematic viscosity.

Keywords

  • nu: Kinematic viscosity
  • epsilon=0.01: Parameter to prevent singularities

References

  • S. Adami et al. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231 (2012), pages 7057-7075. doi: 10.1016/j.jcp.2012.05.005
  • P. Ramachandran et al. "Entropically damped artificial compressibility for SPH". In: Journal of Computers and Fluids 179 (2019), pages 579-594. doi: 10.1016/j.compfluid.2018.11.023
source
TrixiParticles.ViscosityMorrisType
ViscosityMorris(; nu, epsilon=0.01)

Viscosity by Morris et al. (1997).

To the force $f_{ab}$ between two particles $a$ and $b$ due to pressure gradients, an additional force term $\tilde{f}_{ab}$ is added with

\[\tilde{f}_{ab} = m_a m_b \frac{(\mu_a + \mu_b) r_{ab} \cdot \nabla W_{ab}}{\rho_a \rho_b (\Vert r_{ab} \Vert^2 + \epsilon h^2)} v_{ab},\]

where $\mu_a = \rho_a \nu$ and $\mu_b = \rho_b \nu$ denote the dynamic viscosity of particle $a$ and $b$ respectively, and $\nu$ is the kinematic viscosity.

Keywords

  • nu: Kinematic viscosity
  • epsilon=0.01: Parameter to prevent singularities

References

  • Joseph P. Morris, Patrick J. Fox, Yi Zhu. "Modeling Low Reynolds Number Incompressible Flows Using SPH". In: Journal of Computational Physics, Volume 136, Issue 1 (1997), pages 214–226. doi: doi.org/10.1006/jcph.1997.5776
  • Georgios Fourtakas, Jose M. Dominguez, Renato Vacondio, Benedict D. Rogers. "Local uniform stencil (LUST) boundary condition for arbitrary 3-D boundaries in parallel smoothed particle hydrodynamics (SPH) models". In: Computers & Fluids, Volume 190 (2019), pages 346–361. doi: 10.1016/j.compfluid.2019.06.009
source

Density Diffusion

Density diffusion can be used with ContinuityDensity to remove the noise in the pressure field. It is highly recommended to use density diffusion when using WCSPH.

Formulation

All density diffusion terms extend the continuity equation (see ContinuityDensity) by an additional term

\[\frac{\mathrm{d}\rho_a}{\mathrm{d}t} = \sum_{b} m_b v_{ab} \cdot \nabla_{r_a} W(\Vert r_{ab} \Vert, h) +\end{cases}\]

with

\[\mu_{ab} = \frac{h v_{ab} \cdot r_{ab}}{\Vert r_{ab} \Vert^2 + \epsilon h^2},\]

where $\alpha, \beta, \epsilon$ are parameters, $c$ is the speed of sound, $h$ is the smoothing length, $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$, $v_{ab} = v_a - v_b$ is the difference of their velocities, and $\bar{\rho}_{ab}$ is the arithmetic mean of their densities.

Note that $\alpha$ needs to adjusted for different resolutions to maintain a specific Reynolds Number. To do so, Monaghan (Monaghan 2005) defined an equivalent effective physical kinematic viscosity $\nu$ by

\[ \nu = \frac{\alpha h c }{2d + 4},\]

where $d$ is the dimension.

Keywords

References

source
TrixiParticles.ViscosityAdamiType
ViscosityAdami(; nu, epsilon=0.01)

Viscosity by Adami (Adami et al. 2012). The viscous interaction is calculated with the shear force for incompressible flows given by

\[f_{ab} = \sum_w \bar{\eta}_{ab} \left( V_a^2 + V_b^2 \right) \frac{v_{ab}}{||r_{ab}||^2+\epsilon h_{ab}^2} \nabla W_{ab} \cdot r_{ab},\]

where $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$, $v_{ab} = v_a - v_b$ is the difference of their velocities, $h$ is the smoothing length and $V$ is the particle volume. The parameter $\epsilon$ prevents singularities (see Ramachandran et al. 2019). The inter-particle-averaged shear stress is

\[ \bar{\eta}_{ab} =\frac{2 \eta_a \eta_b}{\eta_a + \eta_b},\]

where $\eta_a = \rho_a \nu_a$ with $\nu$ as the kinematic viscosity.

Keywords

  • nu: Kinematic viscosity
  • epsilon=0.01: Parameter to prevent singularities

References

  • S. Adami et al. "A generalized wall boundary condition for smoothed particle hydrodynamics". In: Journal of Computational Physics 231 (2012), pages 7057-7075. doi: 10.1016/j.jcp.2012.05.005
  • P. Ramachandran et al. "Entropically damped artificial compressibility for SPH". In: Journal of Computers and Fluids 179 (2019), pages 579-594. doi: 10.1016/j.compfluid.2018.11.023
source
TrixiParticles.ViscosityMorrisType
ViscosityMorris(; nu, epsilon=0.01)

Viscosity by Morris et al. (1997).

To the force $f_{ab}$ between two particles $a$ and $b$ due to pressure gradients, an additional force term $\tilde{f}_{ab}$ is added with

\[\tilde{f}_{ab} = m_a m_b \frac{(\mu_a + \mu_b) r_{ab} \cdot \nabla W_{ab}}{\rho_a \rho_b (\Vert r_{ab} \Vert^2 + \epsilon h^2)} v_{ab},\]

where $\mu_a = \rho_a \nu$ and $\mu_b = \rho_b \nu$ denote the dynamic viscosity of particle $a$ and $b$ respectively, and $\nu$ is the kinematic viscosity.

Keywords

  • nu: Kinematic viscosity
  • epsilon=0.01: Parameter to prevent singularities

References

  • Joseph P. Morris, Patrick J. Fox, Yi Zhu. "Modeling Low Reynolds Number Incompressible Flows Using SPH". In: Journal of Computational Physics, Volume 136, Issue 1 (1997), pages 214–226. doi: doi.org/10.1006/jcph.1997.5776
  • Georgios Fourtakas, Jose M. Dominguez, Renato Vacondio, Benedict D. Rogers. "Local uniform stencil (LUST) boundary condition for arbitrary 3-D boundaries in parallel smoothed particle hydrodynamics (SPH) models". In: Computers & Fluids, Volume 190 (2019), pages 346–361. doi: 10.1016/j.compfluid.2019.06.009
source

Density Diffusion

Density diffusion can be used with ContinuityDensity to remove the noise in the pressure field. It is highly recommended to use density diffusion when using WCSPH.

Formulation

All density diffusion terms extend the continuity equation (see ContinuityDensity) by an additional term

\[\frac{\mathrm{d}\rho_a}{\mathrm{d}t} = \sum_{b} m_b v_{ab} \cdot \nabla_{r_a} W(\Vert r_{ab} \Vert, h) + \delta h c \sum_{b} V_b \psi_{ab} \cdot \nabla_{r_a} W(\Vert r_{ab} \Vert, h),\]

where $V_b = m_b / \rho_b$ is the volume of particle $b$ and $\psi_{ab}$ depends on the density diffusion method (see DensityDiffusion for available terms). Also, $\rho_a$ denotes the density of particle $a$ and $r_{ab} = r_a - r_b$ is the difference of the coordinates, $v_{ab} = v_a - v_b$ of the velocities of particles $a$ and $b$.

Numerical Results

All density diffusion terms remove numerical noise in the pressure field and produce more accurate results than weakly commpressible SPH without density diffusion. This can be demonstrated with dam break examples in 2D and 3D. Here, $δ = 0.1$ has been used for all terms. Note that, due to added stability, the adaptive time integration method that was used here can choose higher time steps in the simulations with density diffusion. For the cheap DensityDiffusionMolteniColagrossi, this results in reduced runtime.

density_diffusion_2d
Dam break in 2D with different density diffusion terms
@@ -20,9 +20,9 @@

The simpler terms DensityDiffusionMolteniColagrossi and DensityDiffusionFerrari do not solve the hydrostatic problem and lead to incorrect solutions in long-running steady-state hydrostatic simulations with free surfaces (Antuono et al., 2012). This can be seen when running the simple rectangular tank example until $t = 40$ (again using $δ = 0.1$):

density_diffusion_tank
Tank in rest under gravity in 3D with different density diffusion terms
-

DensityDiffusionAntuono adds a correction term to solve this problem, but this term is very expensive and adds about 40–50% of computational cost.

References

API

TrixiParticles.DensityDiffusionType
DensityDiffusion

An abstract supertype of all density diffusion formulations.

Currently, the following formulations are available:

FormulationSuitable for Steady-State SimulationsLow Computational Cost
DensityDiffusionMolteniColagrossi
DensityDiffusionFerrari
DensityDiffusionAntuono

See Density Diffusion for a comparison and more details.

source
TrixiParticles.DensityDiffusionAntuonoType
DensityDiffusionAntuono(initial_condition; delta)

The commonly used density diffusion terms by Antuono et al. (2010), also referred to as δ-SPH. The density diffusion term by Molteni & Colagrossi (2009) is extended by a second term, which is nicely written down by Antuono et al. (2012).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = 2\left(\rho_a - \rho_b - \frac{1}{2}\big(\nabla\rho^L_a + \nabla\rho^L_b\big) \cdot r_{ab}\right) - \frac{r_{ab}}{\Vert r_{ab} \Vert^2},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively and $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$. The symbol $\nabla\rho^L_a$ denotes the renormalized density gradient defined as

\[\nabla\rho^L_a = -\sum_b (\rho_a - \rho_b) V_b L_a \nabla_{r_a} W(\Vert r_{ab} \Vert, h)\]

with

\[L_a := \left( -\sum_{b} V_b r_{ab} \otimes \nabla_{r_a} W(\Vert r_{ab} \Vert, h) \right)^{-1} \in \R^{d \times d},\]

where $d$ is the number of dimensions.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • M. Antuono, A. Colagrossi, S. Marrone, D. Molteni. "Free-Surface Flows Solved by Means of SPH Schemes with Numerical Diffusive Terms." In: Computer Physics Communications 181.3 (2010), pages 532–549. doi: 10.1016/j.cpc.2009.11.002
  • M. Antuono, A. Colagrossi, S. Marrone. "Numerical Diffusive Terms in Weakly-Compressible SPH Schemes." In: Computer Physics Communications 183.12 (2012), pages 2570–2580. doi: 10.1016/j.cpc.2012.07.006
  • Diego Molteni, Andrea Colagrossi. "A Simple Procedure to Improve the Pressure Evaluation in Hydrodynamic Context Using the SPH." In: Computer Physics Communications 180.6 (2009), pages 861–872. doi: 10.1016/j.cpc.2008.12.004
source
TrixiParticles.DensityDiffusionFerrariType
DensityDiffusionFerrari()

A density diffusion term by Ferrari et al. (2009).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = \frac{\rho_a - \rho_b}{2h} \frac{r_{ab}}{\Vert r_{ab} \Vert},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively, $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$ and $h$ is the smoothing length.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • Angela Ferrari, Michael Dumbser, Eleuterio F. Toro, Aronne Armanini. "A New 3D Parallel SPH Scheme for Free Surface Flows." In: Computers & Fluids 38.6 (2009), pages 1203–1217. doi: 10.1016/j.compfluid.2008.11.012.
source
TrixiParticles.DensityDiffusionMolteniColagrossiType
DensityDiffusionMolteniColagrossi(; delta)

The commonly used density diffusion term by Molteni & Colagrossi (2009).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = 2(\rho_a - \rho_b) \frac{r_{ab}}{\Vert r_{ab} \Vert^2},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively and $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • Diego Molteni, Andrea Colagrossi. "A Simple Procedure to Improve the Pressure Evaluation in Hydrodynamic Context Using the SPH." In: Computer Physics Communications 180.6 (2009), pages 861–872. doi: 10.1016/j.cpc.2008.12.004
source

Corrections

TrixiParticles.AkinciFreeSurfaceCorrectionType
AkinciFreeSurfaceCorrection(rho0)

Free surface correction according to Akinci et al. (2013). At a free surface, the mean density is typically lower than the reference density, resulting in reduced surface tension and viscosity forces. The free surface correction adjusts the viscosity, pressure, and surface tension forces near free surfaces to counter this effect. It's important to note that this correlation is unphysical and serves as an approximation. The computation time added by this method is about 2–3%.

Mathematically the idea is quite simple. If we have an SPH particle in the middle of a volume at rest, its density will be identical to the rest density $\rho_0$. If we now consider an SPH particle at a free surface at rest, it will have neighbors missing in the direction normal to the surface, which will result in a lower density. If we calculate the correction factor

\[k = \rho_0/\rho_\text{mean},\]

this value will be about ~1.5 for particles at the free surface and can then be used to increase the pressure and viscosity accordingly.

Arguments

  • rho0: Rest density.

References

  • Akinci, N., Akinci, G., & Teschner, M. (2013). "Versatile Surface Tension and Adhesion for SPH Fluids". ACM Transactions on Graphics (TOG), 32(6), 182. doi: 10.1145/2508363.2508405
source
TrixiParticles.BlendedGradientCorrectionType
BlendedGradientCorrection()

Calculate a blended gradient to reduce the stability issues of the GradientCorrection.

This calculates the following,

\[\tilde\nabla A_i = (1-\lambda) \nabla A_i + \lambda L_i \nabla A_i\]

with $0 \leq \lambda \leq 1$ being the blending factor.

Arguments

  • blending_factor: Blending factor between corrected and regular SPH gradient.
source
TrixiParticles.GradientCorrectionType
GradientCorrection()

Compute the corrected gradient of particle interactions based on their relative positions.

Mathematical Details

Given the standard SPH representation, the gradient of a field $A$ at particle $a$ is given by

\[\nabla A_a = \sum_b m_b \frac{A_b - A_a}{\rho_b} \nabla_{r_a} W(\Vert r_a - r_b \Vert, h),\]

where $m_b$ is the mass of particle $b$ and $\rho_b$ is the density of particle $b$.

The gradient correction, as commonly proposed, involves multiplying this gradient with a correction matrix $L$:

\[\tilde{\nabla} A_a = \bm{L}_a \nabla A_a\]

The correction matrix $\bm{L}_a$ is computed based on the provided particle configuration, aiming to make the corrected gradient more accurate, especially near domain boundaries.

To satisfy

\[\sum_b V_b r_{ba} \otimes \tilde{\nabla}W_b(r_a) = \left( \sum_b V_b r_{ba} \otimes \nabla W_b(r_a) \right) \bm{L}_a^T = \bm{I}\]

the correction matrix $\bm{L}_a$ is evaluated explicitly as

\[\bm{L}_a = \left( \sum_b V_b \nabla W_b(r_{a}) \otimes r_{ba} \right)^{-1}.\]

Note
  • Stability issues arise, especially when particles separate into small clusters.
  • Doubles the computational effort.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97–115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
source
TrixiParticles.KernelCorrectionType
KernelCorrection()

Kernel correction uses Shepard interpolation to obtain a 0-th order accurate result, which was first proposed by Li et al. This can be further extended to obtain a kernel corrected gradient as shown by Basa et al.

The kernel correction coefficient is determined by

\[c(x) = \sum_{b=1} V_b W_b(x)\]

The gradient of corrected kernel is determined by

\[\nabla \tilde{W}_{b}(r) =\frac{\nabla W_{b}(r) - W_b(r) \gamma(r)}{\sum_{b=1} V_b W_b(r)} , \quad \text{where} \quad -\gamma(r) = \frac{\sum_{b=1} V_b \nabla W_b(r)}{\sum_{b=1} V_b W_b(r)}.\]

This correction can be applied with SummationDensity and ContinuityDensity, which leads to an improvement, especially at free surfaces.

Note
  • This only works when the boundary model uses SummationDensity (yet).
  • It is also referred to as "0th order correction".
  • In 2D, we can expect an increase of about 10–15% in computation time.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97-115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
  • Shaofan Li, Wing Kam Liu. "Moving least-square reproducing kernel method Part II: Fourier analysis". In: Computer Methods in Applied Mechanics and Engineering 139 (1996), pages 159-193. doi:10.1016/S0045-7825(96)01082-1
source
TrixiParticles.MixedKernelGradientCorrectionType
MixedKernelGradientCorrection()

Combines GradientCorrection and KernelCorrection, which results in a 1st-order-accurate SPH method.

Notes:

  • Stability issues, especially when particles separate into small clusters.
  • Doubles the computational effort.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97–115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
source
TrixiParticles.ShepardKernelCorrectionType
ShepardKernelCorrection()

Kernel correction uses Shepard interpolation to obtain a 0-th order accurate result, which was first proposed by Li et al.

The kernel correction coefficient is determined by

\[c(x) = \sum_{b=1} V_b W_b(x),\]

where $V_b = m_b / \rho_b$ is the volume of particle $b$.

This correction is applied with SummationDensity to correct the density and leads to an improvement, especially at free surfaces.

Note
  • It is also referred to as "0th order correction".
  • In 2D, we can expect an increase of about 5–6% in computation time.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97-115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
  • Shaofan Li, Wing Kam Liu. "Moving least-square reproducing kernel method Part II: Fourier analysis". In: Computer Methods in Applied Mechanics and Engineering 139 (1996), pages 159–193. doi:10.1016/S0045-7825(96)01082-1
source

Surface Tension

Akinci-based intra-particle force surface tension and wall adhesion model

The work by Akinci proposes three forces:

The classical model is composed of the curvature minimization and cohesion force.

Cohesion force

The model calculates the cohesion force based on the distance between particles and the support radius $h_c$. This force is determined using two distinct regimes within the support radius:

The cohesion force, $F_{\text{cohesion}}$, for a pair of particles is given by:

\[F_{\text{cohesion}} = -\sigma m_b C(r) \frac{r}{\Vert r \Vert},\]

where:

The cohesion kernel $C$ is defined as

\[C(r)=\frac{32}{\pi h_c^9} +

DensityDiffusionAntuono adds a correction term to solve this problem, but this term is very expensive and adds about 40–50% of computational cost.

References

API

TrixiParticles.DensityDiffusionType
DensityDiffusion

An abstract supertype of all density diffusion formulations.

Currently, the following formulations are available:

FormulationSuitable for Steady-State SimulationsLow Computational Cost
DensityDiffusionMolteniColagrossi
DensityDiffusionFerrari
DensityDiffusionAntuono

See Density Diffusion for a comparison and more details.

source
TrixiParticles.DensityDiffusionAntuonoType
DensityDiffusionAntuono(initial_condition; delta)

The commonly used density diffusion terms by Antuono et al. (2010), also referred to as δ-SPH. The density diffusion term by Molteni & Colagrossi (2009) is extended by a second term, which is nicely written down by Antuono et al. (2012).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = 2\left(\rho_a - \rho_b - \frac{1}{2}\big(\nabla\rho^L_a + \nabla\rho^L_b\big) \cdot r_{ab}\right) + \frac{r_{ab}}{\Vert r_{ab} \Vert^2},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively and $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$. The symbol $\nabla\rho^L_a$ denotes the renormalized density gradient defined as

\[\nabla\rho^L_a = -\sum_b (\rho_a - \rho_b) V_b L_a \nabla_{r_a} W(\Vert r_{ab} \Vert, h)\]

with

\[L_a := \left( -\sum_{b} V_b r_{ab} \otimes \nabla_{r_a} W(\Vert r_{ab} \Vert, h) \right)^{-1} \in \R^{d \times d},\]

where $d$ is the number of dimensions.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • M. Antuono, A. Colagrossi, S. Marrone, D. Molteni. "Free-Surface Flows Solved by Means of SPH Schemes with Numerical Diffusive Terms." In: Computer Physics Communications 181.3 (2010), pages 532–549. doi: 10.1016/j.cpc.2009.11.002
  • M. Antuono, A. Colagrossi, S. Marrone. "Numerical Diffusive Terms in Weakly-Compressible SPH Schemes." In: Computer Physics Communications 183.12 (2012), pages 2570–2580. doi: 10.1016/j.cpc.2012.07.006
  • Diego Molteni, Andrea Colagrossi. "A Simple Procedure to Improve the Pressure Evaluation in Hydrodynamic Context Using the SPH." In: Computer Physics Communications 180.6 (2009), pages 861–872. doi: 10.1016/j.cpc.2008.12.004
source
TrixiParticles.DensityDiffusionFerrariType
DensityDiffusionFerrari()

A density diffusion term by Ferrari et al. (2009).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = \frac{\rho_a - \rho_b}{2h} \frac{r_{ab}}{\Vert r_{ab} \Vert},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively, $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$ and $h$ is the smoothing length.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • Angela Ferrari, Michael Dumbser, Eleuterio F. Toro, Aronne Armanini. "A New 3D Parallel SPH Scheme for Free Surface Flows." In: Computers & Fluids 38.6 (2009), pages 1203–1217. doi: 10.1016/j.compfluid.2008.11.012.
source
TrixiParticles.DensityDiffusionMolteniColagrossiType
DensityDiffusionMolteniColagrossi(; delta)

The commonly used density diffusion term by Molteni & Colagrossi (2009).

The term $\psi_{ab}$ in the continuity equation in DensityDiffusion is defined by

\[\psi_{ab} = 2(\rho_a - \rho_b) \frac{r_{ab}}{\Vert r_{ab} \Vert^2},\]

where $\rho_a$ and $\rho_b$ denote the densities of particles $a$ and $b$ respectively and $r_{ab} = r_a - r_b$ is the difference of the coordinates of particles $a$ and $b$.

See DensityDiffusion for an overview and comparison of implemented density diffusion terms.

References

  • Diego Molteni, Andrea Colagrossi. "A Simple Procedure to Improve the Pressure Evaluation in Hydrodynamic Context Using the SPH." In: Computer Physics Communications 180.6 (2009), pages 861–872. doi: 10.1016/j.cpc.2008.12.004
source

Corrections

TrixiParticles.AkinciFreeSurfaceCorrectionType
AkinciFreeSurfaceCorrection(rho0)

Free surface correction according to Akinci et al. (2013). At a free surface, the mean density is typically lower than the reference density, resulting in reduced surface tension and viscosity forces. The free surface correction adjusts the viscosity, pressure, and surface tension forces near free surfaces to counter this effect. It's important to note that this correlation is unphysical and serves as an approximation. The computation time added by this method is about 2–3%.

Mathematically the idea is quite simple. If we have an SPH particle in the middle of a volume at rest, its density will be identical to the rest density $\rho_0$. If we now consider an SPH particle at a free surface at rest, it will have neighbors missing in the direction normal to the surface, which will result in a lower density. If we calculate the correction factor

\[k = \rho_0/\rho_\text{mean},\]

this value will be about ~1.5 for particles at the free surface and can then be used to increase the pressure and viscosity accordingly.

Arguments

  • rho0: Rest density.

References

  • Akinci, N., Akinci, G., & Teschner, M. (2013). "Versatile Surface Tension and Adhesion for SPH Fluids". ACM Transactions on Graphics (TOG), 32(6), 182. doi: 10.1145/2508363.2508405
source
TrixiParticles.BlendedGradientCorrectionType
BlendedGradientCorrection()

Calculate a blended gradient to reduce the stability issues of the GradientCorrection.

This calculates the following,

\[\tilde\nabla A_i = (1-\lambda) \nabla A_i + \lambda L_i \nabla A_i\]

with $0 \leq \lambda \leq 1$ being the blending factor.

Arguments

  • blending_factor: Blending factor between corrected and regular SPH gradient.
source
TrixiParticles.GradientCorrectionType
GradientCorrection()

Compute the corrected gradient of particle interactions based on their relative positions.

Mathematical Details

Given the standard SPH representation, the gradient of a field $A$ at particle $a$ is given by

\[\nabla A_a = \sum_b m_b \frac{A_b - A_a}{\rho_b} \nabla_{r_a} W(\Vert r_a - r_b \Vert, h),\]

where $m_b$ is the mass of particle $b$ and $\rho_b$ is the density of particle $b$.

The gradient correction, as commonly proposed, involves multiplying this gradient with a correction matrix $L$:

\[\tilde{\nabla} A_a = \bm{L}_a \nabla A_a\]

The correction matrix $\bm{L}_a$ is computed based on the provided particle configuration, aiming to make the corrected gradient more accurate, especially near domain boundaries.

To satisfy

\[\sum_b V_b r_{ba} \otimes \tilde{\nabla}W_b(r_a) = \left( \sum_b V_b r_{ba} \otimes \nabla W_b(r_a) \right) \bm{L}_a^T = \bm{I}\]

the correction matrix $\bm{L}_a$ is evaluated explicitly as

\[\bm{L}_a = \left( \sum_b V_b \nabla W_b(r_{a}) \otimes r_{ba} \right)^{-1}.\]

Note
  • Stability issues arise, especially when particles separate into small clusters.
  • Doubles the computational effort.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97–115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
source
TrixiParticles.KernelCorrectionType
KernelCorrection()

Kernel correction uses Shepard interpolation to obtain a 0-th order accurate result, which was first proposed by Li et al. This can be further extended to obtain a kernel corrected gradient as shown by Basa et al.

The kernel correction coefficient is determined by

\[c(x) = \sum_{b=1} V_b W_b(x)\]

The gradient of corrected kernel is determined by

\[\nabla \tilde{W}_{b}(r) =\frac{\nabla W_{b}(r) - W_b(r) \gamma(r)}{\sum_{b=1} V_b W_b(r)} , \quad \text{where} \quad +\gamma(r) = \frac{\sum_{b=1} V_b \nabla W_b(r)}{\sum_{b=1} V_b W_b(r)}.\]

This correction can be applied with SummationDensity and ContinuityDensity, which leads to an improvement, especially at free surfaces.

Note
  • This only works when the boundary model uses SummationDensity (yet).
  • It is also referred to as "0th order correction".
  • In 2D, we can expect an increase of about 10–15% in computation time.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97-115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
  • Shaofan Li, Wing Kam Liu. "Moving least-square reproducing kernel method Part II: Fourier analysis". In: Computer Methods in Applied Mechanics and Engineering 139 (1996), pages 159-193. doi:10.1016/S0045-7825(96)01082-1
source
TrixiParticles.MixedKernelGradientCorrectionType
MixedKernelGradientCorrection()

Combines GradientCorrection and KernelCorrection, which results in a 1st-order-accurate SPH method.

Notes:

  • Stability issues, especially when particles separate into small clusters.
  • Doubles the computational effort.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97–115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
source
TrixiParticles.ShepardKernelCorrectionType
ShepardKernelCorrection()

Kernel correction uses Shepard interpolation to obtain a 0-th order accurate result, which was first proposed by Li et al.

The kernel correction coefficient is determined by

\[c(x) = \sum_{b=1} V_b W_b(x),\]

where $V_b = m_b / \rho_b$ is the volume of particle $b$.

This correction is applied with SummationDensity to correct the density and leads to an improvement, especially at free surfaces.

Note
  • It is also referred to as "0th order correction".
  • In 2D, we can expect an increase of about 5–6% in computation time.

References

  • J. Bonet, T.-S.L. Lok. "Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations". In: Computer Methods in Applied Mechanics and Engineering 180 (1999), pages 97-115. doi: 10.1016/S0045-7825(99)00051-1
  • Mihai Basa, Nathan Quinlan, Martin Lastiwka. "Robustness and accuracy of SPH formulations for viscous flow". In: International Journal for Numerical Methods in Fluids 60 (2009), pages 1127–1148. doi: 10.1002/fld.1927
  • Shaofan Li, Wing Kam Liu. "Moving least-square reproducing kernel method Part II: Fourier analysis". In: Computer Methods in Applied Mechanics and Engineering 139 (1996), pages 159–193. doi:10.1016/S0045-7825(96)01082-1
source

Surface Tension

Akinci-based intra-particle force surface tension and wall adhesion model

The work by Akinci proposes three forces:

The classical model is composed of the curvature minimization and cohesion force.

Cohesion force

The model calculates the cohesion force based on the distance between particles and the support radius $h_c$. This force is determined using two distinct regimes within the support radius:

The cohesion force, $F_{\text{cohesion}}$, for a pair of particles is given by:

\[F_{\text{cohesion}} = -\sigma m_b C(r) \frac{r}{\Vert r \Vert},\]

where:

The cohesion kernel $C$ is defined as

\[C(r)=\frac{32}{\pi h_c^9} \begin{cases} (h_c-r)^3 r^3, & \text{if } 2r > h_c \\ 2(h_c-r)^3 r^3 - \frac{h^6}{64}, & \text{if } r > 0 \text{ and } 2r \leq h_c \\ @@ -31,4 +31,4 @@ \begin{cases} \sqrt[4]{- \frac{4r^2}{h_c} + 6r - 2h_c}, & \text{if } 2r > h_c \text{ and } r \leq h_c \\ 0, & \text{otherwise.} -\end{cases}\]

TrixiParticles.CohesionForceAkinciType
CohesionForceAkinci(surface_tension_coefficient=1.0)

This model only implements the cohesion force of the Akinci surface tension model.

Keywords

  • surface_tension_coefficient=1.0: Modifies the intensity of the surface tension-induced force, enabling the tuning of the fluid's surface tension properties within the simulation.

References

  • Nadir Akinci, Gizem Akinci, Matthias Teschner. "Versatile Surface Tension and Adhesion for SPH Fluids". In: ACM Transactions on Graphics 32.6 (2013). doi: 10.1145/2508363.2508395
source
TrixiParticles.SurfaceTensionAkinciType
SurfaceTensionAkinci(surface_tension_coefficient=1.0)

Implements a model for surface tension and adhesion effects drawing upon the principles outlined by Akinci et al. This model is instrumental in capturing the nuanced behaviors of fluid surfaces, such as droplet formation and the dynamics of merging or separation, by utilizing intra-particle forces.

Keywords

  • surface_tension_coefficient=1.0: A parameter to adjust the magnitude of surface tension forces, facilitating the fine-tuning of how surface tension phenomena are represented in the simulation.

References

  • Nadir Akinci, Gizem Akinci, Matthias Teschner. "Versatile Surface Tension and Adhesion for SPH Fluids". In: ACM Transactions on Graphics 32.6 (2013). doi: 10.1145/2508363.2508395
source
+\end{cases}\]

TrixiParticles.CohesionForceAkinciType
CohesionForceAkinci(surface_tension_coefficient=1.0)

This model only implements the cohesion force of the Akinci surface tension model.

Keywords

  • surface_tension_coefficient=1.0: Modifies the intensity of the surface tension-induced force, enabling the tuning of the fluid's surface tension properties within the simulation.

References

  • Nadir Akinci, Gizem Akinci, Matthias Teschner. "Versatile Surface Tension and Adhesion for SPH Fluids". In: ACM Transactions on Graphics 32.6 (2013). doi: 10.1145/2508363.2508395
source
TrixiParticles.SurfaceTensionAkinciType
SurfaceTensionAkinci(surface_tension_coefficient=1.0)

Implements a model for surface tension and adhesion effects drawing upon the principles outlined by Akinci et al. This model is instrumental in capturing the nuanced behaviors of fluid surfaces, such as droplet formation and the dynamics of merging or separation, by utilizing intra-particle forces.

Keywords

  • surface_tension_coefficient=1.0: A parameter to adjust the magnitude of surface tension forces, facilitating the fine-tuning of how surface tension phenomena are represented in the simulation.

References

  • Nadir Akinci, Gizem Akinci, Matthias Teschner. "Versatile Surface Tension and Adhesion for SPH Fluids". In: ACM Transactions on Graphics 32.6 (2013). doi: 10.1145/2508363.2508395
source
diff --git a/dev/time_integration/index.html b/dev/time_integration/index.html index bef453d37..a57c224d1 100644 --- a/dev/time_integration/index.html +++ b/dev/time_integration/index.html @@ -1,2 +1,2 @@ -Time Integration · TrixiParticles.jl
+Time Integration · TrixiParticles.jl
diff --git a/dev/tutorial/index.html b/dev/tutorial/index.html index 89a8833d7..598454e99 100644 --- a/dev/tutorial/index.html +++ b/dev/tutorial/index.html @@ -1,2 +1,2 @@ -Tutorial · TrixiParticles.jl
+Tutorial · TrixiParticles.jl
diff --git a/dev/tutorials/tut_beam/index.html b/dev/tutorials/tut_beam/index.html index 48e8380ab..deaea9a3b 100644 --- a/dev/tutorials/tut_beam/index.html +++ b/dev/tutorials/tut_beam/index.html @@ -1,3 +1,3 @@ Example file · TrixiParticles.jl

Example file

!!include:examples/solid/oscillating_beam_2d.jl!!
-
+ diff --git a/dev/tutorials/tut_beam_replaced/index.html b/dev/tutorials/tut_beam_replaced/index.html index d2e8be45f..62579471e 100644 --- a/dev/tutorials/tut_beam_replaced/index.html +++ b/dev/tutorials/tut_beam_replaced/index.html @@ -84,4 +84,4 @@ # Use a Runge-Kutta method with automatic (error based) time step size control sol = solve(ode, RDPK3SpFSAL49(), save_everystep=false, callback=callbacks); - + diff --git a/dev/tutorials/tut_dam_break/index.html b/dev/tutorials/tut_dam_break/index.html index c8d14210c..1f9ae70ff 100644 --- a/dev/tutorials/tut_dam_break/index.html +++ b/dev/tutorials/tut_dam_break/index.html @@ -1,3 +1,3 @@ Example file · TrixiParticles.jl
+ diff --git a/dev/tutorials/tut_dam_break_replaced/index.html b/dev/tutorials/tut_dam_break_replaced/index.html index 5bfd21e91..13e78c078 100644 --- a/dev/tutorials/tut_dam_break_replaced/index.html +++ b/dev/tutorials/tut_dam_break_replaced/index.html @@ -111,4 +111,4 @@ dt=1.0, # This is overwritten by the stepsize callback save_everystep=false, callback=callbacks); - + diff --git a/dev/tutorials/tut_falling/index.html b/dev/tutorials/tut_falling/index.html index e69199fc2..f270dbc2c 100644 --- a/dev/tutorials/tut_falling/index.html +++ b/dev/tutorials/tut_falling/index.html @@ -1,3 +1,3 @@ Example file · TrixiParticles.jl

Example file

!!include:examples/fsi/falling_spheres_2d.jl!!
-
+ diff --git a/dev/tutorials/tut_falling_replaced/index.html b/dev/tutorials/tut_falling_replaced/index.html index af6fe22ba..5fc73327d 100644 --- a/dev/tutorials/tut_falling_replaced/index.html +++ b/dev/tutorials/tut_falling_replaced/index.html @@ -129,4 +129,4 @@ reltol=1e-3, # Default reltol is 1e-3 save_everystep=false, callback=callbacks); - + diff --git a/dev/tutorials/tut_setup/index.html b/dev/tutorials/tut_setup/index.html index d87e35ada..8dce5bb41 100644 --- a/dev/tutorials/tut_setup/index.html +++ b/dev/tutorials/tut_setup/index.html @@ -1,3 +1,3 @@ Setting up your simulation from scratch · TrixiParticles.jl
+ diff --git a/dev/tutorials/tut_setup_replaced/index.html b/dev/tutorials/tut_setup_replaced/index.html index 981e6fc82..cacfbcd89 100644 --- a/dev/tutorials/tut_setup_replaced/index.html +++ b/dev/tutorials/tut_setup_replaced/index.html @@ -72,4 +72,4 @@ # 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/dev/visualization/index.html b/dev/visualization/index.html index 2079512f3..4bfb1b297 100644 --- a/dev/visualization/index.html +++ b/dev/visualization/index.html @@ -3,6 +3,6 @@ write_meta_data=true, max_coordinates=Inf, custom_quantities...)

Convert Trixi simulation data to VTK format.

Arguments

Keywords

Example

trixi2vtk(sol.u[end], semi, 0.0, iter=1, output_directory="output", prefix="solution")
 
 # Additionally store the kinetic energy of each system as "my_custom_quantity"
-trixi2vtk(sol.u[end], semi, 0.0, iter=1, my_custom_quantity=kinetic_energy)
source
TrixiParticles.trixi2vtkMethod
trixi2vtk(coordinates; output_directory="out", prefix="", filename="coordinates",
-          custom_quantities...)

Convert coordinate data to VTK format.

Arguments

  • coordinates: Coordinates to be saved.

Keywords

  • output_directory="out": Output directory path.
  • prefix="": Prefix for the output file.
  • filename="coordinates": Name of the output file.
  • custom_quantities...: Additional custom quantities to include in the VTK output.

Returns

  • file::AbstractString: Path to the generated VTK file.
source
TrixiParticles.trixi2vtkMethod
trixi2vtk(initial_condition::InitialCondition; output_directory="out",
-          prefix="", filename="initial_condition", custom_quantities...)

Convert InitialCondition data to VTK format.

Arguments

Keywords

  • output_directory="out": Output directory path.
  • prefix="": Prefix for the output file.
  • filename="coordinates": Name of the output file.
  • custom_quantities...: Additional custom quantities to include in the VTK output.

Returns

  • file::AbstractString: Path to the generated VTK file.
source
+trixi2vtk(sol.u[end], semi, 0.0, iter=1, my_custom_quantity=kinetic_energy)source
TrixiParticles.trixi2vtkMethod
trixi2vtk(coordinates; output_directory="out", prefix="", filename="coordinates",
+          custom_quantities...)

Convert coordinate data to VTK format.

Arguments

  • coordinates: Coordinates to be saved.

Keywords

  • output_directory="out": Output directory path.
  • prefix="": Prefix for the output file.
  • filename="coordinates": Name of the output file.
  • custom_quantities...: Additional custom quantities to include in the VTK output.

Returns

  • file::AbstractString: Path to the generated VTK file.
source
TrixiParticles.trixi2vtkMethod
trixi2vtk(initial_condition::InitialCondition; output_directory="out",
+          prefix="", filename="initial_condition", custom_quantities...)

Convert InitialCondition data to VTK format.

Arguments

Keywords

  • output_directory="out": Output directory path.
  • prefix="": Prefix for the output file.
  • filename="coordinates": Name of the output file.
  • custom_quantities...: Additional custom quantities to include in the VTK output.

Returns

  • file::AbstractString: Path to the generated VTK file.
source