37#ifndef OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
38#define OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
40#include <unordered_map>
125 std::vector<double>& accum_m3,
126 std::vector<double>& cell_budget_m3,
151 const std::vector<double>& accum_m3,
154 const std::vector<double>* node_conc =
nullptr);
187 const double* provisional_vol_m3 =
nullptr,
188 double h1d_offset_m = 0.0) noexcept;
204 double* ydot) noexcept;
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:16
double computeNodeCouplingQ(const CouplingPoint &cp, const MeshData &mesh, const SurfaceStateData &state, const NodeData &nodes, const SolverOptions2D &opts, const double *provisional_vol_m3, double h1d_offset_m) noexcept
Live node-coupling orifice flux for ONE non-outfall coupling point.
Definition NodeCoupling.cpp:180
int accumulateOutfallDischargeStep(const std::vector< CouplingPoint > &cps, const MeshData &mesh, const SurfaceStateData &state, const SimulationContext &ctx, const SolverOptions2D &opts, double dt, std::vector< double > &accum_m3, std::vector< double > &cell_budget_m3, double *sample_row)
Per-routing-step outfall discharge accumulation.
Definition NodeCoupling.cpp:626
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:328
void injectAccumulatedExchange(const std::vector< CouplingPoint > &cps, const MeshData &mesh, SurfaceStateData &state, const std::vector< double > &accum_m3, double window_dt, double sign, const std::vector< double > *node_conc)
Inject a per-point accumulated exchange volume into the 2D window source field.
Definition NodeCoupling.cpp:670
std::vector< CouplingPoint > buildCouplingPoints(const MeshData &mesh, const SimulationContext &ctx)
Build the list of coupling points from mesh coupling maps.
Definition NodeCoupling.cpp:372
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:452
double computeNodeCouplingDQdh1d(const CouplingPoint &cp, const MeshData &mesh, const SurfaceStateData &state, const NodeData &nodes, const SolverOptions2D &opts) noexcept
Head sensitivity G = −∂Q/∂h_1d ≥ 0 of the coupling orifice at a point (SI: m³/s per m of 1D head,...
Definition NodeCoupling.cpp:280
Definition NodeCoupling.cpp:16
@ Q
flow (cfs)
Definition ReactionTokens.hpp:43
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:130
Central, reentrant simulation context.
Definition SimulationContext.hpp:353
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:57
double area
Effective exchange area (m²)
Definition NodeCoupling.hpp:62
bool is_outfall
True if the SWMM node is an outfall.
Definition NodeCoupling.hpp:63
bool has_flap_gate
Definition NodeCoupling.hpp:64
int vertex_idx
Vertex index (-1 if triangle-centroid coupling)
Definition NodeCoupling.hpp:59
int cell_idx
Triangle index in the 2D mesh.
Definition NodeCoupling.hpp:58
int node_idx
SWMM node index.
Definition NodeCoupling.hpp:60
double cd
Discharge coefficient.
Definition NodeCoupling.hpp:61
bool area_authored
Definition NodeCoupling.hpp:68
SoA storage for 2D mixed triangle/quad mesh geometry and topology.
Definition MeshData.hpp:67
Configuration for the 2D surface routing solver.
Definition SolverOptions2D.hpp:208
Definition SurfaceStateData.hpp:59