numerics 0.1.0
Loading...
Searching...
No Matches
sph_kernel.hpp File Reference

Dimension-generic SPH smoothing kernels. More...

#include <cmath>
#include <array>

Go to the source code of this file.

Classes

struct  num::detail::CubicSigma< 2 >
 
struct  num::detail::CubicSigma< 3 >
 
struct  num::detail::SpikyDW< 2 >
 
struct  num::detail::SpikyDW< 3 >
 
struct  num::SPHKernel< Dim >
 Dimension-generic SPH smoothing kernels. Dim = 2 or 3. More...
 

Namespaces

namespace  num
 
namespace  num::detail
 

Detailed Description

Dimension-generic SPH smoothing kernels.

SPHKernel<2> – 2D kernels (cubic sigma = 10/(7*pi*h^2), spiky = -15/(16*pi*h^5) (2h-r)^2) SPHKernel<3> – 3D kernels (cubic sigma = 1/(pi*h^3), spiky = -45/(pi*(2h)^6) (2h-r)^2)

Support radius 2h throughout; q = r/h.

Cubic spline (density + Morris viscosity Laplacian): W = sigma * { 1 - 1.5q^2 + 0.75q^3 q <= 1 { 0.25(2-q)^3 1 < q <= 2 dW/dr = sigma/h * { -3q + 2.25q^2 q <= 1 { -0.75(2-q)^2 1 < q <= 2

Spiky kernel (pressure gradient – dW/dr != 0 as r->0 prevents clustering): dW/dr < 0, Spiky_gradW returns (dW/dr / r) * r_vec

Spiky_gradW takes std::array<float, Dim> and returns std::array<float, Dim>.

Definition in file sph_kernel.hpp.