OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SurfaceExchange.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
69
70#ifndef OPENSWMM_ENGINE_TRANSPORT_SURFACE_EXCHANGE_HPP
71#define OPENSWMM_ENGINE_TRANSPORT_SURFACE_EXCHANGE_HPP
72
73#include "../../../data/HeatOverrideData.hpp" // HeatElement (PE1)
74
75namespace openswmm {
77}
78
80
82inline constexpr double kBowenCoeff = 0.061;
83
85double saturationVapourPressure(double t_c) noexcept;
86
89double latentHeatOfVaporization(double t_c) noexcept;
90
92double windFunction(double wind_ms, double a, double b) noexcept;
93
95double evaporationRate(double t_water_c, double t_air_c, double humidity_pct,
96 double wind_ms, double a, double b) noexcept;
97
99double latentFlux(double t_water_c, double t_air_c, double humidity_pct,
100 double wind_ms, double a, double b,
101 double water_density) noexcept;
102
105double bowenRatio(double t_water_c, double t_air_c, double humidity_pct,
106 double pressure_ratio) noexcept;
107
109double sensibleFlux(double latent_flux, double bowen_ratio) noexcept;
110
115double airTempCelsius(const SimulationContext& ctx) noexcept;
116
119inline constexpr double kProbeC = 1.0e-3;
120
168double relaxT(double j0, double j1, double h, double area_m2, double vol_m3,
169 double dt, double rho, double cp) noexcept;
170
175double equilibriumT(double t0_c, double j0, double j1, double h) noexcept;
176
178inline constexpr double kSqFtToSqM = 0.09290304;
180inline constexpr double kCuFtToCuM = 0.028316846592;
182inline constexpr double kMphToMs = 0.44704;
183
200double surfaceFluxOut(const SimulationContext& ctx,
201 const HeatElement& elem, double t_w) noexcept;
202
203} // namespace openswmm::transport::heat
204
205#endif // OPENSWMM_ENGINE_TRANSPORT_SURFACE_EXCHANGE_HPP
Plan PE — per-element radiative and bed attributes.
Definition BedExchange.cpp:37
constexpr double kBowenCoeff
Bowen's coefficient, kPa/°C (CSH §4.5).
Definition SurfaceExchange.hpp:82
double windFunction(double wind_ms, double a, double b) noexcept
Mass-transfer wind function a + b·w, w in m/s [m/s/kPa].
Definition SurfaceExchange.cpp:104
double saturationVapourPressure(double t_c) noexcept
Saturation vapour pressure over water at t_c degrees Celsius [kPa].
Definition SurfaceExchange.cpp:96
double latentFlux(double t_water_c, double t_air_c, double humidity_pct, double wind_ms, double a, double b, double water_density) noexcept
Latent heat flux [W/m²], POSITIVE out of the water.
Definition SurfaceExchange.cpp:116
double airTempCelsius(const SimulationContext &ctx) noexcept
Definition SurfaceExchange.cpp:57
double evaporationRate(double t_water_c, double t_air_c, double humidity_pct, double wind_ms, double a, double b) noexcept
Evaporative mass-transfer rate [m/s]. Negative under condensation.
Definition SurfaceExchange.cpp:108
double bowenRatio(double t_water_c, double t_air_c, double humidity_pct, double pressure_ratio) noexcept
Definition SurfaceExchange.cpp:124
constexpr double kCuFtToCuM
ft³ → m³.
Definition SurfaceExchange.hpp:180
double latentHeatOfVaporization(double t_c) noexcept
Definition SurfaceExchange.cpp:100
constexpr double kSqFtToSqM
ft² → m². Exported with relaxT, which is useless without it.
Definition SurfaceExchange.hpp:178
constexpr double kMphToMs
mph → m/s. ClimateState::wind_speed is mph.
Definition SurfaceExchange.hpp:182
double surfaceFluxOut(const SimulationContext &ctx, const HeatElement &elem, double t_w) noexcept
This module's contribution to the net outward flux at t_w [W/m²].
Definition SurfaceExchange.cpp:142
constexpr double kProbeC
Definition SurfaceExchange.hpp:119
double sensibleFlux(double latent_flux, double bowen_ratio) noexcept
Sensible heat flux [W/m²], POSITIVE out of the water.
Definition SurfaceExchange.cpp:138
double equilibriumT(double t0_c, double j0, double j1, double h) noexcept
Definition SurfaceExchange.cpp:89
double relaxT(double j0, double j1, double h, double area_m2, double vol_m3, double dt, double rho, double cp) noexcept
One element's temperature change, integrated SEMI-IMPLICITLY [°C].
Definition SurfaceExchange.cpp:61
Definition NodeCoupling.cpp:16
Which element a flux evaluator is being called for.
Definition HeatOverrideData.hpp:96
Central, reentrant simulation context.
Definition SimulationContext.hpp:353