OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
MsxSurfaceQuality.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
54
55#ifndef OPENSWMM_ENGINE_QUALITY_MSX_SURFACE_QUALITY_HPP
56#define OPENSWMM_ENGINE_QUALITY_MSX_SURFACE_QUALITY_HPP
57
58#include <string>
59#include <vector>
60
61namespace openswmm {
62
65
66namespace msxsurf {
67
71double speciesUnitFactor(const std::string& units, const SimulationOptions& opts);
72
74bool active(const SimulationContext& ctx) noexcept;
75
83std::vector<std::string> resolve(SimulationContext& ctx);
84
86void refreshDerived(SimulationContext& ctx) noexcept;
87
92void initState(SimulationContext& ctx);
93
101void step(SimulationContext& ctx, double dt_runoff, double old_runoff_time);
102
105void bookPostLid(SimulationContext& ctx, double dt_runoff,
106 const std::vector<double>& lid_infil_vol);
107
110void addLidDrain(SimulationContext& ctx, int control, int sc, int node, double drain_cfs,
111 bool to_perv, bool runoff_load, double dt_runoff,
112 const double* source = nullptr) noexcept;
113void rollLidDrain(SimulationContext& ctx) noexcept;
116void addLidDrainRunon(SimulationContext& ctx, int control, int sc, int receiver, double drain_cfs,
117 bool to_perv, bool runoff_load, double dt_runoff,
118 const double* source = nullptr) noexcept;
119void consumeLidDrainRunon(SimulationContext& ctx, int receiver) noexcept;
120
123void activateForRain(SimulationContext& ctx) noexcept;
124
126void resolveLidRemovals(SimulationContext& ctx, std::vector<std::string>& warnings);
127
130double remainingBuildup(const SimulationContext& ctx, int m) noexcept;
131
133void clearRunon(SimulationContext& ctx) noexcept;
134void addRunon(SimulationContext& ctx, int donor, int receiver, double q) noexcept;
135
146void deliver(SimulationContext& ctx, double dt_routing);
147
148} // namespace msxsurf
149} // namespace openswmm
150
151#endif // OPENSWMM_ENGINE_QUALITY_MSX_SURFACE_QUALITY_HPP
Definition MsxSurfaceQuality.cpp:49
void clearRunon(SimulationContext &ctx) noexcept
Clear every native surface species run-on mass-rate entry before assembly.
Definition MsxSurfaceQuality.cpp:1123
void consumeLidDrainRunon(SimulationContext &ctx, int receiver) noexcept
Move queued LID underdrain species run-on into one receiver and clear that queue.
Definition MsxSurfaceQuality.cpp:1043
void addLidDrain(SimulationContext &ctx, int control, int sc, int node, double drain_cfs, bool to_perv, bool runoff_load, double dt_runoff, const double *source) noexcept
Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings.
Definition MsxSurfaceQuality.cpp:947
void step(SimulationContext &ctx, double dt_runoff, double old_runoff_time)
Advance native dry/wet species reactions and shared surface buildup/washoff once.
Definition MsxSurfaceQuality.cpp:875
void activateForRain(SimulationContext &ctx) noexcept
Enable native surface storage needed by rainfall or scoped reaction/LID laws.
Definition MsxSurfaceQuality.cpp:420
void initState(SimulationContext &ctx)
Reset native surface state and seed initial dry buildup from loadings or dry days.
Definition MsxSurfaceQuality.cpp:497
std::vector< std::string > resolve(SimulationContext &ctx)
Resolve named surface rows then activate rainfall/reaction-only species storage.
Definition MsxSurfaceQuality.cpp:455
void refreshDerived(SimulationContext &ctx) noexcept
Recalculate analytic buildup saturation times after a parameter edit.
Definition MsxSurfaceQuality.cpp:469
void addLidDrainRunon(SimulationContext &ctx, int control, int sc, int receiver, double drain_cfs, bool to_perv, bool runoff_load, double dt_runoff, const double *source) noexcept
Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings.
Definition MsxSurfaceQuality.cpp:1005
void addRunon(SimulationContext &ctx, int donor, int receiver, double q) noexcept
Add donor previous-runoff species concentration to one receiver's run-on mass rate.
Definition MsxSurfaceQuality.cpp:1140
void resolveLidRemovals(SimulationContext &ctx, std::vector< std::string > &warnings)
Bind by-name LID removals to pollutant or native species identities.
Definition MsxSurfaceQuality.cpp:227
double speciesUnitFactor(const std::string &units, const SimulationOptions &opts)
Map a species unit prefix to its concentration-mass to user-mass factor.
Definition MsxSurfaceQuality.cpp:103
void deliver(SimulationContext &ctx, double)
Deliver this routing step's washoff into msx_ext_mass_in (+= interpolated old/new runoff mass rate pe...
Definition MsxSurfaceQuality.cpp:1165
void rollLidDrain(SimulationContext &ctx) noexcept
Retain current node underdrain species rates as previous step then clear current rates.
Definition MsxSurfaceQuality.cpp:1064
double remainingBuildup(const SimulationContext &ctx, int m) noexcept
Sum retained surface and conventional-LID species inventory for final user-mass reporting.
Definition MsxSurfaceQuality.cpp:1081
void bookPostLid(SimulationContext &ctx, double dt_runoff, const std::vector< double > &lid_infil_vol)
Book native species deposition/infiltration and runoff after conventional LID routing.
Definition MsxSurfaceQuality.cpp:910
bool active(const SimulationContext &ctx) noexcept
Read whether the resolved surface species store is active.
Definition MsxSurfaceQuality.cpp:119
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
All SWMM simulation options parsed from [OPTIONS] section.
Definition SimulationOptions.hpp:168