OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
HydClosureKernels.hpp File Reference

Portable scalar closures shared by the host solvers and the device backend: FHWA HEC-5 culvert inlet control and force-main friction. More...

#include <cmath>
Include dependency graph for HydClosureKernels.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::hydkernels::CulvertCurve
 Inlet-control curve coefficients for one culvert type code. More...
 

Namespaces

namespace  openswmm
 
namespace  openswmm::hydkernels
 

Macros

#define OPENSWMM_KERNEL_FN   inline
 

Functions

OPENSWMM_KERNEL_FN double openswmm::hydkernels::fricSlopeHW (double velocity, double hyd_rad, double c_hw) noexcept
 
OPENSWMM_KERNEL_FN double openswmm::hydkernels::fricSlopeDW (double velocity, double hyd_rad, double roughness) noexcept
 
OPENSWMM_KERNEL_FN double openswmm::hydkernels::culvertInflow (double q_proposed, double head, double y_full, double a_full, double slope, const CulvertCurve &cc, bool mitered, double &dqdh) noexcept
 Inlet-controlled discharge for one culvert.
 

Variables

constexpr double openswmm::hydkernels::kViscosity = 1.1e-5
 
constexpr double openswmm::hydkernels::kGravity = 32.2
 Gravity in internal units, matching constants::GRAVITY.
 

Detailed Description

Portable scalar closures shared by the host solvers and the device backend: FHWA HEC-5 culvert inlet control and force-main friction.

These are pure functions of scalars — no context, no allocation, no exceptions — and both the dynamic wave solver and the finite-volume solver already call them per element. The FV solver now calls them from inside its own substep loop (culvert inlet control caps the flux at the culvert's upstream face; a full force main obeys Hazen-Williams rather than the equivalent Manning n), which is exactly the position a device backend has to reach.

They therefore live here, marked with the same portable-kernel macro as FvKernels.hpp and XSectKernels.hpp, so the identical bodies compile for the host engine and for the Kokkos plugin. Culvert.cpp and ForceMain.cpp keep their public entry points and forward here — one implementation, not two, which is the whole point of the move.

See also
plans/EXPLICIT_FV_KOKKOS_1D_SOLVER_PLAN.md §5.1
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0

Macro Definition Documentation

◆ OPENSWMM_KERNEL_FN

#define OPENSWMM_KERNEL_FN   inline