43#ifndef OPENSWMM_ENGINE_2D_DIFFUSIVE_KERNELS_HPP
44#define OPENSWMM_ENGINE_2D_DIFFUSIVE_KERNELS_HPP
49#ifndef OPENSWMM_KERNEL_FN
50#define OPENSWMM_KERNEL_FN inline
69 if (!(hf > 0.0) || !(nf > 0.0) || slope == 0.0)
71 const double h53 = hf * std::cbrt(hf * hf);
72 const double sa = std::fabs(slope);
73 const double sr = std::sqrt((sa > s_eps) ? sa : s_eps);
74 return -h53 * slope / (nf * sr);
93 double slope_abs,
double s_eps)
noexcept {
96 const double h53 = h * std::cbrt(h * h);
97 const double s = (slope_abs > s_eps) ? slope_abs : s_eps;
98 return alpha * lchar * lchar * n * std::sqrt(s) / (4.0 * h53);
#define OPENSWMM_KERNEL_FN
Definition ExplicitKokkosSurfaceSolver.cpp:22
Definition DiffusiveKernels.hpp:53
OPENSWMM_KERNEL_FN double cellDiffusiveDt(double alpha, double lchar, double h, double n, double slope_abs, double s_eps) noexcept
Explicit-diffusion step bound for a cell of characteristic length L, depth h, Manning n and the large...
Definition DiffusiveKernels.hpp:92
OPENSWMM_KERNEL_FN double faceDischarge(double hf, double slope, double nf, double s_eps) noexcept
Manning quasi-steady face discharge (m²/s, positive L→R) for face depth hf, surface slope S = (η_R − ...
Definition DiffusiveKernels.hpp:68