OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
WatershedCommon.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
36
37#ifndef OPENSWMM_ENGINE_TRANSPORT_WATERSHED_COMMON_HPP
38#define OPENSWMM_ENGINE_TRANSPORT_WATERSHED_COMMON_HPP
39
40#include <cstddef>
41
42namespace openswmm {
44}
45
46namespace openswmm::transport {
47
50constexpr int kSubIMPERV0 = 0;
51constexpr int kSubIMPERV1 = 1;
52constexpr int kSubPERV = 2;
53
87double arrivingPrecipRate(const SimulationContext& ctx, std::size_t ui, int subarea) noexcept;
88
99double arrivingMeltFraction(const SimulationContext& ctx, std::size_t ui, int subarea) noexcept;
100
114double arrivingPrecipTemperature(const SimulationContext& ctx, std::size_t ui,
115 int subarea) noexcept;
116
140double arrivingPrecipAge(const SimulationContext& ctx, std::size_t ui, int subarea) noexcept;
141
145inline constexpr double kMeltwaterTempC = 0.0;
146
147} // namespace openswmm::transport
148
149#endif // OPENSWMM_ENGINE_TRANSPORT_WATERSHED_COMMON_HPP
Definition ExplicitFvSolver.hpp:53
double arrivingPrecipRate(const SimulationContext &ctx, std::size_t ui, int subarea) noexcept
Read arriving liquid precipitation after optional snowpack storage/melt.
Definition WatershedCommon.cpp:45
constexpr int kSubIMPERV0
Definition WatershedCommon.hpp:50
double arrivingPrecipAge(const SimulationContext &ctx, std::size_t ui, int subarea) noexcept
Mix configured rain age with retained meltwater age by arriving melt fraction.
Definition WatershedCommon.cpp:155
constexpr int kSubPERV
Definition WatershedCommon.hpp:52
constexpr int kSubIMPERV1
Definition WatershedCommon.hpp:51
constexpr double kMeltwaterTempC
Definition WatershedCommon.hpp:145
double arrivingMeltFraction(const SimulationContext &ctx, std::size_t ui, int subarea) noexcept
Read the melt fraction of arriving liquid precipitation.
Definition WatershedCommon.cpp:94
double arrivingPrecipTemperature(const SimulationContext &ctx, std::size_t ui, int subarea) noexcept
Mix rain and zero-degree meltwater temperatures by arriving melt fraction.
Definition WatershedCommon.cpp:133
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390