37#ifndef OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
38#define OPENSWMM_ENGINE_2D_NODE_COUPLING_HPP
40#include <unordered_map>
143 double project_len_to_m);
207 std::vector<double>& accum_m3,
208 std::vector<double>& cell_budget_m3,
double* sample_row);
238 double window_dt,
double sign,
239 const std::vector<double>* node_conc =
nullptr);
282 const SolverOptions2D& opts,
const double* provisional_vol_m3 =
nullptr,
283 double h1d_offset_m = 0.0) noexcept;
Regime-aware 1D↔2D exchange law (COUPLING_LAW WEIR_ORIFICE): free / submerged weir and orifice,...
Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
Per-node 1D↔2D coupling structure rows ([2D_NODE_COUPLING]).
Configuration options for the 2D surface routing solver.
Structure-of-Arrays (SoA) storage for 2D surface routing state.
Definition ExchangeLaw.hpp:60
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:278
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:816
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:443
void updateOutfallBoundaries(const std::vector< CouplingPoint > &cps, const MeshData &mesh, const SurfaceStateData &state, SimulationContext &ctx, const SolverOptions2D &opts, double dt)
Update outfall boundary depths from 2D surface heads.
Definition NodeCoupling.cpp:576
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:864
void resolveExchangeStructure(CouplingPoint &cp, const MeshData &mesh, const SimulationContext &ctx, const SolverOptions2D &opts, int row, NodeCoupling2DType type, double project_len_to_m)
Resolve a junction point's exchange law, structure and coefficients from its node's [2D_NODE_COUPLING...
Definition ExchangeStructure.cpp:46
std::vector< CouplingPoint > buildCouplingPoints(const MeshData &mesh, const SimulationContext &ctx)
Build the list of coupling points from mesh coupling maps.
Definition NodeCoupling.cpp:492
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:392
Definition ExchangeLaw.hpp:60
NodeCoupling2DType
Coupling structure type of a node. NONE = not coupleable.
Definition NodeCoupling2DData.hpp:36
@ Q
flow (cfs)
Definition ReactionTokens.hpp:43
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:125
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:59
double spread
Definition NodeCoupling.hpp:94
double area
Effective exchange area (m²)
Definition NodeCoupling.hpp:64
exchange::Geometry geo
WEIR_ORIFICE structure (SI, 2D frame)
Definition NodeCoupling.hpp:78
bool is_outfall
True if the SWMM node is an outfall.
Definition NodeCoupling.hpp:65
bool cd_authored
Definition NodeCoupling.hpp:74
int head_begin
Definition NodeCoupling.hpp:89
bool has_flap_gate
Definition NodeCoupling.hpp:66
int8_t law
Definition NodeCoupling.hpp:77
int vertex_idx
Vertex index (-1 if triangle-centroid coupling)
Definition NodeCoupling.hpp:61
int cell_idx
Triangle index in the 2D mesh.
Definition NodeCoupling.hpp:60
int node_idx
SWMM node index.
Definition NodeCoupling.hpp:62
bool equalize
COUPLING_EQUALIZE resolved for this point.
Definition NodeCoupling.hpp:85
double chamber_area
Definition NodeCoupling.hpp:83
exchange::Coefficients coef
Definition NodeCoupling.hpp:79
double cd
Discharge coefficient.
Definition NodeCoupling.hpp:63
double tw_relax
Definition NodeCoupling.hpp:95
bool area_authored
Definition NodeCoupling.hpp:71
int head_end
Definition NodeCoupling.hpp:90
SoA storage for 2D mixed triangle/quad mesh geometry and topology.
Definition MeshData.hpp:65
Definition SolverOptions2D.hpp:257
Definition SurfaceStateData.hpp:64
Discharge coefficients and the φ regularisation head.
Definition ExchangeLaw.hpp:73
A coupling point's structure, SI.
Definition ExchangeLaw.hpp:66