OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Link.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
32
33#ifndef OPENSWMM_LINK_HPP
34#define OPENSWMM_LINK_HPP
35
36#include "../data/LinkData.hpp"
37#include "XSectBatch.hpp"
38#include "Node.hpp"
39#include "Transect.hpp"
40
41#include <vector>
42
43namespace openswmm {
44
45namespace link {
46
47// ============================================================================
48// Per-element functions
49// ============================================================================
50
63double getVelocity(const XSectParams& xs, double flow, double depth, int barrels = 1);
64
76double getFroude(const XSectParams& xs, double v, double y);
77
93void computeConveyance(double roughness, double slope, double s_full,
94 double& beta, double& rough_factor, double& q_full);
95
107double getDepthFromFlow(const XSectParams& xs, double beta, double q);
108
113double getCapacity(const XSectParams& xs, double depth);
114
128double getHydPower(double flow, double head_upstream, double head_downstream);
129
142XSectParams buildXSectParams(
143 const LinkData& links, std::size_t uj,
144 const std::vector<transect::TransectData>* transects = nullptr);
145
146// ============================================================================
147// Batch functions (for routing hot loop)
148// ============================================================================
149
150// Phase 6: computeVelocities/computeFroude/computeAllConveyance removed (dead
151// code; referenced conduit fields now in ConduitData — see LinkSubtypes.hpp).
152
160int translateShape(XsectShape link_shape);
161
189void applyTabulatedXSectParams(XSectParams& xs, const transect::TransectData& td,
190 double y_full, int transect_idx);
191
192} // namespace link
193
194} // namespace openswmm
195
196#endif // OPENSWMM_LINK_HPP
Node hydraulics — volume/depth/head conversions, surface area, overflow.
Irregular transect cross-section geometry (HEC-2 style).
Cross-section geometry — unified batch + per-element API.
Definition NodeCoupling.cpp:16
XsectShape
Conduit cross-section shape code.
Definition LinkData.hpp:70
double * y
Definition odesolve.c:28