OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Exfiltration.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
31
32#ifndef OPENSWMM_EXFILTRATION_HPP
33#define OPENSWMM_EXFILTRATION_HPP
34
36#include <vector>
37
38namespace openswmm {
39
41
42namespace exfil {
43
44struct ExfilSoA {
45 int count = 0;
46 std::vector<int> node_idx;
47 std::vector<double> btm_area;
48 std::vector<double> bank_min_depth;
49 std::vector<double> bank_max_depth;
50 std::vector<double> bank_max_area;
51 std::vector<GreenAmptState> btm_ga;
52 std::vector<GreenAmptState> bank_ga;
53
63 void resize(int n);
64};
65
67public:
80 void init(SimulationContext& ctx);
81
94 void computeAll(SimulationContext& ctx, double dt);
95
101 ExfilSoA& state() { return soa_; }
107 const ExfilSoA& state() const { return soa_; }
108
109private:
110 ExfilSoA soa_;
111};
112
113} // namespace exfil
114} // namespace openswmm
115
116#endif // OPENSWMM_EXFILTRATION_HPP
Infiltration models — Horton, Green-Ampt, SCS Curve Number.
Definition Exfiltration.hpp:66
const ExfilSoA & state() const
Borrow read-only exfiltration solver state.
Definition Exfiltration.hpp:107
void init(SimulationContext &ctx)
Build storage exfiltration geometry and independent bottom/bank Green-Ampt states.
Definition Exfiltration.cpp:51
ExfilSoA & state()
Borrow mutable exfiltration solver state for checkpoint/inspection.
Definition Exfiltration.hpp:101
void computeAll(SimulationContext &ctx, double dt)
Advance eligible storage exfiltration states and publish raw loss rates.
Definition Exfiltration.cpp:206
Definition Exfiltration.cpp:37
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Definition Exfiltration.hpp:44
std::vector< GreenAmptState > bank_ga
Bank Green-Ampt state.
Definition Exfiltration.hpp:52
int count
Definition Exfiltration.hpp:45
std::vector< double > bank_max_depth
Depth at max bank area.
Definition Exfiltration.hpp:49
void resize(int n)
Resize exfiltration columns and reset geometry/index columns.
Definition Exfiltration.cpp:39
std::vector< int > node_idx
Storage node index.
Definition Exfiltration.hpp:46
std::vector< double > bank_max_area
Maximum bank seepage area (ft2)
Definition Exfiltration.hpp:50
std::vector< GreenAmptState > btm_ga
Bottom Green-Ampt state.
Definition Exfiltration.hpp:51
std::vector< double > bank_min_depth
Depth where bank seepage starts.
Definition Exfiltration.hpp:48
std::vector< double > btm_area
Bottom area (ft2)
Definition Exfiltration.hpp:47