SPHKernels.jl

Author LudwigBoess
Popularity
1 Star
Updated Last
1 Year Ago
Started In
July 2020
Documentation Build Status Licence Version Status
Run CI on master codecov.io The MIT License TagBot CompatHelper

SPHKernels.jl

This package supplies a number of kernels frequently used in Smoothed-Particle Hydrodynamics (SPH), as well as functions to evaluate their values and derivatives in 2D and 3D.

These kernels include the B-splines (Cubic and Quintic) suggested in Monaghan & Lattanzio (1985) and the Wendland functions (WendlandC2, WendlandC4 and WendlandC6) as suggested in Dehnen & Aly (2012).

In this implementation we follow the convention of Dehnen&Aly in using the 'compact kernel support' as a means to define the maximum extent of the kernel. They denote this H in their paper, for convenience (aka for not having to type caps) we use h in the code.

Evaluating Kernels

To evaluate a 3D kernel you need to use the function

kernel_value_3D(k::SPHKernel, u::Real, h_inv::Real)

where SPHKernel is the supertype for an implemented SPH kernel, u = \frac{x}{h} is the distance to the kernel origin in measures of the compact kernel support and h_inv is the inverse of the compact kernel support.

The same goes for a 1D kernel

kernel_value_1D(k::SPHKernel, u::Real, h_inv::Real)

and a 2D kernel

kernel_value_2D(k::SPHKernel, u::Real, h_inv::Real)

If you want your code to look a little more fancy you can also use the alternative functions ๐’ฒโ‚, where the respective subscript refers to the dimension:

๐’ฒโ‚( kernel::SPHKernel, u::Real, h_inv::Real ) = kernel_value_1D(kernel, u, h_inv)
๐’ฒโ‚‚( kernel::SPHKernel, u::Real, h_inv::Real ) = kernel_value_2D(kernel, u, h_inv)
๐’ฒโ‚ƒ( kernel::SPHKernel, u::Real, h_inv::Real ) = kernel_value_3D(kernel, u, h_inv)

Please see the docs for more details!

Used By Packages