OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SurfaceExchange.hpp File Reference

Phase H2 — latent and sensible heat exchange at the water surface (heat plan §2.1; CSHComponent §4.4–4.5). More...

Include dependency graph for SurfaceExchange.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 
namespace  openswmm::transport::heat
 

Functions

double openswmm::transport::heat::saturationVapourPressure (double t_c) noexcept
 Saturation vapour pressure over water at t_c degrees Celsius [kPa].
 
double openswmm::transport::heat::latentHeatOfVaporization (double t_c) noexcept
 
double openswmm::transport::heat::windFunction (double wind_ms, double a, double b) noexcept
 Mass-transfer wind function a + b·w, w in m/s [m/s/kPa].
 
double openswmm::transport::heat::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.
 
double openswmm::transport::heat::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.
 
double openswmm::transport::heat::bowenRatio (double t_water_c, double t_air_c, double humidity_pct, double pressure_ratio) noexcept
 
double openswmm::transport::heat::sensibleFlux (double latent_flux, double bowen_ratio) noexcept
 Sensible heat flux [W/m²], POSITIVE out of the water.
 
double openswmm::transport::heat::airTempCelsius (const SimulationContext &ctx) noexcept
 
double openswmm::transport::heat::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].
 
double openswmm::transport::heat::equilibriumT (double t0_c, double j0, double j1, double h) noexcept
 
double openswmm::transport::heat::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²].
 

Variables

constexpr double openswmm::transport::heat::kBowenCoeff = 0.061
 Bowen's coefficient, kPa/°C (CSH §4.5).
 
constexpr double openswmm::transport::heat::kProbeC = 1.0e-3
 
constexpr double openswmm::transport::heat::kSqFtToSqM = 0.09290304
 ft² → m². Exported with relaxT, which is useless without it.
 
constexpr double openswmm::transport::heat::kCuFtToCuM = 0.028316846592
 ft³ → m³.
 
constexpr double openswmm::transport::heat::kMphToMs = 0.44704
 mph → m/s. ClimateState::wind_speed is mph.
 

Detailed Description

Phase H2 — latent and sensible heat exchange at the water surface (heat plan §2.1; CSHComponent §4.4–4.5).

The formulations are exposed as PURE FUNCTIONS above the engine binding on purpose: they are the part with published reference values (CSH Table 4.1, Dingman 2008, Martin & McCutcheon 1998), so they can be gated against numbers from outside this codebase rather than against the engine's own output.

  • e_s(T) = 0.61275 exp(17.27 T / (237.3 + T)) [kPa]
  • Le(T) = 1000 (2499 − 2.36 T) [J/kg]
  • f(w) = a + b w [m/s/kPa]
  • E = f(w) (e_s(Tw) − e_a) [m/s]
  • Je = ρw Le E [W/m²]
  • Br = CB (Pa/P) (Tw − Ta) / (e_s(Tw) − e_a)
  • Jc = Br Je [W/m²]
Sign convention
Je and Jc are positive when heat LEAVES the water — evaporation cools. The governing equation (plan §1) carries them as − (Je + Jc) / Y, and relaxT applies that sign, so a caller never has to remember it.
Which surfaces exchange, and why that question has a precedent
Heat crosses the free surface exactly where evaporation does, so this module uses the ENGINE'S OWN evaporation surfaces rather than a new area model:
  • storage nodes → node::getSurfArea (Routing.cpp:490),
  • open conduits → xsect::getWofY(y) · length · barrels (Routing.cpp:597, DynamicWave.cpp:2028),
  • junctions, outfalls, dividers and CLOSED conduits → no free surface, no exchange (legacy's convention: getSurfArea returns 0 for them and xsect::isOpen gates the conduit branch). Both of those are solver-independent — initNodeFlows and computeConduitLosses run under every routing model — which is what keeps this module from silently doing nothing under STEADY or KINWAVE. That was the open question when H2 was scoped.
Units
The engine is foot-second internally; these formulations are SI. Conversion happens once, at the binding, and is named kSqFtToSqM / kCuFtToCuM rather than folded into a magic number.
See also
plans/transport/HEAT_TRANSPORT_PLAN.md §2.1, §2.4, §6 H2
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0