numerics
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π h²), spiky = -15/(16π h⁵) (2h-r)²) SPHKernel<3> – 3D kernels (cubic sigma = 1/(π h³), spiky = -45/(π (2h)⁶) (2h-r)²)

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

Cubic spline (density + Morris viscosity Laplacian): W = sigma * { 1 - 1.5q² + 0.75q³ q ≤ 1 { 0.25(2-q)³ 1 < q ≤ 2 dW/dr = sigma/h * { -3q + 2.25q² q ≤ 1 { -0.75(2-q)² 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.