OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
ForceMain.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
34
35#ifndef OPENSWMM_FORCEMAIN_HPP
36#define OPENSWMM_FORCEMAIN_HPP
37
38namespace openswmm {
39
40namespace forcemain {
41
42constexpr double VISCOS = 1.1e-5;
43
44enum class FrictionModel : int {
47};
48
57double getFricSlope_HW(double velocity, double hyd_rad, double c_hw);
58
67double getFricSlope_DW(double velocity, double hyd_rad, double roughness);
68
84double getEquivN(FrictionModel model, double r_bot, double y_full,
85 double slope, double n_raw);
86
99double getRoughFactor(FrictionModel model, double r_bot, double length_factor);
100
112double getFricFactor(double r_bot, double hrad, double re);
113
124void batchFricSlope(const double* velocity, const double* hyd_rad,
125 const double* param, double* fric_slope,
126 FrictionModel model, int count);
127
128} // namespace forcemain
129} // namespace openswmm
130
131#endif // OPENSWMM_FORCEMAIN_HPP
Definition ForceMain.cpp:34
double getFricSlope_DW(double velocity, double hyd_rad, double roughness)
Compute friction slope for Darcy-Weisbach.
Definition ForceMain.cpp:53
void batchFricSlope(const double *velocity, const double *hyd_rad, const double *param, double *fric_slope, FrictionModel model, int count)
Batch compute friction slopes for all force mains — VECTORISABLE.
Definition ForceMain.cpp:137
double getFricFactor(double r_bot, double hrad, double re)
Compute friction factor f (Darcy-Weisbach) for fully-turbulent flow.
Definition ForceMain.cpp:61
FrictionModel
Definition ForceMain.hpp:44
@ HAZEN_WILLIAMS
Definition ForceMain.hpp:45
@ DARCY_WEISBACH
Definition ForceMain.hpp:46
double getRoughFactor(FrictionModel model, double r_bot, double length_factor)
Compute roughness adjustment factor for a force main (Gap #22).
Definition ForceMain.cpp:117
double getEquivN(FrictionModel model, double r_bot, double y_full, double slope, double n_raw)
Compute equivalent Manning's n for a force main (Gap #22).
Definition ForceMain.cpp:92
constexpr double VISCOS
Kinematic viscosity @ 20C (ft2/sec)
Definition ForceMain.hpp:42
double getFricSlope_HW(double velocity, double hyd_rad, double c_hw)
Compute friction slope for Hazen-Williams.
Definition ForceMain.cpp:49
Definition NodeCoupling.cpp:16