OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
NodeCoupling.hpp
Go to the documentation of this file.
1
20
21#ifndef OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
22#define OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
23
24#include <unordered_map>
25
26#include "../data/MeshData.hpp"
29
30// Forward declaration — avoid pulling in full SimulationContext
31namespace openswmm {
33struct NodeData;
34}
35
36namespace openswmm::twoD {
37
45 double cd;
46 double area;
49};
50
61std::vector<CouplingPoint> buildCouplingPoints(const MeshData& mesh,
62 const SimulationContext& ctx);
63
82void computeCouplingExchange(const std::vector<CouplingPoint>& cps,
83 const MeshData& mesh,
84 SurfaceStateData& state,
86 const SolverOptions2D& opts,
87 double dt);
88
106double computeNodeCouplingQ(const CouplingPoint& cp,
107 const MeshData& mesh,
108 const SurfaceStateData& state,
109 const NodeData& nodes,
110 const SolverOptions2D& opts) noexcept;
111
122void scatterCouplingToYdot(const MeshData& mesh,
123 const SurfaceStateData& state,
124 const CouplingPoint& cp,
125 double Q,
126 double* ydot) noexcept;
127
141void updateOutfallBoundaries(const std::vector<CouplingPoint>& cps,
142 const MeshData& mesh,
143 const SurfaceStateData& state,
145 const SolverOptions2D& opts);
146
166int transferOutfallDischarges(const std::vector<CouplingPoint>& cps,
167 const MeshData& mesh,
168 SurfaceStateData& state,
169 const SimulationContext& ctx,
170 const SolverOptions2D& opts,
171 double dt,
172 std::unordered_map<int, double>& applied_q);
173
174} // namespace openswmm::twoD
175
176#endif // OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
Configuration options for the 2D surface routing solver.
Structure-of-Arrays (SoA) storage for 2D surface routing state.
Definition NodeCoupling.cpp:15
void computeCouplingExchange(const std::vector< CouplingPoint > &cps, const MeshData &mesh, SurfaceStateData &state, SimulationContext &ctx, const SolverOptions2D &opts, double dt)
Compute exchange flows at all coupling points and inject into forcing API.
Definition NodeCoupling.cpp:290
int transferOutfallDischarges(const std::vector< CouplingPoint > &cps, const MeshData &mesh, SurfaceStateData &state, const SimulationContext &ctx, const SolverOptions2D &opts, double dt, std::unordered_map< int, double > &applied_q)
Transfer outfall discharges into 2D coupling cells.
Definition NodeCoupling.cpp:613
void scatterCouplingToYdot(const MeshData &mesh, const SurfaceStateData &state, const CouplingPoint &cp, double Q, double *ydot) noexcept
Scatter a signed volumetric exchange Q (m³/s) directly onto the cell derivatives ydot[] of the 2D vol...
Definition NodeCoupling.cpp:183
std::vector< CouplingPoint > buildCouplingPoints(const MeshData &mesh, const SimulationContext &ctx)
Build the list of coupling points from mesh coupling maps.
Definition NodeCoupling.cpp:227
void updateOutfallBoundaries(const std::vector< CouplingPoint > &cps, const MeshData &mesh, const SurfaceStateData &state, SimulationContext &ctx, const SolverOptions2D &opts)
Update outfall boundary depths from 2D surface heads.
Definition NodeCoupling.cpp:514
double computeNodeCouplingQ(const CouplingPoint &cp, const MeshData &mesh, const SurfaceStateData &state, const NodeData &nodes, const SolverOptions2D &opts) noexcept
Live node-coupling orifice flux for ONE non-outfall coupling point.
Definition NodeCoupling.cpp:126
Definition NodeCoupling.cpp:15
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:114
Central, reentrant simulation context.
Definition SimulationContext.hpp:292
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:41
double area
Effective exchange area (m²)
Definition NodeCoupling.hpp:46
bool is_outfall
True if the SWMM node is an outfall.
Definition NodeCoupling.hpp:47
bool has_flap_gate
True if outfall has a flap gate.
Definition NodeCoupling.hpp:48
int vertex_idx
Vertex index (-1 if triangle-centroid coupling)
Definition NodeCoupling.hpp:43
int cell_idx
Triangle index in the 2D mesh.
Definition NodeCoupling.hpp:42
int node_idx
SWMM node index.
Definition NodeCoupling.hpp:44
double cd
Discharge coefficient.
Definition NodeCoupling.hpp:45
SoA storage for 2D triangular mesh geometry and topology.
Definition MeshData.hpp:34
Configuration for the 2D surface routing CVODE solver.
Definition SolverOptions2D.hpp:132
Definition SurfaceStateData.hpp:41